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

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

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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
« no previous file with comments | « Source/core/dom/ElementTraversal.h ('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, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2006, 2007 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 bool hasNameCache() const { return m_isNameCacheValid; } 132 bool hasNameCache() const { return m_isNameCacheValid; }
133 void setHasNameCache() const { m_isNameCacheValid = true; } 133 void setHasNameCache() const { m_isNameCacheValid = true; }
134 134
135 bool shouldOnlyIncludeDirectChildren() const { return m_shouldOnlyIncludeDir ectChildren; } 135 bool shouldOnlyIncludeDirectChildren() const { return m_shouldOnlyIncludeDir ectChildren; }
136 136
137 private: 137 private:
138 Node* itemBeforeOrAfterCachedItem(unsigned offset, ContainerNode* root) cons t; 138 Node* itemBeforeOrAfterCachedItem(unsigned offset, ContainerNode* root) cons t;
139 Node* traverseChildNodeListForwardToOffset(unsigned offset, Node* currentNod e, unsigned& currentOffset) const; 139 Node* traverseChildNodeListForwardToOffset(unsigned offset, Node* currentNod e, unsigned& currentOffset) const;
140 Element* traverseLiveNodeListFirstElement(ContainerNode* root) const; 140 Element* traverseLiveNodeListFirstElement(ContainerNode* root) const;
141 Element* traverseLiveNodeListForwardToOffset(unsigned offset, Element* curre ntElement, unsigned& currentOffset, ContainerNode* root) const; 141 Element* traverseLiveNodeListForwardToOffset(unsigned offset, Element& curre ntElement, unsigned& currentOffset, ContainerNode* root) const;
142 bool isLastItemCloserThanLastOrCachedItem(unsigned offset) const; 142 bool isLastItemCloserThanLastOrCachedItem(unsigned offset) const;
143 bool isFirstItemCloserThanCachedItem(unsigned offset) const; 143 bool isFirstItemCloserThanCachedItem(unsigned offset) const;
144 Node* iterateForPreviousNode(Node* current) const; 144 Node* iterateForPreviousNode(Node* current) const;
145 Node* itemBefore(Node* previousItem) const; 145 Node* itemBefore(Node* previousItem) const;
146 146
147 RefPtr<Node> m_ownerNode; 147 RefPtr<Node> m_ownerNode;
148 mutable Node* m_cachedItem; 148 mutable Node* m_cachedItem;
149 mutable unsigned m_cachedLength; 149 mutable unsigned m_cachedLength;
150 mutable unsigned m_cachedItemOffset; 150 mutable unsigned m_cachedItemOffset;
151 mutable unsigned m_isLengthCacheValid : 1; 151 mutable unsigned m_isLengthCacheValid : 1;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 virtual Node* namedItem(const AtomicString&) const OVERRIDE; 196 virtual Node* namedItem(const AtomicString&) const OVERRIDE;
197 virtual bool nodeMatches(Element*) const = 0; 197 virtual bool nodeMatches(Element*) const = 0;
198 198
199 private: 199 private:
200 virtual bool isLiveNodeList() const OVERRIDE { return true; } 200 virtual bool isLiveNodeList() const OVERRIDE { return true; }
201 }; 201 };
202 202
203 } // namespace WebCore 203 } // namespace WebCore
204 204
205 #endif // LiveNodeList_h 205 #endif // LiveNodeList_h
OLDNEW
« no previous file with comments | « Source/core/dom/ElementTraversal.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698