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

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

Issue 239703007: Rename Node::lastDescendant() / Node::highestAncestor() for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename highestAncestor() as well Created 6 years, 8 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/Node.h » ('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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 return toContainerNode(this)->firstChild(); 292 return toContainerNode(this)->firstChild();
293 } 293 }
294 294
295 inline Node* Node::lastChild() const 295 inline Node* Node::lastChild() const
296 { 296 {
297 if (!isContainerNode()) 297 if (!isContainerNode())
298 return 0; 298 return 0;
299 return toContainerNode(this)->lastChild(); 299 return toContainerNode(this)->lastChild();
300 } 300 }
301 301
302 inline Node& Node::highestAncestor() const 302 inline Node& Node::highestAncestorOrSelf() const
303 { 303 {
304 Node* node = const_cast<Node*>(this); 304 Node* node = const_cast<Node*>(this);
305 Node* highest = node; 305 Node* highest = node;
306 for (; node; node = node->parentNode()) 306 for (; node; node = node->parentNode())
307 highest = node; 307 highest = node;
308 return *highest; 308 return *highest;
309 } 309 }
310 310
311 inline ContainerNode* Node::parentElementOrShadowRoot() const 311 inline ContainerNode* Node::parentElementOrShadowRoot() const
312 { 312 {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 RefPtr<Node> m_currentNode; 389 RefPtr<Node> m_currentNode;
390 unsigned m_currentIndex; 390 unsigned m_currentIndex;
391 OwnPtr<Vector<RefPtr<Node> > > m_childNodes; // Lazily instantiated. 391 OwnPtr<Vector<RefPtr<Node> > > m_childNodes; // Lazily instantiated.
392 ChildNodesLazySnapshot* m_nextSnapshot; 392 ChildNodesLazySnapshot* m_nextSnapshot;
393 }; 393 };
394 394
395 } // namespace WebCore 395 } // namespace WebCore
396 396
397 #endif // ContainerNode_h 397 #endif // ContainerNode_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698