summaryrefslogtreecommitdiffstats
path: root/servo/components/style/selector_map.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /servo/components/style/selector_map.rs
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'servo/components/style/selector_map.rs')
-rw-r--r--servo/components/style/selector_map.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/servo/components/style/selector_map.rs b/servo/components/style/selector_map.rs
index 2b8d6add55..439fd414a6 100644
--- a/servo/components/style/selector_map.rs
+++ b/servo/components/style/selector_map.rs
@@ -330,6 +330,10 @@ impl SelectorMap<Rule> {
) where
E: TElement,
{
+ use selectors::matching::IncludeStartingStyle;
+
+ let include_starting_style =
+ matches!(matching_context.include_starting_style, IncludeStartingStyle::Yes);
for rule in rules {
if !matches_selector(
&rule.selector,
@@ -352,6 +356,17 @@ impl SelectorMap<Rule> {
}
}
+ if rule.is_starting_style {
+ // Set this flag if there are any rules inside @starting-style. This flag is for
+ // optimization to avoid any redundant resolution of starting style if the author
+ // doesn't specify for this element.
+ matching_context.has_starting_style = true;
+
+ if !include_starting_style {
+ continue;
+ }
+ }
+
matching_rules.push(rule.to_applicable_declaration_block(cascade_level, cascade_data));
}
}