Skip to content
  • dcheng@chromium.org's avatar
    dragover's default action should prevent drop for file drags · 98fbabba
    dcheng@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=79173
    
    Reviewed by Tony Chang.
    
    Source/WebCore:
    
    During a file drag, we need to keep track of whether or not the document has cancelled the
    dragover action. We should only send a drop event if the dragover event was cancelled; this
    matches the behavior of the spec, as well as IE, Gecko, and Opera. The relevant sections
    from the spec are the sections pertaining to dragover and drop events at:
    http://www.whatwg.org/specs/web-apps/current-work/#drag-and-drop-processing-model
    
    Test: fast/events/only-valid-drop-targets-receive-file-drop.html
    
    * page/DragController.cpp:
    (WebCore::DragController::performDrag):
    (WebCore::DragController::dragEnteredOrUpdated):
    (WebCore::DragController::tryDocumentDrag):
    * page/DragController.h:
    (DragController): Cleanup to repurpose a variable that doesn't need to be a member anymore
                      and remove the corresponding getter/setter.
    
    LayoutTests:
    
    * fast/dom/shadow/drop-event-in-shadow.html:
        Added dragover handler as required by the HTML specification.
    * fast/events/input-element-display-none-in-dragleave-crash.html:
        Added dragover handler as required by the HTML specification.
    * fast/events/only-valid-drop-targets-receive-file-drop-expected.txt: Added.
    * fast/events/only-valid-drop-targets-receive-file-drop.html: Added.
    * http/tests/security/clipboard/clipboard-file-access.html:
        Added dragover handler as required by the HTML specification.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    98fbabba