Bug 1341721 Part 2b: Add a bool property to PerDocumentStyleDataImpl.
MozReview-Commit-ID: FiXyEN4xVnU
--- a/servo/components/style/gecko/data.rs
+++ b/servo/components/style/gecko/data.rs
@@ -27,16 +27,19 @@ pub struct PerDocumentStyleDataImpl {
pub stylist: Arc<Stylist>,
/// List of stylesheets, mirrored from Gecko.
pub stylesheets: Vec<Arc<Stylesheet>>,
/// 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.
pub new_animations_sender: Sender<Animation>,
/// Unused. Will go away when we actually implement transitions and
/// animations properly.
pub new_animations_receiver: Receiver<Animation>,
/// Unused. Will go away when we actually implement transitions and
@@ -60,16 +63,17 @@ impl PerDocumentStyleData {
let device = Device::new(pres_context);
let (new_anims_sender, new_anims_receiver) = channel();
PerDocumentStyleData(AtomicRefCell::new(PerDocumentStyleDataImpl {
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())),
expired_animations: Arc::new(RwLock::new(HashMap::new())),
font_faces: vec![],
}))
}
--- a/servo/components/style/gecko_bindings/bindings.rs
+++ b/servo/components/style/gecko_bindings/bindings.rs
@@ -1516,17 +1516,18 @@ extern "C" {
RawServoStyleSheetBorrowed,
flush: bool);
}
extern "C" {
pub fn Servo_StyleSet_FlushStyleSheets(set: RawServoStyleSetBorrowed);
}
extern "C" {
pub fn Servo_StyleSet_NoteStyleSheetsChanged(set:
- RawServoStyleSetBorrowed);
+ RawServoStyleSetBorrowed,
+ author_style_disabled: bool);
}
extern "C" {
pub fn Servo_StyleSet_FillKeyframesForName(set: RawServoStyleSetBorrowed,
property: *const nsACString,
timing_function:
nsTimingFunctionBorrowed,
computed_values:
ServoComputedValuesBorrowed,
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -594,19 +594,21 @@ pub extern "C" fn Servo_StyleSet_RemoveS
pub extern "C" fn Servo_StyleSet_FlushStyleSheets(raw_data: RawServoStyleSetBorrowed) {
let global_style_data = &*GLOBAL_STYLE_DATA;
let guard = global_style_data.shared_lock.read();
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
data.flush_stylesheets(&guard);
}
#[no_mangle]
-pub extern "C" fn Servo_StyleSet_NoteStyleSheetsChanged(raw_data: RawServoStyleSetBorrowed) {
+pub extern "C" fn Servo_StyleSet_NoteStyleSheetsChanged(raw_data: RawServoStyleSetBorrowed,
+ author_style_disabled: bool) {
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
data.stylesheets_changed = true;
+ data.author_style_disabled = author_style_disabled;
}
#[no_mangle]
pub extern "C" fn Servo_StyleSheet_HasRules(raw_sheet: RawServoStyleSheetBorrowed) -> bool {
let global_style_data = &*GLOBAL_STYLE_DATA;
let guard = global_style_data.shared_lock.read();
!Stylesheet::as_arc(&raw_sheet).rules.read_with(&guard).0.is_empty()
}