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

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

Issue 365673002: Pass a struct to ContainerNode::childrenChanged() instead of separate arguments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove dead code Created 6 years, 5 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, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2013 Apple Inc. All r ights 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.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 bool childrenAffectedByForwardPositionalRules() const { return hasRestyleFla g(ChildrenAffectedByForwardPositionalRules); } 144 bool childrenAffectedByForwardPositionalRules() const { return hasRestyleFla g(ChildrenAffectedByForwardPositionalRules); }
145 void setChildrenAffectedByForwardPositionalRules() { setRestyleFlag(Children AffectedByForwardPositionalRules); } 145 void setChildrenAffectedByForwardPositionalRules() { setRestyleFlag(Children AffectedByForwardPositionalRules); }
146 146
147 bool childrenAffectedByBackwardPositionalRules() const { return hasRestyleFl ag(ChildrenAffectedByBackwardPositionalRules); } 147 bool childrenAffectedByBackwardPositionalRules() const { return hasRestyleFl ag(ChildrenAffectedByBackwardPositionalRules); }
148 void setChildrenAffectedByBackwardPositionalRules() { setRestyleFlag(Childre nAffectedByBackwardPositionalRules); } 148 void setChildrenAffectedByBackwardPositionalRules() { setRestyleFlag(Childre nAffectedByBackwardPositionalRules); }
149 149
150 // FIXME: These methods should all be renamed to something better than "chec k", 150 // FIXME: These methods should all be renamed to something better than "chec k",
151 // since it's not clear that they alter the style bits of siblings and child ren. 151 // since it's not clear that they alter the style bits of siblings and child ren.
152 void checkForChildrenAdjacentRuleChanges(); 152 void checkForChildrenAdjacentRuleChanges();
153 void checkForSiblingStyleChanges(bool finishedParsingCallback, Node* beforeC hange, Node* afterChange, int childCountDelta); 153 enum SiblingCheckType { FinishedParsingChildren, SiblingRemoved, Other };
154 void checkForSiblingStyleChanges(SiblingCheckType, Node* beforeChange, Node* afterChange);
154 155
155 bool childrenSupportStyleSharing() const { return !hasRestyleFlags(); } 156 bool childrenSupportStyleSharing() const { return !hasRestyleFlags(); }
156 157
157 // ------------------------------------------------------------------------- ---- 158 // ------------------------------------------------------------------------- ----
158 // Notification of document structure changes (see core/dom/Node.h for more notification methods) 159 // Notification of document structure changes (see core/dom/Node.h for more notification methods)
159 160
161 enum ChildrenChangeType { ChildInserted, ChildRemoved, AllChildrenRemoved, T extChanged };
162 enum ChildrenChangeSource { ChildrenChangeSourceAPI, ChildrenChangeSourcePar ser };
163 struct ChildrenChange {
164 ChildrenChangeType type;
165 Node* siblingBeforeChange;
166 Node* siblingAfterChange;
167 ChildrenChangeSource byParser;
168 };
169
160 // Notifies the node that it's list of children have changed (either by addi ng or removing child nodes), or a child 170 // Notifies the node that it's list of children have changed (either by addi ng or removing child nodes), or a child
161 // node that is of the type CDATA_SECTION_NODE, TEXT_NODE or COMMENT_NODE ha s changed its value. 171 // node that is of the type CDATA_SECTION_NODE, TEXT_NODE or COMMENT_NODE ha s changed its value.
162 virtual void childrenChanged(bool createdByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0); 172 virtual void childrenChanged(const ChildrenChange&);
163 173
164 void disconnectDescendantFrames(); 174 void disconnectDescendantFrames();
165 175
166 virtual void trace(Visitor*) OVERRIDE; 176 virtual void trace(Visitor*) OVERRIDE;
167 177
168 void notifyNodeInserted(Node&); 178 void notifyNodeInserted(Node&);
169 void notifyNodeRemoved(Node&); 179 void notifyNodeRemoved(Node&);
170 180
171 protected: 181 protected:
172 ContainerNode(TreeScope*, ConstructionType = CreateContainer); 182 ContainerNode(TreeScope*, ConstructionType = CreateContainer);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 inline void getChildNodes(Node& node, NodeVector& nodes) 318 inline void getChildNodes(Node& node, NodeVector& nodes)
309 { 319 {
310 ASSERT(!nodes.size()); 320 ASSERT(!nodes.size());
311 for (Node* child = node.firstChild(); child; child = child->nextSibling()) 321 for (Node* child = node.firstChild(); child; child = child->nextSibling())
312 nodes.append(child); 322 nodes.append(child);
313 } 323 }
314 324
315 } // namespace WebCore 325 } // namespace WebCore
316 326
317 #endif // ContainerNode_h 327 #endif // ContainerNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698