| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 if (m_lastChild) { | 247 if (m_lastChild) { |
| 248 child.setPreviousSibling(m_lastChild); | 248 child.setPreviousSibling(m_lastChild); |
| 249 m_lastChild->setNextSibling(&child); | 249 m_lastChild->setNextSibling(&child); |
| 250 } else { | 250 } else { |
| 251 setFirstChild(&child); | 251 setFirstChild(&child); |
| 252 } | 252 } |
| 253 | 253 |
| 254 setLastChild(&child); | 254 setLastChild(&child); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void ContainerNode::parserInsertBefore(PassRefPtr<Node> newChild, Node& nextChil
d) | |
| 258 { | |
| 259 ASSERT(newChild); | |
| 260 ASSERT(nextChild.parentNode() == this); | |
| 261 ASSERT(!newChild->isDocumentFragment()); | |
| 262 ASSERT(!isHTMLTemplateElement(this)); | |
| 263 | |
| 264 if (nextChild.previousSibling() == newChild || &nextChild == newChild) // no
thing to do | |
| 265 return; | |
| 266 | |
| 267 RefPtr<Node> protect(this); | |
| 268 | |
| 269 if (document() != newChild->document()) | |
| 270 document().adoptNode(newChild.get(), ASSERT_NO_EXCEPTION); | |
| 271 | |
| 272 insertBeforeCommon(nextChild, *newChild); | |
| 273 | |
| 274 ChildListMutationScope(*this).childAdded(*newChild); | |
| 275 | |
| 276 notifyNodeInserted(*newChild, ChildrenChangeSourceParser); | |
| 277 } | |
| 278 | |
| 279 PassRefPtr<Node> ContainerNode::replaceChild(PassRefPtr<Node> newChild, PassRefP
tr<Node> oldChild, ExceptionState& exceptionState) | 257 PassRefPtr<Node> ContainerNode::replaceChild(PassRefPtr<Node> newChild, PassRefP
tr<Node> oldChild, ExceptionState& exceptionState) |
| 280 { | 258 { |
| 281 #if !ENABLE(OILPAN) | 259 #if !ENABLE(OILPAN) |
| 282 // Check that this node is not "floating". | 260 // Check that this node is not "floating". |
| 283 // If it is, it can be deleted as a side effect of sending mutation events. | 261 // If it is, it can be deleted as a side effect of sending mutation events. |
| 284 ASSERT(refCount() || parentOrShadowHostNode()); | 262 ASSERT(refCount() || parentOrShadowHostNode()); |
| 285 #endif | 263 #endif |
| 286 | 264 |
| 287 RefPtr<Node> protect(this); | 265 RefPtr<Node> protect(this); |
| 288 | 266 |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 return true; | 1012 return true; |
| 1035 | 1013 |
| 1036 if (node->isElementNode() && toElement(node)->shadow()) | 1014 if (node->isElementNode() && toElement(node)->shadow()) |
| 1037 return true; | 1015 return true; |
| 1038 | 1016 |
| 1039 return false; | 1017 return false; |
| 1040 } | 1018 } |
| 1041 #endif | 1019 #endif |
| 1042 | 1020 |
| 1043 } // namespace blink | 1021 } // namespace blink |
| OLD | NEW |