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
--- 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>