[whatwg] Issue on drag & drop example in specification?

Hi, Ian.

I'm sorry for delay of replying and thanks for your post very much.

> Here you want to put the preventDefault() after the for() loop, so that it
> cancels the event only if the type was not found.

Mmm, it seems my mistake about understanding the specification...
For the example of section 7.9.1 (Drag and drop introduction), I have
understood that I should call preventDefault() in the dragenter event
when I want to *do* the dnd operation, but actually I should call
preventDefault() when I *don't* want to do, shouldn't I?

Here is the quote from the example in spec:
==========
  // cancel the event if the drag contains data of our type
  function dragEnterHandler(event) {
    // cancel the event if the drag contains data of our type
    if (event.dataTransfer.types.contains(internalDNDType))
      event.preventDefault();
  }
==========

And what I wanted to say is, "dnd operation is performed in spite of
omitting to call preventDefault() in dragenter event, so could I omit
to handle the dragenter event?".
I'm sorry about my example was hard to tell what I thought.

Kind regards.

--Shumpei

Received on Monday, 26 October 2009 01:53:16 UTC