WebCore:
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Apr 2008 17:26:23 +0000 (17:26 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Apr 2008 17:26:23 +0000 (17:26 +0000)
2008-04-17  Dean Jackson  <dino@apple.com>

        Reviewed by Hyatt.

        Fix for <rdar://problem/5849968> translate method should have Y=0 when only X is present

        Test: fast/css/transform-default-parameter.html

        * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyProperty):
        translate function with only X parameter now leaves the Y parameter as zero.

LayoutTests:

2008-04-17  Dean Jackson  <dino@apple.com>

        Reviewed by Hyatt.

        Test for <rdar://problem/5849968> translate method should have Y=0 when only X is present

        * fast/css/transform-default-parameter.html: Added.
        * platform/mac/fast/css/transform-default-parameter-expected.checksum: Added.
        * platform/mac/fast/css/transform-default-parameter-expected.png: Added.
        * platform/mac/fast/css/transform-default-parameter-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/css/transform-default-parameter.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSStyleSelector.cpp

index e1d028a..8707944 100644 (file)
@@ -1,3 +1,14 @@
+2008-04-17  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Hyatt.
+
+        Test for <rdar://problem/5849968> translate method should have Y=0 when only X is present
+
+        * fast/css/transform-default-parameter.html: Added.
+        * platform/mac/fast/css/transform-default-parameter-expected.checksum: Added.
+        * platform/mac/fast/css/transform-default-parameter-expected.png: Added.
+        * platform/mac/fast/css/transform-default-parameter-expected.txt: Added.
+
 2008-04-16  Darin Adler  <darin@apple.com>
 
         Earlier version reviewed by Mitz.
diff --git a/LayoutTests/fast/css/transform-default-parameter.html b/LayoutTests/fast/css/transform-default-parameter.html
new file mode 100644 (file)
index 0000000..eab6b0b
--- /dev/null
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+  "http://www.w3.org/TR/html4/strict.dtd">
+
+<html>
+  <head>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+    <title>Testing translate(x)</title>
+    <style type="text/css" media="screen">
+      
+      div {
+        position: absolute;
+        width: 300px;
+        height: 100px;
+      }
+      
+      #box1 {
+        top: 100px;
+        left: 100px;
+        background-color: blue;
+        -webkit-transform: translate(400px); // this should evaluate as 400px, 0px
+      }
+
+      #box2 {
+        top: 500px;
+        left: 500px;
+        background-color: green;
+        -webkit-transform: translate3d(0px, 0px, -1px);
+      }
+
+      #box3 {
+        top: 100px;
+        left: 500px;
+        background-color: red;
+        -webkit-transform: translate3d(0px, 0px, -1px);
+      }
+      
+    </style>
+  </head>
+  <body>
+    <h1>Testing default translate parameter</h1>
+    <p>There should be blue and green boxes shown. If there is a red box visible, the test has failed</p>
+    
+    <div id="box3">
+      If you can see this box, then the test has failed.
+    </div>
+
+    <div id="box1">
+      This box should be visible (it is translated).
+    </div>
+
+    <div id="box2">
+      This box should be visible.
+    </div>
+
+    
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.checksum b/LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.checksum
new file mode 100644 (file)
index 0000000..ed7a7e1
--- /dev/null
@@ -0,0 +1 @@
+397ec8129fc0f617b71a8f0547a9f5a0
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.png b/LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.png
new file mode 100644 (file)
index 0000000..7e085ac
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.txt b/LayoutTests/platform/mac/fast/css/transform-default-parameter-expected.txt
new file mode 100644 (file)
index 0000000..b4ed48d
--- /dev/null
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x113
+  RenderBlock {HTML} at (0,0) size 800x113
+    RenderBody {BODY} at (8,21) size 784x76
+      RenderBlock {H1} at (0,0) size 784x37
+        RenderText {#text} at (0,0) size 487x37
+          text run at (0,0) width 487: "Testing default translate parameter"
+      RenderBlock {P} at (0,58) size 784x18
+        RenderText {#text} at (0,0) size 577x18
+          text run at (0,0) width 577: "There should be blue and green boxes shown. If there is a red box visible, the test has failed"
+layer at (500,100) size 300x100
+  RenderBlock (positioned) {DIV} at (500,100) size 300x100 [bgcolor=#FF0000]
+    RenderText {#text} at (0,0) size 293x18
+      text run at (0,0) width 293: "If you can see this box, then the test has failed."
+layer at (100,100) size 300x100
+  RenderBlock (positioned) {DIV} at (100,100) size 300x100 [bgcolor=#0000FF]
+    RenderText {#text} at (0,0) size 270x18
+      text run at (0,0) width 270: "This box should be visible (it is translated)."
+layer at (500,500) size 300x100
+  RenderBlock (positioned) {DIV} at (500,500) size 300x100 [bgcolor=#008000]
+    RenderText {#text} at (0,0) size 170x18
+      text run at (0,0) width 170: "This box should be visible."
index 4d1cec4..69234fe 100644 (file)
@@ -1,3 +1,14 @@
+2008-04-17  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Hyatt.
+
+        Fix for <rdar://problem/5849968> translate method should have Y=0 when only X is present
+
+        Test: fast/css/transform-default-parameter.html
+
+        * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyProperty):
+        translate function with only X parameter now leaves the Y parameter as zero.
+
 2008-04-17  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam.
index dde4fc0..c227300 100644 (file)
@@ -4423,8 +4423,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
                                 if (values->length() > 1) {
                                     CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(values->itemWithoutBoundsCheck(1));
                                     ty = convertToLength(secondValue, m_style, &ok);
-                                } else
-                                    ty = tx;
+                                }
                             }
                         }