Closed Bug 1763282 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 33525 - Always rebuild CascadeLayerMap if active style sheets changed

Categories

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

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Xiaocheng Hu <xiaochengh@chromium.org> wrote:

Always rebuild CascadeLayerMap if active style sheets changed

When active style sheets changed, StyleEngine::ApplyRuleSetChanges()
always resets the ScopedStyleResolver of a tree scope (which includes
clearing the CascadeLayerMap), but then rebuilds CascadeLayerMap only
if the changed rule sets include layer rules. This results in a bug that
if we change a rule set without layer rules, then all the existing
layers are cleared, and all the previously layered rules break into the
default layer.

This patch fixes it by rebuilding the CascadeLayerMap if active style
sheets have changed, regardless of whether the change has layer rules.

Fortunately, this bug does not apply to other name-defining at-rules.
Other at-rules are either directly managed on StyleEngine, or are
reinserted in AppendActiveStylesheets().

Fixed: 1313357
Change-Id: I702a6421416aea2634537b6d9650399b68e25f0a

Reviewed-on: https://chromium-review.googlesource.com/3572544
WPT-Export-Revision: 025a739aa6fe84c8038f63e6f3032d11168c17f2

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/34668c63d1a8
[wpt PR 33525] - Always rebuild CascadeLayerMap if active style sheets changed, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.