Bug 1319378 - Don't set NS_FRAME_MAY_BE_TRANSFORMED against nsIFrame that does not support transforms. r?dbaron draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 28 Nov 2016 14:19:40 +0900
changeset 445574 ba3c6605861011524d97b10c5dd0bb9fe6f3efdf
parent 445465 8d8846f63b74eb930e48b410730ae088e9bdbee8
child 538571 e321f073b1bb2369cf635af1c15ec55393d9d3a4
push id37565
push userhiikezoe@mozilla-japan.org
push dateWed, 30 Nov 2016 00:55:13 +0000
reviewersdbaron
bugs1319378
milestone53.0a1
Bug 1319378 - Don't set NS_FRAME_MAY_BE_TRANSFORMED against nsIFrame that does not support transforms. r?dbaron MozReview-Commit-ID: CuDA14ktcDL
layout/generic/nsFrame.cpp
layout/reftests/transform/reftest.list
layout/reftests/transform/table-overflowed-by-animation-ref.html
layout/reftests/transform/table-overflowed-by-animation.html
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -550,17 +550,18 @@ nsFrame::Init(nsIContent*       aContent
 
     if (HasAnyStateBits(NS_FRAME_IN_POPUP) && TrackingVisibility()) {
       // Assume all frames in popups are visible.
       IncApproximateVisibleCount();
     }
   }
   const nsStyleDisplay *disp = StyleDisplay();
   if (disp->HasTransform(this) ||
-      nsLayoutUtils::HasAnimationOfProperty(this, eCSSProperty_transform)) {
+      (IsFrameOfType(eSupportsCSSTransforms) &&
+       nsLayoutUtils::HasAnimationOfProperty(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) &&
       !disp->IsInnerTableStyle()) {
--- a/layout/reftests/transform/reftest.list
+++ b/layout/reftests/transform/reftest.list
@@ -134,8 +134,9 @@ pref(svg.transform-box.enabled,true) == 
 == transform-origin-svg-2a.svg transform-origin-svg-2-ref.svg
 == transform-origin-svg-2b.svg transform-origin-svg-2-ref.svg
 # Bug 1122526
 == animate-layer-scale-inherit-1.html animate-layer-scale-inherit-1-ref.html
 == animate-layer-scale-inherit-2.html animate-layer-scale-inherit-2-ref.html
 == animate-layer-scale-inherit-3.html animate-layer-scale-inherit-1-ref.html
 # Bug 1301500
 == dynamic-add-without-change-cb-1.html dynamic-add-without-change-cb-1-ref.html
+fuzzy-if(d2d,1,5) == table-overflowed-by-animation.html table-overflowed-by-animation-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/transform/table-overflowed-by-animation-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<table style="width: 100px; height: 100px;">
+  <td style="transform: rotateZ(45deg); background-color: rgb(212, 61, 188);">
+  </td>
+</table>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/transform/table-overflowed-by-animation.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<style>
+@keyframes anim {
+  /*
+   * We need to use different transform functions to produce
+   * UpdatePostTransformOverflow change hint, also these functions have to be
+   * the same matrix to being the same position while running reftest.
+   */
+  from {
+    transform: rotate(0deg);
+  }
+  to {
+    transform: scale(1);
+  }
+}
+</style>
+<table id="test" style="width: 100px; height: 100px; animation: anim 1s infinite;">
+  <td style="transform: rotateZ(45deg); background-color: rgb(212, 61, 188);">
+  </td>
+</table>
+<script>
+document.getElementById("test").addEventListener("animationstart", () => {
+  requestAnimationFrame(() => {
+    document.documentElement.classList.remove("reftest-wait");
+  });
+}, false);
+</script>
+</html>