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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 HitTestResult(); | 56 HitTestResult(); |
57 HitTestResult(const HitTestRequest&, const LayoutPoint&); | 57 HitTestResult(const HitTestRequest&, const LayoutPoint&); |
58 // Pass positive padding values to perform a rect-based hit test. | 58 // Pass positive padding values to perform a rect-based hit test. |
59 HitTestResult(const HitTestRequest&, const LayoutPoint& centerPoint, unsigne
d topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPaddin
g); | 59 HitTestResult(const HitTestRequest&, const LayoutPoint& centerPoint, unsigne
d topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPaddin
g); |
60 HitTestResult(const HitTestRequest&, const HitTestLocation&); | 60 HitTestResult(const HitTestRequest&, const HitTestLocation&); |
61 HitTestResult(const HitTestResult&); | 61 HitTestResult(const HitTestResult&); |
62 ~HitTestResult(); | 62 ~HitTestResult(); |
63 HitTestResult& operator=(const HitTestResult&); | 63 HitTestResult& operator=(const HitTestResult&); |
64 DECLARE_TRACE(); | 64 DECLARE_TRACE(); |
65 | 65 |
| 66 bool equalForCacheability(const HitTestResult&) const; |
| 67 void cacheValues(const HitTestResult&); |
| 68 |
| 69 // Populate this object based on another HitTestResult; similar to assignmen
t operator |
| 70 // but don't assign any of the request parameters. ie. Thie method avoids se
tting |
| 71 // |m_hitTestLocation|, |m_hitTestRequest|. |
| 72 void populateFromCachedResult(const HitTestResult&); |
| 73 |
66 // For point-based hit tests, these accessors provide information about the
node | 74 // For point-based hit tests, these accessors provide information about the
node |
67 // under the point. For rect-based hit tests they are meaningless (reflect t
he | 75 // under the point. For rect-based hit tests they are meaningless (reflect t
he |
68 // last candidate node observed in the rect). | 76 // last candidate node observed in the rect). |
69 // FIXME: Make these less error-prone for rect-based hit tests (center point
or fail). | 77 // FIXME: Make these less error-prone for rect-based hit tests (center point
or fail). |
70 Node* innerNode() const { return m_innerNode.get(); } | 78 Node* innerNode() const { return m_innerNode.get(); } |
71 Node* innerPossiblyPseudoNode() const { return m_innerPossiblyPseudoNode.get
(); } | 79 Node* innerPossiblyPseudoNode() const { return m_innerPossiblyPseudoNode.get
(); } |
72 Element* innerElement() const; | 80 Element* innerElement() const; |
73 | 81 |
74 // If innerNode is an image map or image map area, return the associated ima
ge node. | 82 // If innerNode is an image map or image map area, return the associated ima
ge node. |
75 Node* innerNodeOrImageMapImage() const; | 83 Node* innerNodeOrImageMapImage() const; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 KURL absoluteImageURL() const; | 125 KURL absoluteImageURL() const; |
118 KURL absoluteMediaURL() const; | 126 KURL absoluteMediaURL() const; |
119 KURL absoluteLinkURL() const; | 127 KURL absoluteLinkURL() const; |
120 String textContent() const; | 128 String textContent() const; |
121 bool isLiveLink() const; | 129 bool isLiveLink() const; |
122 bool isMisspelled() const; | 130 bool isMisspelled() const; |
123 bool isContentEditable() const; | 131 bool isContentEditable() const; |
124 | 132 |
125 bool isOverLink() const; | 133 bool isOverLink() const; |
126 | 134 |
| 135 const LayoutRect& validityRect() const { return m_validityRect; } |
| 136 void setValidityRect(const LayoutRect&); |
| 137 |
127 // Return true if the test is a list-based test and we should continue testi
ng. | 138 // Return true if the test is a list-based test and we should continue testi
ng. |
128 bool addNodeToListBasedTestResult(Node*, const HitTestLocation& pointInConta
iner, const LayoutRect& = LayoutRect()); | 139 bool addNodeToListBasedTestResult(Node*, const HitTestLocation& pointInConta
iner, const LayoutRect& = LayoutRect()); |
129 bool addNodeToListBasedTestResult(Node*, const HitTestLocation& pointInConta
iner, const FloatRect&); | 140 bool addNodeToListBasedTestResult(Node*, const HitTestLocation& pointInConta
iner, const FloatRect&); |
130 void append(const HitTestResult&); | 141 void append(const HitTestResult&); |
131 | 142 |
132 // If m_listBasedTestResult is 0 then set it to a new NodeSet. Return *m_lis
tBasedTestResult. Lazy allocation makes | 143 // If m_listBasedTestResult is 0 then set it to a new NodeSet. Return *m_lis
tBasedTestResult. Lazy allocation makes |
133 // sense because the NodeSet is seldom necessary, and it's somewhat expensiv
e to allocate and initialize. This method does | 144 // sense because the NodeSet is seldom necessary, and it's somewhat expensiv
e to allocate and initialize. This method does |
134 // the same thing as mutableListBasedTestResult(), but here the return value
is const. | 145 // the same thing as mutableListBasedTestResult(), but here the return value
is const. |
135 const NodeSet& listBasedTestResult() const; | 146 const NodeSet& listBasedTestResult() const; |
136 | 147 |
137 // Collapse the rect-based test result into a single target at the specified
location. | 148 // Collapse the rect-based test result into a single target at the specified
location. |
138 void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolv
edPointInMainFrame); | 149 void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolv
edPointInMainFrame); |
139 | 150 |
140 private: | 151 private: |
141 NodeSet& mutableListBasedTestResult(); // See above. | 152 NodeSet& mutableListBasedTestResult(); // See above. |
142 HTMLMediaElement* mediaElement() const; | 153 HTMLMediaElement* mediaElement() const; |
143 | 154 |
144 HitTestLocation m_hitTestLocation; | 155 HitTestLocation m_hitTestLocation; |
145 HitTestRequest m_hitTestRequest; | 156 HitTestRequest m_hitTestRequest; |
| 157 LayoutRect m_validityRect; |
146 | 158 |
147 RefPtrWillBeMember<Node> m_innerNode; | 159 RefPtrWillBeMember<Node> m_innerNode; |
148 RefPtrWillBeMember<Node> m_innerPossiblyPseudoNode; | 160 RefPtrWillBeMember<Node> m_innerPossiblyPseudoNode; |
149 // FIXME: Nothing changes this to a value different from m_hitTestLocation! | 161 // FIXME: Nothing changes this to a value different from m_hitTestLocation! |
150 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. | 162 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. |
151 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNode's layoutObject. Allows us to efficiently | 163 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNode's layoutObject. Allows us to efficiently |
152 // determine where inside the layoutObject we hit on subsequent operatio
ns. | 164 // determine where inside the layoutObject we hit on subsequent operatio
ns. |
153 RefPtrWillBeMember<Element> m_innerURLElement; | 165 RefPtrWillBeMember<Element> m_innerURLElement; |
154 RefPtrWillBeMember<Scrollbar> m_scrollbar; | 166 RefPtrWillBeMember<Scrollbar> m_scrollbar; |
155 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a LayoutPart for example). | 167 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a LayoutPart for example). |
156 | 168 |
157 mutable OwnPtrWillBeMember<NodeSet> m_listBasedTestResult; | 169 mutable OwnPtrWillBeMember<NodeSet> m_listBasedTestResult; |
158 }; | 170 }; |
159 | 171 |
160 } // namespace blink | 172 } // namespace blink |
161 | 173 |
162 #endif // HitTestResult_h | 174 #endif // HitTestResult_h |
OLD | NEW |