| 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, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 #if !ENABLE(OILPAN) | 81 #if !ENABLE(OILPAN) |
| 82 oldScope().guardDeref(); | 82 oldScope().guardDeref(); |
| 83 #endif | 83 #endif |
| 84 } | 84 } |
| 85 | 85 |
| 86 void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument,
Document& newDocument) const | 86 void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument,
Document& newDocument) const |
| 87 { | 87 { |
| 88 ASSERT(oldDocument != newDocument); | 88 ASSERT(oldDocument != newDocument); |
| 89 for (Node* node = &root; node; node = NodeTraversal::next(*node, &root)) { | 89 for (Node* node = &root; node; node = NodeTraversal::next(*node, &root)) { |
| 90 moveNodeToNewDocument(*node, oldDocument, newDocument); | 90 moveNodeToNewDocument(*node, oldDocument, newDocument); |
| 91 |
| 92 if (node->hasSyntheticAttrChildNodes()) { |
| 93 WillBeHeapVector<RefPtrWillBeMember<Attr> >& attrs = *toElement(node
)->attrNodeList(); |
| 94 for (unsigned i = 0; i < attrs.size(); ++i) |
| 95 moveTreeToNewDocument(*attrs[i], oldDocument, newDocument); |
| 96 } |
| 97 |
| 91 for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = s
hadow->olderShadowRoot()) | 98 for (ShadowRoot* shadow = node->youngestShadowRoot(); shadow; shadow = s
hadow->olderShadowRoot()) |
| 92 moveTreeToNewDocument(*shadow, oldDocument, newDocument); | 99 moveTreeToNewDocument(*shadow, oldDocument, newDocument); |
| 93 } | 100 } |
| 94 } | 101 } |
| 95 | 102 |
| 96 #if ENABLE(ASSERT) | 103 #if ENABLE(ASSERT) |
| 97 static bool didMoveToNewDocumentWasCalled = false; | 104 static bool didMoveToNewDocumentWasCalled = false; |
| 98 static Document* oldDocumentDidMoveToNewDocumentWasCalledWith = 0; | 105 static Document* oldDocumentDidMoveToNewDocumentWasCalledWith = 0; |
| 99 | 106 |
| 100 void TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(Document& oldDocument
) | 107 void TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(Document& oldDocument
) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 #if ENABLE(ASSERT) | 141 #if ENABLE(ASSERT) |
| 135 didMoveToNewDocumentWasCalled = false; | 142 didMoveToNewDocumentWasCalled = false; |
| 136 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument; | 143 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument; |
| 137 #endif | 144 #endif |
| 138 | 145 |
| 139 node.didMoveToNewDocument(oldDocument); | 146 node.didMoveToNewDocument(oldDocument); |
| 140 ASSERT(didMoveToNewDocumentWasCalled); | 147 ASSERT(didMoveToNewDocumentWasCalled); |
| 141 } | 148 } |
| 142 | 149 |
| 143 } | 150 } |
| OLD | NEW |