[wpt-sync] Sync PR 56223 - Use unconnected RuleSets for duplicate contents with cascade layers
Categories
(Core :: CSS Parsing and Computation, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox147 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 56223 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/56223
Details from upstream follow.
Anders Hartvoll Ruud <andruud@chromium.org> wrote:
Use unconnected RuleSets for duplicate contents with cascade layers
We currently deduplicate shared StyleSheetContents during RuleSet-
building in order to avoid "collapsing" distinct anonymous layers
into one. This is done in a somewhat roundabout way with a "fake"
rule mutation event, but is otherwise not an unreasonable way
of handling it.However, it does not handle the case where the same CSSStyleSheet
instance appears in the list of active stylesheets (which can happen
when the same sheet is listed multiple times in adoptedStyleSheets).
The exact behavior is not handled explicitly by specs, but what we're
doing is not a reasonable default: other things in the RuleSet
(e.g. style rules, named constructs defined by at-rules) do "see"
the different orders when the same sheet is specified multiple times
(see examples in Issue 462744687). Layers are just inconsistent with
this.To address this, this CL tracks which StyleSheetContents we've already
seen (shared or otherwise), and adds an unconnected RuleSet for any
already-seen contents. (Unconnected RuleSets are one-off RuleSets that
ignore the RuleSet cache on StyleSheetContents). In sharing cases
(multiple CSSStyleSheets, same StyleSheetContents) this means we'll
cache less, but also deduplicate less. Under the assumption that
adding the same StyleSheetContents more than once is a rare corner case,
the performance characteristics of this seem unimportant anyway.This change aligns our behavior with Firefox and Safari.
Fixed: 462744687
Change-Id: I564f7598204227213bce5b9b8eeb62c77acd079b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7185810
Reviewed-by: Steinar H Gunderson \<sesse@chromium.org>
Commit-Queue: Anders Hartvoll Ruud \<andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1549143}
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
| Assignee | ||
Comment 2•1 year ago
|
||
CI Results
Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 146 tests
Status Summary
Firefox
OK : 1[GitHub] 92[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-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
PASS: 1[GitHub] 5[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 1506[Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt] 1545[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] 1552[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
FAIL: 20[Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt] 23[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-24h2-debug, Gecko-windows11-64-24h2-opt]
Chrome
OK : 1
FAIL: 1
Safari
OK : 1
PASS: 1
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /css/css-cascade/presentational-hints-rollback.html [wpt.fyi]
- #tests > * 7:
FAIL - #tests > * 15:
FAIL
- #tests > * 7:
- /css/css-cascade/revert-rule-basic.tentative.html [wpt.fyi]
- The revert-rule keyword rolls back to the previous rule:
FAIL - Cascade order determines the previous rule, not order of appearance:
FAIL - Reverting from style attribute reverts to regular rules:
FAIL - A chain of revert-rule works:
FAIL
- The revert-rule keyword rolls back to the previous rule:
- /css/css-cascade/revert-rule-layer.tentative.html [wpt.fyi]
- The revert-rule keyword can cross layers:
FAIL - The revert-rule does not unconditionally cross layers:
FAIL
- The revert-rule keyword can cross layers:
- /css/css-cascade/revert-val-006.html [wpt.fyi]
- The revert keyword works with @keyframes:
FAIL
- The revert keyword works with @keyframes:
- /css/css-cascade/revert-val-007.html [wpt.fyi]
- A @keyframe animation with revert works when applied to multiple identical elements:
FAIL
- A @keyframe animation with revert works when applied to multiple identical elements:
- /css/css-cascade/revert-val-008.html [wpt.fyi]
- The revert keyword works in the final frame of a web animation:
FAIL
- The revert keyword works in the final frame of a web animation:
- /css/css-cascade/revert-val-010.html [wpt.fyi]
- The revert works when appearing in setKeyframes:
FAIL
- The revert works when appearing in setKeyframes:
- /css/css-cascade/scope-import-implicit.tentative.html [wpt.fyi]
- Scope-imported rule applies within implicit scope:
FAIL
- Scope-imported rule applies within implicit scope:
- /css/css-cascade/scope-import-inner-scope.tentative.html [wpt.fyi]
- @scope within scope-imported stylesheet matches:
FAIL
- @scope within scope-imported stylesheet matches:
- /css/css-cascade/scope-import-multiple.tentative.html [wpt.fyi]
- A stylesheet may be imported multiple times, and scoped differently:
FAIL
- A stylesheet may be imported multiple times, and scoped differently:
- /css/css-cascade/scope-import-parent-pseudo.tentative.html [wpt.fyi]
- The & selector matches the scoping root:
FAIL - The & selector behaves like :scope:
FAIL
- The & selector matches the scoping root:
- /css/css-cascade/scope-import-scope-end.tentative.html [wpt.fyi]
- Scope-imported rule applies within scope, above limit:
FAIL
- Scope-imported rule applies within scope, above limit:
- /css/css-cascade/scope-import-scope-pseudo.tentative.html [wpt.fyi]
- The :scope pseudo-class works in imported stylesheets:
FAIL
- The :scope pseudo-class works in imported stylesheets:
- /css/css-cascade/scope-import-scope-start.tentative.html [wpt.fyi]
- Scope-imported rule applies within scope:
FAIL
- Scope-imported rule applies within scope:
- /css/css-cascade/all-prop-initial-visited.html [wpt.fyi]:
FAIL - /css/css-cascade/revert-layer-010.html [wpt.fyi]:
FAIL - /css/css-cascade/scope-visited.html [wpt.fyi]:
FAIL
Comment 4•11 months ago
|
||
| bugherder | ||
Description
•