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

Side by Side Diff: sky/engine/core/dom/ContainerNode.h

Issue 722313002: Remove some unused methods from Node and ContainerNode. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 | « no previous file | sky/engine/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, 2013 Apple Inc. All r ights 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.
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 return toContainerNode(this)->firstChild(); 207 return toContainerNode(this)->firstChild();
208 } 208 }
209 209
210 inline Node* Node::lastChild() const 210 inline Node* Node::lastChild() const
211 { 211 {
212 if (!isContainerNode()) 212 if (!isContainerNode())
213 return 0; 213 return 0;
214 return toContainerNode(this)->lastChild(); 214 return toContainerNode(this)->lastChild();
215 } 215 }
216 216
217 inline ContainerNode* Node::parentElementOrShadowRoot() const
218 {
219 ContainerNode* parent = parentNode();
220 return parent && (parent->isElementNode() || parent->isShadowRoot()) ? paren t : 0;
221 }
222
223 inline ContainerNode* Node::parentElementOrDocumentFragment() const
224 {
225 ContainerNode* parent = parentNode();
226 return parent && (parent->isElementNode() || parent->isDocumentFragment()) ? parent : 0;
227 }
228
229 inline bool Node::isTreeScope() const 217 inline bool Node::isTreeScope() const
230 { 218 {
231 return &treeScope().rootNode() == this; 219 return &treeScope().rootNode() == this;
232 } 220 }
233 221
234 inline void getChildNodes(ContainerNode& node, NodeVector& nodes) 222 inline void getChildNodes(ContainerNode& node, NodeVector& nodes)
235 { 223 {
236 ASSERT(!nodes.size()); 224 ASSERT(!nodes.size());
237 for (Node* child = node.firstChild(); child; child = child->nextSibling()) 225 for (Node* child = node.firstChild(); child; child = child->nextSibling())
238 nodes.append(child); 226 nodes.append(child);
239 } 227 }
240 228
241 } // namespace blink 229 } // namespace blink
242 230
243 #endif // ContainerNode_h 231 #endif // ContainerNode_h
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698