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 23 matching lines...) Expand all Loading... |
34 #include "wtf/RefPtr.h" | 34 #include "wtf/RefPtr.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 class Element; | 38 class Element; |
39 class Frame; | 39 class Frame; |
40 class HTMLMediaElement; | 40 class HTMLMediaElement; |
41 class Image; | 41 class Image; |
42 class KURL; | 42 class KURL; |
43 class Node; | 43 class Node; |
| 44 class RenderObject; |
44 class RenderRegion; | 45 class RenderRegion; |
45 class Scrollbar; | 46 class Scrollbar; |
46 | 47 |
47 class HitTestResult { | 48 class HitTestResult { |
48 public: | 49 public: |
49 typedef ListHashSet<RefPtr<Node> > NodeSet; | 50 typedef ListHashSet<RefPtr<Node> > NodeSet; |
50 | 51 |
51 HitTestResult(); | 52 HitTestResult(); |
52 HitTestResult(const LayoutPoint&); | 53 HitTestResult(const LayoutPoint&); |
53 // Pass non-negative padding values to perform a rect-based hit test. | 54 // Pass non-negative padding values to perform a rect-based hit test. |
(...skipping 19 matching lines...) Expand all Loading... |
73 | 74 |
74 // The hit-tested point in the coordinates of the innerNode frame, the frame
containing innerNode. | 75 // The hit-tested point in the coordinates of the innerNode frame, the frame
containing innerNode. |
75 const LayoutPoint& pointInInnerNodeFrame() const { return m_pointInInnerNode
Frame; } | 76 const LayoutPoint& pointInInnerNodeFrame() const { return m_pointInInnerNode
Frame; } |
76 IntPoint roundedPointInInnerNodeFrame() const { return roundedIntPoint(point
InInnerNodeFrame()); } | 77 IntPoint roundedPointInInnerNodeFrame() const { return roundedIntPoint(point
InInnerNodeFrame()); } |
77 Frame* innerNodeFrame() const; | 78 Frame* innerNodeFrame() const; |
78 | 79 |
79 // The hit-tested point in the coordinates of the inner node. | 80 // The hit-tested point in the coordinates of the inner node. |
80 const LayoutPoint& localPoint() const { return m_localPoint; } | 81 const LayoutPoint& localPoint() const { return m_localPoint; } |
81 void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; } | 82 void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; } |
82 | 83 |
| 84 RenderObject* renderer() const; |
| 85 |
83 void setToNodesInDocumentTreeScope(); | 86 void setToNodesInDocumentTreeScope(); |
84 void setToShadowHostIfInUserAgentShadowRoot(); | 87 void setToShadowHostIfInUserAgentShadowRoot(); |
85 | 88 |
86 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } | 89 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } |
87 | 90 |
88 void setInnerNode(Node*); | 91 void setInnerNode(Node*); |
89 void setInnerNonSharedNode(Node*); | 92 void setInnerNonSharedNode(Node*); |
90 void setURLElement(Element*); | 93 void setURLElement(Element*); |
91 void setScrollbar(Scrollbar*); | 94 void setScrollbar(Scrollbar*); |
| 95 void setIsFirstLetter(bool b) { m_isFirstLetter = b; } |
92 void setIsOverWidget(bool b) { m_isOverWidget = b; } | 96 void setIsOverWidget(bool b) { m_isOverWidget = b; } |
93 | 97 |
94 Frame* targetFrame() const; | 98 Frame* targetFrame() const; |
95 bool isSelected() const; | 99 bool isSelected() const; |
96 String spellingToolTip(TextDirection&) const; | 100 String spellingToolTip(TextDirection&) const; |
97 String title(TextDirection&) const; | 101 String title(TextDirection&) const; |
98 String altDisplayString() const; | 102 String altDisplayString() const; |
99 String titleDisplayString() const; | 103 String titleDisplayString() const; |
100 Image* image() const; | 104 Image* image() const; |
101 IntRect imageRect() const; | 105 IntRect imageRect() const; |
(...skipping 24 matching lines...) Expand all Loading... |
126 | 130 |
127 HitTestLocation m_hitTestLocation; | 131 HitTestLocation m_hitTestLocation; |
128 | 132 |
129 RefPtr<Node> m_innerNode; | 133 RefPtr<Node> m_innerNode; |
130 RefPtr<Node> m_innerNonSharedNode; | 134 RefPtr<Node> m_innerNonSharedNode; |
131 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. | 135 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. |
132 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNonSharedNode's renderer. Allows us to efficiently | 136 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNonSharedNode's renderer. Allows us to efficiently |
133 // determine where inside the renderer we hit on s
ubsequent operations. | 137 // determine where inside the renderer we hit on s
ubsequent operations. |
134 RefPtr<Element> m_innerURLElement; | 138 RefPtr<Element> m_innerURLElement; |
135 RefPtr<Scrollbar> m_scrollbar; | 139 RefPtr<Scrollbar> m_scrollbar; |
| 140 bool m_isFirstLetter; |
136 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a RenderWidget for example). | 141 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a RenderWidget for example). |
137 | 142 |
138 mutable OwnPtr<NodeSet> m_rectBasedTestResult; | 143 mutable OwnPtr<NodeSet> m_rectBasedTestResult; |
139 }; | 144 }; |
140 | 145 |
141 String displayString(const String&, const Node*); | 146 String displayString(const String&, const Node*); |
142 | 147 |
143 } // namespace WebCore | 148 } // namespace WebCore |
144 | 149 |
145 #endif // HitTestResult_h | 150 #endif // HitTestResult_h |
OLD | NEW |