diff options
-rw-r--r-- | components/style/stylesheet_set.rs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index 4c3e37d3cd8..e668ba0d03d 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -441,12 +441,8 @@ where /// We could simplify the setup moving invalidations to SheetCollection, but /// that would imply not sharing invalidations across origins of the same /// documents, which is slightly annoying. -macro_rules! stylesheetset_impl { - ($set_name:expr, $set_type:ty) => { - impl<S> $set_type - where - S: StylesheetInDocument + PartialEq + 'static, - { +macro_rules! sheet_set_methods { + ($set_name:expr) => { fn collect_invalidations_for( &mut self, device: Option<&Device>, @@ -502,7 +498,6 @@ macro_rules! stylesheetset_impl { let collection = self.collection_for(&sheet, guard); collection.remove(&sheet) } - } }; } @@ -527,6 +522,8 @@ where self.collections.borrow_mut_for_origin(&origin) } + sheet_set_methods!("DocumentStylesheetSet"); + /// Returns the number of stylesheets in the set. pub fn len(&self) -> usize { self.collections @@ -605,8 +602,6 @@ where } } -stylesheetset_impl!("DocumentStylesheetSet", DocumentStylesheetSet<S>); - /// The set of stylesheets effective for a given XBL binding or Shadow Root. #[derive(MallocSizeOf)] pub struct AuthorStylesheetSet<S> @@ -671,6 +666,8 @@ where &mut self.collection } + sheet_set_methods!("AuthorStylesheetSet"); + /// Iterate over the list of stylesheets. pub fn iter(&self) -> StylesheetCollectionIterator<S> { self.collection.iter() @@ -702,5 +699,3 @@ where } } } - -stylesheetset_impl!("AuthorStylesheetSet", AuthorStylesheetSet<S>); |