style: Don't keep two list of stylesheets in ServoStyleSet.

Just one set of stylesheets is enough. While at it, unify SheetType and Origin.

Differential Revision: https://phabricator.services.mozilla.com/D27564
This commit is contained in:
Emilio Cobos Álvarez 2019-04-19 04:20:31 +00:00
parent 098eb300ac
commit c0b17cc844
4 changed files with 26 additions and 18 deletions

View file

@ -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)
}