2006-11-21 Alex Taylor <darwin@techvisual.co.nz>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Nov 2006 12:08:13 +0000 (12:08 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Nov 2006 12:08:13 +0000 (12:08 +0000)
        Reviewed by Mitz.

        Pixel tests for border radius rendering bug
        - http://bugs.webkit.org/show_bug.cgi?id=11587

        * fast/borders/borderRadiusArcs01-expected.checksum: Added.
        * fast/borders/borderRadiusArcs01-expected.png: Added.
        * fast/borders/borderRadiusArcs01-expected.txt: Added.
        * fast/borders/borderRadiusArcs01.html: Added.
2006-11-21  Alex Taylor  <darwin@techvisual.co.nz>

        Reviewed by Mitz.

Fixes: http://bugs.webkit.org/show_bug.cgi?id=11587
        Adds calculations for bottom right radius's position
        which was being drawn incorrectly.

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::paintBorder):

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

LayoutTests/ChangeLog
LayoutTests/fast/borders/borderRadiusArcs01-expected.checksum [new file with mode: 0644]
LayoutTests/fast/borders/borderRadiusArcs01-expected.png [new file with mode: 0644]
LayoutTests/fast/borders/borderRadiusArcs01-expected.txt [new file with mode: 0644]
LayoutTests/fast/borders/borderRadiusArcs01.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderObject.cpp

index 6e930846f74fb1c7d3b4341249376b990599773e..eb0c271d91b3e53ce026b7d228cac2ff3434168d 100644 (file)
@@ -1,3 +1,15 @@
+2006-11-21  Alex Taylor  <darwin@techvisual.co.nz>
+
+        Reviewed by Mitz.
+
+        Pixel tests for border radius rendering bug
+        - http://bugs.webkit.org/show_bug.cgi?id=11587
+
+        * fast/borders/borderRadiusArcs01-expected.checksum: Added.
+        * fast/borders/borderRadiusArcs01-expected.png: Added.
+        * fast/borders/borderRadiusArcs01-expected.txt: Added.
+        * fast/borders/borderRadiusArcs01.html: Added.
+
 2006-11-20  W. Andy Carrel  <wac@google.com>
 
         Reviewed by Maciej.
diff --git a/LayoutTests/fast/borders/borderRadiusArcs01-expected.checksum b/LayoutTests/fast/borders/borderRadiusArcs01-expected.checksum
new file mode 100644 (file)
index 0000000..8b8c688
--- /dev/null
@@ -0,0 +1 @@
+170d090756e82d3db2711846fe9cc93c
\ No newline at end of file
diff --git a/LayoutTests/fast/borders/borderRadiusArcs01-expected.png b/LayoutTests/fast/borders/borderRadiusArcs01-expected.png
new file mode 100644 (file)
index 0000000..d452e41
Binary files /dev/null and b/LayoutTests/fast/borders/borderRadiusArcs01-expected.png differ
diff --git a/LayoutTests/fast/borders/borderRadiusArcs01-expected.txt b/LayoutTests/fast/borders/borderRadiusArcs01-expected.txt
new file mode 100644 (file)
index 0000000..f79f3a1
--- /dev/null
@@ -0,0 +1,8 @@
+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
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 220x220 [bgcolor=#00FF00] [border: (10px solid #00FFFF) (10px solid #FF0000) (10px solid #0000FF) (10px solid #00FFFF)]
+        RenderText {#text} at (10,10) size 4x18
+          text run at (10,10) width 4: " "
diff --git a/LayoutTests/fast/borders/borderRadiusArcs01.html b/LayoutTests/fast/borders/borderRadiusArcs01.html
new file mode 100644 (file)
index 0000000..512b10d
--- /dev/null
@@ -0,0 +1,22 @@
+<html>
+<head>
+    <style type="text/css">
+        div {
+            width: 200px;
+            height: 200px;
+            border: 10px solid cyan;
+            border-bottom-color: blue;
+            border-right-color: red;
+            -webkit-border-top-right-radius: 40px;
+            -webkit-border-bottom-left-radius: 60px;
+            -webkit-border-bottom-right-radius: 30px;
+            background-color:lime;
+        }
+    </style>
+</head>
+<body>
+    <div>
+        &nbsp;
+    </div>
+</body>
+</html>
index af45a4c9726a44b2637c95f298354e37be2f1a51..16300ab9b50b920faa15ceedc3328e70bac7acd8 100644 (file)
@@ -1,3 +1,15 @@
+2006-11-21  Alex Taylor  <darwin@techvisual.co.nz>
+
+        Reviewed by Mitz.
+
+        Fixes: http://bugs.webkit.org/show_bug.cgi?id=11587
+
+        Adds calculations for bottom right radius's position
+        which was being drawn incorrectly.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::paintBorder):
+
 2006-11-20  Rob Buis  <buis@kde.org>
 
         Reviewed by Maciej.
index b8f6eb939587d97e578bc977448cd015262d3e5f..35cfb8a406f90c82ca4875e0d991348337193dfa 100644 (file)
@@ -1395,6 +1395,7 @@ void RenderObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty,
         if (renderRadii) {
             int leftX = tx;
             int leftY = ty + h - bottomLeft.height() * 2;
+            int rightY = ty + h - bottomRight.height() * 2;
             int rightX = tx + w - bottomRight.width() * 2;
             secondAngleStart = 270;
             secondAngleSpan = upperRightBorderStylesMatch ? 90 : 45;
@@ -1428,12 +1429,12 @@ void RenderObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty,
                 && (bs != DOUBLE || style->borderBottomWidth() > 6);
             if (applyRightInnerClip) {
                 graphicsContext->save();
-                graphicsContext->addInnerRoundedRectClip(IntRect(rightX, leftY, bottomRight.width() * 2, bottomRight.height() * 2),
+                graphicsContext->addInnerRoundedRectClip(IntRect(rightX, rightY, bottomRight.width() * 2, bottomRight.height() * 2),
                                                          style->borderBottomWidth());
             }
 
             // Draw lower right arc
-            drawBorderArc(graphicsContext, rightX, leftY, thickness, bottomRight, secondAngleStart, secondAngleSpan,
+            drawBorderArc(graphicsContext, rightX, rightY, thickness, bottomRight, secondAngleStart, secondAngleSpan,
                           BSBottom, bc, style->color(), bs, false);
             if (applyRightInnerClip)
                 graphicsContext->restore();
@@ -1524,6 +1525,7 @@ void RenderObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty,
         if (renderRadii && (!upperRightBorderStylesMatch || !lowerRightBorderStylesMatch)) {
             int topX = tx + w - topRight.width() * 2;
             int topY = ty;
+            int bottomX = tx + w - bottomRight.width() * 2;
             int bottomY = ty + h - bottomRight.height() * 2;
             firstAngleStart = 0;
             secondAngleStart = 315;
@@ -1550,12 +1552,12 @@ void RenderObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty,
                 && (rs != DOUBLE || style->borderRightWidth() > 6);
             if (applyBottomInnerClip) {
                 graphicsContext->save();
-                graphicsContext->addInnerRoundedRectClip(IntRect(topX, bottomY, bottomRight.width() * 2, bottomRight.height() * 2),
+                graphicsContext->addInnerRoundedRectClip(IntRect(bottomX, bottomY, bottomRight.width() * 2, bottomRight.height() * 2),
                                                          style->borderRightWidth());
             }
 
             // Draw bottom right arc
-            drawBorderArc(graphicsContext, topX, bottomY, thickness, bottomRight, secondAngleStart, secondAngleSpan,
+            drawBorderArc(graphicsContext, bottomX, bottomY, thickness, bottomRight, secondAngleStart, secondAngleSpan,
                           BSRight, rc, style->color(), rs, false);
             if (applyBottomInnerClip)
                 graphicsContext->restore();