Bug 1298588 part 4, servo piece. Recreate the default computed values for a document as needed. r=bholley

This commit is contained in:
Boris Zbarsky 2017-01-04 13:40:19 -05:00
parent 34bb2f1e6c
commit a5ac55c8ff
2 changed files with 14 additions and 0 deletions

View file

@ -1160,6 +1160,12 @@ extern "C" {
pub fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextBorrowed) pub fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextBorrowed)
-> RawServoStyleSetOwned; -> RawServoStyleSetOwned;
} }
extern "C" {
pub fn Servo_StyleSet_RecomputeDefaultStyles(set:
RawServoStyleSetBorrowed,
pres_context:
RawGeckoPresContextBorrowed);
}
extern "C" { extern "C" {
pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed, pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed,
sheet: RawServoStyleSheetBorrowed, sheet: RawServoStyleSheetBorrowed,

View file

@ -608,6 +608,14 @@ pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextBorrowed)
data.into_ffi() 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] #[no_mangle]
pub extern "C" fn Servo_StyleSet_Drop(data: RawServoStyleSetOwned) -> () { pub extern "C" fn Servo_StyleSet_Drop(data: RawServoStyleSetOwned) -> () {
let _ = data.into_box::<PerDocumentStyleData>(); let _ = data.into_box::<PerDocumentStyleData>();