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

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

Issue 334713006: Use stricter typing for NodeLists throughout the code base (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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 | « Source/core/dom/ChildListMutationScope.cpp ('k') | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »
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 13 matching lines...) Expand all
24 #ifndef ContainerNode_h 24 #ifndef ContainerNode_h
25 #define ContainerNode_h 25 #define ContainerNode_h
26 26
27 #include "bindings/v8/ExceptionStatePlaceholder.h" 27 #include "bindings/v8/ExceptionStatePlaceholder.h"
28 #include "core/dom/Node.h" 28 #include "core/dom/Node.h"
29 #include "wtf/OwnPtr.h" 29 #include "wtf/OwnPtr.h"
30 #include "wtf/Vector.h" 30 #include "wtf/Vector.h"
31 31
32 namespace WebCore { 32 namespace WebCore {
33 33
34 class ClassCollection;
34 class ExceptionState; 35 class ExceptionState;
35 class FloatPoint; 36 class FloatPoint;
36 class HTMLCollection; 37 class HTMLCollection;
38 class StaticNodeList;
39 class TagCollection;
37 40
38 namespace Private { 41 namespace Private {
39 template<class GenericNode, class GenericNodeContainer> 42 template<class GenericNode, class GenericNodeContainer>
40 void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, Ge nericNodeContainer&); 43 void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, Ge nericNodeContainer&);
41 } 44 }
42 45
43 enum DynamicRestyleFlags { 46 enum DynamicRestyleFlags {
44 ChildrenOrSiblingsAffectedByFocus = 1 << 0, 47 ChildrenOrSiblingsAffectedByFocus = 1 << 0,
45 ChildrenOrSiblingsAffectedByHover = 1 << 1, 48 ChildrenOrSiblingsAffectedByHover = 1 << 1,
46 ChildrenOrSiblingsAffectedByActive = 1 << 2, 49 ChildrenOrSiblingsAffectedByActive = 1 << 2,
(...skipping 25 matching lines...) Expand all
72 bool hasOneChild() const { return m_firstChild && !m_firstChild->nextSibling (); } 75 bool hasOneChild() const { return m_firstChild && !m_firstChild->nextSibling (); }
73 bool hasOneTextChild() const { return hasOneChild() && m_firstChild->isTextN ode(); } 76 bool hasOneTextChild() const { return hasOneChild() && m_firstChild->isTextN ode(); }
74 bool hasChildCount(unsigned) const; 77 bool hasChildCount(unsigned) const;
75 78
76 PassRefPtrWillBeRawPtr<HTMLCollection> children(); 79 PassRefPtrWillBeRawPtr<HTMLCollection> children();
77 80
78 unsigned countChildren() const; 81 unsigned countChildren() const;
79 Node* traverseToChildAt(unsigned index) const; 82 Node* traverseToChildAt(unsigned index) const;
80 83
81 PassRefPtrWillBeRawPtr<Element> querySelector(const AtomicString& selectors, ExceptionState&); 84 PassRefPtrWillBeRawPtr<Element> querySelector(const AtomicString& selectors, ExceptionState&);
82 PassRefPtrWillBeRawPtr<NodeList> querySelectorAll(const AtomicString& select ors, ExceptionState&); 85 PassRefPtrWillBeRawPtr<StaticNodeList> querySelectorAll(const AtomicString& selectors, ExceptionState&);
83 86
84 void insertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node* refChild, Exc eptionState& = ASSERT_NO_EXCEPTION); 87 void insertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node* refChild, Exc eptionState& = ASSERT_NO_EXCEPTION);
85 void replaceChild(PassRefPtrWillBeRawPtr<Node> newChild, Node* oldChild, Exc eptionState& = ASSERT_NO_EXCEPTION); 88 void replaceChild(PassRefPtrWillBeRawPtr<Node> newChild, Node* oldChild, Exc eptionState& = ASSERT_NO_EXCEPTION);
86 void removeChild(Node* child, ExceptionState& = ASSERT_NO_EXCEPTION); 89 void removeChild(Node* child, ExceptionState& = ASSERT_NO_EXCEPTION);
87 void appendChild(PassRefPtrWillBeRawPtr<Node> newChild, ExceptionState& = AS SERT_NO_EXCEPTION); 90 void appendChild(PassRefPtrWillBeRawPtr<Node> newChild, ExceptionState& = AS SERT_NO_EXCEPTION);
88 91
89 Element* getElementById(const AtomicString& id) const; 92 Element* getElementById(const AtomicString& id) const;
90 PassRefPtrWillBeRawPtr<HTMLCollection> getElementsByTagName(const AtomicStri ng&); 93 PassRefPtrWillBeRawPtr<TagCollection> getElementsByTagName(const AtomicStrin g&);
91 PassRefPtrWillBeRawPtr<HTMLCollection> getElementsByTagNameNS(const AtomicSt ring& namespaceURI, const AtomicString& localName); 94 PassRefPtrWillBeRawPtr<TagCollection> getElementsByTagNameNS(const AtomicStr ing& namespaceURI, const AtomicString& localName);
92 PassRefPtrWillBeRawPtr<NodeList> getElementsByName(const AtomicString& eleme ntName); 95 PassRefPtrWillBeRawPtr<NameNodeList> getElementsByName(const AtomicString& e lementName);
93 PassRefPtrWillBeRawPtr<HTMLCollection> getElementsByClassName(const AtomicSt ring& classNames); 96 PassRefPtrWillBeRawPtr<ClassCollection> getElementsByClassName(const AtomicS tring& classNames);
94 PassRefPtrWillBeRawPtr<RadioNodeList> radioNodeList(const AtomicString&, boo l onlyMatchImgElements = false); 97 PassRefPtrWillBeRawPtr<RadioNodeList> radioNodeList(const AtomicString&, boo l onlyMatchImgElements = false);
95 98
96 // These methods are only used during parsing. 99 // These methods are only used during parsing.
97 // They don't send DOM mutation events or handle reparenting. 100 // They don't send DOM mutation events or handle reparenting.
98 void parserAppendChild(PassRefPtrWillBeRawPtr<Node>); 101 void parserAppendChild(PassRefPtrWillBeRawPtr<Node>);
99 void parserRemoveChild(Node&); 102 void parserRemoveChild(Node&);
100 void parserInsertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node& refChil d); 103 void parserInsertBefore(PassRefPtrWillBeRawPtr<Node> newChild, Node& refChil d);
101 void parserTakeAllChildrenFrom(ContainerNode&); 104 void parserTakeAllChildrenFrom(ContainerNode&);
102 105
103 void removeChildren(); 106 void removeChildren();
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 inline void getChildNodes(Node& node, NodeVector& nodes) 308 inline void getChildNodes(Node& node, NodeVector& nodes)
306 { 309 {
307 ASSERT(!nodes.size()); 310 ASSERT(!nodes.size());
308 for (Node* child = node.firstChild(); child; child = child->nextSibling()) 311 for (Node* child = node.firstChild(); child; child = child->nextSibling())
309 nodes.append(child); 312 nodes.append(child);
310 } 313 }
311 314
312 } // namespace WebCore 315 } // namespace WebCore
313 316
314 #endif // ContainerNode_h 317 #endif // ContainerNode_h
OLDNEW
« no previous file with comments | « Source/core/dom/ChildListMutationScope.cpp ('k') | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698