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

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

Issue 306233005: Call insertedInto or removedFrom before childrenChanged (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: enum { OjanReview } Created 6 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
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | Source/core/dom/ContainerNode.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void checkForChildrenAdjacentRuleChanges(); 149 void checkForChildrenAdjacentRuleChanges();
150 void checkForSiblingStyleChanges(bool finishedParsingCallback, Node* beforeC hange, Node* afterChange, int childCountDelta); 150 void checkForSiblingStyleChanges(bool finishedParsingCallback, Node* beforeC hange, Node* afterChange, int childCountDelta);
151 151
152 bool childrenSupportStyleSharing() const { return !hasRestyleFlags(); } 152 bool childrenSupportStyleSharing() const { return !hasRestyleFlags(); }
153 153
154 // ------------------------------------------------------------------------- ---- 154 // ------------------------------------------------------------------------- ----
155 // Notification of document structure changes (see core/dom/Node.h for more notification methods) 155 // Notification of document structure changes (see core/dom/Node.h for more notification methods)
156 156
157 // Notifies the node that it's list of children have changed (either by addi ng or removing child nodes), or a child 157 // Notifies the node that it's list of children have changed (either by addi ng or removing child nodes), or a child
158 // node that is of the type CDATA_SECTION_NODE, TEXT_NODE or COMMENT_NODE ha s changed its value. 158 // node that is of the type CDATA_SECTION_NODE, TEXT_NODE or COMMENT_NODE ha s changed its value.
159 // FIXME: Replace the bool for createdByParser with the InsertionSourceType.
159 virtual void childrenChanged(bool createdByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0); 160 virtual void childrenChanged(bool createdByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0);
160 161
161 void disconnectDescendantFrames(); 162 void disconnectDescendantFrames();
162 163
163 virtual void trace(Visitor*) OVERRIDE; 164 virtual void trace(Visitor*) OVERRIDE;
164 165
165 void notifyNodeInserted(Node&); 166 enum InsertionSourceType { InsertedByDOM, InsertedByParser };
167 void notifyNodeInserted(Node&, InsertionSourceType = InsertedByDOM);
166 void notifyNodeRemoved(Node&); 168 void notifyNodeRemoved(Node&);
167 169
168 protected: 170 protected:
169 ContainerNode(TreeScope*, ConstructionType = CreateContainer); 171 ContainerNode(TreeScope*, ConstructionType = CreateContainer);
170 172
171 template<class GenericNode, class GenericNodeContainer> 173 template<class GenericNode, class GenericNodeContainer>
172 friend void appendChildToContainer(GenericNode& child, GenericNodeContainer& ); 174 friend void appendChildToContainer(GenericNode& child, GenericNodeContainer& );
173 175
174 template<class GenericNode, class GenericNodeContainer> 176 template<class GenericNode, class GenericNodeContainer>
175 friend void Private::addChildNodesToDeletionQueue(GenericNode*& head, Generi cNode*& tail, GenericNodeContainer&); 177 friend void Private::addChildNodesToDeletionQueue(GenericNode*& head, Generi cNode*& tail, GenericNodeContainer&);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 inline void getChildNodes(Node& node, NodeVector& nodes) 309 inline void getChildNodes(Node& node, NodeVector& nodes)
308 { 310 {
309 ASSERT(!nodes.size()); 311 ASSERT(!nodes.size());
310 for (Node* child = node.firstChild(); child; child = child->nextSibling()) 312 for (Node* child = node.firstChild(); child; child = child->nextSibling())
311 nodes.append(child); 313 nodes.append(child);
312 } 314 }
313 315
314 } // namespace WebCore 316 } // namespace WebCore
315 317
316 #endif // ContainerNode_h 318 #endif // ContainerNode_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | Source/core/dom/ContainerNode.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698