| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 if (m_lastChild == &oldChild) | 492 if (m_lastChild == &oldChild) |
| 493 m_lastChild = previousChild; | 493 m_lastChild = previousChild; |
| 494 | 494 |
| 495 oldChild.setPreviousSibling(0); | 495 oldChild.setPreviousSibling(0); |
| 496 oldChild.setNextSibling(0); | 496 oldChild.setNextSibling(0); |
| 497 oldChild.setParentOrShadowHostNode(0); | 497 oldChild.setParentOrShadowHostNode(0); |
| 498 | 498 |
| 499 document().adoptIfNeeded(oldChild); | 499 document().adoptIfNeeded(oldChild); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void ContainerNode::parserRemoveChild(Node& oldChild) | |
| 503 { | |
| 504 ASSERT(oldChild.parentNode() == this); | |
| 505 ASSERT(!oldChild.isDocumentFragment()); | |
| 506 | |
| 507 Node* prev = oldChild.previousSibling(); | |
| 508 Node* next = oldChild.nextSibling(); | |
| 509 | |
| 510 ChildListMutationScope(*this).willRemoveChild(oldChild); | |
| 511 oldChild.notifyMutationObserversNodeWillDetach(); | |
| 512 | |
| 513 removeBetween(prev, next, oldChild); | |
| 514 | |
| 515 notifyNodeRemoved(oldChild); | |
| 516 childrenChanged(ChildrenChange::forRemoval(oldChild, ChildrenChangeSourcePar
ser)); | |
| 517 } | |
| 518 | |
| 519 // this differs from other remove functions because it forcibly removes all the
children, | 502 // this differs from other remove functions because it forcibly removes all the
children, |
| 520 // regardless of read-only status or event exceptions, e.g. | 503 // regardless of read-only status or event exceptions, e.g. |
| 521 void ContainerNode::removeChildren() | 504 void ContainerNode::removeChildren() |
| 522 { | 505 { |
| 523 if (!m_firstChild) | 506 if (!m_firstChild) |
| 524 return; | 507 return; |
| 525 | 508 |
| 526 // The container node can be removed from event handlers. | 509 // The container node can be removed from event handlers. |
| 527 RefPtr<ContainerNode> protect(this); | 510 RefPtr<ContainerNode> protect(this); |
| 528 | 511 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 return true; | 995 return true; |
| 1013 | 996 |
| 1014 if (node->isElementNode() && toElement(node)->shadow()) | 997 if (node->isElementNode() && toElement(node)->shadow()) |
| 1015 return true; | 998 return true; |
| 1016 | 999 |
| 1017 return false; | 1000 return false; |
| 1018 } | 1001 } |
| 1019 #endif | 1002 #endif |
| 1020 | 1003 |
| 1021 } // namespace blink | 1004 } // namespace blink |
| OLD | NEW |