Title: [145172] trunk
Revision
145172
Author
[email protected]
Date
2013-03-07 19:52:08 -0800 (Thu, 07 Mar 2013)

Log Message

Reading border radius from style property returns in wrong order.
https://bugs.webkit.org/show_bug.cgi?id=110853

Source/WebCore:

Patch by Jared Wyles <[email protected]> on 2013-03-07
Reviewed by Ryosuke Niwa

Updating the order of border-radius to return in the order specified
in http://www.w3.org/TR/css3-background/#the-border-radius

Tests updated in LayoutTests/fast/borders/border-radius-parsing.html
Changed the expectations in LayoutTests/inspector/elements/elements-panel-styles-expected.txt

Compat information -
jQuery's css function favours using getComputedStyle for elements so that should not be impacted.
Zepto does check for the element on style first so may be a slight concern there.

* css/StylePropertyShorthand.cpp:
(WebCore::borderRadiusShorthand):

LayoutTests:

Patch by Jared Wyles <[email protected]> on 2013-03-07
Reviewed by Ryosuke Niwa

* fast/borders/border-radius-parsing-expected.txt:
* fast/borders/border-radius-parsing.html:
* inspector/elements/elements-panel-styles-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (145171 => 145172)


--- trunk/LayoutTests/ChangeLog	2013-03-08 03:01:27 UTC (rev 145171)
+++ trunk/LayoutTests/ChangeLog	2013-03-08 03:52:08 UTC (rev 145172)
@@ -1,3 +1,14 @@
+2013-03-07  Jared Wyles  <[email protected]>
+
+        Reading border radius from style property returns in wrong order.
+        https://bugs.webkit.org/show_bug.cgi?id=110853
+
+        Reviewed by Ryosuke Niwa
+        
+        * fast/borders/border-radius-parsing-expected.txt:
+        * fast/borders/border-radius-parsing.html:
+        * inspector/elements/elements-panel-styles-expected.txt:
+
 2013-03-07  Andreas Kling  <[email protected]>
 
         Remove desktop version of -webkit-text-size-adjust property.

Modified: trunk/LayoutTests/fast/borders/border-radius-parsing-expected.txt (145171 => 145172)


--- trunk/LayoutTests/fast/borders/border-radius-parsing-expected.txt	2013-03-08 03:01:27 UTC (rev 145171)
+++ trunk/LayoutTests/fast/borders/border-radius-parsing-expected.txt	2013-03-08 03:52:08 UTC (rev 145172)
@@ -1,7 +1,17 @@
 Testing border-radius: 10px;
 SUCCESS
+Testing border-radius: 10px 20px 30px 40px;
+SUCCESS
+Testing border-radius: 10px 20px 30px 40px 50px;
+SUCCESS
 Testing border-radius: 10px 20px;
 SUCCESS
+Testing border-radius: 10px 20px;
+SUCCESS
+Testing border-radius: 10px;
+SUCCESS
+Testing border-radius: 10px 20px;
+SUCCESS
 Testing -webkit-border-radius: 10px 20px;
 SUCCESS
 Testing border-radius: 10px 20px 30px;

Modified: trunk/LayoutTests/fast/borders/border-radius-parsing.html (145171 => 145172)


--- trunk/LayoutTests/fast/borders/border-radius-parsing.html	2013-03-08 03:01:27 UTC (rev 145171)
+++ trunk/LayoutTests/fast/borders/border-radius-parsing.html	2013-03-08 03:52:08 UTC (rev 145172)
@@ -1,14 +1,34 @@
 <pre id="console"></pre>
 <script>
+
     function log(message)
     {
         document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
     }
 
+    function testBorderRadiusStyleProperty(property, value, expected)
+    {
+        log ("Testing " + property + ": " + value + ";");
+        var element = document.createElement("div");
+        document.body.appendChild(element);
+        element.style.setProperty(property, value);
+        var failed = false;
+
+        if(element.style[property] !== expected) {
+            log("FAILED style: " + property + " was " + element.style[property] + " instead of " + expected);
+            failed = true;  
+        }
+
+
+        if (!failed)
+            log("SUCCESS");
+
+        document.body.removeChild(element);
+    }
+
     function testBorderRadiusValue(property, value, expectedRadii)
     {
         log ("Testing " + property + ": " + value + ";");
-
         var element = document.createElement("div");
         document.body.appendChild(element);
         element.style.setProperty(property, value);
@@ -22,7 +42,7 @@
                 continue;
 
             failed = true;
-            log("FAILED: " + properties[i] + " was " + actualRadius + " instead of " + expectedRadii[i])
+            log("FAILED: " + properties[i] + " was " + actualRadius + " instead of " + expectedRadii[i]);
         }
         if (!failed)
             log("SUCCESS");
@@ -32,6 +52,14 @@
     if (window.testRunner)
         testRunner.dumpAsText();
 
+
+
+    testBorderRadiusStyleProperty("border-radius", "10px", "10px", "10px", "10px", "10px");
+    testBorderRadiusStyleProperty("border-radius", "10px 20px 30px 40px", "10px 20px 30px 40px");
+    testBorderRadiusStyleProperty("border-radius", "10px 20px 30px 40px 50px", "");
+    testBorderRadiusStyleProperty("border-radius", "10px 20px", "10px 20px");
+    
+    testBorderRadiusValue("border-radius", "10px 20px", ["10px", "20px", "10px", "20px"]);
     testBorderRadiusValue("border-radius", "10px", ["10px", "10px", "10px", "10px"]);
     testBorderRadiusValue("border-radius", "10px 20px", ["10px", "20px", "10px", "20px"]);
     testBorderRadiusValue("-webkit-border-radius", "10px 20px", ["10px 20px", "10px 20px", "10px 20px", "10px 20px"]);

Modified: trunk/LayoutTests/inspector/elements/elements-panel-styles-expected.txt (145171 => 145172)


--- trunk/LayoutTests/inspector/elements/elements-panel-styles-expected.txt	2013-03-08 03:01:27 UTC (rev 145171)
+++ trunk/LayoutTests/inspector/elements/elements-panel-styles-expected.txt	2013-03-08 03:52:08 UTC (rev 145172)
@@ -79,10 +79,10 @@
     margin-bottom: 2px;
     margin-left: 1px;
 border-radius: 5px;
+    border-top-left-radius: 5px;
     border-top-right-radius: 5px;
-    border-top-left-radius: 5px;
+    border-bottom-right-radius: 5px;
     border-bottom-left-radius: 5px;
-    border-bottom-right-radius: 5px;
 /-- overloaded --/ font-style: normal !important;
 font-weight: normal !important;
 /-- overloaded --/ font-weight: bold;

Modified: trunk/Source/WebCore/ChangeLog (145171 => 145172)


--- trunk/Source/WebCore/ChangeLog	2013-03-08 03:01:27 UTC (rev 145171)
+++ trunk/Source/WebCore/ChangeLog	2013-03-08 03:52:08 UTC (rev 145172)
@@ -1,3 +1,23 @@
+2013-03-07  Jared Wyles  <[email protected]>
+
+        Reading border radius from style property returns in wrong order.
+        https://bugs.webkit.org/show_bug.cgi?id=110853
+
+        Reviewed by Ryosuke Niwa
+        
+        Updating the order of border-radius to return in the order specified
+        in http://www.w3.org/TR/css3-background/#the-border-radius
+
+        Tests updated in LayoutTests/fast/borders/border-radius-parsing.html 
+        Changed the expectations in LayoutTests/inspector/elements/elements-panel-styles-expected.txt 
+        
+        Compat information -
+        jQuery's css function favours using getComputedStyle for elements so that should not be impacted.
+        Zepto does check for the element on style first so may be a slight concern there.
+
+        * css/StylePropertyShorthand.cpp:
+        (WebCore::borderRadiusShorthand):
+
 2013-03-07  Andreas Kling  <[email protected]>
 
         Resizing Cappuccino is very laggy on WebKit since Safari 5.1

Modified: trunk/Source/WebCore/css/StylePropertyShorthand.cpp (145171 => 145172)


--- trunk/Source/WebCore/css/StylePropertyShorthand.cpp	2013-03-08 03:01:27 UTC (rev 145171)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.cpp	2013-03-08 03:52:08 UTC (rev 145172)
@@ -125,10 +125,10 @@
 const StylePropertyShorthand& borderRadiusShorthand()
 {
     static const CSSPropertyID borderRadiusProperties[] = {
+        CSSPropertyBorderTopLeftRadius,
         CSSPropertyBorderTopRightRadius,
-        CSSPropertyBorderTopLeftRadius,
-        CSSPropertyBorderBottomLeftRadius,
-        CSSPropertyBorderBottomRightRadius
+        CSSPropertyBorderBottomRightRadius,
+        CSSPropertyBorderBottomLeftRadius
     };
     DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderRadiusLonghands, (borderRadiusProperties, WTF_ARRAY_LENGTH(borderRadiusProperties)));
     return borderRadiusLonghands;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to