Changeset 49651 in webkit
- Timestamp:
- Oct 15, 2009 1:39:43 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r49646 r49651 1 2009-10-15 Daniel Bates <dbates@webkit.org> 2 3 Reviewed by Adam Roben. 4 5 https://bugs.webkit.org/show_bug.cgi?id=24731 6 And 7 rdar://problem/5015961 8 9 Tests that DHTML drag-and-drop works correctly. 10 11 Note, this test fails when effectAllowed == "uninitialized" because 12 this effect has not been implemented yet (see bug #30291). 13 14 * fast/events/drag-and-drop-expected.txt: Added. 15 * fast/events/drag-and-drop.html: Added. 16 1 17 2009-10-15 Zan Dobersek <zandobersek@gmail.com> 2 18 -
trunk/WebKit/win/ChangeLog
r49566 r49651 1 2009-10-15 Daniel Bates <dbates@webkit.org> 2 3 Reviewed by Adam Roben. 4 5 https://bugs.webkit.org/show_bug.cgi?id=24731 6 And 7 rdar://problem/5015961 8 9 Implements support for DHTML drag-and-drop operations (i.e. ondragstart, ondragend) 10 in the Windows build so that it conforms to the Mac OS X build. Hence, dropEffect is 11 correctly set. 12 13 The WebView and WebDropSource drag-and-drop functions, as called by function 14 DoDragDrop in its event loop, neither used the drop effect as specified by 15 event.dataTransfer.dropEffect nor respected event.dataTransfer.effectsAllowed. 16 Instead, these functions defaulted to some hardcoded drop effect and set of 17 allowed drop effects, respectively. 18 19 Tests: fast/events/drag-and-drop.html 20 21 * WebCoreSupport/WebDragClient.cpp: 22 (WebDragClient::startDrag): 23 * WebDropSource.cpp: 24 (WebDropSource::QueryContinueDrag): Moved call to EventHandler::dragSourceEndedAt 25 into method WebDragClient::startDrag. 26 * WebDropSource.h: 27 * WebView.cpp: 28 (WebView::keyStateToDragOperation): Fixes <rdar://problem/5015961>. Determines 29 appropriate drop effect from state of keyboard and allowed effects 30 m_page->dragController()->sourceDragOperation(). 31 (WebView::DragEnter): 32 (WebView::DragOver): 33 (WebView::Drop): 34 * WebView.h: 35 1 36 2009-10-14 Adam Roben <aroben@apple.com> 2 37 -
trunk/WebKit/win/WebCoreSupport/WebDragClient.cpp
r49268 r49651 173 173 174 174 DWORD okEffect = draggingSourceOperationMaskToDragCursors(m_webView->page()->dragController()->sourceDragOperation()); 175 DWORD effect ;175 DWORD effect = DROPEFFECT_NONE; 176 176 COMPtr<IWebUIDelegate> ui; 177 HRESULT hr = E_NOTIMPL; 177 178 if (SUCCEEDED(m_webView->uiDelegate(&ui))) { 178 179 COMPtr<IWebUIDelegatePrivate> uiPrivate; 179 180 if (SUCCEEDED(ui->QueryInterface(IID_IWebUIDelegatePrivate, (void**)&uiPrivate))) 180 if (SUCCEEDED(uiPrivate->doDragDrop(m_webView, dataObject.get(), source.get(), okEffect, &effect))) 181 return; 181 hr = uiPrivate->doDragDrop(m_webView, dataObject.get(), source.get(), okEffect, &effect); 182 182 } 183 184 DoDragDrop(dataObject.get(), source.get(), okEffect, &effect); 183 if (hr == E_NOTIMPL) 184 hr = DoDragDrop(dataObject.get(), source.get(), okEffect, &effect); 185 186 DragOperation operation = DragOperationNone; 187 if (hr == DRAGDROP_S_DROP) { 188 if (effect & DROPEFFECT_COPY) 189 operation = DragOperationCopy; 190 else if (effect & DROPEFFECT_LINK) 191 operation = DragOperationLink; 192 else if (effect & DROPEFFECT_MOVE) 193 operation = DragOperationMove; 194 } 195 frame->eventHandler()->dragSourceEndedAt(generateMouseEvent(m_webView, false), operation); 185 196 } 186 197 } -
trunk/WebKit/win/WebDropSource.cpp
r45515 r49651 107 107 if (fEscapePressed || !(grfKeyState & (MK_LBUTTON|MK_RBUTTON))) { 108 108 m_dropped = !fEscapePressed; 109 if (Page* page = m_webView->page())110 if (Frame* frame = page->mainFrame())111 //FIXME: We need to figure out how to find out what actually happened in the drag <rdar://problem/5015961>112 frame->eventHandler()->dragSourceEndedAt(generateMouseEvent(m_webView.get(), false), fEscapePressed ? DragOperationNone : DragOperationCopy);113 109 return fEscapePressed? DRAGDROP_S_CANCEL : DRAGDROP_S_DROP; 114 110 } else if (Page* page = m_webView->page()) -
trunk/WebKit/win/WebDropSource.h
r31726 r49651 33 33 class WebView; 34 34 35 namespace WebCore { 36 class PlatformMouseEvent; 37 } 38 39 WebCore::PlatformMouseEvent generateMouseEvent(WebView*, bool isDrag); 40 35 41 class WebDropSource : public IDropSource 36 42 { -
trunk/WebKit/win/WebView.cpp
r49564 r49651 4645 4645 } 4646 4646 4647 static DragOperation keyStateToDragOperation(DWORD) { 4648 //FIXME: This is currently very simple, it may need to actually 4649 //work out an appropriate DragOperation in future -- however this 4650 //behaviour appears to match FireFox 4651 return (DragOperation)(DragOperationCopy | DragOperationLink); 4647 DragOperation WebView::keyStateToDragOperation(DWORD grfKeyState) const 4648 { 4649 if (!m_page) 4650 return DragOperationNone; 4651 4652 // Conforms to Microsoft's key combinations as documented for 4653 // IDropTarget::DragOver. Note, grfKeyState is the current 4654 // state of the keyboard modifier keys on the keyboard. See: 4655 // <http://msdn.microsoft.com/en-us/library/ms680129(VS.85).aspx>. 4656 DragOperation operation = m_page->dragController()->sourceDragOperation(); 4657 4658 if ((grfKeyState & (MK_CONTROL | MK_SHIFT)) == (MK_CONTROL | MK_SHIFT)) 4659 operation = DragOperationLink; 4660 else if ((grfKeyState & MK_CONTROL) == MK_CONTROL) 4661 operation = DragOperationCopy; 4662 else if ((grfKeyState & MK_SHIFT) == MK_SHIFT) 4663 operation = DragOperationGeneric; 4664 4665 return operation; 4652 4666 } 4653 4667 … … 4666 4680 *pdwEffect = dragOperationToDragCursor(m_page->dragController()->dragEntered(&data)); 4667 4681 4682 m_lastDropEffect = *pdwEffect; 4668 4683 m_dragData = pDataObject; 4669 4684 … … 4686 4701 *pdwEffect = DROPEFFECT_NONE; 4687 4702 4703 m_lastDropEffect = *pdwEffect; 4688 4704 return S_OK; 4689 4705 } … … 4710 4726 4711 4727 m_dragData = 0; 4712 *pdwEffect = DROPEFFECT_NONE;4728 *pdwEffect = m_lastDropEffect; 4713 4729 POINTL localpt = pt; 4714 4730 ::ScreenToClient(m_viewWindow, (LPPOINT)&localpt); -
trunk/WebKit/win/WebView.h
r49564 r49651 873 873 void updateBackingStore(WebCore::FrameView*, HDC = 0, bool backingStoreCompletelyDirty = false, WindowsToPaint = PaintWebViewOnly); 874 874 875 WebCore::DragOperation keyStateToDragOperation(DWORD grfKeyState) const; 876 877 // FIXME: This variable is part of a workaround. The drop effect (pdwEffect) passed to Drop is incorrect. 878 // We set this variable in DragEnter and DragOver so that it can be used in Drop to set the correct drop effect. 879 // Thus, on return from DoDragDrop we have the correct pdwEffect for the drag-and-drop operation. 880 // (see https://bugs.webkit.org/show_bug.cgi?id=29264) 881 DWORD m_lastDropEffect; 882 875 883 protected: 876 884 HIMC getIMMContext();
Note: See TracChangeset
for help on using the changeset viewer.