From a5ac55c8ff0c572fc1dcdb9b420720828d0c18d4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 4 Jan 2017 13:40:19 -0500 Subject: [PATCH] Bug 1298588 part 4, servo piece. Recreate the default computed values for a document as needed. r=bholley --- components/style/gecko_bindings/bindings.rs | 6 ++++++ ports/geckolib/glue.rs | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 0f7da774c8e..83350c3d389 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -1160,6 +1160,12 @@ extern "C" { pub fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextBorrowed) -> RawServoStyleSetOwned; } +extern "C" { + pub fn Servo_StyleSet_RecomputeDefaultStyles(set: + RawServoStyleSetBorrowed, + pres_context: + RawGeckoPresContextBorrowed); +} extern "C" { pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed, sheet: RawServoStyleSheetBorrowed, diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index c5c0733a5c5..9758c696797 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -608,6 +608,14 @@ pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextBorrowed) data.into_ffi() } +#[no_mangle] +pub extern "C" fn Servo_StyleSet_RecomputeDefaultStyles( + raw_data: RawServoStyleSetBorrowed, + pres_context: RawGeckoPresContextBorrowed) { + let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); + data.default_computed_values = ComputedValues::default_values(pres_context); +} + #[no_mangle] pub extern "C" fn Servo_StyleSet_Drop(data: RawServoStyleSetOwned) -> () { let _ = data.into_box::();