Title: [136712] trunk
Revision
136712
Author
[email protected]
Date
2012-12-05 10:22:34 -0800 (Wed, 05 Dec 2012)

Log Message

REGRESSION(r126683): Table cell are getting borders when the style doesn't mention any
https://bugs.webkit.org/show_bug.cgi?id=101677

Reviewed by Julien Chaffraix.

Source/WebCore:

The bordercolor attribute on a cell or row has no effect on FF and Opera, even when the parent
table has a border attribute. IE displays the bordercolor of the cell and row in all cases except when
the parent has no border attribute. WebKit's old behaviour (before r126683) was to display the
bordercolor of the row but not the cells (I don't think this behaviour was particularly deliberate). No
browser displays the bordercolor for a col or tbody element.

Bring WebKit into line with Opera and FF by ignoring the bordercolor attribute on cells, rows, cols, rowgroups, and
colgroups in all cases, regardless of whether the table has a border or not.

Test: fast/table/td-bordercolor-attribute.html

* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::isPresentationAttribute):
(WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute):

LayoutTests:

* fast/table/td-bordercolor-attribute-expected.txt: Added.
* fast/table/td-bordercolor-attribute.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (136711 => 136712)


--- trunk/LayoutTests/ChangeLog	2012-12-05 18:07:32 UTC (rev 136711)
+++ trunk/LayoutTests/ChangeLog	2012-12-05 18:22:34 UTC (rev 136712)
@@ -1,3 +1,13 @@
+2012-12-05  Robert Hogan  <[email protected]>
+
+        REGRESSION(r126683): Table cell are getting borders when the style doesn't mention any
+        https://bugs.webkit.org/show_bug.cgi?id=101677
+
+        Reviewed by Julien Chaffraix.
+
+        * fast/table/td-bordercolor-attribute-expected.txt: Added.
+        * fast/table/td-bordercolor-attribute.html: Added.
+
 2012-12-05  Zan Dobersek  <[email protected]>
 
         Unreviewed gardening.

Added: trunk/LayoutTests/fast/table/td-bordercolor-attribute-expected.txt (0 => 136712)


--- trunk/LayoutTests/fast/table/td-bordercolor-attribute-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/table/td-bordercolor-attribute-expected.txt	2012-12-05 18:22:34 UTC (rev 136712)
@@ -0,0 +1,33 @@
+There should be no red below. 
+The bordercolor attribute on a cell or row should have no effect. 
+https://bugs.webkit.org/show_bug.cgi?id=101677
+
+PASS document.defaultView.getComputedStyle(cell, null).getPropertyValue("border-top-color") is "rgb(0, 0, 0)"
+PASS document.defaultView.getComputedStyle(cell, null).getPropertyValue("border-top-width") is "0px"
+PASS document.defaultView.getComputedStyle(table, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(table, null).getPropertyValue("border-top-width") is "0px"
+PASS document.defaultView.getComputedStyle(cell2, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(cell2, null).getPropertyValue("border-top-width") is "1px"
+PASS document.defaultView.getComputedStyle(table2, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(table2, null).getPropertyValue("border-top-width") is "1px"
+PASS document.defaultView.getComputedStyle(cell3, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(cell3, null).getPropertyValue("border-top-width") is "1px"
+PASS document.defaultView.getComputedStyle(table3, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(table3, null).getPropertyValue("border-top-width") is "2px"
+PASS document.defaultView.getComputedStyle(row4, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(row4, null).getPropertyValue("border-top-width") is "0px"
+PASS document.defaultView.getComputedStyle(table4, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(table4, null).getPropertyValue("border-top-width") is "2px"
+PASS document.defaultView.getComputedStyle(col5, null).getPropertyValue("border-top-color") is "rgb(0, 0, 0)"
+PASS document.defaultView.getComputedStyle(col5, null).getPropertyValue("border-top-width") is "0px"
+PASS document.defaultView.getComputedStyle(table5, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(table5, null).getPropertyValue("border-top-width") is "2px"
+PASS document.defaultView.getComputedStyle(tbody6, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(tbody6, null).getPropertyValue("border-top-width") is "0px"
+PASS document.defaultView.getComputedStyle(table6, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(table6, null).getPropertyValue("border-top-width") is "2px"
+PASS document.defaultView.getComputedStyle(col7, null).getPropertyValue("border-top-color") is "rgb(0, 0, 0)"
+PASS document.defaultView.getComputedStyle(col7, null).getPropertyValue("border-top-width") is "0px"
+PASS document.defaultView.getComputedStyle(table7, null).getPropertyValue("border-top-color") is "rgb(128, 128, 128)"
+PASS document.defaultView.getComputedStyle(table7, null).getPropertyValue("border-top-width") is "2px"
+

Added: trunk/LayoutTests/fast/table/td-bordercolor-attribute.html (0 => 136712)


--- trunk/LayoutTests/fast/table/td-bordercolor-attribute.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/td-bordercolor-attribute.html	2012-12-05 18:22:34 UTC (rev 136712)
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<head>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+</script>
+<script src=""
+</head>
+<body>
+
+    <p>There should be no red below. <br> 
+    The bordercolor attribute on a cell or row should have no effect. <br>
+    https://bugs.webkit.org/show_bug.cgi?id=101677</p> 
+
+    <table id="table" border="0" width="100%" height="100%">
+        <tr>
+            <td id="cell" bordercolor="red" height="26"></td>
+        </tr>
+    </table>
+
+    <table id="table2" border="" width="100%" height="100%">
+        <tr>
+            <td id="cell2" bordercolor="red" height="26"></td>
+        </tr>
+    </table>
+
+    <table id="table3" border="2" width="100%" height="100%">
+        <tr>
+            <td id="cell3" bordercolor="red" height="26"></td>
+        </tr>
+    </table>
+
+    <table id="table4" border="2" width="100%" height="100%">
+        <tr id="row4" bordercolor="red">
+            <td height="26"></td>
+        </tr>
+    </table>
+
+    <table id="table5" border="2" width="100%" height="100%">
+        <tbody>
+        <col id="col5" bordercolor="red">
+        <tr>
+            <td height="26"></td>
+        </tr>
+        </tbody>
+    </table>
+
+    <table id="table6" border="2" width="100%" height="100%">
+        <tbody id="tbody6" bordercolor="red">
+        <tr>
+            <td height="26"></td>
+        </tr>
+        </tbody>
+    </table>
+
+    <table id="table7" border="2" width="100%" height="100%">
+        <tbody>
+        <colgroup id="col7" bordercolor="red">
+            <col>
+        </colgroup>
+        <tr>
+            <td height="26"></td>
+        </tr>
+        </tbody>
+    </table>
+
+    <div id="console"></div>
+    
+    <script>
+    shouldBeEqualToString('document.defaultView.getComputedStyle(cell, null).getPropertyValue("border-top-color")', "rgb(0, 0, 0)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(cell, null).getPropertyValue("border-top-width")', "0px");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table, null).getPropertyValue("border-top-width")', "0px");
+
+    shouldBeEqualToString('document.defaultView.getComputedStyle(cell2, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(cell2, null).getPropertyValue("border-top-width")', "1px");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table2, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table2, null).getPropertyValue("border-top-width")', "1px");
+
+    shouldBeEqualToString('document.defaultView.getComputedStyle(cell3, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(cell3, null).getPropertyValue("border-top-width")', "1px");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table3, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table3, null).getPropertyValue("border-top-width")', "2px");
+
+    shouldBeEqualToString('document.defaultView.getComputedStyle(row4, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(row4, null).getPropertyValue("border-top-width")', "0px");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table4, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table4, null).getPropertyValue("border-top-width")', "2px");
+
+    shouldBeEqualToString('document.defaultView.getComputedStyle(col5, null).getPropertyValue("border-top-color")', "rgb(0, 0, 0)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(col5, null).getPropertyValue("border-top-width")', "0px");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table5, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table5, null).getPropertyValue("border-top-width")', "2px");
+
+    shouldBeEqualToString('document.defaultView.getComputedStyle(tbody6, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(tbody6, null).getPropertyValue("border-top-width")', "0px");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table6, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table6, null).getPropertyValue("border-top-width")', "2px");
+
+    shouldBeEqualToString('document.defaultView.getComputedStyle(col7, null).getPropertyValue("border-top-color")', "rgb(0, 0, 0)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(col7, null).getPropertyValue("border-top-width")', "0px");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table7, null).getPropertyValue("border-top-color")', "rgb(128, 128, 128)");
+    shouldBeEqualToString('document.defaultView.getComputedStyle(table7, null).getPropertyValue("border-top-width")', "2px");
+
+    </script>
+</body>

Modified: trunk/Source/WebCore/ChangeLog (136711 => 136712)


--- trunk/Source/WebCore/ChangeLog	2012-12-05 18:07:32 UTC (rev 136711)
+++ trunk/Source/WebCore/ChangeLog	2012-12-05 18:22:34 UTC (rev 136712)
@@ -1,3 +1,25 @@
+2012-12-05  Robert Hogan  <[email protected]>
+
+        REGRESSION(r126683): Table cell are getting borders when the style doesn't mention any
+        https://bugs.webkit.org/show_bug.cgi?id=101677
+
+        Reviewed by Julien Chaffraix.
+
+        The bordercolor attribute on a cell or row has no effect on FF and Opera, even when the parent
+        table has a border attribute. IE displays the bordercolor of the cell and row in all cases except when
+        the parent has no border attribute. WebKit's old behaviour (before r126683) was to display the
+        bordercolor of the row but not the cells (I don't think this behaviour was particularly deliberate). No
+        browser displays the bordercolor for a col or tbody element.
+
+        Bring WebKit into line with Opera and FF by ignoring the bordercolor attribute on cells, rows, cols, rowgroups, and
+        colgroups in all cases, regardless of whether the table has a border or not.
+
+        Test: fast/table/td-bordercolor-attribute.html
+
+        * html/HTMLTablePartElement.cpp:
+        (WebCore::HTMLTablePartElement::isPresentationAttribute):
+        (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute):
+
 2012-12-05  Krzysztof Czech  <[email protected]>
 
         [EFL][WK2] Introduce WebKit-EFL to Assistive Technologies

Modified: trunk/Source/WebCore/html/HTMLTablePartElement.cpp (136711 => 136712)


--- trunk/Source/WebCore/html/HTMLTablePartElement.cpp	2012-12-05 18:07:32 UTC (rev 136711)
+++ trunk/Source/WebCore/html/HTMLTablePartElement.cpp	2012-12-05 18:22:34 UTC (rev 136712)
@@ -40,7 +40,7 @@
 
 bool HTMLTablePartElement::isPresentationAttribute(const QualifiedName& name) const
 {
-    if (name == bgcolorAttr || name == backgroundAttr || name == bordercolorAttr || name == valignAttr || name == alignAttr || name == heightAttr)
+    if (name == bgcolorAttr || name == backgroundAttr || name == valignAttr || name == alignAttr || name == heightAttr)
         return true;
     return HTMLElement::isPresentationAttribute(name);
 }
@@ -53,11 +53,6 @@
         String url = ""
         if (!url.isEmpty())
             style->setProperty(CSSProperty(CSSPropertyBackgroundImage, CSSImageValue::create(document()->completeURL(url).string())));
-    } else if (attribute.name() == bordercolorAttr) {
-        if (!attribute.value().isEmpty()) {
-            addHTMLColorToStyle(style, CSSPropertyBorderColor, attribute.value());
-            addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderStyle, CSSValueSolid);
-        }
     } else if (attribute.name() == valignAttr) {
         if (equalIgnoringCase(attribute.value(), "top"))
             addPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, CSSValueTop);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to