mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
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
This commit is contained in:
parent
11153c63fa
commit
060d74ba3b
11 changed files with 175 additions and 178 deletions
|
@ -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>,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue