<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160410] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160410">160410</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-10 21:57:01 -0800 (Tue, 10 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>top and bottom black background line not getting displayed
https://bugs.webkit.org/show_bug.cgi?id=21664

Patch by Gurpreet Kaur &lt;k.gurpreet@samsung.com&gt; 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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasttableauto100percentwidthexpectedtxt">trunk/LayoutTests/fast/table/auto-100-percent-width-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasttableemptycellsexpectedtxt">trunk/LayoutTests/platform/mac/fast/table/empty-cells-expected.txt</a></li>
<li><a href="#trunkLayoutTeststablesmozillabugsbug18186expectedtxt">trunk/LayoutTests/tables/mozilla/bugs/bug1818-6-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingAutoTableLayoutcpp">trunk/Source/WebCore/rendering/AutoTableLayout.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomHTMLTableElementempytablecellwithbackgroundcolorexpectedtxt">trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLTableElementempytablecellwithbackgroundcolorhtml">trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160409 => 160410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-11 04:44:39 UTC (rev 160409)
+++ trunk/LayoutTests/ChangeLog        2013-12-11 05:57:01 UTC (rev 160410)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2013-12-10  Gurpreet Kaur  &lt;k.gurpreet@samsung.com&gt;
+
+        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.
+
</ins><span class="cx"> 2013-12-10  Krzysztof Czech  &lt;k.czech@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Share accessibility/aria-hidden-negates-no-visibility.html expectation with other ports
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLTableElementempytablecellwithbackgroundcolorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt (0 => 160410)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.getElementById('nochildTd').offsetWidth is 750
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="trunkLayoutTestsfastdomHTMLTableElementempytablecellwithbackgroundcolorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html (0 => 160410)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+        &lt;script&gt;
+            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(&quot;document.getElementById('nochildTd').offsetWidth&quot;,&quot;750&quot;);
+                isSuccessfullyParsed();
+            }
+        &lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body onload=&quot;runTest()&quot;&gt;
+        &lt;table  width=&quot;750px&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
+            &lt;tr&gt;
+                &lt;td id=&quot;nochildTd&quot; height=&quot;1px&quot; bgcolor=#000000&gt;&lt;/td&gt;
+            &lt;/tr&gt;
+        &lt;/table&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/dom/HTMLTableElement/empy-table-cell-with-background-color.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="trunkLayoutTestsfasttableauto100percentwidthexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/table/auto-100-percent-width-expected.txt (160409 => 160410)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -8,5 +8,5 @@
</span><span class="cx">     RenderTable {TABLE} at (0,0) size 480x540
</span><span class="cx">       RenderTableSection {TBODY} at (0,0) size 480x540
</span><span class="cx">         RenderTableRow {TR} at (0,0) size 480x540
</span><del>-          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]
</del><ins>+          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]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasttableemptycellsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/table/empty-cells-expected.txt (160409 => 160410)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -78,8 +78,8 @@
</span><span class="cx">       RenderTable {TABLE} at (0,292) size 785x29 [border: (2px solid #000000)]
</span><span class="cx">         RenderTableSection {TBODY} at (2,2) size 781x25
</span><span class="cx">           RenderTableRow {TR} at (0,0) size 781x25
</span><del>-            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]
</del><ins>+            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]
</ins><span class="cx">               RenderText {#text} at (0,0) size 261x18
</span><span class="cx">                 text run at (0,0) width 261: &quot;First cell empty but has background color&quot;
</span><span class="cx">       RenderTable {TABLE} at (0,321) size 785x54 [border: (2px solid #000000)]
</span></span></pre></div>
<a id="trunkLayoutTeststablesmozillabugsbug18186expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/tables/mozilla/bugs/bug1818-6-expected.txt (160409 => 160410)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -6,6 +6,6 @@
</span><span class="cx">       RenderTable {TABLE} at (0,0) size 784x0
</span><span class="cx">         RenderTableSection {TBODY} at (0,0) size 784x0
</span><span class="cx">           RenderTableRow {TR} at (0,0) size 784x0
</span><del>-            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]
</del><ins>+            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]
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160409 => 160410)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2013-12-10  Gurpreet Kaur  &lt;k.gurpreet@samsung.com&gt;
+
+        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.
+
</ins><span class="cx"> 2013-12-10  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Horizontal rubber-banding without a horizontal scrollbar is distracting
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingAutoTableLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (160409 => 160410)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">                 if (current.inColSpan || !cell)
</span><span class="cx">                     continue;
</span><span class="cx"> 
</span><del>-                bool cellHasContent = cell-&gt;firstChild() || cell-&gt;style().hasBorder() || cell-&gt;style().hasPadding();
</del><ins>+                bool cellHasContent = cell-&gt;firstChild() || cell-&gt;style().hasBorder() || cell-&gt;style().hasPadding() || cell-&gt;style().hasBackground();
</ins><span class="cx">                 if (cellHasContent)
</span><span class="cx">                     columnLayout.emptyCellsOnly = false;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>