style: Update CSSOM for layer rules to the spec

Pretty mechanical.

Tests are in https://wpt.live/css/css-cascade/layer-rules-cssom.html
which (with a fix for @import tests which I'll submit separately) we
pass.

Sync for that is bug 1743936.

Differential Revision: https://phabricator.services.mozilla.com/D133387
This commit is contained in:
Emilio Cobos Álvarez 2023-06-06 17:30:03 +02:00 committed by Oriol Brufau
parent 1ac55889bb
commit dff8f78c42
9 changed files with 155 additions and 141 deletions

View file

@ -541,6 +541,7 @@ impl StylesheetInvalidationSet {
Page(..) |
Viewport(..) |
FontFeatureValues(..) |
LayerStatement(..) |
FontFace(..) |
Keyframes(..) |
ScrollTimeline(..) |
@ -556,7 +557,7 @@ impl StylesheetInvalidationSet {
self.collect_invalidations_for_rule(rule, guard, device, quirks_mode)
},
Document(..) | Import(..) | Media(..) | Supports(..) | Layer(..) => {
Document(..) | Import(..) | Media(..) | Supports(..) | LayerBlock(..) => {
if !is_generic_change &&
!EffectiveRules::is_effective(guard, device, quirks_mode, rule)
{
@ -597,7 +598,8 @@ impl StylesheetInvalidationSet {
}
}
},
Document(..) | Namespace(..) | Import(..) | Media(..) | Supports(..) | Layer(..) => {
Document(..) | Namespace(..) | Import(..) | Media(..) | Supports(..) |
LayerStatement(..) | LayerBlock(..) => {
// Do nothing, relevant nested rules are visited as part of the
// iteration.
},