Revert changes in sheet_set_methods macro

This commit is contained in:
Fernando Jiménez Moreno 2019-03-07 17:33:26 +01:00
parent efbfc0f939
commit 0ca4792dc6

View file

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