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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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, 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) 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2012 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // If we have been added to the document during this loop, then we 83 // If we have been added to the document during this loop, then we
84 // don't want to tell the rest of our children that they've been 84 // don't want to tell the rest of our children that they've been
85 // removed from the document because they haven't. 85 // removed from the document because they haven't.
86 if (!node->inDocument() && child->parentNode() == node) 86 if (!node->inDocument() && child->parentNode() == node)
87 notifyNodeRemovedFromDocument(child.get()); 87 notifyNodeRemovedFromDocument(child.get());
88 } 88 }
89 89
90 if (!node->isElementNode()) 90 if (!node->isElementNode())
91 return; 91 return;
92 92
93 if (node->document()->cssTarget() == node) 93 if (node->document().cssTarget() == node)
94 node->document()->setCSSTarget(0); 94 node->document().setCSSTarget(0);
95 95
96 if (ElementShadow* shadow = toElement(node)->shadow()) { 96 if (ElementShadow* shadow = toElement(node)->shadow()) {
97 ShadowRootVector roots(shadow); 97 ShadowRootVector roots(shadow);
98 for (size_t i = 0; i < roots.size(); ++i) { 98 for (size_t i = 0; i < roots.size(); ++i) {
99 if (!node->inDocument() && roots[i]->host() == node) 99 if (!node->inDocument() && roots[i]->host() == node)
100 notifyNodeRemovedFromDocument(roots[i].get()); 100 notifyNodeRemovedFromDocument(roots[i].get());
101 } 101 }
102 } 102 }
103 } 103 }
104 104
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // If we overcount it's safe, but not optimal because it means we'll travers e 150 // If we overcount it's safe, but not optimal because it means we'll travers e
151 // through the document in ChildFrameDisconnector looking for frames that ha ve 151 // through the document in ChildFrameDisconnector looking for frames that ha ve
152 // already been disconnected. 152 // already been disconnected.
153 ASSERT(node->connectedSubframeCount() == count); 153 ASSERT(node->connectedSubframeCount() == count);
154 154
155 return count; 155 return count;
156 } 156 }
157 #endif 157 #endif
158 158
159 } 159 }
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNodeAlgorithms.h ('k') | Source/core/dom/CustomElementCallbackInvocation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698