Index: Source/WebCore/rendering/RenderBoxModelObject.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderBoxModelObject.cpp (revision 118862) |
+++ Source/WebCore/rendering/RenderBoxModelObject.cpp (working copy) |
@@ -3044,4 +3044,27 @@ |
transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform); |
} |
+void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, RenderObject* child, RenderObject* beforeChild, bool fullRemoveInsert) |
+{ |
+ ASSERT(this == child->parent()); |
+ ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
+ if (fullRemoveInsert && (toBoxModelObject->isRenderBlock() || toBoxModelObject->isRenderInline())) { |
+ // Takes care of adding the new child correctly if toBlock and fromBlock |
+ // have different kind of children (block vs inline). |
+ toBoxModelObject->addChild(virtualChildren()->removeChildNode(this, child), beforeChild); |
+ } else |
+ toBoxModelObject->virtualChildren()->insertChildNode(toBoxModelObject, virtualChildren()->removeChildNode(this, child, fullRemoveInsert), beforeChild, fullRemoveInsert); |
+} |
+ |
+void RenderBoxModelObject::moveChildrenTo(RenderBoxModelObject* toBoxModelObject, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert) |
+{ |
+ ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
+ for (RenderObject* child = startChild; child && child != endChild; ) { |
+ // Save our next sibling as moveChildTo will clear it. |
+ RenderObject* nextSibling = child->nextSibling(); |
+ moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
+ child = nextSibling; |
+ } |
+} |
+ |
} // namespace WebCore |