| 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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #ifndef HitTestResult_h | 22 #ifndef HitTestResult_h |
| 23 #define HitTestResult_h | 23 #define HitTestResult_h |
| 24 | 24 |
| 25 #include "core/CoreExport.h" | 25 #include "core/CoreExport.h" |
| 26 #include "core/editing/PositionWithAffinity.h" | 26 #include "core/editing/PositionWithAffinity.h" |
| 27 #include "core/layout/HitTestCanvasResult.h" |
| 27 #include "core/layout/HitTestLocation.h" | 28 #include "core/layout/HitTestLocation.h" |
| 28 #include "core/layout/HitTestRequest.h" | 29 #include "core/layout/HitTestRequest.h" |
| 29 #include "platform/geometry/FloatQuad.h" | 30 #include "platform/geometry/FloatQuad.h" |
| 30 #include "platform/geometry/FloatRect.h" | 31 #include "platform/geometry/FloatRect.h" |
| 31 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
| 32 #include "platform/text/TextDirection.h" | 33 #include "platform/text/TextDirection.h" |
| 33 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
| 34 #include "wtf/ListHashSet.h" | 35 #include "wtf/ListHashSet.h" |
| 35 #include "wtf/RefPtr.h" | 36 #include "wtf/RefPtr.h" |
| 36 #include "wtf/VectorTraits.h" | 37 #include "wtf/VectorTraits.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 const LayoutPoint& localPoint() const { return m_localPoint; } | 111 const LayoutPoint& localPoint() const { return m_localPoint; } |
| 111 void setNodeAndPosition(Node* node, const LayoutPoint& p) { m_localPoint = p
; setInnerNode(node); } | 112 void setNodeAndPosition(Node* node, const LayoutPoint& p) { m_localPoint = p
; setInnerNode(node); } |
| 112 | 113 |
| 113 PositionWithAffinity position() const; | 114 PositionWithAffinity position() const; |
| 114 LayoutObject* layoutObject() const; | 115 LayoutObject* layoutObject() const; |
| 115 | 116 |
| 116 void setToShadowHostIfInUserAgentShadowRoot(); | 117 void setToShadowHostIfInUserAgentShadowRoot(); |
| 117 | 118 |
| 118 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } | 119 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } |
| 119 const HitTestRequest& hitTestRequest() const { return m_hitTestRequest; } | 120 const HitTestRequest& hitTestRequest() const { return m_hitTestRequest; } |
| 121 HitTestCanvasResult* hitTestCanvasResult() const { return m_hitTestCanvasRes
ult.get(); } |
| 120 | 122 |
| 121 void setInnerNode(Node*); | 123 void setInnerNode(Node*); |
| 122 HTMLAreaElement* imageAreaForImage() const; | 124 HTMLAreaElement* imageAreaForImage() const; |
| 123 void setURLElement(Element*); | 125 void setURLElement(Element*); |
| 124 void setScrollbar(Scrollbar*); | 126 void setScrollbar(Scrollbar*); |
| 125 void setIsOverWidget(bool b) { m_isOverWidget = b; } | 127 void setIsOverWidget(bool b) { m_isOverWidget = b; } |
| 128 void setHitCanvasRegion(HitTestCanvasResult*); |
| 126 | 129 |
| 127 bool isSelected() const; | 130 bool isSelected() const; |
| 128 String title(TextDirection&) const; | 131 String title(TextDirection&) const; |
| 129 const AtomicString& altDisplayString() const; | 132 const AtomicString& altDisplayString() const; |
| 130 Image* image() const; | 133 Image* image() const; |
| 131 IntRect imageRect() const; | 134 IntRect imageRect() const; |
| 132 KURL absoluteImageURL() const; | 135 KURL absoluteImageURL() const; |
| 133 KURL absoluteMediaURL() const; | 136 KURL absoluteMediaURL() const; |
| 134 KURL absoluteLinkURL() const; | 137 KURL absoluteLinkURL() const; |
| 135 String textContent() const; | 138 String textContent() const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 158 | 161 |
| 159 // Collapse the rect-based test result into a single target at the specified
location. | 162 // Collapse the rect-based test result into a single target at the specified
location. |
| 160 void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolv
edPointInMainFrame); | 163 void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolv
edPointInMainFrame); |
| 161 | 164 |
| 162 private: | 165 private: |
| 163 NodeSet& mutableListBasedTestResult(); // See above. | 166 NodeSet& mutableListBasedTestResult(); // See above. |
| 164 HTMLMediaElement* mediaElement() const; | 167 HTMLMediaElement* mediaElement() const; |
| 165 | 168 |
| 166 HitTestLocation m_hitTestLocation; | 169 HitTestLocation m_hitTestLocation; |
| 167 HitTestRequest m_hitTestRequest; | 170 HitTestRequest m_hitTestRequest; |
| 171 Member<HitTestCanvasResult> m_hitTestCanvasResult; |
| 168 bool m_cacheable; | 172 bool m_cacheable; |
| 169 | 173 |
| 170 Member<Node> m_innerNode; | 174 Member<Node> m_innerNode; |
| 171 Member<Node> m_innerPossiblyPseudoNode; | 175 Member<Node> m_innerPossiblyPseudoNode; |
| 172 // FIXME: Nothing changes this to a value different from m_hitTestLocation! | 176 // FIXME: Nothing changes this to a value different from m_hitTestLocation! |
| 173 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. | 177 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. |
| 174 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNode's layoutObject. Allows us to efficiently | 178 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNode's layoutObject. Allows us to efficiently |
| 175 // determine where inside the layoutObject we hit on subsequent operatio
ns. | 179 // determine where inside the layoutObject we hit on subsequent operatio
ns. |
| 176 Member<Element> m_innerURLElement; | 180 Member<Element> m_innerURLElement; |
| 177 Member<Scrollbar> m_scrollbar; | 181 Member<Scrollbar> m_scrollbar; |
| 178 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a LayoutPart for example). | 182 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a LayoutPart for example). |
| 179 | 183 |
| 180 mutable Member<NodeSet> m_listBasedTestResult; | 184 mutable Member<NodeSet> m_listBasedTestResult; |
| 181 }; | 185 }; |
| 182 | 186 |
| 183 } // namespace blink | 187 } // namespace blink |
| 184 | 188 |
| 185 WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::HitTestResult); | 189 WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::HitTestResult); |
| 186 | 190 |
| 187 #endif // HitTestResult_h | 191 #endif // HitTestResult_h |
| OLD | NEW |