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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 void setIsFirstLetter(bool b) { m_isFirstLetter = b; } | 103 void setIsFirstLetter(bool b) { m_isFirstLetter = b; } |
104 void setIsOverWidget(bool b) { m_isOverWidget = b; } | 104 void setIsOverWidget(bool b) { m_isOverWidget = b; } |
105 | 105 |
106 bool isSelected() const; | 106 bool isSelected() const; |
107 String spellingToolTip(TextDirection&) const; | 107 String spellingToolTip(TextDirection&) const; |
108 String title(TextDirection&) const; | 108 String title(TextDirection&) const; |
109 const AtomicString& altDisplayString() const; | 109 const AtomicString& altDisplayString() const; |
110 Image* image() const; | 110 Image* image() const; |
111 IntRect imageRect() const; | 111 IntRect imageRect() const; |
112 KURL absoluteImageURL() const; | 112 KURL absoluteImageURL() const; |
113 // This variant of absoluteImageURL will also convert <canvas> elements | |
114 // to huge image data URLs (very expensive). | |
115 KURL absoluteImageURLIncludingCanvasDataURL() const; | |
116 KURL absoluteMediaURL() const; | 113 KURL absoluteMediaURL() const; |
117 KURL absoluteLinkURL() const; | 114 KURL absoluteLinkURL() const; |
118 String textContent() const; | 115 String textContent() const; |
119 bool isLiveLink() const; | 116 bool isLiveLink() const; |
120 bool isMisspelled() const; | 117 bool isMisspelled() const; |
121 bool isContentEditable() const; | 118 bool isContentEditable() const; |
122 | 119 |
123 bool isOverLink() const; | 120 bool isOverLink() const; |
124 // Returns true if it is rect-based hit test and needs to continue until the
rect is fully | 121 // Returns true if it is rect-based hit test and needs to continue until the
rect is fully |
125 // enclosed by the boundaries of a node. | 122 // enclosed by the boundaries of a node. |
126 bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTes
tLocation& pointInContainer, const LayoutRect& = LayoutRect()); | 123 bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTes
tLocation& pointInContainer, const LayoutRect& = LayoutRect()); |
127 bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTes
tLocation& pointInContainer, const FloatRect&); | 124 bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTes
tLocation& pointInContainer, const FloatRect&); |
128 void append(const HitTestResult&); | 125 void append(const HitTestResult&); |
129 | 126 |
130 // If m_rectBasedTestResult is 0 then set it to a new NodeSet. Return *m_rec
tBasedTestResult. Lazy allocation makes | 127 // If m_rectBasedTestResult is 0 then set it to a new NodeSet. Return *m_rec
tBasedTestResult. Lazy allocation makes |
131 // sense because the NodeSet is seldom necessary, and it's somewhat expensiv
e to allocate and initialize. This method does | 128 // sense because the NodeSet is seldom necessary, and it's somewhat expensiv
e to allocate and initialize. This method does |
132 // the same thing as mutableRectBasedTestResult(), but here the return value
is const. | 129 // the same thing as mutableRectBasedTestResult(), but here the return value
is const. |
133 const NodeSet& rectBasedTestResult() const; | 130 const NodeSet& rectBasedTestResult() const; |
134 | 131 |
135 // Collapse the rect-based test result into a single target at the specified
location. | 132 // Collapse the rect-based test result into a single target at the specified
location. |
136 void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolv
edPointInMainFrame); | 133 void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolv
edPointInMainFrame); |
137 | 134 |
138 private: | 135 private: |
139 KURL absoluteImageURLInternal(bool allowCanvas) const; | |
140 NodeSet& mutableRectBasedTestResult(); // See above. | 136 NodeSet& mutableRectBasedTestResult(); // See above. |
141 HTMLMediaElement* mediaElement() const; | 137 HTMLMediaElement* mediaElement() const; |
142 | 138 |
143 HitTestLocation m_hitTestLocation; | 139 HitTestLocation m_hitTestLocation; |
144 | 140 |
145 RefPtrWillBeMember<Node> m_innerNode; | 141 RefPtrWillBeMember<Node> m_innerNode; |
146 RefPtrWillBeMember<Node> m_innerPossiblyPseudoNode; | 142 RefPtrWillBeMember<Node> m_innerPossiblyPseudoNode; |
147 RefPtrWillBeMember<Node> m_innerNonSharedNode; | 143 RefPtrWillBeMember<Node> m_innerNonSharedNode; |
148 // FIXME: Nothing changes this to a value different from m_hitTestLocation! | 144 // FIXME: Nothing changes this to a value different from m_hitTestLocation! |
149 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. | 145 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. |
150 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNonSharedNode's renderer. Allows us to efficiently | 146 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNonSharedNode's renderer. Allows us to efficiently |
151 // determine where inside the renderer we hit on s
ubsequent operations. | 147 // determine where inside the renderer we hit on s
ubsequent operations. |
152 RefPtrWillBeMember<Element> m_innerURLElement; | 148 RefPtrWillBeMember<Element> m_innerURLElement; |
153 RefPtr<Scrollbar> m_scrollbar; | 149 RefPtr<Scrollbar> m_scrollbar; |
154 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a RenderWidget for example). | 150 bool m_isOverWidget; // Returns true if we are over a widget (and not in the
border/padding area of a RenderWidget for example). |
155 bool m_isFirstLetter; | 151 bool m_isFirstLetter; |
156 | 152 |
157 mutable OwnPtrWillBeMember<NodeSet> m_rectBasedTestResult; | 153 mutable OwnPtrWillBeMember<NodeSet> m_rectBasedTestResult; |
158 }; | 154 }; |
159 | 155 |
160 } // namespace blink | 156 } // namespace blink |
161 | 157 |
162 #endif // HitTestResult_h | 158 #endif // HitTestResult_h |
OLD | NEW |