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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 return; | 307 return; |
308 | 308 |
309 RefPtrWillBeRawPtr<Node> protect(this); | 309 RefPtrWillBeRawPtr<Node> protect(this); |
310 | 310 |
311 // FIXME: parserRemoveChild can run script which could then insert the | 311 // FIXME: parserRemoveChild can run script which could then insert the |
312 // newChild back into the page. Loop until the child is actually removed. | 312 // newChild back into the page. Loop until the child is actually removed. |
313 // See: fast/parser/execute-script-during-adoption-agency-removal.html | 313 // See: fast/parser/execute-script-during-adoption-agency-removal.html |
314 while (RefPtrWillBeRawPtr<ContainerNode> parent = newChild->parentNode()) | 314 while (RefPtrWillBeRawPtr<ContainerNode> parent = newChild->parentNode()) |
315 parent->parserRemoveChild(*newChild); | 315 parent->parserRemoveChild(*newChild); |
316 | 316 |
| 317 if (nextChild.parentNode() != this) |
| 318 return; |
| 319 |
317 if (document() != newChild->document()) | 320 if (document() != newChild->document()) |
318 document().adoptNode(newChild.get(), ASSERT_NO_EXCEPTION); | 321 document().adoptNode(newChild.get(), ASSERT_NO_EXCEPTION); |
319 | 322 |
320 { | 323 { |
321 EventDispatchForbiddenScope assertNoEventDispatch; | 324 EventDispatchForbiddenScope assertNoEventDispatch; |
322 ScriptForbiddenScope forbidScript; | 325 ScriptForbiddenScope forbidScript; |
323 | 326 |
324 treeScope().adoptIfNeeded(*newChild); | 327 treeScope().adoptIfNeeded(*newChild); |
325 insertBeforeCommon(nextChild, *newChild); | 328 insertBeforeCommon(nextChild, *newChild); |
326 newChild->updateAncestorConnectedSubframeCountForInsertion(); | 329 newChild->updateAncestorConnectedSubframeCountForInsertion(); |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 return true; | 1517 return true; |
1515 | 1518 |
1516 if (node->isElementNode() && toElement(node)->shadow()) | 1519 if (node->isElementNode() && toElement(node)->shadow()) |
1517 return true; | 1520 return true; |
1518 | 1521 |
1519 return false; | 1522 return false; |
1520 } | 1523 } |
1521 #endif | 1524 #endif |
1522 | 1525 |
1523 } // namespace blink | 1526 } // namespace blink |
OLD | NEW |