Title: [201230] branches/safari-602.1.32-branch

Diff

Modified: branches/safari-602.1.32-branch/LayoutTests/ChangeLog (201229 => 201230)


--- branches/safari-602.1.32-branch/LayoutTests/ChangeLog	2016-05-20 22:28:40 UTC (rev 201229)
+++ branches/safari-602.1.32-branch/LayoutTests/ChangeLog	2016-05-20 22:31:34 UTC (rev 201230)
@@ -1,3 +1,20 @@
+2016-05-20  Babak Shafiei  <[email protected]>
+
+        Merge r201227. rdar://problem/24577706
+
+    2016-05-20  Enrica Casucci  <[email protected]>
+
+            Drag cannot start if no drag data or custom data is available in the Pasteboard.
+            https://bugs.webkit.org/show_bug.cgi?id=157911
+            rdar://problem/24577706
+
+            Reviewed by Tim Horton.
+
+            * fast/events/draggable-div-customdata-expected.txt: Added.
+            * fast/events/draggable-div-customdata.html: Added.
+            * platform/ios-simulator/TestExpectations
+            * platform/mac-wk2/TestExpectations
+
 2016-05-19  Babak Shafiei  <[email protected]>
 
         Merge r201187. rdar://problem/25314776

Added: branches/safari-602.1.32-branch/LayoutTests/fast/events/draggable-div-customdata-expected.txt (0 => 201230)


--- branches/safari-602.1.32-branch/LayoutTests/fast/events/draggable-div-customdata-expected.txt	                        (rev 0)
+++ branches/safari-602.1.32-branch/LayoutTests/fast/events/draggable-div-customdata-expected.txt	2016-05-20 22:31:34 UTC (rev 201230)
@@ -0,0 +1,9 @@
+This test checks that we drag a draggable element without setting data to transfer
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS TEST PASSED: square dropped
+
+TEST COMPLETE
+

Added: branches/safari-602.1.32-branch/LayoutTests/fast/events/draggable-div-customdata.html (0 => 201230)


--- branches/safari-602.1.32-branch/LayoutTests/fast/events/draggable-div-customdata.html	                        (rev 0)
+++ branches/safari-602.1.32-branch/LayoutTests/fast/events/draggable-div-customdata.html	2016-05-20 22:31:34 UTC (rev 201230)
@@ -0,0 +1,89 @@
+<html>
+<head>
+<script src=""
+<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 consoleElm;
+    var event;
+
+    window._onload_ = function()
+    {
+        dragMe = document.getElementById("dragMe");
+        dropTarget = document.getElementById("dropTarget");
+        consoleElm = document.getElementById("console");
+
+        if (!dragMe || !dropTarget || !consoleElm)
+            return;
+
+        dragMe._onstart_ = dragStart;
+        dropTarget._ondragover_ = dragOver;
+        dropTarget._ondrop_ = drop;
+
+        runTest();
+    }
+
+    function dragStart(event)
+    {
+        event.dataTransfer.items.add('hello world', 'custom-data');
+    }
+
+    function drop(event)
+    {
+        testPassed("TEST PASSED: square dropped");
+        event.preventDefault();
+        dragMe.parentNode.removeChild(dragMe);
+        event.target.appendChild(dragMe);
+    }
+
+    function dragOver(event)
+    {
+        event.preventDefault();
+    }
+
+    function runTest()
+    {
+        if (!window.eventSender)
+            return;
+
+        if (window.testRunner)
+            testRunner.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;
+
+        eventSender.mouseMoveTo(startX, startY);
+        eventSender.mouseDown();
+        eventSender.leapForward(1000);
+        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">
+        <div id="dropTarget">Drop the red square onto me.</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 we drag a draggable element without setting data to transfer");
+    </script>
+</body>
+</html>

Modified: branches/safari-602.1.32-branch/LayoutTests/platform/ios-simulator/TestExpectations (201229 => 201230)


--- branches/safari-602.1.32-branch/LayoutTests/platform/ios-simulator/TestExpectations	2016-05-20 22:28:40 UTC (rev 201229)
+++ branches/safari-602.1.32-branch/LayoutTests/platform/ios-simulator/TestExpectations	2016-05-20 22:31:34 UTC (rev 201230)
@@ -204,6 +204,7 @@
 fast/events/drag-selects-image.html
 fast/events/drag-to-navigate.html
 fast/events/draggable-div-nodata.html
+fast/events/draggable-div-customdata.html
 fast/events/drop-handler-should-not-stop-navigate.html
 fast/events/drop-with-file-paths.html
 fast/events/dropzone-001.html

Modified: branches/safari-602.1.32-branch/LayoutTests/platform/mac-wk2/TestExpectations (201229 => 201230)


--- branches/safari-602.1.32-branch/LayoutTests/platform/mac-wk2/TestExpectations	2016-05-20 22:28:40 UTC (rev 201229)
+++ branches/safari-602.1.32-branch/LayoutTests/platform/mac-wk2/TestExpectations	2016-05-20 22:31:34 UTC (rev 201230)
@@ -96,6 +96,7 @@
 fast/events/drag-in-frames.html
 fast/events/drag-parent-node.html
 fast/events/draggable-div-nodata.html
+fast/events/draggable-div-customdata.html
 fast/events/dropzone-001.html
 fast/events/dropzone-002.html
 fast/events/dropzone-003.html

Modified: branches/safari-602.1.32-branch/Source/WebKit/mac/ChangeLog (201229 => 201230)


--- branches/safari-602.1.32-branch/Source/WebKit/mac/ChangeLog	2016-05-20 22:28:40 UTC (rev 201229)
+++ branches/safari-602.1.32-branch/Source/WebKit/mac/ChangeLog	2016-05-20 22:31:34 UTC (rev 201230)
@@ -1,3 +1,21 @@
+2016-05-20  Babak Shafiei  <[email protected]>
+
+        Merge r201227. rdar://problem/24577706
+
+    2016-05-20  Enrica Casucci  <[email protected]>
+
+            Drag cannot start if no drag data or custom data is available in the Pasteboard.
+            https://bugs.webkit.org/show_bug.cgi?id=157911
+            rdar://problem/24577706
+
+            Reviewed by Tim Horton.
+
+            We need to make sure there is always one item in common between source and target
+            of the drag and drop operation.
+
+            * WebView/WebHTMLView.mm:
+            (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]):
+
 2016-05-19  Babak Shafiei  <[email protected]>
 
         Merge r201187. rdar://problem/25314776

Modified: branches/safari-602.1.32-branch/Source/WebKit/mac/WebView/WebHTMLView.mm (201229 => 201230)


--- branches/safari-602.1.32-branch/Source/WebKit/mac/WebView/WebHTMLView.mm	2016-05-20 22:28:40 UTC (rev 201229)
+++ branches/safari-602.1.32-branch/Source/WebKit/mac/WebView/WebHTMLView.mm	2016-05-20 22:31:34 UTC (rev 201230)
@@ -4576,8 +4576,7 @@
         slideBack:(BOOL)slideBack
 {
     ASSERT(self == [self _topHTMLView]);
-    if (![[pasteboard types] count])
-        [pasteboard setString:@"" forType:[WebHTMLView _dummyPasteboardType]];
+    [pasteboard setString:@"" forType:[WebHTMLView _dummyPasteboardType]];
 
     [super dragImage:dragImage at:at offset:offset event:event pasteboard:pasteboard source:source slideBack:slideBack];
 }

Modified: branches/safari-602.1.32-branch/Source/WebKit2/ChangeLog (201229 => 201230)


--- branches/safari-602.1.32-branch/Source/WebKit2/ChangeLog	2016-05-20 22:28:40 UTC (rev 201229)
+++ branches/safari-602.1.32-branch/Source/WebKit2/ChangeLog	2016-05-20 22:31:34 UTC (rev 201230)
@@ -1,3 +1,21 @@
+2016-05-20  Babak Shafiei  <[email protected]>
+
+        Merge r201227. rdar://problem/24577706
+
+    2016-05-20  Enrica Casucci  <[email protected]>
+
+            Drag cannot start if no drag data or custom data is available in the Pasteboard.
+            https://bugs.webkit.org/show_bug.cgi?id=157911
+            rdar://problem/24577706
+
+            Reviewed by Tim Horton.
+
+            We need to make sure there is always one item in common between source and target
+            of the drag and drop operation.
+
+            * UIProcess/Cocoa/WebViewImpl.mm:
+            (WebKit::WebViewImpl::dragImageForView):
+
 2016-05-19  Babak Shafiei  <[email protected]>
 
         Merge r201187. rdar://problem/25314776

Modified: branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (201229 => 201230)


--- branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2016-05-20 22:28:40 UTC (rev 201229)
+++ branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2016-05-20 22:31:34 UTC (rev 201230)
@@ -2931,8 +2931,7 @@
     // The call below could release the view.
     RetainPtr<NSView> protector(m_view);
     NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
-    if (![[pasteboard types] count])
-        [pasteboard setString:@"" forType:PasteboardTypes::WebDummyPboardType];
+    [pasteboard setString:@"" forType:PasteboardTypes::WebDummyPboardType];
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
     [view dragImage:image
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to