Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 7946014: Merge 95461 - Child not placed correctly when beforeChild (table part) (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/WebCore/rendering/RenderObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBlock.cpp
===================================================================
--- Source/WebCore/rendering/RenderBlock.cpp (revision 95468)
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -682,26 +682,17 @@
void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
- if (!beforeChild) {
- RenderObject* lastRenderer = lastChild();
- while (lastRenderer && lastRenderer->isAnonymous() && !isAfterContent(lastRenderer))
- lastRenderer = lastRenderer->lastChild();
- if (lastRenderer && isAfterContent(lastRenderer))
- beforeChild = lastRenderer;
- }
+ if (!beforeChild)
+ beforeChild = findAfterContentRenderer();
// If the requested beforeChild is not one of our children, then this is because
// there is an anonymous container within this object that contains the beforeChild.
if (beforeChild && beforeChild->parent() != this) {
- RenderObject* anonymousChild = beforeChild->parent();
- ASSERT(anonymousChild);
+ RenderObject* beforeChildAnonymousContainer = anonymousContainer(beforeChild);
+ ASSERT(beforeChildAnonymousContainer);
+ ASSERT(beforeChildAnonymousContainer->isAnonymous());
- while (anonymousChild->parent() != this)
- anonymousChild = anonymousChild->parent();
-
- ASSERT(anonymousChild->isAnonymous());
-
- if (anonymousChild->isAnonymousBlock()) {
+ if (beforeChildAnonymousContainer->isAnonymousBlock()) {
// Insert the child into the anonymous block box instead of here.
if (newChild->isInline() || beforeChild->parent()->firstChild() != beforeChild)
beforeChild->parent()->addChild(newChild, beforeChild);
@@ -710,19 +701,19 @@
return;
}
- ASSERT(anonymousChild->isTable());
+ ASSERT(beforeChildAnonymousContainer->isTable());
if ((newChild->isTableCol() && newChild->style()->display() == TABLE_COLUMN_GROUP)
|| (newChild->isRenderBlock() && newChild->style()->display() == TABLE_CAPTION)
|| newChild->isTableSection()
|| newChild->isTableRow()
|| newChild->isTableCell()) {
// Insert into the anonymous table.
- anonymousChild->addChild(newChild, beforeChild);
+ beforeChildAnonymousContainer->addChild(newChild, beforeChild);
return;
}
// Go on to insert before the anonymous table.
- beforeChild = anonymousChild;
+ beforeChild = beforeChildAnonymousContainer;
}
// Check for a spanning element in columns.
« no previous file with comments | « no previous file | Source/WebCore/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698