Add an author_style_disabled flag to stylist.update, and associated structs.

MozReview-Commit-ID: FiXyEN4xVnU
This commit is contained in:
Brad Werth 2017-04-11 15:48:38 +08:00 committed by Brad Werth
parent 54e691b2aa
commit 91a9fb06c7
5 changed files with 29 additions and 3 deletions

View file

@ -32,6 +32,9 @@ pub struct PerDocumentStyleDataImpl {
/// Whether the stylesheets list above has changed since the last restyle.
pub stylesheets_changed: bool,
/// Has author style been disabled?
pub author_style_disabled: bool,
// FIXME(bholley): Hook these up to something.
/// Unused. Will go away when we actually implement transitions and
/// animations properly.
@ -65,6 +68,7 @@ impl PerDocumentStyleData {
stylist: Arc::new(Stylist::new(device)),
stylesheets: vec![],
stylesheets_changed: true,
author_style_disabled: false,
new_animations_sender: new_anims_sender,
new_animations_receiver: new_anims_receiver,
running_animations: Arc::new(RwLock::new(HashMap::new())),
@ -103,6 +107,7 @@ impl PerDocumentStyleDataImpl {
let mut stylist = Arc::get_mut(&mut self.stylist).unwrap();
let mut extra_data = ExtraStyleData {
font_faces: &mut self.font_faces,
author_style_disabled: Some(self.author_style_disabled),
};
stylist.update(&self.stylesheets, &StylesheetGuards::same(guard),
None, true, &mut extra_data);