Skip to content

Bug 2070503 - Use an empty atom to store the universal name of PtNameAndClassSelectors. r=#style - #361

Closed
emilio wants to merge 1 commit into
mozilla-firefox:autolandfrom
emilio:universal-name-view-transition
Closed

emilio wants to merge 1 commit into
mozilla-firefox:autolandfrom
emilio:universal-name-view-transition

Conversation

@emilio

@emilio emilio commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

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 4 warnings.
🚫 This pull request has 1 blocker.

…AndClassSelectors. r=#style

Since "*" is a real name if escaped.

This fixes the tests in web-platform-tests/wpt#62480
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

View this pull request in Lando to land it once approved.

@mozilla-code-review

Copy link
Copy Markdown

No new issues detected. This pull request is 🆗

@emilio
emilio requested review from a team and a lite review from Copilot September 9, 2026 13:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_NAME sentinel atom (empty atom) to represent the universal selector internally.
  • Update parsing to map * to UNIVERSAL_NAME and update matching/specificity checks to compare against UNIVERSAL_NAME.
  • Update serialization to emit * when the stored name is UNIVERSAL_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 {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you saying? It totally builds :)

Comment on lines +190 to 191
// 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).
@emilio

emilio commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Ugh, the copilot thingie was a misclick when manually adding the reviewers, sorry for the noise :(

@lando-worker

lando-worker Bot commented Sep 9, 2026

Copy link
Copy Markdown

Pull request closed by commit 77a4943

lando-worker Bot pushed a commit that referenced this pull request Sep 9, 2026
…AndClassSelectors. r=dshin

Since "*" is a real name if escaped.

This fixes the tests in web-platform-tests/wpt#62480

Pull request: #361
@lando-worker lando-worker Bot closed this Sep 9, 2026
github-actions Bot pushed a commit to DioxusLabs/stylo that referenced this pull request Sep 10, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants