Skip to content

Commit

Permalink
[iw] (2) Make DragEvent inherit from MouseEvent so we get mouse and k…
Browse files Browse the repository at this point in the history
…ey info into the events. Add a note about the difference between addElement() and setDragImage(). (credit: nd)

git-svn-id: http://svn.whatwg.org/webapps@2448 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 26, 2008
1 parent 9f5c8ed commit 0206dc1
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 25 deletions.
35 changes: 23 additions & 12 deletions index
Expand Up @@ -40370,21 +40370,22 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
<p>The drag-and-drop processing model involves several events. They
all use the <code><a href=#dragevent>DragEvent</a></code> interface.</p>

<pre class=idl>interface <dfn id=dragevent>DragEvent</dfn> : UIEvent {
<pre class=idl>interface <dfn id=dragevent>DragEvent</dfn> : MouseEvent {
readonly attribute <a href=#datatransfer>DataTransfer</a> <a href=#dom-dragevent-datatransfer title=dom-DragEvent-dataTransfer>dataTransfer</a>;
void <a href=#dom-dragevent-initdragevent title=dom-DragEvent-initDragEvent>initDragEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in <a href=#datatransfer>DataTransfer</a> dataTransferArg);
void <a href=#dom-dragevent-initdrageventns title=dom-DragEvent-initDragEventNS>initDragEventNS</a>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in <a href=#datatransfer>DataTransfer</a> dataTransferArg);
};</pre>

<p class=XXX>We should have modifier key information in here too
(shift/ctrl, etc), like with mouse events and like with the context
menu event.</p>
void <a href=#dom-dragevent-initdragevent title=dom-DragEvent-initDragEvent>initDragEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean shiftKeyArg, in boolean metaKeyArg, in unsigned short buttonArg, in EventTarget relatedTargetArg, in <a href=#datatransfer>DataTransfer</a> dataTransferArg);
void <a href=#dom-dragevent-initdrageventns title=dom-DragEvent-initDragEventNS>initDragEventNS</a>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in unsigned short buttonArg, in EventTarget relatedTargetArg, in DOMString modifiersListArg, in <a href=#datatransfer>DataTransfer</a> dataTransferArg);
};</pre>

<p>The <dfn id=dom-dragevent-initdragevent title=dom-DragEvent-initDragEvent><code>initDragEvent()</code></dfn>
and <dfn id=dom-dragevent-initdrageventns title=dom-DragEvent-initDragEventNS><code>initDragEventNS()</code></dfn>
methods must initialize the event in a manner analogous to the
similarly-named methods in the DOM3 Events interfaces. <a href=#refsDOM3EVENTS>[DOM3EVENTS]</a></p>

<p class=note>The <code title=dom-DragEvent-initDragEvent><a href=#dom-dragevent-initdragevent>initDragEvent()</a></code> and <code title=dom-DragEvent-initDragEventNS><a href=#dom-dragevent-initdrageventns>initDragEventNS()</a></code>
methods handle modifier keys differently, much like the equivalent
methods on the <code>MouseEvent</code> interface.</p>

<p>The <dfn id=dom-dragevent-datatransfer title=dom-DragEvent-dataTransfer><code>dataTransfer</code></dfn>
attribute of the <code><a href=#dragevent>DragEvent</a></code> interface represents the
context information for the event.</p>
Expand Down Expand Up @@ -40488,18 +40489,28 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
specifying how the user agent is to <a href=#base-dnd-feedback>render the drag feedback</a>. It adds an
element to the <code><a href=#datatransfer>DataTransfer</a></code> object.</p>

<p class=note>The difference between <code title=dom-DataTransfer-setDragImage><a href=#dom-datatransfer-setdragimage>setDragImage()</a></code> and
<code title=dom-DataTransfer-addElement><a href=#dom-datatransfer-addelement>addElement()</a></code> is
that the latter automatically generates the image based on the
current rendering of the elements added, whereas the former uses the
exact specified image.</p>


<h4 id=events-fired-during-a-drag-and-drop-action><span class=secno>6.8.3 </span>Events fired during a drag-and-drop action</h4>

<p>The following events are involved in the drag-and-drop
model. Whenever the processing model described below causes one of
these events to be fired, the event fired must use the
<code><a href=#dragevent>DragEvent</a></code> interface defined above, must have the
bubbling and cancelable behaviors given in the table below, and
must have the context information set up as described after the
table, with the <code title=dom-UIEvent-view>view</code> attribute
set to the view with which the user interacted to trigger the
drag-and-drop event, and the <code title=dom-UIEvent-detail>detail</code> attribute set to zero.</p>
bubbling and cancelable behaviors given in the table below, and must
have the context information set up as described after the table,
with the <code title=dom-UIEvent-view>view</code> attribute set to
the view with which the user interacted to trigger the drag-and-drop
event, the <code title=dom-UIEvent-detail>detail</code> attribute
set to zero, the mouse and key attributes set according to the state
of the input devices as they would be for user interaction events,
and the <code title="">relatedTarget</code> attribute set to
null.</p>

<table><thead><tr><th> Event Name </th>
<th> Target </th>
Expand Down
39 changes: 26 additions & 13 deletions source
Expand Up @@ -45962,15 +45962,12 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
<p>The drag-and-drop processing model involves several events. They
all use the <code>DragEvent</code> interface.</p>

<pre class="idl">interface <dfn>DragEvent</dfn> : UIEvent {
<pre class="idl">interface <dfn>DragEvent</dfn> : MouseEvent {
readonly attribute <span>DataTransfer</span> <span title="dom-DragEvent-dataTransfer">dataTransfer</span>;
void <span title="dom-DragEvent-initDragEvent">initDragEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in <span>DataTransfer</span> dataTransferArg);
void <span title="dom-DragEvent-initDragEventNS">initDragEventNS</span>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in <span>DataTransfer</span> dataTransferArg);
};</pre>

<p class="XXX">We should have modifier key information in here too
(shift/ctrl, etc), like with mouse events and like with the context
menu event.</p>
void <span title="dom-DragEvent-initDragEvent">initDragEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean shiftKeyArg, in boolean metaKeyArg, in unsigned short buttonArg, in EventTarget relatedTargetArg, in <span>DataTransfer</span> dataTransferArg);
void <span title="dom-DragEvent-initDragEventNS">initDragEventNS</span>(in DOMString namespaceURIArg, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in AbstractView viewArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in unsigned short buttonArg, in EventTarget relatedTargetArg, in DOMString modifiersListArg, in <span>DataTransfer</span> dataTransferArg);
};</pre>

<p>The <dfn
title="dom-DragEvent-initDragEvent"><code>initDragEvent()</code></dfn>
Expand All @@ -45980,6 +45977,12 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
similarly-named methods in the DOM3 Events interfaces. <a
href="#refsDOM3EVENTS">[DOM3EVENTS]</a></p>

<p class="note">The <code
title="dom-DragEvent-initDragEvent">initDragEvent()</code> and <code
title="dom-DragEvent-initDragEventNS">initDragEventNS()</code>
methods handle modifier keys differently, much like the equivalent
methods on the <code>MouseEvent</code> interface.</p>

<p>The <dfn
title="dom-DragEvent-dataTransfer"><code>dataTransfer</code></dfn>
attribute of the <code>DragEvent</code> interface represents the
Expand Down Expand Up @@ -46117,19 +46120,29 @@ http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSPr
href="#base-dnd-feedback">render the drag feedback</a>. It adds an
element to the <code>DataTransfer</code> object.</p>

<p class="note">The difference between <code
title="dom-DataTransfer-setDragImage">setDragImage()</code> and
<code title="dom-DataTransfer-addElement">addElement()</code> is
that the latter automatically generates the image based on the
current rendering of the elements added, whereas the former uses the
exact specified image.</p>


<h4>Events fired during a drag-and-drop action</h4>

<p>The following events are involved in the drag-and-drop
model. Whenever the processing model described below causes one of
these events to be fired, the event fired must use the
<code>DragEvent</code> interface defined above, must have the
bubbling and cancelable behaviors given in the table below, and
must have the context information set up as described after the
table, with the <code title="dom-UIEvent-view">view</code> attribute
set to the view with which the user interacted to trigger the
drag-and-drop event, and the <code
title="dom-UIEvent-detail">detail</code> attribute set to zero.</p>
bubbling and cancelable behaviors given in the table below, and must
have the context information set up as described after the table,
with the <code title="dom-UIEvent-view">view</code> attribute set to
the view with which the user interacted to trigger the drag-and-drop
event, the <code title="dom-UIEvent-detail">detail</code> attribute
set to zero, the mouse and key attributes set according to the state
of the input devices as they would be for user interaction events,
and the <code title="">relatedTarget</code> attribute set to
null.</p>

<table>

Expand Down

0 comments on commit 0206dc1

Please sign in to comment.