Skip to content

Commit

Permalink
[giow] (2) Make some dragleave and dragenter events have a relatedTar…
Browse files Browse the repository at this point in the history
…get.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=13524
Affected topics: DOM APIs, HTML

git-svn-id: http://svn.whatwg.org/webapps@8396 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 14, 2014
1 parent d92962f commit cf69738
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 17 deletions.
20 changes: 14 additions & 6 deletions complete.html
Expand Up @@ -72470,14 +72470,15 @@ <h5 id=event-firing><span class=secno>7.1.5.3 </span>Event firing</h5>
(except where otherwise stated), and which uses the <code><a href=#event>Event</a></code> interface, must be created
and <a href=#concept-event-dispatch title=concept-event-dispatch>dispatched</a> at the given target.</p>

<!--CLEANUP-->
<p><dfn id=fire-a-synthetic-mouse-event title="fire a synthetic mouse event">Firing a synthetic mouse event named <var title="">e</var></dfn> means that an event with the name <var title="">e</var>, which is <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> (except where otherwise stated), does not bubble
(except where otherwise stated), is not cancelable (except where otherwise stated), and which uses
the <code><a href=#mouseevent>MouseEvent</a></code> interface, must be created and dispatched at the given target. The
event object must have its <code title="">screenX</code>, <code title="">screenY</code>, <code title="">clientX</code>, <code title="">clientY</code>, and <code title="">button</code>
attributes initialized to 0, its <code title="">ctrlKey</code>, <code title="">shiftKey</code>,
<code title="">altKey</code>, and <code title="">metaKey</code> attributes initialized according
to the current state of the key input device, if any (false for any keys that are not available),
its <code title="">detail</code> attribute initialized to 1, and its <code title="">relatedTarget</code> attribute initialized to null (except where otherwise stated). The
its <code title="">detail</code> attribute initialized to 1, and its <code title=dom-MouseEvent-relatedTarget>relatedTarget</code> attribute initialized to null (except where otherwise stated). The
<code title="">getModifierState()</code> method on the object must return values appropriately
describing the state of the key input device at the time the event is created.</p>

Expand Down Expand Up @@ -77749,11 +77750,15 @@ <h4 id=the-dragevent-interface><span class=secno>8.7.4 </span>The <code><a href=

<div class=impl>

<!--CLEANUP-->
<p>When a user agent is required to <dfn id=fire-a-dnd-event>fire a DND event</dfn> named <var title="">e</var> at an
element, using a particular <a href=#drag-data-store>drag data store</a>, the user agent must run the following
element, using a particular <a href=#drag-data-store>drag data store</a>, and optionally with a specific <var title="">related target</var>, the user agent must run the following
steps:</p>

<ol><li>
<ol><li><p>If not <var title="">related target</var> was provided, set <var title="">related
target</var> to null.</li>

<li>

<p>If <var title="">e</var> is <code title=event-dnd-dragstart><a href=#event-dnd-dragstart>dragstart</a></code>, set the
<a href=#drag-data-store-mode>drag data store mode</a> to the <a href=#concept-dnd-rw title=concept-dnd-rw>read/write
Expand Down Expand Up @@ -77818,12 +77823,13 @@ <h4 id=the-dragevent-interface><span class=secno>8.7.4 </span>The <code><a href=

<li>

<!--CLEANUP-->
<p>Create a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> <code><a href=#dragevent>DragEvent</a></code> object
and initialize it to have the given name <var title="">e</var>, to bubble, to be cancelable
unless <var title="">e</var> is <code title=event-dnd-dragexit><a href=#event-dnd-dragexit>dragexit</a></code>, <code title=event-dnd-dragleave><a href=#event-dnd-dragleave>dragleave</a></code>, or <code title=event-dnd-dragend><a href=#event-dnd-dragend>dragend</a></code>, and to
have the <code title=dom-UIEvent-detail><a href=#dom-uievent-detail>detail</a></code> attribute initialized to zero, the mouse
and key attributes initialized according to the state of the input devices as they would be for
user interaction events, the <code title="">relatedTarget</code> attribute initialized to null,
user interaction events, the <code title=dom-MouseEvent-relatedTarget>relatedTarget</code> attribute initialized to <var title="">related target</var>,
and the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> attribute initialized to
<var title="">dataTransfer</var>, the <code><a href=#datatransfer>DataTransfer</a></code> object created above.</p>

Expand Down Expand Up @@ -78172,7 +78178,9 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
<p>If the <a href=#immediate-user-selection>immediate user selection</a> is <var title="">new target</var>, then
leave the <a href=#current-target-element>current target element</a> unchanged.</p>

<p>Otherwise, <a href=#fire-a-dnd-event>fire a DND event</a> named <code title=event-dnd-dragenter><a href=#event-dnd-dragenter>dragenter</a></code> at <var title="">new target</var>. Then, set the
<!--CLEANUP-->
<p>Otherwise, <a href=#fire-a-dnd-event>fire a DND event</a> named <code title=event-dnd-dragenter><a href=#event-dnd-dragenter>dragenter</a></code> at <var title="">new target</var>, with the
current <a href=#current-target-element>current target element</a> as the specific <var title="">related target</var>. Then, set the
<a href=#current-target-element>current target element</a> to <var title="">new target</var>, regardless of
whether that event was canceled or not.</p>

Expand Down Expand Up @@ -78204,7 +78212,7 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr
<p>If the previous step caused the <a href=#current-target-element>current target element</a> to change, and if the
previous target element was not null or a part of a non-DOM document, then <a href=#fire-a-dnd-event>fire a DND
event</a> named <code title=event-dnd-dragleave><a href=#event-dnd-dragleave>dragleave</a></code> at the previous target
element.</p>
element, with the new <a href=#current-target-element>current target element</a> as the specific <var title="">related target</var>.</p>

</li>

Expand Down
20 changes: 14 additions & 6 deletions index
Expand Up @@ -72470,14 +72470,15 @@ interface <dfn id=windoweventhandlers>WindowEventHandlers</dfn> {
(except where otherwise stated), and which uses the <code><a href=#event>Event</a></code> interface, must be created
and <a href=#concept-event-dispatch title=concept-event-dispatch>dispatched</a> at the given target.</p>

<!--CLEANUP-->
<p><dfn id=fire-a-synthetic-mouse-event title="fire a synthetic mouse event">Firing a synthetic mouse event named <var title="">e</var></dfn> means that an event with the name <var title="">e</var>, which is <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> (except where otherwise stated), does not bubble
(except where otherwise stated), is not cancelable (except where otherwise stated), and which uses
the <code><a href=#mouseevent>MouseEvent</a></code> interface, must be created and dispatched at the given target. The
event object must have its <code title="">screenX</code>, <code title="">screenY</code>, <code title="">clientX</code>, <code title="">clientY</code>, and <code title="">button</code>
attributes initialized to 0, its <code title="">ctrlKey</code>, <code title="">shiftKey</code>,
<code title="">altKey</code>, and <code title="">metaKey</code> attributes initialized according
to the current state of the key input device, if any (false for any keys that are not available),
its <code title="">detail</code> attribute initialized to 1, and its <code title="">relatedTarget</code> attribute initialized to null (except where otherwise stated). The
its <code title="">detail</code> attribute initialized to 1, and its <code title=dom-MouseEvent-relatedTarget>relatedTarget</code> attribute initialized to null (except where otherwise stated). The
<code title="">getModifierState()</code> method on the object must return values appropriately
describing the state of the key input device at the time the event is created.</p>

Expand Down Expand Up @@ -77749,11 +77750,15 @@ dictionary <dfn id=drageventinit>DragEventInit</dfn> : <a href=#mouseeventinit>M

<div class=impl>

<!--CLEANUP-->
<p>When a user agent is required to <dfn id=fire-a-dnd-event>fire a DND event</dfn> named <var title="">e</var> at an
element, using a particular <a href=#drag-data-store>drag data store</a>, the user agent must run the following
element, using a particular <a href=#drag-data-store>drag data store</a>, and optionally with a specific <var title="">related target</var>, the user agent must run the following
steps:</p>

<ol><li>
<ol><li><p>If not <var title="">related target</var> was provided, set <var title="">related
target</var> to null.</li>

<li>

<p>If <var title="">e</var> is <code title=event-dnd-dragstart><a href=#event-dnd-dragstart>dragstart</a></code>, set the
<a href=#drag-data-store-mode>drag data store mode</a> to the <a href=#concept-dnd-rw title=concept-dnd-rw>read/write
Expand Down Expand Up @@ -77818,12 +77823,13 @@ dictionary <dfn id=drageventinit>DragEventInit</dfn> : <a href=#mouseeventinit>M

<li>

<!--CLEANUP-->
<p>Create a <a href=#concept-events-trusted title=concept-events-trusted>trusted</a> <code><a href=#dragevent>DragEvent</a></code> object
and initialize it to have the given name <var title="">e</var>, to bubble, to be cancelable
unless <var title="">e</var> is <code title=event-dnd-dragexit><a href=#event-dnd-dragexit>dragexit</a></code>, <code title=event-dnd-dragleave><a href=#event-dnd-dragleave>dragleave</a></code>, or <code title=event-dnd-dragend><a href=#event-dnd-dragend>dragend</a></code>, and to
have the <code title=dom-UIEvent-detail><a href=#dom-uievent-detail>detail</a></code> attribute initialized to zero, the mouse
and key attributes initialized according to the state of the input devices as they would be for
user interaction events, the <code title="">relatedTarget</code> attribute initialized to null,
user interaction events, the <code title=dom-MouseEvent-relatedTarget>relatedTarget</code> attribute initialized to <var title="">related target</var>,
and the <code title=dom-DragEvent-dataTransfer><a href=#dom-dragevent-datatransfer>dataTransfer</a></code> attribute initialized to
<var title="">dataTransfer</var>, the <code><a href=#datatransfer>DataTransfer</a></code> object created above.</p>

Expand Down Expand Up @@ -78172,7 +78178,9 @@ dictionary <dfn id=drageventinit>DragEventInit</dfn> : <a href=#mouseeventinit>M
<p>If the <a href=#immediate-user-selection>immediate user selection</a> is <var title="">new target</var>, then
leave the <a href=#current-target-element>current target element</a> unchanged.</p>

<p>Otherwise, <a href=#fire-a-dnd-event>fire a DND event</a> named <code title=event-dnd-dragenter><a href=#event-dnd-dragenter>dragenter</a></code> at <var title="">new target</var>. Then, set the
<!--CLEANUP-->
<p>Otherwise, <a href=#fire-a-dnd-event>fire a DND event</a> named <code title=event-dnd-dragenter><a href=#event-dnd-dragenter>dragenter</a></code> at <var title="">new target</var>, with the
current <a href=#current-target-element>current target element</a> as the specific <var title="">related target</var>. Then, set the
<a href=#current-target-element>current target element</a> to <var title="">new target</var>, regardless of
whether that event was canceled or not.</p>

Expand Down Expand Up @@ -78204,7 +78212,7 @@ dictionary <dfn id=drageventinit>DragEventInit</dfn> : <a href=#mouseeventinit>M
<p>If the previous step caused the <a href=#current-target-element>current target element</a> to change, and if the
previous target element was not null or a part of a non-DOM document, then <a href=#fire-a-dnd-event>fire a DND
event</a> named <code title=event-dnd-dragleave><a href=#event-dnd-dragleave>dragleave</a></code> at the previous target
element.</p>
element, with the new <a href=#current-target-element>current target element</a> as the specific <var title="">related target</var>.</p>

</li>

Expand Down
19 changes: 14 additions & 5 deletions source
Expand Up @@ -81015,6 +81015,7 @@ interface <dfn>WindowEventHandlers</dfn> {
(except where otherwise stated), and which uses the <code>Event</code> interface, must be created
and <span data-x="concept-event-dispatch">dispatched</span> at the given target.</p>

<!--CLEANUP-->
<p><dfn data-x="fire a synthetic mouse event">Firing a synthetic mouse event named <var
data-x="">e</var></dfn> means that an event with the name <var data-x="">e</var>, which is <span
data-x="concept-events-trusted">trusted</span> (except where otherwise stated), does not bubble
Expand All @@ -81026,7 +81027,7 @@ interface <dfn>WindowEventHandlers</dfn> {
<code data-x="">altKey</code>, and <code data-x="">metaKey</code> attributes initialized according
to the current state of the key input device, if any (false for any keys that are not available),
its <code data-x="">detail</code> attribute initialized to 1, and its <code
data-x="">relatedTarget</code> attribute initialized to null (except where otherwise stated). The
data-x="dom-MouseEvent-relatedTarget">relatedTarget</code> attribute initialized to null (except where otherwise stated). The
<code data-x="">getModifierState()</code> method on the object must return values appropriately
describing the state of the key input device at the time the event is created.</p>

Expand Down Expand Up @@ -86991,12 +86992,16 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {

<div class="impl">

<!--CLEANUP-->
<p>When a user agent is required to <dfn>fire a DND event</dfn> named <var data-x="">e</var> at an
element, using a particular <span>drag data store</span>, the user agent must run the following
element, using a particular <span>drag data store</span>, and optionally with a specific <var data-x="">related target</var>, the user agent must run the following
steps:</p>

<ol>

<li><p>If not <var data-x="">related target</var> was provided, set <var data-x="">related
target</var> to null.</p></li>

<li>

<p>If <var data-x="">e</var> is <code data-x="event-dnd-dragstart">dragstart</code>, set the
Expand Down Expand Up @@ -87100,13 +87105,14 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {

<li>

<!--CLEANUP-->
<p>Create a <span data-x="concept-events-trusted">trusted</span> <code>DragEvent</code> object
and initialize it to have the given name <var data-x="">e</var>, to bubble, to be cancelable
unless <var data-x="">e</var> is <code data-x="event-dnd-dragexit">dragexit</code>, <code
data-x="event-dnd-dragleave">dragleave</code>, or <code data-x="event-dnd-dragend">dragend</code>, and to
have the <code data-x="dom-UIEvent-detail">detail</code> attribute initialized to zero, the mouse
and key attributes initialized according to the state of the input devices as they would be for
user interaction events, the <code data-x="">relatedTarget</code> attribute initialized to null,
user interaction events, the <code data-x="dom-MouseEvent-relatedTarget">relatedTarget</code> attribute initialized to <var data-x="">related target</var>,
and the <code data-x="dom-DragEvent-dataTransfer">dataTransfer</code> attribute initialized to
<var data-x="">dataTransfer</var>, the <code>DataTransfer</code> object created above.</p>

Expand Down Expand Up @@ -87512,8 +87518,10 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
<p>If the <span>immediate user selection</span> is <var data-x="">new target</var>, then
leave the <span>current target element</span> unchanged.</p>

<!--CLEANUP-->
<p>Otherwise, <span>fire a DND event</span> named <code
data-x="event-dnd-dragenter">dragenter</code> at <var data-x="">new target</var>. Then, set the
data-x="event-dnd-dragenter">dragenter</code> at <var data-x="">new target</var>, with the
current <span>current target element</span> as the specific <var data-x="">related target</var>. Then, set the
<span>current target element</span> to <var data-x="">new target</var>, regardless of
whether that event was canceled or not.</p>

Expand Down Expand Up @@ -87549,7 +87557,8 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
<p>If the previous step caused the <span>current target element</span> to change, and if the
previous target element was not null or a part of a non-DOM document, then <span>fire a DND
event</span> named <code data-x="event-dnd-dragleave">dragleave</code> at the previous target
element.</p>
element, with the new <span>current target element</span> as the specific <var
data-x="">related target</var>.</p>

</li>

Expand Down

0 comments on commit cf69738

Please sign in to comment.