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

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

Issue 171773008: Rename childNodeCount() / childNode() methods for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Further renaming for consistency Created 6 years, 10 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/Element.cpp ('k') | Source/core/dom/Node.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, 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, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 virtual KURL baseURI() const; 189 virtual KURL baseURI() const;
190 190
191 // These should all actually return a node, but this is only important for l anguage bindings, 191 // These should all actually return a node, but this is only important for l anguage bindings,
192 // which will already know and hold a ref on the right node to return. 192 // which will already know and hold a ref on the right node to return.
193 void insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionState& = ASSERT_NO_EXCEPTION); 193 void insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionState& = ASSERT_NO_EXCEPTION);
194 void replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionState& = ASSERT_NO_EXCEPTION); 194 void replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionState& = ASSERT_NO_EXCEPTION);
195 void removeChild(Node* child, ExceptionState&); 195 void removeChild(Node* child, ExceptionState&);
196 void appendChild(PassRefPtr<Node> newChild, ExceptionState& = ASSERT_NO_EXCE PTION); 196 void appendChild(PassRefPtr<Node> newChild, ExceptionState& = ASSERT_NO_EXCE PTION);
197 197
198 bool hasChildNodes() const { return firstChild(); } 198 bool hasChildren() const { return firstChild(); }
199 virtual PassRefPtr<Node> cloneNode(bool deep = false) = 0; 199 virtual PassRefPtr<Node> cloneNode(bool deep = false) = 0;
200 virtual const AtomicString& localName() const; 200 virtual const AtomicString& localName() const;
201 virtual const AtomicString& namespaceURI() const; 201 virtual const AtomicString& namespaceURI() const;
202 void normalize(); 202 void normalize();
203 203
204 bool isSameNode(Node* other) const { return this == other; } 204 bool isSameNode(Node* other) const { return this == other; }
205 bool isEqualNode(Node*) const; 205 bool isEqualNode(Node*) const;
206 bool isDefaultNamespace(const AtomicString& namespaceURI) const; 206 bool isDefaultNamespace(const AtomicString& namespaceURI) const;
207 const AtomicString& lookupPrefix(const AtomicString& namespaceURI) const; 207 const AtomicString& lookupPrefix(const AtomicString& namespaceURI) const;
208 const AtomicString& lookupNamespaceURI(const String& prefix) const; 208 const AtomicString& lookupNamespaceURI(const String& prefix) const;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // node tree, false otherwise. 468 // node tree, false otherwise.
469 bool inDocument() const 469 bool inDocument() const
470 { 470 {
471 return getFlag(InDocumentFlag); 471 return getFlag(InDocumentFlag);
472 } 472 }
473 bool isInShadowTree() const { return getFlag(IsInShadowTreeFlag); } 473 bool isInShadowTree() const { return getFlag(IsInShadowTreeFlag); }
474 bool isInTreeScope() const { return getFlag(static_cast<NodeFlags>(InDocumen tFlag | IsInShadowTreeFlag)); } 474 bool isInTreeScope() const { return getFlag(static_cast<NodeFlags>(InDocumen tFlag | IsInShadowTreeFlag)); }
475 475
476 bool isDocumentTypeNode() const { return nodeType() == DOCUMENT_TYPE_NODE; } 476 bool isDocumentTypeNode() const { return nodeType() == DOCUMENT_TYPE_NODE; }
477 virtual bool childTypeAllowed(NodeType) const { return false; } 477 virtual bool childTypeAllowed(NodeType) const { return false; }
478 unsigned childNodeCount() const; 478 unsigned countChildren() const;
479 Node* childNode(unsigned index) const; 479 Node* traverseToChildAt(unsigned index) const;
480 480
481 bool isDescendantOf(const Node*) const; 481 bool isDescendantOf(const Node*) const;
482 bool contains(const Node*) const; 482 bool contains(const Node*) const;
483 bool containsIncludingShadowDOM(const Node*) const; 483 bool containsIncludingShadowDOM(const Node*) const;
484 bool containsIncludingHostElements(const Node&) const; 484 bool containsIncludingHostElements(const Node&) const;
485 Node* commonAncestor(const Node&, Node* (*parent)(const Node&)); 485 Node* commonAncestor(const Node&, Node* (*parent)(const Node&));
486 486
487 // Used to determine whether range offsets use characters or node indices. 487 // Used to determine whether range offsets use characters or node indices.
488 virtual bool offsetInCharacters() const; 488 virtual bool offsetInCharacters() const;
489 // Number of DOM 16-bit units contained in node. Note that rendered text len gth can be different - e.g. because of 489 // Number of DOM 16-bit units contained in node. Note that rendered text len gth can be different - e.g. because of
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 907
908 } // namespace WebCore 908 } // namespace WebCore
909 909
910 #ifndef NDEBUG 910 #ifndef NDEBUG
911 // Outside the WebCore namespace for ease of invocation from gdb. 911 // Outside the WebCore namespace for ease of invocation from gdb.
912 void showTree(const WebCore::Node*); 912 void showTree(const WebCore::Node*);
913 void showNodePath(const WebCore::Node*); 913 void showNodePath(const WebCore::Node*);
914 #endif 914 #endif
915 915
916 #endif 916 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698