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 20 matching lines...) Expand all Loading... |
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 |
83 void allowPseudoElements() { m_allowPseudoElements = true; } | 84 void allowPseudoElements() { m_allowPseudoElements = true; } |
| 85 RenderObject* renderer() const; |
| 86 |
84 void setToNodesInDocumentTreeScope(); | 87 void setToNodesInDocumentTreeScope(); |
85 void setToShadowHostIfInUserAgentShadowRoot(); | 88 void setToShadowHostIfInUserAgentShadowRoot(); |
86 | 89 |
87 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } | 90 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } |
88 | 91 |
89 void setInnerNode(Node*); | 92 void setInnerNode(Node*); |
90 void setInnerNonSharedNode(Node*); | 93 void setInnerNonSharedNode(Node*); |
91 void setURLElement(Element*); | 94 void setURLElement(Element*); |
92 void setScrollbar(Scrollbar*); | 95 void setScrollbar(Scrollbar*); |
| 96 void setIsFirstLetter(bool b) { m_isFirstLetter = b; } |
93 void setIsOverWidget(bool b) { m_isOverWidget = b; } | 97 void setIsOverWidget(bool b) { m_isOverWidget = b; } |
94 | 98 |
95 Frame* targetFrame() const; | 99 Frame* targetFrame() const; |
96 bool isSelected() const; | 100 bool isSelected() const; |
97 String spellingToolTip(TextDirection&) const; | 101 String spellingToolTip(TextDirection&) const; |
98 String title(TextDirection&) const; | 102 String title(TextDirection&) const; |
99 String altDisplayString() const; | 103 String altDisplayString() const; |
100 String titleDisplayString() const; | 104 String titleDisplayString() const; |
101 Image* image() const; | 105 Image* image() const; |
102 IntRect imageRect() const; | 106 IntRect imageRect() const; |
(...skipping 26 matching lines...) Expand all Loading... |
129 | 133 |
130 RefPtr<Node> m_innerNode; | 134 RefPtr<Node> m_innerNode; |
131 RefPtr<Node> m_innerNonSharedNode; | 135 RefPtr<Node> m_innerNonSharedNode; |
132 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. | 136 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. |
133 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNonSharedNode's renderer. Allows us to efficiently | 137 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNonSharedNode's renderer. Allows us to efficiently |
134 // determine where inside the renderer we hit on s
ubsequent operations. | 138 // determine where inside the renderer we hit on s
ubsequent operations. |
135 RefPtr<Element> m_innerURLElement; | 139 RefPtr<Element> m_innerURLElement; |
136 RefPtr<Scrollbar> m_scrollbar; | 140 RefPtr<Scrollbar> m_scrollbar; |
137 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). |
138 bool m_allowPseudoElements; | 142 bool m_allowPseudoElements; |
| 143 bool m_isFirstLetter; |
139 | 144 |
140 mutable OwnPtr<NodeSet> m_rectBasedTestResult; | 145 mutable OwnPtr<NodeSet> m_rectBasedTestResult; |
141 }; | 146 }; |
142 | 147 |
143 String displayString(const String&, const Node*); | 148 String displayString(const String&, const Node*); |
144 | 149 |
145 } // namespace WebCore | 150 } // namespace WebCore |
146 | 151 |
147 #endif // HitTestResult_h | 152 #endif // HitTestResult_h |
OLD | NEW |