diff options
Diffstat (limited to 'components/style/stylesheet_set.rs')
-rw-r--r-- | components/style/stylesheet_set.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index d2c3ad0f88e..5e72f7a219f 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -468,7 +468,14 @@ where .fold(0, |s, (item, _)| s + item.len()) } + /// Returns the count of stylesheets for a given origin. + #[inline] + pub fn sheet_count(&self, origin: Origin) -> usize { + self.collections.borrow_for_origin(&origin).len() + } + /// Returns the `index`th stylesheet in the set for the given origin. + #[inline] pub fn get(&self, origin: Origin, index: usize) -> Option<&S> { self.collections.borrow_for_origin(&origin).get(index) } |