+2011-05-17 Emil A Eklund <eae@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Change nodeAtPoint to take IntPoint instead of int x, int y
+ https://bugs.webkit.org/show_bug.cgi?id=60663
+
+ Change nodeAtPoint to take a single const IntPoint& instead of a pair of
+ ints for the location.
+
+ Covered by existing tests.
+
+ * platform/graphics/FloatPoint.h:
+ (WebCore::flooredIntPoint):
+ * rendering/EllipsisBox.cpp:
+ (WebCore::EllipsisBox::nodeAtPoint):
+ * rendering/EllipsisBox.h:
+ * rendering/InlineBox.cpp:
+ (WebCore::InlineBox::nodeAtPoint):
+ * rendering/InlineBox.h:
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::nodeAtPoint):
+ * rendering/InlineFlowBox.h:
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::nodeAtPoint):
+ * rendering/InlineTextBox.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::nodeAtPoint):
+ (WebCore::RenderBlock::hitTestContents):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::nodeAtPoint):
+ * rendering/RenderBox.h:
+ * rendering/RenderFrameSet.cpp:
+ (WebCore::RenderFrameSet::nodeAtPoint):
+ * rendering/RenderFrameSet.h:
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::nodeAtPoint):
+ * rendering/RenderImage.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::nodeAtPoint):
+ * rendering/RenderInline.h:
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::hitTest):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::nodeAtPoint):
+ * rendering/RenderListBox.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::hitTest):
+ (WebCore::RenderObject::nodeAtPoint):
+ * rendering/RenderObject.h:
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::nodeAtPoint):
+ * rendering/RenderTable.h:
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::nodeAtPoint):
+ * rendering/RenderTableRow.h:
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::nodeAtPoint):
+ * rendering/RenderTableSection.h:
+ * rendering/RenderText.h:
+ (WebCore::RenderText::nodeAtPoint):
+ * rendering/RenderTextControlMultiLine.cpp:
+ (WebCore::RenderTextControlMultiLine::nodeAtPoint):
+ * rendering/RenderTextControlMultiLine.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::nodeAtPoint):
+ * rendering/RenderTextControlSingleLine.h:
+ * rendering/RenderWidget.cpp:
+ (WebCore::RenderWidget::nodeAtPoint):
+ * rendering/RenderWidget.h:
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::nodeAtPoint):
+ * rendering/RootInlineBox.h:
+ * rendering/svg/RenderSVGForeignObject.cpp:
+ (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
+ (WebCore::RenderSVGForeignObject::nodeAtPoint):
+ * rendering/svg/RenderSVGForeignObject.h:
+ * rendering/svg/RenderSVGModelObject.cpp:
+ (WebCore::RenderSVGModelObject::nodeAtPoint):
+ * rendering/svg/RenderSVGModelObject.h:
+ * rendering/svg/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::nodeAtPoint):
+ * rendering/svg/RenderSVGRoot.h:
+ * rendering/svg/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::nodeAtFloatPoint):
+ (WebCore::RenderSVGText::nodeAtPoint):
+ * rendering/svg/RenderSVGText.h:
+
2011-05-17 Andrew Wilson <atwilson@chromium.org>
Unreviewed, rolling out r86647.
return IntPoint(static_cast<int>(roundf(p.x())), static_cast<int>(roundf(p.y())));
}
+inline IntPoint flooredIntPoint(const FloatPoint& p)
+{
+ return IntPoint(static_cast<int>(p.x()), static_cast<int>(p.y()));
+}
+
float findSlope(const FloatPoint& p1, const FloatPoint& p2, float& c);
// Find point where lines through the two pairs of points intersect. Returns false if the lines don't intersect.
IntPoint(m_x + tx, m_y + ty + y), h, c, style->colorSpace());
}
-bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, int lineTop, int lineBottom)
+bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom)
{
tx += m_x;
ty += m_y;
RenderStyle* style = m_renderer->style(m_firstLine);
int mtx = tx + m_logicalWidth - m_markupBox->x();
int mty = ty + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->fontMetrics().ascent());
- if (m_markupBox->nodeAtPoint(request, result, x, y, mtx, mty, lineTop, lineBottom)) {
- renderer()->updateHitTestResult(result, IntPoint(x - mtx, y - mty));
+ if (m_markupBox->nodeAtPoint(request, result, pointInContainer, mtx, mty, lineTop, lineBottom)) {
+ renderer()->updateHitTestResult(result, pointInContainer - IntSize(mtx, mty));
return true;
}
}
IntRect boundsRect = IntRect(tx, ty, m_logicalWidth, m_height);
- if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint(x, y))) {
- renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
- if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, boundsRect))
+ if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
+ renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
+ if (!result.addNodeToRectBasedTestResult(renderer()->node(), pointInContainer.x(), pointInContainer.y(), boundsRect))
return true;
}
}
virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
void setSelectionState(RenderObject::SelectionState s) { m_selectionState = s; }
IntRect selectionRect(int tx, int ty);
}
}
-bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, int /* lineTop */, int /*lineBottom*/)
+bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int /* lineTop */, int /*lineBottom*/)
{
// Hit test all phases of replaced elements atomically, as though the replaced element established its
// own stacking context. (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1
// specification.)
- return renderer()->hitTest(request, result, IntPoint(x, y), tx, ty);
+ return renderer()->hitTest(request, result, pointInContainer, tx, ty);
}
const RootInlineBox* InlineBox::root() const
}
virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
InlineBox* next() const { return m_next; }
setVisualOverflow(visualOverflow, lineTop, lineBottom);
}
-bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, int lineTop, int lineBottom)
+bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom)
{
IntRect overflowRect(visualOverflowRect(lineTop, lineBottom));
flipForWritingMode(overflowRect);
overflowRect.move(tx, ty);
- if (!overflowRect.intersects(result.rectForPoint(x, y)))
+ if (!overflowRect.intersects(result.rectForPoint(pointInContainer)))
return false;
// Check children first.
for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) {
- if ((curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) && curr->nodeAtPoint(request, result, x, y, tx, ty, lineTop, lineBottom)) {
- renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
+ if ((curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) && curr->nodeAtPoint(request, result, pointInContainer, tx, ty, lineTop, lineBottom)) {
+ renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
return true;
}
}
flipForWritingMode(rect);
rect.move(tx, ty);
- if (visibleToHitTesting() && rect.intersects(result.rectForPoint(x, y))) {
- 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.
- if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
+ if (visibleToHitTesting() && rect.intersects(result.rectForPoint(pointInContainer))) {
+ 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.
+ if (!result.addNodeToRectBasedTestResult(renderer()->node(), pointInContainer.x(), pointInContainer.y(), rect))
return true;
}
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, const IntRect&);
virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
virtual RenderLineBoxList* rendererLineBoxes() const;
return renderer()->isBR() || (renderer()->style()->preserveNewline() && len() == 1 && (*textRenderer()->text())[start()] == '\n');
}
-bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, int x, int y, int tx, int ty, int /* lineTop */, int /*lineBottom*/)
+bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int /* lineTop */, int /*lineBottom*/)
{
if (isLineBreak())
return false;
FloatPoint boxOrigin = locationIncludingFlipping();
boxOrigin.move(tx, ty);
FloatRect rect(boxOrigin, IntSize(width(), height()));
- if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectForPoint(x, y))) {
- renderer()->updateHitTestResult(result, flipForWritingMode(IntPoint(x - tx, y - ty)));
- if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
+ if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectForPoint(pointInContainer))) {
+ renderer()->updateHitTestResult(result, flipForWritingMode(pointInContainer - IntSize(tx, ty)));
+ if (!result.addNodeToRectBasedTestResult(renderer()->node(), pointInContainer.x(), pointInContainer.y(), rect))
return true;
}
return false;
protected:
virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
public:
RenderText* textRenderer() const;
return layer()->hitTestOverflowControls(result, IntPoint(_x - _tx, _y - _ty));
}
-bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
+bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
{
- int tx = _tx + x();
- int ty = _ty + y();
+ IntSize localOffset(tx + x(), ty + y());
if (!isRenderView()) {
// Check if we need to do anything at all.
IntRect overflowBox = visualOverflowRect();
- overflowBox.move(tx, ty);
- if (!overflowBox.intersects(result.rectForPoint(_x, _y)))
+ overflowBox.move(localOffset);
+ if (!overflowBox.intersects(result.rectForPoint(pointInContainer)))
return false;
}
- if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) && isPointInOverflowControl(result, _x, _y, tx, ty)) {
- updateHitTestResult(result, IntPoint(_x - tx, _y - ty));
+ if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) && isPointInOverflowControl(result, pointInContainer.x(), pointInContainer.y(), localOffset.width(), localOffset.height())) {
+ updateHitTestResult(result, pointInContainer - localOffset);
// FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet.
- if (!result.addNodeToRectBasedTestResult(node(), _x, _y))
+ if (!result.addNodeToRectBasedTestResult(node(), pointInContainer.x(), pointInContainer.y()))
return true;
}
// If we have clipping, then we can't have any spillout.
bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer();
bool useClip = (hasControlClip() || useOverflowClip);
- IntRect hitTestArea(result.rectForPoint(_x, _y));
- bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(tx, ty).intersects(hitTestArea) : overflowClipRect(tx, ty, IncludeOverlayScrollbarSize).intersects(hitTestArea));
+ IntRect hitTestArea(result.rectForPoint(pointInContainer));
+ bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(localOffset.width(), localOffset.height()).intersects(hitTestArea) : overflowClipRect(localOffset.width(), localOffset.height(), IncludeOverlayScrollbarSize).intersects(hitTestArea));
if (checkChildren) {
// Hit test descendants first.
- int scrolledX = tx;
- int scrolledY = ty;
+ IntSize scrolledOffset(localOffset);
if (hasOverflowClip()) {
- IntSize offset = layer()->scrolledContentOffset();
- scrolledX -= offset.width();
- scrolledY -= offset.height();
+ scrolledOffset -= layer()->scrolledContentOffset();
}
// Hit test contents if we don't have columns.
if (!hasColumns()) {
- if (hitTestContents(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {
- updateHitTestResult(result, IntPoint(_x - tx, _y - ty));
+ if (hitTestContents(request, result, pointInContainer.x(), pointInContainer.y(), scrolledOffset.width(), scrolledOffset.height(), hitTestAction)) {
+ updateHitTestResult(result, pointInContainer - localOffset);
return true;
}
- if (hitTestAction == HitTestFloat && hitTestFloats(request, result, _x, _y, scrolledX, scrolledY))
+ if (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer.x(), pointInContainer.y(), scrolledOffset.width(), scrolledOffset.height()))
return true;
- } else if (hitTestColumns(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {
- updateHitTestResult(result, IntPoint(_x - tx, _y - ty));
+ } else if (hitTestColumns(request, result, pointInContainer.x(), pointInContainer.y(), scrolledOffset.width(), scrolledOffset.height(), hitTestAction)) {
+ updateHitTestResult(result, pointInContainer - localOffset);
return true;
}
}
// Now hit test our background
if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) {
- IntRect boundsRect(tx, ty, width(), height());
- if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint(_x, _y))) {
- updateHitTestResult(result, flipForWritingMode(IntPoint(_x - tx, _y - ty)));
- if (!result.addNodeToRectBasedTestResult(node(), _x, _y, boundsRect))
+ IntRect boundsRect(localOffset.width(), localOffset.height(), width(), height());
+ if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
+ updateHitTestResult(result, flipForWritingMode(pointInContainer - localOffset));
+ if (!result.addNodeToRectBasedTestResult(node(), pointInContainer.x(), pointInContainer.y(), boundsRect))
return true;
}
}
childHitTest = HitTestChildBlockBackground;
for (RenderBox* child = lastChildBox(); child; child = child->previousSiblingBox()) {
IntPoint childPoint = flipForWritingMode(child, IntPoint(tx, ty), ParentToChildFlippingAdjustment);
- if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, x, y, childPoint.x(), childPoint.y(), childHitTest))
+ if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, IntPoint(x, y), childPoint.x(), childPoint.y(), childHitTest))
return true;
}
}
virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { }
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual void computePreferredLogicalWidths();
}
// Hit Testing
-bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)
+bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
{
tx += x();
ty += y();
// Check kids first.
for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
- if (!child->hasLayer() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) {
- updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
+ if (!child->hasLayer() && child->nodeAtPoint(request, result, pointInContainer, tx, ty, action)) {
+ updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
return true;
}
}
// Check our bounds next. For this purpose always assume that we can only be hit in the
// foreground phase (which is true for replaced elements like images).
IntRect boundsRect = IntRect(tx, ty, width(), height());
- if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectForPoint(xPos, yPos))) {
- updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
- if (!result.addNodeToRectBasedTestResult(node(), xPos, yPos, boundsRect))
+ if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
+ updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
+ if (!result.addNodeToRectBasedTestResult(node(), pointInContainer.x(), pointInContainer.y(), boundsRect))
return true;
}
virtual void layout();
virtual void paint(PaintInfo&, int tx, int ty);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual void destroy();
}
bool RenderFrameSet::nodeAtPoint(const HitTestRequest& request, HitTestResult& result,
- int x, int y, int tx, int ty, HitTestAction action)
+ const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
{
if (action != HitTestForeground)
return false;
- bool inside = RenderBox::nodeAtPoint(request, result, x, y, tx, ty, action)
+ bool inside = RenderBox::nodeAtPoint(request, result, pointInContainer, tx, ty, action)
|| m_isResizing;
if (inside && frameSet()->noResize()
virtual bool isFrameSet() const { return true; }
virtual void layout();
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual void paint(PaintInfo&, int tx, int ty);
virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
return i ? i->treeScope()->getImageMap(i->fastGetAttribute(usemapAttr)) : 0;
}
-bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
{
HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding());
- bool inside = RenderReplaced::nodeAtPoint(request, tempResult, x, y, tx, ty, hitTestAction);
+ bool inside = RenderReplaced::nodeAtPoint(request, tempResult, pointInContainer, tx, ty, hitTestAction);
if (tempResult.innerNode() && node()) {
if (HTMLMapElement* map = imageMap()) {
IntRect contentBox = contentBoxRect();
float zoom = style()->effectiveZoom();
- int mapX = lroundf((x - tx - this->x() - contentBox.x()) / zoom);
- int mapY = lroundf((y - ty - this->y() - contentBox.y()) / zoom);
+ int mapX = lroundf((pointInContainer.x() - tx - this->x() - contentBox.x()) / zoom);
+ int mapY = lroundf((pointInContainer.y() - ty - this->y() - contentBox.y()) / zoom);
if (map->mapMouseEvent(mapX, mapY, contentBox.size(), tempResult))
tempResult.setInnerNonSharedNode(node());
}
virtual int minimumReplacedHeight() const;
virtual void notifyFinished(CachedResource*);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual int computeReplacedLogicalWidth(bool includeMaxWidth = true) const;
virtual int computeReplacedLogicalHeight() const;
}
bool RenderInline::nodeAtPoint(const HitTestRequest& request, HitTestResult& result,
- int x, int y, int tx, int ty, HitTestAction hitTestAction)
+ const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
{
- return m_lineBoxes.hitTest(this, request, result, x, y, tx, ty, hitTestAction);
+ return m_lineBoxes.hitTest(this, request, result, pointInContainer.x(), pointInContainer.y(), tx, ty, hitTestAction);
}
VisiblePosition RenderInline::positionForPoint(const IntPoint& point)
virtual void paint(PaintInfo&, int tx, int ty);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual bool requiresLayer() const { return isRelPositioned() || isTransparent() || hasMask(); }
for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevLineBox()) {
RootInlineBox* root = curr->root();
if (rangeIntersectsRect(renderer, curr->logicalTopVisualOverflow(root->lineTop()), curr->logicalBottomVisualOverflow(root->lineBottom()), rect, tx, ty)) {
- bool inside = curr->nodeAtPoint(request, result, x, y, tx, ty, root->lineTop(), root->lineBottom());
+ bool inside = curr->nodeAtPoint(request, result, IntPoint(x, y), tx, ty, root->lineTop(), root->lineBottom());
if (inside) {
renderer->updateHitTestResult(result, IntPoint(x - tx, y - ty));
return true;
ScrollableArea::scrollToYOffsetWithoutAnimation(index);
}
-bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
{
- if (!RenderBlock::nodeAtPoint(request, result, x, y, tx, ty, hitTestAction))
+ if (!RenderBlock::nodeAtPoint(request, result, pointInContainer, tx, ty, hitTestAction))
return false;
const Vector<Element*>& listItems = toSelectElement(static_cast<Element*>(node()))->listItems();
int size = numItems();
tx += this->x();
ty += this->y();
for (int i = 0; i < size; ++i) {
- if (itemBoundingBoxRect(tx, ty, i).contains(x, y)) {
+ if (itemBoundingBoxRect(tx, ty, i).contains(pointInContainer)) {
if (Element* node = listItems[i]) {
result.setInnerNode(node);
if (!result.innerNonSharedNode())
result.setInnerNonSharedNode(node);
- result.setLocalPoint(IntPoint(x - tx, y - ty));
+ result.setLocalPoint(pointInContainer - IntSize(tx, ty));
break;
}
}
virtual void setScrollLeft(int);
virtual void setScrollTop(int);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
// ScrollableArea interface.
virtual int scrollSize(ScrollbarOrientation orientation) const;
curr->updateDragState(dragOn);
}
-bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const IntPoint& point, int tx, int ty, HitTestFilter hitTestFilter)
+bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestFilter hitTestFilter)
{
bool inside = false;
if (hitTestFilter != HitTestSelf) {
// First test the foreground layer (lines and inlines).
- inside = nodeAtPoint(request, result, point.x(), point.y(), tx, ty, HitTestForeground);
+ inside = nodeAtPoint(request, result, pointInContainer, tx, ty, HitTestForeground);
// Test floats next.
if (!inside)
- inside = nodeAtPoint(request, result, point.x(), point.y(), tx, ty, HitTestFloat);
+ inside = nodeAtPoint(request, result, pointInContainer, tx, ty, HitTestFloat);
// Finally test to see if the mouse is in the background (within a child block's background).
if (!inside)
- inside = nodeAtPoint(request, result, point.x(), point.y(), tx, ty, HitTestChildBlockBackgrounds);
+ inside = nodeAtPoint(request, result, pointInContainer, tx, ty, HitTestChildBlockBackgrounds);
}
// See if the mouse is inside us but not any of our descendants
if (hitTestFilter != HitTestDescendants && !inside)
- inside = nodeAtPoint(request, result, point.x(), point.y(), tx, ty, HitTestBlockBackground);
+ inside = nodeAtPoint(request, result, pointInContainer, tx, ty, HitTestBlockBackground);
return inside;
}
}
}
-bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int /*x*/, int /*y*/, int /*tx*/, int /*ty*/, HitTestAction)
+bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& /*pointInContainer*/, int /*tx*/, int /*ty*/, HitTestAction)
{
return false;
}
#endif
bool hitTest(const HitTestRequest&, HitTestResult&, const IntPoint&, int tx, int ty, HitTestFilter = HitTestAll);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual void updateHitTestResult(HitTestResult&, const IntPoint&);
VisiblePosition positionForCoordinates(int x, int y);
return rect;
}
-bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)
+bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
{
tx += x();
ty += y();
// Check kids first.
- if (!hasOverflowClip() || overflowClipRect(tx, ty).intersects(result.rectForPoint(xPos, yPos))) {
+ if (!hasOverflowClip() || overflowClipRect(tx, ty).intersects(result.rectForPoint(pointInContainer))) {
for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) {
IntPoint childPoint = flipForWritingMode(toRenderBox(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment);
- if (child->nodeAtPoint(request, result, xPos, yPos, childPoint.x(), childPoint.y(), action)) {
- updateHitTestResult(result, IntPoint(xPos - childPoint.x(), yPos - childPoint.y()));
+ if (child->nodeAtPoint(request, result, pointInContainer, childPoint.x(), childPoint.y(), action)) {
+ updateHitTestResult(result, toPoint(pointInContainer - childPoint));
return true;
}
}
// Check our bounds next.
IntRect boundsRect = IntRect(tx, ty, width(), height());
- if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint(xPos, yPos))) {
- updateHitTestResult(result, flipForWritingMode(IntPoint(xPos - tx, yPos - ty)));
- if (!result.addNodeToRectBasedTestResult(node(), xPos, yPos, boundsRect))
+ if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
+ updateHitTestResult(result, flipForWritingMode(pointInContainer - IntSize(tx, ty)));
+ if (!result.addNodeToRectBasedTestResult(node(), pointInContainer.x(), pointInContainer.y(), boundsRect))
return true;
}
virtual void paintMask(PaintInfo&, IntSize);
virtual void layout();
virtual void computePreferredLogicalWidths();
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int xPos, int yPos, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual int firstLineBoxBaseline() const;
}
// Hit Testing
-bool RenderTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
+bool RenderTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
{
// Table rows cannot ever be hit tested. Effectively they do not exist.
// Just forward to our children always.
// then we can remove this check.
if (child->isTableCell() && !toRenderBox(child)->hasSelfPaintingLayer()) {
IntPoint cellPoint = flipForWritingMode(toRenderTableCell(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment);
- if (child->nodeAtPoint(request, result, x, y, cellPoint.x(), cellPoint.y(), action)) {
- updateHitTestResult(result, IntPoint(x - cellPoint.x(), y - cellPoint.y()));
+ if (child->nodeAtPoint(request, result, pointInContainer, cellPoint.x(), cellPoint.y(), action)) {
+ updateHitTestResult(result, pointInContainer - IntSize(cellPoint.x(), cellPoint.y()));
return true;
}
}
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
virtual void layout();
virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
// The only time rows get a layer is when they have transparency.
virtual bool requiresLayer() const { return isTransparent() || hasOverflowClip() || hasTransform() || hasMask(); }
}
// Hit Testing
-bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)
+bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
{
// If we have no children then we have nothing to do.
if (!firstChild())
tx += x();
ty += y();
- if (hasOverflowClip() && !overflowClipRect(tx, ty).intersects(result.rectForPoint(xPos, yPos)))
+ if (hasOverflowClip() && !overflowClipRect(tx, ty).intersects(result.rectForPoint(pointInContainer)))
return false;
if (m_hasOverflowingCell) {
// then we can remove this check.
if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer()) {
IntPoint childPoint = flipForWritingMode(toRenderBox(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment);
- if (child->nodeAtPoint(request, result, xPos, yPos, childPoint.x(), childPoint.y(), action)) {
- updateHitTestResult(result, IntPoint(xPos - childPoint.x(), yPos - childPoint.y()));
+ if (child->nodeAtPoint(request, result, pointInContainer, childPoint.x(), childPoint.y(), action)) {
+ updateHitTestResult(result, toPoint(pointInContainer - childPoint));
return true;
}
}
return false;
}
- IntPoint location = IntPoint(xPos - tx, yPos - ty);
+ IntPoint location = pointInContainer - IntSize(tx, ty);
if (style()->isFlippedBlocksWritingMode()) {
if (style()->isHorizontalWritingMode())
location.setY(height() - location.y());
for (int i = current.cells.size() - 1; i >= 0; --i) {
RenderTableCell* cell = current.cells[i];
IntPoint cellPoint = flipForWritingMode(cell, IntPoint(tx, ty), ParentToChildFlippingAdjustment);
- if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, xPos, yPos, cellPoint.x(), cellPoint.y(), action)) {
- updateHitTestResult(result, IntPoint(xPos - cellPoint.x(), yPos - cellPoint.y()));
+ if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, pointInContainer, cellPoint.x(), cellPoint.y(), action)) {
+ updateHitTestResult(result, toPoint(pointInContainer - cellPoint));
return true;
}
}
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
bool ensureRows(int);
void clearGrid();
virtual void paint(PaintInfo&, int, int) { ASSERT_NOT_REACHED(); }
virtual void layout() { ASSERT_NOT_REACHED(); }
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction) { ASSERT_NOT_REACHED(); return false; }
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, IntPoint, int, int, HitTestAction) { ASSERT_NOT_REACHED(); return false; }
void deleteTextBoxes();
bool containsOnlyWhitespace(unsigned from, unsigned len) const;
frame->editor()->textDidChangeInTextArea(textArea);
}
-bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
{
- if (!RenderTextControl::nodeAtPoint(request, result, x, y, tx, ty, hitTestAction))
+ if (!RenderTextControl::nodeAtPoint(request, result, pointInContainer, tx, ty, hitTestAction))
return false;
if (result.innerNode() == node() || result.innerNode() == innerTextElement())
- hitInnerTextElement(result, x, y, tx, ty);
+ hitInnerTextElement(result, pointInContainer.x(), pointInContainer.y(), tx, ty);
return true;
}
virtual void subtreeHasChanged();
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual float getAvgCharWidth(AtomicString family);
virtual int preferredContentWidth(float charWidth) const;
}
}
-bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction hitTestAction)
+bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
{
// 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
// was on the control but not on the inner element (see Radar 4617841).
// In a search field, we want to act as if we've hit the results block if we're to the left of the inner text block,
// and act as if we've hit the close block if we're to the right of the inner text block.
- if (!RenderTextControl::nodeAtPoint(request, result, xPos, yPos, tx, ty, hitTestAction))
+ if (!RenderTextControl::nodeAtPoint(request, result, pointInContainer, tx, ty, hitTestAction))
return false;
// If we hit a node inside the inner text element, say that we hit that element,
// and if we hit our node (e.g. we're over the border or padding), also say that we hit the
// inner text element so that it gains focus.
if (result.innerNode()->isDescendantOf(innerTextElement()) || result.innerNode() == node())
- hitInnerTextElement(result, xPos, yPos, tx, ty);
+ hitInnerTextElement(result, pointInContainer.x(), pointInContainer.y(), tx, ty);
// If we found a spin button, we're done.
if (m_innerSpinButton && result.innerNode() == m_innerSpinButton)
localPoint.move(-innerBlockRenderer->x(), -innerBlockRenderer->y());
int textLeft = tx + x() + innerBlockRenderer->x() + innerTextRenderer->x();
- if (m_resultsButton && m_resultsButton->renderer() && xPos < textLeft)
+ if (m_resultsButton && m_resultsButton->renderer() && pointInContainer.x() < textLeft)
innerNode = m_resultsButton.get();
#if ENABLE(INPUT_SPEECH)
if (!innerNode && m_speechButton && m_speechButton->renderer()) {
int buttonLeft = tx + x() + innerBlockRenderer->x() + innerBlockRenderer->width() - m_speechButton->renderBox()->width();
- if (xPos >= buttonLeft)
+ if (pointInContainer.x() >= buttonLeft)
innerNode = m_speechButton.get();
}
#endif
if (!innerNode) {
int textRight = textLeft + innerTextRenderer->width();
- if (m_cancelButton && m_cancelButton->renderer() && xPos > textRight)
+ if (m_cancelButton && m_cancelButton->renderer() && pointInContainer.x() > textRight)
innerNode = m_cancelButton.get();
}
virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
virtual void layout();
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual void autoscroll();
return widgetRendererMap().get(widget);
}
-bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action)
+bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
{
bool hadResult = result.innerNode();
- bool inside = RenderReplaced::nodeAtPoint(request, result, x, y, tx, ty, action);
+ bool inside = RenderReplaced::nodeAtPoint(request, result, pointInContainer, tx, ty, action);
// Check to see if we are really over the widget itself (and not just in the border/padding area).
if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode() == node())
virtual void destroy();
virtual void setSelectionState(SelectionState);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual void setOverlapTestResult(bool);
bool setWidgetGeometry(const IntRect&, const IntSize&);
#endif
}
-bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, int lineTop, int lineBottom)
+bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom)
{
if (hasEllipsisBox() && visibleToHitTesting()) {
- if (ellipsisBox()->nodeAtPoint(request, result, x, y, tx, ty, lineTop, lineBottom)) {
- renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
+ if (ellipsisBox()->nodeAtPoint(request, result, pointInContainer, tx, ty, lineTop, lineBottom)) {
+ renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
return true;
}
}
- return InlineFlowBox::nodeAtPoint(request, result, x, y, tx, ty, lineTop, lineBottom);
+ return InlineFlowBox::nodeAtPoint(request, result, pointInContainer, tx, ty, lineTop, lineBottom);
}
void RootInlineBox::adjustPosition(float dx, float dy)
#endif
virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
bool hasSelectedChildren() const { return m_hasSelectedChildrenOrCanHaveLeadingExpansion; }
void setHasSelectedChildren(bool hasSelectedChildren) { m_hasSelectedChildrenOrCanHaveLeadingExpansion = hasSelectedChildren; }
return false;
IntPoint roundedLocalPoint = roundedIntPoint(localPoint);
- return RenderBlock::nodeAtPoint(request, result, roundedLocalPoint.x(), roundedLocalPoint.y(), 0, 0, hitTestAction);
+ return RenderBlock::nodeAtPoint(request, result, roundedLocalPoint, 0, 0, hitTestAction);
}
-bool RenderSVGForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction)
+bool RenderSVGForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction)
{
ASSERT_NOT_REACHED();
return false;
virtual FloatRect repaintRectInLocalCoordinates() const { return m_viewport; }
virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual bool isSVGForeignObject() const { return true; }
virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState&) const;
SVGResourcesCache::clientUpdatedFromElement(this, style());
}
-bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction)
+bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction)
{
ASSERT_NOT_REACHED();
return false;
private:
// This method should never be called, SVG uses a different nodeAtPoint method
- bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int xInContainer, int yInContainer, int dxParentToContainer, int dyParentToContainer, HitTestAction);
+ bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int dxParentToContainer, int dyParentToContainer, HitTestAction);
};
}
m_repaintBoundingBox.inflate(borderAndPaddingWidth());
}
-bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
+bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
{
- IntPoint pointInContainer(x, y);
IntSize containerToParentOffset(tx, ty);
IntPoint pointInParent = pointInContainer - containerToParentOffset;
// FIXME: CSS/HTML assumes the local point is relative to the border box, right?
updateHitTestResult(result, pointInBorderBox);
// FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet.
- result.addNodeToRectBasedTestResult(child->node(), x, y);
+ result.addNodeToRectBasedTestResult(child->node(), pointInContainer.x(), pointInContainer.y());
return true;
}
}
virtual FloatRect strokeBoundingBox() const { return m_strokeBoundingBox; }
virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; }
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed);
if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
return false;
- return RenderBlock::nodeAtPoint(request, result, (int)localPoint.x(), (int)localPoint.y(), 0, 0, hitTestAction);
+ return RenderBlock::nodeAtPoint(request, result, flooredIntPoint(localPoint), 0, 0, hitTestAction);
}
}
return false;
}
-bool RenderSVGText::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction)
+bool RenderSVGText::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction)
{
ASSERT_NOT_REACHED();
return false;
virtual bool isSVGText() const { return true; }
virtual void paint(PaintInfo&, int tx, int ty);
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
virtual VisiblePosition positionForPoint(const IntPoint&);