Changeset 49268 in webkit


Ignore:
Timestamp:
Oct 7, 2009 3:26:48 PM (15 years ago)
Author:
dbates@webkit.org
Message:

2009-10-07 Daniel Bates <dbates@webkit.org>

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=30102
And
<rdar://problem/5015957>


Fixes an issue (in the Windows build) where the cursor does not change to the
not-allowed cursor when the drag-and-drop operation is not allowed.


The allowed effects in WebDragClient::startDrag are hard-coded to be
DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOVE. Instead, the list of
allowed drop effects should be determined by the allowed operations of the
drag source.


We cannot test this using DRT because DRT looks at the programmatic drop
cursor and until bug #24731 is fixed this value is hard-coded to DragOperationCopy.
That is, there is a discrepancy in the Windows build between the Windows API-based
drop effect and the WebKit drop effect. Because DRT cannot read the screen buffer
to determine the cursor, a manual test is needed.

  • WebCoreSupport/WebDragClient.cpp: (draggingSourceOperationMaskToDragCursors): Added method. (WebDragClient::startDrag):

2009-10-07 Daniel Bates <dbates@webkit.org>

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=30102
And
<rdar://problem/5015957>


Manual test to confirm that the not-allowed cursor is shown for an
invalid drag-and-drop operation.


We cannot test this using DRT because of a discrepancy between the Windows
API-based drop effect and the WebKit drop effect. See bug #24731 for more
details.

  • manual-tests/drag-cursor-notallowed.html: Added.
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r49266 r49268  
     12009-10-07  Daniel Bates  <dbates@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=30102
     6        And
     7        <rdar://problem/5015957>
     8       
     9        Manual test to confirm that the not-allowed cursor is shown for an
     10        invalid drag-and-drop operation.
     11       
     12        We cannot test this using DRT because of a discrepancy between the Windows
     13        API-based drop effect and the WebKit drop effect. See bug #24731 for more
     14        details.
     15
     16        * manual-tests/drag-cursor-notallowed.html: Added.
     17
    1182009-10-07  Mark Rowe  <mrowe@apple.com>
    219
  • trunk/WebKit/win/ChangeLog

    r49256 r49268  
     12009-10-07  Daniel Bates  <dbates@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=30102
     6        And
     7        <rdar://problem/5015957>
     8       
     9        Fixes an issue (in the Windows build) where the cursor does not change to the
     10        not-allowed cursor when the drag-and-drop operation is not allowed.
     11       
     12        The allowed effects in WebDragClient::startDrag are hard-coded to be
     13        DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOVE. Instead, the list of
     14        allowed drop effects should be determined by the allowed operations of the
     15        drag source.
     16       
     17        We cannot test this using DRT because DRT looks at the programmatic drop
     18        cursor and until bug #24731 is fixed this value is hard-coded to DragOperationCopy.
     19        That is, there is a discrepancy in the Windows build between the Windows API-based
     20        drop effect and the WebKit drop effect. Because DRT cannot read the screen buffer
     21        to determine the cursor, a manual test is needed.
     22
     23        * WebCoreSupport/WebDragClient.cpp:
     24        (draggingSourceOperationMaskToDragCursors): Added method.
     25        (WebDragClient::startDrag):
     26
    1272009-10-07  Steve Falkenburg  <sfalken@apple.com>
    228
  • trunk/WebKit/win/WebCoreSupport/WebDragClient.cpp

    r47014 r49268  
    3434#pragma warning(push, 0)
    3535#include <WebCore/ClipboardWin.h>
     36#include <WebCore/DragController.h>
    3637#include <WebCore/DragData.h>
    3738#include <WebCore/Font.h>
     
    6869
    6970using namespace WebCore;
     71
     72static DWORD draggingSourceOperationMaskToDragCursors(DragOperation op)
     73{
     74    DWORD result = DROPEFFECT_NONE;
     75    if (op == DragOperationEvery)
     76        return DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOVE;
     77    if (op & DragOperationCopy)
     78        result |= DROPEFFECT_COPY;
     79    if (op & DragOperationLink)
     80        result |= DROPEFFECT_LINK;
     81    if (op & DragOperationMove)
     82        result |= DROPEFFECT_MOVE;
     83    if (op & DragOperationGeneric)
     84        result |= DROPEFFECT_MOVE;
     85    return result;
     86}
    7087
    7188WebDragClient::WebDragClient(WebView* webView)
     
    155172        }
    156173
    157         //FIXME: Ensure correct drag ops are available <rdar://problem/5015957>
    158         DWORD okEffect = DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOVE;
     174        DWORD okEffect = draggingSourceOperationMaskToDragCursors(m_webView->page()->dragController()->sourceDragOperation());
    159175        DWORD effect;
    160176        COMPtr<IWebUIDelegate> ui;
Note: See TracChangeset for help on using the changeset viewer.