diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-05-08 07:46:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 07:46:34 -0400 |
commit | ea71b3522061c48256ab1c5a27fb2db8f2607e0e (patch) | |
tree | 8744328a89c07011db8748a73b53af924281710c /components/style/stylesheet_set.rs | |
parent | 115a4ac4ff0c38fbe1c705e4aaa76d1dfcdeaab6 (diff) | |
parent | 1bb15d881951425dd62f5d5b3677a18d1019167d (diff) | |
download | servo-ea71b3522061c48256ab1c5a27fb2db8f2607e0e.tar.gz servo-ea71b3522061c48256ab1c5a27fb2db8f2607e0e.zip |
Auto merge of #23325 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.
See each individual commit for details.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23325)
<!-- Reviewable:end -->
Diffstat (limited to 'components/style/stylesheet_set.rs')
-rw-r--r-- | components/style/stylesheet_set.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index d2c3ad0f88e..d8c21d5494c 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) } @@ -539,7 +546,7 @@ where } } -/// The set of stylesheets effective for a given XBL binding or Shadow Root. +/// The set of stylesheets effective for a given Shadow Root. #[derive(MallocSizeOf)] pub struct AuthorStylesheetSet<S> where |