Crash in WebCore::RenderTableSection::addChild due to assert failure
https://bugs.webkit.org/show_bug.cgi?id=70678
Reviewed by David Hyatt.
Source/WebCore:
Tests: fast/table/table-anonymous-cell-bug.html
fast/table/table-anonymous-row-bug.html
fast/table/table-anonymous-section-bug.html
If the child being added is not a Section/Row/Cell, and the previous sibling is not anonymous,
we need to create a new anonymous Section/Row/Cell respectively, instead of failing an
assert.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
LayoutTests:
If the child being added is not a Section/Row/Cell, and the previous sibling is not anonymous,
we need to create a new anonymous Section/Row/Cell respectively, instead of failing an
assert.
* fast/table/table-anonymous-cell-bug-expected.txt: Added.
* fast/table/table-anonymous-cell-bug.html: Added.
* fast/table/table-anonymous-row-bug-expected.txt: Added.
* fast/table/table-anonymous-row-bug.html: Added.
* fast/table/table-anonymous-section-bug-expected.txt: Added.
* fast/table/table-anonymous-section-bug.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/table/table-anonymous-row-bug-expected.txt b/LayoutTests/fast/table/table-anonymous-row-bug-expected.txt
new file mode 100644
index 0000000..70c0d4d
--- /dev/null
+++ b/LayoutTests/fast/table/table-anonymous-row-bug-expected.txt
@@ -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"