Last Comment Bug 723008 - Implement dropzone content attribute
: Implement dropzone content attribute
Status: NEW
: dev-doc-needed
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- enhancement with 22 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: html5 html5test
  Show dependency treegraph
 
Reported: 2012-01-31 23:54 PST by Ryosuke Niwa
Modified: 2016-11-22 21:42 PST (History)
20 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Ryosuke Niwa 2012-01-31 23:54:36 PST
Consider implementing http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dropzone-attribute.

FWIW, WebKit has webkitdropzone that matches the latest spec.
Comment 1 Olli Pettay [:smaug] 2012-02-01 03:11:20 PST
Yes, we should implement it after reviewing the spec, and get the spec possibly fixed.
(Last time I read the spec, it was still bad.)
Comment 2 Florian Bender 2012-07-24 10:31:18 PDT
Can you specify "bad".
Comment 3 Florian Bender 2012-08-09 13:36:41 PDT
This is the W3C doc: http://dev.w3.org/html5/spec/dnd.html#the-dropzone-attribute
Comment 4 Josh Aas 2012-10-01 18:59:01 PDT
Olli - can you say more about what the issues with the spec are?
Comment 5 Olli Pettay [:smaug] 2012-10-02 03:28:23 PDT
(Use whatwg spec for implementation http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dropzone-attribute)

Hmm, it was long ago when I was looking at this.
It is that the API is kind of packed into one attribute, and there is no easy
way to change just certain parts of the attribute value. Sure it is DOMSettableTokenList, but
one needs to iterate through all the values to change them.
Also, it is [PutForwards=value] readonly attribute DOMSettableTokenList dropzone; and
PutForwards is always quite horrible API.


But in general, whenever implementing something from a spec you'll find bugs in the spec.
Comment 6 Jonas Sicking (:sicking) No longer reading bugmail consistently 2012-10-03 18:57:23 PDT
I basically think that PutForwards is generally always a bad API which should be restricted to legacy behavior.

The spec generally seemed like a good approach. But I haven't reviewed any details.
Comment 7 Jonas Sicking (:sicking) No longer reading bugmail consistently 2012-10-03 18:59:56 PDT
Olli: What do you mean by that you have to iterate through all attributes of a DOMSettableTokenList. The API was designed specifically so that you can add/remove/flip values without having to do that.
Comment 8 Olli Pettay [:smaug] 2012-10-04 03:21:30 PDT
I mean it is too hard to know which all string: or file: types are supported.
One needs to either check each thinkable value with 
dropzone.contains("file:" + type)
or iterate the list and cut file: and string: values from the actual values.
It is use of string: and file: prefixes which makes the API somewhat ugly.
Comment 9 Florian Bender 2013-08-14 01:42:16 PDT
(In reply to Olli Pettay [:smaug] from comment #8)
> I mean it is too hard to know which all string: or file: types are supported.
> One needs to either check each thinkable value with 
> dropzone.contains("file:" + type)
> or iterate the list and cut file: and string: values from the actual values.
> It is use of string: and file: prefixes which makes the API somewhat ugly.

I don't think the spec will change much on that regard. So either, it should be implemented as specced, or you may want to propose a better solution on the WHATWG mailing list.

Note You need to log in before you can comment on or make changes to this bug.