Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: Source/core/dom/ContainerNode.cpp

Issue 1204933006: Elements moved from a shadow root to a detached tree should clear their IsInShadowTree Flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/shadow/hit-test-inside-shadow-root-expected.txt ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698