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 81e9c4711a67f2595fe4b3b9fc08609d8f820327..ca390ab536a73d4adc9659f7abb28acb50c5e5a5 100644 |
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
@@ -688,6 +688,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) |
@@ -3327,8 +3335,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 boundingIncludingDescendants = layoutObject->absoluteBoundingBoxRectIncludingDescendants(); |
+ IntSize delta = m_mouseDownPos - boundingIncludingDescendants.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 |