Changeset 88311 in webkit


Ignore:
Timestamp:
Jun 7, 2011 6:46:17 PM (13 years ago)
Author:
eae@chromium.org
Message:

2011-06-07 Emil A Eklund <eae@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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88308 r88311  
     12011-06-07  Emil A Eklund  <eae@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Change RenderBlock::hitTestColumns to IntPoint
     6        https://bugs.webkit.org/show_bug.cgi?id=62172
     7
     8        Covered by existing tests.
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::RenderBlock::nodeAtPoint):
     12        (WebCore::RenderBlock::hitTestColumns):
     13        * rendering/RenderBlock.h:
     14
    1152011-06-07  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r88297 r88311  
    39353935            if (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer, scrolledOffset.width(), scrolledOffset.height()))
    39363936                return true;
    3937         } else if (hitTestColumns(request, result, pointInContainer, scrolledOffset.width(), scrolledOffset.height(), hitTestAction)) {
     3937        } else if (hitTestColumns(request, result, pointInContainer, toPoint(scrolledOffset), hitTestAction)) {
    39383938            updateHitTestResult(result, pointInContainer - localOffset);
    39393939            return true;
     
    39833983}
    39843984
    3985 bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
     3985bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
    39863986{
    39873987    // We need to do multiple passes, breaking up our hit testing into strips.
     
    40114011        else
    40124012            currLogicalTopOffset += blockDelta;
    4013         colRect.move(tx, ty);
     4013        colRect.moveBy(accumulatedOffset);
    40144014       
    40154015        if (colRect.intersects(result.rectForPoint(pointInContainer))) {
    40164016            // The point is inside this column.
    4017             // Adjust tx and ty to change where we hit test.
     4017            // Adjust accumulatedOffset to change where we hit test.
    40184018       
    40194019            IntSize offset = isHorizontal ? IntSize(currLogicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, currLogicalLeftOffset);
    4020             int finalX = tx + offset.width();
    4021             int finalY = ty + offset.height();
     4020            IntPoint finalLocation = accumulatedOffset + offset;
    40224021            if (result.isRectBasedTest() && !colRect.contains(result.rectForPoint(pointInContainer)))
    4023                 hitTestContents(request, result, pointInContainer, IntPoint(finalX, finalY), hitTestAction);
     4022                hitTestContents(request, result, pointInContainer, finalLocation, hitTestAction);
    40244023            else
    4025                 return hitTestContents(request, result, pointInContainer, IntPoint(finalX, finalY), hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer, finalX, finalY));
     4024                return hitTestContents(request, result, pointInContainer, finalLocation, hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(request, result, pointInContainer, finalLocation.x(), finalLocation.y()));
    40264025        }
    40274026    }
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r88297 r88311  
    589589    int nextFloatLogicalBottomBelow(int) const;
    590590   
    591     virtual bool hitTestColumns(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
     591    virtual bool hitTestColumns(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
    592592    virtual bool hitTestContents(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction);
    593593    bool hitTestFloats(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty);
Note: See TracChangeset for help on using the changeset viewer.