Diff
Copied: branches/chromium/912/LayoutTests/fast/table/table-anonymous-cell-bug-expected.txt (from rev 98372, trunk/LayoutTests/fast/table/table-anonymous-cell-bug-expected.txt) (0 => 98740)
--- branches/chromium/912/LayoutTests/fast/table/table-anonymous-cell-bug-expected.txt (rev 0)
+++ branches/chromium/912/LayoutTests/fast/table/table-anonymous-cell-bug-expected.txt 2011-10-28 18:25:24 UTC (rev 98740)
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x66
+ RenderBlock {HTML} at (0,0) size 800x66
+ RenderBody {BODY} at (8,8) size 784x50
+ RenderTable {DIV} at (0,0) size 260x50
+ RenderTableSection {DIV} at (0,0) size 260x50
+ RenderTableRow {DIV} at (0,0) size 260x50
+ RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell (anonymous) at (50,0) size 160x16 [r=0 c=1 rs=1 cs=1]
+ RenderInline {SPAN} at (0,0) size 160x16
+ RenderText {#text} at (0,0) size 160x16
+ text run at (0,0) width 160: "Some text."
+ RenderTableCell {DIV} at (210,0) size 50x0 [bgcolor=#0000FF] [r=0 c=2 rs=1 cs=1]
Copied: branches/chromium/912/LayoutTests/fast/table/table-anonymous-cell-bug.html (from rev 98372, trunk/LayoutTests/fast/table/table-anonymous-cell-bug.html) (0 => 98740)
--- branches/chromium/912/LayoutTests/fast/table/table-anonymous-cell-bug.html (rev 0)
+++ branches/chromium/912/LayoutTests/fast/table/table-anonymous-cell-bug.html 2011-10-28 18:25:24 UTC (rev 98740)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<body style="font-family: ahem; -webkit-font-smoothing: none;">
+<style>
+ div.table { display: table; }
+ div.section { display: table-row-group; }
+ div.cell { display: table-cell; width: 50px; height: 50px; background-color: blue; }
+ div.row { display: table-row; }
+</style>
+
+<div class="table" id="table-1">
+ <div class="section" id="tbody-1">
+ <div class="row" id="row-1">
+ <div class="cell" id="cell-1"></div>
+ <div class="cell" id="cell-2"></div>
+ </div>
+ </div>
+</div>
+
+<script>
+ function createSpan()
+ {
+ var spanElement = document.createElement("span");
+ spanElement.appendChild(document.createTextNode("Some text."));
+ return spanElement;
+ }
+
+ function insertSpan(tableID, beforeID)
+ {
+ var tableRow = document.getElementById(tableID);
+ var before = document.getElementById(beforeID);
+ tableRow.insertBefore(createSpan(), before);
+ }
+
+ document.body.offsetTop;
+
+ insertSpan("row-1", "cell-2");
+</script>
+</body>
+</html>
Copied: branches/chromium/912/LayoutTests/fast/table/table-anonymous-row-bug-expected.txt (from rev 98372, trunk/LayoutTests/fast/table/table-anonymous-row-bug-expected.txt) (0 => 98740)
--- branches/chromium/912/LayoutTests/fast/table/table-anonymous-row-bug-expected.txt (rev 0)
+++ branches/chromium/912/LayoutTests/fast/table/table-anonymous-row-bug-expected.txt 2011-10-28 18:25:24 UTC (rev 98740)
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x132
+ RenderBlock {HTML} at (0,0) size 800x132
+ RenderBody {BODY} at (8,8) size 784x116
+ RenderTable {DIV} at (0,0) size 160x116
+ RenderTableSection (anonymous) at (0,0) size 160x116
+ RenderTableRow {DIV} at (0,0) size 160x50
+ RenderTableCell {DIV} at (0,0) size 160x16 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 96x16
+ text run at (0,0) width 96: "Cell 1"
+ RenderTableRow (anonymous) at (0,50) size 160x16
+ RenderTableCell (anonymous) at (0,50) size 160x16 [r=1 c=0 rs=1 cs=1]
+ RenderInline {SPAN} at (0,0) size 160x16
+ RenderText {#text} at (0,0) size 160x16
+ text run at (0,0) width 160: "Some text."
+ RenderTableRow {DIV} at (0,66) size 160x50
+ RenderTableCell {DIV} at (0,66) size 160x16 [bgcolor=#0000FF] [r=2 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 96x16
+ text run at (0,0) width 96: "Cell 2"
Copied: branches/chromium/912/LayoutTests/fast/table/table-anonymous-row-bug.html (from rev 98372, trunk/LayoutTests/fast/table/table-anonymous-row-bug.html) (0 => 98740)
--- branches/chromium/912/LayoutTests/fast/table/table-anonymous-row-bug.html (rev 0)
+++ branches/chromium/912/LayoutTests/fast/table/table-anonymous-row-bug.html 2011-10-28 18:25:24 UTC (rev 98740)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<body style="font-family: ahem; -webkit-font-smoothing: none;">
+<style>
+ div.table { display: table; }
+ div.cell { display: table-cell; width: 50px; height: 50px; background-color: blue; }
+ div.row { display: table-row; }
+</style>
+
+<div class="table" id="table-1">
+ <div class="row" id="row-1">
+ <div class="cell">Cell 1</div>
+ </div>
+ <div class="row" id="row-2">
+ <div class="cell">Cell 2</div>
+ </div>
+</div>
+
+<script>
+ function createSpan()
+ {
+ var spanElement = document.createElement("span");
+ spanElement.appendChild(document.createTextNode("Some text."));
+ return spanElement;
+ }
+
+ function insertSpan(tableID, beforeID)
+ {
+ var table = document.getElementById(tableID);
+ var before = document.getElementById(beforeID);
+ table.insertBefore(createSpan(), before);
+ }
+
+ document.body.offsetTop;
+
+ insertSpan("table-1", "row-2");
+</script>
+</body>
+</html>
Copied: branches/chromium/912/LayoutTests/fast/table/table-anonymous-section-bug-expected.txt (from rev 98372, trunk/LayoutTests/fast/table/table-anonymous-section-bug-expected.txt) (0 => 98740)
--- branches/chromium/912/LayoutTests/fast/table/table-anonymous-section-bug-expected.txt (rev 0)
+++ branches/chromium/912/LayoutTests/fast/table/table-anonymous-section-bug-expected.txt 2011-10-28 18:25:24 UTC (rev 98740)
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x32
+ RenderBlock {HTML} at (0,0) size 800x32
+ RenderBody {BODY} at (8,8) size 784x16
+ RenderTable {DIV} at (0,0) size 160x16
+ RenderTableSection {DIV} at (0,0) size 160x0
+ RenderTableSection (anonymous) at (0,0) size 160x16
+ RenderTableRow (anonymous) at (0,0) size 160x16
+ RenderTableCell (anonymous) at (0,0) size 160x16 [r=0 c=0 rs=1 cs=1]
+ RenderInline {SPAN} at (0,0) size 160x16
+ RenderText {#text} at (0,0) size 160x16
+ text run at (0,0) width 160: "Some text."
+ RenderTableSection {DIV} at (0,16) size 160x0
Copied: branches/chromium/912/LayoutTests/fast/table/table-anonymous-section-bug.html (from rev 98372, trunk/LayoutTests/fast/table/table-anonymous-section-bug.html) (0 => 98740)
--- branches/chromium/912/LayoutTests/fast/table/table-anonymous-section-bug.html (rev 0)
+++ branches/chromium/912/LayoutTests/fast/table/table-anonymous-section-bug.html 2011-10-28 18:25:24 UTC (rev 98740)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<body style="font-family: ahem; -webkit-font-smoothing: none;">
+<style>
+ div.table { display: table; }
+ div.section { display: table-row-group; }
+</style>
+
+<div class="table" id="table-1">
+ <div class="section" id="tbody-1">
+ </div>
+ <div class="section" id="tbody-2">
+ </div>
+</div>
+
+<script>
+ function createSpan()
+ {
+ var spanElement = document.createElement("span");
+ spanElement.appendChild(document.createTextNode("Some text."));
+ return spanElement;
+ }
+
+ function insertSpan(tableID, beforeID)
+ {
+ var table = document.getElementById(tableID);
+ var before = document.getElementById(beforeID);
+ table.insertBefore(createSpan(), before);
+ }
+
+ document.body.offsetTop;
+
+ insertSpan("table-1", "tbody-2");
+</script>
+</body>
+</html>
Modified: branches/chromium/912/Source/WebCore/rendering/RenderTable.cpp (98739 => 98740)
--- branches/chromium/912/Source/WebCore/rendering/RenderTable.cpp 2011-10-28 18:23:05 UTC (rev 98739)
+++ branches/chromium/912/Source/WebCore/rendering/RenderTable.cpp 2011-10-28 18:25:24 UTC (rev 98740)
@@ -186,8 +186,7 @@
if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
RenderObject* section = beforeChild->previousSibling();
- if (section && section->isTableSection()) {
- ASSERT(section->isAnonymous());
+ if (section && section->isTableSection() && section->isAnonymous()) {
section->addChild(child);
return;
}
Modified: branches/chromium/912/Source/WebCore/rendering/RenderTableRow.cpp (98739 => 98740)
--- branches/chromium/912/Source/WebCore/rendering/RenderTableRow.cpp 2011-10-28 18:23:05 UTC (rev 98739)
+++ branches/chromium/912/Source/WebCore/rendering/RenderTableRow.cpp 2011-10-28 18:25:24 UTC (rev 98740)
@@ -106,8 +106,7 @@
if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
RenderObject* cell = beforeChild->previousSibling();
- if (cell && cell->isTableCell()) {
- ASSERT(cell->isAnonymous());
+ if (cell && cell->isTableCell() && cell->isAnonymous()) {
cell->addChild(child);
return;
}
Modified: branches/chromium/912/Source/WebCore/rendering/RenderTableSection.cpp (98739 => 98740)
--- branches/chromium/912/Source/WebCore/rendering/RenderTableSection.cpp 2011-10-28 18:23:05 UTC (rev 98739)
+++ branches/chromium/912/Source/WebCore/rendering/RenderTableSection.cpp 2011-10-28 18:25:24 UTC (rev 98740)
@@ -119,8 +119,7 @@
if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
RenderObject* row = beforeChild->previousSibling();
- if (row && row->isTableRow()) {
- ASSERT(row->isAnonymous());
+ if (row && row->isTableRow() && row->isAnonymous()) {
row->addChild(child);
return;
}