#include "wtf/OwnPtr.h"
#include "wtf/RefPtr.h"
-namespace WebCore {
+namespace blink {
class Element;
class LocalFrame;
class KURL;
class Node;
class RenderObject;
+class PositionWithAffinity;
class Scrollbar;
class HitTestResult {
HitTestResult& operator=(const HitTestResult&);
void trace(Visitor*);
+ // For point-based hit tests, these accessors provide information about the node
+ // under the point. For rect-based hit tests they are meaningless (reflect the
+ // last candidate node observed in the rect).
+ // FIXME: Make these less error-prone for rect-based hit tests (center point or fail).
Node* innerNode() const { return m_innerNode.get(); }
Node* innerPossiblyPseudoNode() const { return m_innerPossiblyPseudoNode.get(); }
Element* innerElement() const;
const LayoutPoint& localPoint() const { return m_localPoint; }
void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; }
+ PositionWithAffinity position() const;
RenderObject* renderer() const;
- void setToNodesInDocumentTreeScope();
void setToShadowHostIfInUserAgentShadowRoot();
const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; }
Image* image() const;
IntRect imageRect() const;
KURL absoluteImageURL() const;
+ // This variant of absoluteImageURL will also convert <canvas> elements
+ // to huge image data URLs (very expensive).
+ KURL absoluteImageURLIncludingCanvasDataURL() const;
KURL absoluteMediaURL() const;
KURL absoluteLinkURL() const;
String textContent() const;
// the same thing as mutableRectBasedTestResult(), but here the return value is const.
const NodeSet& rectBasedTestResult() const;
- Node* targetNode() const;
+ // Collapse the rect-based test result into a single target at the specified location.
+ void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolvedPointInMainFrame);
+
+ // FIXME: Remove this.
+ Node* targetNode() const { return innerNode(); }
private:
+ KURL absoluteImageURLInternal(bool allowCanvas) const;
NodeSet& mutableRectBasedTestResult(); // See above.
HTMLMediaElement* mediaElement() const;
RefPtrWillBeMember<Node> m_innerNode;
RefPtrWillBeMember<Node> m_innerPossiblyPseudoNode;
RefPtrWillBeMember<Node> m_innerNonSharedNode;
+ // FIXME: Nothing changes this to a value different from m_hitTestLocation!
LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode frame coordinates.
LayoutPoint m_localPoint; // A point in the local coordinate space of m_innerNonSharedNode's renderer. Allows us to efficiently
// determine where inside the renderer we hit on subsequent operations.
mutable OwnPtrWillBeMember<NodeSet> m_rectBasedTestResult;
};
-} // namespace WebCore
+} // namespace blink
#endif // HitTestResult_h