[Webkit-unassigned] [Bug 58210] webkit should implement the dropzone attribute

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 26 17:47:46 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=58210





--- Comment #10 from Daniel Cheng <dcheng at chromium.org>  2011-04-26 17:47:45 PST ---
(From update of attachment 91167)
View in context: https://bugs.webkit.org/attachment.cgi?id=91167&action=review

> Source/WebCore/dom/Clipboard.cpp:164
> +    String platformType = platformTypeForHTMLType(type);

Maybe you can just convert the type to lowercase and avoid having to call equalIgnoringCase.

"The drag data item type string
A Unicode string giving the type or format of the data, generally given by a MIME type. Some values that are not MIME types are special-cased for legacy reasons. The API does not enforce the use of MIME types; other values can be used as well. In all cases, however, the values are all converted to ASCII lowercase by the API."

I would consider it a bug if any implementation of Clipboard returned non-lowercased values for a file's type or from types().

> Source/WebCore/dom/Clipboard.cpp:167
> +        if (files()->isEmpty())

It would probably be better to call this once and hang on to the returned FileList. A lot of implementations create a new FileList every time you call files().

> Source/WebCore/dom/Clipboard.cpp:192
> +String Clipboard::platformTypeForHTMLType(const String& type) const

I do not think you need this function. From my reading of the spec, "Text" and "URL" are only supported via getData() / setData() for compatibility with IE. Since dropzone is not a legacy API, you should not need to support these values.

> Source/WebCore/page/EventHandler.cpp:1825
> +    if (clipboard->policy() == ClipboardNumb)

I don't think you should check ClipboardNumb here. Why not centralize all the checks in Clipboard::hasData() like the other Clipboard methods? For example, just several lines down, you don't check the access policy before calling clipboard->hasType().

-- 
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