| 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 11 matching lines...) Expand all Loading... |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef TreeScope_h | 27 #ifndef TreeScope_h |
| 28 #define TreeScope_h | 28 #define TreeScope_h |
| 29 | 29 |
| 30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
| 31 #include "core/dom/DocumentOrderedMap.h" | 31 #include "core/dom/DocumentOrderedMap.h" |
| 32 #include "core/layout/HitTestRequest.h" | |
| 33 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
| 34 #include "wtf/text/AtomicString.h" | 33 #include "wtf/text/AtomicString.h" |
| 35 | 34 |
| 36 namespace blink { | 35 namespace blink { |
| 37 | 36 |
| 38 class ContainerNode; | 37 class ContainerNode; |
| 39 class DOMSelection; | 38 class DOMSelection; |
| 40 class Document; | 39 class Document; |
| 41 class Element; | 40 class Element; |
| 42 class HTMLLabelElement; | 41 class HTMLLabelElement; |
| 43 class HTMLMapElement; | 42 class HTMLMapElement; |
| 44 class HitTestResult; | 43 class HitTestResult; |
| 44 class HitTestRequest; |
| 45 class IdTargetObserverRegistry; | 45 class IdTargetObserverRegistry; |
| 46 class ScopedStyleResolver; | 46 class ScopedStyleResolver; |
| 47 class Node; | 47 class Node; |
| 48 | 48 |
| 49 // A class which inherits both Node and TreeScope must call clearRareData() in i
ts destructor | 49 // A class which inherits both Node and TreeScope must call clearRareData() in i
ts destructor |
| 50 // so that the Node destructor no longer does problematic NodeList cache manipul
ation in | 50 // so that the Node destructor no longer does problematic NodeList cache manipul
ation in |
| 51 // the destructor. | 51 // the destructor. |
| 52 class CORE_EXPORT TreeScope : public WillBeGarbageCollectedMixin { | 52 class CORE_EXPORT TreeScope : public WillBeGarbageCollectedMixin { |
| 53 public: | 53 public: |
| 54 TreeScope* parentTreeScope() const { return m_parentTreeScope; } | 54 TreeScope* parentTreeScope() const { return m_parentTreeScope; } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 70 return *m_document; | 70 return *m_document; |
| 71 } | 71 } |
| 72 | 72 |
| 73 Node* ancestorInThisScope(Node*) const; | 73 Node* ancestorInThisScope(Node*) const; |
| 74 | 74 |
| 75 void addImageMap(HTMLMapElement*); | 75 void addImageMap(HTMLMapElement*); |
| 76 void removeImageMap(HTMLMapElement*); | 76 void removeImageMap(HTMLMapElement*); |
| 77 HTMLMapElement* getImageMap(const String& url) const; | 77 HTMLMapElement* getImageMap(const String& url) const; |
| 78 | 78 |
| 79 Element* elementFromPoint(int x, int y) const; | 79 Element* elementFromPoint(int x, int y) const; |
| 80 Element* elementFromPointNoCache(int x, int y) const; | |
| 81 Vector<Element*> elementsFromPoint(int x, int y) const; | 80 Vector<Element*> elementsFromPoint(int x, int y) const; |
| 82 | 81 |
| 83 // For accessibility. | 82 // For accessibility. |
| 84 bool shouldCacheLabelsByForAttribute() const { return m_labelsByForAttribute
; } | 83 bool shouldCacheLabelsByForAttribute() const { return m_labelsByForAttribute
; } |
| 85 void addLabel(const AtomicString& forAttributeValue, HTMLLabelElement*); | 84 void addLabel(const AtomicString& forAttributeValue, HTMLLabelElement*); |
| 86 void removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement*); | 85 void removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement*); |
| 87 HTMLLabelElement* labelElementForId(const AtomicString& forAttributeValue); | 86 HTMLLabelElement* labelElementForId(const AtomicString& forAttributeValue); |
| 88 | 87 |
| 89 DOMSelection* getSelection() const; | 88 DOMSelection* getSelection() const; |
| 90 | 89 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 bool deletionHasBegun(); | 169 bool deletionHasBegun(); |
| 171 void beginDeletion(); | 170 void beginDeletion(); |
| 172 #else | 171 #else |
| 173 bool deletionHasBegun() { return false; } | 172 bool deletionHasBegun() { return false; } |
| 174 void beginDeletion() { } | 173 void beginDeletion() { } |
| 175 #endif | 174 #endif |
| 176 #endif | 175 #endif |
| 177 | 176 |
| 178 bool rootNodeHasTreeSharedParent() const; | 177 bool rootNodeHasTreeSharedParent() const; |
| 179 | 178 |
| 180 Element* hitTestPoint(int x, int y, const HitTestRequest&) const; | |
| 181 | |
| 182 RawPtrWillBeMember<ContainerNode> m_rootNode; | 179 RawPtrWillBeMember<ContainerNode> m_rootNode; |
| 183 RawPtrWillBeMember<Document> m_document; | 180 RawPtrWillBeMember<Document> m_document; |
| 184 RawPtrWillBeMember<TreeScope> m_parentTreeScope; | 181 RawPtrWillBeMember<TreeScope> m_parentTreeScope; |
| 185 | 182 |
| 186 #if !ENABLE(OILPAN) | 183 #if !ENABLE(OILPAN) |
| 187 int m_guardRefCount; | 184 int m_guardRefCount; |
| 188 #endif | 185 #endif |
| 189 | 186 |
| 190 OwnPtrWillBeMember<DocumentOrderedMap> m_elementsById; | 187 OwnPtrWillBeMember<DocumentOrderedMap> m_elementsById; |
| 191 OwnPtrWillBeMember<DocumentOrderedMap> m_imageMapsByName; | 188 OwnPtrWillBeMember<DocumentOrderedMap> m_imageMapsByName; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 204 return m_elementsById && m_elementsById->contains(id); | 201 return m_elementsById && m_elementsById->contains(id); |
| 205 } | 202 } |
| 206 | 203 |
| 207 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co
nst | 204 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co
nst |
| 208 { | 205 { |
| 209 return m_elementsById && m_elementsById->containsMultiple(id); | 206 return m_elementsById && m_elementsById->containsMultiple(id); |
| 210 } | 207 } |
| 211 | 208 |
| 212 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) | 209 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) |
| 213 | 210 |
| 214 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ
est& = HitTestRequest::ReadOnly | HitTestRequest::Active); | 211 HitTestResult hitTestInDocument(const Document*, int x, int y); |
| 215 | 212 |
| 216 } // namespace blink | 213 } // namespace blink |
| 217 | 214 |
| 218 #endif // TreeScope_h | 215 #endif // TreeScope_h |
| OLD | NEW |