2011-06-07 Emil A Eklund <eae@chromium.org>
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jun 2011 03:12:08 +0000 (03:12 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jun 2011 03:12:08 +0000 (03:12 +0000)
        Reviewed by Eric Seidel.

        Convert nodeAtPoint to IntPoint
        https://bugs.webkit.org/show_bug.cgi?id=62145

        Convert nodeAtPoint to take an IntPoint instead of a pair of ints for the
        accumulated offset.

        Covered by existing tests.

        * platform/graphics/FloatPoint.h:
        (WebCore::FloatPoint::moveBy):
        Add moveBy(IntPoint) method

        * 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):
        * 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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88319 268f45cc-cd09-0410-ab3c-d52691b4dbfc

47 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/EllipsisBox.cpp
Source/WebCore/rendering/EllipsisBox.h
Source/WebCore/rendering/InlineBox.cpp
Source/WebCore/rendering/InlineBox.h
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineFlowBox.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/InlineTextBox.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderFrameSet.h
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderLineBoxList.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListBox.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableRow.h
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderTableSection.h
Source/WebCore/rendering/RenderText.h
Source/WebCore/rendering/RenderTextControlMultiLine.cpp
Source/WebCore/rendering/RenderTextControlMultiLine.h
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.h
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/RenderWidget.h
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/RootInlineBox.h
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.h
Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
Source/WebCore/rendering/svg/RenderSVGModelObject.h
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.h
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/RenderSVGText.h

index 39aa9cd..08ff664 100644 (file)
@@ -1,3 +1,93 @@
+2011-06-07  Emil A Eklund  <eae@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Convert nodeAtPoint to IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=62145
+
+        Convert nodeAtPoint to take an IntPoint instead of a pair of ints for the
+        accumulated offset.
+
+        Covered by existing tests.
+
+        * platform/graphics/FloatPoint.h:
+        (WebCore::FloatPoint::moveBy):
+        Add moveBy(IntPoint) method
+        
+        * 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):
+        * 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-06-07  Yi Shen  <yi.4.shen@nokia.com>
 
         Reviewed by Simon Hausmann.
index cbbf2bb..e002e0e 100644 (file)
@@ -101,25 +101,24 @@ void EllipsisBox::paintSelection(GraphicsContext* context, const IntPoint& paint
     context->drawHighlightForText(font, RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + paintOffset.x(), y() + paintOffset.y() + top), h, c, style->colorSpace());
 }
 
-bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom)
+bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int lineTop, int lineBottom)
 {
-    tx += x();
-    ty += y();
+    IntPoint adjustedLocation = accumulatedOffset + roundedIntPoint(topLeft());
 
     // Hit test the markup box.
     if (m_markupBox) {
         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, pointInContainer, mtx, mty, lineTop, lineBottom)) {
+        int mtx = adjustedLocation.x() + m_logicalWidth - m_markupBox->x();
+        int mty = adjustedLocation.y() + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->fontMetrics().ascent());
+        if (m_markupBox->nodeAtPoint(request, result, pointInContainer, IntPoint(mtx, mty), lineTop, lineBottom)) {
             renderer()->updateHitTestResult(result, pointInContainer - IntSize(mtx, mty));
             return true;
         }
     }
 
-    IntRect boundsRect = IntRect(tx, ty, m_logicalWidth, m_height);
+    IntRect boundsRect = IntRect(adjustedLocation, IntSize(m_logicalWidth, m_height));
     if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
-        renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
+        renderer()->updateHitTestResult(result, pointInContainer - toSize(adjustedLocation));
         if (!result.addNodeToRectBasedTestResult(renderer()->node(), pointInContainer, boundsRect))
             return true;
     }
index bc3baff..50595b2 100644 (file)
@@ -40,7 +40,7 @@ public:
     }
 
     virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int lineTop, int lineBottom);
     void setSelectionState(RenderObject::SelectionState s) { m_selectionState = s; }
     IntRect selectionRect();
 
index c71c7e5..b495148 100644 (file)
@@ -220,12 +220,12 @@ void InlineBox::paint(PaintInfo& paintInfo, const IntPoint& paintOffset, int /*
     }
 }
 
-bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int /* lineTop */, int /*lineBottom*/)
+bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, 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, pointInContainer, IntPoint(tx, ty));
+    return renderer()->hitTest(request, result, pointInContainer, accumulatedOffset);
 }
 
 const RootInlineBox* InlineBox::root() const
index f1a85b6..8948cdf 100644 (file)
@@ -127,7 +127,7 @@ public:
     }
 
     virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int lineTop, int lineBottom);
 
     InlineBox* next() const { return m_next; }
 
index a66564d..8a77de4 100644 (file)
@@ -898,18 +898,18 @@ void InlineFlowBox::setOverflowFromLogicalRects(const IntRect& logicalLayoutOver
     setVisualOverflow(visualOverflow, lineTop, lineBottom);
 }
 
-bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom)
+bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int lineTop, int lineBottom)
 {
     IntRect overflowRect(visualOverflowRect(lineTop, lineBottom));
     flipForWritingMode(overflowRect);
-    overflowRect.move(tx, ty);
+    overflowRect.moveBy(accumulatedOffset);
     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, pointInContainer, tx, ty, lineTop, lineBottom)) {
-            renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
+        if ((curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer()) && curr->nodeAtPoint(request, result, pointInContainer, accumulatedOffset, lineTop, lineBottom)) {
+            renderer()->updateHitTestResult(result, pointInContainer - toSize(accumulatedOffset));
             return true;
         }
     }
@@ -935,10 +935,10 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
     // Move x/y to our coordinates.
     IntRect rect(minX, minY, width, height);
     flipForWritingMode(rect);
-    rect.move(tx, ty);
+    rect.moveBy(accumulatedOffset);
 
     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.
+        renderer()->updateHitTestResult(result, flipForWritingMode(pointInContainer - toSize(accumulatedOffset))); // 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, rect))
             return true;
     }
index a2983d0..70fc476 100644 (file)
@@ -109,7 +109,7 @@ public:
     void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
     void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, const IntRect&);
     virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int lineTop, int lineBottom);
 
     virtual RenderLineBoxList* rendererLineBoxes() const;
 
index 141c9cc..a823fee 100644 (file)
@@ -345,16 +345,16 @@ bool InlineTextBox::isLineBreak() const
     return renderer()->isBR() || (renderer()->style()->preserveNewline() && len() == 1 && (*textRenderer()->text())[start()] == '\n');
 }
 
-bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int /* lineTop */, int /*lineBottom*/)
+bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int /* lineTop */, int /*lineBottom*/)
 {
     if (isLineBreak())
         return false;
 
     FloatPoint boxOrigin = locationIncludingFlipping();
-    boxOrigin.move(tx, ty);
+    boxOrigin.moveBy(accumulatedOffset);
     FloatRect rect(boxOrigin, IntSize(width(), height()));
     if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectForPoint(pointInContainer))) {
-        renderer()->updateHitTestResult(result, flipForWritingMode(pointInContainer - IntSize(tx, ty)));
+        renderer()->updateHitTestResult(result, flipForWritingMode(pointInContainer - toSize(accumulatedOffset)));
         if (!result.addNodeToRectBasedTestResult(renderer()->node(), pointInContainer, rect))
             return true;
     }
index 294765e..4b02111 100644 (file)
@@ -111,7 +111,7 @@ public:
 
 protected:
     virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int lineTop, int lineBottom);
 
 public:
     RenderText* textRenderer() const;
index f2a26ab..4e0e67a 100644 (file)
@@ -3895,14 +3895,15 @@ bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const IntPoint
     return layer()->hitTestOverflowControls(result, pointInContainer - IntSize(tx, ty));
 }
 
-bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
 {
-    IntSize localOffset(tx + x(), ty + y());
+    IntPoint adjustedLocation(accumulatedOffset + location());
+    IntSize localOffset = toSize(adjustedLocation);
 
     if (!isRenderView()) {
         // Check if we need to do anything at all.
         IntRect overflowBox = visualOverflowRect();
-        overflowBox.move(localOffset);
+        overflowBox.moveBy(adjustedLocation);
         if (!overflowBox.intersects(result.rectForPoint(pointInContainer)))
             return false;
     }
@@ -3918,7 +3919,7 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
     bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer();
     bool useClip = (hasControlClip() || useOverflowClip);
     IntRect hitTestArea(result.rectForPoint(pointInContainer));
-    bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(toPoint(localOffset)).intersects(hitTestArea) : overflowClipRect(toPoint(localOffset), IncludeOverlayScrollbarSize).intersects(hitTestArea));
+    bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(adjustedLocation).intersects(hitTestArea) : overflowClipRect(adjustedLocation, IncludeOverlayScrollbarSize).intersects(hitTestArea));
     if (checkChildren) {
         // Hit test descendants first.
         IntSize scrolledOffset(localOffset);
@@ -3942,7 +3943,7 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
 
     // Now hit test our background
     if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) {
-        IntRect boundsRect(localOffset.width(), localOffset.height(), width(), height());
+        IntRect boundsRect(adjustedLocation, size());
         if (visibleToHitTesting() && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
             updateHitTestResult(result, flipForWritingMode(pointInContainer - localOffset));
             if (!result.addNodeToRectBasedTestResult(node(), pointInContainer, boundsRect))
@@ -4041,7 +4042,7 @@ bool RenderBlock::hitTestContents(const HitTestRequest& request, HitTestResult&
             childHitTest = HitTestChildBlockBackground;
         for (RenderBox* child = lastChildBox(); child; child = child->previousSiblingBox()) {
             IntPoint childPoint = flipForWritingMode(child, accumulatedOffset, ParentToChildFlippingAdjustment);
-            if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, pointInContainer, childPoint.x(), childPoint.y(), childHitTest))
+            if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, pointInContainer, childPoint, childHitTest))
                 return true;
         }
     }
index e9e9023..860f7eb 100644 (file)
@@ -301,7 +301,7 @@ protected:
     virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
     virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { }
 
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     virtual void computePreferredLogicalWidths();
 
index e948bbc..12e9583 100644 (file)
@@ -740,24 +740,23 @@ int RenderBox::computeContentBoxLogicalHeight(int height) const
 }
 
 // Hit Testing
-bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
+bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction action)
 {
-    tx += x();
-    ty += y();
+    IntPoint adjustedLocation = accumulatedOffset + location();
 
     // Check kids first.
     for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
-        if (!child->hasLayer() && child->nodeAtPoint(request, result, pointInContainer, tx, ty, action)) {
-            updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
+        if (!child->hasLayer() && child->nodeAtPoint(request, result, pointInContainer, adjustedLocation, action)) {
+            updateHitTestResult(result, pointInContainer - toSize(adjustedLocation));
             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());
+    IntRect boundsRect = IntRect(adjustedLocation, size());
     if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
-        updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
+        updateHitTestResult(result, pointInContainer - toSize(adjustedLocation));
         if (!result.addNodeToRectBasedTestResult(node(), pointInContainer, boundsRect))
             return true;
     }
index 64d1ead..7308bcf 100644 (file)
@@ -240,7 +240,7 @@ public:
 
     virtual void layout();
     virtual void paint(PaintInfo&, const IntPoint&);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     virtual void destroy();
 
index fd77da2..1f96d01 100644 (file)
@@ -156,12 +156,12 @@ void RenderFrameSet::paint(PaintInfo& paintInfo, const IntPoint& paintOffset)
 }
 
 bool RenderFrameSet::nodeAtPoint(const HitTestRequest& request, HitTestResult& result,
-    const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
+    const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction action)
 {
     if (action != HitTestForeground)
         return false;
 
-    bool inside = RenderBox::nodeAtPoint(request, result, pointInContainer, tx, ty, action)
+    bool inside = RenderBox::nodeAtPoint(request, result, pointInContainer, accumulatedOffset, action)
         || m_isResizing;
 
     if (inside && frameSet()->noResize()
index cef95e6..45267ca 100644 (file)
@@ -96,7 +96,7 @@ private:
     virtual bool isFrameSet() const { return true; }
 
     virtual void layout();
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
     virtual void paint(PaintInfo&, const IntPoint&);
     virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
 
index bb45537..dba5060 100644 (file)
@@ -394,17 +394,17 @@ HTMLMapElement* RenderImage::imageMap() const
     return i ? i->treeScope()->getImageMap(i->fastGetAttribute(usemapAttr)) : 0;
 }
 
-bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+bool RenderImage::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
 {
     HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding());
-    bool inside = RenderReplaced::nodeAtPoint(request, tempResult, pointInContainer, tx, ty, hitTestAction);
+    bool inside = RenderReplaced::nodeAtPoint(request, tempResult, pointInContainer, accumulatedOffset, hitTestAction);
 
     if (tempResult.innerNode() && node()) {
         if (HTMLMapElement* map = imageMap()) {
             IntRect contentBox = contentBoxRect();
             float zoom = style()->effectiveZoom();
-            int mapX = lroundf((pointInContainer.x() - tx - this->x() - contentBox.x()) / zoom);
-            int mapY = lroundf((pointInContainer.y() - ty - this->y() - contentBox.y()) / zoom);
+            int mapX = lroundf((pointInContainer.x() - accumulatedOffset.x() - this->x() - contentBox.x()) / zoom);
+            int mapY = lroundf((pointInContainer.y() - accumulatedOffset.y() - this->y() - contentBox.y()) / zoom);
             if (map->mapMouseEvent(mapX, mapY, contentBox.size(), tempResult))
                 tempResult.setInnerNonSharedNode(node());
         }
index c2f7480..13995ff 100644 (file)
@@ -81,7 +81,7 @@ private:
     virtual int minimumReplacedHeight() const;
 
     virtual void notifyFinished(CachedResource*);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     virtual int computeReplacedLogicalWidth(bool includeMaxWidth = true) const;
     virtual int computeReplacedLogicalHeight() const;
index 4bdb1ca..7679269 100644 (file)
@@ -710,9 +710,9 @@ const char* RenderInline::renderName() const
 }
 
 bool RenderInline::nodeAtPoint(const HitTestRequest& request, HitTestResult& result,
-                                const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+                                const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
 {
-    return m_lineBoxes.hitTest(this, request, result, pointInContainer, IntPoint(tx, ty), hitTestAction);
+    return m_lineBoxes.hitTest(this, request, result, pointInContainer, accumulatedOffset, hitTestAction);
 }
 
 VisiblePosition RenderInline::positionForPoint(const IntPoint& point)
index b117eff..da61710 100644 (file)
@@ -117,7 +117,7 @@ private:
 
     virtual void paint(PaintInfo&, const IntPoint&);
 
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     virtual bool requiresLayer() const { return isRelPositioned() || isTransparent() || hasMask(); }
 
index 37f4ff6..e63d7d3 100644 (file)
@@ -298,7 +298,7 @@ bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq
     for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevLineBox()) {
         RootInlineBox* root = curr->root();
         if (rangeIntersectsRect(renderer, curr->logicalTopVisualOverflow(root->lineTop()), curr->logicalBottomVisualOverflow(root->lineBottom()), rect, accumulatedOffset)) {
-            bool inside = curr->nodeAtPoint(request, result, pointInContainer, accumulatedOffset.x(), accumulatedOffset.y(), root->lineTop(), root->lineBottom());
+            bool inside = curr->nodeAtPoint(request, result, pointInContainer, accumulatedOffset, root->lineTop(), root->lineBottom());
             if (inside) {
                 renderer->updateHitTestResult(result, toPoint(pointInContainer - accumulatedOffset));
                 return true;
index d3c6721..29e1f6a 100644 (file)
@@ -669,21 +669,21 @@ void RenderListBox::setScrollTop(int newTop)
     ScrollableArea::scrollToYOffsetWithoutAnimation(index);
 }
 
-bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
 {
-    if (!RenderBlock::nodeAtPoint(request, result, pointInContainer, tx, ty, hitTestAction))
+    if (!RenderBlock::nodeAtPoint(request, result, pointInContainer, accumulatedOffset, hitTestAction))
         return false;
     const Vector<Element*>& listItems = toSelectElement(static_cast<Element*>(node()))->listItems();
     int size = numItems();
-    tx += this->x();
-    ty += this->y();
+    IntPoint adjustedLocation = accumulatedOffset + location();
+
     for (int i = 0; i < size; ++i) {
-        if (itemBoundingBoxRect(IntPoint(tx, ty), i).contains(pointInContainer)) {
+        if (itemBoundingBoxRect(adjustedLocation, i).contains(pointInContainer)) {
             if (Element* node = listItems[i]) {
                 result.setInnerNode(node);
                 if (!result.innerNonSharedNode())
                     result.setInnerNonSharedNode(node);
-                result.setLocalPoint(pointInContainer - IntSize(tx, ty));
+                result.setLocalPoint(pointInContainer - toSize(adjustedLocation));
                 break;
             }
         }
index 14e0b02..2306ef9 100644 (file)
@@ -96,7 +96,7 @@ private:
     virtual void setScrollLeft(int);
     virtual void setScrollTop(int);
 
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     // ScrollableArea interface.
     virtual int scrollSize(ScrollbarOrientation orientation) const;
index 5caf65e..c0378c8 100644 (file)
@@ -2147,20 +2147,20 @@ bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result,
     bool inside = false;
     if (hitTestFilter != HitTestSelf) {
         // First test the foreground layer (lines and inlines).
-        inside = nodeAtPoint(request, result, pointInContainer, accumulatedOffset.x(), accumulatedOffset.y(), HitTestForeground);
+        inside = nodeAtPoint(request, result, pointInContainer, accumulatedOffset, HitTestForeground);
 
         // Test floats next.
         if (!inside)
-            inside = nodeAtPoint(request, result, pointInContainer, accumulatedOffset.x(), accumulatedOffset.y(), HitTestFloat);
+            inside = nodeAtPoint(request, result, pointInContainer, accumulatedOffset, HitTestFloat);
 
         // Finally test to see if the mouse is in the background (within a child block's background).
         if (!inside)
-            inside = nodeAtPoint(request, result, pointInContainer, accumulatedOffset.x(), accumulatedOffset.y(), HitTestChildBlockBackgrounds);
+            inside = nodeAtPoint(request, result, pointInContainer, accumulatedOffset, HitTestChildBlockBackgrounds);
     }
 
     // See if the mouse is inside us but not any of our descendants
     if (hitTestFilter != HitTestDescendants && !inside)
-        inside = nodeAtPoint(request, result, pointInContainer, accumulatedOffset.x(), accumulatedOffset.y(), HitTestBlockBackground);
+        inside = nodeAtPoint(request, result, pointInContainer, accumulatedOffset, HitTestBlockBackground);
 
     return inside;
 }
@@ -2179,7 +2179,7 @@ void RenderObject::updateHitTestResult(HitTestResult& result, const IntPoint& po
     }
 }
 
-bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& /*pointInContainer*/, int /*tx*/, int /*ty*/, HitTestAction)
+bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& /*pointInContainer*/, const IntPoint& /*accumulatedOffset*/, HitTestAction)
 {
     return false;
 }
index d8baaf4..4174475 100644 (file)
@@ -546,7 +546,7 @@ public:
 #endif
 
     bool hitTest(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestFilter = HitTestAll);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
     virtual void updateHitTestResult(HitTestResult&, const IntPoint&);
 
     VisiblePosition positionForCoordinates(int x, int y);
index 80476b3..6bf3fb7 100644 (file)
@@ -1193,17 +1193,16 @@ IntRect RenderTable::overflowClipRect(const IntPoint& location, OverlayScrollbar
     return rect;
 }
 
-bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
+bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction action)
 {
-    tx += x();
-    ty += y();
+    IntPoint adjustedLocation = accumulatedOffset + location();
 
     // Check kids first.
-    if (!hasOverflowClip() || overflowClipRect(IntPoint(tx, ty)).intersects(result.rectForPoint(pointInContainer))) {
+    if (!hasOverflowClip() || overflowClipRect(adjustedLocation).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, pointInContainer, childPoint.x(), childPoint.y(), action)) {
+                IntPoint childPoint = flipForWritingMode(toRenderBox(child), adjustedLocation, ParentToChildFlippingAdjustment);
+                if (child->nodeAtPoint(request, result, pointInContainer, childPoint, action)) {
                     updateHitTestResult(result, toPoint(pointInContainer - childPoint));
                     return true;
                 }
@@ -1212,9 +1211,9 @@ bool RenderTable::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
     }
 
     // Check our bounds next.
-    IntRect boundsRect = IntRect(tx, ty, width(), height());
+    IntRect boundsRect = IntRect(adjustedLocation, size());
     if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint(pointInContainer))) {
-        updateHitTestResult(result, flipForWritingMode(pointInContainer - IntSize(tx, ty)));
+        updateHitTestResult(result, flipForWritingMode(pointInContainer - toSize(adjustedLocation)));
         if (!result.addNodeToRectBasedTestResult(node(), pointInContainer, boundsRect))
             return true;
     }
index 710a2f9..944c13e 100644 (file)
@@ -220,7 +220,7 @@ private:
     virtual void paintMask(PaintInfo&, const IntPoint&);
     virtual void layout();
     virtual void computePreferredLogicalWidths();
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
     
     virtual int firstLineBoxBaseline() const;
 
index 66fc0e6..ad8047d 100644 (file)
@@ -187,7 +187,7 @@ IntRect RenderTableRow::clippedOverflowRectForRepaint(RenderBoxModelObject* repa
 }
 
 // Hit Testing
-bool RenderTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
+bool RenderTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction action)
 {
     // Table rows cannot ever be hit tested.  Effectively they do not exist.
     // Just forward to our children always.
@@ -197,9 +197,9 @@ bool RenderTableRow::nodeAtPoint(const HitTestRequest& request, HitTestResult& r
         // table-specific hit-test method (which we should do for performance reasons anyway),
         // 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, pointInContainer, cellPoint.x(), cellPoint.y(), action)) {
-                updateHitTestResult(result, pointInContainer - IntSize(cellPoint.x(), cellPoint.y()));
+            IntPoint cellPoint = flipForWritingMode(toRenderTableCell(child), accumulatedOffset, ParentToChildFlippingAdjustment);
+            if (child->nodeAtPoint(request, result, pointInContainer, cellPoint, action)) {
+                updateHitTestResult(result, pointInContainer - toSize(cellPoint));
                 return true;
             }
         }
index d4e323f..c4caafb 100644 (file)
@@ -54,7 +54,7 @@ private:
     virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
     virtual void layout();
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     // The only time rows get a layer is when they have transparency.
     virtual bool requiresLayer() const { return isTransparent() || hasOverflowClip() || hasTransform() || hasMask(); }
index 820f24b..eb07e81 100644 (file)
@@ -1141,7 +1141,7 @@ void RenderTableSection::splitColumn(int pos, int first)
 }
 
 // Hit Testing
-bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
+bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction action)
 {
     // If we have no children then we have nothing to do.
     if (!firstChild())
@@ -1149,10 +1149,9 @@ bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
 
     // Table sections cannot ever be hit tested.  Effectively they do not exist.
     // Just forward to our children always.
-    tx += x();
-    ty += y();
+    IntPoint adjustedLocation = accumulatedOffset + location();
 
-    if (hasOverflowClip() && !overflowClipRect(IntPoint(tx, ty)).intersects(result.rectForPoint(pointInContainer)))
+    if (hasOverflowClip() && !overflowClipRect(adjustedLocation).intersects(result.rectForPoint(pointInContainer)))
         return false;
 
     if (m_hasOverflowingCell) {
@@ -1162,8 +1161,8 @@ bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
             // table-specific hit-test method (which we should do for performance reasons anyway),
             // 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, pointInContainer, childPoint.x(), childPoint.y(), action)) {
+                IntPoint childPoint = flipForWritingMode(toRenderBox(child), adjustedLocation, ParentToChildFlippingAdjustment);
+                if (child->nodeAtPoint(request, result, pointInContainer, childPoint, action)) {
                     updateHitTestResult(result, toPoint(pointInContainer - childPoint));
                     return true;
                 }
@@ -1172,7 +1171,7 @@ bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
         return false;
     }
 
-    IntPoint location = pointInContainer - IntSize(tx, ty);
+    IntPoint location = pointInContainer - toSize(adjustedLocation);
     if (style()->isFlippedBlocksWritingMode()) {
         if (style()->isHorizontalWritingMode())
             location.setY(height() - location.y());
@@ -1206,8 +1205,8 @@ bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
 
     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, pointInContainer, cellPoint.x(), cellPoint.y(), action)) {
+        IntPoint cellPoint = flipForWritingMode(cell, adjustedLocation, ParentToChildFlippingAdjustment);
+        if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, pointInContainer, cellPoint, action)) {
             updateHitTestResult(result, toPoint(pointInContainer - cellPoint));
             return true;
         }
index 11fa792..f5e7b2b 100644 (file)
@@ -138,7 +138,7 @@ private:
 
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
 
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     bool ensureRows(int);
     void clearGrid();
index 540b13c..3697965 100644 (file)
@@ -149,7 +149,7 @@ private:
 
     virtual void paint(PaintInfo&, const IntPoint&) { ASSERT_NOT_REACHED(); }
     virtual void layout() { ASSERT_NOT_REACHED(); }
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction) { ASSERT_NOT_REACHED(); return false; }
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, const IntPoint&, HitTestAction) { ASSERT_NOT_REACHED(); return false; }
 
     void deleteTextBoxes();
     bool containsOnlyWhitespace(unsigned from, unsigned len) const;
index c67fed1..2cbf8ed 100644 (file)
@@ -64,13 +64,13 @@ void RenderTextControlMultiLine::subtreeHasChanged()
         frame->editor()->textDidChangeInTextArea(textArea);
 }
 
-bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
 {
-    if (!RenderTextControl::nodeAtPoint(request, result, pointInContainer, tx, ty, hitTestAction))
+    if (!RenderTextControl::nodeAtPoint(request, result, pointInContainer, accumulatedOffset, hitTestAction))
         return false;
 
     if (result.innerNode() == node() || result.innerNode() == innerTextElement())
-        hitInnerTextElement(result, pointInContainer, IntPoint(tx, ty));
+        hitInnerTextElement(result, pointInContainer, accumulatedOffset);
 
     return true;
 }
index 7691562..7992a6a 100644 (file)
@@ -40,7 +40,7 @@ private:
 
     virtual void subtreeHasChanged();
 
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     virtual float getAvgCharWidth(AtomicString family);
     virtual int preferredContentWidth(float charWidth) const;
index 66d8abf..a29e3a8 100644 (file)
@@ -327,7 +327,7 @@ void RenderTextControlSingleLine::layout()
 #endif
 }
 
-bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, 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).
@@ -335,14 +335,14 @@ bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, Hit
     // 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, pointInContainer, tx, ty, hitTestAction))
+    if (!RenderTextControl::nodeAtPoint(request, result, pointInContainer, accumulatedOffset, 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, pointInContainer, IntPoint(tx, ty));
+        hitInnerTextElement(result, pointInContainer, accumulatedOffset);
 
     // If we found a spin button, we're done.
     HTMLElement* innerSpinButton = innerSpinButtonElement();
@@ -367,13 +367,13 @@ bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, Hit
     IntPoint localPoint = result.localPoint();
     localPoint.move(-innerBlockRenderer->location());
 
-    int textLeft = tx + x() + innerBlockRenderer->x() + innerTextRenderer->x();
+    int textLeft = accumulatedOffset.x() + x() + innerBlockRenderer->x() + innerTextRenderer->x();
     if (resultsButton && resultsButton->renderer() && pointInContainer.x() < textLeft)
         innerNode = resultsButton;
 
 #if ENABLE(INPUT_SPEECH)
     if (!innerNode && speechButtonElement() && speechButtonElement()->renderer()) {
-        int buttonLeft = tx + x() + innerBlockRenderer->x() + innerBlockRenderer->width() - speechButtonElement()->renderBox()->width();
+        int buttonLeft = accumulatedOffset.x() + x() + innerBlockRenderer->x() + innerBlockRenderer->width() - speechButtonElement()->renderBox()->width();
         if (pointInContainer.x() >= buttonLeft)
             innerNode = speechButtonElement();
     }
index d8fe41d..208dd65 100644 (file)
@@ -64,7 +64,7 @@ private:
     virtual void paint(PaintInfo&, const IntPoint&);
     virtual void layout();
 
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     virtual void autoscroll();
 
index 8a62961..797dc40 100644 (file)
@@ -390,10 +390,10 @@ RenderWidget* RenderWidget::find(const Widget* widget)
     return widgetRendererMap().get(widget);
 }
 
-bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction action)
+bool RenderWidget::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction action)
 {
     bool hadResult = result.innerNode();
-    bool inside = RenderReplaced::nodeAtPoint(request, result, pointInContainer, tx, ty, action);
+    bool inside = RenderReplaced::nodeAtPoint(request, result, pointInContainer, accumulatedOffset, 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())
index 95ef429..29c96c9 100644 (file)
@@ -67,7 +67,7 @@ private:
 
     virtual void destroy();
     virtual void setSelectionState(SelectionState);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
     virtual void setOverlapTestResult(bool);
 
     bool setWidgetGeometry(const IntRect&, const IntSize&);
index f003386..674417f 100644 (file)
@@ -189,15 +189,15 @@ void RootInlineBox::paint(PaintInfo& paintInfo, const IntPoint& paintOffset, int
 #endif
 }
 
-bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom)
+bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int lineTop, int lineBottom)
 {
     if (hasEllipsisBox() && visibleToHitTesting()) {
-        if (ellipsisBox()->nodeAtPoint(request, result, pointInContainer, tx, ty, lineTop, lineBottom)) {
-            renderer()->updateHitTestResult(result, pointInContainer - IntSize(tx, ty));
+        if (ellipsisBox()->nodeAtPoint(request, result, pointInContainer, accumulatedOffset, lineTop, lineBottom)) {
+            renderer()->updateHitTestResult(result, pointInContainer - toSize(accumulatedOffset));
             return true;
         }
     }
-    return InlineFlowBox::nodeAtPoint(request, result, pointInContainer, tx, ty, lineTop, lineBottom);
+    return InlineFlowBox::nodeAtPoint(request, result, pointInContainer, accumulatedOffset, lineTop, lineBottom);
 }
 
 void RootInlineBox::adjustPosition(float dx, float dy)
index 98318c1..d1dde43 100644 (file)
@@ -96,7 +96,7 @@ public:
 #endif
 
     virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, int lineTop, int lineBottom);
 
     bool hasSelectedChildren() const { return m_hasSelectedChildrenOrCanHaveLeadingExpansion; }
     void setHasSelectedChildren(bool hasSelectedChildren) { m_hasSelectedChildrenOrCanHaveLeadingExpansion = hasSelectedChildren; }
index 3f52490..c7e5f23 100644 (file)
@@ -149,10 +149,10 @@ bool RenderSVGForeignObject::nodeAtFloatPoint(const HitTestRequest& request, Hit
         return false;
 
     IntPoint roundedLocalPoint = roundedIntPoint(localPoint);
-    return RenderBlock::nodeAtPoint(request, result, roundedLocalPoint, 0, 0, hitTestAction);
+    return RenderBlock::nodeAtPoint(request, result, roundedLocalPoint, IntPoint(), hitTestAction);
 }
 
-bool RenderSVGForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction)
+bool RenderSVGForeignObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, const IntPoint&, HitTestAction)
 {
     ASSERT_NOT_REACHED();
     return false;
index 9bdf2f8..b98113c 100644 (file)
@@ -50,7 +50,7 @@ public:
     virtual FloatRect repaintRectInLocalCoordinates() const { return m_viewport; }
 
     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
     virtual bool isSVGForeignObject() const { return true; }
 
     virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState&) const;
index 0150979..2d0ab63 100644 (file)
@@ -106,7 +106,7 @@ void RenderSVGModelObject::updateFromElement()
     SVGResourcesCache::clientUpdatedFromElement(this, style());
 }
 
-bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction)
+bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, const IntPoint&, HitTestAction)
 {
     ASSERT_NOT_REACHED();
     return false;
index eb3549e..bb6efc1 100644 (file)
@@ -67,7 +67,7 @@ public:
 
 private:
     // This method should never be called, SVG uses a different nodeAtPoint method
-    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int dxParentToContainer, int dyParentToContainer, HitTestAction);
+    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 };
 
 }
index 89e84b6..626dd72 100644 (file)
@@ -434,11 +434,9 @@ void RenderSVGRoot::updateCachedBoundaries()
     m_repaintBoundingBox.inflate(borderAndPaddingWidth());
 }
 
-bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
 {
-    IntSize containerToParentOffset(tx, ty);
-
-    IntPoint pointInParent = pointInContainer - containerToParentOffset;
+    IntPoint pointInParent = pointInContainer - toSize(accumulatedOffset);
     IntPoint pointInBorderBox = pointInParent - parentOriginToBorderBox();
 
     // Note: For now, we're ignoring hits to border and padding for <svg>
index 0659f5c..2b5f3ca 100644 (file)
@@ -78,7 +78,7 @@ private:
     virtual FloatRect strokeBoundingBox() const { return m_strokeBoundingBox; }
     virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; }
 
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
 
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
     virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed);
index 70935cc..ac8c8e8 100644 (file)
@@ -194,14 +194,14 @@ bool RenderSVGText::nodeAtFloatPoint(const HitTestRequest& request, HitTestResul
             if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
                 return false;       
 
-            return RenderBlock::nodeAtPoint(request, result, flooredIntPoint(localPoint), 0, 0, hitTestAction);
+            return RenderBlock::nodeAtPoint(request, result, flooredIntPoint(localPoint), IntPoint(), hitTestAction);
         }
     }
 
     return false;
 }
 
-bool RenderSVGText::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, int, int, HitTestAction)
+bool RenderSVGText::nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint&, const IntPoint&, HitTestAction)
 {
     ASSERT_NOT_REACHED();
     return false;
index 9787273..11d7434 100644 (file)
@@ -53,7 +53,7 @@ private:
     virtual bool isSVGText() const { return true; }
 
     virtual void paint(PaintInfo&, const IntPoint&);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
     virtual VisiblePosition positionForPoint(const IntPoint&);