Section's collapsed borders painted in wrong place in rtl tables
authorrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2013 18:07:00 +0000 (18:07 +0000)
committerrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2013 18:07:00 +0000 (18:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119691

Reviewed by Darin Adler.

Source/WebCore:

Table row-groups can be RTL too, so look to the section rather than the
table when deciding the direction of a row. The section will inherit the
table's direction if it doesn't override it.

Test: fast/table/paint-collapsed-borders-rtl-section.html

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::hasStartBorderAdjoiningTable):
(WebCore::RenderTableCell::hasEndBorderAdjoiningTable):

LayoutTests:

* fast/table/paint-collapsed-borders-rtl-section-expected.html: Added.
* fast/table/paint-collapsed-borders-rtl-section.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/table/paint-collapsed-borders-rtl-section-expected.html [new file with mode: 0644]
LayoutTests/fast/table/paint-collapsed-borders-rtl-section.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTableCell.cpp

index c38b2adaafafae3534c235ff8b40bc82a0de3b5c..12f35243dfab9b5a21e761242f7ba4c7c12b0762 100644 (file)
@@ -1,3 +1,13 @@
+2013-08-13  Robert Hogan  <robert@webkit.org>
+
+        Section's collapsed borders painted in wrong place in rtl tables
+        https://bugs.webkit.org/show_bug.cgi?id=119691
+
+        Reviewed by Darin Adler.
+
+        * fast/table/paint-collapsed-borders-rtl-section-expected.html: Added.
+        * fast/table/paint-collapsed-borders-rtl-section.html: Added.
+
 2013-08-13  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         NodeList.item() does not behave according to specification
diff --git a/LayoutTests/fast/table/paint-collapsed-borders-rtl-section-expected.html b/LayoutTests/fast/table/paint-collapsed-borders-rtl-section-expected.html
new file mode 100644 (file)
index 0000000..455bef8
--- /dev/null
@@ -0,0 +1,39 @@
+<!doctype html>
+<head>
+<style>
+table  {
+    border: solid 20px red; 
+    border-collapse: collapse;
+}
+#tbody1  {
+    border: solid 20px blue; 
+}
+td  {
+    height: 20px;
+    width: 20px;
+}
+</style>
+</head>
+<body>
+<table>
+    <p> webkit.org/b/119691: Paint collapsed section borders correctly when the section has rtl direction.
+       <tbody id="tbody1">
+        <tr>
+            <td></td>
+            <td></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td></td>
+            <td></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td></td>
+            <td></td>
+            <td></td>
+        </tr>
+    </tbody>
+</table>
+</body
+</html>
diff --git a/LayoutTests/fast/table/paint-collapsed-borders-rtl-section.html b/LayoutTests/fast/table/paint-collapsed-borders-rtl-section.html
new file mode 100644 (file)
index 0000000..63f89aa
--- /dev/null
@@ -0,0 +1,40 @@
+<!doctype html>
+<head>
+<style>
+table  {
+    border: solid 20px red; 
+    border-collapse: collapse;
+}
+#tbody1  {
+    border: solid 20px blue; 
+    direction: rtl;
+}
+td  {
+    height: 20px;
+    width: 20px;
+}
+</style>
+</head>
+<body>
+<table>
+    <p> webkit.org/b/119691: Paint collapsed section borders correctly when the section has rtl direction.
+       <tbody id="tbody1">
+        <tr>
+            <td></td>
+            <td></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td></td>
+            <td></td>
+            <td></td>
+        </tr>
+        <tr>
+            <td></td>
+            <td></td>
+            <td></td>
+        </tr>
+    </tbody>
+</table>
+</body
+</html>
index e5d8e993ccddf6807e75359e7cf0f9ba76ea1dfe..e320232dec27d0c686ce5aeb04822ab3328748bd 100644 (file)
@@ -1,3 +1,20 @@
+2013-08-13  Robert Hogan  <robert@webkit.org>
+
+        Section's collapsed borders painted in wrong place in rtl tables
+        https://bugs.webkit.org/show_bug.cgi?id=119691
+
+        Reviewed by Darin Adler.
+
+        Table row-groups can be RTL too, so look to the section rather than the
+        table when deciding the direction of a row. The section will inherit the
+        table's direction if it doesn't override it.
+
+        Test: fast/table/paint-collapsed-borders-rtl-section.html
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::hasStartBorderAdjoiningTable):
+        (WebCore::RenderTableCell::hasEndBorderAdjoiningTable):
+
 2013-08-13  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         NodeList.item() does not behave according to specification
index 9b0d57cd360c0b1a2e814d281740884bf8e2f806..0843ac222ad458b653dad9c9a276e9742b79156c 100644 (file)
@@ -484,7 +484,7 @@ bool RenderTableCell::hasStartBorderAdjoiningTable() const
 {
     bool isStartColumn = !col();
     bool isEndColumn = table()->colToEffCol(col() + colSpan() - 1) == table()->numEffCols() - 1;
-    bool hasSameDirectionAsTable = hasSameDirectionAs(table());
+    bool hasSameDirectionAsTable = hasSameDirectionAs(section());
 
     // The table direction determines the row direction. In mixed directionality, we cannot guarantee that
     // we have a common border with the table (think a ltr table with rtl start cell).
@@ -495,7 +495,7 @@ bool RenderTableCell::hasEndBorderAdjoiningTable() const
 {
     bool isStartColumn = !col();
     bool isEndColumn = table()->colToEffCol(col() + colSpan() - 1) == table()->numEffCols() - 1;
-    bool hasSameDirectionAsTable = hasSameDirectionAs(table());
+    bool hasSameDirectionAsTable = hasSameDirectionAs(section());
 
     // The table direction determines the row direction. In mixed directionality, we cannot guarantee that
     // we have a common border with the table (think a ltr table with ltr end cell).