summaryrefslogtreecommitdiffstats
path: root/servo/components/selectors/context.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/selectors/context.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/selectors/context.rs')
-rw-r--r--servo/components/selectors/context.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/servo/components/selectors/context.rs b/servo/components/selectors/context.rs
index 289b081b64..c6870c6c96 100644
--- a/servo/components/selectors/context.rs
+++ b/servo/components/selectors/context.rs
@@ -70,6 +70,19 @@ impl VisitedHandlingMode {
}
}
+/// The mode to use whether we should matching rules inside @starting-style.
+/// https://drafts.csswg.org/css-transitions-2/#starting-style
+#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+pub enum IncludeStartingStyle {
+ /// All without rules inside @starting-style. This is for the most common case because the
+ /// primary/pseudo styles doesn't use rules inside @starting-style.
+ No,
+ /// Get the starting style. The starting style for an element as the after-change style with
+ /// @starting-style rules applied in addition. In other words, this matches all rules,
+ /// including rules inside @starting-style.
+ Yes,
+}
+
/// Whether we need to set selector invalidation flags on elements for this
/// match request.
#[derive(Clone, Copy, Debug, PartialEq)]
@@ -191,6 +204,12 @@ where
/// Controls how matching for links is handled.
visited_handling: VisitedHandlingMode,
+ /// Controls if we should match rules in @starting-style.
+ pub include_starting_style: IncludeStartingStyle,
+
+ /// Whether there are any rules inside @starting-style.
+ pub has_starting_style: bool,
+
/// The current nesting level of selectors that we're matching.
nesting_level: usize,
@@ -239,6 +258,7 @@ where
bloom_filter,
selector_caches,
VisitedHandlingMode::AllLinksUnvisited,
+ IncludeStartingStyle::No,
quirks_mode,
needs_selector_flags,
matching_for_invalidation,
@@ -251,6 +271,7 @@ where
bloom_filter: Option<&'a BloomFilter>,
selector_caches: &'a mut SelectorCaches,
visited_handling: VisitedHandlingMode,
+ include_starting_style: IncludeStartingStyle,
quirks_mode: QuirksMode,
needs_selector_flags: NeedsSelectorFlags,
matching_for_invalidation: MatchingForInvalidation,
@@ -259,6 +280,8 @@ where
matching_mode,
bloom_filter,
visited_handling,
+ include_starting_style,
+ has_starting_style: false,
quirks_mode,
classes_and_ids_case_sensitivity: quirks_mode.classes_and_ids_case_sensitivity(),
needs_selector_flags,