diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-02-08 13:05:28 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-02-09 19:44:53 +0100 |
commit | a254dc12a48f7b9fb154057111feaa5b93434e11 (patch) | |
tree | 0a0063c37a45a96b13ccfd02090b6f923331b73a /components/style/stylesheet_set.rs | |
parent | 438251cbfc30d7f8f868815012831c4b8f759943 (diff) | |
download | servo-a254dc12a48f7b9fb154057111feaa5b93434e11.tar.gz servo-a254dc12a48f7b9fb154057111feaa5b93434e11.zip |
style: Move author-style-disabled handling to push_applicable_declarations.
This will make it easier to handle it properly for Shadow DOM, though this patch
doesn't do that.
This also makes some method inline and infallible for convenience, since nobody
checks the errors anyway.
Bug: 1436798
Reviewed-by: bholley
MozReview-Commit-ID: Hq3erAUs5tf
Diffstat (limited to 'components/style/stylesheet_set.rs')
-rw-r--r-- | components/style/stylesheet_set.rs | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index 0277842262e..eeb75e738e6 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -124,16 +124,6 @@ impl Default for DataValidity { } } -/// Whether author styles are enabled. -/// -/// This is used to support Gecko. -#[allow(missing_docs)] -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub enum AuthorStylesEnabled { - Yes, - No, -} - /// A struct to iterate over the different stylesheets to be flushed. pub struct StylesheetFlusher<'a, S> where @@ -142,7 +132,6 @@ where origins_dirty: OriginSet, collections: &'a mut PerOrigin<SheetCollection<S>>, origin_data_validity: PerOrigin<DataValidity>, - author_styles_enabled: AuthorStylesEnabled, had_invalidations: bool, } @@ -209,14 +198,6 @@ where "origin_data_validity should be a subset of origins_dirty!" ); - if self.author_styles_enabled == AuthorStylesEnabled::No && - origin == Origin::Author - { - return PerOriginFlusher { - iter: [].iter_mut(), - validity, - } - } PerOriginFlusher { iter: self.collections.borrow_mut_for_origin(&origin).entries.iter_mut(), validity, @@ -411,9 +392,6 @@ where /// The invalidations for stylesheets added or removed from this document. invalidations: StylesheetInvalidationSet, - - /// Whether author styles are enabled. - author_styles_enabled: AuthorStylesEnabled, } impl<S> DocumentStylesheetSet<S> @@ -425,7 +403,6 @@ where Self { collections: Default::default(), invalidations: StylesheetInvalidationSet::new(), - author_styles_enabled: AuthorStylesEnabled::Yes, } } @@ -510,18 +487,6 @@ where self.collections.borrow_mut_for_origin(&origin).remove(&sheet) } - /// Notes that the author style has been disabled for this document. - pub fn set_author_styles_enabled(&mut self, enabled: AuthorStylesEnabled) { - debug!("DocumentStylesheetSet::set_author_styles_enabled"); - if self.author_styles_enabled == enabled { - return; - } - self.author_styles_enabled = enabled; - self.invalidations.invalidate_fully(); - self.collections.borrow_mut_for_origin(&Origin::Author) - .set_data_validity_at_least(DataValidity::FullyInvalid) - } - /// Returns whether the given set has changed from the last flush. pub fn has_changed(&self) -> bool { self.collections.iter_origins().any(|(collection, _)| collection.dirty) @@ -560,7 +525,6 @@ where StylesheetFlusher { collections: &mut self.collections, - author_styles_enabled: self.author_styles_enabled, had_invalidations, origins_dirty, origin_data_validity, |