style: Pass a &ComputedValues (aka ServoStyleContext*) to Gecko_CalcStyleDifference.

This commit is contained in:
Cameron McCormack 2017-07-19 14:15:07 +08:00
parent a9b748f17a
commit 25dc352d7c
2 changed files with 5 additions and 1 deletions

View file

@ -55,7 +55,7 @@ impl GeckoRestyleDamage {
let mut any_style_changed: bool = false; let mut any_style_changed: bool = false;
let hint = unsafe { let hint = unsafe {
bindings::Gecko_CalcStyleDifference(context, bindings::Gecko_CalcStyleDifference(context,
&new_style, new_style.as_style_context(),
&mut any_style_changed) &mut any_style_changed)
}; };
let change = if any_style_changed { StyleChange::Changed } else { StyleChange::Unchanged }; let change = if any_style_changed { StyleChange::Changed } else { StyleChange::Unchanged };

View file

@ -137,6 +137,10 @@ impl ComputedValues {
let atom = Atom::from(atom); let atom = Atom::from(atom);
PseudoElement::from_atom(&atom) PseudoElement::from_atom(&atom)
} }
pub fn as_style_context(&self) -> &::gecko_bindings::structs::mozilla::ServoStyleContext {
&self.0
}
} }
impl Drop for ComputedValues { impl Drop for ComputedValues {