[html5] r2448 - [iw] (2) Make DragEvent inherit from MouseEvent so we get mouse and key info int [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Nov 25 17:46:47 PST 2008


Author: ianh
Date: 2008-11-25 17:46:46 -0800 (Tue, 25 Nov 2008)
New Revision: 2448

Modified:
   index
   source
Log:
[iw] (2) Make DragEvent inherit from MouseEvent so we get mouse and key info into the events. Add a note about the difference between addElement() and setDragImage(). (credit: nd)

Modified: index
===================================================================
--- index	2008-11-26 01:26:03 UTC (rev 2447)
+++ index	2008-11-26 01:46:46 UTC (rev 2448)
@@ -40370,21 +40370,22 @@
   <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);
+
+  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 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>
-
   <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>
@@ -40488,18 +40489,28 @@
   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>

Modified: source
===================================================================
--- source	2008-11-26 01:26:03 UTC (rev 2447)
+++ source	2008-11-26 01:46:46 UTC (rev 2448)
@@ -45962,16 +45962,13 @@
   <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);
+
+  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 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>
-
   <p>The <dfn
   title="dom-DragEvent-initDragEvent"><code>initDragEvent()</code></dfn>
   and <dfn
@@ -45980,6 +45977,12 @@
   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
@@ -46117,19 +46120,29 @@
   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>
 




More information about the Commit-Watchers mailing list