OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 unsigned leftPadding); | 70 unsigned leftPadding); |
71 HitTestResult(const HitTestRequest&, const HitTestLocation&); | 71 HitTestResult(const HitTestRequest&, const HitTestLocation&); |
72 HitTestResult(const HitTestResult&); | 72 HitTestResult(const HitTestResult&); |
73 ~HitTestResult(); | 73 ~HitTestResult(); |
74 HitTestResult& operator=(const HitTestResult&); | 74 HitTestResult& operator=(const HitTestResult&); |
75 DECLARE_TRACE(); | 75 DECLARE_TRACE(); |
76 | 76 |
77 bool equalForCacheability(const HitTestResult&) const; | 77 bool equalForCacheability(const HitTestResult&) const; |
78 void cacheValues(const HitTestResult&); | 78 void cacheValues(const HitTestResult&); |
79 | 79 |
80 // Populate this object based on another HitTestResult; similar to assignment operator | 80 // Populate this object based on another HitTestResult; similar to assignment |
81 // but don't assign any of the request parameters. ie. Thie method avoids sett ing | 81 // operator but don't assign any of the request parameters. ie. This method |
82 // |m_hitTestLocation|, |m_hitTestRequest|. | 82 // avoids setting |m_hitTestLocation|, |m_hitTestRequest|. |
83 void populateFromCachedResult(const HitTestResult&); | 83 void populateFromCachedResult(const HitTestResult&); |
84 | 84 |
85 // For point-based hit tests, these accessors provide information about the no de | 85 // For point-based hit tests, these accessors provide information about the |
86 // under the point. For rect-based hit tests they are meaningless (reflect the | 86 // node under the point. For rect-based hit tests they are meaningless |
87 // last candidate node observed in the rect). | 87 // (reflect the last candidate node observed in the rect). |
88 // FIXME: Make these less error-prone for rect-based hit tests (center point o r fail). | 88 // FIXME: Make these less error-prone for rect-based hit tests (center point |
89 // or fail). | |
89 Node* innerNode() const { return m_innerNode.get(); } | 90 Node* innerNode() const { return m_innerNode.get(); } |
90 Node* innerPossiblyPseudoNode() const { | 91 Node* innerPossiblyPseudoNode() const { |
91 return m_innerPossiblyPseudoNode.get(); | 92 return m_innerPossiblyPseudoNode.get(); |
92 } | 93 } |
93 Element* innerElement() const; | 94 Element* innerElement() const; |
94 | 95 |
95 // If innerNode is an image map or image map area, return the associated image node. | 96 // If innerNode is an image map or image map area, return the associated image |
97 // node. | |
96 Node* innerNodeOrImageMapImage() const; | 98 Node* innerNodeOrImageMapImage() const; |
97 | 99 |
98 Element* URLElement() const { return m_innerURLElement.get(); } | 100 Element* URLElement() const { return m_innerURLElement.get(); } |
99 Scrollbar* scrollbar() const { return m_scrollbar.get(); } | 101 Scrollbar* scrollbar() const { return m_scrollbar.get(); } |
100 bool isOverWidget() const { return m_isOverWidget; } | 102 bool isOverWidget() const { return m_isOverWidget; } |
101 | 103 |
102 // Forwarded from HitTestLocation | 104 // Forwarded from HitTestLocation |
103 bool isRectBasedTest() const { return m_hitTestLocation.isRectBasedTest(); } | 105 bool isRectBasedTest() const { return m_hitTestLocation.isRectBasedTest(); } |
104 | 106 |
105 // The hit-tested point in the coordinates of the main frame. | 107 // The hit-tested point in the coordinates of the main frame. |
106 const LayoutPoint& pointInMainFrame() const { | 108 const LayoutPoint& pointInMainFrame() const { |
107 return m_hitTestLocation.point(); | 109 return m_hitTestLocation.point(); |
108 } | 110 } |
109 IntPoint roundedPointInMainFrame() const { | 111 IntPoint roundedPointInMainFrame() const { |
110 return roundedIntPoint(pointInMainFrame()); | 112 return roundedIntPoint(pointInMainFrame()); |
111 } | 113 } |
112 | 114 |
113 // The hit-tested point in the coordinates of the innerNode frame, the frame c ontaining innerNode. | 115 // The hit-tested point in the coordinates of the innerNode frame, the frame |
116 // containing innerNode. | |
114 const LayoutPoint& pointInInnerNodeFrame() const { | 117 const LayoutPoint& pointInInnerNodeFrame() const { |
115 return m_pointInInnerNodeFrame; | 118 return m_pointInInnerNodeFrame; |
116 } | 119 } |
117 IntPoint roundedPointInInnerNodeFrame() const { | 120 IntPoint roundedPointInInnerNodeFrame() const { |
118 return roundedIntPoint(pointInInnerNodeFrame()); | 121 return roundedIntPoint(pointInInnerNodeFrame()); |
119 } | 122 } |
120 LocalFrame* innerNodeFrame() const; | 123 LocalFrame* innerNodeFrame() const; |
121 | 124 |
122 // The hit-tested point in the coordinates of the inner node. | 125 // The hit-tested point in the coordinates of the inner node. |
123 const LayoutPoint& localPoint() const { return m_localPoint; } | 126 const LayoutPoint& localPoint() const { return m_localPoint; } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 ListBasedHitTestBehavior addNodeToListBasedTestResult( | 167 ListBasedHitTestBehavior addNodeToListBasedTestResult( |
165 Node*, | 168 Node*, |
166 const HitTestLocation&, | 169 const HitTestLocation&, |
167 const LayoutRect& = LayoutRect()); | 170 const LayoutRect& = LayoutRect()); |
168 ListBasedHitTestBehavior addNodeToListBasedTestResult(Node*, | 171 ListBasedHitTestBehavior addNodeToListBasedTestResult(Node*, |
169 const HitTestLocation&, | 172 const HitTestLocation&, |
170 const Region&); | 173 const Region&); |
171 | 174 |
172 void append(const HitTestResult&); | 175 void append(const HitTestResult&); |
173 | 176 |
174 // If m_listBasedTestResult is 0 then set it to a new NodeSet. Return *m_listB asedTestResult. Lazy allocation makes | 177 // If m_listBasedTestResult is 0 then set it to a new NodeSet. Return |
175 // sense because the NodeSet is seldom necessary, and it's somewhat expensive to allocate and initialize. This method does | 178 // *m_listBasedTestResult. Lazy allocation makes sense because the NodeSet is |
176 // the same thing as mutableListBasedTestResult(), but here the return value i s const. | 179 // seldom necessary, and it's somewhat expensive to allocate and initialize. |
180 // This method does the same thing as mutableListBasedTestResult(), but here | |
181 // the return value is const. | |
177 const NodeSet& listBasedTestResult() const; | 182 const NodeSet& listBasedTestResult() const; |
178 | 183 |
179 // Collapse the rect-based test result into a single target at the specified l ocation. | 184 // Collapse the rect-based test result into a single target at the specified |
185 // location. | |
180 void resolveRectBasedTest(Node* resolvedInnerNode, | 186 void resolveRectBasedTest(Node* resolvedInnerNode, |
181 const LayoutPoint& resolvedPointInMainFrame); | 187 const LayoutPoint& resolvedPointInMainFrame); |
182 | 188 |
183 private: | 189 private: |
184 NodeSet& mutableListBasedTestResult(); // See above. | 190 NodeSet& mutableListBasedTestResult(); // See above. |
185 HTMLMediaElement* mediaElement() const; | 191 HTMLMediaElement* mediaElement() const; |
186 | 192 |
187 HitTestLocation m_hitTestLocation; | 193 HitTestLocation m_hitTestLocation; |
188 HitTestRequest m_hitTestRequest; | 194 HitTestRequest m_hitTestRequest; |
189 bool m_cacheable; | 195 bool m_cacheable; |
190 | 196 |
191 Member<Node> m_innerNode; | 197 Member<Node> m_innerNode; |
192 Member<Node> m_innerPossiblyPseudoNode; | 198 Member<Node> m_innerPossiblyPseudoNode; |
193 // FIXME: Nothing changes this to a value different from m_hitTestLocation! | 199 // FIXME: Nothing changes this to a value different from m_hitTestLocation! |
194 LayoutPoint | 200 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode |
195 m_pointInInnerNodeFrame; // The hit-tested point in innerNode frame coord inates. | 201 // frame coordinates. |
196 LayoutPoint | 202 LayoutPoint m_localPoint; // A point in the local coordinate space of |
197 m_localPoint; // A point in the local coordinate space of m_innerNode's l ayoutObject. Allows us to efficiently | 203 // m_innerNode's layoutObject. Allows us to |
204 // efficiently | |
198 // determine where inside the layoutObject we hit on subsequent operations. | 205 // determine where inside the layoutObject we hit on subsequent operations. |
ikilpatrick
2016/10/04 16:39:02
very bad.
| |
199 Member<Element> m_innerURLElement; | 206 Member<Element> m_innerURLElement; |
200 Member<Scrollbar> m_scrollbar; | 207 Member<Scrollbar> m_scrollbar; |
201 bool | 208 bool m_isOverWidget; // Returns true if we are over a widget (and not in the |
202 m_isOverWidget; // Returns true if we are over a widget (and not in the b order/padding area of a LayoutPart for example). | 209 // border/padding area of a LayoutPart for example). |
203 | 210 |
204 mutable Member<NodeSet> m_listBasedTestResult; | 211 mutable Member<NodeSet> m_listBasedTestResult; |
205 }; | 212 }; |
206 | 213 |
207 } // namespace blink | 214 } // namespace blink |
208 | 215 |
209 WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::HitTestResult); | 216 WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::HitTestResult); |
210 | 217 |
211 #endif // HitTestResult_h | 218 #endif // HitTestResult_h |
OLD | NEW |