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

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

Issue 17038004: Remove needsShadowTreeWalker flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 6 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 | « Source/core/dom/Node.cpp ('k') | Source/core/dom/NodeRenderingTraversal.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) 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 private: 61 private:
62 InsertionPoint* m_insertionPoint; 62 InsertionPoint* m_insertionPoint;
63 bool m_resetStyleInheritance; 63 bool m_resetStyleInheritance;
64 bool m_outOfComposition; 64 bool m_outOfComposition;
65 }; 65 };
66 66
67 ContainerNode* parent(const Node*); 67 ContainerNode* parent(const Node*);
68 ContainerNode* parent(const Node*, ParentDetails*); 68 ContainerNode* parent(const Node*, ParentDetails*);
69 ContainerNode* parentSlow(const Node*, ParentDetails*);
70 Node* nextSibling(const Node*); 69 Node* nextSibling(const Node*);
71 Node* nextSiblingSlow(const Node*);
72 Node* previousSibling(const Node*); 70 Node* previousSibling(const Node*);
73 Node* previousSiblingSlow(const Node*);
74 71
75 Node* nextInScope(const Node*); 72 Node* nextInScope(const Node*);
76 Node* previousInScope(const Node*); 73 Node* previousInScope(const Node*);
77 Node* parentInScope(const Node*); 74 Node* parentInScope(const Node*);
78 Node* lastChildInScope(const Node*); 75 Node* lastChildInScope(const Node*);
79 76
80 inline ContainerNode* parent(const Node* node) 77 inline ContainerNode* parent(const Node* node)
81 { 78 {
82 ParentDetails unusedDetails; 79 ParentDetails unusedDetails;
83 return parent(node, &unusedDetails); 80 return parent(node, &unusedDetails);
84 } 81 }
85 82
86 inline ContainerNode* parent(const Node* node, ParentDetails* details)
87 {
88 if (!node->needsShadowTreeWalker()) {
89 #ifndef NDEBUG
90 ParentDetails slowDetails;
91 ASSERT(node->parentNode() == parentSlow(node, &slowDetails));
92 ASSERT(slowDetails == *details);
93 #endif
94 return node->parentNodeGuaranteedHostFree();
95 }
96
97 return parentSlow(node, details);
98 }
99
100 inline Node* nextSibling(const Node* node)
101 {
102 if (!node->needsShadowTreeWalker()) {
103 Node* next = node->nextSibling();
104 if (!next || !next->isInsertionPoint()) {
105 ASSERT(nextSiblingSlow(node) == next);
106 return next;
107 }
108 }
109
110 return nextSiblingSlow(node);
111 }
112
113 inline Node* previousSibling(const Node* node)
114 {
115 if (!node->needsShadowTreeWalker()) {
116 Node* prev = node->previousSibling();
117 if (!prev || !prev->isInsertionPoint()) {
118 ASSERT(previousSiblingSlow(node) == prev);
119 return prev;
120 }
121 }
122
123 return previousSiblingSlow(node);
124 }
125
126 } 83 }
127 84
128 } // namespace WebCore 85 } // namespace WebCore
129 86
130 #endif 87 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/NodeRenderingTraversal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698