[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 15:03:43 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit a3a25288475ba77a22b6295bfe829da8b71e62ad
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 27 19:48:16 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=48449
    
    Reviewed by Beth Dakin.
    
    Make border drawing work correctly with vertical inline flows.  The top and bottom edge have to be omitted
    rather than the left and right edges.
    
    Also discovered that border-radius is broken with the new path-based-drawing code for all inline flows.  This
    is a regression from the old drawing code.  I patched the code to be correct rather than clipping out stuff
    that it shouldn't and applying border-radii on lines that don't even have them.
    
    Added fast/blockflow/border-vertical-lr.html and fast/borders/border-radius-inline-flow.html
    
    WebCore:
    
    * rendering/RenderBoxModelObject.cpp:
    (WebCore::RenderBoxModelObject::paintBorder):
    (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
    * rendering/RenderBoxModelObject.h:
    
    LayoutTests:
    
    * fast/blockflow/border-vertical-lr.html: Added.
    * fast/borders/border-radius-inline-flow.html: Added.
    * platform/mac/fast/blockflow/border-vertical-lr-expected.checksum: Added.
    * platform/mac/fast/blockflow/border-vertical-lr-expected.png: Added.
    * platform/mac/fast/blockflow/border-vertical-lr-expected.txt: Added.
    * platform/mac/fast/borders/border-radius-inline-flow-expected.checksum: Added.
    * platform/mac/fast/borders/border-radius-inline-flow-expected.png: Added.
    * platform/mac/fast/borders/border-radius-inline-flow-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70692 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f3993ea..3147b9b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,27 @@
+2010-10-27  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=48449
+        
+        Make border drawing work correctly with vertical inline flows.  The top and bottom edge have to be omitted
+        rather than the left and right edges.
+        
+        Also discovered that border-radius is broken with the new path-based-drawing code for all inline flows.  This
+        is a regression from the old drawing code.  I patched the code to be correct rather than clipping out stuff
+        that it shouldn't and applying border-radii on lines that don't even have them.
+
+        Added fast/blockflow/border-vertical-lr.html and fast/borders/border-radius-inline-flow.html
+
+        * fast/blockflow/border-vertical-lr.html: Added.
+        * fast/borders/border-radius-inline-flow.html: Added.
+        * platform/mac/fast/blockflow/border-vertical-lr-expected.checksum: Added.
+        * platform/mac/fast/blockflow/border-vertical-lr-expected.png: Added.
+        * platform/mac/fast/blockflow/border-vertical-lr-expected.txt: Added.
+        * platform/mac/fast/borders/border-radius-inline-flow-expected.checksum: Added.
+        * platform/mac/fast/borders/border-radius-inline-flow-expected.png: Added.
+        * platform/mac/fast/borders/border-radius-inline-flow-expected.txt: Added.
+
 2010-10-27  Adam Roben  <aroben at apple.com>
 
         Skip some failing tests on Windows
diff --git a/LayoutTests/fast/blockflow/border-vertical-lr.html b/LayoutTests/fast/blockflow/border-vertical-lr.html
new file mode 100644
index 0000000..0a62e04
--- /dev/null
+++ b/LayoutTests/fast/blockflow/border-vertical-lr.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<html style="-webkit-writing-mode:vertical-lr">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<style>
+body {
+    font-family: "HiraMinPro-W3";
+    font-size: 16pt;
+    line-height:3
+}
+</style>
+</head>
+<body>
+<span style="border: 2px solid black; padding:2px">
+せっかく見つけたすばらしい記事がどこにあったか忘れてしまった経験はありますかならタイトルとアドレスだけでなく、訪問したウェブページのコンテンツからも検索することができます。</span>
+
+<br>
+<br>
+<span style="border:5px solid black; -webkit-border-radius:10px; padding:2px">
+せっかく見つけたすばらしい記事がどこにあったか忘れてしまった経験はありますか ならタイトルとアドレスだけでなく、訪問したウェブページのコンテンツからも検索することができます。訪問したウェブページのコンテンツからも検索することができます。せっかく見つけたすばらしい記事がどこにあったか忘れてしまった経験はありますか ならタイトルとアドレスだけでなく、訪問
+</span>
+</body>
diff --git a/LayoutTests/fast/borders/border-radius-inline-flow.html b/LayoutTests/fast/borders/border-radius-inline-flow.html
new file mode 100644
index 0000000..4a0ff74
--- /dev/null
+++ b/LayoutTests/fast/borders/border-radius-inline-flow.html
@@ -0,0 +1,6 @@
+<body style="line-height:3">
+<span style="border:5px solid black; -webkit-border-radius:10px; padding:2px">
+This is a span that crosses multiple lines and has a border-radius.  The border-radius should only apply at the endpoints of the span,
+and the edges that are "open" should just be solid right up to the edge (with no rounding or clipping).
+</span>
+
diff --git a/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.checksum
new file mode 100644
index 0000000..3b63bfa
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.checksum
@@ -0,0 +1 @@
+385aa084edea5cff12b522e2d0505fdf
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.png b/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.png
new file mode 100644
index 0000000..744070e
Binary files /dev/null and b/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.txt b/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.txt
new file mode 100644
index 0000000..360aec9
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.txt
@@ -0,0 +1,25 @@
+layer at (0,0) size 1181x585
+  RenderView at (0,0) size 800x585
+layer at (0,0) size 1181x585
+  RenderBlock {HTML} at (0,0) size 772x585
+    RenderBody {BODY} at (8,8) size 756x569
+      RenderInline {SPAN} at (0,0) size 676x29 [border: (2px solid #000000)]
+        RenderText {#text} at (4,4) size 676x17
+          text run at (4,4) width 529: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}"
+          text run at (67,0) width 529: "\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}\x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}"
+          text run at (130,0) width 550: "\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}"
+          text run at (193,0) width 212: "\x{3059}\x{308B}\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}"
+      RenderText {#text} at (193,216) size 7x21
+        text run at (193,216) width 7: " "
+      RenderBR {BR} at (0,0) size 0x0
+      RenderBR {BR} at (252,0) size 0x21
+      RenderInline {SPAN} at (0,0) size 858x35 [border: (5px solid #000000)]
+        RenderText {#text} at (322,7) size 851x14
+          text run at (322,7) width 529: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}"
+          text run at (385,0) width 536: "\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B} \x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}"
+          text run at (448,0) width 550: "\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}"
+          text run at (511,0) width 550: "\x{3059}\x{308B}\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}"
+          text run at (574,0) width 529: "\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}"
+          text run at (637,0) width 529: "\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}"
+          text run at (700,0) width 473: "\x{307E}\x{3059}\x{304B} \x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}"
+      RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.checksum b/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.checksum
new file mode 100644
index 0000000..81ca749
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.checksum
@@ -0,0 +1 @@
+9cd3e64ea9e7e5d87726679af3623a05
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.png b/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.png
new file mode 100644
index 0000000..1248d16
Binary files /dev/null and b/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.txt b/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.txt
new file mode 100644
index 0000000..894547b
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/borders/border-radius-inline-flow-expected.txt
@@ -0,0 +1,11 @@
+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
+      RenderInline {SPAN} at (0,0) size 766x80 [border: (5px solid #000000)]
+        RenderText {#text} at (7,15) size 766x66
+          text run at (7,15) width 409: "This is a span that crosses multiple lines and has a border-radius. "
+          text run at (416,15) width 350: "The border-radius should only apply at the endpoints of"
+          text run at (0,63) width 695: "the span, and the edges that are \"open\" should just be solid right up to the edge (with no rounding or clipping)."
+      RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 683fbae..87afbec 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-10-27  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=48449
+        
+        Make border drawing work correctly with vertical inline flows.  The top and bottom edge have to be omitted
+        rather than the left and right edges.
+        
+        Also discovered that border-radius is broken with the new path-based-drawing code for all inline flows.  This
+        is a regression from the old drawing code.  I patched the code to be correct rather than clipping out stuff
+        that it shouldn't and applying border-radii on lines that don't even have them.
+
+        Added fast/blockflow/border-vertical-lr.html and fast/borders/border-radius-inline-flow.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBorder):
+        (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
+        * rendering/RenderBoxModelObject.h:
+
 2010-10-27  Martin Robinson  <mrobinson at igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index ec065a6..ed1fa69 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -1002,7 +1002,7 @@ static bool borderWillArcInnerEdge(const IntSize& firstRadius, const IntSize& se
 }
 
 void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
-                                       const RenderStyle* style, bool begin, bool end)
+                                       const RenderStyle* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
 {
     if (paintNinePieceImage(graphicsContext, tx, ty, w, h, style, style->borderImage()))
         return;
@@ -1025,10 +1025,12 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
     EBorderStyle leftStyle = style->borderLeftStyle();
     EBorderStyle rightStyle = style->borderRightStyle();
 
-    bool renderTop = topStyle > BHIDDEN && !topTransparent;
-    bool renderLeft = leftStyle > BHIDDEN && begin && !leftTransparent;
-    bool renderRight = rightStyle > BHIDDEN && end && !rightTransparent;
-    bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent;
+    bool horizontal = style->isHorizontalWritingMode();
+
+    bool renderTop = topStyle > BHIDDEN && !topTransparent && (horizontal || includeLogicalLeftEdge);
+    bool renderLeft = leftStyle > BHIDDEN && !leftTransparent && (!horizontal || includeLogicalLeftEdge);
+    bool renderRight = rightStyle > BHIDDEN && !rightTransparent && (!horizontal || includeLogicalRightEdge);
+    bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent && (horizontal || includeLogicalRightEdge);
 
     bool renderRadii = false;
     Path roundedPath;
@@ -1039,32 +1041,52 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
         IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
         style->getBorderRadiiForRect(borderRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
 
-        IntRect innerBorderRect = borderInnerRect(borderRect, style->borderTopWidth(), style->borderBottomWidth(), 
-            style->borderLeftWidth(), style->borderRightWidth());
+        int leftWidth = (!horizontal || includeLogicalLeftEdge) ? style->borderLeftWidth() : 0;
+        int rightWidth = (!horizontal || includeLogicalRightEdge) ? style->borderRightWidth() : 0;
+        int topWidth = (horizontal || includeLogicalLeftEdge) ? style->borderTopWidth() : 0;
+        int bottomWidth = (horizontal || includeLogicalRightEdge) ? style->borderBottomWidth() : 0;
 
+        IntRect innerBorderRect = borderInnerRect(borderRect, topWidth, bottomWidth, leftWidth, rightWidth);
         IntSize innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius;
-        style->getInnerBorderRadiiForRectWithBorderWidths(innerBorderRect, style->borderTopWidth(), style->borderBottomWidth(), 
-            style->borderLeftWidth(), style->borderRightWidth(), innerTopLeftRadius, innerTopRightRadius, 
-            innerBottomLeftRadius, innerBottomRightRadius);
+        
+        style->getInnerBorderRadiiForRectWithBorderWidths(innerBorderRect, topWidth, bottomWidth, leftWidth, rightWidth, innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius);
 
-        if (begin) {
+        IntSize innerTopLeft, innerTopRight, innerBottomLeft, innerBottomRight;
+
+        if (includeLogicalLeftEdge) {
             topLeft = topLeftRadius;
-            bottomLeft = bottomLeftRadius;
+            innerTopLeft = innerTopLeftRadius;
+            if (horizontal) {
+                bottomLeft = bottomLeftRadius;
+                innerBottomLeft = innerBottomLeftRadius;
+            } else {
+                topRight = topRightRadius;
+                innerTopRight = innerTopRightRadius;
+            }
         }
-        if (end) {
-            topRight = topRightRadius;
+
+        if (includeLogicalRightEdge) {
+            if (horizontal) {
+                topRight = topRightRadius;
+                innerTopRight = innerTopRightRadius;
+            } else {
+                bottomLeft = bottomLeftRadius;
+                innerBottomLeft = innerBottomLeftRadius;
+            }
             bottomRight = bottomRightRadius;
+            innerBottomRight = innerBottomRightRadius;
         }
 
-        renderRadii = true;
-
-        // Clip to the inner and outer radii rects.
-        graphicsContext->save();
-        graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
-        graphicsContext->clipOutRoundedRect(innerBorderRect, innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius);
-
-        roundedPath.addRoundedRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
-        graphicsContext->addPath(roundedPath);
+        renderRadii = !topLeft.isZero() || !topRight.isZero() || !bottomLeft.isZero() || !bottomRight.isZero();
+        
+        if (renderRadii) {
+            // Clip to the inner and outer radii rects.
+            graphicsContext->save();
+            graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+            graphicsContext->clipOutRoundedRect(innerBorderRect, innerTopLeft, innerTopRight, innerBottomLeft, innerBottomRight);
+            roundedPath.addRoundedRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+            graphicsContext->addPath(roundedPath);
+        }
     }
 
     bool upperLeftBorderStylesMatch = renderLeft && (topStyle == leftStyle) && (topColor == leftColor);
@@ -1078,7 +1100,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
 
         if (renderRadii && borderWillArcInnerEdge(topLeft, topRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderTopWidth())) {
             graphicsContext->save();
-            clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style);
+            clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
             float thickness = max(max(style->borderTopWidth(), style->borderLeftWidth()), style->borderRightWidth());
             drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderTopWidth(), thickness, BSTop, style, topColor, topStyle);
             graphicsContext->restore();
@@ -1099,7 +1121,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
 
         if (renderRadii && borderWillArcInnerEdge(bottomLeft, bottomRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderBottomWidth())) {
             graphicsContext->save();
-            clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style);
+            clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
             float thickness = max(max(style->borderBottomWidth(), style->borderLeftWidth()), style->borderRightWidth());
             drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderBottomWidth(), thickness, BSBottom, style, bottomColor, bottomStyle);
             graphicsContext->restore();
@@ -1122,7 +1144,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
 
         if (renderRadii && borderWillArcInnerEdge(bottomLeft, topLeft, style->borderBottomWidth(), style->borderTopWidth(), style->borderLeftWidth())) {
             graphicsContext->save();
-            clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style);
+            clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
             float thickness = max(max(style->borderLeftWidth(), style->borderTopWidth()), style->borderBottomWidth());
             drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderLeftWidth(), thickness, BSLeft, style, leftColor, leftStyle);
             graphicsContext->restore();
@@ -1141,7 +1163,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
     if (renderRight) {
         if (renderRadii && borderWillArcInnerEdge(bottomRight, topRight, style->borderBottomWidth(), style->borderTopWidth(), style->borderRightWidth())) {
             graphicsContext->save();
-            clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style);
+            clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
             float thickness = max(max(style->borderRightWidth(), style->borderTopWidth()), style->borderBottomWidth());
             drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderRightWidth(), thickness, BSRight, style, rightColor, rightStyle);
             graphicsContext->restore();
@@ -1168,7 +1190,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
 }
 #else
 void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
-                                       const RenderStyle* style, bool begin, bool end)
+                                       const RenderStyle* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
 {
     // FIXME: This old version of paintBorder should be removed when all ports implement 
     // GraphicsContext::clipConvexPolygon()!! This should happen soon.
@@ -1190,10 +1212,10 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
     EBorderStyle leftStyle = style->borderLeftStyle();
     EBorderStyle rightStyle = style->borderRightStyle();
 
-    bool renderTop = topStyle > BHIDDEN && !topTransparent;
-    bool renderLeft = leftStyle > BHIDDEN && begin && !leftTransparent;
-    bool renderRight = rightStyle > BHIDDEN && end && !rightTransparent;
-    bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent;
+    bool renderTop = topStyle > BHIDDEN && !topTransparent && (horizontal || includeLogicalLeftEdge);
+    bool renderLeft = leftStyle > BHIDDEN && !leftTransparent && (!horizontal || includeLogicalLeftEdge);
+    bool renderRight = rightStyle > BHIDDEN && !rightTransparent && (!horizontal || includeLogicalRightEdge);
+    bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent && (horizontal || includeLogicalRightEdge);
 
     bool renderRadii = false;
     IntSize topLeft, topRight, bottomLeft, bottomRight;
@@ -1204,20 +1226,29 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
         IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
         style->getBorderRadiiForRect(borderRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
 
-        if (begin) {
+        if (includeLogicalLeftEdge) {
             topLeft = topLeftRadius;
-            bottomLeft = bottomLeftRadius;
+            if (horizontal)
+                bottomLeft = bottomLeftRadius;
+            else
+                topRight = topRightRadius;
         }
-        if (end) {
-            topRight = topRightRadius;
+        
+        if (includeLogicalRightEdge) {
+            if (horizontal)
+                topRight = topRightRadius;
+            else
+                bottomLeft = bottomLeftRadius;
             bottomRight = bottomRightRadius;
         }
 
-        renderRadii = true;
-
-        // Clip to the rounded rectangle.
-        graphicsContext->save();
-        graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+        renderRadii = !topLeft.isZero() || !topRight.isZero() || !bottomLeft.isZero() || !bottomRight.isZero();
+        
+        if (renderRadii) {
+            // Clip to the rounded rectangle.
+            graphicsContext->save();
+            graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+        }
     }
 
     int firstAngleStart, secondAngleStart, firstAngleSpan, secondAngleSpan;
@@ -1519,7 +1550,9 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
 }
 #endif
 
-void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style)
+void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight,
+                                                 const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style,
+                                                 bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
 {
     FloatPoint quad[4];
     int tx = box.x();
@@ -1527,47 +1560,37 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContex
     int w = box.width();
     int h = box.height();
 
+    bool horizontal = style->isHorizontalWritingMode();
+    int leftWidth = (!horizontal || includeLogicalLeftEdge) ? style->borderLeftWidth() : 0;
+    int rightWidth = (!horizontal || includeLogicalRightEdge) ? style->borderRightWidth() : 0;
+    int topWidth = (horizontal || includeLogicalLeftEdge) ? style->borderTopWidth() : 0;
+    int bottomWidth = (horizontal || includeLogicalRightEdge) ? style->borderBottomWidth() : 0;
+
     // For each side, create an array of FloatPoints where each point is based on whichever value in each corner
     // is larger -- the radius width/height or the border width/height -- as appropriate.
     switch (side) {
     case BSTop:
         quad[0] = FloatPoint(tx, ty);
-        quad[1] = FloatPoint(
-            tx + max(topLeft.width(), (int) style->borderLeftWidth()), 
-            ty + max(topLeft.height(), (int) style->borderTopWidth()));
-        quad[2] = FloatPoint(
-            tx + w - max(topRight.width(), (int) style->borderRightWidth()), 
-            ty + max(topRight.height(), (int)style->borderTopWidth()));
+        quad[1] = FloatPoint(tx + max(topLeft.width(), leftWidth), ty + max(topLeft.height(), topWidth));
+        quad[2] = FloatPoint(tx + w - max(topRight.width(), rightWidth), ty + max(topRight.height(), topWidth));
         quad[3] = FloatPoint(tx + w, ty);
         break;
     case BSLeft:
         quad[0] = FloatPoint(tx, ty);
-        quad[1] = FloatPoint(
-            tx + max(topLeft.width(), (int) style->borderLeftWidth()), 
-            ty + max(topLeft.height(), (int) style->borderTopWidth()));
-        quad[2] = FloatPoint(
-            tx + max(bottomLeft.width(), (int) style->borderLeftWidth()), 
-            ty + h - max(bottomLeft.height(), (int)style->borderBottomWidth()));
+        quad[1] = FloatPoint(tx + max(topLeft.width(), leftWidth), ty + max(topLeft.height(), topWidth));
+        quad[2] = FloatPoint(tx + max(bottomLeft.width(), leftWidth), ty + h - max(bottomLeft.height(), bottomWidth));
         quad[3] = FloatPoint(tx, ty + h);
         break;
     case BSBottom:
         quad[0] = FloatPoint(tx, ty + h);
-        quad[1] = FloatPoint(
-            tx + max(bottomLeft.width(), (int) style->borderLeftWidth()), 
-            ty + h - max(bottomLeft.height(), (int)style->borderBottomWidth()));
-        quad[2] = FloatPoint(
-            tx + w - max(bottomRight.width(), (int) style->borderRightWidth()), 
-            ty + h - max(bottomRight.height(), (int)style->borderBottomWidth()));
+        quad[1] = FloatPoint(tx + max(bottomLeft.width(), leftWidth), ty + h - max(bottomLeft.height(), bottomWidth));
+        quad[2] = FloatPoint(tx + w - max(bottomRight.width(), rightWidth), ty + h - max(bottomRight.height(), bottomWidth));
         quad[3] = FloatPoint(tx + w, ty + h);
         break;
     case BSRight:
         quad[0] = FloatPoint(tx + w, ty);
-        quad[1] = FloatPoint(
-            tx + w - max(topRight.width(), (int) style->borderRightWidth()), 
-            ty + max(topRight.height(), (int) style->borderTopWidth()));
-        quad[2] = FloatPoint(
-            tx + w - max(bottomRight.width(), (int) style->borderRightWidth()), 
-            ty + h - max(bottomRight.height(), (int)style->borderBottomWidth()));
+        quad[1] = FloatPoint(tx + w - max(topRight.width(), rightWidth), ty + max(topRight.height(), topWidth));
+        quad[2] = FloatPoint(tx + w - max(bottomRight.width(), rightWidth), ty + h - max(bottomRight.height(), bottomWidth));
         quad[3] = FloatPoint(tx + w, ty + h);
         break;
     default:
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index 33d7ca2..f7f79d9 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -109,7 +109,7 @@ public:
 
     virtual void childBecameNonInline(RenderObject* /*child*/) { }
 
-    void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true);
+    void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
     bool paintNinePieceImage(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
     void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, ShadowStyle, bool begin = true, bool end = true);
     void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int width, int height, InlineFlowBox* = 0, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
@@ -137,7 +137,9 @@ private:
 
     IntSize calculateFillTileSize(const FillLayer*, IntSize scaledSize) const;
 
-    void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style);
+    void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft,
+                               const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style,
+                               bool includeLogicalLeftEdge, bool includeLogicalRightEdge);
 
     friend class RenderView;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list