[wpt-sync] Sync PR 45846 - [@scope] Treat kScopeActivation as a special kSubSelector
Categories
(Core :: CSS Parsing and Computation, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox127 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 45846 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/45846
Details from upstream follow.
Anders Hartvoll Ruud <andruud@chromium.org> wrote:
[@scope] Treat kScopeActivation as a special kSubSelector
The internal selector relation kScopeActivation is inserted by
the selector parser for selectors within @scope. This relation,
when encountered in the selector, basically figures out if we're
in scope [1], what the scoping roots are (there may be multiple),
and tries to match the rest of the selector with context.scope
set to those roots.However, kScopeActivation is not a combinator: it does not change
the current element being considered for matching. In this respect,
it's much like the kSubSelector relation. This CL treats it as
such in SelectorChecker::MatchSelector, by skipping the combinator-
related checks for exceeding the scope [2] and dynamic_pseudo
matching (i.e. exactly the same as kSubSelector).I've moved the handling of kScopeActivation to a separate function
(MatchForScopeActivation) to make it more clear that it's a special
case (like MatchForSubSelector), and not like the other relations.This fixes a bug where selectors with pseudo-elements within @scope
would match the originating element instead (due to missing
dynamic_pseudo).[1] https://drafts.csswg.org/css-cascade-6/#in-scope
[2] Although we already skipped this for kScopeActivation.Fixed: 335337303
Change-Id: I6f421c317c00efba5be8ca1407455f03e414a174
Reviewed-on: https://chromium-review.googlesource.com/5476369
WPT-Export-Revision: c82979ce5086a8692a19ad65ecd821c5c151d35d
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Comment 1•6 months ago
|
||
Assignee | ||
Comment 2•6 months ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests
Status Summary
Firefox
FAIL
: 1
Chrome
FAIL
: 1
Safari
PASS
: 1
Links
Details
New Tests That Don't Pass
- /css/css-cascade/scope-pseudo-element.html [wpt.fyi]:
FAIL
(Chrome:FAIL
, Safari:PASS
)
Comment 4•6 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4c6e58d3283d
https://hg.mozilla.org/mozilla-central/rev/51c96421eca2
Description
•