[Webkit-unassigned] [Bug 132306] New: dataTransfer.types changes to null during execution of HTML drop event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 28 15:24:10 PDT 2014


           Summary: dataTransfer.types changes to null during execution of
                    HTML drop event
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Mac OS X 10.9
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML Events
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: webkit at owenpshaw.net

Created an attachment (id=230327)
 --> (https://bugs.webkit.org/attachment.cgi?id=230327&action=review)
simplified test code

In an HTML drop event handler function, event.dataTransfer.types is initially non-null, but then changes to null, seemingly between lines of JavaScript.

The issue is sporadic, even in the simplified test code attached.  Furthermore, I have only reproduced this when dragging and dropping data from Chrome to Safari.

The attached test code sets up bare-minimum drop handling on document.body, and on drop loops 10 times, making a note each iteration of whether event.dataTransfer.types is null or non-null, and finally prints the results on the page.

1) Load attached HTML test page in Safari
2) Open Chrome and browse to any site
3) Drag text or image from Chrome to test page in Safari
4) Repeat as necessary to observe
    a) value can start as non-null and change to null
    b) the change can occur at different places on different runs

Repeated testing is key because the results vary from run to run.  Some runs will show the value as always null, others will show the value as never null, and some runs will show a changing value.

The test code is a bit contrived, but it helps catch the issue.  The code that started my investigation was essentially the following:

if (e.dataTransfer.types === null){
for (var i = 0, l = e.dataTransfer.types.length; i < l; ++i){
>> TypeError: 'null' is not an object (evaluating 'e.dataTransfer.types.length')

Which is one line saying .types is not null and then the next line throwing an error because .types is null.

Mac 10.9.2
Safari Version: 7.0.3 (9537.75.14)  (also tested in WebKit Nightly r167883)
Chrome Version: 34.0.1847.131

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list