Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 24074002: Drag'n drop Autoscroll does not work properly on inner frames (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Drag'n drop Autoscroll does not work properly on inner frames Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « LayoutTests/fast/events/drag-and-drop-autoscroll-inner-frame-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698