Chromium Code Reviews| 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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 843 } | 843 } |
| 844 } | 844 } |
| 845 | 845 |
| 846 void ContainerNode::notifyNodeRemoved(Node& root) | 846 void ContainerNode::notifyNodeRemoved(Node& root) |
| 847 { | 847 { |
| 848 ScriptForbiddenScope forbidScript; | 848 ScriptForbiddenScope forbidScript; |
| 849 EventDispatchForbiddenScope assertNoEventDispatch; | 849 EventDispatchForbiddenScope assertNoEventDispatch; |
| 850 | 850 |
| 851 for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) { | 851 for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) { |
| 852 // As an optimization we skip notifying Text nodes and other leaf nodes | 852 // As an optimization we skip notifying Text nodes and other leaf nodes |
| 853 // of removal when they're not in the Document tree since the virtual | 853 // of removal when they're not in the Document tree and not in a shadow root since the virtual |
| 854 // call to removedFrom is not needed. | 854 // call to removedFrom is not needed. |
| 855 if (!node.inDocument() && !node.isContainerNode()) | 855 if (!node.inDocument() && !node.isContainerNode() && !node.isInShadowTre e()) |
|
rhogan
2015/06/24 20:20:22
Strictly, shouldn't this be: if (inDocument() ..
| |
| 856 continue; | 856 continue; |
| 857 node.removedFrom(this); | 857 node.removedFrom(this); |
| 858 for (ShadowRoot* shadowRoot = node.youngestShadowRoot(); shadowRoot; sha dowRoot = shadowRoot->olderShadowRoot()) | 858 for (ShadowRoot* shadowRoot = node.youngestShadowRoot(); shadowRoot; sha dowRoot = shadowRoot->olderShadowRoot()) |
| 859 notifyNodeRemoved(*shadowRoot); | 859 notifyNodeRemoved(*shadowRoot); |
| 860 } | 860 } |
| 861 } | 861 } |
| 862 | 862 |
| 863 void ContainerNode::attach(const AttachContext& context) | 863 void ContainerNode::attach(const AttachContext& context) |
| 864 { | 864 { |
| 865 attachChildren(context); | 865 attachChildren(context); |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1522 return true; | 1522 return true; |
| 1523 | 1523 |
| 1524 if (node->isElementNode() && toElement(node)->shadow()) | 1524 if (node->isElementNode() && toElement(node)->shadow()) |
| 1525 return true; | 1525 return true; |
| 1526 | 1526 |
| 1527 return false; | 1527 return false; |
| 1528 } | 1528 } |
| 1529 #endif | 1529 #endif |
| 1530 | 1530 |
| 1531 } // namespace blink | 1531 } // namespace blink |
| OLD | NEW |