Bug 1234403 - Part 2: Implement document.getAnimations. r=birtles
authorBoris Chiou <boris.chiou@gmail.com>
Thu, 18 Feb 2016 02:24:00 +0100
changeset 285587 df84913f9ff2bcc124162e2e898df54efe743fd5
parent 285586 069f272ec9f1b1a88516577dfcf5dfb186bf132c
child 285588 d49c6a43b80a4e95b5dcbac0878a6757011e39db
push id17831
push userkwierso@gmail.com
push dateThu, 25 Feb 2016 22:42:17 +0000
treeherderfx-team@8e34b12969bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1234403
milestone47.0a1
Bug 1234403 - Part 2: Implement document.getAnimations. r=birtles
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3136,32 +3136,29 @@ nsDocument::Timeline()
   return mDocumentTimeline;
 }
 
 void
 nsDocument::GetAnimations(nsTArray<RefPtr<Animation>>& aAnimations)
 {
   FlushPendingNotifications(Flush_Style);
 
-  // Bug 1174575: Until we implement a suitable PseudoElement interface we
-  // don't have anything to return for the |target| attribute of
-  // KeyframeEffect(ReadOnly) objects that refer to pseudo-elements.
-  // Rather than return some half-baked version of these objects (e.g.
-  // we a null effect attribute) we simply don't provide access to animations
-  // whose effect refers to a pseudo-element until we can support them
-  // properly.
   for (nsIContent* node = nsINode::GetFirstChild();
        node;
        node = node->GetNextNode(this)) {
     if (!node->IsElement()) {
       continue;
     }
 
-    Element::GetAnimationsUnsorted(node->AsElement(),
-                                   CSSPseudoElementType::NotPseudo,
+    Element* element = node->AsElement();
+    Element::GetAnimationsUnsorted(element, CSSPseudoElementType::NotPseudo,
+                                   aAnimations);
+    Element::GetAnimationsUnsorted(element, CSSPseudoElementType::before,
+                                   aAnimations);
+    Element::GetAnimationsUnsorted(element, CSSPseudoElementType::after,
                                    aAnimations);
   }
 
   // Sort animations by priority
   aAnimations.Sort(AnimationPtrComparator<RefPtr<Animation>>());
 }
 
 /* Return true if the document is in the focused top-level window, and is an