Bug 2070503 - Use an empty atom to store the universal name of PtNameAndClassSelectors. r=#style - #361
Bug 2070503 - Use an empty atom to store the universal name of PtNameAndClassSelectors. r=#style#361emilio wants to merge 1 commit into
Conversation
…AndClassSelectors. r=#style Since "*" is a real name if escaped. This fixes the tests in web-platform-tests/wpt#62480
|
View this pull request in Lando to land it once approved. |
|
No new issues detected. This pull request is 🆗 |
There was a problem hiding this comment.
🟡 Changes recommended
The current diff introduces a Rust move-from-borrow issue (*name where name: &Atom), which should fail to compile.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the internal representation of the universal <pt-name-selector> for PtNameAndClassSelector so that "*" can be treated as a valid escaped custom-ident, aligning parsing/serialization with the CSS View Transitions selector grammar and fixing related WPT expectations.
Changes:
- Introduce a dedicated
UNIVERSAL_NAMEsentinel atom (empty atom) to represent the universal selector internally. - Update parsing to map
*toUNIVERSAL_NAMEand update matching/specificity checks to compare againstUNIVERSAL_NAME. - Update serialization to emit
*when the stored name isUNIVERSAL_NAME.
File summaries
| File | Description |
|---|---|
| servo/components/style/gecko/pseudo_element.rs | Switch universal selector storage from "*" to an empty-atom sentinel and adjust parsing/serialization/matching accordingly. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| let name = self.name(); | ||
| if name == &atom!("*") { | ||
| // serialize_atom_identifier() may serialize "*" as "\*", so we handle it separately. | ||
| if *name == Self::UNIVERSAL_NAME { |
There was a problem hiding this comment.
What are you saying? It totally builds :)
| // Use the universal selector as the first element to present the part of | ||
| // `<pt-name-selector>` because they are equivalent (and the serialization is the same). |
|
Ugh, the copilot thingie was a misclick when manually adding the reviewers, sorry for the noise :( |
|
Pull request closed by commit 77a4943 |
…AndClassSelectors. r=dshin Since "*" is a real name if escaped. This fixes the tests in web-platform-tests/wpt#62480 Pull request: #361
…AndClassSelectors. r=dshin Since "*" is a real name if escaped. This fixes the tests in web-platform-tests/wpt#62480 Pull request: mozilla-firefox/firefox#361
Since "*" is a real name if escaped.
This fixes the tests in web-platform-tests/wpt#62480
Lando: link
Bugzilla: bug 2070503
🚫 This pull request has 1 blocker.