Changeset 53203 in webkit


Ignore:
Timestamp:
Jan 13, 2010 1:59:28 PM (14 years ago)
Author:
bweinstein@apple.com
Message:

WebCore: REGRESSION (r49268): DHTML drag not allowed unless event.dataTransfer.effectAllowed
is set (differs from HTML5).
Fixes <https://bugs.webkit.org/show_bug.cgi?id=33607> and <rdar://7507114>.

Reviewed by Adam Roben.

If no effectAllowed is set in the dragStart operation, we should default to
uninitialized instead of none, so the user doesn't have to manually set the
effectAllowed to enable drag and drop.

  • dom/Clipboard.cpp:

(WebCore::Clipboard::Clipboard):

LayoutTests: REGRESSION (r49268): DHTML drag not allowed unless event.dataTransfer.effectAllowed
is set (differs from HTML5).
Fixes <https://bugs.webkit.org/show_bug.cgi?id=33607> and <rdar://7507114>.

Reviewed by Adam Roben.

Updated the drag and drop test to test if effectAllowed isn't set, in addition
to its other tests.

  • fast/events/drag-and-drop-expected.txt:
  • fast/events/drag-and-drop.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r53201 r53203  
     12010-01-13  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        REGRESSION (r49268): DHTML drag not allowed unless event.dataTransfer.effectAllowed
     6        is set (differs from HTML5).
     7        Fixes <https://bugs.webkit.org/show_bug.cgi?id=33607> and <rdar://7507114>.
     8       
     9        Updated the drag and drop test to test if effectAllowed isn't set, in addition
     10        to its other tests.
     11
     12        * fast/events/drag-and-drop-expected.txt:
     13        * fast/events/drag-and-drop.html:
     14
    1152010-01-13  Dirk Schulze  <krit@webkit.org>
    216
  • trunk/LayoutTests/fast/events/drag-and-drop-expected.txt

    r50888 r53203  
    1212PASS event.dataTransfer.dropEffect is "move"
    1313PASS event.dataTransfer.dropEffect is "link"
     14PASS event.dataTransfer.dropEffect is "none"
     15
     16When effectAllowed == "undefined"
     17
     18PASS event.dataTransfer.effectAllowed is "uninitialized"
     19PASS event.dataTransfer.dropEffect is "none"
     20PASS event.dataTransfer.effectAllowed is "uninitialized"
     21PASS event.dataTransfer.dropEffect is "copy"
     22PASS event.dataTransfer.effectAllowed is "uninitialized"
     23PASS event.dataTransfer.dropEffect is "move"
     24PASS event.dataTransfer.effectAllowed is "uninitialized"
     25PASS event.dataTransfer.dropEffect is "link"
     26PASS event.dataTransfer.effectAllowed is "uninitialized"
    1427PASS event.dataTransfer.dropEffect is "none"
    1528
  • trunk/LayoutTests/fast/events/drag-and-drop.html

    r50888 r53203  
    4040    {
    4141        event = e;
    42         e.dataTransfer.effectAllowed = effectAllowedElem.options[effectAllowedElem.selectedIndex].value;
     42        if (effectAllowedElem.options[effectAllowedElem.selectedIndex].value != "undefined")
     43            e.dataTransfer.effectAllowed = effectAllowedElem.options[effectAllowedElem.selectedIndex].value;
     44
    4345        e.dataTransfer.setData('Text', e.target.textContent);
    4446    }
     
    8890        var chosenEffectAllowed = effectAllowedElem.options[effectAllowedElem.selectedIndex].value;
    8991        var actualDropEffect = e.dataTransfer.dropEffect;
     92       
     93        if (chosenEffectAllowed === "undefined") {
     94            // If no effectAllowed is set, we should default to uninitialized. Make sure that's the case.
     95            shouldBeEqualToString("event.dataTransfer.effectAllowed", "uninitialized");
     96           
     97            // Then set the chosenEffectAllowed so isDropEffectAllowed matches the HTML5 spec, and
     98            // doesn't need special cases for undefined.
     99            chosenEffectAllowed = "uninitialized";
     100        }
    90101       
    91102        if (isDropEffectAllowed(chosenDropEffect, chosenEffectAllowed))
     
    149160        <label for="effectAllowed">effectAllowed</label> <select id="effectAllowed">
    150161            <option value="uninitialized">Uninitialized</option>
     162            <option value="undefined">Undefined</option>
    151163            <option value="none">None</option>
    152164            <option value="all">All</option>
  • trunk/WebCore/ChangeLog

    r53200 r53203  
     12010-01-13  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        REGRESSION (r49268): DHTML drag not allowed unless event.dataTransfer.effectAllowed
     6        is set (differs from HTML5).
     7        Fixes <https://bugs.webkit.org/show_bug.cgi?id=33607> and <rdar://7507114>.
     8
     9        If no effectAllowed is set in the dragStart operation, we should default to
     10        uninitialized instead of none, so the user doesn't have to manually set the
     11        effectAllowed to enable drag and drop.
     12
     13        * dom/Clipboard.cpp:
     14        (WebCore::Clipboard::Clipboard):
     15
    1162010-01-13  Dave Hyatt  <hyatt@apple.com>
    217
  • trunk/WebCore/dom/Clipboard.cpp

    r50888 r53203  
    3737Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging)
    3838    : m_policy(policy)
     39    , m_effectAllowed("uninitialized")
    3940    , m_dragStarted(false)
    4041    , m_forDragging(isForDragging)
Note: See TracChangeset for help on using the changeset viewer.