Title: [160410] trunk
Revision
160410
Author
commit-qu...@webkit.org
Date
2013-12-10 21:57:01 -0800 (Tue, 10 Dec 2013)

Log Message

top and bottom black background line not getting displayed
https://bugs.webkit.org/show_bug.cgi?id=21664

Patch by Gurpreet Kaur <k.gurpr...@samsung.com> on 2013-12-10
Reviewed by Simon Fraser.

Source/WebCore:

The table cell's background was not being displayed. Since the table
cell had no child correct offsetWidth was not being set even if table
width is being defined.

Test: fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html

* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
cellHasContent should also be set to true incase background color is
present.

LayoutTests:

* fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt: Added.
* fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html: Added.
Added new test case to verify that table cell offsetWidth is set even
when it has no contents but has background color.
* fast/table/auto-100-percent-width-expected.txt:
* platform/mac/fast/table/empty-cells-expected.txt:
* tables/mozilla/bugs/bug1818-6-expected.txt:
Rebaselining the existing test case as per the new changes. The new
dimension changes are as per mozilla behaviour. For
auto-100-percent-width-expected.txt we get 1 px red background because
if cellHasContent we set columnLayout's minLogicalWidth and
columnLayout's maxLogicalWidth as 1 initially even if cell is empty.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (160409 => 160410)


--- trunk/LayoutTests/ChangeLog	2013-12-11 04:44:39 UTC (rev 160409)
+++ trunk/LayoutTests/ChangeLog	2013-12-11 05:57:01 UTC (rev 160410)
@@ -1,3 +1,23 @@
+2013-12-10  Gurpreet Kaur  <k.gurpr...@samsung.com>
+
+        top and bottom black background line not getting displayed
+        https://bugs.webkit.org/show_bug.cgi?id=21664
+
+        Reviewed by Simon Fraser.
+
+        * fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt: Added.
+        * fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html: Added.
+        Added new test case to verify that table cell offsetWidth is set even
+        when it has no contents but has background color.
+        * fast/table/auto-100-percent-width-expected.txt:
+        * platform/mac/fast/table/empty-cells-expected.txt:
+        * tables/mozilla/bugs/bug1818-6-expected.txt:
+        Rebaselining the existing test case as per the new changes. The new
+        dimension changes are as per mozilla behaviour. For
+        auto-100-percent-width-expected.txt we get 1 px red background because
+        if cellHasContent we set columnLayout's minLogicalWidth and 
+        columnLayout's maxLogicalWidth as 1 initially even if cell is empty.
+
 2013-12-10  Krzysztof Czech  <k.cz...@samsung.com>
 
         AX: Share accessibility/aria-hidden-negates-no-visibility.html expectation with other ports

Added: trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt (0 => 160410)


--- trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt	2013-12-11 05:57:01 UTC (rev 160410)
@@ -0,0 +1,10 @@
+Tests that the table cell width is set properly even when the table cell has no child and its table has width defined
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.getElementById('nochildTd').offsetWidth is 750
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Property changes on: trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html (0 => 160410)


--- trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html	2013-12-11 05:57:01 UTC (rev 160410)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script src=""
+        <script>
+            function runTest() {
+                description('Tests that the table cell width is set properly even when the table cell has no child and its table has width defined');
+
+                shouldBe("document.getElementById('nochildTd').offsetWidth","750");
+                isSuccessfullyParsed();
+            }
+        </script>
+    </head>
+    <body _onload_="runTest()">
+        <table  width="750px" border="0" cellpadding="0" cellspacing="0">
+            <tr>
+                <td id="nochildTd" height="1px" bgcolor=#000000></td>
+            </tr>
+        </table>
+    </body>
+</html>
Property changes on: trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html
___________________________________________________________________

Added: svn:executable

Modified: trunk/LayoutTests/fast/table/auto-100-percent-width-expected.txt (160409 => 160410)


--- trunk/LayoutTests/fast/table/auto-100-percent-width-expected.txt	2013-12-11 04:44:39 UTC (rev 160409)
+++ trunk/LayoutTests/fast/table/auto-100-percent-width-expected.txt	2013-12-11 05:57:01 UTC (rev 160410)
@@ -8,5 +8,5 @@
     RenderTable {TABLE} at (0,0) size 480x540
       RenderTableSection {TBODY} at (0,0) size 480x540
         RenderTableRow {TR} at (0,0) size 480x540
-          RenderTableCell {TD} at (0,269) size 480x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
-          RenderTableCell {TD} at (480,270) size 0x0 [bgcolor=#FF0000] [r=0 c=1 rs=1 cs=1]
+          RenderTableCell {TD} at (0,269) size 479x2 [bgcolor=#008000] [r=0 c=0 rs=1 cs=1]
+          RenderTableCell {TD} at (479,270) size 1x0 [bgcolor=#FF0000] [r=0 c=1 rs=1 cs=1]

Modified: trunk/LayoutTests/platform/mac/fast/table/empty-cells-expected.txt (160409 => 160410)


--- trunk/LayoutTests/platform/mac/fast/table/empty-cells-expected.txt	2013-12-11 04:44:39 UTC (rev 160409)
+++ trunk/LayoutTests/platform/mac/fast/table/empty-cells-expected.txt	2013-12-11 05:57:01 UTC (rev 160410)
@@ -78,8 +78,8 @@
       RenderTable {TABLE} at (0,292) size 785x29 [border: (2px solid #000000)]
         RenderTableSection {TBODY} at (2,2) size 781x25
           RenderTableRow {TR} at (0,0) size 781x25
-            RenderTableCell {TD} at (0,12) size 0x0 [bgcolor=#FFFF00] [r=0 c=0 rs=1 cs=1]
-            RenderTableCell {TD} at (0,3) size 781x18 [bgcolor=#FF0000] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (0,12) size 391x0 [bgcolor=#FFFF00] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {TD} at (391,3) size 390x18 [bgcolor=#FF0000] [r=0 c=1 rs=1 cs=1]
               RenderText {#text} at (0,0) size 261x18
                 text run at (0,0) width 261: "First cell empty but has background color"
       RenderTable {TABLE} at (0,321) size 785x54 [border: (2px solid #000000)]

Modified: trunk/LayoutTests/tables/mozilla/bugs/bug1818-6-expected.txt (160409 => 160410)


--- trunk/LayoutTests/tables/mozilla/bugs/bug1818-6-expected.txt	2013-12-11 04:44:39 UTC (rev 160409)
+++ trunk/LayoutTests/tables/mozilla/bugs/bug1818-6-expected.txt	2013-12-11 05:57:01 UTC (rev 160410)
@@ -6,6 +6,6 @@
       RenderTable {TABLE} at (0,0) size 784x0
         RenderTableSection {TBODY} at (0,0) size 784x0
           RenderTableRow {TR} at (0,0) size 784x0
-            RenderTableCell {TD} at (0,0) size 772x0 [bgcolor=#0000CC] [r=0 c=0 rs=1 cs=1]
-            RenderTableCell {TD} at (772,0) size 12x0 [bgcolor=#00CC00] [r=0 c=1 rs=1 cs=1]
-            RenderTableCell {TD} at (784,0) size 0x0 [bgcolor=#CC0000] [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (0,0) size 400x0 [bgcolor=#0000CC] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {TD} at (400,0) size 6x0 [bgcolor=#00CC00] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (406,0) size 378x0 [bgcolor=#CC0000] [r=0 c=2 rs=1 cs=1]

Modified: trunk/Source/WebCore/ChangeLog (160409 => 160410)


--- trunk/Source/WebCore/ChangeLog	2013-12-11 04:44:39 UTC (rev 160409)
+++ trunk/Source/WebCore/ChangeLog	2013-12-11 05:57:01 UTC (rev 160410)
@@ -1,3 +1,21 @@
+2013-12-10  Gurpreet Kaur  <k.gurpr...@samsung.com>
+
+        top and bottom black background line not getting displayed
+        https://bugs.webkit.org/show_bug.cgi?id=21664
+
+        Reviewed by Simon Fraser.
+
+        The table cell's background was not being displayed. Since the table
+        cell had no child correct offsetWidth was not being set even if table
+        width is being defined.
+
+        Test: fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html
+
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::AutoTableLayout::recalcColumn):
+        cellHasContent should also be set to true incase background color is
+        present.
+
 2013-12-10  Beth Dakin  <bda...@apple.com>
 
         Horizontal rubber-banding without a horizontal scrollbar is distracting

Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (160409 => 160410)


--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2013-12-11 04:44:39 UTC (rev 160409)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2013-12-11 05:57:01 UTC (rev 160410)
@@ -63,7 +63,7 @@
                 if (current.inColSpan || !cell)
                     continue;
 
-                bool cellHasContent = cell->firstChild() || cell->style().hasBorder() || cell->style().hasPadding();
+                bool cellHasContent = cell->firstChild() || cell->style().hasBorder() || cell->style().hasPadding() || cell->style().hasBackground();
                 if (cellHasContent)
                     columnLayout.emptyCellsOnly = false;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to