mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
parent
098eb300ac
commit
c0b17cc844
4 changed files with 26 additions and 18 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue