diff options
author | Oriol Brufau <obrufau@igalia.com> | 2023-05-16 09:51:46 +0200 |
---|---|---|
committer | Oriol Brufau <obrufau@igalia.com> | 2023-05-16 13:00:08 +0200 |
commit | 060d74ba3bcccf8ace74ac8d00c7589783a2a45d (patch) | |
tree | 24b80ad4e927ceb010e4ada41371dd3f6290c4fd /components/style/selector_map.rs | |
parent | 11153c63fa9d908355573722614a5bb8f23dac9a (diff) | |
download | servo-060d74ba3bcccf8ace74ac8d00c7589783a2a45d.tar.gz servo-060d74ba3bcccf8ace74ac8d00c7589783a2a45d.zip |
style: Share CascadeData instances across ShadowRoots
This should be both a memory and speed win for pages using a lot of
Shadow DOM.
In order to make the cache properly work we need to start keying media query
results on the actual StyleSheetContents, as that's what we share on Gecko, but
that should all be fine.
Differential Revision: https://phabricator.services.mozilla.com/D107266
Diffstat (limited to 'components/style/selector_map.rs')
-rw-r--r-- | components/style/selector_map.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/style/selector_map.rs b/components/style/selector_map.rs index 4ea8cc1a018..40806ed47af 100644 --- a/components/style/selector_map.rs +++ b/components/style/selector_map.rs @@ -94,7 +94,7 @@ pub trait SelectorMapEntry: Sized + Clone { /// * https://bugzilla.mozilla.org/show_bug.cgi?id=681755 /// /// TODO: Tune the initial capacity of the HashMap -#[derive(Debug, MallocSizeOf)] +#[derive(Clone, Debug, MallocSizeOf)] pub struct SelectorMap<T: 'static> { /// Rules that have `:root` selectors. pub root: SmallVec<[T; 1]>, @@ -615,7 +615,7 @@ fn find_bucket<'a>( } /// Wrapper for PrecomputedHashMap that does ASCII-case-insensitive lookup in quirks mode. -#[derive(Debug, MallocSizeOf)] +#[derive(Clone, Debug, MallocSizeOf)] pub struct MaybeCaseInsensitiveHashMap<K: PrecomputedHash + Hash + Eq, V: 'static>( PrecomputedHashMap<K, V>, ); |