Title: [165740] trunk
Revision
165740
Author
[email protected]
Date
2014-03-17 10:28:14 -0700 (Mon, 17 Mar 2014)

Log Message

Safari should not render a cell if the <td> is empty
https://bugs.webkit.org/show_bug.cgi?id=15273

Patch by Gurpreet Kaur <[email protected]> on 2014-03-17
Reviewed by Darin Adler.

Source/WebCore:

When table cell has no children and the doctype is not present or not
correct the border for that cell should not be drawn. Firefox also
follows the same behaviour hence making the changes to make it similiar
to Firefox behaviour.

Tests: fast/table/table-cell-border-doctype.html
       fast/table/table-cell-border-no-doctype.html

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBoxDecorations):
Added condition for not drawing the border when table cell has no child
and doctype.

LayoutTests:

* fast/table/table-cell-border-doctype-expected.html: Added.
* fast/table/table-cell-border-doctype.html: Added.
* fast/table/table-cell-border-no-doctype-expected.html: Added.
* fast/table/table-cell-border-no-doctype.html: Added.
Added new test cases to check the behaviour of table cell border when
table has doctype/no doctype and table cell has child/nochild.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (165739 => 165740)


--- trunk/LayoutTests/ChangeLog	2014-03-17 16:52:31 UTC (rev 165739)
+++ trunk/LayoutTests/ChangeLog	2014-03-17 17:28:14 UTC (rev 165740)
@@ -1,3 +1,17 @@
+2014-03-17  Gurpreet Kaur  <[email protected]>
+
+        Safari should not render a cell if the <td> is empty
+        https://bugs.webkit.org/show_bug.cgi?id=15273
+
+        Reviewed by Darin Adler.
+
+        * fast/table/table-cell-border-doctype-expected.html: Added.
+        * fast/table/table-cell-border-doctype.html: Added.
+        * fast/table/table-cell-border-no-doctype-expected.html: Added.
+        * fast/table/table-cell-border-no-doctype.html: Added.
+        Added new test cases to check the behaviour of table cell border when
+        table has doctype/no doctype and table cell has child/nochild.
+
 2014-03-16  Mihnea Ovidenie  <[email protected]>
 
         [CSSRegions]Do not compute region range for a box unless the parent has one

Added: trunk/LayoutTests/fast/table/table-cell-border-doctype-expected.html (0 => 165740)


--- trunk/LayoutTests/fast/table/table-cell-border-doctype-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-border-doctype-expected.html	2014-03-17 17:28:14 UTC (rev 165740)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+            #parent {
+                border: 1px solid blue;
+                width: 194px;
+                height: 94px;
+                display:table;
+                padding:2px;
+            }
+        </style>
+    </head>
+    <body>
+        <div id="parent">
+            <p style="display:table-cell;border: 1px solid red;background-color: yellow;"></p>
+            <p style="display:table-cell;width:2px"></p>
+            <p style="display:table-cell;border: 1px solid red;"></p>
+        </div>
+    </body>
+</html>
Property changes on: trunk/LayoutTests/fast/table/table-cell-border-doctype-expected.html
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/fast/table/table-cell-border-doctype.html (0 => 165740)


--- trunk/LayoutTests/fast/table/table-cell-border-doctype.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-border-doctype.html	2014-03-17 17:28:14 UTC (rev 165740)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+            table {
+                border: 1px solid blue;
+                width: 200px;
+                height: 100px;
+            }
+        </style>
+    </head>
+    <body>
+        <table>
+            <tr>
+                <td width="50%" style="border-collapse:collapse;border: 1px solid red;background-color: yellow;"><p></p></td>
+                <td width="50%" style="border-collapse:collapse; border: 1px solid red; "></td>
+            </tr>
+        </table>
+    </body>
+</html>
Property changes on: trunk/LayoutTests/fast/table/table-cell-border-doctype.html
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/fast/table/table-cell-border-no-doctype-expected.html (0 => 165740)


--- trunk/LayoutTests/fast/table/table-cell-border-no-doctype-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-border-no-doctype-expected.html	2014-03-17 17:28:14 UTC (rev 165740)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+            table {
+                border: 1px solid blue;
+                width: 200px;
+                height: 100px;
+            }
+        </style>
+    </head>
+    <body>
+        <table>
+            <tr>
+                <td width="50%" style=" border: 1px solid red;background-color: yellow;"><p></p></td>
+                <td width="50%" style=" border: none"></td>
+            </tr>
+        </table>
+        </br>
+        <table>
+            <tr>
+                <td width="50%" style=" border: 1px solid red;background-color: yellow;"><p></p></td>
+                <td width="50%" style=" border: none"></td>
+            </tr>
+        </table>
+    </body>
+</html>
Property changes on: trunk/LayoutTests/fast/table/table-cell-border-no-doctype-expected.html
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/fast/table/table-cell-border-no-doctype.html (0 => 165740)


--- trunk/LayoutTests/fast/table/table-cell-border-no-doctype.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-border-no-doctype.html	2014-03-17 17:28:14 UTC (rev 165740)
@@ -0,0 +1,34 @@
+<html>
+    <head>
+        <style>
+            table {
+                border: 1px solid blue;
+                width: 200px;
+                height: 100px;
+            }
+        </style>
+        <script>
+            function runTest()
+            {
+                var  tableCell = document.getElementById('noChild');
+                var text = document.createTextNode("    ");
+                tableCell.appendChild(text);
+            }
+        </script>
+    </head>
+    <body _onload_="runTest()">
+        <table>
+            <tr>
+                <td width="50%" style=" border: 1px solid red;background-color: yellow;"><p></p></td>
+                <td width="50%" style=" border: 1px solid red; "></td>
+            </tr>
+        </table>
+        </br>
+        <table>
+            <tr>
+                <td width="50%" style=" border: 1px solid red;background-color: yellow;"><p></p></td>
+                <td id="noChild" width="50%" style=" border: 1px solid red; "></td>
+            </tr>
+        </table>
+    </body>
+</html>
Property changes on: trunk/LayoutTests/fast/table/table-cell-border-no-doctype.html
___________________________________________________________________

Added: svn:executable

Modified: trunk/Source/WebCore/ChangeLog (165739 => 165740)


--- trunk/Source/WebCore/ChangeLog	2014-03-17 16:52:31 UTC (rev 165739)
+++ trunk/Source/WebCore/ChangeLog	2014-03-17 17:28:14 UTC (rev 165740)
@@ -1,3 +1,24 @@
+2014-03-17  Gurpreet Kaur  <[email protected]>
+
+        Safari should not render a cell if the <td> is empty
+        https://bugs.webkit.org/show_bug.cgi?id=15273
+
+        Reviewed by Darin Adler.
+
+        When table cell has no children and the doctype is not present or not
+        correct the border for that cell should not be drawn. Firefox also
+        follows the same behaviour hence making the changes to make it similiar
+        to Firefox behaviour.
+
+        Tests: fast/table/table-cell-border-doctype.html
+               fast/table/table-cell-border-no-doctype.html
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintBoxDecorations):
+        Added condition for not drawing the border when table cell has no child
+        and doctype.
+
+
 2014-03-17  Frédéric Wang  <[email protected]>
 
         Fix handling of <annotation> in MathMLTextElement.

Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (165739 => 165740)


--- trunk/Source/WebCore/rendering/RenderTableCell.cpp	2014-03-17 16:52:31 UTC (rev 165739)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp	2014-03-17 17:28:14 UTC (rev 165740)
@@ -1326,7 +1326,7 @@
 
     paintBoxShadow(paintInfo, paintRect, style(), Inset);
 
-    if (!style().hasBorder() || tableElt->collapseBorders())
+    if (!style().hasBorder() || tableElt->collapseBorders() || (!firstChild() && document().inQuirksMode()))
         return;
 
     paintBorder(paintInfo, paintRect, style());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to