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

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

Issue 10914111: Merge 125737 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 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 | « Source/WebCore/rendering/RenderObjectChildList.h ('k') | Source/WebCore/rendering/RenderQuote.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderObjectChildList.cpp
===================================================================
--- Source/WebCore/rendering/RenderObjectChildList.cpp (revision 127654)
+++ Source/WebCore/rendering/RenderObjectChildList.cpp (working copy)
@@ -63,14 +63,6 @@
}
}
-static RenderNamedFlowThread* renderNamedFlowThreadContainer(RenderObject* object)
-{
- while (object && object->isAnonymousBlock() && !object->isRenderNamedFlowThread())
- object = object->parent();
-
- return object && object->isRenderNamedFlowThread() ? toRenderNamedFlowThread(object) : 0;
-}
-
RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, RenderObject* oldChild, bool fullRemove)
{
ASSERT(oldChild->parent() == owner);
@@ -126,7 +118,7 @@
oldChild->enclosingRenderFlowThread()->clearRenderObjectCustomStyle(oldChild);
}
- if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadContainer(owner))
+ if (RenderNamedFlowThread* containerFlowThread = owner->enclosingRenderNamedFlowThread())
containerFlowThread->removeFlowChild(oldChild);
#if ENABLE(SVG)
@@ -169,7 +161,7 @@
return oldChild;
}
-void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* newChild, bool fullAppend)
+void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* newChild, bool notifyRenderer)
{
ASSERT(newChild->parent() == 0);
ASSERT(!owner->isBlockFlow() || (!newChild->isTableSection() && !newChild->isTableRow() && !newChild->isTableCell()));
@@ -185,41 +177,9 @@
setLastChild(newChild);
- if (fullAppend) {
- // Keep our layer hierarchy updated. Optimize for the common case where we don't have any children
- // and don't have a layer attached to ourselves.
- RenderLayer* layer = 0;
- if (newChild->firstChild() || newChild->hasLayer()) {
- layer = owner->enclosingLayer();
- newChild->addLayers(layer);
- }
+ if (notifyRenderer)
+ newChild->insertedIntoTree();
- // if the new child is visible but this object was not, tell the layer it has some visible content
- // that needs to be drawn and layer visibility optimization can't be used
- if (owner->style()->visibility() != VISIBLE && newChild->style()->visibility() == VISIBLE && !newChild->hasLayer()) {
- if (!layer)
- layer = owner->enclosingLayer();
- if (layer)
- layer->setHasVisibleContent();
- }
-
- if (newChild->isListItem())
- toRenderListItem(newChild)->updateListMarkerNumbers();
-
- if (!newChild->isFloating() && owner->childrenInline())
- owner->dirtyLinesFromChangedChild(newChild);
-
- if (newChild->isRenderRegion())
- toRenderRegion(newChild)->attachRegion();
-
- // You can't attachQuote() otherwise the quote would be attached too early
- // and get the wrong depth since generated content is inserted into anonymous
- // renderers before going into the main render tree.
-
- if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadContainer(owner))
- containerFlowThread->addFlowChild(newChild);
- }
-
if (!owner->documentBeingDestroyed()) {
RenderCounter::rendererSubtreeAttached(newChild);
}
@@ -231,10 +191,10 @@
owner->document()->axObjectCache()->childrenChanged(owner);
}
-void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* child, RenderObject* beforeChild, bool fullInsert)
+void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* child, RenderObject* beforeChild, bool notifyRenderer)
{
if (!beforeChild) {
- appendChildNode(owner, child, fullInsert);
+ appendChildNode(owner, child, notifyRenderer);
return;
}
@@ -257,40 +217,9 @@
child->setParent(owner);
- if (fullInsert) {
- // Keep our layer hierarchy updated. Optimize for the common case where we don't have any children
- // and don't have a layer attached to ourselves.
- RenderLayer* layer = 0;
- if (child->firstChild() || child->hasLayer()) {
- layer = owner->enclosingLayer();
- child->addLayers(layer);
- }
+ if (notifyRenderer)
+ child->insertedIntoTree();
- // if the new child is visible but this object was not, tell the layer it has some visible content
- // that needs to be drawn and layer visibility optimization can't be used
- if (owner->style()->visibility() != VISIBLE && child->style()->visibility() == VISIBLE && !child->hasLayer()) {
- if (!layer)
- layer = owner->enclosingLayer();
- if (layer)
- layer->setHasVisibleContent();
- }
-
- if (child->isListItem())
- toRenderListItem(child)->updateListMarkerNumbers();
-
- if (!child->isFloating() && owner->childrenInline())
- owner->dirtyLinesFromChangedChild(child);
-
- if (child->isRenderRegion())
- toRenderRegion(child)->attachRegion();
-
- // Calling attachQuote() here would be too early (before anonymous renderers are inserted)
- // see appendChild() for more explanation.
-
- if (RenderNamedFlowThread* containerFlowThread = renderNamedFlowThreadContainer(owner))
- containerFlowThread->addFlowChild(child, beforeChild);
- }
-
if (!owner->documentBeingDestroyed()) {
RenderCounter::rendererSubtreeAttached(child);
}
« no previous file with comments | « Source/WebCore/rendering/RenderObjectChildList.h ('k') | Source/WebCore/rendering/RenderQuote.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698