Title: [88282] trunk/Source/WebCore
Revision
88282
Author
[email protected]
Date
2011-06-07 16:24:40 -0700 (Tue, 07 Jun 2011)

Log Message

2011-06-07  Emil A Eklund  <[email protected]>

        Reviewed by Eric Seidel.

        Change RenderBlock::hitTestContents to IntPoint
        https://bugs.webkit.org/show_bug.cgi?id=62170

        Covered by existing tests.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::nodeAtPoint):
        (WebCore::RenderBlock::hitTestColumns):
        (WebCore::RenderBlock::hitTestContents):
        * rendering/RenderBlock.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88281 => 88282)


--- trunk/Source/WebCore/ChangeLog	2011-06-07 23:21:55 UTC (rev 88281)
+++ trunk/Source/WebCore/ChangeLog	2011-06-07 23:24:40 UTC (rev 88282)
@@ -1,3 +1,18 @@
+2011-06-07  Emil A Eklund  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        Change RenderBlock::hitTestContents to IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=62170
+
+        Covered by existing tests.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint):
+        (WebCore::RenderBlock::hitTestColumns):
+        (WebCore::RenderBlock::hitTestContents):
+        * rendering/RenderBlock.h:
+
 2011-06-07  Jer Noble  <[email protected]>
 
         Reviewed by Eric Carlson.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (88281 => 88282)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-06-07 23:21:55 UTC (rev 88281)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-06-07 23:24:40 UTC (rev 88282)
@@ -3928,7 +3928,7 @@
 
         // Hit test contents if we don't have columns.
         if (!hasColumns()) {
-            if (hitTestContents(request, result, pointInContainer, scrolledOffset.width(), scrolledOffset.height(), hitTestAction)) {
+            if (hitTestContents(request, result, pointInContainer, toPoint(scrolledOffset), hitTestAction)) {
                 updateHitTestResult(result, pointInContainer - localOffset);
                 return true;
             }
@@ -4020,20 +4020,20 @@
             int finalX = tx + offset.width();
             int finalY = ty + offset.height();
             if (result.isRectBasedTest() && !colRect.contains(result.rectForPoint(pointInContainer)))
-                hitTestContents(request, result, pointInContainer, finalX, finalY, hitTestAction);
+                hitTestContents(request, result, pointInContainer, IntPoint(finalX, finalY), hitTestAction);
             else
-                return hitTestContents(request, result, pointInContainer, finalX, finalY, hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer, finalX, finalY));
+                return hitTestContents(request, result, pointInContainer, IntPoint(finalX, finalY), hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer, finalX, finalY));
         }
     }
 
     return false;
 }
 
-bool RenderBlock::hitTestContents(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+bool RenderBlock::hitTestContents(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
 {
     if (childrenInline() && !isTable()) {
         // We have to hit-test our line boxes.
-        if (m_lineBoxes.hitTest(this, request, result, pointInContainer, IntPoint(tx, ty), hitTestAction))
+        if (m_lineBoxes.hitTest(this, request, result, pointInContainer, accumulatedOffset, hitTestAction))
             return true;
     } else {
         // Hit test our children.
@@ -4041,7 +4041,7 @@
         if (hitTestAction == HitTestChildBlockBackgrounds)
             childHitTest = HitTestChildBlockBackground;
         for (RenderBox* child = lastChildBox(); child; child = child->previousSiblingBox()) {
-            IntPoint childPoint = flipForWritingMode(child, IntPoint(tx, ty), ParentToChildFlippingAdjustment);
+            IntPoint childPoint = flipForWritingMode(child, accumulatedOffset, ParentToChildFlippingAdjustment);
             if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, pointInContainer, childPoint.x(), childPoint.y(), childHitTest))
                 return true;
         }

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (88281 => 88282)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2011-06-07 23:21:55 UTC (rev 88281)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2011-06-07 23:24:40 UTC (rev 88282)
@@ -589,7 +589,7 @@
     int nextFloatLogicalBottomBelow(int) const;
     
     virtual bool hitTestColumns(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
-    virtual bool hitTestContents(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool hitTestContents(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
     bool hitTestFloats(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty);
 
     virtual bool isPointInOverflowControl(HitTestResult&, const IntPoint& pointInContainer, int tx, int ty);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to