aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/properties/computed_value_flags.rs
diff options
context:
space:
mode:
authorDavid Shin <dshin@mozilla.com>2023-05-25 14:35:18 +0000
committerMartin Robinson <mrobinson@igalia.com>2023-11-24 08:57:14 +0100
commitff8100d3963ac88fa0001bec40472134dbb4394b (patch)
tree7f6485012d046f07afd2cc7eda7f8b44b8a214c6 /components/style/properties/computed_value_flags.rs
parent5c0897c8eb6ef789dd14918b9b427935a244a847 (diff)
downloadservo-ff8100d3963ac88fa0001bec40472134dbb4394b.tar.gz
servo-ff8100d3963ac88fa0001bec40472134dbb4394b.zip
style: Correct style sharing handling for any element that considered `:has()` in selector matching
For any element that anchors a `:has()` selector (i.e. Matches a selector that contains a `:has()` on its rightmost side), we prevent style sharing altogether, as evaluation of the `:has()` selector is required in the first place to determine style sharing. On the other hand, any element matching a rule containing `:has()` without anchoring it can do style sharing for siblings, but not cousins. Differential Revision: https://phabricator.services.mozilla.com/D176836
Diffstat (limited to 'components/style/properties/computed_value_flags.rs')
-rw-r--r--components/style/properties/computed_value_flags.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/style/properties/computed_value_flags.rs b/components/style/properties/computed_value_flags.rs
index 9b834efc222..d84311de084 100644
--- a/components/style/properties/computed_value_flags.rs
+++ b/components/style/properties/computed_value_flags.rs
@@ -118,6 +118,9 @@ bitflags! {
/// A flag used to mark styles which have `container-type` of `size` or
/// `inline-size`, or under one.
const SELF_OR_ANCESTOR_HAS_SIZE_CONTAINER_TYPE = 1 << 23;
+
+ /// Whether the style evaluated any relative selector.
+ const CONSIDERED_RELATIVE_SELECTOR = 1 << 24;
}
}
@@ -150,7 +153,7 @@ impl ComputedValueFlags {
/// Flags that are an input to the cascade.
#[inline]
fn cascade_input_flags() -> Self {
- Self::USES_VIEWPORT_UNITS_ON_CONTAINER_QUERIES
+ Self::USES_VIEWPORT_UNITS_ON_CONTAINER_QUERIES | Self::CONSIDERED_RELATIVE_SELECTOR
}
/// Returns the flags that are always propagated to descendants.