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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 && m_resetStyleInheritance == other.m_resetStyleInheritance | 57 && m_resetStyleInheritance == other.m_resetStyleInheritance |
58 && m_outOfComposition == other.m_outOfComposition; | 58 && m_outOfComposition == other.m_outOfComposition; |
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*, ParentDetails*); | 68 ContainerNode* parent(const Node*, ParentDetails*); |
68 ContainerNode* parentSlow(const Node*, ParentDetails*); | 69 ContainerNode* parentSlow(const Node*, ParentDetails*); |
69 Node* nextSibling(const Node*); | 70 Node* nextSibling(const Node*); |
70 Node* nextSiblingSlow(const Node*); | 71 Node* nextSiblingSlow(const Node*); |
71 Node* previousSibling(const Node*); | 72 Node* previousSibling(const Node*); |
72 Node* previousSiblingSlow(const Node*); | 73 Node* previousSiblingSlow(const Node*); |
73 | 74 |
74 Node* nextInScope(const Node*); | 75 Node* nextInScope(const Node*); |
75 Node* previousInScope(const Node*); | 76 Node* previousInScope(const Node*); |
76 Node* parentInScope(const Node*); | 77 Node* parentInScope(const Node*); |
77 Node* lastChildInScope(const Node*); | 78 Node* lastChildInScope(const Node*); |
78 | 79 |
| 80 inline ContainerNode* parent(const Node* node) |
| 81 { |
| 82 ParentDetails unusedDetails; |
| 83 return parent(node, &unusedDetails); |
| 84 } |
| 85 |
79 inline ContainerNode* parent(const Node* node, ParentDetails* details) | 86 inline ContainerNode* parent(const Node* node, ParentDetails* details) |
80 { | 87 { |
81 if (!node->needsShadowTreeWalker()) { | 88 if (!node->needsShadowTreeWalker()) { |
82 #ifndef NDEBUG | 89 #ifndef NDEBUG |
83 ParentDetails slowDetails; | 90 ParentDetails slowDetails; |
84 ASSERT(node->parentNode() == parentSlow(node, &slowDetails)); | 91 ASSERT(node->parentNode() == parentSlow(node, &slowDetails)); |
85 ASSERT(slowDetails == *details); | 92 ASSERT(slowDetails == *details); |
86 #endif | 93 #endif |
87 return node->parentNodeGuaranteedHostFree(); | 94 return node->parentNodeGuaranteedHostFree(); |
88 } | 95 } |
(...skipping 25 matching lines...) Expand all Loading... |
114 } | 121 } |
115 | 122 |
116 return previousSiblingSlow(node); | 123 return previousSiblingSlow(node); |
117 } | 124 } |
118 | 125 |
119 } | 126 } |
120 | 127 |
121 } // namespace WebCore | 128 } // namespace WebCore |
122 | 129 |
123 #endif | 130 #endif |
OLD | NEW |