| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 for (const auto& attr : *attrs) | 65 for (const auto& attr : *attrs) |
| 66 moveTreeToNewScope(*attr); | 66 moveTreeToNewScope(*attr); |
| 67 } | 67 } |
| 68 | 68 |
| 69 for (ShadowRoot* shadow = element.youngestShadowRoot(); shadow; shadow =
shadow->olderShadowRoot()) { | 69 for (ShadowRoot* shadow = element.youngestShadowRoot(); shadow; shadow =
shadow->olderShadowRoot()) { |
| 70 shadow->setParentTreeScope(newScope()); | 70 shadow->setParentTreeScope(newScope()); |
| 71 if (willMoveToNewDocument) | 71 if (willMoveToNewDocument) |
| 72 moveTreeToNewDocument(*shadow, oldDocument, newDocument); | 72 moveTreeToNewDocument(*shadow, oldDocument, newDocument); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 if (!willMoveToNewDocument) |
| 76 return; |
| 77 oldDocument.didMoveTreeToNewDocument(root); |
| 75 } | 78 } |
| 76 | 79 |
| 77 void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument,
Document& newDocument) const | 80 void TreeScopeAdopter::moveTreeToNewDocument(Node& root, Document& oldDocument,
Document& newDocument) const |
| 78 { | 81 { |
| 79 DCHECK_NE(oldDocument, newDocument); | 82 DCHECK_NE(oldDocument, newDocument); |
| 80 for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) { | 83 for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) { |
| 81 moveNodeToNewDocument(node, oldDocument, newDocument); | 84 moveNodeToNewDocument(node, oldDocument, newDocument); |
| 82 | 85 |
| 83 if (!node.isElementNode()) | 86 if (!node.isElementNode()) |
| 84 continue; | 87 continue; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument; | 136 oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument; |
| 134 #endif | 137 #endif |
| 135 | 138 |
| 136 node.didMoveToNewDocument(oldDocument); | 139 node.didMoveToNewDocument(oldDocument); |
| 137 #if DCHECK_IS_ON() | 140 #if DCHECK_IS_ON() |
| 138 DCHECK(didMoveToNewDocumentWasCalled); | 141 DCHECK(didMoveToNewDocumentWasCalled); |
| 139 #endif | 142 #endif |
| 140 } | 143 } |
| 141 | 144 |
| 142 } // namespace blink | 145 } // namespace blink |
| OLD | NEW |