Test compositing and slow scrolling behavior of fixed position elements under transfo...
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2013 21:04:52 +0000 (21:04 +0000)
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2013 21:04:52 +0000 (21:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=103470

Reviewed by Simon Fraser.

Add test case for the behavior change about fixed position elements under transformed elements in bug 102543 by the way.

* compositing/layer-creation/no-compositing-for-fixed-position-under-transform-expected.txt: Added.
* compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138842 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/compositing/layer-creation/no-compositing-for-fixed-position-under-transform-expected.txt [new file with mode: 0644]
LayoutTests/compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html [new file with mode: 0644]

index 7ef7e69..cc4feb4 100644 (file)
@@ -1,3 +1,15 @@
+2013-01-04  Xianzhu Wang  <wangxianzhu@chromium.org>
+
+        Test compositing and slow scrolling behavior of fixed position elements under transformed elements
+        https://bugs.webkit.org/show_bug.cgi?id=103470
+
+        Reviewed by Simon Fraser.
+
+        Add test case for the behavior change about fixed position elements under transformed elements in bug 102543 by the way.
+
+        * compositing/layer-creation/no-compositing-for-fixed-position-under-transform-expected.txt: Added.
+        * compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html: Added.
+
 2013-01-04  Tony Chang  <tony@chromium.org>
 
         Remove some autogenerated settings from InternalSettings.idl
diff --git a/LayoutTests/compositing/layer-creation/no-compositing-for-fixed-position-under-transform-expected.txt b/LayoutTests/compositing/layer-creation/no-compositing-for-fixed-position-under-transform-expected.txt
new file mode 100644 (file)
index 0000000..728a469
--- /dev/null
@@ -0,0 +1,17 @@
+TEST
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 100.00 30.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html b/LayoutTests/compositing/layer-creation/no-compositing-for-fixed-position-under-transform.html
new file mode 100644 (file)
index 0000000..e941d0b
--- /dev/null
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <style>
+    .transform {
+      width: 100px;
+      height: 30px;
+      -webkit-transform: translateZ(0);
+    }
+    .fixed {
+      position: fixed;
+      left: 10px;
+      top: 10px;
+    }
+  </style>
+
+  <script type="text/javascript">
+    if (window.internals) {
+      window.internals.settings.setEnableCompositingForFixedPosition(true);
+      window.internals.settings.setFixedPositionCreatesStackingContext(true);
+    }
+
+    if (window.testRunner) {
+      testRunner.dumpAsText();
+
+      window.addEventListener("load", function() {
+        document.getElementById("layerTree").innerText = window.internals.layerTreeAsText(document);
+        document.getElementById("mainThreadScrollingReasons").innerText = window.internals.mainThreadScrollingReasons(document);
+      }, false);
+    }
+  </script>
+</head>
+
+<body>
+  <div class="transform">
+    <!-- This element should neither be composited nor force main thread scrolling. -->
+    <div class="fixed">TEST</div>
+  </div>
+
+  <pre id="layerTree"></pre>
+  <pre id="mainThreadScrollingReasons"></pre>
+</body>
+</html>