https://bugs.webkit.org/show_bug.cgi?id=21664
Patch by Gurpreet Kaur <k.gurpreet@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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160410
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-12-10 Gurpreet Kaur <k.gurpreet@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.czech@samsung.com>
AX: Share accessibility/aria-hidden-negates-no-visibility.html expectation with other ports
--- /dev/null
+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
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../../../resources/js-test-pre.js"></script>
+ <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>
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]
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)]
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]
+2013-12-10 Gurpreet Kaur <k.gurpreet@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 <bdakin@apple.com>
Horizontal rubber-banding without a horizontal scrollbar is distracting
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;