Changeset 86705 in webkit
- Timestamp:
- May 17, 2011 1:57:28 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86704 r86705 1 2011-05-17 Emil A Eklund <eae@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Change nodeAtPoint to take IntPoint instead of int x, int y 6 https://bugs.webkit.org/show_bug.cgi?id=60663 7 8 Change nodeAtPoint to take a single const IntPoint& instead of a pair of 9 ints for the location. 10 11 Covered by existing tests. 12 13 * platform/graphics/FloatPoint.h: 14 (WebCore::flooredIntPoint): 15 * rendering/EllipsisBox.cpp: 16 (WebCore::EllipsisBox::nodeAtPoint): 17 * rendering/EllipsisBox.h: 18 * rendering/InlineBox.cpp: 19 (WebCore::InlineBox::nodeAtPoint): 20 * rendering/InlineBox.h: 21 * rendering/InlineFlowBox.cpp: 22 (WebCore::InlineFlowBox::nodeAtPoint): 23 * rendering/InlineFlowBox.h: 24 * rendering/InlineTextBox.cpp: 25 (WebCore::InlineTextBox::nodeAtPoint): 26 * rendering/InlineTextBox.h: 27 * rendering/RenderBlock.cpp: 28 (WebCore::RenderBlock::nodeAtPoint): 29 (WebCore::RenderBlock::hitTestContents): 30 * rendering/RenderBlock.h: 31 * rendering/RenderBox.cpp: 32 (WebCore::RenderBox::nodeAtPoint): 33 * rendering/RenderBox.h: 34 * rendering/RenderFrameSet.cpp: 35 (WebCore::RenderFrameSet::nodeAtPoint): 36 * rendering/RenderFrameSet.h: 37 * rendering/RenderImage.cpp: 38 (WebCore::RenderImage::nodeAtPoint): 39 * rendering/RenderImage.h: 40 * rendering/RenderInline.cpp: 41 (WebCore::RenderInline::nodeAtPoint): 42 * rendering/RenderInline.h: 43 * rendering/RenderLineBoxList.cpp: 44 (WebCore::RenderLineBoxList::hitTest): 45 * rendering/RenderListBox.cpp: 46 (WebCore::RenderListBox::nodeAtPoint): 47 * rendering/RenderListBox.h: 48 * rendering/RenderObject.cpp: 49 (WebCore::RenderObject::hitTest): 50 (WebCore::RenderObject::nodeAtPoint): 51 * rendering/RenderObject.h: 52 * rendering/RenderTable.cpp: 53 (WebCore::RenderTable::nodeAtPoint): 54 * rendering/RenderTable.h: 55 * rendering/RenderTableRow.cpp: 56 (WebCore::RenderTableRow::nodeAtPoint): 57 * rendering/RenderTableRow.h: 58 * rendering/RenderTableSection.cpp: 59 (WebCore::RenderTableSection::nodeAtPoint): 60 * rendering/RenderTableSection.h: 61 * rendering/RenderText.h: 62 (WebCore::RenderText::nodeAtPoint): 63 * rendering/RenderTextControlMultiLine.cpp: 64 (WebCore::RenderTextControlMultiLine::nodeAtPoint): 65 * rendering/RenderTextControlMultiLine.h: 66 * rendering/RenderTextControlSingleLine.cpp: 67 (WebCore::RenderTextControlSingleLine::nodeAtPoint): 68 * rendering/RenderTextControlSingleLine.h: 69 * rendering/RenderWidget.cpp: 70 (WebCore::RenderWidget::nodeAtPoint): 71 * rendering/RenderWidget.h: 72 * rendering/RootInlineBox.cpp: 73 (WebCore::RootInlineBox::nodeAtPoint): 74 * rendering/RootInlineBox.h: 75 * rendering/svg/RenderSVGForeignObject.cpp: 76 (WebCore::RenderSVGForeignObject::nodeAtFloatPoint): 77 (WebCore::RenderSVGForeignObject::nodeAtPoint): 78 * rendering/svg/RenderSVGForeignObject.h: 79 * rendering/svg/RenderSVGModelObject.cpp: 80 (WebCore::RenderSVGModelObject::nodeAtPoint): 81 * rendering/svg/RenderSVGModelObject.h: 82 * rendering/svg/RenderSVGRoot.cpp: 83 (WebCore::RenderSVGRoot::nodeAtPoint): 84 * rendering/svg/RenderSVGRoot.h: 85 * rendering/svg/RenderSVGText.cpp: 86 (WebCore::RenderSVGText::nodeAtFloatPoint): 87 (WebCore::RenderSVGText::nodeAtPoint): 88 * rendering/svg/RenderSVGText.h: 89 1 90 2011-05-17 Andrew Wilson <atwilson@chromium.org> 2 91 -
trunk/Source/WebCore/platform/graphics/FloatPoint.h
r84273 r86705 203 203 } 204 204 205 inline IntPoint flooredIntPoint(const FloatPoint& p) 206 { 207 return IntPoint(static_cast<int>(p.x()), static_cast<int>(p.y())); 208 } 209 205 210 float findSlope(const FloatPoint& p1, const FloatPoint& p2, float& c); 206 211 -
trunk/Source/WebCore/rendering/EllipsisBox.cpp
r85143 r86705 102 102 } 103 103 104 bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, int lineTop, int lineBottom)104 bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom) 105 105 { 106 106 tx += m_x; … … 112 112 int mtx = tx + m_logicalWidth - m_markupBox->x(); 113 113 int mty = ty + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->fontMetrics().ascent()); 114 if (m_markupBox->nodeAtPoint(request, result, x, y, mtx, mty, lineTop, lineBottom)) {115 renderer()->updateHitTestResult(result, IntPoint(x - mtx, y -mty));114 if (m_markupBox->nodeAtPoint(request, result, pointInContainer, mtx, mty, lineTop, lineBottom)) { 115 renderer()->updateHitTestResult(result, pointInContainer - IntSize(mtx, mty)); 116 116 return true; 117 117 } … … 119 119 120 120 IntRect boundsRect = IntRect(tx, ty, m_logicalWidth, m_height); 121 if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint( x, y))) {122 renderer()->updateHitTestResult(result, IntPoint(x - tx, y -ty));123 if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, boundsRect))121 if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint(pointInContainer))) { 122 renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty)); 123 if (!result.addNodeToRectBasedTestResult(renderer()->node(), pointInContainer.x(), pointInContainer.y(), boundsRect)) 124 124 return true; 125 125 } -
trunk/Source/WebCore/rendering/EllipsisBox.h
r82611 r86705 41 41 42 42 virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom); 43 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);43 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom); 44 44 void setSelectionState(RenderObject::SelectionState s) { m_selectionState = s; } 45 45 IntRect selectionRect(int tx, int ty); -
trunk/Source/WebCore/rendering/InlineBox.cpp
r85512 r86705 222 222 } 223 223 224 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, int /* lineTop */, int /*lineBottom*/)224 bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int /* lineTop */, int /*lineBottom*/) 225 225 { 226 226 // Hit test all phases of replaced elements atomically, as though the replaced element established its 227 227 // own stacking context. (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1 228 228 // specification.) 229 return renderer()->hitTest(request, result, IntPoint(x, y), tx, ty);229 return renderer()->hitTest(request, result, pointInContainer, tx, ty); 230 230 } 231 231 -
trunk/Source/WebCore/rendering/InlineBox.h
r85512 r86705 131 131 132 132 virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom); 133 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);133 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom); 134 134 135 135 InlineBox* next() const { return m_next; } -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r86384 r86705 899 899 } 900 900 901 bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, int lineTop, int lineBottom)901 bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom) 902 902 { 903 903 IntRect overflowRect(visualOverflowRect(lineTop, lineBottom)); 904 904 flipForWritingMode(overflowRect); 905 905 overflowRect.move(tx, ty); 906 if (!overflowRect.intersects(result.rectForPoint( x, y)))906 if (!overflowRect.intersects(result.rectForPoint(pointInContainer))) 907 907 return false; 908 908 909 909 // Check children first. 910 910 for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) { 911 if ((curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) && curr->nodeAtPoint(request, result, x, y, tx, ty, lineTop, lineBottom)) {912 renderer()->updateHitTestResult(result, IntPoint(x - tx, y -ty));911 if ((curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) && curr->nodeAtPoint(request, result, pointInContainer, tx, ty, lineTop, lineBottom)) { 912 renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty)); 913 913 return true; 914 914 } … … 938 938 rect.move(tx, ty); 939 939 940 if (visibleToHitTesting() && rect.intersects(result.rectForPoint( x, y))) {941 renderer()->updateHitTestResult(result, flipForWritingMode( IntPoint(x - tx, y -ty))); // Don't add in m_x or m_y here, we want coords in the containing block's space.942 if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))940 if (visibleToHitTesting() && rect.intersects(result.rectForPoint(pointInContainer))) { 941 renderer()->updateHitTestResult(result, flipForWritingMode(pointInContainer - IntSize(tx, ty))); // Don't add in m_x or m_y here, we want coords in the containing block's space. 942 if (!result.addNodeToRectBasedTestResult(renderer()->node(), pointInContainer.x(), pointInContainer.y(), rect)) 943 943 return true; 944 944 } -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r86384 r86705 110 110 void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, const IntRect&); 111 111 virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom); 112 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);112 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom); 113 113 114 114 virtual RenderLineBoxList* rendererLineBoxes() const; -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r86704 r86705 345 345 } 346 346 347 bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, int x, int y, int tx, int ty, int /* lineTop */, int /*lineBottom*/)347 bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int /* lineTop */, int /*lineBottom*/) 348 348 { 349 349 if (isLineBreak()) … … 353 353 boxOrigin.move(tx, ty); 354 354 FloatRect rect(boxOrigin, IntSize(width(), height())); 355 if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectForPoint( x, y))) {356 renderer()->updateHitTestResult(result, flipForWritingMode( IntPoint(x - tx, y -ty)));357 if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))355 if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectForPoint(pointInContainer))) { 356 renderer()->updateHitTestResult(result, flipForWritingMode(pointInContainer - IntSize(tx, ty))); 357 if (!result.addNodeToRectBasedTestResult(renderer()->node(), pointInContainer.x(), pointInContainer.y(), rect)) 358 358 return true; 359 359 } -
trunk/Source/WebCore/rendering/InlineTextBox.h
r86197 r86705 108 108 protected: 109 109 virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom); 110 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);110 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom); 111 111 112 112 public: -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r86698 r86705 3898 3898 } 3899 3899 3900 bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) 3901 { 3902 int tx = _tx + x(); 3903 int ty = _ty + y(); 3900 bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction) 3901 { 3902 IntSize localOffset(tx + x(), ty + y()); 3904 3903 3905 3904 if (!isRenderView()) { 3906 3905 // Check if we need to do anything at all. 3907 3906 IntRect overflowBox = visualOverflowRect(); 3908 overflowBox.move( tx, ty);3909 if (!overflowBox.intersects(result.rectForPoint( _x, _y)))3907 overflowBox.move(localOffset); 3908 if (!overflowBox.intersects(result.rectForPoint(pointInContainer))) 3910 3909 return false; 3911 3910 } 3912 3911 3913 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) && isPointInOverflowControl(result, _x, _y, tx, ty)) {3914 updateHitTestResult(result, IntPoint(_x - tx, _y - ty));3912 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) && isPointInOverflowControl(result, pointInContainer.x(), pointInContainer.y(), localOffset.width(), localOffset.height())) { 3913 updateHitTestResult(result, pointInContainer - localOffset); 3915 3914 // FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet. 3916 if (!result.addNodeToRectBasedTestResult(node(), _x, _y))3915 if (!result.addNodeToRectBasedTestResult(node(), pointInContainer.x(), pointInContainer.y())) 3917 3916 return true; 3918 3917 } … … 3921 3920 bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer(); 3922 3921 bool useClip = (hasControlClip() || useOverflowClip); 3923 IntRect hitTestArea(result.rectForPoint( _x, _y));3924 bool checkChildren = !useClip || (hasControlClip() ? controlClipRect( tx, ty).intersects(hitTestArea) : overflowClipRect(tx, ty, IncludeOverlayScrollbarSize).intersects(hitTestArea));3922 IntRect hitTestArea(result.rectForPoint(pointInContainer)); 3923 bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(localOffset.width(), localOffset.height()).intersects(hitTestArea) : overflowClipRect(localOffset.width(), localOffset.height(), IncludeOverlayScrollbarSize).intersects(hitTestArea)); 3925 3924 if (checkChildren) { 3926 3925 // Hit test descendants first. 3927 int scrolledX = tx; 3928 int scrolledY = ty; 3926 IntSize scrolledOffset(localOffset); 3929 3927 if (hasOverflowClip()) { 3930 IntSize offset = layer()->scrolledContentOffset(); 3931 scrolledX -= offset.width(); 3932 scrolledY -= offset.height(); 3928 scrolledOffset -= layer()->scrolledContentOffset(); 3933 3929 } 3934 3930 3935 3931 // Hit test contents if we don't have columns. 3936 3932 if (!hasColumns()) { 3937 if (hitTestContents(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {3938 updateHitTestResult(result, IntPoint(_x - tx, _y - ty));3933 if (hitTestContents(request, result, pointInContainer.x(), pointInContainer.y(), scrolledOffset.width(), scrolledOffset.height(), hitTestAction)) { 3934 updateHitTestResult(result, pointInContainer - localOffset); 3939 3935 return true; 3940 3936 } 3941 if (hitTestAction == HitTestFloat && hitTestFloats(request, result, _x, _y, scrolledX, scrolledY))3937 if (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer.x(), pointInContainer.y(), scrolledOffset.width(), scrolledOffset.height())) 3942 3938 return true; 3943 } else if (hitTestColumns(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {3944 updateHitTestResult(result, IntPoint(_x - tx, _y - ty));3939 } else if (hitTestColumns(request, result, pointInContainer.x(), pointInContainer.y(), scrolledOffset.width(), scrolledOffset.height(), hitTestAction)) { 3940 updateHitTestResult(result, pointInContainer - localOffset); 3945 3941 return true; 3946 3942 } … … 3949 3945 // Now hit test our background 3950 3946 if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) { 3951 IntRect boundsRect( tx, ty, width(), height());3952 if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint( _x, _y))) {3953 updateHitTestResult(result, flipForWritingMode( IntPoint(_x - tx, _y - ty)));3954 if (!result.addNodeToRectBasedTestResult(node(), _x, _y, boundsRect))3947 IntRect boundsRect(localOffset.width(), localOffset.height(), width(), height()); 3948 if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint(pointInContainer))) { 3949 updateHitTestResult(result, flipForWritingMode(pointInContainer - localOffset)); 3950 if (!result.addNodeToRectBasedTestResult(node(), pointInContainer.x(), pointInContainer.y(), boundsRect)) 3955 3951 return true; 3956 3952 } … … 4049 4045 for (RenderBox* child = lastChildBox(); child; child = child->previousSiblingBox()) { 4050 4046 IntPoint childPoint = flipForWritingMode(child, IntPoint(tx, ty), ParentToChildFlippingAdjustment); 4051 if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, x, y, childPoint.x(), childPoint.y(), childHitTest))4047 if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, IntPoint(x, y), childPoint.x(), childPoint.y(), childHitTest)) 4052 4048 return true; 4053 4049 } -
trunk/Source/WebCore/rendering/RenderBlock.h
r86698 r86705 287 287 virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { } 288 288 289 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);289 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 290 290 291 291 virtual void computePreferredLogicalWidths(); -
trunk/Source/WebCore/rendering/RenderBox.cpp
r86632 r86705 741 741 742 742 // Hit Testing 743 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)743 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action) 744 744 { 745 745 tx += x(); … … 748 748 // Check kids first. 749 749 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { 750 if (!child->hasLayer() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) {751 updateHitTestResult(result, IntPoint(xPos - tx, yPos -ty));750 if (!child->hasLayer() && child->nodeAtPoint(request, result, pointInContainer, tx, ty, action)) { 751 updateHitTestResult(result, pointInContainer - IntSize(tx, ty)); 752 752 return true; 753 753 } … … 757 757 // foreground phase (which is true for replaced elements like images). 758 758 IntRect boundsRect = IntRect(tx, ty, width(), height()); 759 if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectForPoint( xPos, yPos))) {760 updateHitTestResult(result, IntPoint(xPos - tx, yPos -ty));761 if (!result.addNodeToRectBasedTestResult(node(), xPos, yPos, boundsRect))759 if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectForPoint(pointInContainer))) { 760 updateHitTestResult(result, pointInContainer - IntSize(tx, ty)); 761 if (!result.addNodeToRectBasedTestResult(node(), pointInContainer.x(), pointInContainer.y(), boundsRect)) 762 762 return true; 763 763 } -
trunk/Source/WebCore/rendering/RenderBox.h
r86395 r86705 240 240 virtual void layout(); 241 241 virtual void paint(PaintInfo&, int tx, int ty); 242 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);242 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 243 243 244 244 virtual void destroy(); -
trunk/Source/WebCore/rendering/RenderFrameSet.cpp
r86395 r86705 159 159 160 160 bool RenderFrameSet::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, 161 int x, int y, int tx, int ty, HitTestAction action)161 const IntPoint& pointInContainer, int tx, int ty, HitTestAction action) 162 162 { 163 163 if (action != HitTestForeground) 164 164 return false; 165 165 166 bool inside = RenderBox::nodeAtPoint(request, result, x, y, tx, ty, action)166 bool inside = RenderBox::nodeAtPoint(request, result, pointInContainer, tx, ty, action) 167 167 || m_isResizing; 168 168 -
trunk/Source/WebCore/rendering/RenderFrameSet.h
r86390 r86705 97 97 98 98 virtual void layout(); 99 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);99 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 100 100 virtual void paint(PaintInfo&, int tx, int ty); 101 101 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const; -
trunk/Source/WebCore/rendering/RenderImage.cpp
r86197 r86705 394 394 } 395 395 396 bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)396 bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction) 397 397 { 398 398 HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding()); 399 bool inside = RenderReplaced::nodeAtPoint(request, tempResult, x, y, tx, ty, hitTestAction);399 bool inside = RenderReplaced::nodeAtPoint(request, tempResult, pointInContainer, tx, ty, hitTestAction); 400 400 401 401 if (tempResult.innerNode() && node()) { … … 403 403 IntRect contentBox = contentBoxRect(); 404 404 float zoom = style()->effectiveZoom(); 405 int mapX = lroundf(( x- tx - this->x() - contentBox.x()) / zoom);406 int mapY = lroundf(( y- ty - this->y() - contentBox.y()) / zoom);405 int mapX = lroundf((pointInContainer.x() - tx - this->x() - contentBox.x()) / zoom); 406 int mapY = lroundf((pointInContainer.y() - ty - this->y() - contentBox.y()) / zoom); 407 407 if (map->mapMouseEvent(mapX, mapY, contentBox.size(), tempResult)) 408 408 tempResult.setInnerNonSharedNode(node()); -
trunk/Source/WebCore/rendering/RenderImage.h
r77313 r86705 82 82 83 83 virtual void notifyFinished(CachedResource*); 84 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);84 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 85 85 86 86 virtual int computeReplacedLogicalWidth(bool includeMaxWidth = true) const; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r86413 r86705 713 713 714 714 bool RenderInline::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, 715 int x, int y, int tx, int ty, HitTestAction hitTestAction)716 { 717 return m_lineBoxes.hitTest(this, request, result, x, y, tx, ty, hitTestAction);715 const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction) 716 { 717 return m_lineBoxes.hitTest(this, request, result, pointInContainer.x(), pointInContainer.y(), tx, ty, hitTestAction); 718 718 } 719 719 -
trunk/Source/WebCore/rendering/RenderInline.h
r86314 r86705 118 118 virtual void paint(PaintInfo&, int tx, int ty); 119 119 120 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);120 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 121 121 122 122 virtual bool requiresLayer() const { return isRelPositioned() || isTransparent() || hasMask(); } -
trunk/Source/WebCore/rendering/RenderLineBoxList.cpp
r86176 r86705 302 302 RootInlineBox* root = curr->root(); 303 303 if (rangeIntersectsRect(renderer, curr->logicalTopVisualOverflow(root->lineTop()), curr->logicalBottomVisualOverflow(root->lineBottom()), rect, tx, ty)) { 304 bool inside = curr->nodeAtPoint(request, result, x, y, tx, ty, root->lineTop(), root->lineBottom());304 bool inside = curr->nodeAtPoint(request, result, IntPoint(x, y), tx, ty, root->lineTop(), root->lineBottom()); 305 305 if (inside) { 306 306 renderer->updateHitTestResult(result, IntPoint(x - tx, y - ty)); -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r86325 r86705 667 667 } 668 668 669 bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)670 { 671 if (!RenderBlock::nodeAtPoint(request, result, x, y, tx, ty, hitTestAction))669 bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction) 670 { 671 if (!RenderBlock::nodeAtPoint(request, result, pointInContainer, tx, ty, hitTestAction)) 672 672 return false; 673 673 const Vector<Element*>& listItems = toSelectElement(static_cast<Element*>(node()))->listItems(); … … 676 676 ty += this->y(); 677 677 for (int i = 0; i < size; ++i) { 678 if (itemBoundingBoxRect(tx, ty, i).contains( x, y)) {678 if (itemBoundingBoxRect(tx, ty, i).contains(pointInContainer)) { 679 679 if (Element* node = listItems[i]) { 680 680 result.setInnerNode(node); 681 681 if (!result.innerNonSharedNode()) 682 682 result.setInnerNonSharedNode(node); 683 result.setLocalPoint( IntPoint(x - tx, y -ty));683 result.setLocalPoint(pointInContainer - IntSize(tx, ty)); 684 684 break; 685 685 } -
trunk/Source/WebCore/rendering/RenderListBox.h
r83820 r86705 97 97 virtual void setScrollTop(int); 98 98 99 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);99 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 100 100 101 101 // ScrollableArea interface. -
trunk/Source/WebCore/rendering/RenderObject.cpp
r86413 r86705 2133 2133 } 2134 2134 2135 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const IntPoint& point , int tx, int ty, HitTestFilter hitTestFilter)2135 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestFilter hitTestFilter) 2136 2136 { 2137 2137 bool inside = false; 2138 2138 if (hitTestFilter != HitTestSelf) { 2139 2139 // First test the foreground layer (lines and inlines). 2140 inside = nodeAtPoint(request, result, point .x(), point.y(), tx, ty, HitTestForeground);2140 inside = nodeAtPoint(request, result, pointInContainer, tx, ty, HitTestForeground); 2141 2141 2142 2142 // Test floats next. 2143 2143 if (!inside) 2144 inside = nodeAtPoint(request, result, point .x(), point.y(), tx, ty, HitTestFloat);2144 inside = nodeAtPoint(request, result, pointInContainer, tx, ty, HitTestFloat); 2145 2145 2146 2146 // Finally test to see if the mouse is in the background (within a child block's background). 2147 2147 if (!inside) 2148 inside = nodeAtPoint(request, result, point .x(), point.y(), tx, ty, HitTestChildBlockBackgrounds);2148 inside = nodeAtPoint(request, result, pointInContainer, tx, ty, HitTestChildBlockBackgrounds); 2149 2149 } 2150 2150 2151 2151 // See if the mouse is inside us but not any of our descendants 2152 2152 if (hitTestFilter != HitTestDescendants && !inside) 2153 inside = nodeAtPoint(request, result, point .x(), point.y(), tx, ty, HitTestBlockBackground);2153 inside = nodeAtPoint(request, result, pointInContainer, tx, ty, HitTestBlockBackground); 2154 2154 2155 2155 return inside; … … 2170 2170 } 2171 2171 2172 bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int /*x*/, int /*y*/, int /*tx*/, int /*ty*/, HitTestAction)2172 bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& /*pointInContainer*/, int /*tx*/, int /*ty*/, HitTestAction) 2173 2173 { 2174 2174 return false; -
trunk/Source/WebCore/rendering/RenderObject.h
r86400 r86705 547 547 548 548 bool hitTest(const HitTestRequest&, HitTestResult&, const IntPoint&, int tx, int ty, HitTestFilter = HitTestAll); 549 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);549 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 550 550 virtual void updateHitTestResult(HitTestResult&, const IntPoint&); 551 551 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r86400 r86705 1199 1199 } 1200 1200 1201 bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)1201 bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action) 1202 1202 { 1203 1203 tx += x(); … … 1205 1205 1206 1206 // Check kids first. 1207 if (!hasOverflowClip() || overflowClipRect(tx, ty).intersects(result.rectForPoint( xPos, yPos))) {1207 if (!hasOverflowClip() || overflowClipRect(tx, ty).intersects(result.rectForPoint(pointInContainer))) { 1208 1208 for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { 1209 1209 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) { 1210 1210 IntPoint childPoint = flipForWritingMode(toRenderBox(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment); 1211 if (child->nodeAtPoint(request, result, xPos, yPos, childPoint.x(), childPoint.y(), action)) {1212 updateHitTestResult(result, IntPoint(xPos - childPoint.x(), yPos - childPoint.y()));1211 if (child->nodeAtPoint(request, result, pointInContainer, childPoint.x(), childPoint.y(), action)) { 1212 updateHitTestResult(result, toPoint(pointInContainer - childPoint)); 1213 1213 return true; 1214 1214 } … … 1219 1219 // Check our bounds next. 1220 1220 IntRect boundsRect = IntRect(tx, ty, width(), height()); 1221 if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint( xPos, yPos))) {1222 updateHitTestResult(result, flipForWritingMode( IntPoint(xPos - tx, yPos -ty)));1223 if (!result.addNodeToRectBasedTestResult(node(), xPos, yPos, boundsRect))1221 if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint(pointInContainer))) { 1222 updateHitTestResult(result, flipForWritingMode(pointInContainer - IntSize(tx, ty))); 1223 if (!result.addNodeToRectBasedTestResult(node(), pointInContainer.x(), pointInContainer.y(), boundsRect)) 1224 1224 return true; 1225 1225 } -
trunk/Source/WebCore/rendering/RenderTable.h
r86377 r86705 221 221 virtual void layout(); 222 222 virtual void computePreferredLogicalWidths(); 223 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int xPos, int yPos, int tx, int ty, HitTestAction);223 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 224 224 225 225 virtual int firstLineBoxBaseline() const; -
trunk/Source/WebCore/rendering/RenderTableRow.cpp
r83255 r86705 188 188 189 189 // Hit Testing 190 bool RenderTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)190 bool RenderTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action) 191 191 { 192 192 // Table rows cannot ever be hit tested. Effectively they do not exist. … … 199 199 if (child->isTableCell() && !toRenderBox(child)->hasSelfPaintingLayer()) { 200 200 IntPoint cellPoint = flipForWritingMode(toRenderTableCell(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment); 201 if (child->nodeAtPoint(request, result, x, y, cellPoint.x(), cellPoint.y(), action)) {202 updateHitTestResult(result, IntPoint(x - cellPoint.x(), y -cellPoint.y()));201 if (child->nodeAtPoint(request, result, pointInContainer, cellPoint.x(), cellPoint.y(), action)) { 202 updateHitTestResult(result, pointInContainer - IntSize(cellPoint.x(), cellPoint.y())); 203 203 return true; 204 204 } -
trunk/Source/WebCore/rendering/RenderTableRow.h
r83255 r86705 55 55 virtual void layout(); 56 56 virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer); 57 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);57 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 58 58 59 59 // The only time rows get a layer is when they have transparency. -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r86395 r86705 1143 1143 1144 1144 // Hit Testing 1145 bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)1145 bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action) 1146 1146 { 1147 1147 // If we have no children then we have nothing to do. … … 1154 1154 ty += y(); 1155 1155 1156 if (hasOverflowClip() && !overflowClipRect(tx, ty).intersects(result.rectForPoint( xPos, yPos)))1156 if (hasOverflowClip() && !overflowClipRect(tx, ty).intersects(result.rectForPoint(pointInContainer))) 1157 1157 return false; 1158 1158 … … 1165 1165 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer()) { 1166 1166 IntPoint childPoint = flipForWritingMode(toRenderBox(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment); 1167 if (child->nodeAtPoint(request, result, xPos, yPos, childPoint.x(), childPoint.y(), action)) {1168 updateHitTestResult(result, IntPoint(xPos - childPoint.x(), yPos - childPoint.y()));1167 if (child->nodeAtPoint(request, result, pointInContainer, childPoint.x(), childPoint.y(), action)) { 1168 updateHitTestResult(result, toPoint(pointInContainer - childPoint)); 1169 1169 return true; 1170 1170 } … … 1174 1174 } 1175 1175 1176 IntPoint location = IntPoint(xPos - tx, yPos -ty);1176 IntPoint location = pointInContainer - IntSize(tx, ty); 1177 1177 if (style()->isFlippedBlocksWritingMode()) { 1178 1178 if (style()->isHorizontalWritingMode()) … … 1209 1209 RenderTableCell* cell = current.cells[i]; 1210 1210 IntPoint cellPoint = flipForWritingMode(cell, IntPoint(tx, ty), ParentToChildFlippingAdjustment); 1211 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, xPos, yPos, cellPoint.x(), cellPoint.y(), action)) {1212 updateHitTestResult(result, IntPoint(xPos - cellPoint.x(), yPos - cellPoint.y()));1211 if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, pointInContainer, cellPoint.x(), cellPoint.y(), action)) { 1212 updateHitTestResult(result, toPoint(pointInContainer - cellPoint)); 1213 1213 return true; 1214 1214 } -
trunk/Source/WebCore/rendering/RenderTableSection.h
r76276 r86705 139 139 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); 140 140 141 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);141 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 142 142 143 143 bool ensureRows(int); -
trunk/Source/WebCore/rendering/RenderText.h
r83075 r86705 150 150 virtual void paint(PaintInfo&, int, int) { ASSERT_NOT_REACHED(); } 151 151 virtual void layout() { ASSERT_NOT_REACHED(); } 152 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int,int, int, int, HitTestAction) { ASSERT_NOT_REACHED(); return false; }152 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, IntPoint, int, int, HitTestAction) { ASSERT_NOT_REACHED(); return false; } 153 153 154 154 void deleteTextBoxes(); -
trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp
r80412 r86705 58 58 } 59 59 60 bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)60 bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction) 61 61 { 62 if (!RenderTextControl::nodeAtPoint(request, result, x, y, tx, ty, hitTestAction))62 if (!RenderTextControl::nodeAtPoint(request, result, pointInContainer, tx, ty, hitTestAction)) 63 63 return false; 64 64 65 65 if (result.innerNode() == node() || result.innerNode() == innerTextElement()) 66 hitInnerTextElement(result, x, y, tx, ty);66 hitInnerTextElement(result, pointInContainer.x(), pointInContainer.y(), tx, ty); 67 67 68 68 return true; -
trunk/Source/WebCore/rendering/RenderTextControlMultiLine.h
r73572 r86705 39 39 virtual void subtreeHasChanged(); 40 40 41 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);41 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 42 42 43 43 virtual float getAvgCharWidth(AtomicString family); -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r86451 r86705 334 334 } 335 335 336 bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction hitTestAction)336 bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction) 337 337 { 338 338 // If we're within the text control, we want to act as if we've hit the inner text block element, in case the point … … 342 342 // and act as if we've hit the close block if we're to the right of the inner text block. 343 343 344 if (!RenderTextControl::nodeAtPoint(request, result, xPos, yPos, tx, ty, hitTestAction))344 if (!RenderTextControl::nodeAtPoint(request, result, pointInContainer, tx, ty, hitTestAction)) 345 345 return false; 346 346 … … 349 349 // inner text element so that it gains focus. 350 350 if (result.innerNode()->isDescendantOf(innerTextElement()) || result.innerNode() == node()) 351 hitInnerTextElement(result, xPos, yPos, tx, ty);351 hitInnerTextElement(result, pointInContainer.x(), pointInContainer.y(), tx, ty); 352 352 353 353 // If we found a spin button, we're done. … … 372 372 373 373 int textLeft = tx + x() + innerBlockRenderer->x() + innerTextRenderer->x(); 374 if (m_resultsButton && m_resultsButton->renderer() && xPos< textLeft)374 if (m_resultsButton && m_resultsButton->renderer() && pointInContainer.x() < textLeft) 375 375 innerNode = m_resultsButton.get(); 376 376 … … 378 378 if (!innerNode && m_speechButton && m_speechButton->renderer()) { 379 379 int buttonLeft = tx + x() + innerBlockRenderer->x() + innerBlockRenderer->width() - m_speechButton->renderBox()->width(); 380 if ( xPos>= buttonLeft)380 if (pointInContainer.x() >= buttonLeft) 381 381 innerNode = m_speechButton.get(); 382 382 } … … 385 385 if (!innerNode) { 386 386 int textRight = textLeft + innerTextRenderer->width(); 387 if (m_cancelButton && m_cancelButton->renderer() && xPos> textRight)387 if (m_cancelButton && m_cancelButton->renderer() && pointInContainer.x() > textRight) 388 388 innerNode = m_cancelButton.get(); 389 389 } -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h
r85998 r86705 72 72 virtual void layout(); 73 73 74 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);74 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 75 75 76 76 virtual void autoscroll(); -
trunk/Source/WebCore/rendering/RenderWidget.cpp
r86451 r86705 392 392 } 393 393 394 bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)394 bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action) 395 395 { 396 396 bool hadResult = result.innerNode(); 397 bool inside = RenderReplaced::nodeAtPoint(request, result, x, y, tx, ty, action);397 bool inside = RenderReplaced::nodeAtPoint(request, result, pointInContainer, tx, ty, action); 398 398 399 399 // Check to see if we are really over the widget itself (and not just in the border/padding area). -
trunk/Source/WebCore/rendering/RenderWidget.h
r75897 r86705 68 68 virtual void destroy(); 69 69 virtual void setSelectionState(SelectionState); 70 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);70 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 71 71 virtual void setOverlapTestResult(bool); 72 72 -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r86197 r86705 190 190 } 191 191 192 bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, int lineTop, int lineBottom)192 bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom) 193 193 { 194 194 if (hasEllipsisBox() && visibleToHitTesting()) { 195 if (ellipsisBox()->nodeAtPoint(request, result, x, y, tx, ty, lineTop, lineBottom)) {196 renderer()->updateHitTestResult(result, IntPoint(x - tx, y -ty));195 if (ellipsisBox()->nodeAtPoint(request, result, pointInContainer, tx, ty, lineTop, lineBottom)) { 196 renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty)); 197 197 return true; 198 198 } 199 199 } 200 return InlineFlowBox::nodeAtPoint(request, result, x, y, tx, ty, lineTop, lineBottom);200 return InlineFlowBox::nodeAtPoint(request, result, pointInContainer, tx, ty, lineTop, lineBottom); 201 201 } 202 202 -
trunk/Source/WebCore/rendering/RootInlineBox.h
r86197 r86705 97 97 98 98 virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom); 99 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);99 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom); 100 100 101 101 bool hasSelectedChildren() const { return m_hasSelectedChildrenOrCanHaveLeadingExpansion; } -
trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
r84504 r86705 150 150 151 151 IntPoint roundedLocalPoint = roundedIntPoint(localPoint); 152 return RenderBlock::nodeAtPoint(request, result, roundedLocalPoint .x(), roundedLocalPoint.y(), 0, 0, hitTestAction);152 return RenderBlock::nodeAtPoint(request, result, roundedLocalPoint, 0, 0, hitTestAction); 153 153 } 154 154 155 bool RenderSVGForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction)155 bool RenderSVGForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction) 156 156 { 157 157 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.h
r75351 r86705 51 51 52 52 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); 53 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);53 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 54 54 virtual bool isSVGForeignObject() const { return true; } 55 55 -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
r75350 r86705 107 107 } 108 108 109 bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction)109 bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction) 110 110 { 111 111 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.h
r75350 r86705 68 68 private: 69 69 // This method should never be called, SVG uses a different nodeAtPoint method 70 bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int xInContainer, int yInContainer, int dxParentToContainer, int dyParentToContainer, HitTestAction);70 bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int dxParentToContainer, int dyParentToContainer, HitTestAction); 71 71 }; 72 72 -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r86400 r86705 316 316 } 317 317 318 bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction) 319 { 320 IntPoint pointInContainer(x, y); 318 bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction) 319 { 321 320 IntSize containerToParentOffset(tx, ty); 322 321 … … 336 335 updateHitTestResult(result, pointInBorderBox); 337 336 // FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet. 338 result.addNodeToRectBasedTestResult(child->node(), x, y);337 result.addNodeToRectBasedTestResult(child->node(), pointInContainer.x(), pointInContainer.y()); 339 338 return true; 340 339 } -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h
r75350 r86705 74 74 virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; } 75 75 76 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);76 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 77 77 78 78 virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer); -
trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp
r84504 r86705 195 195 return false; 196 196 197 return RenderBlock::nodeAtPoint(request, result, (int)localPoint.x(), (int)localPoint.y(), 0, 0, hitTestAction);197 return RenderBlock::nodeAtPoint(request, result, flooredIntPoint(localPoint), 0, 0, hitTestAction); 198 198 } 199 199 } … … 202 202 } 203 203 204 bool RenderSVGText::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction)204 bool RenderSVGText::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction) 205 205 { 206 206 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/rendering/svg/RenderSVGText.h
r84085 r86705 54 54 55 55 virtual void paint(PaintInfo&, int tx, int ty); 56 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);56 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction); 57 57 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); 58 58 virtual VisiblePosition positionForPoint(const IntPoint&);
Note: See TracChangeset
for help on using the changeset viewer.