Changeset 237986 in webkit


Ignore:
Timestamp:
Nov 8, 2018 7:36:05 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
https://bugs.webkit.org/show_bug.cgi?id=191228
<rdar://problem/45786830>

Patch by Jonathan Hammer <jonathan@e3software.com> on 2018-11-08
Reviewed by Wenson Hsieh.

Source/WebCore:

DragController::beginDrag should not call cleanupAfterSystemDrag because
the drag is still in progress even after the call to m_client.beginDrag()
returns. This is in contrast to DragController::doSystemDrag, where the
call to cleanupAfterSystemDrag is appropriate because the drag has
concluded by the time m_client.startDrag() returns.

Test: fast/events/drag-and-drop-move-not-copy.html

  • page/DragController.cpp:

(WebCore::DragController::beginDrag):

LayoutTests:

A test that checks that dragging plain text in a contenteditable element results
in the text being moved and not copied. Only applies to WK1. Test skipped on
WK2 because WK2 EventSender does not support drag events. Test also skipped on
AppleWin because drag and drop doesn't work correctly in DRT (according to the
TestExpectations file).

  • fast/events/drag-and-drop-move-not-copy-expected.txt: Added.
  • fast/events/drag-and-drop-move-not-copy.html: Added.
  • platform/win/TestExpectations:
  • platform/wk2/TestExpectations:
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r237984 r237986  
     12018-11-08  Jonathan Hammer  <jonathan@e3software.com>
     2
     3        Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
     4        https://bugs.webkit.org/show_bug.cgi?id=191228
     5        <rdar://problem/45786830>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        A test that checks that dragging plain text in a contenteditable element results
     10        in the text being moved and not copied. Only applies to WK1. Test skipped on
     11        WK2 because WK2 EventSender does not support drag events. Test also skipped on
     12        AppleWin because drag and drop doesn't work correctly in DRT (according to the
     13        TestExpectations file).
     14
     15        * fast/events/drag-and-drop-move-not-copy-expected.txt: Added.
     16        * fast/events/drag-and-drop-move-not-copy.html: Added.
     17        * platform/win/TestExpectations:
     18        * platform/wk2/TestExpectations:
     19
    1202018-11-08  Alicia Boya García  <aboya@igalia.com>
    221
  • trunk/LayoutTests/platform/win/TestExpectations

    r237932 r237986  
    174174fast/events/standalone-image-drag-to-editable.html [ Skip ]
    175175fast/events/drag-and-drop-autoscroll-inner-frame.html [ Skip ]
     176fast/events/drag-and-drop-move-not-copy.html [ Skip ]
    176177http/tests/security/clipboard/clipboard-file-access.html [ Skip ]
    177178http/tests/security/drag-drop-same-unique-origin.html [ Skip ]
  • trunk/LayoutTests/platform/wk2/TestExpectations

    r237811 r237986  
    177177# eventSender.dragMode is unimplemented in WKTR
    178178# Mac: https://bugs.webkit.org/show_bug.cgi?id=68552
     179fast/events/drag-and-drop-move-not-copy.html
    179180fast/events/controlclick-no-onclick.html
    180181fast/events/moving-text-should-fire-drop-and-dragend-events.html
  • trunk/Source/WebCore/ChangeLog

    r237985 r237986  
     12018-11-08  Jonathan Hammer  <jonathan@e3software.com>
     2
     3        Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
     4        https://bugs.webkit.org/show_bug.cgi?id=191228
     5        <rdar://problem/45786830>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        DragController::beginDrag should not call cleanupAfterSystemDrag because
     10        the drag is still in progress even after the call to m_client.beginDrag()
     11        returns. This is in contrast to DragController::doSystemDrag, where the
     12        call to cleanupAfterSystemDrag is appropriate because the drag has
     13        concluded by the time m_client.startDrag() returns.
     14
     15        Test: fast/events/drag-and-drop-move-not-copy.html
     16
     17        * page/DragController.cpp:
     18        (WebCore::DragController::beginDrag):
     19
    1202018-11-08  Zalan Bujtas  <zalan@apple.com>
    221
  • trunk/Source/WebCore/page/DragController.cpp

    r237266 r237986  
    12541254
    12551255    m_client.beginDrag(WTFMove(dragItem), frame, mouseDownPointInRootViewCoordinates, mouseDraggedPointInRootViewCoordinates, dataTransfer, dragSourceAction);
    1256 
    1257     // DragClient::beginDrag can cause the drag controller to be deleted.
    1258     if (!mainFrameProtector->page())
    1259         return;
    1260 
    1261     // FIXME: This shouldn't be needed.
    1262     cleanupAfterSystemDrag();
    12631256}
    12641257
Note: See TracChangeset for help on using the changeset viewer.