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

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.h

Issue 2251703002: Introduce EphemeralRange::nodes() helper to traverse over a range. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // |InsertionPoint::isActive()| for details of active insertion points, since 47 // |InsertionPoint::isActive()| for details of active insertion points, since
48 // they aren't appeared in the flat tree. |assertPrecondition()| and 48 // they aren't appeared in the flat tree. |assertPrecondition()| and
49 // |assertPostCondition()| check this condition. 49 // |assertPostCondition()| check this condition.
50 // 50 //
51 // FIXME: Make some functions inline to optimise the performance. 51 // FIXME: Make some functions inline to optimise the performance.
52 // https://bugs.webkit.org/show_bug.cgi?id=82702 52 // https://bugs.webkit.org/show_bug.cgi?id=82702
53 class CORE_EXPORT FlatTreeTraversal { 53 class CORE_EXPORT FlatTreeTraversal {
54 STATIC_ONLY(FlatTreeTraversal); 54 STATIC_ONLY(FlatTreeTraversal);
55 public: 55 public:
56 typedef LayoutTreeBuilderTraversal::ParentDetails ParentTraversalDetails; 56 typedef LayoutTreeBuilderTraversal::ParentDetails ParentTraversalDetails;
57 using TraversalNodeType = Node;
Andrey Kraynov 2016/08/16 10:02:11 This is to use FlatTreeTraversal in the same way a
yosin_UTC9 2016/08/17 01:45:31 ACK
57 58
58 static Node* next(const Node&); 59 static Node* next(const Node&);
59 static Node* next(const Node&, const Node* stayWithin); 60 static Node* next(const Node&, const Node* stayWithin);
60 static Node* previous(const Node&); 61 static Node* previous(const Node&);
61 62
62 static Node* firstChild(const Node&); 63 static Node* firstChild(const Node&);
63 static Node* lastChild(const Node&); 64 static Node* lastChild(const Node&);
64 static bool hasChildren(const Node&); 65 static bool hasChildren(const Node&);
65 66
66 static ContainerNode* parent(const Node&, ParentTraversalDetails* = 0); 67 static ContainerNode* parent(const Node&, ParentTraversalDetails* = 0);
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 304 }
304 305
305 inline Node* FlatTreeTraversal::traverseLastChild(const Node& node) 306 inline Node* FlatTreeTraversal::traverseLastChild(const Node& node)
306 { 307 {
307 return traverseChild(node, TraversalDirectionBackward); 308 return traverseChild(node, TraversalDirectionBackward);
308 } 309 }
309 310
310 } // namespace blink 311 } // namespace blink
311 312
312 #endif 313 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698