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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1716023002: Fix draggable elements are painted at incorrect position (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: third_party/WebKit/Source/core/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 188d4c4fab19cba46bedd6102aa61ee868924cc9..5cd29438afc881ad4bd40c9205cf36ecad63177e 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -687,6 +687,14 @@ IntPoint EventHandler::lastKnownMousePosition() const
return m_lastKnownMousePosition;
}
+IntPoint EventHandler::dragDataTransferLocationForTesting()
+{
+ if (dragState().m_dragDataTransfer)
+ return dragState().m_dragDataTransfer->dragLocation();
+
+ return IntPoint();
+}
+
static LocalFrame* subframeForTargetNode(Node* node)
{
if (!node)
@@ -3321,8 +3329,8 @@ bool EventHandler::tryStartDrag(const MouseEventWithHitTestResults& event)
// image and offset
if (dragState().m_dragType == DragSourceActionDHTML) {
if (LayoutObject* layoutObject = dragState().m_dragSrc->layoutObject()) {
- FloatPoint absPos = layoutObject->localToAbsolute(FloatPoint(), UseTransforms);
- IntSize delta = m_mouseDownPos - roundedIntPoint(absPos);
+ IntRect absoluteBoundingBox = layoutObject->absoluteBoundingBoxRect();
fs 2016/02/24 12:51:16 Why did you switch this to absoluteBoundingBoxRect
hyunjunekim2 2016/02/24 13:06:36 |absoluteBoundingBoxRect| function was thought to
+ IntSize delta = m_mouseDownPos - absoluteBoundingBox.location();
dragState().m_dragDataTransfer->setDragImageElement(dragState().m_dragSrc.get(), IntPoint(delta));
} else {
// The layoutObject has disappeared, this can happen if the onStartDrag handler has hidden
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.h ('k') | third_party/WebKit/Source/core/input/EventHandlerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698