commit a8412391a99308054a19313ce40faa298ee7dd02
parent bab44fc04343c3ec6e3fd0e0490facf95d32a8c6
Author: Boris Chiou <boris.chiou@gmail.com>
Date: Fri, 14 Nov 2025 21:56:21 +0000
Bug 1999958 - Handle wildcard for selector_matches_element() for view transition. r=firefox-style-system-reviewers,emilio
Add the special handling when using `*` in the selector.
Differential Revision: https://phabricator.services.mozilla.com/D272565
Diffstat:
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs
@@ -2813,12 +2813,13 @@ where
Some(pseudo) => {
// We need to make sure that the requested pseudo element type
// matches the selector pseudo element type before proceeding.
- match selector.pseudo_element() {
- Some(selector_pseudo) if *selector_pseudo == pseudo => {
- matching_mode = MatchingMode::ForStatelessPseudoElement
- },
- _ => return None,
- };
+ let selector_pseudo = selector.pseudo_element()?;
+ // The element here is used to get the active view transition (for
+ // view-transition-class), so passing the originating element is fine here.
+ if !pseudo.matches(selector_pseudo, &element) {
+ return None;
+ }
+ matching_mode = MatchingMode::ForStatelessPseudoElement;
},
None => {
// Do not attempt to match if a pseudo element is requested and