Title: [133029] trunk
Revision
133029
Author
[email protected]
Date
2012-10-31 08:01:30 -0700 (Wed, 31 Oct 2012)

Log Message

perspective-origin should ignore values with more then two lengths and use the default values
https://bugs.webkit.org/show_bug.cgi?id=100835

Patch by Zoltan Nyul <[email protected]> on 2012-10-31
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Perspective-origin should ignore values with more then two lengths
(http://www.w3.org/TR/css3-transforms/#perspective-origin) and use
the default values instead of parsing it as an unlimited-length list,
of which all but the first two values are ignored. This makes perspective-origin
behave similar to transform-origin which uses default value in this case,
as well as firefox does the same.

Test: transforms/2d/computed-style-origin.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parsePerspectiveOrigin):

LayoutTests:

Add test for perspective-origin with more the than two lengths.

* transforms/2d/computed-style-origin-expected.txt:
* transforms/2d/computed-style-origin.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (133028 => 133029)


--- trunk/LayoutTests/ChangeLog	2012-10-31 14:59:59 UTC (rev 133028)
+++ trunk/LayoutTests/ChangeLog	2012-10-31 15:01:30 UTC (rev 133029)
@@ -1,3 +1,15 @@
+2012-10-31  Zoltan Nyul  <[email protected]>
+
+        perspective-origin should ignore values with more then two lengths and use the default values
+        https://bugs.webkit.org/show_bug.cgi?id=100835
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add test for perspective-origin with more the than two lengths.
+
+        * transforms/2d/computed-style-origin-expected.txt:
+        * transforms/2d/computed-style-origin.html:
+
 2012-10-31  Raphael Kubo da Costa  <[email protected]>
 
         [EFL] Unreviewed pixel expectations gardening.

Modified: trunk/LayoutTests/transforms/2d/computed-style-origin-expected.txt (133028 => 133029)


--- trunk/LayoutTests/transforms/2d/computed-style-origin-expected.txt	2012-10-31 14:59:59 UTC (rev 133028)
+++ trunk/LayoutTests/transforms/2d/computed-style-origin-expected.txt	2012-10-31 15:01:30 UTC (rev 133029)
@@ -13,6 +13,7 @@
 PASS test3Style.webkitPerspectiveOrigin is '0px 20px'
 PASS test4Style.webkitPerspectiveOrigin is '5px 7px'
 PASS test5Style.webkitPerspectiveOrigin is '15px 15px'
+PASS test6Style.webkitPerspectiveOrigin is '50px 50px'
 
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/transforms/2d/computed-style-origin.html (133028 => 133029)


--- trunk/LayoutTests/transforms/2d/computed-style-origin.html	2012-10-31 14:59:59 UTC (rev 133028)
+++ trunk/LayoutTests/transforms/2d/computed-style-origin.html	2012-10-31 15:01:30 UTC (rev 133029)
@@ -48,6 +48,14 @@
         -webkit-transform-origin: 50% 50%;
         -webkit-perspective-origin: 50% 50%;
     }
+    #test6 {
+        width: 100px;
+        height: 100px;
+        background-color: blue;
+        position: relative;
+        -webkit-transform: translate(0);
+        -webkit-perspective-origin: 10% 20% 30%;
+    }
 
 </style>
 <script src=""
@@ -58,6 +66,7 @@
 <p id="test3"></p>
 <p id="test4"></p>
 <p id="test5"></p>
+<p id="test6"></p>
 <p id="description"></p>
 <div id="console"></div>
 <script>
@@ -69,12 +78,14 @@
 var test3 = document.getElementById("test3");
 var test4 = document.getElementById("test4");
 var test5 = document.getElementById("test5");
+var test6 = document.getElementById("test6");
 
 var test1Style = window.getComputedStyle(test1);
 var test2Style = window.getComputedStyle(test2);
 var test3Style = window.getComputedStyle(test3);
 var test4Style = window.getComputedStyle(test4);
 var test5Style = window.getComputedStyle(test5);
+var test6Style = window.getComputedStyle(test6);
 
 shouldBe("test1Style.webkitTransformOrigin", "'10px 10px'");
 shouldBe("test2Style.webkitTransformOrigin", "'10px 10px'");
@@ -87,6 +98,7 @@
 shouldBe("test3Style.webkitPerspectiveOrigin", "'0px 20px'");
 shouldBe("test4Style.webkitPerspectiveOrigin", "'5px 7px'");
 shouldBe("test5Style.webkitPerspectiveOrigin", "'15px 15px'");
+shouldBe("test6Style.webkitPerspectiveOrigin", "'50px 50px'");
 
 debug("");
 

Modified: trunk/Source/WebCore/ChangeLog (133028 => 133029)


--- trunk/Source/WebCore/ChangeLog	2012-10-31 14:59:59 UTC (rev 133028)
+++ trunk/Source/WebCore/ChangeLog	2012-10-31 15:01:30 UTC (rev 133029)
@@ -1,3 +1,22 @@
+2012-10-31  Zoltan Nyul  <[email protected]>
+
+        perspective-origin should ignore values with more then two lengths and use the default values
+        https://bugs.webkit.org/show_bug.cgi?id=100835
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Perspective-origin should ignore values with more then two lengths
+        (http://www.w3.org/TR/css3-transforms/#perspective-origin) and use
+        the default values instead of parsing it as an unlimited-length list,
+        of which all but the first two values are ignored. This makes perspective-origin 
+        behave similar to transform-origin which uses default value in this case,
+        as well as firefox does the same.
+
+        Test: transforms/2d/computed-style-origin.html
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parsePerspectiveOrigin):
+
 2012-10-31  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r133016.

Modified: trunk/Source/WebCore/css/CSSParser.cpp (133028 => 133029)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-10-31 14:59:59 UTC (rev 133028)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-10-31 15:01:30 UTC (rev 133029)
@@ -8010,6 +8010,8 @@
 
     switch (propId) {
         case CSSPropertyWebkitPerspectiveOrigin:
+            if (m_valueList->size() > 2)
+                return false;
             parseFillPosition(m_valueList.get(), value, value2);
             break;
         case CSSPropertyWebkitPerspectiveOriginX: {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to