Title: [105433] trunk
Revision
105433
Author
[email protected]
Date
2012-01-19 12:27:08 -0800 (Thu, 19 Jan 2012)

Log Message

Hit ASSERTION FAILED: table()->collapseBorders() on techcrunch.com
https://bugs.webkit.org/show_bug.cgi?id=76405

Reviewed by Julien Chaffraix.

Source/WebCore:

Tests: fast/css/nested-table-with-collapsed-borders.html

Change recalcCollapsedBorders() so that it only collects border values for the current
table. Calculating the borders for nested tables was wrong as well as wasting cycles, though it would never
have impacted rendering since a cell only paints the borders that match its own.

* rendering/RenderTable.cpp:
(WebCore::RenderTable::recalcCollapsedBorders):

LayoutTests:

* fast/css/nested-table-with-collapsed-borders-expected.html: Added.
* fast/css/nested-table-with-collapsed-borders.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (105432 => 105433)


--- trunk/LayoutTests/ChangeLog	2012-01-19 20:03:45 UTC (rev 105432)
+++ trunk/LayoutTests/ChangeLog	2012-01-19 20:27:08 UTC (rev 105433)
@@ -1,3 +1,13 @@
+2012-01-18  Robert Hogan  <[email protected]>
+
+        Hit ASSERTION FAILED: table()->collapseBorders() on techcrunch.com
+        https://bugs.webkit.org/show_bug.cgi?id=76405
+
+        Reviewed by Julien Chaffraix.
+
+        * fast/css/nested-table-with-collapsed-borders-expected.html: Added.
+        * fast/css/nested-table-with-collapsed-borders.html: Added.
+
 2012-01-19  David Hyatt  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=76644

Added: trunk/LayoutTests/fast/css/nested-table-with-collapsed-borders-expected.html (0 => 105433)


--- trunk/LayoutTests/fast/css/nested-table-with-collapsed-borders-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/nested-table-with-collapsed-borders-expected.html	2012-01-19 20:27:08 UTC (rev 105433)
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+    <head>
+        <title>This test will assert if a parent table attempts to calculate collapsed borders 
+               for a cell in a nested table that does not have collapsed borders.</title>
+        <style type="text/css">
+            #table1
+            {
+                border-collapse: collapse;
+                height: 2in;
+                width: 2in;
+            }
+            #table2
+            {
+                height: 2in;
+                width: 2in;
+            }
+            td
+            {
+                border: 5px solid black;
+            }
+        </style>
+    </head>
+    <body>
+        <table id="table1">
+            <tr>
+                <td></td>
+                <td></td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>
+                    <table id="table2">
+                        <tr>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                        </tr>
+                    </table>
+                </td>
+                <td></td>
+                <td></td>
+            </tr>
+            <tr>
+                <td></td>
+                <td></td>
+                <td></td>
+            </tr>
+        </table>
+    </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/fast/css/nested-table-with-collapsed-borders-expected.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/nested-table-with-collapsed-borders.html (0 => 105433)


--- trunk/LayoutTests/fast/css/nested-table-with-collapsed-borders.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/nested-table-with-collapsed-borders.html	2012-01-19 20:27:08 UTC (rev 105433)
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+    <head>
+        <title>This test will assert if a parent table attempts to calculate the collapsed borders of a nested table.</title>
+        <style type="text/css">
+            #table1
+            {
+                border-collapse: collapse;
+                height: 2in;
+                width: 2in;
+            }
+            #table2
+            {
+                height: 2in;
+                width: 2in;
+            }
+            td
+            {
+                border: 5px solid black;
+            }
+        </style>
+    </head>
+    <body>
+        <table id="table1">
+            <tr>
+                <td></td>
+                <td></td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>
+                    <table id="table2">
+                        <tr>
+                            <td></td>
+                            <td></td>
+                            <td></td>
+                        </tr>
+                    </table>
+                </td>
+                <td></td>
+                <td></td>
+            </tr>
+            <tr>
+                <td></td>
+                <td></td>
+                <td></td>
+            </tr>
+        </table>
+    </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/fast/css/nested-table-with-collapsed-borders.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (105432 => 105433)


--- trunk/Source/WebCore/ChangeLog	2012-01-19 20:03:45 UTC (rev 105432)
+++ trunk/Source/WebCore/ChangeLog	2012-01-19 20:27:08 UTC (rev 105433)
@@ -1,3 +1,19 @@
+2012-01-18  Robert Hogan  <[email protected]>
+
+        Hit ASSERTION FAILED: table()->collapseBorders() on techcrunch.com
+        https://bugs.webkit.org/show_bug.cgi?id=76405
+
+        Reviewed by Julien Chaffraix.
+
+        Tests: fast/css/nested-table-with-collapsed-borders.html
+
+        Change recalcCollapsedBorders() so that it only collects border values for the current
+        table. Calculating the borders for nested tables was wrong as well as wasting cycles, though it would never
+        have impacted rendering since a cell only paints the borders that match its own.
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::recalcCollapsedBorders):
+
 2012-01-18  Jer Noble  <[email protected]>
 
         Make WebAudio API const-correct.

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (105432 => 105433)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2012-01-19 20:03:45 UTC (rev 105432)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2012-01-19 20:27:08 UTC (rev 105433)
@@ -447,10 +447,19 @@
         return;
     m_collapsedBordersValid = true;
     m_collapsedBorders.clear();
-    RenderObject* stop = nextInPreOrderAfterChildren();
-    for (RenderObject* o = firstChild(); o && o != stop; o = o->nextInPreOrder()) {
-        if (o->isTableCell())
-            toRenderTableCell(o)->collectBorderValues(m_collapsedBorders);
+    for (RenderObject* section = firstChild(); section; section = section->nextSibling()) {
+        if (!section->isTableSection())
+            continue;
+        for (RenderObject* row = section->firstChild(); row; row = row->nextSibling()) {
+            if (!row->isTableRow())
+                continue;
+            for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
+                if (!cell->isTableCell())
+                    continue;
+                ASSERT(cell->table() == this);
+                toRenderTableCell(cell)->collectBorderValues(m_collapsedBorders);
+            }
+        }
     }
     RenderTableCell::sortBorderValues(m_collapsedBorders);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to