2010-12-21 Jan Erik Hanssen <jhanssen@sencha.com>
authorariya@webkit.org <ariya@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Dec 2010 03:42:38 +0000 (03:42 +0000)
committerariya@webkit.org <ariya@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Dec 2010 03:42:38 +0000 (03:42 +0000)
        Reviewed by Simon Fraser.

        matrix3d() must take the zoom factor into account
        https://bugs.webkit.org/show_bug.cgi?id=51408

        * transforms/3d/general/matrix-with-zoom-3d-expected.checksum: Added.
        * transforms/3d/general/matrix-with-zoom-3d-expected.png: Added.
        * transforms/3d/general/matrix-with-zoom-3d-expected.txt: Added.
        * transforms/3d/general/matrix-with-zoom-3d.html: Added.
2010-12-21  Jan Erik Hanssen  <jhanssen@sencha.com>

        Reviewed by Simon Fraser.

        matrix3d() must take the zoom factor into account
        https://bugs.webkit.org/show_bug.cgi?id=51408

        Test: transforms/3d/general/matrix-with-zoom-3d.html

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::createTransformOperations):

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

LayoutTests/ChangeLog
LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.checksum [new file with mode: 0644]
LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.png [new file with mode: 0644]
LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.txt [new file with mode: 0644]
LayoutTests/transforms/3d/general/matrix-with-zoom-3d.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSStyleSelector.cpp

index 904f685..56fdee6 100644 (file)
@@ -1,3 +1,15 @@
+2010-12-21  Jan Erik Hanssen  <jhanssen@sencha.com>
+
+        Reviewed by Simon Fraser.
+
+        matrix3d() must take the zoom factor into account
+        https://bugs.webkit.org/show_bug.cgi?id=51408
+
+        * transforms/3d/general/matrix-with-zoom-3d-expected.checksum: Added.
+        * transforms/3d/general/matrix-with-zoom-3d-expected.png: Added.
+        * transforms/3d/general/matrix-with-zoom-3d-expected.txt: Added.
+        * transforms/3d/general/matrix-with-zoom-3d.html: Added.
+
 2010-12-21  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by John Sullivan.
diff --git a/LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.checksum b/LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.checksum
new file mode 100644 (file)
index 0000000..44366ce
--- /dev/null
@@ -0,0 +1 @@
+b456bd8acae8d9bc2bb5f43534e2ff9f
\ No newline at end of file
diff --git a/LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.png b/LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.png
new file mode 100644 (file)
index 0000000..3a8790e
Binary files /dev/null and b/LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.png differ
diff --git a/LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.txt b/LayoutTests/transforms/3d/general/matrix-with-zoom-3d-expected.txt
new file mode 100644 (file)
index 0000000..838dfc8
--- /dev/null
@@ -0,0 +1,10 @@
+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
+layer 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/matrix-with-zoom-3d.html b/LayoutTests/transforms/3d/general/matrix-with-zoom-3d.html
new file mode 100644 (file)
index 0000000..2420f4b
--- /dev/null
@@ -0,0 +1,65 @@
+<html>
+<head>
+<style>
+body {
+    zoom: 1.2;
+    padding: 0;
+    margin: 0;
+    -webkit-transform-style: perserve-3d;
+    -webkit-perspective: 1000px;
+}
+
+.box {
+    width: 100px;
+    height: 100px;
+    background-color: blue;
+    position: absolute;
+    top: 60px;
+    left: 40px;
+}
+
+.translate {
+    -webkit-transform: translate(100px, 50px);
+    background-color: red;
+}
+
+.matrix {
+    -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 50, 0, 1);
+    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>
+
+</body>
+</html>
index 87078ec..4b61335 100644 (file)
@@ -1,3 +1,15 @@
+2010-12-21  Jan Erik Hanssen  <jhanssen@sencha.com>
+
+        Reviewed by Simon Fraser.
+
+        matrix3d() must take the zoom factor into account
+        https://bugs.webkit.org/show_bug.cgi?id=51408
+
+        Test: transforms/3d/general/matrix-with-zoom-3d.html
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::createTransformOperations):
+
 2010-12-21  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Darin Adler.
index 4f47432..e90f9f0 100644 (file)
@@ -6841,8 +6841,8 @@ bool CSSStyleSelector::createTransformOperations(CSSValue* inValue, RenderStyle*
                                    static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(9))->getDoubleValue(),
                                    static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(10))->getDoubleValue(),
                                    static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(11))->getDoubleValue(),
-                                   static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(12))->getDoubleValue(),
-                                   static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(13))->getDoubleValue(),
+                                   zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(12))->getDoubleValue(),
+                                   zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(13))->getDoubleValue(),
                                    static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(14))->getDoubleValue(),
                                    static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(15))->getDoubleValue());
                 operations.operations().append(Matrix3DTransformOperation::create(matrix));