Skip to content

Commit

Permalink
[e] (0) v2 notes for dnd
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@3249 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 15, 2009
1 parent 06fd1e5 commit 0c1097c
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 48 deletions.
60 changes: 36 additions & 24 deletions index
Expand Up @@ -54698,31 +54698,43 @@ at the first element with the given ID must be treated as if it was cloned and r

<h3 id=dnd><span class=secno>7.10 </span><dfn>Drag and drop</dfn></h3>

<!--XXX
<!-- v2 ideas for drag and drop:

* being able to animate a drop target:

> To implement this with simple interface I've proposed, events
> should be handled either by existing elements (like list
> items that compare their size and position of dragged element
> to decide whether element should be dropped before or after)
> or handled by container that would probably need to calculate
> positions of it's children and create new element to show
> drop target. Smooth Mac-like drag'n'drop can be implemented
> by animating drop target's padding/margin. So that's quite a
> bit of code that's going to be reinvented each time someone
> implements reordering.

<hyatt> :droptarget
<hyatt> or something
<hyatt> we don't support a pseudo-class for the drop target but that's a great idea
<Hixie_> yeah, thinking about that too
<Hixie_> :drop-target, :drop-target(above), :drop-target(below) and having ondragover be able to say "not on me, but next to me maybe"

* We should let drop targets communicate back to drag sources if
they want to communicate. (e.g. expose Window, and thus
postMessage(), on the dataTransfer object on drop.)

We should let drag sources provide a set of options via a
context menu when the drop happens. (So that, e.g., the source
can know whether a capabilities URI that it is passing along is
supposed to be read-write access or read-only access to the
object being dragged.)

We should let potential drop targets see the types (but not the
contents!) of dragged data so they can establish if they care
or not. (dataTransfer.hasType())

Ack: Ben Laurie (@g)

http://msdn.microsoft.com/workshop/author/datatransfer/overview.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/clipboarddata.asp

> To implement this with simple interface I've proposed, events should be
> handled either by existing elements (like list items that compare their size
> and position of dragged element to decide whether element should be dropped
> before or after) or handled by container that would probably need to calculate
> positions of it's children and create new element to show drop target. Smooth
> Mac-like drag'n'drop can be implemented by animating drop target's
> padding/margin. So that's quite a bit of code that's going to be reinvented
> each time someone implements reordering.

<hyatt> :droptarget
<hyatt> or something
<hyatt> we don't support a pseudo-class for the drop target but that's a great idea
<Hixie_> yeah, thinking about that too
<Hixie_> :drop-target, :drop-target(above), :drop-target(below) and having ondragover be able to say "not on me, but next to me maybe"

http://msdn.microsoft.com/workshop/author/dhtml/reference/events/ondragstart.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/ondrag.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/ondragend.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_datatransfer.asp
http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/DragAndDrop.html
-->

<p>This section defines an event-based drag-and-drop mechanism.</p>
Expand Down
60 changes: 36 additions & 24 deletions source
Expand Up @@ -64056,31 +64056,43 @@ at the first element with the given ID must be treated as if it was cloned and r

<h3 id="dnd"><dfn>Drag and drop</dfn></h3>

<!--XXX
<!-- v2 ideas for drag and drop:

* being able to animate a drop target:

> To implement this with simple interface I've proposed, events
> should be handled either by existing elements (like list
> items that compare their size and position of dragged element
> to decide whether element should be dropped before or after)
> or handled by container that would probably need to calculate
> positions of it's children and create new element to show
> drop target. Smooth Mac-like drag'n'drop can be implemented
> by animating drop target's padding/margin. So that's quite a
> bit of code that's going to be reinvented each time someone
> implements reordering.

<hyatt> :droptarget
<hyatt> or something
<hyatt> we don't support a pseudo-class for the drop target but that's a great idea
<Hixie_> yeah, thinking about that too
<Hixie_> :drop-target, :drop-target(above), :drop-target(below) and having ondragover be able to say "not on me, but next to me maybe"

* We should let drop targets communicate back to drag sources if
they want to communicate. (e.g. expose Window, and thus
postMessage(), on the dataTransfer object on drop.)

We should let drag sources provide a set of options via a
context menu when the drop happens. (So that, e.g., the source
can know whether a capabilities URI that it is passing along is
supposed to be read-write access or read-only access to the
object being dragged.)

We should let potential drop targets see the types (but not the
contents!) of dragged data so they can establish if they care
or not. (dataTransfer.hasType())

Ack: Ben Laurie (@g)

http://msdn.microsoft.com/workshop/author/datatransfer/overview.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/clipboarddata.asp

> To implement this with simple interface I've proposed, events should be
> handled either by existing elements (like list items that compare their size
> and position of dragged element to decide whether element should be dropped
> before or after) or handled by container that would probably need to calculate
> positions of it's children and create new element to show drop target. Smooth
> Mac-like drag'n'drop can be implemented by animating drop target's
> padding/margin. So that's quite a bit of code that's going to be reinvented
> each time someone implements reordering.

<hyatt> :droptarget
<hyatt> or something
<hyatt> we don't support a pseudo-class for the drop target but that's a great idea
<Hixie_> yeah, thinking about that too
<Hixie_> :drop-target, :drop-target(above), :drop-target(below) and having ondragover be able to say "not on me, but next to me maybe"

http://msdn.microsoft.com/workshop/author/dhtml/reference/events/ondragstart.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/ondrag.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/ondragend.asp
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_datatransfer.asp
http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/DragAndDrop.html
-->

<p>This section defines an event-based drag-and-drop mechanism.</p>
Expand Down

0 comments on commit 0c1097c

Please sign in to comment.