OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2012 Apple Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 TreeScope* commonAncestorTreeScope(TreeScope& other); | 134 TreeScope* commonAncestorTreeScope(TreeScope& other); |
135 | 135 |
136 Element* getElementByAccessKey(const String& key) const; | 136 Element* getElementByAccessKey(const String& key) const; |
137 | 137 |
138 DECLARE_VIRTUAL_TRACE(); | 138 DECLARE_VIRTUAL_TRACE(); |
139 | 139 |
140 ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResol
ver.get(); } | 140 ScopedStyleResolver* scopedStyleResolver() const { return m_scopedStyleResol
ver.get(); } |
141 ScopedStyleResolver& ensureScopedStyleResolver(); | 141 ScopedStyleResolver& ensureScopedStyleResolver(); |
142 void clearScopedStyleResolver(); | 142 void clearScopedStyleResolver(); |
143 | 143 |
| 144 TreeScope* composedParent(); |
| 145 |
| 146 static TreeScope* treeScopeInComposedTree(const Node&); |
| 147 |
144 protected: | 148 protected: |
145 TreeScope(ContainerNode&, Document&); | 149 TreeScope(ContainerNode&, Document&); |
146 TreeScope(Document&); | 150 TreeScope(Document&); |
147 virtual ~TreeScope(); | 151 virtual ~TreeScope(); |
148 | 152 |
149 #if !ENABLE(OILPAN) | 153 #if !ENABLE(OILPAN) |
150 void destroyTreeScopeData(); | 154 void destroyTreeScopeData(); |
151 #endif | 155 #endif |
152 | 156 |
153 void setDocument(Document& document) { m_document = &document; } | 157 void setDocument(Document& document) { m_document = &document; } |
154 void setParentTreeScope(TreeScope&); | 158 void setParentTreeScope(TreeScope&); |
| 159 void clearComposedParent() { m_composedParent = nullptr; } |
155 | 160 |
156 #if !ENABLE(OILPAN) | 161 #if !ENABLE(OILPAN) |
157 bool hasGuardRefCount() const { return m_guardRefCount; } | 162 bool hasGuardRefCount() const { return m_guardRefCount; } |
158 #endif | 163 #endif |
159 | 164 |
160 void setNeedsStyleRecalcForViewportUnits(); | 165 void setNeedsStyleRecalcForViewportUnits(); |
161 | 166 |
162 private: | 167 private: |
163 #if !ENABLE(OILPAN) | 168 #if !ENABLE(OILPAN) |
164 virtual void dispose() { } | 169 virtual void dispose() { } |
165 | 170 |
166 int refCount() const; | 171 int refCount() const; |
167 | 172 |
168 #if ENABLE(SECURITY_ASSERT) | 173 #if ENABLE(SECURITY_ASSERT) |
169 bool deletionHasBegun(); | 174 bool deletionHasBegun(); |
170 void beginDeletion(); | 175 void beginDeletion(); |
171 #else | 176 #else |
172 bool deletionHasBegun() { return false; } | 177 bool deletionHasBegun() { return false; } |
173 void beginDeletion() { } | 178 void beginDeletion() { } |
174 #endif | 179 #endif |
175 #endif | 180 #endif |
176 | 181 |
177 bool rootNodeHasTreeSharedParent() const; | 182 bool rootNodeHasTreeSharedParent() const; |
178 | 183 |
179 RawPtrWillBeMember<ContainerNode> m_rootNode; | 184 RawPtrWillBeMember<ContainerNode> m_rootNode; |
180 RawPtrWillBeMember<Document> m_document; | 185 RawPtrWillBeMember<Document> m_document; |
181 RawPtrWillBeMember<TreeScope> m_parentTreeScope; | 186 RawPtrWillBeMember<TreeScope> m_parentTreeScope; |
| 187 RawPtrWillBeMember<TreeScope> m_composedParent; |
182 | 188 |
183 #if !ENABLE(OILPAN) | 189 #if !ENABLE(OILPAN) |
184 int m_guardRefCount; | 190 int m_guardRefCount; |
185 #endif | 191 #endif |
186 | 192 |
187 OwnPtrWillBeMember<DocumentOrderedMap> m_elementsById; | 193 OwnPtrWillBeMember<DocumentOrderedMap> m_elementsById; |
188 OwnPtrWillBeMember<DocumentOrderedMap> m_imageMapsByName; | 194 OwnPtrWillBeMember<DocumentOrderedMap> m_imageMapsByName; |
189 OwnPtrWillBeMember<DocumentOrderedMap> m_labelsByForAttribute; | 195 OwnPtrWillBeMember<DocumentOrderedMap> m_labelsByForAttribute; |
190 | 196 |
191 OwnPtrWillBeMember<IdTargetObserverRegistry> m_idTargetObserverRegistry; | 197 OwnPtrWillBeMember<IdTargetObserverRegistry> m_idTargetObserverRegistry; |
(...skipping 14 matching lines...) Expand all Loading... |
206 return m_elementsById && m_elementsById->containsMultiple(id); | 212 return m_elementsById && m_elementsById->containsMultiple(id); |
207 } | 213 } |
208 | 214 |
209 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) | 215 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) |
210 | 216 |
211 HitTestResult hitTestInDocument(const Document*, int x, int y); | 217 HitTestResult hitTestInDocument(const Document*, int x, int y); |
212 | 218 |
213 } // namespace blink | 219 } // namespace blink |
214 | 220 |
215 #endif // TreeScope_h | 221 #endif // TreeScope_h |
OLD | NEW |