mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
style: Add an outparam to Gecko_CalcStyleDifference that returns whether any style data changed.
This commit is contained in:
parent
605974a112
commit
715d18d377
2 changed files with 5 additions and 2 deletions
|
@ -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" {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue