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.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105433
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-18 Robert Hogan <robert@webkit.org>
+
+ 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 <hyatt@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=76644
--- /dev/null
+<!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
--- /dev/null
+<!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
+2012-01-18 Robert Hogan <robert@webkit.org>
+
+ 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 <jer.noble@apple.com>
Make WebAudio API const-correct.
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);
}