Closed Bug 2080496 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63486 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=326937

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63486 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63486
Details from upstream follow.

Ahmad Saleem <ahmad.saleem792+github@gmail.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=326937

WebKit export from bug: Implicit @scope in a constructed stylesheet adopted by a document matches nothing

<pre>
Implicit @scope in a constructed stylesheet adopted by a document matches nothing

Per [1], "if no such element exists and the containing node tree is a shadow
tree, then the scoping root is the shadow host. Otherwise, the scoping root is
the root of the containing node tree." For a constructed stylesheet adopted by
a document, that is the Document. ElementRuleCollector only produced implicit
scoping roots for shadow root adopters, so nothing in such a sheet matched.

Use the Document as the scoping root. Since scoped selectors are relative, "with
the scoping root and descendant combinator implied at the start" [2],
SelectorChecker's descendant and child combinator walks now treat reaching a
Document scoping root as matching a lone :scope (or :where(:scope), which is
what & resolves to). Every element "that is an inclusive descendant of the
scoping root" [3] is therefore in scope, including the root element, while
:scope itself still matches no element.

[1] <a href="https://drafts.csswg.org/css-cascade-6/#scope-limits">https://drafts.csswg.org/css-cascade-6/#scope-limits</a>
[2] <a href="https://drafts.csswg.org/css-cascade-6/#scoped-rules">https://drafts.csswg.org/css-cascade-6/#scoped-rules</a>
[3] <a href="https://drafts.csswg.org/css-cascade-6/#scope-atrule">https://drafts.csswg.org/css-cascade-6/#scope-atrule</a>

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=326937">https://bugs.webkit.org/show_bug.cgi?id=326937</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/323237@main">https://commits.webkit.org/323237@main</a>
</pre>

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 162 tests

Status Summary

Firefox

OK : 1[GitHub] 105[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 7[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 12[GitHub] 1612[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 1652[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 1659[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 2[GitHub] 19[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 22[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 1
PASS: 3
FAIL: 11

Safari

OK : 1
PASS: 4
FAIL: 10

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.