Child not placed correctly when beforeChild (table part)
authorinferno@chromium.org <inferno@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Sep 2011 20:17:53 +0000 (20:17 +0000)
committerinferno@chromium.org <inferno@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Sep 2011 20:17:53 +0000 (20:17 +0000)
commit21e597675e0d420b679a75ff216ea8abfc248b39
treef18ab9f52a0d0ae2088ea38f097927748266c5bf
parent6ad29ca3d4dfacc23f579e799c9e19c7117e145c
Child not placed correctly when beforeChild (table part)
has both :before, :after content.
https://bugs.webkit.org/show_bug.cgi?id=67656

Reviewed by James Robinson.

Source/WebCore:

Tests: fast/table/table-cell-before-after-content-around-table-block.html
       fast/table/table-cell-before-after-content-around-table-row.html
       fast/table/table-cell-before-after-content-around-table.html
       fast/table/table-row-before-after-content-around-block.html
       fast/table/table-row-before-after-content-around-table.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
1. Use the new helper functions findAfterContentRenderer,
   anonymousContainer.
2. Rename anonymousChild to better name - beforeChildAnonymousContainer.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addChild):
When adding a new child, if beforeChild is a table part(
Table/TableSection/TableRow), we need to check if both
:before, :after content are shoved in one of the anonymous child.
If yes, we need to split the :before, :after content before adding
newChild. Easiest approach is to destroy the :before content, then add
the newChild and then call updateBeforeAfterContent to recreate the
:before content.
* rendering/RenderObject.h:
(WebCore::RenderObject::findBeforeContentRenderer): same as
beforePseudoElementRenderer, but ignores text childs since they are
sequentially added.
(WebCore::RenderObject::findAfterContentRenderer): same.
(WebCore::RenderObject::anonymousContainer):
(WebCore::objectIsRelayoutBoundary):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild): use the new helpers and functionally
correct functions - findAfterContentRenderer, anonymousContainer. previous
implementation was wrong since it would not go inside, if :after content
is embedded deeper than one level.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild): same.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild): same.

LayoutTests:

* fast/table/table-cell-before-after-content-around-table-block-expected.png: Added.
* fast/table/table-cell-before-after-content-around-table-block-expected.txt: Added.
* fast/table/table-cell-before-after-content-around-table-block.html: Added.
* fast/table/table-cell-before-after-content-around-table-expected.png: Added.
* fast/table/table-cell-before-after-content-around-table-expected.txt: Added.
* fast/table/table-cell-before-after-content-around-table-row-expected.png: Added.
* fast/table/table-cell-before-after-content-around-table-row-expected.txt: Added.
* fast/table/table-cell-before-after-content-around-table-row.html: Added.
* fast/table/table-cell-before-after-content-around-table.html: Added.
* fast/table/table-row-before-after-content-around-block-expected.png: Added.
* fast/table/table-row-before-after-content-around-block-expected.txt: Added.
* fast/table/table-row-before-after-content-around-block.html: Added.
* fast/table/table-row-before-after-content-around-table-expected.png: Added.
* fast/table/table-row-before-after-content-around-table-expected.txt: Added.
* fast/table/table-row-before-after-content-around-table.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/table/table-cell-before-after-content-around-table-block-expected.png [new file with mode: 0644]
LayoutTests/fast/table/table-cell-before-after-content-around-table-block-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/table-cell-before-after-content-around-table-block.html [new file with mode: 0644]
LayoutTests/fast/table/table-cell-before-after-content-around-table-expected.png [new file with mode: 0644]
LayoutTests/fast/table/table-cell-before-after-content-around-table-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/table-cell-before-after-content-around-table-row-expected.png [new file with mode: 0644]
LayoutTests/fast/table/table-cell-before-after-content-around-table-row-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/table-cell-before-after-content-around-table-row.html [new file with mode: 0644]
LayoutTests/fast/table/table-cell-before-after-content-around-table.html [new file with mode: 0644]
LayoutTests/fast/table/table-row-before-after-content-around-block-expected.png [new file with mode: 0644]
LayoutTests/fast/table/table-row-before-after-content-around-block-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/table-row-before-after-content-around-block.html [new file with mode: 0644]
LayoutTests/fast/table/table-row-before-after-content-around-table-expected.png [new file with mode: 0644]
LayoutTests/fast/table/table-row-before-after-content-around-table-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/table-row-before-after-content-around-table.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableSection.cpp