diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2023-06-18 13:06:43 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-08-16 17:46:41 +0200 |
commit | a2a4ec6ffb8051e522dd9a1a3c5f4f7b958c713e (patch) | |
tree | 28ef838a61e19b08c84643835c340b2d67a1e614 /components/style/sharing/mod.rs | |
parent | 46978b2543e1515c4dcac0e936585aaeed67007a (diff) | |
download | servo-a2a4ec6ffb8051e522dd9a1a3c5f4f7b958c713e.tar.gz servo-a2a4ec6ffb8051e522dd9a1a3c5f4f7b958c713e.zip |
style: Simplify selector flag setting now that flag setting is atomic
These bits are write-only, actually, and we don't even need to read
them.
Differential Revision: https://phabricator.services.mozilla.com/D141888
Diffstat (limited to 'components/style/sharing/mod.rs')
-rw-r--r-- | components/style/sharing/mod.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/components/style/sharing/mod.rs b/components/style/sharing/mod.rs index 50eb51fba35..749504972a7 100644 --- a/components/style/sharing/mod.rs +++ b/components/style/sharing/mod.rs @@ -66,9 +66,8 @@ use crate::applicable_declarations::ApplicableDeclarationBlock; use crate::bloom::StyleBloom; -use crate::context::{SelectorFlagsMap, SharedStyleContext, StyleContext}; +use crate::context::{SharedStyleContext, StyleContext}; use crate::dom::{SendElement, TElement}; -use crate::matching::MatchMethods; use crate::properties::ComputedValues; use crate::rule_tree::StrongRuleNode; use crate::style_resolver::{PrimaryStyle, ResolvedElementStyles}; @@ -384,7 +383,6 @@ impl<E: TElement> StyleSharingTarget<E> { stylist: &Stylist, bloom: &StyleBloom<E>, nth_index_cache: &mut NthIndexCache, - selector_flags_map: &mut SelectorFlagsMap<E>, ) -> &SmallBitVec { // It's important to set the selector flags. Otherwise, if we succeed in // sharing the style, we may not set the slow selector flags for the @@ -401,9 +399,8 @@ impl<E: TElement> StyleSharingTarget<E> { // The style sharing cache will get a hit for the second span. When the // child span is subsequently removed from the DOM, missing selector // flags would cause us to miss the restyle on the second span. - let element = self.element; let mut set_selector_flags = |el: &E, flags: ElementSelectorFlags| { - element.apply_selector_flags(selector_flags_map, el, flags); + el.apply_selector_flags(flags); }; self.validation_data.revalidation_match_results( @@ -423,7 +420,6 @@ impl<E: TElement> StyleSharingTarget<E> { ) -> Option<ResolvedElementStyles> { let cache = &mut context.thread_local.sharing_cache; let shared_context = &context.shared; - let selector_flags_map = &mut context.thread_local.selector_flags; let bloom_filter = &context.thread_local.bloom_filter; let nth_index_cache = &mut context.thread_local.nth_index_cache; @@ -443,7 +439,6 @@ impl<E: TElement> StyleSharingTarget<E> { cache.share_style_if_possible( shared_context, - selector_flags_map, bloom_filter, nth_index_cache, self, @@ -667,7 +662,6 @@ impl<E: TElement> StyleSharingCache<E> { fn share_style_if_possible( &mut self, shared_context: &SharedStyleContext, - selector_flags_map: &mut SelectorFlagsMap<E>, bloom_filter: &StyleBloom<E>, nth_index_cache: &mut NthIndexCache, target: &mut StyleSharingTarget<E>, @@ -700,7 +694,6 @@ impl<E: TElement> StyleSharingCache<E> { &shared_context, bloom_filter, nth_index_cache, - selector_flags_map, shared_context, ) }) @@ -712,7 +705,6 @@ impl<E: TElement> StyleSharingCache<E> { shared: &SharedStyleContext, bloom: &StyleBloom<E>, nth_index_cache: &mut NthIndexCache, - selector_flags_map: &mut SelectorFlagsMap<E>, shared_context: &SharedStyleContext, ) -> Option<ResolvedElementStyles> { debug_assert!(!target.is_in_native_anonymous_subtree()); @@ -817,7 +809,6 @@ impl<E: TElement> StyleSharingCache<E> { shared, bloom, nth_index_cache, - selector_flags_map, ) { trace!("Miss: Revalidation"); return None; |