From 25dc352d7cb18ca6bb77e02f5200ef8e1b7f32b6 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 19 Jul 2017 14:15:07 +0800 Subject: [PATCH] style: Pass a &ComputedValues (aka ServoStyleContext*) to Gecko_CalcStyleDifference. --- components/style/gecko/restyle_damage.rs | 2 +- components/style/properties/gecko.mako.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/style/gecko/restyle_damage.rs b/components/style/gecko/restyle_damage.rs index 2af898a28aa..cd8402d07af 100644 --- a/components/style/gecko/restyle_damage.rs +++ b/components/style/gecko/restyle_damage.rs @@ -55,7 +55,7 @@ impl GeckoRestyleDamage { let mut any_style_changed: bool = false; let hint = unsafe { bindings::Gecko_CalcStyleDifference(context, - &new_style, + new_style.as_style_context(), &mut any_style_changed) }; let change = if any_style_changed { StyleChange::Changed } else { StyleChange::Unchanged }; diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 055d33a62c9..f34b8a9d8fa 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -137,6 +137,10 @@ impl ComputedValues { let atom = Atom::from(atom); PseudoElement::from_atom(&atom) } + + pub fn as_style_context(&self) -> &::gecko_bindings::structs::mozilla::ServoStyleContext { + &self.0 + } } impl Drop for ComputedValues {