From cfd86b747d32ac22246a1aa908eaa720c63a88c1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 7 Nov 2012 11:22:47 +0100 Subject: Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733) New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes. --- Source/WebCore/page/DragController.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'Source/WebCore/page/DragController.cpp') diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp index 2e0aafb96..81ea3f95d 100644 --- a/Source/WebCore/page/DragController.cpp +++ b/Source/WebCore/page/DragController.cpp @@ -96,10 +96,10 @@ DragController::DragController(Page* page, DragClient* client) , m_documentUnderMouse(0) , m_dragInitiator(0) , m_fileInputElementUnderMouse(0) + , m_documentIsHandlingDrag(false) , m_dragDestinationAction(DragDestinationActionNone) , m_dragSourceAction(DragSourceActionNone) , m_didInitiateDrag(false) - , m_isHandlingDrag(false) , m_sourceDragOperation(DragOperationNone) { ASSERT(m_client); @@ -209,7 +209,7 @@ bool DragController::performDrag(DragData* dragData) { ASSERT(dragData); m_documentUnderMouse = m_page->mainFrame()->documentAtPoint(dragData->clientPosition()); - if (m_dragDestinationAction & DragDestinationActionDHTML) { + if ((m_dragDestinationAction & DragDestinationActionDHTML) && m_documentIsHandlingDrag) { m_client->willPerformDragDestinationAction(DragDestinationActionDHTML, dragData); RefPtr mainFrame = m_page->mainFrame(); bool preventedDefault = false; @@ -265,8 +265,8 @@ DragSession DragController::dragEnteredOrUpdated(DragData* dragData) } DragSession dragSession; - bool handledByDocument = tryDocumentDrag(dragData, m_dragDestinationAction, dragSession); - if (!handledByDocument && (m_dragDestinationAction & DragDestinationActionLoad)) + m_documentIsHandlingDrag = tryDocumentDrag(dragData, m_dragDestinationAction, dragSession); + if (!m_documentIsHandlingDrag && (m_dragDestinationAction & DragDestinationActionLoad)) dragSession.operation = operationForLoad(dragData); return dragSession; } @@ -314,9 +314,9 @@ bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction a if (m_dragInitiator && !m_documentUnderMouse->securityOrigin()->canReceiveDragData(m_dragInitiator->securityOrigin())) return false; - m_isHandlingDrag = false; + bool isHandlingDrag = false; if (actionMask & DragDestinationActionDHTML) { - m_isHandlingDrag = tryDHTMLDrag(dragData, dragSession.operation); + isHandlingDrag = tryDHTMLDrag(dragData, dragSession.operation); // Do not continue if m_documentUnderMouse has been reset by tryDHTMLDrag. // tryDHTMLDrag fires dragenter event. The event listener that listens // to this event may create a nested message loop (open a modal dialog), @@ -332,10 +332,12 @@ bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction a if (!frameView) return false; - if (m_isHandlingDrag) { + if (isHandlingDrag) { m_page->dragCaretController()->clear(); return true; - } else if ((actionMask & DragDestinationActionEdit) && canProcessDrag(dragData)) { + } + + if ((actionMask & DragDestinationActionEdit) && canProcessDrag(dragData)) { if (dragData->containsColor()) { dragSession.operation = DragOperationGeneric; return true; -- cgit v1.2.1