style: Introduce AuthorStyleSheetSet. draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 08 Feb 2018 16:03:47 +0100
changeset 752879 8780ab850260b459dcfeeaea2239de755b385d9c
parent 752878 c3267da3c9f40c103db799c4108eeed6f58bad4d
push id98405
push userbmo:emilio@crisal.io
push dateFri, 09 Feb 2018 01:50:06 +0000
milestone60.0a1
style: Introduce AuthorStyleSheetSet. MozReview-Commit-ID: K3ciocPJuz3
servo/components/style/stylesheet_set.rs
--- a/servo/components/style/stylesheet_set.rs
+++ b/servo/components/style/stylesheet_set.rs
@@ -582,8 +582,34 @@ where
         for origin in origins.iter() {
             // We don't know what happened, assume the worse.
             self.collections
                 .borrow_mut_for_origin(&origin)
                 .set_data_validity_at_least(DataValidity::FullyInvalid);
         }
     }
 }
+
+/// The set of stylesheets effective for a given XBL binding or Shadow Root.
+pub struct AuthorStylesheetSet<S>
+where
+    S: StylesheetInDocument + PartialEq + 'static,
+{
+    /// The actual style sheets.
+    collection: SheetCollection<S>,
+    /// The set of invalidations scheduled for this collection.
+    invalidations: StylesheetInvalidationSet,
+}
+
+impl<S> AuthorStylesheetSet<S>
+where
+    S: StylesheetInDocument + PartialEq + 'static,
+{
+    fn collection_for(
+        &mut self,
+        _sheet: &S,
+        _guard: &SharedRwLockReadGuard,
+    ) -> &mut SheetCollection<S> {
+        &mut self.collection
+    }
+
+    sheet_set_methods!("AuthorStylesheetSet");
+}