| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class Element; | 39 class Element; |
| 40 class LocalFrame; | 40 class LocalFrame; |
| 41 class Image; | 41 class Image; |
| 42 class KURL; | 42 class KURL; |
| 43 class Node; | 43 class Node; |
| 44 class RenderObject; | 44 class RenderObject; |
| 45 class PositionWithAffinity; | 45 class PositionWithAffinity; |
| 46 class Scrollbar; | |
| 47 | 46 |
| 48 class HitTestResult { | 47 class HitTestResult { |
| 49 DISALLOW_ALLOCATION(); | 48 DISALLOW_ALLOCATION(); |
| 50 public: | 49 public: |
| 51 typedef ListHashSet<RefPtr<Node> > NodeSet; | 50 typedef ListHashSet<RefPtr<Node> > NodeSet; |
| 52 | 51 |
| 53 HitTestResult(); | 52 HitTestResult(); |
| 54 HitTestResult(const LayoutPoint&); | 53 HitTestResult(const LayoutPoint&); |
| 55 // 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. |
| 56 HitTestResult(const LayoutPoint& centerPoint, unsigned topPadding, unsigned
rightPadding, unsigned bottomPadding, unsigned leftPadding); | 55 HitTestResult(const LayoutPoint& centerPoint, unsigned topPadding, unsigned
rightPadding, unsigned bottomPadding, unsigned leftPadding); |
| 57 HitTestResult(const HitTestLocation&); | 56 HitTestResult(const HitTestLocation&); |
| 58 HitTestResult(const HitTestResult&); | 57 HitTestResult(const HitTestResult&); |
| 59 ~HitTestResult(); | 58 ~HitTestResult(); |
| 60 HitTestResult& operator=(const HitTestResult&); | 59 HitTestResult& operator=(const HitTestResult&); |
| 61 | 60 |
| 62 // For point-based hit tests, these accessors provide information about the
node | 61 // For point-based hit tests, these accessors provide information about the
node |
| 63 // under the point. For rect-based hit tests they are meaningless (reflect t
he | 62 // under the point. For rect-based hit tests they are meaningless (reflect t
he |
| 64 // last candidate node observed in the rect). | 63 // last candidate node observed in the rect). |
| 65 // FIXME: Make these less error-prone for rect-based hit tests (center point
or fail). | 64 // FIXME: Make these less error-prone for rect-based hit tests (center point
or fail). |
| 66 Node* innerNode() const { return m_innerNode.get(); } | 65 Node* innerNode() const { return m_innerNode.get(); } |
| 67 Node* innerPossiblyPseudoNode() const { return m_innerPossiblyPseudoNode.get
(); } | 66 Node* innerPossiblyPseudoNode() const { return m_innerPossiblyPseudoNode.get
(); } |
| 68 Element* innerElement() const; | 67 Element* innerElement() const; |
| 69 Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); } | 68 Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); } |
| 70 Element* URLElement() const { return m_innerURLElement.get(); } | 69 Element* URLElement() const { return m_innerURLElement.get(); } |
| 71 Scrollbar* scrollbar() const { return m_scrollbar.get(); } | |
| 72 bool isOverWidget() const { return m_isOverWidget; } | 70 bool isOverWidget() const { return m_isOverWidget; } |
| 73 | 71 |
| 74 // Forwarded from HitTestLocation | 72 // Forwarded from HitTestLocation |
| 75 bool isRectBasedTest() const { return m_hitTestLocation.isRectBasedTest(); } | 73 bool isRectBasedTest() const { return m_hitTestLocation.isRectBasedTest(); } |
| 76 | 74 |
| 77 // The hit-tested point in the coordinates of the main frame. | 75 // The hit-tested point in the coordinates of the main frame. |
| 78 const LayoutPoint& pointInMainFrame() const { return m_hitTestLocation.point
(); } | 76 const LayoutPoint& pointInMainFrame() const { return m_hitTestLocation.point
(); } |
| 79 IntPoint roundedPointInMainFrame() const { return roundedIntPoint(pointInMai
nFrame()); } | 77 IntPoint roundedPointInMainFrame() const { return roundedIntPoint(pointInMai
nFrame()); } |
| 80 | 78 |
| 81 // 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. |
| 82 const LayoutPoint& pointInInnerNodeFrame() const { return m_pointInInnerNode
Frame; } | 80 const LayoutPoint& pointInInnerNodeFrame() const { return m_pointInInnerNode
Frame; } |
| 83 IntPoint roundedPointInInnerNodeFrame() const { return roundedIntPoint(point
InInnerNodeFrame()); } | 81 IntPoint roundedPointInInnerNodeFrame() const { return roundedIntPoint(point
InInnerNodeFrame()); } |
| 84 LocalFrame* innerNodeFrame() const; | 82 LocalFrame* innerNodeFrame() const; |
| 85 | 83 |
| 86 // The hit-tested point in the coordinates of the inner node. | 84 // The hit-tested point in the coordinates of the inner node. |
| 87 const LayoutPoint& localPoint() const { return m_localPoint; } | 85 const LayoutPoint& localPoint() const { return m_localPoint; } |
| 88 void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; } | 86 void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; } |
| 89 | 87 |
| 90 PositionWithAffinity position() const; | 88 PositionWithAffinity position() const; |
| 91 RenderObject* renderer() const; | 89 RenderObject* renderer() const; |
| 92 | 90 |
| 93 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } | 91 const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } |
| 94 | 92 |
| 95 void setInnerNode(Node*); | 93 void setInnerNode(Node*); |
| 96 void setInnerNonSharedNode(Node*); | 94 void setInnerNonSharedNode(Node*); |
| 97 void setURLElement(Element*); | 95 void setURLElement(Element*); |
| 98 void setScrollbar(Scrollbar*); | |
| 99 void setIsOverWidget(bool b) { m_isOverWidget = b; } | 96 void setIsOverWidget(bool b) { m_isOverWidget = b; } |
| 100 | 97 |
| 101 bool isSelected() const; | 98 bool isSelected() const; |
| 102 Image* image() const; | 99 Image* image() const; |
| 103 IntRect imageRect() const; | 100 IntRect imageRect() const; |
| 104 KURL absoluteImageURL() const; | 101 KURL absoluteImageURL() const; |
| 105 // This variant of absoluteImageURL will also convert <canvas> elements | 102 // This variant of absoluteImageURL will also convert <canvas> elements |
| 106 // to huge image data URLs (very expensive). | 103 // to huge image data URLs (very expensive). |
| 107 KURL absoluteImageURLIncludingCanvasDataURL() const; | 104 KURL absoluteImageURLIncludingCanvasDataURL() const; |
| 108 KURL absoluteLinkURL() const; | 105 KURL absoluteLinkURL() const; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 136 HitTestLocation m_hitTestLocation; | 133 HitTestLocation m_hitTestLocation; |
| 137 | 134 |
| 138 RefPtr<Node> m_innerNode; | 135 RefPtr<Node> m_innerNode; |
| 139 RefPtr<Node> m_innerPossiblyPseudoNode; | 136 RefPtr<Node> m_innerPossiblyPseudoNode; |
| 140 RefPtr<Node> m_innerNonSharedNode; | 137 RefPtr<Node> m_innerNonSharedNode; |
| 141 // FIXME: Nothing changes this to a value different from m_hitTestLocation! | 138 // FIXME: Nothing changes this to a value different from m_hitTestLocation! |
| 142 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. | 139 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr
ame coordinates. |
| 143 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNonSharedNode's renderer. Allows us to efficiently | 140 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne
rNonSharedNode's renderer. Allows us to efficiently |
| 144 // determine where inside the renderer we hit on s
ubsequent operations. | 141 // determine where inside the renderer we hit on s
ubsequent operations. |
| 145 RefPtr<Element> m_innerURLElement; | 142 RefPtr<Element> m_innerURLElement; |
| 146 RefPtr<Scrollbar> m_scrollbar; | |
| 147 bool m_isOverWidget; // Returns true if we are over a widget. | 143 bool m_isOverWidget; // Returns true if we are over a widget. |
| 148 | 144 |
| 149 mutable OwnPtr<NodeSet> m_rectBasedTestResult; | 145 mutable OwnPtr<NodeSet> m_rectBasedTestResult; |
| 150 }; | 146 }; |
| 151 | 147 |
| 152 } // namespace blink | 148 } // namespace blink |
| 153 | 149 |
| 154 #endif // SKY_ENGINE_CORE_RENDERING_HITTESTRESULT_H_ | 150 #endif // SKY_ENGINE_CORE_RENDERING_HITTESTRESULT_H_ |
| OLD | NEW |