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/rendering/HitTestLocation.h" | 25 #include "core/rendering/HitTestLocation.h" |
26 #include "core/rendering/HitTestRequest.h" | 26 #include "core/rendering/HitTestRequest.h" |
| 27 // TODO: We should |enum CursorDirective| to its own header file from RenderObje
ct.h. |
| 28 #include "core/rendering/RenderObject.h" |
27 #include "platform/geometry/FloatQuad.h" | 29 #include "platform/geometry/FloatQuad.h" |
28 #include "platform/geometry/FloatRect.h" | 30 #include "platform/geometry/FloatRect.h" |
29 #include "platform/geometry/LayoutRect.h" | 31 #include "platform/geometry/LayoutRect.h" |
30 #include "platform/text/TextDirection.h" | 32 #include "platform/text/TextDirection.h" |
31 #include "wtf/Forward.h" | 33 #include "wtf/Forward.h" |
32 #include "wtf/ListHashSet.h" | 34 #include "wtf/ListHashSet.h" |
33 #include "wtf/OwnPtr.h" | 35 #include "wtf/OwnPtr.h" |
34 #include "wtf/RefPtr.h" | 36 #include "wtf/RefPtr.h" |
35 | 37 |
36 namespace WebCore { | 38 namespace WebCore { |
37 | 39 |
38 class Element; | 40 class Element; |
39 class Frame; | 41 class Frame; |
40 class HTMLMediaElement; | 42 class HTMLMediaElement; |
41 class Image; | 43 class Image; |
42 class KURL; | 44 class KURL; |
43 class Node; | 45 class Node; |
| 46 class PositionWithAffinity; |
44 class RenderObject; | 47 class RenderObject; |
45 class RenderRegion; | 48 class RenderRegion; |
46 class Scrollbar; | 49 class Scrollbar; |
47 | 50 |
48 class HitTestResult { | 51 class HitTestResult { |
49 public: | 52 public: |
50 typedef ListHashSet<RefPtr<Node> > NodeSet; | 53 typedef ListHashSet<RefPtr<Node> > NodeSet; |
51 | 54 |
52 HitTestResult(); | 55 HitTestResult(); |
53 HitTestResult(const LayoutPoint&); | 56 HitTestResult(const LayoutPoint&); |
(...skipping 17 matching lines...) Expand all Loading... |
71 | 74 |
72 // The hit-tested point in the coordinates of the main frame. | 75 // The hit-tested point in the coordinates of the main frame. |
73 const LayoutPoint& pointInMainFrame() const { return m_hitTestLocation.point
(); } | 76 const LayoutPoint& pointInMainFrame() const { return m_hitTestLocation.point
(); } |
74 IntPoint roundedPointInMainFrame() const { return roundedIntPoint(pointInMai
nFrame()); } | 77 IntPoint roundedPointInMainFrame() const { return roundedIntPoint(pointInMai
nFrame()); } |
75 | 78 |
76 // The hit-tested point in the coordinates of the innerNode frame, the frame
containing innerNode. | 79 // The hit-tested point in the coordinates of the innerNode frame, the frame
containing innerNode. |
77 const LayoutPoint& pointInInnerNodeFrame() const { return m_pointInInnerNode
Frame; } | 80 const LayoutPoint& pointInInnerNodeFrame() const { return m_pointInInnerNode
Frame; } |
78 IntPoint roundedPointInInnerNodeFrame() const { return roundedIntPoint(point
InInnerNodeFrame()); } | 81 IntPoint roundedPointInInnerNodeFrame() const { return roundedIntPoint(point
InInnerNodeFrame()); } |
79 Frame* innerNodeFrame() const; | 82 Frame* innerNodeFrame() const; |
80 | 83 |
81 // The hit-tested point in the coordinates of the inner node. | 84 // The hit-tested point in the coordinates of |innerPossiblyPseudoNode()| |
| 85 // rather htan |innerNode()|. |
82 const LayoutPoint& localPoint() const { return m_localPoint; } | 86 const LayoutPoint& localPoint() const { return m_localPoint; } |
83 void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; } | 87 void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; } |
84 | 88 PositionWithAffinity position() const; |
85 RenderObject* renderer() const; | 89 RenderObject* renderer() const; |
86 | 90 |
87 void setToNodesInDocumentTreeScope(); | 91 void setToNodesInDocumentTreeScope(); |
88 void setToShadowHostIfInUserAgentShadowRoot(); | 92 void setToShadowHostIfInUserAgentShadowRoot(); |
89 | 93 |
90 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } | 94 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } |
91 | 95 |
92 void setInnerNode(Node*); | 96 void setInnerNode(Node*); |
93 void setInnerNonSharedNode(Node*); | 97 void setInnerNonSharedNode(Node*); |
94 void setURLElement(Element*); | 98 void setURLElement(Element*); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 RefPtr<Scrollbar> m_scrollbar; | 146 RefPtr<Scrollbar> m_scrollbar; |
143 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a RenderWidget for example). | 147 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a RenderWidget for example). |
144 bool m_isFirstLetter; | 148 bool m_isFirstLetter; |
145 | 149 |
146 mutable OwnPtr<NodeSet> m_rectBasedTestResult; | 150 mutable OwnPtr<NodeSet> m_rectBasedTestResult; |
147 }; | 151 }; |
148 | 152 |
149 } // namespace WebCore | 153 } // namespace WebCore |
150 | 154 |
151 #endif // HitTestResult_h | 155 #endif // HitTestResult_h |
OLD | NEW |