diff --git a/servo/components/style/properties/computed_value_flags.rs b/servo/components/style/properties/computed_value_flags.rs index 6e66f7bc2e3b..8c6d0f74caa7 100644 --- a/servo/components/style/properties/computed_value_flags.rs +++ b/servo/components/style/properties/computed_value_flags.rs @@ -126,6 +126,9 @@ bitflags! { /// Whether there are author-specific rules for text `color`. const HAS_AUTHOR_SPECIFIED_TEXT_COLOR = 1 << 25; + + /// Whether this style considered a scope style rule. + const CONSIDERED_SCOPED_STYLE = 1 << 26; } } @@ -158,7 +161,8 @@ 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_SCOPED_STYLE } /// Returns the flags that are always propagated to descendants. diff --git a/servo/components/style/stylist.rs b/servo/components/style/stylist.rs index 67d7753f63b8..c34a55ca5d48 100644 --- a/servo/components/style/stylist.rs +++ b/servo/components/style/stylist.rs @@ -2862,6 +2862,8 @@ impl CascadeData { element: E, context: &mut MatchingContext, ) -> ScopeProximity { + context.extra_data.cascade_input_flags.insert(ComputedValueFlags::CONSIDERED_SCOPED_STYLE); + let candidates = self.scope_condition_matches( rule.scope_condition_id, stylist,