[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

dbates at webkit.org dbates at webkit.org
Thu Oct 29 20:40:31 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 546fc4d4d4967c05b689702229a821cc6eb32d98
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 6 19:14:39 2009 +0000

    2009-10-06  Daniel Bates  <dbates at webkit.org>
    
            Reviewed by Eric Seidel.
    
            https://bugs.webkit.org/show_bug.cgi?id=30107
    
            Fixes an issue where the Mac build does return the correct drop effect
            with respect to the HTML 5 specification when effectAllowed == "none".
    
            Currently, when effectAllowed == "none" and dropEffect == "copy" or
            dropEffect == "move" the resulting drop effect is "copy" and "move",
            respectively. However, the HTML 5 specification states that regardless
            of the specified dropEffect, when effectAllowed == "none" the resulting
            drop effect should be "none".
    
            * WebView/WebHTMLView.mm:
            (-[WebHTMLView draggingSourceOperationMaskForLocal:]):
    2009-10-06  Daniel Bates  <dbates at webkit.org>
    
            Reviewed by Eric Seidel.
    
            https://bugs.webkit.org/show_bug.cgi?id=30107
    
            Tests that drag-and-drop returns dropEffect = "none" when
            effectAllowed == "none", regardless of the user-specified
            drop effect.
    
            * fast/events/drag-and-drop-none-expected.txt: Added.
            * fast/events/drag-and-drop-none.html: Added.
            * platform/win/Skipped: This test does not work under
            Windows. We need the fix for bug #24731.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49203 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 16e2c0b..f9565f4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-06  Daniel Bates  <dbates at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30107
+        
+        Tests that drag-and-drop returns dropEffect = "none" when 
+        effectAllowed == "none", regardless of the user-specified
+        drop effect.
+
+        * fast/events/drag-and-drop-none-expected.txt: Added.
+        * fast/events/drag-and-drop-none.html: Added.
+        * platform/win/Skipped: This test does not work under 
+        Windows. We need the fix for bug #24731.
+
 2009-10-06  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/events/drag-and-drop-none-expected.txt b/LayoutTests/fast/events/drag-and-drop-none-expected.txt
new file mode 100644
index 0000000..a4c7856
--- /dev/null
+++ b/LayoutTests/fast/events/drag-and-drop-none-expected.txt
@@ -0,0 +1,14 @@
+This test checks that drag-and-drop support works and conforms to the HTML 5 specification when effectAllowed = none.
+This test iterates through the possible dropEffects: none, copy, move, link, dummy.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS event.dataTransfer.dropEffect is dropEffectElem.options[dropEffectElem.selectedIndex].value
+PASS event.dataTransfer.dropEffect is "none"
+PASS event.dataTransfer.dropEffect is "none"
+PASS event.dataTransfer.dropEffect is "none"
+PASS event.dataTransfer.dropEffect is "none"
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/drag-and-drop-none.html b/LayoutTests/fast/events/drag-and-drop-none.html
new file mode 100644
index 0000000..3892e6d
--- /dev/null
+++ b/LayoutTests/fast/events/drag-and-drop-none.html
@@ -0,0 +1,168 @@
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+<style>
+#dropTarget, #dragMe { text-align: center; display: table-cell; vertical-align: middle }
+#dropTarget {width: 256px; height: 256px; border: 1px dashed}
+#dragMe {-webkit-user-drag: element; -webkit-user-select: none; background: #ff0000; width: 64px; height: 64px; color: white}
+</style>
+<script>
+    var dragMe;
+    var dropTarget;
+    var dropEffectElem;
+    var consoleElm;
+    var event;
+    
+    var ALLOWED_EFFECTS = 'none';
+    
+    window.onload = function()
+    {
+        dragMe = document.getElementById("dragMe");
+        dropTarget = document.getElementById("dropTarget");
+        dropEffectElem = document.getElementById("dropEffect");
+        consoleElm = document.getElementById("console");
+        
+        if (!dragMe || !dropTarget || !dropEffectElem || !consoleElm)
+            return;
+        
+        dragMe.ondragstart = dragStart;
+        dragMe.ondragend = dragEnd;
+        
+        dropTarget.ondragenter = dragEntered;
+        dropTarget.ondragover = dragOver;
+        dropTarget.ondrop = drop;
+        
+        runTest();
+    }
+    
+    function dragStart(e)
+    {
+        event = e;
+        e.dataTransfer.effectAllowed = ALLOWED_EFFECTS;
+        e.dataTransfer.setData('Text', e.target.textContent);
+    }
+    
+    function dragEnd(e)
+    {
+        checkDragState(e);
+        return;
+    }
+    
+    function dragEntered(e)
+    {
+        dragEnteredAndUpdated(e);
+    }
+    
+    function dragOver(e)
+    {
+        dragEnteredAndUpdated(e);
+    }
+    
+    function dragEnteredAndUpdated(e)
+    {
+        event = e;
+        e.dataTransfer.dropEffect = dropEffectElem.options[dropEffectElem.selectedIndex].value;
+        cancelDrag(e);
+    }
+    
+    function drop(e)
+    {
+        cancelDrag(e);
+    }
+    
+    function cancelDrag(e)
+    {
+        if (e.preventDefault)
+            e.preventDefault();
+        else {
+            // Assume this script is executing within Internet Explorer
+            e.returnValue = false;
+        }
+    }
+    
+    function checkDragState(e)
+    {
+        event = e;
+        var chosenDropEffect = dropEffectElem.options[dropEffectElem.selectedIndex].value;
+        var chosenEffectAllowed = ALLOWED_EFFECTS;
+        var actualDropEffect = e.dataTransfer.dropEffect;
+        
+        if (isDropEffectAllowed(chosenDropEffect, chosenEffectAllowed))
+            shouldEvaluateTo('event.dataTransfer.dropEffect', 'dropEffectElem.options[dropEffectElem.selectedIndex].value');
+        else
+            shouldBeEqualToString('event.dataTransfer.dropEffect', 'none');
+            
+    }
+    
+    function isDropEffectAllowed(chosenDropEffect, allowedDropEffect) {
+        // Extracted from the HTML 5 drag-and-drop section, http://dev.w3.org/html5/spec/Overview.html#dnd
+        if (chosenDropEffect == "none")
+            return true;
+        if (chosenDropEffect == "copy" && ["copy", "copyLink", "copyMove", "uninitialized", "all"].indexOf(allowedDropEffect) != -1)
+            return true;
+        if (chosenDropEffect == "move" && ["move", "copyMove", "linkMove", "uninitialized", "all"].indexOf(allowedDropEffect) != -1)
+            return true;
+        if (chosenDropEffect == "link" && ["link", "copyLink", "linkMove", "uninitialized", "all"].indexOf(allowedDropEffect) != -1)
+            return true;
+        return false;
+    }
+
+    function runTest()
+    {
+        if (!window.eventSender)
+            return;
+            
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+            
+        var startX = dragMe.offsetLeft + 10;
+        var startY = dragMe.offsetTop + dragMe.offsetHeight / 2;
+        var endX = dropTarget.offsetLeft + 10;
+        var endY = dropTarget.offsetTop + dropTarget.offsetHeight / 2;
+        
+        var numEffects = dropEffectElem.options.length;
+        
+        for (var j = 0; j < numEffects; ++j) {
+            dropEffectElem.options[j].selected = true;
+            eventSender.mouseMoveTo(startX, startY);
+            eventSender.mouseDown();
+            eventSender.leapForward(100);
+            eventSender.mouseMoveTo(endX, endY);
+            eventSender.mouseUp();
+        }
+        var testContainer = document.getElementById("test-container");
+        if (testContainer)
+            document.body.removeChild(testContainer);
+        debug('<br /><span class="pass">TEST COMPLETE</span>');
+    }
+</script>
+</head>
+<body>
+    <p id="description"></p>
+    <div id="test-container">
+        <label for="effectAllowed">effectAllowed:</label> <code><script>document.write(ALLOWED_EFFECTS)</script></code>
+        <br/><br/>
+        <div id="dropTarget">Drop the red square onto me.<br/><br/>
+            <label for="dropEffect">Expects dropEffect</label> <select id="dropEffect">
+                <option value="none">None</option>
+                <option value="copy">Copy</option>
+                <option value="move">Move</option>
+                <option value="link">Link</option>
+                <option value="dummy">Nonexistent (Dummy) Effect</option>
+            </select>
+        </div>
+        <hr/>
+        <p>Items that can be dragged to the drop target:</p>
+        <div id="dragMe" draggable="true">Square</div>
+        <hr/>
+    </div>
+    <div id="console"></div>
+    <script>
+        description("This test checks that drag-and-drop support works and conforms to the HTML 5 specification when " +
+                    "effectAllowed = <code>none</code>.<br/>" +
+                    "This test iterates through the possible dropEffects: none, copy, move, link, dummy.");
+        var successfullyParsed = true;
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 4032be8..0674d3e 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -105,6 +105,9 @@ editing/selection/drag-in-iframe.html
 fast/events/drag-in-frames.html
 fast/events/standalone-image-drag-to-editable.html
 
+# Windows drag-and-drop does not work correctly (https://bugs.webkit.org/show_bug.cgi?id=24731)
+fast/events/drag-and-drop-none.html
+
 # <rdar://problem/5643675> window.scrollTo scrolls a window with no scrollbars
 fast/events/attempt-scroll-with-no-scrollbars.html
 
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 937ee8c..59d232a 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,21 @@
+2009-10-06  Daniel Bates  <dbates at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30107
+        
+        Fixes an issue where the Mac build does return the correct drop effect
+        with respect to the HTML 5 specification when effectAllowed == "none".
+        
+        Currently, when effectAllowed == "none" and dropEffect == "copy" or 
+        dropEffect == "move" the resulting drop effect is "copy" and "move",
+        respectively. However, the HTML 5 specification states that regardless
+        of the specified dropEffect, when effectAllowed == "none" the resulting
+        drop effect should be "none".
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView draggingSourceOperationMaskForLocal:]):
+
 2009-10-06  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index d24f1a9..2ed0ba8 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -3425,10 +3425,6 @@ done:
     if (!page)
         return NSDragOperationNone;
 
-    // FIXME: Why do we override the source provided operation here?  Why not in DragController::startDrag
-    if (page->dragController()->sourceDragOperation() == DragOperationNone)
-        return NSDragOperationGeneric | NSDragOperationCopy;
-
     return (NSDragOperation)page->dragController()->sourceDragOperation();
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list