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

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..473a8be7f44e7aa28979d11104a0266b6bedd417 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -687,6 +687,15 @@ IntPoint EventHandler::lastKnownMousePosition() const
return m_lastKnownMousePosition;
}
+IntPoint EventHandler::dragDataTransferLocation()
+{
+ IntPoint loc;
+ if (dragState().m_dragDataTransfer) {
fs 2016/02/23 17:27:45 if (...) return ...; return IntPoint();
hyunjunekim2 2016/02/24 13:06:36 Done.
+ loc = dragState().m_dragDataTransfer->dragLocation();
+ }
+ return loc;
+}
+
static LocalFrame* subframeForTargetNode(Node* node)
{
if (!node)
@@ -3321,7 +3330,8 @@ bool EventHandler::tryStartDrag(const MouseEventWithHitTestResults& event)
// image and offset
if (dragState().m_dragType == DragSourceActionDHTML) {
fs 2016/02/23 17:27:45 (I wonder why this code isn't in DragController::p
hyunjunekim2 2016/02/24 12:00:07 This is the report that is flow to draw dragged im
hyunjunekim2 2016/02/24 12:04:41 Did you say that this codes need to transfer on |D
fs 2016/02/24 12:47:48 No need to take any action on this - I was mostly
if (LayoutObject* layoutObject = dragState().m_dragSrc->layoutObject()) {
- FloatPoint absPos = layoutObject->localToAbsolute(FloatPoint(), UseTransforms);
+ IntRect boundingIncludingDescendants = layoutObject->absoluteBoundingBoxRectIncludingDescendants();
fs 2016/02/23 17:27:45 I guess this makes sense since it's what LocalFram
+ FloatPoint absPos(boundingIncludingDescendants.x(), boundingIncludingDescendants.y());
fs 2016/02/23 17:27:45 No need to do int -> float and then round to int a
hyunjunekim2 2016/02/24 13:06:36 Done.
IntSize delta = m_mouseDownPos - roundedIntPoint(absPos);
dragState().m_dragDataTransfer->setDragImageElement(dragState().m_dragSrc.get(), IntPoint(delta));
} else {

Powered by Google App Engine
This is Rietveld 408576698