2010-12-22 Ariya Hidayat <ariya@sencha.com>
authorariya@webkit.org <ariya@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Dec 2010 23:58:31 +0000 (23:58 +0000)
committerariya@webkit.org <ariya@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Dec 2010 23:58:31 +0000 (23:58 +0000)
        Reviewed by Simon Fraser.

        Transform applied via CSSMatrix does not take full page zoom into account
        https://bugs.webkit.org/show_bug.cgi?id=24808

        The bug has been fixed with r74430 and r74451.
        These two are just the tests.

        * transforms/2d/cssmatrix-2d-zoom-expected.checksum: Added.
        * transforms/2d/cssmatrix-2d-zoom-expected.png: Added.
        * transforms/2d/cssmatrix-2d-zoom-expected.txt: Added.
        * transforms/2d/cssmatrix-2d-zoom.html: Added.
        * transforms/3d/general/cssmatrix-3d-zoom-expected.checksum: Added.
        * transforms/3d/general/cssmatrix-3d-zoom-expected.png: Added.
        * transforms/3d/general/cssmatrix-3d-zoom-expected.txt: Added.
        * transforms/3d/general/cssmatrix-3d-zoom.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.checksum [new file with mode: 0644]
LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.png [new file with mode: 0644]
LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.txt [new file with mode: 0644]
LayoutTests/transforms/2d/cssmatrix-2d-zoom.html [new file with mode: 0644]
LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.checksum [new file with mode: 0644]
LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.png [new file with mode: 0644]
LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.txt [new file with mode: 0644]
LayoutTests/transforms/3d/general/cssmatrix-3d-zoom.html [new file with mode: 0644]

index 2324413..a789037 100644 (file)
@@ -1,3 +1,22 @@
+2010-12-22  Ariya Hidayat  <ariya@sencha.com>
+
+        Reviewed by Simon Fraser.
+
+        Transform applied via CSSMatrix does not take full page zoom into account
+        https://bugs.webkit.org/show_bug.cgi?id=24808
+
+        The bug has been fixed with r74430 and r74451.
+        These two are just the tests.
+
+        * transforms/2d/cssmatrix-2d-zoom-expected.checksum: Added.
+        * transforms/2d/cssmatrix-2d-zoom-expected.png: Added.
+        * transforms/2d/cssmatrix-2d-zoom-expected.txt: Added.
+        * transforms/2d/cssmatrix-2d-zoom.html: Added.
+        * transforms/3d/general/cssmatrix-3d-zoom-expected.checksum: Added.
+        * transforms/3d/general/cssmatrix-3d-zoom-expected.png: Added.
+        * transforms/3d/general/cssmatrix-3d-zoom-expected.txt: Added.
+        * transforms/3d/general/cssmatrix-3d-zoom.html: Added.
+
 2010-12-22  Jian Li  <jianli@chromium.org>
 
         Reviewed by David Levin.
diff --git a/LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.checksum b/LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.checksum
new file mode 100644 (file)
index 0000000..0b1c4dd
--- /dev/null
@@ -0,0 +1 @@
+e1a5a5c4303d2d4891700085b9702312
\ No newline at end of file
diff --git a/LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.png b/LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.png
new file mode 100644 (file)
index 0000000..9f3a5ca
Binary files /dev/null and b/LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.png differ
diff --git a/LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.txt b/LayoutTests/transforms/2d/cssmatrix-2d-zoom-expected.txt
new file mode 100644 (file)
index 0000000..3a2a86a
--- /dev/null
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+layer at (48,72) size 120x120
+  RenderBlock (positioned) {DIV} at (48,72) size 120x120 [bgcolor=#FF0000]
+layer at (48,72) size 120x120
+  RenderBlock (positioned) {DIV} at (48,72) size 120x120 [bgcolor=#008000]
diff --git a/LayoutTests/transforms/2d/cssmatrix-2d-zoom.html b/LayoutTests/transforms/2d/cssmatrix-2d-zoom.html
new file mode 100644 (file)
index 0000000..064ac28
--- /dev/null
@@ -0,0 +1,66 @@
+<html>
+<head>
+<style>
+body {
+    zoom: 1.2;
+    padding: 0;
+    margin: 0;
+}
+
+.box {
+    width: 100px;
+    height: 100px;
+    background-color: blue;
+    position: absolute;
+    top: 60px;
+    left: 40px;
+}
+
+.translate {
+    -webkit-transform: translate(100px, 50px);
+    background-color: red;
+}
+
+.matrix {
+    background-color: green;
+}
+</style>
+<script type="text/javascript">
+
+function runTest() {
+
+    if (!window.layoutTestController) {
+
+        var id1 = "a";
+        var id2 = "b";
+        var element1 = document.getElementById(id1);
+        var element2 = document.getElementById(id2);
+        var x1 = webkitConvertPointFromNodeToPage(element1, new WebKitPoint(0,0)).x;
+        var y1 = webkitConvertPointFromNodeToPage(element1, new WebKitPoint(0,0)).y;
+        var x2 = webkitConvertPointFromNodeToPage(element2, new WebKitPoint(0,0)).x;
+        var y2 = webkitConvertPointFromNodeToPage(element2, new WebKitPoint(0,0)).y;
+
+        var resultString = '';
+        if (x1 == x2 && y1 == y2) {
+            resultString += "PASS - Element " + id1 + " and Element " + id2 + " had identical positions";
+        } else {
+            resultString += "FAIL - Element " + id1 + " and Element " + id2 + " had different positions";
+        }
+
+        document.body.appendChild(document.createTextNode(resultString));
+    }
+}
+</script>
+</head>
+<body onload="runTest();">
+
+<!-- You should see green box only. If you see red, the test has failed -->
+
+<div id='a' class="box translate"></div>
+<div id='b' class="box matrix"></div>
+
+<script>
+    document.getElementById('b').style.webkitTransform = new WebKitCSSMatrix('matrix(1, 0, 0, 1, 100, 50)');
+</script>
+</body>
+</html>
diff --git a/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.checksum b/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.checksum
new file mode 100644 (file)
index 0000000..0b1c4dd
--- /dev/null
@@ -0,0 +1 @@
+e1a5a5c4303d2d4891700085b9702312
\ No newline at end of file
diff --git a/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.png b/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.png
new file mode 100644 (file)
index 0000000..9f3a5ca
Binary files /dev/null and b/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.png differ
diff --git a/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.txt b/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom-expected.txt
new file mode 100644 (file)
index 0000000..3a2a86a
--- /dev/null
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+layer at (48,72) size 120x120
+  RenderBlock (positioned) {DIV} at (48,72) size 120x120 [bgcolor=#FF0000]
+layer at (48,72) size 120x120
+  RenderBlock (positioned) {DIV} at (48,72) size 120x120 [bgcolor=#008000]
diff --git a/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom.html b/LayoutTests/transforms/3d/general/cssmatrix-3d-zoom.html
new file mode 100644 (file)
index 0000000..a122f0f
--- /dev/null
@@ -0,0 +1,66 @@
+<html>
+<head>
+<style>
+body {
+    zoom: 1.2;
+    padding: 0;
+    margin: 0;
+}
+
+.box {
+    width: 100px;
+    height: 100px;
+    background-color: blue;
+    position: absolute;
+    top: 60px;
+    left: 40px;
+}
+
+.translate {
+    -webkit-transform: translate(100px, 50px);
+    background-color: red;
+}
+
+.matrix {
+    background-color: green;
+}
+</style>
+<script type="text/javascript">
+
+function runTest() {
+
+    if (!window.layoutTestController) {
+
+        var id1 = "a";
+        var id2 = "b";
+        var element1 = document.getElementById(id1);
+        var element2 = document.getElementById(id2);
+        var x1 = webkitConvertPointFromNodeToPage(element1, new WebKitPoint(0,0)).x;
+        var y1 = webkitConvertPointFromNodeToPage(element1, new WebKitPoint(0,0)).y;
+        var x2 = webkitConvertPointFromNodeToPage(element2, new WebKitPoint(0,0)).x;
+        var y2 = webkitConvertPointFromNodeToPage(element2, new WebKitPoint(0,0)).y;
+
+        var resultString = '';
+        if (x1 == x2 && y1 == y2) {
+            resultString += "PASS - Element " + id1 + " and Element " + id2 + " had identical positions";
+        } else {
+            resultString += "FAIL - Element " + id1 + " and Element " + id2 + " had different positions";
+        }
+
+        document.body.appendChild(document.createTextNode(resultString));
+    }
+}
+</script>
+</head>
+<body onload="runTest();">
+
+<!-- You should see green box only. If you see red, the test has failed -->
+
+<div id='a' class="box translate"></div>
+<div id='b' class="box matrix"></div>
+
+<script>
+    document.getElementById('b').style.webkitTransform = new WebKitCSSMatrix('matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 50, 0, 1)');
+</script>
+</body>
+</html>