Changeset 89369 in webkit
- Timestamp:
- Jun 21, 2011 12:18:11 PM (13 years ago)
- Location:
- trunk/Source/WebKit/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r88933 r89369 270 270 if (actions & Qt::LinkAction) 271 271 result |= DragOperationLink; 272 if (result == (DragOperationCopy | DragOperationMove | DragOperationGeneric | DragOperationLink)) 273 result = DragOperationEvery; 272 274 return (DragOperation)result; 273 275 } … … 316 318 , inspector(0) 317 319 , inspectorIsInternalOnly(false) 320 , m_lastDropAction(Qt::IgnoreAction) 318 321 { 319 322 WebCore::InitializeLoggingChannelsIfNecessary(); … … 1016 1019 DragData dragData(ev->mimeData(), QPointF(ev->pos()).toPoint(), 1017 1020 QCursor::pos(), dropActionToDragOp(ev->possibleActions())); 1018 Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData));1019 ev->setDropAction( action);1020 if ( action != Qt::IgnoreAction)1021 ev->accept ProposedAction();1021 m_lastDropAction = dragOpToDropAction(page->dragController()->dragUpdated(&dragData)); 1022 ev->setDropAction(m_lastDropAction); 1023 if (m_lastDropAction != Qt::IgnoreAction) 1024 ev->accept(); 1022 1025 #endif 1023 1026 } … … 1029 1032 DragData dragData(ev->mimeData(), QPointF(ev->pos()).toPoint(), 1030 1033 QCursor::pos(), dropActionToDragOp(ev->possibleActions())); 1031 if (page->dragController()->performDrag(&dragData)) 1032 ev->acceptProposedAction(); 1034 if (page->dragController()->performDrag(&dragData)) { 1035 ev->setDropAction(m_lastDropAction); 1036 ev->accept(); 1037 } 1033 1038 #endif 1034 1039 } -
trunk/Source/WebKit/qt/ChangeLog
r89252 r89369 1 2011-06-21 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Andreas Kling. 4 5 [Qt] Regression(60942) wrong default action for drag-and-drop. 6 https://bugs.webkit.org/show_bug.cgi?id=63004 7 8 Added special handling for the case that dragOperation is not initialized. 9 Save the last dropOperation and pass it to the dropEvent, so that it can 10 be accepted by QDrag. 11 Call event->accepted() and not event->acceptProposedAction(), because the 12 later ignores the dropAction specified in JavaScript. 13 14 Tested with the test page attached to https://bugs.webkit.org/show_bug.cgi?id=40401 15 and did not see any issue. 16 Also manually tested all combinations of LayoutTests/fast/events/drag-and-drop.html 17 and they all pass. 18 19 * Api/qwebpage.cpp: 20 (dropActionToDragOp): 21 (QWebPagePrivate::dragMoveEvent): 22 (QWebPagePrivate::dropEvent): 23 1 24 2011-06-20 Pavel Feldman <pfeldman@chromium.org> 2 25
Note: See TracChangeset
for help on using the changeset viewer.