style: Add an outparam to Gecko_CalcStyleDifference that returns whether any style data changed.

This commit is contained in:
Cameron McCormack 2017-05-20 11:17:57 +08:00 committed by Emilio Cobos Álvarez
parent 605974a112
commit 715d18d377
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 5 additions and 2 deletions

View file

@ -961,7 +961,8 @@ extern "C" {
}
extern "C" {
pub fn Gecko_CalcStyleDifference(oldstyle: *mut nsStyleContext,
newstyle: ServoComputedValuesBorrowed)
newstyle: ServoComputedValuesBorrowed,
any_style_changed: *mut bool)
-> nsChangeHint;
}
extern "C" {

View file

@ -49,9 +49,11 @@ impl GeckoRestyleDamage {
new_style: &Arc<ComputedValues>) -> Self {
// TODO(emilio): Const-ify this?
let context = source as *const nsStyleContext as *mut nsStyleContext;
let mut any_style_changed: bool = false;
let hint = unsafe {
bindings::Gecko_CalcStyleDifference(context,
new_style.as_borrowed_opt().unwrap())
new_style.as_borrowed_opt().unwrap(),
&mut any_style_changed)
};
GeckoRestyleDamage(hint)
}