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

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

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove validity rect as per Elliott's request Created 5 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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/TreeScope.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) 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
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"
32 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
33 #include "wtf/text/AtomicString.h" 34 #include "wtf/text/AtomicString.h"
34 35
35 namespace blink { 36 namespace blink {
36 37
37 class ContainerNode; 38 class ContainerNode;
38 class DOMSelection; 39 class DOMSelection;
39 class Document; 40 class Document;
40 class Element; 41 class Element;
41 class HTMLLabelElement; 42 class HTMLLabelElement;
42 class HTMLMapElement; 43 class HTMLMapElement;
43 class HitTestResult; 44 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
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* hitTestPoint(int x, int y, const HitTestRequest&) const;
80 Vector<Element*> elementsFromPoint(int x, int y) const; 81 Vector<Element*> elementsFromPoint(int x, int y) const;
81 82
82 // For accessibility. 83 // For accessibility.
83 bool shouldCacheLabelsByForAttribute() const { return m_labelsByForAttribute ; } 84 bool shouldCacheLabelsByForAttribute() const { return m_labelsByForAttribute ; }
84 void addLabel(const AtomicString& forAttributeValue, HTMLLabelElement*); 85 void addLabel(const AtomicString& forAttributeValue, HTMLLabelElement*);
85 void removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement*); 86 void removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement*);
86 HTMLLabelElement* labelElementForId(const AtomicString& forAttributeValue); 87 HTMLLabelElement* labelElementForId(const AtomicString& forAttributeValue);
87 88
88 DOMSelection* getSelection() const; 89 DOMSelection* getSelection() const;
89 90
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return m_elementsById && m_elementsById->contains(id); 202 return m_elementsById && m_elementsById->contains(id);
202 } 203 }
203 204
204 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co nst 205 inline bool TreeScope::containsMultipleElementsWithId(const AtomicString& id) co nst
205 { 206 {
206 return m_elementsById && m_elementsById->containsMultiple(id); 207 return m_elementsById && m_elementsById->containsMultiple(id);
207 } 208 }
208 209
209 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope) 210 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(TreeScope)
210 211
211 HitTestResult hitTestInDocument(const Document*, int x, int y); 212 HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequ est& = HitTestRequest::ReadOnly | HitTestRequest::Active);
212 213
213 } // namespace blink 214 } // namespace blink
214 215
215 #endif // TreeScope_h 216 #endif // TreeScope_h
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698