Auto merge of #16365 - bradwerth:authoredStyle, r=heycam

Stylo: Add a bool property to PerDocumentStyleDataImpl, and pass the …

https://bugzilla.mozilla.org/show_bug.cgi?id=1341721
https://reviewboard.mozilla.org/r/121214/
r=heycam

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16365)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-13 21:23:07 -05:00 committed by GitHub
commit 605637fe1d
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);