diff options
Diffstat (limited to 'components/style')
-rw-r--r-- | components/style/author_styles.rs | 1 | ||||
-rw-r--r-- | components/style/stylesheet_set.rs | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/components/style/author_styles.rs b/components/style/author_styles.rs index 37eb68ff4f7..eff64ed6c1e 100644 --- a/components/style/author_styles.rs +++ b/components/style/author_styles.rs @@ -18,6 +18,7 @@ use crate::stylist::CascadeData; /// A set of author stylesheets and their computed representation, such as the /// ones used for ShadowRoot and XBL. +#[derive(MallocSizeOf)] pub struct AuthorStyles<S> where S: StylesheetInDocument + PartialEq + 'static, diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index 409978c3a9e..d2c3ad0f88e 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -585,6 +585,16 @@ where self.collection.len() == 0 } + /// Returns the `index`th stylesheet in the collection of author styles if present. + pub fn get(&self, index: usize) -> Option<&S> { + self.collection.get(index) + } + + /// Returns the number of author stylesheets. + pub fn len(&self) -> usize { + self.collection.len() + } + fn collection_for( &mut self, _sheet: &S, |