| Index: Source/core/rendering/RenderBox.cpp
|
| diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
|
| index 84e550a7798d4d4f302644e0ae06c575e692a200..a1144c0cdf0d6f3a8e658ec8d884d8b6b24532c4 100644
|
| --- a/Source/core/rendering/RenderBox.cpp
|
| +++ b/Source/core/rendering/RenderBox.cpp
|
| @@ -769,22 +769,23 @@ IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con
|
| if (!frameView)
|
| return IntSize();
|
|
|
| - IntSize offset;
|
| - IntPoint point = frameView->windowToContents(windowPoint);
|
| IntRect box(absoluteBoundingBoxRect());
|
| - if (isRenderView())
|
| - box.moveBy(frameView->windowToContents(IntPoint()));
|
| -
|
| - if (point.x() < box.x() + autoscrollBeltSize)
|
| - point.move(-autoscrollBeltSize, 0);
|
| - else if (point.x() > box.maxX() - autoscrollBeltSize)
|
| - point.move(autoscrollBeltSize, 0);
|
| -
|
| - if (point.y() < box.y() + autoscrollBeltSize)
|
| - point.move(0, -autoscrollBeltSize);
|
| - else if (point.y() > box.maxY() - autoscrollBeltSize)
|
| - point.move(0, autoscrollBeltSize);
|
| - return frameView->contentsToWindow(point) - windowPoint;
|
| + box.move(view()->frameView()->scrollOffset());
|
| + IntRect windowBox = view()->frameView()->contentsToWindow(box);
|
| +
|
| + IntPoint windowAutoscrollPoint = windowPoint;
|
| +
|
| + if (windowAutoscrollPoint.x() < windowBox.x() + autoscrollBeltSize)
|
| + windowAutoscrollPoint.move(-autoscrollBeltSize, 0);
|
| + else if (windowAutoscrollPoint.x() > windowBox.maxX() - autoscrollBeltSize)
|
| + windowAutoscrollPoint.move(autoscrollBeltSize, 0);
|
| +
|
| + if (windowAutoscrollPoint.y() < windowBox.y() + autoscrollBeltSize)
|
| + windowAutoscrollPoint.move(0, -autoscrollBeltSize);
|
| + else if (windowAutoscrollPoint.y() > windowBox.maxY() - autoscrollBeltSize)
|
| + windowAutoscrollPoint.move(0, autoscrollBeltSize);
|
| +
|
| + return windowAutoscrollPoint - windowPoint;
|
| }
|
|
|
| RenderBox* RenderBox::findAutoscrollable(RenderObject* renderer)
|
|
|