Title: [88311] trunk/Source/WebCore
Revision
88311
Author
e...@chromium.org
Date
2011-06-07 18:46:17 -0700 (Tue, 07 Jun 2011)

Log Message

2011-06-07  Emil A Eklund  <e...@chromium.org>

        Reviewed by Eric Seidel.

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

        Covered by existing tests.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88310 => 88311)


--- trunk/Source/WebCore/ChangeLog	2011-06-08 01:37:20 UTC (rev 88310)
+++ trunk/Source/WebCore/ChangeLog	2011-06-08 01:46:17 UTC (rev 88311)
@@ -1,3 +1,17 @@
+2011-06-07  Emil A Eklund  <e...@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Change RenderBlock::hitTestColumns to IntPoint
+        https://bugs.webkit.org/show_bug.cgi?id=62172
+
+        Covered by existing tests.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint):
+        (WebCore::RenderBlock::hitTestColumns):
+        * rendering/RenderBlock.h:
+
 2011-06-07  Simon Fraser  <simon.fra...@apple.com>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (88310 => 88311)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-06-08 01:37:20 UTC (rev 88310)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-06-08 01:46:17 UTC (rev 88311)
@@ -3934,7 +3934,7 @@
             }
             if (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer, scrolledOffset.width(), scrolledOffset.height()))
                 return true;
-        } else if (hitTestColumns(request, result, pointInContainer, scrolledOffset.width(), scrolledOffset.height(), hitTestAction)) {
+        } else if (hitTestColumns(request, result, pointInContainer, toPoint(scrolledOffset), hitTestAction)) {
             updateHitTestResult(result, pointInContainer - localOffset);
             return true;
         }
@@ -3982,7 +3982,7 @@
     return false;
 }
 
-bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
+bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
 {
     // We need to do multiple passes, breaking up our hit testing into strips.
     ColumnInfo* colInfo = columnInfo();
@@ -4010,19 +4010,18 @@
             currLogicalTopOffset -= blockDelta;
         else
             currLogicalTopOffset += blockDelta;
-        colRect.move(tx, ty);
+        colRect.moveBy(accumulatedOffset);
         
         if (colRect.intersects(result.rectForPoint(pointInContainer))) {
             // The point is inside this column.
-            // Adjust tx and ty to change where we hit test.
+            // Adjust accumulatedOffset to change where we hit test.
         
             IntSize offset = isHorizontal ? IntSize(currLogicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, currLogicalLeftOffset);
-            int finalX = tx + offset.width();
-            int finalY = ty + offset.height();
+            IntPoint finalLocation = accumulatedOffset + offset;
             if (result.isRectBasedTest() && !colRect.contains(result.rectForPoint(pointInContainer)))
-                hitTestContents(request, result, pointInContainer, IntPoint(finalX, finalY), hitTestAction);
+                hitTestContents(request, result, pointInContainer, finalLocation, hitTestAction);
             else
-                return hitTestContents(request, result, pointInContainer, IntPoint(finalX, finalY), hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer, finalX, finalY));
+                return hitTestContents(request, result, pointInContainer, finalLocation, hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer, finalLocation.x(), finalLocation.y()));
         }
     }
 

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (88310 => 88311)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2011-06-08 01:37:20 UTC (rev 88310)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2011-06-08 01:46:17 UTC (rev 88311)
@@ -588,7 +588,7 @@
     int lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::FloatBoth) const;
     int nextFloatLogicalBottomBelow(int) const;
     
-    virtual bool hitTestColumns(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
+    virtual bool hitTestColumns(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, 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);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to