Skip to content

Commit

Permalink
Bug 1298588 part 4, servo piece. Recreate the default computed values…
Browse files Browse the repository at this point in the history
… for a document as needed. r=bholley
  • Loading branch information
bzbarsky committed Jan 5, 2017
1 parent 34bb2f1 commit a5ac55c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/style/gecko_bindings/bindings.rs
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions ports/geckolib/glue.rs
Expand Up @@ -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::<PerDocumentStyleData>();
Expand Down

0 comments on commit a5ac55c

Please sign in to comment.