OLD | NEW |
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 14 matching lines...) Expand all Loading... |
25 */ | 25 */ |
26 | 26 |
27 #ifndef ComposedTreeTraversal_h | 27 #ifndef ComposedTreeTraversal_h |
28 #define ComposedTreeTraversal_h | 28 #define ComposedTreeTraversal_h |
29 | 29 |
30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
31 #include "core/dom/Document.h" | 31 #include "core/dom/Document.h" |
32 #include "core/dom/LayoutTreeBuilderTraversal.h" | 32 #include "core/dom/LayoutTreeBuilderTraversal.h" |
33 #include "core/dom/shadow/InsertionPoint.h" | 33 #include "core/dom/shadow/InsertionPoint.h" |
34 #include "core/dom/shadow/ShadowRoot.h" | 34 #include "core/dom/shadow/ShadowRoot.h" |
| 35 #include "wtf/Allocator.h" |
35 | 36 |
36 namespace blink { | 37 namespace blink { |
37 | 38 |
38 class ContainerNode; | 39 class ContainerNode; |
39 class Node; | 40 class Node; |
40 | 41 |
41 // Composed tree version of |NodeTraversal|. | 42 // Composed tree version of |NodeTraversal|. |
42 // | 43 // |
43 // None of member functions takes a |ShadowRoot| or an active insertion point, | 44 // None of member functions takes a |ShadowRoot| or an active insertion point, |
44 // e.g. roughly speaking <content> and <shadow> in the shadow tree, see | 45 // e.g. roughly speaking <content> and <shadow> in the shadow tree, see |
45 // |InsertionPoint::isActive()| for details of active insertion points, since | 46 // |InsertionPoint::isActive()| for details of active insertion points, since |
46 // they aren't appeared in the composed tree. |assertPrecondition()| and | 47 // they aren't appeared in the composed tree. |assertPrecondition()| and |
47 // |assertPostCondition()| check this condition. | 48 // |assertPostCondition()| check this condition. |
48 // | 49 // |
49 // FIXME: Make some functions inline to optimise the performance. | 50 // FIXME: Make some functions inline to optimise the performance. |
50 // https://bugs.webkit.org/show_bug.cgi?id=82702 | 51 // https://bugs.webkit.org/show_bug.cgi?id=82702 |
51 class CORE_EXPORT ComposedTreeTraversal { | 52 class CORE_EXPORT ComposedTreeTraversal { |
| 53 STATIC_ONLY(ComposedTreeTraversal); |
52 public: | 54 public: |
53 typedef LayoutTreeBuilderTraversal::ParentDetails ParentTraversalDetails; | 55 typedef LayoutTreeBuilderTraversal::ParentDetails ParentTraversalDetails; |
54 | 56 |
55 static Node* next(const Node&); | 57 static Node* next(const Node&); |
56 static Node* next(const Node&, const Node* stayWithin); | 58 static Node* next(const Node&, const Node* stayWithin); |
57 static Node* previous(const Node&); | 59 static Node* previous(const Node&); |
58 | 60 |
59 static Node* firstChild(const Node&); | 61 static Node* firstChild(const Node&); |
60 static Node* lastChild(const Node&); | 62 static Node* lastChild(const Node&); |
61 static bool hasChildren(const Node&); | 63 static bool hasChildren(const Node&); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 303 } |
302 | 304 |
303 inline Node* ComposedTreeTraversal::traverseLastChild(const Node& node) | 305 inline Node* ComposedTreeTraversal::traverseLastChild(const Node& node) |
304 { | 306 { |
305 return traverseChild(node, TraversalDirectionBackward); | 307 return traverseChild(node, TraversalDirectionBackward); |
306 } | 308 } |
307 | 309 |
308 } // namespace | 310 } // namespace |
309 | 311 |
310 #endif | 312 #endif |
OLD | NEW |