Bug 1889109: Part 2 - Mark all elements considering scoped styles. r=firefox-style-system-reviewers,emilio

This lets us avoid having to run scope matching for revalidation
for elements that don't match scoped styles.

Differential Revision: https://phabricator.services.mozilla.com/D212726
This commit is contained in:
David Shin 2024-07-15 18:41:13 +00:00
Родитель bd3588e245
Коммит 3da446ba63
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -2862,6 +2862,8 @@ impl CascadeData {
element: E,
context: &mut MatchingContext<E::Impl>,
) -> ScopeProximity {
context.extra_data.cascade_input_flags.insert(ComputedValueFlags::CONSIDERED_SCOPED_STYLE);
let candidates = self.scope_condition_matches(
rule.scope_condition_id,
stylist,