Lines Matching full:child
77 // Make sure adding the new child is OK.
82 // NOT_FOUND_ERR: Raised if refChild is not a child of this node
95 // Now actually add the child(ren)
102 RefPtr<Node> child = isFragment ? newChild->firstChild() : newChild;
103 while (child) {
104 RefPtr<Node> nextChild = isFragment ? child->nextSibling() : 0;
106 // If child is already present in the tree, first remove it from the old location.
107 if (Node* oldParent = child->parentNode())
108 oldParent->removeChild(child.get(), ec);
118 // possible that "next" is no longer a child of "this".
119 // It's also possible that "child" has been inserted elsewhere.
123 if (child->parentNode())
126 ASSERT(!child->nextSibling());
127 ASSERT(!child->previousSibling());
129 // Add child before "next".
133 next->setPreviousSibling(child.get());
137 prev->setNextSibling(child.get());
140 m_firstChild = child.get();
142 child->setParent(this);
143 child->setPreviousSibling(prev);
144 child->setNextSibling(next.get());
149 dispatchChildInsertionEvents(child.get());
151 // Add child to the rendering tree.
152 if (attached() && !child->attached() && child->parent() == this) {
154 child->lazyAttach();
156 child->attach();
159 child = nextChild.release();
177 // Make sure replacing the old child with the new is ok
182 // NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
204 // Add the new child(ren)
206 RefPtr<Node> child = isFragment ? newChild->firstChild() : newChild;
207 while (child) {
208 // If the new child is already in the right place, we're done.
209 if (prev && (prev == child || prev == child->previousSibling()))
213 RefPtr<Node> nextChild = isFragment ? child->nextSibling() : 0;
215 // Remove child from its old position.
216 if (Node* oldParent = child->parentNode())
217 oldParent->removeChild(child.get(), ec);
222 // possible that "prev" is no longer a child of "this".
223 // It's also possible that "child" has been inserted elsewhere.
227 if (child->parentNode())
232 ASSERT(!child->nextSibling());
233 ASSERT(!child->previousSibling());
235 // Add child after "prev".
241 prev->setNextSibling(child.get());
244 m_firstChild = child.get();
249 next->setPreviousSibling(child.get());
252 m_lastChild = child.get();
254 child->setParent(this);
255 child->setPreviousSibling(prev.get());
256 child->setNextSibling(next);
260 dispatchChildInsertionEvents(child.get());
262 // Add child to the rendering tree
263 if (attached() && !child->attached() && child->parent() == this) {
265 child->lazyAttach();
267 child->attach();
270 prev = child;
271 child = nextChild.release();
287 static ExceptionCode willRemoveChild(Node *child)
292 dispatchChildRemovalEvents(child);
296 if (child->attached())
297 child->willRemove();
316 // NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
322 RefPtr<Node> child = oldChild;
324 ec = willRemoveChild(child.get());
328 // Mutation events might have moved this child into a different parent.
329 if (child->parentNode() != this) {
334 document()->removeFocusedNodeOfSubtree(child.get());
344 if (child->attached())
345 child->detach();
347 // Remove the child
349 prev = child->previousSibling();
350 next = child->nextSibling();
356 if (m_firstChild == child)
358 if (m_lastChild == child)
361 child->setPreviousSibling(0);
362 child->setNextSibling(0);
363 child->setParent(0);
371 if (child->inDocument())
372 child->removedFromDocument();
374 child->removedFromTree(true);
376 return child;
437 // Make sure adding the new child is ok
452 // Now actually add the child(ren)
454 RefPtr<Node> child = isFragment ? newChild->firstChild() : newChild;
455 while (child) {
457 RefPtr<Node> nextChild = isFragment ? child->nextSibling() : 0;
459 // If child is already present in the tree, first remove it
460 if (Node* oldParent = child->parentNode()) {
461 oldParent->removeChild(child.get(), ec);
465 // If the child has a parent again, just stop what we're doing, because
467 // a child that already has a parent.
468 if (child->parentNode())
472 // Append child to the end of the list
474 child->setParent(this);
476 child->setPreviousSibling(m_lastChild);
477 m_lastChild->setNextSibling(child.get());
479 m_firstChild = child.get();
480 m_lastChild = child.get();
485 dispatchChildInsertionEvents(child.get());
487 // Add child to the rendering tree
488 if (attached() && !child->attached() && child->parent() == this) {
490 child->lazyAttach();
492 child->attach();
495 child = nextChild.release();
581 for (Node* child = m_firstChild; child; child = child->nextSibling())
582 child->attach();
588 for (Node* child = m_firstChild; child; child = child->nextSibling())
589 child->detach();
598 for (Node* child = m_firstChild; child; child = child->nextSibling())
599 child->insertedIntoDocument();
609 for (Node* child = m_firstChild; child; child = child->nextSibling())
610 child->removedFromDocument();
617 for (Node* child = m_firstChild; child; child = child->nextSibling())
618 child->insertedIntoTree(true);
625 for (Node* child = m_firstChild; child; child = child->nextSibling())
626 child->removedFromTree(true);
664 // find the next text/image child, to get a position
690 // do nothing - skip unrendered whitespace that is a child or next sibling of the anchor
727 // find the last text/image child, to get a position
869 static void dispatchChildInsertionEvents(Node* child)
874 if (Page* page = child->document()->page()) {
876 inspectorController->didInsertDOMNode(child);
880 RefPtr<Node> c = child;
881 RefPtr<Document> document = child->document();
895 for (; c; c = c->traverseNextNode(child))
900 static void dispatchChildRemovalEvents(Node* child)
903 if (Page* page = child->document()->page()) {
905 inspectorController->didRemoveDOMNode(child);
909 RefPtr<Node> c = child;
910 RefPtr<Document> document = child->document();
913 document->nodeWillBeRemoved(child);
923 for (; c; c = c->traverseNextNode(child))