Skip to content

Commit 715d18d

Browse files
heycamemilio
authored andcommitted
style: Add an outparam to Gecko_CalcStyleDifference that returns whether any style data changed.
1 parent 605974a commit 715d18d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

components/style/gecko/generated/bindings.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,8 @@ extern "C" {
961961
}
962962
extern "C" {
963963
pub fn Gecko_CalcStyleDifference(oldstyle: *mut nsStyleContext,
964-
newstyle: ServoComputedValuesBorrowed)
964+
newstyle: ServoComputedValuesBorrowed,
965+
any_style_changed: *mut bool)
965966
-> nsChangeHint;
966967
}
967968
extern "C" {

components/style/gecko/restyle_damage.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ impl GeckoRestyleDamage {
4949
new_style: &Arc<ComputedValues>) -> Self {
5050
// TODO(emilio): Const-ify this?
5151
let context = source as *const nsStyleContext as *mut nsStyleContext;
52+
let mut any_style_changed: bool = false;
5253
let hint = unsafe {
5354
bindings::Gecko_CalcStyleDifference(context,
54-
new_style.as_borrowed_opt().unwrap())
55+
new_style.as_borrowed_opt().unwrap(),
56+
&mut any_style_changed)
5557
};
5658
GeckoRestyleDamage(hint)
5759
}

0 commit comments

Comments
 (0)