Changeset 56603 in webkit
- Timestamp:
- Mar 25, 2010 10:48:28 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r56598 r56603 1 2010-03-25 Tony Chang <tony@chromium.org> 2 3 Reviewed by David Levin. 4 5 [chromium] correctly handle move drag operations 6 https://bugs.webkit.org/show_bug.cgi?id=36484 7 8 * platform/chromium/test_expectations.txt: 9 1 10 2010-03-25 Ojan Vafai <ojan@chromium.org> 2 11 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r56598 r56603 2792 2792 BUG38376 WIN : editing/deleting/5390681-2.html = IMAGE+TEXT 2793 2793 2794 // WebKit roll 55940 -> 560042795 BUG38228 : fast/events/drag-and-drop.html = TEXT2796 2797 2794 // HTMLProgressElement related tests deferred due to r55980. 2798 2795 BUG38227 DEFER : fast/dom/HTMLProgressElement/progress-element.html = MISSING -
trunk/WebKit/chromium/ChangeLog
r56580 r56603 1 2010-03-25 Tony Chang <tony@chromium.org> 2 3 Reviewed by David Levin. 4 5 [chromium] correctly handle move drag operations 6 https://bugs.webkit.org/show_bug.cgi?id=36484 7 8 * src/WebViewImpl.cpp: 9 (WebKit::WebViewImpl::dragTargetDragEnter): 10 (WebKit::WebViewImpl::dragTargetDragOver): 11 (WebKit::WebViewImpl::dragTargetDragEnterOrOver): Combine common code into a helper method 12 and properly mask against the drag effect. 13 (WebKit::WebViewImpl::createUniqueIdentifierForRequest): 14 * src/WebViewImpl.h: 15 1 16 2010-03-25 Drew Wilson <atwilson@chromium.org> 2 17 -
trunk/WebKit/chromium/src/WebViewImpl.cpp
r56502 r56603 1513 1513 m_operationsAllowed = operationsAllowed; 1514 1514 1515 DragData dragData( 1516 m_currentDragData.get(), 1517 clientPoint, 1518 screenPoint, 1519 static_cast<DragOperation>(operationsAllowed)); 1520 1521 m_dropEffect = DropEffectDefault; 1522 m_dragTargetDispatch = true; 1523 DragOperation effect = m_page->dragController()->dragEntered(&dragData); 1524 // Mask the operation against the drag source's allowed operations. 1525 if ((effect & dragData.draggingSourceOperationMask()) != effect) 1526 effect = DragOperationNone; 1527 m_dragTargetDispatch = false; 1528 1529 if (m_dropEffect != DropEffectDefault) { 1530 m_dragOperation = (m_dropEffect != DropEffectNone) ? WebDragOperationCopy 1531 : WebDragOperationNone; 1532 } else 1533 m_dragOperation = static_cast<WebDragOperation>(effect); 1534 return m_dragOperation; 1515 return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); 1535 1516 } 1536 1517 … … 1540 1521 WebDragOperationsMask operationsAllowed) 1541 1522 { 1542 ASSERT(m_currentDragData.get());1543 1544 1523 m_operationsAllowed = operationsAllowed; 1545 DragData dragData( 1546 m_currentDragData.get(), 1547 clientPoint, 1548 screenPoint, 1549 static_cast<DragOperation>(operationsAllowed)); 1550 1551 m_dropEffect = DropEffectDefault; 1552 m_dragTargetDispatch = true; 1553 DragOperation effect = m_page->dragController()->dragUpdated(&dragData); 1554 // Mask the operation against the drag source's allowed operations. 1555 if ((effect & dragData.draggingSourceOperationMask()) != effect) 1556 effect = DragOperationNone; 1557 m_dragTargetDispatch = false; 1558 1559 if (m_dropEffect != DropEffectDefault) { 1560 m_dragOperation = (m_dropEffect != DropEffectNone) ? WebDragOperationCopy 1561 : WebDragOperationNone; 1562 } else 1563 m_dragOperation = static_cast<WebDragOperation>(effect); 1564 return m_dragOperation; 1524 1525 return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragOver); 1565 1526 } 1566 1527 … … 1625 1586 } 1626 1587 1627 unsigned long WebViewImpl::createUniqueIdentifierForRequest() { 1588 WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction) 1589 { 1590 ASSERT(m_currentDragData.get()); 1591 1592 DragData dragData( 1593 m_currentDragData.get(), 1594 clientPoint, 1595 screenPoint, 1596 static_cast<DragOperation>(m_operationsAllowed)); 1597 1598 m_dropEffect = DropEffectDefault; 1599 m_dragTargetDispatch = true; 1600 DragOperation effect = dragAction == DragEnter ? m_page->dragController()->dragEntered(&dragData) 1601 : m_page->dragController()->dragUpdated(&dragData); 1602 // Mask the operation against the drag source's allowed operations. 1603 if (!(effect & dragData.draggingSourceOperationMask())) 1604 effect = DragOperationNone; 1605 m_dragTargetDispatch = false; 1606 1607 if (m_dropEffect != DropEffectDefault) { 1608 m_dragOperation = (m_dropEffect != DropEffectNone) ? WebDragOperationCopy 1609 : WebDragOperationNone; 1610 } else 1611 m_dragOperation = static_cast<WebDragOperation>(effect); 1612 1613 return m_dragOperation; 1614 } 1615 1616 unsigned long WebViewImpl::createUniqueIdentifierForRequest() 1617 { 1628 1618 if (m_page) 1629 1619 return m_page->progress()->createUniqueIdentifier(); -
trunk/WebKit/chromium/src/WebViewImpl.h
r56449 r56603 205 205 } 206 206 207 // Returns the page object associated with this view. 207 // Returns the page object associated with this view. This may be null when 208 208 // the page is shutting down, but will be valid at all other times. 209 209 WebCore::Page* page() const … … 214 214 WebCore::RenderTheme* theme() const; 215 215 216 // Returns the main frame associated with this view. 216 // Returns the main frame associated with this view. This may be null when 217 217 // the page is shutting down, but will be valid at all other times. 218 218 WebFrameImpl* mainFrameImpl(); … … 236 236 237 237 // Handles context menu events orignated via the the keyboard. These 238 // include the VK_APPS virtual key and the Shift+F10 combine. 238 // include the VK_APPS virtual key and the Shift+F10 combine. Code is 239 239 // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM 240 240 // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only … … 243 243 bool sendContextMenuEvent(const WebKeyboardEvent&); 244 244 245 // Notifies the WebView that a load has been committed. 245 // Notifies the WebView that a load has been committed. isNewNavigation 246 246 // will be true if a new session history item should be created for that 247 247 // load. … … 314 314 friend class WTF::RefCounted<WebViewImpl>; 315 315 316 enum DragAction { 317 DragEnter, 318 DragOver 319 }; 320 316 321 WebViewImpl(WebViewClient* client); 317 322 ~WebViewImpl(); … … 326 331 bool autocompleteHandleKeyEvent(const WebKeyboardEvent&); 327 332 328 // Repaints the suggestions popup. 329 // have changed. 333 // Repaints the suggestions popup. Should be called when the suggestions 334 // have changed. Note that this should only be called when the suggestions 330 335 // popup is showing. 331 336 void refreshSuggestionsPopup(); … … 340 345 // the HitTestResult for it. 341 346 WebCore::HitTestResult hitTestResultForWindowPos(const WebCore::IntPoint&); 347 348 // Consolidate some common code between starting a drag over a target and 349 // updating a drag over a target. If we're starting a drag, |isEntering| 350 // should be true. 351 WebDragOperation dragTargetDragEnterOrOver(const WebPoint& clientPoint, 352 const WebPoint& screenPoint, 353 DragAction); 342 354 343 355 #if USE(ACCELERATED_COMPOSITING) … … 361 373 OwnPtr<WebCore::Page> m_page; 362 374 363 // This flag is set when a new navigation is detected. 375 // This flag is set when a new navigation is detected. It is used to satisfy 364 376 // the corresponding argument to WebFrameClient::didCommitProvisionalLoad. 365 377 bool m_observedNewNavigation; … … 371 383 372 384 // An object that can be used to manipulate m_page->settings() without linking 373 // against WebCore. 385 // against WebCore. This is lazily allocated the first time GetWebSettings() 374 386 // is called. 375 387 OwnPtr<WebSettingsImpl> m_webSettings; … … 387 399 WebPoint m_lastMouseDownPoint; 388 400 389 // Keeps track of the current zoom level. 401 // Keeps track of the current zoom level. 0 means no zoom, positive numbers 390 402 // mean zoom in, negative numbers mean zoom out. 391 403 int m_zoomLevel; … … 417 429 int m_dragIdentity; 418 430 419 // Valid when m_dragTargetDispatch is true. 431 // Valid when m_dragTargetDispatch is true. Used to override the default 420 432 // browser drop effect with the effects "none" or "copy". 421 433 enum DragTargetDropEffect { … … 436 448 bool m_suggestionsPopupShowing; 437 449 438 // A pointer to the current suggestions popup menu client. 439 // either an AutoFillPopupMenuClient or an AutocompletePopupMenuClient. 450 // A pointer to the current suggestions popup menu client. This can be 451 // either an AutoFillPopupMenuClient or an AutocompletePopupMenuClient. We 440 452 // do not own this pointer. 441 453 SuggestionsPopupMenuClient* m_suggestionsPopupClient; … … 447 459 OwnPtr<AutocompletePopupMenuClient> m_autocompletePopupClient; 448 460 449 // A pointer to the current suggestions popup. 461 // A pointer to the current suggestions popup. We do not own this pointer. 450 462 WebCore::PopupContainer* m_suggestionsPopup; 451 463
Note: See TracChangeset
for help on using the changeset viewer.