Bug 1277991 - We don't need to check ShouldBlockAsyncTransformAnimations() when we just want to know whether the frame has transform animations or not. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 06 Jun 2016 11:27:27 +0900
changeset 375528 70fc6fc3cf014f13167c5554f130c345b2227999
parent 375369 3e8ee3599a67edd971770af4982ad4b0fe77f073
child 522892 e798677b3b5ae886856d589203643aea3adf8fdb
push id20300
push userhiikezoe@mozilla-japan.org
push dateMon, 06 Jun 2016 02:45:22 +0000
reviewersbirtles
bugs1277991
milestone49.0a1
Bug 1277991 - We don't need to check ShouldBlockAsyncTransformAnimations() when we just want to know whether the frame has transform animations or not. r?birtles MozReview-Commit-ID: HYZCKoK62Fq
layout/generic/nsFrame.cpp
layout/reftests/css-animations/reftest.list
layout/reftests/css-animations/stacking-context-transform-none-animation-on-svg.html
layout/reftests/css-animations/stacking-context-transform-none-animation-with-preserve-3d.html
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -551,17 +551,17 @@ nsFrame::Init(nsIContent*       aContent
 
     if (HasAnyStateBits(NS_FRAME_IN_POPUP) && TrackingVisibility()) {
       // Assume all frames in popups are visible.
       IncVisibilityCount(VisibilityCounter::IN_DISPLAYPORT);
     }
   }
   const nsStyleDisplay *disp = StyleDisplay();
   if (disp->HasTransform(this) ||
-      EffectCompositor::HasAnimationsForCompositor(this,
+      nsLayoutUtils::HasCurrentAnimationOfProperty(this,
                                                    eCSSProperty_transform)) {
     // The frame gets reconstructed if we toggle the -moz-transform
     // property, so we can set this bit here and then ignore it.
     mState |= NS_FRAME_MAY_BE_TRANSFORMED;
   }
   if (disp->mPosition == NS_STYLE_POSITION_STICKY &&
       !aPrevInFlow &&
       !(mState & NS_FRAME_IS_NONDISPLAY) &&
--- a/layout/reftests/css-animations/reftest.list
+++ b/layout/reftests/css-animations/reftest.list
@@ -4,8 +4,10 @@ fails == print-no-animations.html print-
 fails != print-no-animations.html print-no-animations-notref.html # reftest harness doesn't actually make pres context non-dynamic for reftest-print tests
 == animate-opacity.html animate-opacity-ref.html
 == animate-preserves3d.html animate-preserves3d-ref.html
 == in-visibility-hidden-animation.html in-visibility-hidden-animation-ref.html
 == in-visibility-hidden-animation-pseudo-element.html in-visibility-hidden-animation-pseudo-element-ref.html
 == partially-out-of-view-animation.html partially-out-of-view-animation-ref.html
 == animate-display-table-opacity.html animate-display-table-opacity-ref.html
 == stacking-context-transform-none-animation.html  stacking-context-transform-animation-ref.html
+== stacking-context-transform-none-animation-on-svg.html  stacking-context-transform-animation-ref.html
+== stacking-context-transform-none-animation-with-preserve-3d.html  stacking-context-transform-animation-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-animations/stacking-context-transform-none-animation-on-svg.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<title>Transform animation creates a stacking context even though it has only
+'transform:none' keyframes on an svg element</title>
+<style>
+span {
+  height: 100px;
+  width: 100px;
+  position: fixed;
+  background: green;
+  top: 50px;
+}
+@keyframes TransformNone {
+  from, to { transform: none }
+}
+#test {
+  animation: TransformNone 100s infinite;
+}
+</style>
+<span></span>
+<svg id="test" width="100px" height="100px">
+  <rect x="0" y="0" width="100%" height="100%" fill="blue"/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-animations/stacking-context-transform-none-animation-with-preserve-3d.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<title>
+Transform animation creates a stacking context even though it has only
+'transform:none' keyframes and with a style which prevents performning
+the animation on the compositor.
+</title>
+<style>
+span {
+  height: 100px;
+  width: 100px;
+  position: fixed;
+  background: green;
+  top: 50px;
+}
+@keyframes TransformNone {
+  from, to { transform: none }
+}
+#test {
+  width: 100px; height: 100px;
+  background: blue;
+  transform-style: preserve-3d;
+  animation: TransformNone 100s infinite;
+}
+</style>
+<span></span>
+<div id="test"></div>