Changeset 90603 in webkit
- Timestamp:
- Jul 7, 2011, 5:17:24 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
page/MouseEventWithHitTestResults.cpp (modified) (1 diff)
-
page/MouseEventWithHitTestResults.h (modified) (1 diff)
-
rendering/HitTestResult.cpp (modified) (6 diffs)
-
rendering/HitTestResult.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90600 r90603 1 2011-07-07 Emil A Eklund <eae@chromium.org> 2 3 Switch HitTestResult to to new layout types 4 https://bugs.webkit.org/show_bug.cgi?id=64131 5 6 Reviewed by Eric Seidel. 7 8 No new tests, no functionality changes. 9 10 * page/MouseEventWithHitTestResults.cpp: 11 (WebCore::MouseEventWithHitTestResults::localPoint): 12 * page/MouseEventWithHitTestResults.h: 13 * rendering/HitTestResult.cpp: 14 (WebCore::HitTestResult::HitTestResult): 15 (WebCore::HitTestResult::addNodeToRectBasedTestResult): 16 (WebCore::HitTestResult::rectForPoint): 17 * rendering/HitTestResult.h: 18 (WebCore::HitTestResult::point): 19 (WebCore::HitTestResult::localPoint): 20 (WebCore::HitTestResult::setPoint): 21 (WebCore::HitTestResult::setLocalPoint): 22 (WebCore::HitTestResult::rectForPoint): 23 1 24 2011-07-07 Levi Weintraub <leviw@chromium.org> 2 25 -
trunk/Source/WebCore/page/MouseEventWithHitTestResults.cpp
r83153 r90603 34 34 } 35 35 36 const IntPoint MouseEventWithHitTestResults::localPoint() const36 const LayoutPoint MouseEventWithHitTestResults::localPoint() const 37 37 { 38 38 return m_hitTestResult.localPoint(); -
trunk/Source/WebCore/page/MouseEventWithHitTestResults.h
r83153 r90603 35 35 const PlatformMouseEvent& event() const { return m_event; } 36 36 const HitTestResult& hitTestResult() const { return m_hitTestResult; } 37 const IntPoint localPoint() const;37 const LayoutPoint localPoint() const; 38 38 Scrollbar* scrollbar() const; 39 39 bool isOverLink() const; -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r87539 r90603 56 56 } 57 57 58 HitTestResult::HitTestResult(const IntPoint& point)58 HitTestResult::HitTestResult(const LayoutPoint& point) 59 59 : m_point(point) 60 60 , m_isOverWidget(false) … … 67 67 } 68 68 69 HitTestResult::HitTestResult(const IntPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding)69 HitTestResult::HitTestResult(const LayoutPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding) 70 70 : m_point(centerPoint) 71 71 , m_isOverWidget(false) … … 509 509 } 510 510 511 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const IntPoint& pointInContainer, const IntRect& rect)511 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const LayoutPoint& pointInContainer, const LayoutRect& rect) 512 512 { 513 513 // If it is not a rect-based hit test, this method has to be no-op. … … 540 540 } 541 541 542 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const IntPoint& pointInContainer, const FloatRect& rect)542 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const LayoutPoint& pointInContainer, const FloatRect& rect) 543 543 { 544 544 // If it is not a rect-based hit test, this method has to be no-op. … … 591 591 } 592 592 593 IntRect HitTestResult::rectForPoint(const IntPoint& point, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding)594 { 595 IntPoint actualPoint(point);596 actualPoint -= IntSize(leftPadding, topPadding);593 LayoutRect HitTestResult::rectForPoint(const LayoutPoint& point, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding) 594 { 595 LayoutPoint actualPoint(point); 596 actualPoint -= LayoutSize(leftPadding, topPadding); 597 597 598 598 IntSize actualPadding(leftPadding + rightPadding, topPadding + bottomPadding); … … 600 600 actualPadding += IntSize(1, 1); 601 601 602 return IntRect(actualPoint, actualPadding);602 return LayoutRect(actualPoint, actualPadding); 603 603 } 604 604 -
trunk/Source/WebCore/rendering/HitTestResult.h
r87018 r90603 22 22 23 23 #include "FloatRect.h" 24 #include "IntPoint.h" 25 #include "IntRect.h" 26 #include "IntSize.h" 24 #include "LayoutTypes.h" 27 25 #include "TextDirection.h" 28 26 #include <wtf/Forward.h> … … 39 37 #endif 40 38 class Image; 41 class IntRect;42 39 class KURL; 43 40 class Node; … … 49 46 50 47 HitTestResult(); 51 HitTestResult(const IntPoint&);48 HitTestResult(const LayoutPoint&); 52 49 // Pass non-negative padding values to perform a rect-based hit test. 53 HitTestResult(const IntPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding);50 HitTestResult(const LayoutPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding); 54 51 HitTestResult(const HitTestResult&); 55 52 ~HitTestResult(); … … 58 55 Node* innerNode() const { return m_innerNode.get(); } 59 56 Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); } 60 IntPoint point() const { return m_point; }61 IntPoint localPoint() const { return m_localPoint; }57 LayoutPoint point() const { return m_point; } 58 LayoutPoint localPoint() const { return m_localPoint; } 62 59 Element* URLElement() const { return m_innerURLElement.get(); } 63 60 Scrollbar* scrollbar() const { return m_scrollbar.get(); } … … 68 65 void setInnerNode(Node*); 69 66 void setInnerNonSharedNode(Node*); 70 void setPoint(const IntPoint& p) { m_point = p; }71 void setLocalPoint(const IntPoint& p) { m_localPoint = p; }67 void setPoint(const LayoutPoint& p) { m_point = p; } 68 void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; } 72 69 void setURLElement(Element*); 73 70 void setScrollbar(Scrollbar*); … … 104 101 // Rect-based hit test related methods. 105 102 bool isRectBasedTest() const { return m_isRectBased; } 106 IntRect rectForPoint(const IntPoint&) const;107 static IntRect rectForPoint(const IntPoint&, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding);103 LayoutRect rectForPoint(const LayoutPoint&) const; 104 static LayoutRect rectForPoint(const LayoutPoint&, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding); 108 105 int topPadding() const { return m_topPadding; } 109 106 int rightPadding() const { return m_rightPadding; } … … 113 110 // Returns true if it is rect-based hit test and needs to continue until the rect is fully 114 111 // enclosed by the boundaries of a node. 115 bool addNodeToRectBasedTestResult(Node*, const IntPoint& pointInContainer, const IntRect& = IntRect());116 bool addNodeToRectBasedTestResult(Node*, const IntPoint& pointInContainer, const FloatRect&);112 bool addNodeToRectBasedTestResult(Node*, const LayoutPoint& pointInContainer, const LayoutRect& = IntRect()); 113 bool addNodeToRectBasedTestResult(Node*, const LayoutPoint& pointInContainer, const FloatRect&); 117 114 void append(const HitTestResult&); 118 115 … … 131 128 RefPtr<Node> m_innerNode; 132 129 RefPtr<Node> m_innerNonSharedNode; 133 IntPoint m_point;134 IntPoint m_localPoint; // A point in the local coordinate space of m_innerNonSharedNode's renderer.Allows us to efficiently135 // determine where inside the renderer we hit on subsequent operations.130 LayoutPoint m_point; 131 LayoutPoint m_localPoint; // A point in the local coordinate space of m_innerNonSharedNode's renderer. Allows us to efficiently 132 // determine where inside the renderer we hit on subsequent operations. 136 133 RefPtr<Element> m_innerURLElement; 137 134 RefPtr<Scrollbar> m_scrollbar; … … 150 147 // width = leftPadding + rightPadding + 1 151 148 // height = topPadding + bottomPadding + 1 152 inline IntRect HitTestResult::rectForPoint(const IntPoint& point) const149 inline LayoutRect HitTestResult::rectForPoint(const LayoutPoint& point) const 153 150 { 154 151 return rectForPoint(point, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding);
Note:
See TracChangeset
for help on using the changeset viewer.