Crash in WebCore::RenderTableSection::addChild due to assert failure
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2011 19:10:58 +0000 (19:10 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2011 19:10:58 +0000 (19:10 +0000)
commitcf55c462f693efd51e245b72f56f8218caea2f70
treecd26c0acf5fcf3510e8f174e4638e68ced14bfb8
parentead74f6cbc08e2d6bf0095c98740f00888f7f33a
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: https://svn.webkit.org/repository/webkit/trunk@98372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/table/table-anonymous-cell-bug-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/table-anonymous-cell-bug.html [new file with mode: 0644]
LayoutTests/fast/table/table-anonymous-row-bug-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/table-anonymous-row-bug.html [new file with mode: 0644]
LayoutTests/fast/table/table-anonymous-section-bug-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/table-anonymous-section-bug.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableSection.cpp