style: Fix style attribute important and revert-layer behavior

By modeling it as a separate layer that behaves somewhat specially.

See https://github.com/w3c/csswg-drafts/issues/6872.

The remaining revert-layer tests that we fail are because either we
don't implement a feature (like @property) or because it's used in
keyframes (where revert is a bit unspecified and we have existing
issues with it).

Differential Revision: https://phabricator.services.mozilla.com/D133373
This commit is contained in:
Emilio Cobos Álvarez 2023-06-06 17:28:49 +02:00 committed by Oriol Brufau
parent 5c0f044d39
commit 50510715a2
5 changed files with 67 additions and 31 deletions

View file

@ -11,7 +11,7 @@ use crate::rule_tree::{CascadeLevel, ShadowCascadeOrder};
use crate::selector_map::SelectorMap;
use crate::selector_parser::PseudoElement;
use crate::shared_lock::Locked;
use crate::stylesheets::Origin;
use crate::stylesheets::{layer_rule::LayerOrder, Origin};
use crate::stylist::{AuthorStylesEnabled, CascadeData, Rule, RuleInclusion, Stylist};
use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode};
use servo_arc::ArcBorrow;
@ -450,6 +450,7 @@ where
.push(ApplicableDeclarationBlock::from_declarations(
sa.clone_arc(),
CascadeLevel::same_tree_author_normal(),
LayerOrder::style_attribute(),
));
}
}
@ -460,6 +461,7 @@ where
.push(ApplicableDeclarationBlock::from_declarations(
so.clone_arc(),
CascadeLevel::SMILOverride,
LayerOrder::root(),
));
}
@ -471,6 +473,7 @@ where
.push(ApplicableDeclarationBlock::from_declarations(
anim,
CascadeLevel::Animations,
LayerOrder::root(),
));
}
@ -481,6 +484,7 @@ where
.push(ApplicableDeclarationBlock::from_declarations(
anim,
CascadeLevel::Transitions,
LayerOrder::root(),
));
}
}