- From: poot <cvsmail@w3.org>
- Date: Wed, 26 Nov 2008 10:49:43 +0900 (JST)
- To: public-html-diffs@w3.org
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) (whatwg r2448) 6.8 Drag and drop http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#dnd DragEvent http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#dragevent 6.8.3 Events fired during a drag-and-drop action http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#events-fired-during-a-drag-and-drop-action DataTransfer http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#datatransfer dataTransfer http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#dom-dragevent-datatransfer setDragImage(element, x, y) http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#dom-datatransfer-setdragimage initDragEventNS() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#dom-dragevent-initdrageventns initDragEvent() http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#dom-dragevent-initdragevent 6.8.1 Introduction http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#introduction-3 addElement(element) http://people.w3.org/mike/diffs/html5/spec/Overview.1.1620.html#dom-datatransfer-addelement http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1619&r2=1.1620&f=h http://html5.org/tools/web-apps-tracker?from=2447&to=2448 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.1619 retrieving revision 1.1620 diff -u -d -r1.1619 -r1.1620 --- Overview.html 26 Nov 2008 01:26:07 -0000 1.1619 +++ Overview.html 26 Nov 2008 01:46:51 -0000 1.1620 @@ -32373,16 +32373,17 @@ possible drop point before the drop occurs (so if the operation is not canceled, there must be at least one element in the middle step).<h4 id=introduction-3><span class=secno>6.8.1 </span>Introduction</h4><p><em>This section is non-normative.</em><p class=XXX>It's also currently non-existent.<h4 id=the-dragevent-and-datatransfer-interfaces><span class=secno>6.8.2 </span>The <code><a href=#dragevent>DragEvent</a></code> and <code><a href=#datatransfer>DataTransfer</a></code> interfaces</h4><p>The drag-and-drop processing model involves several events. They - all use the <code><a href=#dragevent>DragEvent</a></code> interface.<pre class=idl>interface <dfn id=dragevent>DragEvent</dfn> : UIEvent { + all use the <code><a href=#dragevent>DragEvent</a></code> interface.<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>The <dfn id=dom-dragevent-initdragevent title=dom-DragEvent-initDragEvent><code>initDragEvent()</code></dfn> + + 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=#references>[DOM3EVENTS]</a><p>The <dfn id=dom-dragevent-datatransfer title=dom-DragEvent-dataTransfer><code>dataTransfer</code></dfn> + similarly-named methods in the DOM3 Events interfaces. <a href=#references>[DOM3EVENTS]</a><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>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.<pre class=idl>interface <dfn id=datatransfer>DataTransfer</dfn> { attribute DOMString <a href=#dom-datatransfer-dropeffect title=dom-DataTransfer-dropEffect>dropEffect</a>; @@ -32453,15 +32454,23 @@ feedback on the given element (but the exact mechanism for doing so is not specified).<p>The <dfn id=dom-datatransfer-addelement title=dom-DataTransfer-addElement><code>addElement(<var title="">element</var>)</code></dfn> method is an alternative way of 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.<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 + element to the <code><a href=#datatransfer>DataTransfer</a></code> object.<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.<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.<table><thead><tr><th> Event Name </th> + 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.<table><thead><tr><th> Event Name </th> <th> Target </th> <th> Bubbles? </th> <th> Cancelable? </th>
Received on Wednesday, 26 November 2008 01:50:24 UTC