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

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

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/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 9118)
+++ third_party/WebKit/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -55,6 +55,12 @@
using namespace HTMLNames;
+static void moveChild(RenderObject* to, RenderObjectChildList* toChildList, RenderObject* from, RenderObjectChildList* fromChildList, RenderObject* child)
+{
+ ASSERT(from == child->parent());
+ toChildList->appendChildNode(to, fromChildList->removeChildNode(from, child, false), false);
+}
+
struct ColumnInfo {
ColumnInfo()
: m_desiredColumnWidth(0)
@@ -245,6 +251,14 @@
updateFirstLetter();
}
+void RenderBlock::updateBeforeAfterContent(RenderStyle::PseudoId pseudoId)
+{
+ // If this is an anonymous wrapper, then the parent applies its own pseudo-element style to it.
+ if (parent() && parent()->createsAnonymousWrapper())
+ return;
+ return children()->updateBeforeAfterContent(this, pseudoId);
+}
+
void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
@@ -422,16 +436,16 @@
child = inlineRunEnd->nextSibling();
- RenderBlock* box = createAnonymousBlock();
- insertChildNode(box, inlineRunStart);
+ RenderBlock* block = createAnonymousBlock();
+ children()->insertChildNode(this, block, inlineRunStart);
RenderObject* o = inlineRunStart;
- while(o != inlineRunEnd)
- {
+ while (o != inlineRunEnd) {
RenderObject* no = o;
o = no->nextSibling();
- box->moveChildNode(no);
+
+ moveChild(block, block->children(), this, children(), no);
}
- box->moveChildNode(inlineRunEnd);
+ moveChild(block, block->children(), this, children(), inlineRunEnd);
}
#ifndef NDEBUG
@@ -500,13 +514,15 @@
// the |prev| block.
prev->setNeedsLayoutAndPrefWidthsRecalc();
RenderObject* o = next->firstChild();
+
+ RenderBlock* nextBlock = toRenderBlock(next);
+ RenderBlock* prevBlock = toRenderBlock(prev);
while (o) {
RenderObject* no = o;
o = no->nextSibling();
- prev->moveChildNode(no);
+ moveChild(prevBlock, prevBlock->children(), nextBlock, nextBlock->children(), no);
}
- RenderBlock* nextBlock = toRenderBlock(next);
nextBlock->deleteLineBoxTree();
// Nuke the now-empty block.
@@ -521,13 +537,13 @@
// box. We can go ahead and pull the content right back up into our
// box.
setNeedsLayoutAndPrefWidthsRecalc();
- RenderBlock* anonBlock = toRenderBlock(removeChildNode(child, false));
+ RenderBlock* anonBlock = toRenderBlock(children()->removeChildNode(this, child, false));
setChildrenInline(true);
RenderObject* o = anonBlock->firstChild();
while (o) {
RenderObject* no = o;
o = no->nextSibling();
- moveChildNode(no);
+ moveChild(this, children(), anonBlock, anonBlock->children(), no);
}
// Delete the now-empty block's lines and nuke it.
@@ -963,24 +979,27 @@
return 0;
}
-RenderBox* RenderBlock::handleRunInChild(RenderBox* blockRunIn, bool& handled)
+RenderBox* RenderBlock::handleRunInChild(RenderBox* child, bool& handled)
{
// See if we have a run-in element with inline children. If the
// children aren't inline, then just treat the run-in as a normal
// block.
- if (blockRunIn->isRunIn() && (blockRunIn->childrenInline() || blockRunIn->isReplaced())) {
+ if (child->isRunIn() && (child->childrenInline() || child->isReplaced())) {
+ RenderBlock* blockRunIn = toRenderBlock(child);
// Get the next non-positioned/non-floating RenderBlock.
RenderObject* curr = blockRunIn->nextSibling();
while (curr && curr->isFloatingOrPositioned())
curr = curr->nextSibling();
if (curr && (curr->isRenderBlock() && curr->childrenInline() && !curr->isRunIn())) {
+ RenderBlock* currBlock = toRenderBlock(curr);
+
// The block acts like an inline, so just null out its
// position.
handled = true;
// Remove the old child.
RenderBox* next = blockRunIn->nextSiblingBox();
- removeChildNode(blockRunIn);
+ children()->removeChildNode(this, blockRunIn);
// Create an inline.
RenderInline* inlineRunIn = new (renderArena()) RenderInline(blockRunIn->node());
@@ -988,10 +1007,10 @@
// Move the nodes from the old child to the new child.
for (RenderObject* runInChild = blockRunIn->firstChild(); runInChild; runInChild = runInChild->nextSibling())
- inlineRunIn->moveChildNode(runInChild);
+ moveChild(inlineRunIn, inlineRunIn->children(), blockRunIn, blockRunIn->children(), runInChild);
- // Now insert the new child under |curr|.
- curr->insertChildNode(inlineRunIn, curr->firstChild());
+ // Now insert the new child under |currBlock|.
+ currBlock->children()->insertChildNode(currBlock, inlineRunIn, currBlock->firstChild());
// If the run-in had an element, we need to set the new renderer.
if (blockRunIn->element())
« no previous file with comments | « third_party/WebKit/WebCore/rendering/RenderBlock.h ('k') | third_party/WebKit/WebCore/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698