Changeset 52815 in webkit
- Timestamp:
- Jan 5, 2010 11:36:23 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r52813 r52815 1 2010-01-05 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Drag & drop layout tests fail even when run manually 6 https://bugs.webkit.org/show_bug.cgi?id=33055 7 8 No new tests. Fix 3 layout tests when run manually. 9 fast/events/drag-and-drop.html 10 fast/events/drag-and-drop-dataTransfer-types-nocrash.html 11 fast/events/drag-and-drop-fire-drag-dragover.html 12 Running these tests in DRT will be fixed in 31332. 13 14 * page/qt/DragControllerQt.cpp: 15 (WebCore::DragController::cleanupAfterSystemDrag): 16 Cleanup the drag operation if it failed to complete, 17 Otherwise, new drag operations will not be possible. 18 1 19 2010-01-05 Gustavo Noronha Silva <gns@gnome.org> 2 20 -
trunk/WebCore/page/qt/DragControllerQt.cpp
r45747 r52815 67 67 void DragController::cleanupAfterSystemDrag() 68 68 { 69 dragEnded(); 69 70 } 70 71 -
trunk/WebKit/qt/Api/qwebpage.cpp
r52662 r52815 345 345 if (actions & Qt::CopyAction) 346 346 result |= DragOperationCopy; 347 // DragOperationgeneric represents InternetExplorer's equivalent of Move operation, 348 // hence it should be considered as "move" 347 349 if (actions & Qt::MoveAction) 348 result |= DragOperationMove;350 result |= (DragOperationMove | DragOperationGeneric); 349 351 if (actions & Qt::LinkAction) 350 352 result |= DragOperationLink; … … 358 360 result = Qt::CopyAction; 359 361 else if (actions & DragOperationMove) 362 result = Qt::MoveAction; 363 // DragOperationgeneric represents InternetExplorer's equivalent of Move operation, 364 // hence it should be considered as "move" 365 else if (actions & DragOperationGeneric) 360 366 result = Qt::MoveAction; 361 367 else if (actions & DragOperationLink) … … 1095 1101 Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData)); 1096 1102 ev->setDropAction(action); 1097 if (action != Qt::IgnoreAction) 1098 ev->accept(); 1103 // We must accept this event in order to receive the drag move events that are sent 1104 // while the drag and drop action is in progress. 1105 ev->accept(); 1099 1106 #endif 1100 1107 } … … 1136 1143 dropActionToDragOp(ev->possibleActions())); 1137 1144 Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData)); 1145 m_lastDropAction = action; 1138 1146 ev->setDropAction(action); 1139 if (action != Qt::IgnoreAction) 1140 ev->accept(); 1147 // We must accept this event in order to receive the drag move events that are sent 1148 // while the drag and drop action is in progress. 1149 ev->accept(); 1141 1150 #endif 1142 1151 } … … 1147 1156 DragData dragData(ev->mimeData(), ev->pos().toPoint(), 1148 1157 QCursor::pos(), dropActionToDragOp(ev->possibleActions())); 1149 Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData)); 1150 if (action != Qt::IgnoreAction) 1158 if (page->dragController()->performDrag(&dragData)) 1151 1159 ev->accept(); 1152 1160 #endif … … 1156 1164 { 1157 1165 #ifndef QT_NO_DRAGANDDROP 1166 // Overwrite the defaults set by QDragManager::defaultAction() 1167 ev->setDropAction(m_lastDropAction); 1158 1168 DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(), 1159 dropActionToDragOp(ev->possibleActions())); 1160 Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData)); 1161 if (action != Qt::IgnoreAction) 1169 dropActionToDragOp(Qt::DropAction(ev->dropAction()))); 1170 if (page->dragController()->performDrag(&dragData)) 1162 1171 ev->accept(); 1163 1172 #endif -
trunk/WebKit/qt/Api/qwebpage_p.h
r51991 r52815 181 181 QWebInspector* inspector; 182 182 bool inspectorIsInternalOnly; // True if created through the Inspect context menu action 183 Qt::DropAction m_lastDropAction; 183 184 184 185 static bool drtRun; -
trunk/WebKit/qt/ChangeLog
r52713 r52815 1 2010-01-05 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 Drag & drop layout tests fail even when run manually 6 https://bugs.webkit.org/show_bug.cgi?id=33055 7 8 No new tests. Fix 3 layout tests when run manually. 9 fast/events/drag-and-drop.html 10 fast/events/drag-and-drop-dataTransfer-types-nocrash.html 11 fast/events/drag-and-drop-fire-drag-dragover.html 12 Running these tests in DRT will be fixed in 31332. 13 14 * Api/qwebpage.cpp: 15 (dropActionToDragOp): 16 (dragOpToDropAction): 17 (QWebPagePrivate::dragEnterEvent): 18 (QWebPagePrivate::dragMoveEvent): 19 (QWebPagePrivate::dropEvent): 20 Accept drag events even if they are not over a drop target. 21 This is to ensure that drag events will continue to be delivered. 22 23 * Api/qwebpage_p.h: 24 * WebCoreSupport/DragClientQt.cpp: 25 (WebCore::dragOperationToDropActions): 26 (WebCore::dropActionToDragOperation): 27 (WebCore::DragClientQt::startDrag): 28 Send dragEnd event. 29 1 30 2010-01-04 Daniel Bates <dbates@webkit.org> 2 31 -
trunk/WebKit/qt/WebCoreSupport/DragClientQt.cpp
r49200 r52815 28 28 29 29 #include "ClipboardQt.h" 30 #include "Frame.h" 31 #include "PlatformMouseEvent.h" 30 32 #include "qwebpage.h" 31 33 … … 35 37 36 38 namespace WebCore { 39 40 static inline Qt::DropActions dragOperationsToDropActions(unsigned op) 41 { 42 Qt::DropActions result = Qt::IgnoreAction; 43 if (op & DragOperationCopy) 44 result = Qt::CopyAction; 45 if (op & DragOperationMove) 46 result |= Qt::MoveAction; 47 if (op & DragOperationGeneric) 48 result |= Qt::MoveAction; 49 if (op & DragOperationLink) 50 result |= Qt::LinkAction; 51 return result; 52 } 53 54 static inline DragOperation dropActionToDragOperation(Qt::DropActions action) 55 { 56 DragOperation result = DragOperationNone; 57 if (action & Qt::CopyAction) 58 result = DragOperationCopy; 59 if (action & Qt::LinkAction) 60 result = DragOperationLink; 61 if (action & Qt::MoveAction) 62 result = DragOperationMove; 63 return result; 64 } 37 65 38 66 DragDestinationAction DragClientQt::actionMaskForDrag(DragData*) … … 59 87 } 60 88 61 void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard* clipboard, Frame* , bool)89 void DragClientQt::startDrag(DragImageRef, const IntPoint&, const IntPoint&, Clipboard* clipboard, Frame* frame, bool) 62 90 { 63 91 #ifndef QT_NO_DRAGANDDROP … … 67 95 if (view) { 68 96 QDrag *drag = new QDrag(view); 69 if (clipboardData ->hasImage())97 if (clipboardData && clipboardData->hasImage()) 70 98 drag->setPixmap(qvariant_cast<QPixmap>(clipboardData->imageData())); 99 DragOperation dragOperationMask = DragOperationEvery; 100 clipboard->sourceOperation(dragOperationMask); 71 101 drag->setMimeData(clipboardData); 72 drag->start(); 102 Qt::DropAction actualDropAction = drag->exec(dragOperationsToDropActions(dragOperationMask)); 103 104 // Send dragEnd event 105 PlatformMouseEvent me(m_webPage->view()->mapFromGlobal(QCursor::pos()), QCursor::pos(), LeftButton, MouseEventMoved, 0, false, false, false, false, 0); 106 frame->eventHandler()->dragSourceEndedAt(me, dropActionToDragOperation(actualDropAction)); 73 107 } 74 108 #endif
Note: See TracChangeset
for help on using the changeset viewer.