Bug 1057129 patch 2 - Post all animation restyles directly to pseudo-elements. r=birtles
authorL. David Baron <dbaron@dbaron.org>
Sun, 24 Aug 2014 21:48:22 -0700
changeset 201271 2bf015380818ecdae9254922461ff99defd6d7b5
parent 201270 c0948312ced7c5e4c4f618bde4d627912cf7f1aa
child 201272 916f273f3ad1c438b8e48ff0cce848b01f2ed86d
push id48141
push userdbaron@mozilla.com
push dateMon, 25 Aug 2014 04:48:50 +0000
treeherdermozilla-inbound@916f273f3ad1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1057129
milestone34.0a1
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
Bug 1057129 patch 2 - Post all animation restyles directly to pseudo-elements. r=birtles This (like patch 1) posts restyles directly to the pseudo-element content nodes, which is a new thing as of this bug. Previously we'd have posted eRestyle_Subtree restyles to the pseudo element's real element (i.e., the parent of the pseudo-element content node). This changes the way we post animation restyles for ::before and ::after pseudo-elements with animations on them.
layout/style/AnimationCommon.h
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -261,18 +261,20 @@ struct AnimationPlayerCollection : publi
     } else {
       return NS_LITERAL_STRING("::after");
     }
   }
 
   mozilla::dom::Element* GetElementToRestyle() const;
 
   void PostRestyleForAnimation(nsPresContext *aPresContext) {
-    nsRestyleHint styleHint = IsForElement() ? eRestyle_Self : eRestyle_Subtree;
-    aPresContext->PresShell()->RestyleForAnimation(mElement, styleHint);
+    mozilla::dom::Element* element = GetElementToRestyle();
+    if (element) {
+      aPresContext->PresShell()->RestyleForAnimation(element, eRestyle_Self);
+    }
   }
 
   static void LogAsyncAnimationFailure(nsCString& aMessage,
                                        const nsIContent* aContent = nullptr);
 
   dom::Element *mElement;
 
   // the atom we use in mElement's prop table (must be a static atom,