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

Unified Diff: third_party/WebKit/WebCore/rendering/RenderBlock.cpp

Issue 21184: WebKit merge 40722:40785 (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 10 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
Index: third_party/WebKit/WebCore/rendering/RenderBlock.cpp
===================================================================
--- third_party/WebKit/WebCore/rendering/RenderBlock.cpp (revision 9391)
+++ third_party/WebKit/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -1005,9 +1005,14 @@
RenderInline* inlineRunIn = new (renderArena()) RenderInline(blockRunIn->node());
inlineRunIn->setStyle(blockRunIn->style());
- // Move the nodes from the old child to the new child.
- for (RenderObject* runInChild = blockRunIn->firstChild(); runInChild; runInChild = runInChild->nextSibling())
- moveChild(inlineRunIn, inlineRunIn->children(), blockRunIn, blockRunIn->children(), runInChild);
+ // Move the nodes from the old child to the new child, but skip any :before/:after content. It has already
+ // been regenerated by the new inline.
+ for (RenderObject* runInChild = blockRunIn->firstChild(); runInChild; runInChild = runInChild->nextSibling()) {
+ if (runInChild->style()->styleType() != BEFORE && runInChild->style()->styleType() != AFTER) {
+ blockRunIn->children()->removeChildNode(blockRunIn, runInChild, false);
+ inlineRunIn->addChild(runInChild); // Use addChild instead of appendChildNode since it handles correct placement of the children relative to :after-generated content.
+ }
+ }
// Now insert the new child under |currBlock|.
currBlock->children()->insertChildNode(currBlock, inlineRunIn, currBlock->firstChild());
@@ -3918,7 +3923,7 @@
return 0;
}
-static int getBorderPaddingMargin(const RenderBox* child, bool endOfInline)
+static int getBorderPaddingMargin(const RenderBoxModelObject* child, bool endOfInline)
{
RenderStyle* cstyle = child->style();
int result = 0;
@@ -4021,7 +4026,7 @@
if (child->isRenderInline()) {
// Add in padding/border/margin from the appropriate side of
// the element.
- int bpm = getBorderPaddingMargin(static_cast<RenderBox*>(child), childIterator.endOfInline);
+ int bpm = getBorderPaddingMargin(toRenderInline(child), childIterator.endOfInline);
childMin += bpm;
childMax += bpm;
« no previous file with comments | « third_party/WebKit/WebCore/rendering/InlineFlowBox.cpp ('k') | third_party/WebKit/WebCore/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698