Changeset 176687 in webkit
- Timestamp:
- Dec 2, 2014, 1:00:07 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r176684 r176687 1 2014-12-02 Dan Bernstein <mitz@apple.com> 2 3 REGRESSION: Dragging selected text changes the selection 4 https://bugs.webkit.org/show_bug.cgi?id=139110 5 6 Reviewed by Simon Fraser. 7 8 After it sent the UI process the message to start dragging, the Web process handled mouse 9 move events that had already been in flight, interpreting them as a drag to start a new 10 selection. This is fixed by ignoring any mouse events received after asking the UI process 11 to start dragging. 12 13 * UIProcess/mac/WebPageProxyMac.mm: 14 (WebKit::WebPageProxy::setDragImage): Send the new DidStartDrag message back to the Web 15 process, so that it stops ignoring mouse events. 16 17 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: 18 (WebKit::WebDragClient::startDrag): Call the new WebPage::willStartDrag, so that it starts 19 ignoring mouse events. 20 21 * WebProcess/WebPage/WebPage.cpp: 22 (WebKit::WebPage::WebPage): Initialize new member variable. 23 (WebKit::WebPage::mouseEvent): Don’t handle the event if we have asked the UI process to 24 start dragging. 25 26 * WebProcess/WebPage/WebPage.h: 27 (WebKit::WebPage::willStartDrag): Added. Sets new member variable m_isStartingDrag to true. 28 (WebKit::WebPage::didStartDrag): Added. Handles the message from the UI process by setting 29 m_isStartingDrag back to false. 30 31 * WebProcess/WebPage/WebPage.messages.in: Added DidStartDrag. 32 1 33 2014-12-02 Beth Dakin <bdakin@apple.com> 2 34 -
trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
r176164 r176687 379 379 void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, bool isLinkDrag) 380 380 { 381 RefPtr<ShareableBitmap> dragImage = ShareableBitmap::create(dragImageHandle); 382 if (!dragImage) 383 return; 384 385 m_pageClient.setDragImage(clientPosition, dragImage.release(), isLinkDrag); 381 if (RefPtr<ShareableBitmap> dragImage = ShareableBitmap::create(dragImageHandle)) 382 m_pageClient.setDragImage(clientPosition, dragImage.release(), isLinkDrag); 383 384 process().send(Messages::WebPage::DidStartDrag(), m_pageID); 386 385 } 387 386 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
r174676 r176687 81 81 return; 82 82 83 m_page->willStartDrag(); 84 83 85 // FIXME: Seems this message should be named StartDrag, not SetDragImage. 84 86 m_page->send(Messages::WebPageProxy::SetDragImage(frame.view()->contentsToWindow(point), handle, linkDrag)); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r176544 r176687 291 291 , m_canRunModal(parameters.canRunModal) 292 292 , m_isRunningModal(false) 293 #if ENABLE(DRAG_SUPPORT) 294 , m_isStartingDrag(false) 295 #endif 293 296 , m_cachedMainFrameIsPinnedToLeftSide(true) 294 297 , m_cachedMainFrameIsPinnedToRightSide(true) … … 1910 1913 m_page->pageThrottler().didReceiveUserInput(); 1911 1914 1915 bool shouldHandleEvent = true; 1916 1912 1917 #if ENABLE(CONTEXT_MENUS) 1913 1918 // Don't try to handle any pending mouse events if a context menu is showing. 1914 if (m_isShowingContextMenu) { 1919 if (m_isShowingContextMenu) 1920 shouldHandleEvent = false; 1921 #endif 1922 #if ENABLE(DRAG_SUPPORT) 1923 if (m_isStartingDrag) 1924 shouldHandleEvent = false; 1925 #endif 1926 1927 if (!shouldHandleEvent) { 1915 1928 send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), false)); 1916 1929 return; 1917 1930 } 1918 #endif 1931 1919 1932 bool handled = false; 1920 1933 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r176462 r176687 696 696 void willPerformLoadDragDestinationAction(); 697 697 void mayPerformUploadDragDestinationAction(); 698 699 void willStartDrag() { ASSERT(!m_isStartingDrag); m_isStartingDrag = true; } 700 void didStartDrag() { ASSERT(m_isStartingDrag); m_isStartingDrag = false; } 698 701 #endif // ENABLE(DRAG_SUPPORT) 699 702 … … 1233 1236 bool m_canRunModal; 1234 1237 bool m_isRunningModal; 1238 1239 #if ENABLE(DRAG_SUPPORT) 1240 bool m_isStartingDrag; 1241 #endif 1235 1242 1236 1243 bool m_cachedMainFrameIsPinnedToLeftSide; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r176337 r176687 230 230 #endif 231 231 #if ENABLE(DRAG_SUPPORT) 232 DidStartDrag() 232 233 DragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation) 233 234 #endif
Note:
See TracChangeset
for help on using the changeset viewer.