Bug 1380258 - Check corresponding frame in case of pseudo element instead of parent frame. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 24 Jul 2017 09:20:22 +0900
changeset 419202 6903156877e93ddb192e2d0f62a2baa8ff4a4707
parent 419201 a0181f9fc90a915f5762b64165e8968715c7ff11
child 419203 174b43f8eeb91b0504e2e0f83acc395f98c3ba87
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)
reviewersbirtles
bugs1380258
milestone56.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 1380258 - Check corresponding frame in case of pseudo element instead of parent frame. r=birtles In case of pseudo element, AnimationsWithDestroyedFrame holds the parent element instead of generated pseudo content, so the primary frame of the holding content is not the primary frame for pseudo elements. We need to check correct primary frame respectively. MozReview-Commit-ID: DleEoV13G1f
layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1809,18 +1809,28 @@ RestyleManager::AnimationsWithDestroyedF
                   nsTArray<RefPtr<nsIContent>>& aArray,
                   CSSPseudoElementType aPseudoType)
 {
   nsAnimationManager* animationManager =
     mRestyleManager->PresContext()->AnimationManager();
   nsTransitionManager* transitionManager =
     mRestyleManager->PresContext()->TransitionManager();
   for (nsIContent* content : aArray) {
-    if (content->GetPrimaryFrame()) {
-      continue;
+    if (aPseudoType == CSSPseudoElementType::NotPseudo) {
+      if (content->GetPrimaryFrame()) {
+        continue;
+      }
+    } else if (aPseudoType == CSSPseudoElementType::before) {
+      if (nsLayoutUtils::GetBeforeFrame(content)) {
+        continue;
+      }
+    } else if (aPseudoType == CSSPseudoElementType::after) {
+      if (nsLayoutUtils::GetAfterFrame(content)) {
+        continue;
+      }
     }
     dom::Element* element = content->AsElement();
 
     animationManager->StopAnimationsForElement(element, aPseudoType);
     transitionManager->StopAnimationsForElement(element, aPseudoType);
 
     // All other animations should keep running but not running on the
     // *compositor* at this point.