Backed out changeset b10e6ba9cbdb because gecko part had to be backed out. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 20 Jul 2017 15:42:03 +0200
changeset 418596 4df8bfcb4e9f1c64e99e04cb0d54376dae98b2de
parent 418595 79ce273e2150149fade852d483d34691e479e465
child 418597 cf72ce758a61b0f3cd998932017d45f6198215db
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
milestone56.0a1
backs outb10e6ba9cbdb409833226ac088eba7a719399ce5
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset b10e6ba9cbdb because gecko part had to be backed out. r=backout on a CLOSED TREE
servo/components/layout/animation.rs
servo/components/style/gecko/generated/bindings.rs
servo/components/style/gecko/restyle_damage.rs
servo/components/style/matching.rs
servo/components/style/properties/gecko.mako.rs
servo/components/style/servo/restyle_damage.rs
--- a/servo/components/layout/animation.rs
+++ b/servo/components/layout/animation.rs
@@ -156,19 +156,17 @@ pub fn recalc_style_for_animations(conte
         if let Some(ref animations) = animations.get(&fragment.node) {
             for animation in animations.iter() {
                 let old_style = fragment.style.clone();
                 update_style_for_animation(&context.style_context,
                                            animation,
                                            &mut fragment.style,
                                            &ServoMetricsProvider);
                 let difference =
-                    RestyleDamage::compute_style_difference(&old_style,
-                                                            &old_style,
-                                                            &fragment.style);
+                    RestyleDamage::compute_style_difference(&old_style, &fragment.style);
                 damage |= difference.damage;
             }
         }
     });
 
     let base = flow::mut_base(flow);
     base.restyle_damage.insert(damage);
     for kid in base.children.iter_mut() {
--- a/servo/components/style/gecko/generated/bindings.rs
+++ b/servo/components/style/gecko/generated/bindings.rs
@@ -1042,19 +1042,18 @@ extern "C" {
                                  aPseudoTagOrNull: *mut nsIAtom)
      -> *mut nsStyleContext;
 }
 extern "C" {
     pub fn Gecko_GetImplementedPseudo(element: RawGeckoElementBorrowed)
      -> CSSPseudoElementType;
 }
 extern "C" {
-    pub fn Gecko_CalcStyleDifference(old_style: *const ServoStyleContext,
-                                     new_style: *const ServoStyleContext,
-                                     old_style_bits: u64,
+    pub fn Gecko_CalcStyleDifference(oldstyle: *mut nsStyleContext,
+                                     newstyle: ServoComputedValuesBorrowed,
                                      any_style_changed: *mut bool)
      -> nsChangeHint;
 }
 extern "C" {
     pub fn Gecko_HintsHandledForDescendants(aHint: nsChangeHint)
      -> nsChangeHint;
 }
 extern "C" {
--- a/servo/components/style/gecko/restyle_damage.rs
+++ b/servo/components/style/gecko/restyle_damage.rs
@@ -43,24 +43,24 @@ impl GeckoRestyleDamage {
     /// (in the form of `ComputedValues`).
     ///
     /// Note that we could in theory just get two `ComputedValues` here and diff
     /// them, but Gecko has an interesting optimization when they mark accessed
     /// structs, so they effectively only diff structs that have ever been
     /// accessed from layout.
     pub fn compute_style_difference(
         source: &nsStyleContext,
-        old_style: &ComputedValues,
-        new_style: &Arc<ComputedValues>,
+        new_style: &Arc<ComputedValues>
     ) -> StyleDifference {
+        // 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(old_style.as_style_context(),
-                                                new_style.as_style_context(),
-                                                source.mBits,
+            bindings::Gecko_CalcStyleDifference(context,
+                                                &new_style,
                                                 &mut any_style_changed)
         };
         let change = if any_style_changed { StyleChange::Changed } else { StyleChange::Unchanged };
         StyleDifference::new(GeckoRestyleDamage(hint), change)
     }
 
     /// Returns true if this restyle damage contains all the damage of |other|.
     pub fn contains(self, other: Self) -> bool {
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -763,17 +763,17 @@ pub trait MatchMethods : TElement {
     fn compute_style_difference(
         &self,
         old_values: &ComputedValues,
         new_values: &Arc<ComputedValues>,
         pseudo: Option<&PseudoElement>
     ) -> StyleDifference {
         debug_assert!(pseudo.map_or(true, |p| p.is_eager()));
         if let Some(source) = self.existing_style_for_restyle_damage(old_values, pseudo) {
-            return RestyleDamage::compute_style_difference(source, old_values, new_values)
+            return RestyleDamage::compute_style_difference(source, new_values)
         }
 
         let new_display = new_values.get_box().clone_display();
         let old_display = old_values.get_box().clone_display();
 
         let new_style_is_display_none = new_display == display::T::none;
         let old_style_is_display_none = old_display == display::T::none;
 
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -132,20 +132,16 @@ impl ComputedValues {
         let atom = (self.0)._base.mPseudoTag.raw::<structs::nsIAtom>();
         if atom.is_null() {
             return None;
         }
 
         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 {
     fn drop(&mut self) {
         unsafe {
             bindings::Gecko_ServoStyleContext_Destroy(&mut self.0);
         }
     }
--- a/servo/components/style/servo/restyle_damage.rs
+++ b/servo/components/style/servo/restyle_damage.rs
@@ -55,18 +55,17 @@ bitflags! {
 
 impl HeapSizeOf for ServoRestyleDamage {
     fn heap_size_of_children(&self) -> usize { 0 }
 }
 
 impl ServoRestyleDamage {
     /// Compute the `StyleDifference` (including the appropriate restyle damage)
     /// for a given style change between `old` and `new`.
-    pub fn compute_style_difference(_source: &ComputedValues,
-                                    old: &ComputedValues,
+    pub fn compute_style_difference(old: &ComputedValues,
                                     new: &ComputedValues)
                                     -> StyleDifference {
         let damage = compute_damage(old, new);
         let change = if damage.is_empty() { StyleChange::Unchanged } else { StyleChange::Changed };
         StyleDifference::new(damage, change)
     }
 
     /// Returns a bitmask that represents a flow that needs to be rebuilt and