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

@ -591,6 +591,18 @@ impl Stylist {
.remove_stylesheet(Some(&self.device), sheet, guard)
}
/// Appends a new stylesheet to the current set.
#[inline]
pub fn sheet_count(&self, origin: Origin) -> usize {
self.stylesheets.sheet_count(origin)
}
/// Appends a new stylesheet to the current set.
#[inline]
pub fn sheet_at(&self, origin: Origin, index: usize) -> Option<&StylistSheet> {
self.stylesheets.get(origin, index)
}
/// Returns whether for any of the applicable style rule data a given
/// condition is true.
pub fn any_applicable_rule_data<E, F>(&self, element: E, mut f: F) -> bool