style: Make AuthorStylesEnabled an enum.

Chances are we need to pass it around in a bit.

Also invert the boolean because I don't want to reason about double negations,
even if they're simple.

MozReview-Commit-ID: KhX4lDKwDoj
This commit is contained in:
Emilio Cobos Álvarez 2018-02-08 12:40:27 +01:00
parent 4cc5717116
commit 438251cbfc
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 33 additions and 20 deletions

View file

@ -41,7 +41,7 @@ use smallvec::SmallVec;
use std::ops;
use std::sync::Mutex;
use style_traits::viewport::ViewportConstraints;
use stylesheet_set::{DataValidity, SheetRebuildKind, DocumentStylesheetSet, StylesheetFlusher};
use stylesheet_set::{AuthorStylesEnabled, DataValidity, SheetRebuildKind, DocumentStylesheetSet, StylesheetFlusher};
#[cfg(feature = "gecko")]
use stylesheets::{CounterStyleRule, FontFaceRule, FontFeatureValuesRule, PageRule};
use stylesheets::{CssRule, Origin, OriginSet, PerOrigin, PerOriginIter};
@ -592,8 +592,8 @@ impl Stylist {
}
/// Sets whether author style is enabled or not.
pub fn set_author_style_disabled(&mut self, disabled: bool) {
self.stylesheets.set_author_style_disabled(disabled);
pub fn set_author_styles_enabled(&mut self, enabled: AuthorStylesEnabled) {
self.stylesheets.set_author_styles_enabled(enabled);
}
/// Returns whether we've recorded any stylesheet change so far.