Changeset 56603 in webkit


Ignore:
Timestamp:
Mar 25, 2010 10:48:28 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-25 Tony Chang <tony@chromium.org>

Reviewed by David Levin.

[chromium] correctly handle move drag operations
https://bugs.webkit.org/show_bug.cgi?id=36484

  • platform/chromium/test_expectations.txt:

2010-03-25 Tony Chang <tony@chromium.org>

Reviewed by David Levin.

[chromium] correctly handle move drag operations
https://bugs.webkit.org/show_bug.cgi?id=36484

  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::dragTargetDragEnter): (WebKit::WebViewImpl::dragTargetDragOver): (WebKit::WebViewImpl::dragTargetDragEnterOrOver): Combine common code into a helper method

and properly mask against the drag effect.

(WebKit::WebViewImpl::createUniqueIdentifierForRequest):

  • src/WebViewImpl.h:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r56598 r56603  
     12010-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
    1102010-03-25  Ojan Vafai  <ojan@chromium.org>
    211
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r56598 r56603  
    27922792BUG38376 WIN : editing/deleting/5390681-2.html = IMAGE+TEXT
    27932793
    2794 // WebKit roll 55940 -> 56004
    2795 BUG38228 : fast/events/drag-and-drop.html = TEXT
    2796 
    27972794// HTMLProgressElement related tests deferred due to r55980.
    27982795BUG38227 DEFER : fast/dom/HTMLProgressElement/progress-element.html = MISSING
  • trunk/WebKit/chromium/ChangeLog

    r56580 r56603  
     12010-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
    1162010-03-25  Drew Wilson  <atwilson@chromium.org>
    217
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r56502 r56603  
    15131513    m_operationsAllowed = operationsAllowed;
    15141514
    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);
    15351516}
    15361517
     
    15401521    WebDragOperationsMask operationsAllowed)
    15411522{
    1542     ASSERT(m_currentDragData.get());
    1543 
    15441523    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);
    15651526}
    15661527
     
    16251586}
    16261587
    1627 unsigned long WebViewImpl::createUniqueIdentifierForRequest() {
     1588WebDragOperation 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
     1616unsigned long WebViewImpl::createUniqueIdentifierForRequest()
     1617{
    16281618    if (m_page)
    16291619        return m_page->progress()->createUniqueIdentifier();
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r56449 r56603  
    205205    }
    206206
    207     // Returns the page object associated with this view.  This may be null when
     207    // Returns the page object associated with this view. This may be null when
    208208    // the page is shutting down, but will be valid at all other times.
    209209    WebCore::Page* page() const
     
    214214    WebCore::RenderTheme* theme() const;
    215215
    216     // Returns the main frame associated with this view.  This may be null when
     216    // Returns the main frame associated with this view. This may be null when
    217217    // the page is shutting down, but will be valid at all other times.
    218218    WebFrameImpl* mainFrameImpl();
     
    236236
    237237    // Handles context menu events orignated via the the keyboard. These
    238     // include the VK_APPS virtual key and the Shift+F10 combine.  Code is
     238    // include the VK_APPS virtual key and the Shift+F10 combine. Code is
    239239    // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM
    240240    // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only
     
    243243    bool sendContextMenuEvent(const WebKeyboardEvent&);
    244244
    245     // Notifies the WebView that a load has been committed.  isNewNavigation
     245    // Notifies the WebView that a load has been committed. isNewNavigation
    246246    // will be true if a new session history item should be created for that
    247247    // load.
     
    314314    friend class WTF::RefCounted<WebViewImpl>;
    315315
     316    enum DragAction {
     317      DragEnter,
     318      DragOver
     319    };
     320
    316321    WebViewImpl(WebViewClient* client);
    317322    ~WebViewImpl();
     
    326331    bool autocompleteHandleKeyEvent(const WebKeyboardEvent&);
    327332
    328     // Repaints the suggestions popup.  Should be called when the suggestions
    329     // have changed.  Note that this should only be called when the suggestions
     333    // Repaints the suggestions popup. Should be called when the suggestions
     334    // have changed. Note that this should only be called when the suggestions
    330335    // popup is showing.
    331336    void refreshSuggestionsPopup();
     
    340345    // the HitTestResult for it.
    341346    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);
    342354
    343355#if USE(ACCELERATED_COMPOSITING)
     
    361373    OwnPtr<WebCore::Page> m_page;
    362374
    363     // This flag is set when a new navigation is detected.  It is used to satisfy
     375    // This flag is set when a new navigation is detected. It is used to satisfy
    364376    // the corresponding argument to WebFrameClient::didCommitProvisionalLoad.
    365377    bool m_observedNewNavigation;
     
    371383
    372384    // An object that can be used to manipulate m_page->settings() without linking
    373     // against WebCore.  This is lazily allocated the first time GetWebSettings()
     385    // against WebCore. This is lazily allocated the first time GetWebSettings()
    374386    // is called.
    375387    OwnPtr<WebSettingsImpl> m_webSettings;
     
    387399    WebPoint m_lastMouseDownPoint;
    388400
    389     // Keeps track of the current zoom level.  0 means no zoom, positive numbers
     401    // Keeps track of the current zoom level. 0 means no zoom, positive numbers
    390402    // mean zoom in, negative numbers mean zoom out.
    391403    int m_zoomLevel;
     
    417429    int m_dragIdentity;
    418430
    419     // Valid when m_dragTargetDispatch is true.  Used to override the default
     431    // Valid when m_dragTargetDispatch is true. Used to override the default
    420432    // browser drop effect with the effects "none" or "copy".
    421433    enum DragTargetDropEffect {
     
    436448    bool m_suggestionsPopupShowing;
    437449
    438     // A pointer to the current suggestions popup menu client.  This can be
    439     // either an AutoFillPopupMenuClient or an AutocompletePopupMenuClient.  We
     450    // A pointer to the current suggestions popup menu client. This can be
     451    // either an AutoFillPopupMenuClient or an AutocompletePopupMenuClient. We
    440452    // do not own this pointer.
    441453    SuggestionsPopupMenuClient* m_suggestionsPopupClient;
     
    447459    OwnPtr<AutocompletePopupMenuClient> m_autocompletePopupClient;
    448460
    449     // A pointer to the current suggestions popup.  We do not own this pointer.
     461    // A pointer to the current suggestions popup. We do not own this pointer.
    450462    WebCore::PopupContainer* m_suggestionsPopup;
    451463
Note: See TracChangeset for help on using the changeset viewer.