Skip to content
Permalink
Browse files

Revert changes in sheet_set_methods macro

  • Loading branch information...
ferjm committed Mar 7, 2019
1 parent efbfc0f commit 0ca4792dc622029b807b40eee47cc38dd5d24e9a
Showing with 6 additions and 11 deletions.
  1. +6 −11 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>);

0 comments on commit 0ca4792

Please sign in to comment.
You can’t perform that action at this time.