Closed Bug 723008 Opened 14 years ago Closed 8 years ago

Implement dropzone content attribute

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: rniwa, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
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.)
Blocks: html
Can you specify "bad".
Olli - can you say more about what the issues with the spec are?
(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.
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.
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.
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.
(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.
We (Blink) are planning to remove our implementation of webkitdropzone [1], and I've started the process of removing dropzone from the HTML specification [2]. Based on this bug's status, it seems like you're not implementing the attribute right now. Is this correct? Thank you! [1] https://groups.google.com/a/chromium.org/d/topic/blink-dev/rdGvTDPU7mM/discussion [2] https://github.com/whatwg/html/issues/2331
This has been dropped from the spec.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.