Title: [158721] trunk
Revision
158721
Author
[email protected]
Date
2013-11-05 22:00:46 -0800 (Tue, 05 Nov 2013)

Log Message

valueForBorderRadiusShorthand returns wrong values in some case
https://bugs.webkit.org/show_bug.cgi?id=123866

Reviewed by Andreas Kling.

Source/WebCore: 

Merge https://chromium.googlesource.com/chromium/blink/+/0933728126f2db06ab8e945efc98bffa2d42af1c

Because valueForBorderRadiusShorthand misses the followings:
- showHorizontalBottomRight depends on showHorizontalBottomLeft.
- showHorizontalTopRight depends on showHorizontalBottomRight (including showHorizontalBottomLeft).

See also http://dev.w3.org/csswg/css-backgrounds/#the-border-radius

Test: fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::getBorderRadiusShorthandValue):

LayoutTests: 

* fast/css/getComputedStyle/getComputedStyle-borderRadius-2-expected.txt: Added.
* fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (158720 => 158721)


--- trunk/LayoutTests/ChangeLog	2013-11-06 05:50:35 UTC (rev 158720)
+++ trunk/LayoutTests/ChangeLog	2013-11-06 06:00:46 UTC (rev 158721)
@@ -1,5 +1,15 @@
 2013-11-05  Ryosuke Niwa  <[email protected]>
 
+        valueForBorderRadiusShorthand returns wrong values in some case
+        https://bugs.webkit.org/show_bug.cgi?id=123866
+
+        Reviewed by Andreas Kling.
+
+        * fast/css/getComputedStyle/getComputedStyle-borderRadius-2-expected.txt: Added.
+        * fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html: Added.
+
+2013-11-05  Ryosuke Niwa  <[email protected]>
+
         Flaky Test: transitions/cancel-transition.html
         https://bugs.webkit.org/show_bug.cgi?id=114193
 

Added: trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2-expected.txt (0 => 158721)


--- trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2-expected.txt	2013-11-06 06:00:46 UTC (rev 158721)
@@ -0,0 +1,15 @@
+Test calling getPropertyValue on computed styles for border radius shorthand properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.getComputedStyle(document.getElementById('borderRadius1')).getPropertyValue('border-radius') is '0px 0px 10px 10px'
+PASS window.getComputedStyle(document.getElementById('borderRadius2')).getPropertyValue('border-radius') is '0px 0px 0px 10px'
+PASS window.getComputedStyle(document.getElementById('borderRadius3')).getPropertyValue('border-radius') is '0px 0px 10px'
+PASS window.getComputedStyle(document.getElementById('borderRadius4')).getPropertyValue('border-radius') is '0px 10px'
+PASS window.getComputedStyle(document.getElementById('borderRadius5')).getPropertyValue('border-radius') is '10px'
+PASS window.getComputedStyle(document.getElementById('NoBorderRadius')).getPropertyValue('border-radius') is '0px'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html (0 => 158721)


--- trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html	2013-11-06 06:00:46 UTC (rev 158721)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<style>
+    .test { float: left; width: 50px; height: 50px; border: 1px solid black; }
+    #borderRadius1 { border-radius: 0 0 10px 10px; }
+    #borderRadius2 { border-radius: 0 0 0 10px; }
+    #borderRadius3 { border-radius: 0 0 10px; }
+    #borderRadius4 { border-radius: 0 10px; }
+    #borderRadius5 { border-radius: 10px; }
+</style>
+</head>
+<body>
+    <pre id="console"></pre>
+    <div class="test" id="borderRadius1"></div>
+    <div class="test" id="borderRadius2"></div>
+    <div class="test" id="borderRadius3"></div>
+    <div class="test" id="borderRadius4"></div>
+    <div class="test" id="borderRadius5"></div>
+    <div class="test" id="NoBorderRadius"></div>
+<script>
+description('Test calling getPropertyValue on computed styles for border radius shorthand properties.');
+
+shouldBe("window.getComputedStyle(document.getElementById('borderRadius1')).getPropertyValue('border-radius')", "'0px 0px 10px 10px'");
+shouldBe("window.getComputedStyle(document.getElementById('borderRadius2')).getPropertyValue('border-radius')", "'0px 0px 0px 10px'");
+shouldBe("window.getComputedStyle(document.getElementById('borderRadius3')).getPropertyValue('border-radius')", "'0px 0px 10px'");
+shouldBe("window.getComputedStyle(document.getElementById('borderRadius4')).getPropertyValue('border-radius')", "'0px 10px'");
+shouldBe("window.getComputedStyle(document.getElementById('borderRadius5')).getPropertyValue('border-radius')", "'10px'");
+shouldBe("window.getComputedStyle(document.getElementById('NoBorderRadius')).getPropertyValue('border-radius')", "'0px'");
+</script>
+</body>
+<script src=""
+</html>

Modified: trunk/Source/WebCore/ChangeLog (158720 => 158721)


--- trunk/Source/WebCore/ChangeLog	2013-11-06 05:50:35 UTC (rev 158720)
+++ trunk/Source/WebCore/ChangeLog	2013-11-06 06:00:46 UTC (rev 158721)
@@ -1,5 +1,25 @@
 2013-11-05  Ryosuke Niwa  <[email protected]>
 
+        valueForBorderRadiusShorthand returns wrong values in some case
+        https://bugs.webkit.org/show_bug.cgi?id=123866
+
+        Reviewed by Andreas Kling.
+
+        Merge https://chromium.googlesource.com/chromium/blink/+/0933728126f2db06ab8e945efc98bffa2d42af1c
+
+        Because valueForBorderRadiusShorthand misses the followings:
+        - showHorizontalBottomRight depends on showHorizontalBottomLeft.
+        - showHorizontalTopRight depends on showHorizontalBottomRight (including showHorizontalBottomLeft).
+
+        See also http://dev.w3.org/csswg/css-backgrounds/#the-border-radius
+
+        Test: fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::getBorderRadiusShorthandValue):
+
+2013-11-05  Ryosuke Niwa  <[email protected]>
+
         Protect DOM nodes in IndentOutdentCommand::tryIndentingAsListItem()
         https://bugs.webkit.org/show_bug.cgi?id=123861
 

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (158720 => 158721)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-11-06 05:50:35 UTC (rev 158720)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-11-06 06:00:46 UTC (rev 158721)
@@ -739,12 +739,12 @@
 {
     RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
     bool showHorizontalBottomLeft = style->borderTopRightRadius().width() != style->borderBottomLeftRadius().width();
-    bool showHorizontalBottomRight = style->borderBottomRightRadius().width() != style->borderTopLeftRadius().width();
-    bool showHorizontalTopRight = style->borderTopRightRadius().width() != style->borderTopLeftRadius().width();
+    bool showHorizontalBottomRight = showHorizontalBottomLeft || (style->borderBottomRightRadius().width() != style->borderTopLeftRadius().width());
+    bool showHorizontalTopRight = showHorizontalBottomRight || (style->borderTopRightRadius().width() != style->borderTopLeftRadius().width());
 
     bool showVerticalBottomLeft = style->borderTopRightRadius().height() != style->borderBottomLeftRadius().height();
-    bool showVerticalBottomRight = (style->borderBottomRightRadius().height() != style->borderTopLeftRadius().height()) || showVerticalBottomLeft;
-    bool showVerticalTopRight = (style->borderTopRightRadius().height() != style->borderTopLeftRadius().height()) || showVerticalBottomRight;
+    bool showVerticalBottomRight = showVerticalBottomLeft || (style->borderBottomRightRadius().height() != style->borderTopLeftRadius().height());
+    bool showVerticalTopRight = showVerticalBottomRight || (style->borderTopRightRadius().height() != style->borderTopLeftRadius().height());
     bool showVerticalTopLeft = (style->borderTopLeftRadius().width() != style->borderTopLeftRadius().height());
 
     RefPtr<CSSValueList> topLeftRadius = getBorderRadiusCornerValues(style->borderTopLeftRadius(), style, renderView);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to