Skip to content

Commit

Permalink
[giow] (2) Compatibility fix for how events are fired when nothing is…
Browse files Browse the repository at this point in the history
… focused and there's no body element. Also, editorial tweaks around how drag and drop events are fired to the body element.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=14534

git-svn-id: http://svn.whatwg.org/webapps@6753 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 25, 2011
1 parent f0b851b commit b20ab9b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 45 deletions.
25 changes: 10 additions & 15 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -9641,10 +9641,7 @@ <h4 id=dom-tree-accessors><span class=secno>3.1.4 </span><dfn>DOM tree accessors
</dl><p><dfn id=the-body-element-0>The body element</dfn> of a document is the first child of
<a href=#the-html-element-0>the <code>html</code> element</a> that is either a
<code><a href=#the-body-element>body</a></code> element or a <code><a href=#frameset>frameset</a></code> element. If
there is no such element, it is null. <span class=impl>If the body
element is null, then when the specification requires that events be
fired at "the body element", they must instead be fired at the
<code><a href=#document>Document</a></code> object.</span></p>
there is no such element, it is null.</p>

<div class=impl>

Expand Down Expand Up @@ -71637,7 +71634,10 @@ <h3 id=focus><span class=secno>8.3 </span>Focus</h3>
<p>When an element is <i>focused</i>, key events received by the
document must be targeted at that element. There may be no element
focused; when no element is focused, key events received by the
document must be targeted at <a href=#the-body-element-0>the body element</a>.</p>
document must be targeted at <a href=#the-body-element-0>the body element</a>, if there
is one, or else at the <code><a href=#document>Document</a></code>'s root element, if
there is one. If there is no root element, key events must not be
fired.</p>

<p>User agents may track focus for each <a href=#browsing-context>browsing
context</a> or <code><a href=#document>Document</a></code> individually, or may support
Expand Down Expand Up @@ -74262,16 +74262,11 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.6.5 </span>Drag-and-dr
<dd>

<p><a href=#fire-a-dnd-event>Fire a DND event</a> named <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> at <a href=#the-body-element-0>the body
element</a>, and set the <a href=#current-target-element>current target
element</a> to <a href=#the-body-element-0>the body element</a>, regardless
of whether that event was canceled or not.</p>

<p class=note>If <a href=#the-body-element-0>the body element</a> is null,
then the event will be fired at the <code><a href=#document>Document</a></code>
object (as required by the definition of <a href=#the-body-element-0>the body
element</a>), but the <a href=#current-target-element>current target element</a>
would be set to null, not the <code><a href=#document>Document</a></code>
object.</dd>
element</a>, if there is one, or at the
<code><a href=#document>Document</a></code> object, if not. Then, and set the
<a href=#current-target-element>current target element</a> to <a href=#the-body-element-0>the body
element</a>, regardless of whether that event was
canceled or not.</p>

</dl></dd>

Expand Down
25 changes: 10 additions & 15 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -9641,10 +9641,7 @@ partial interface <a href=#document>Document</a> {
</dl><p><dfn id=the-body-element-0>The body element</dfn> of a document is the first child of
<a href=#the-html-element-0>the <code>html</code> element</a> that is either a
<code><a href=#the-body-element>body</a></code> element or a <code><a href=#frameset>frameset</a></code> element. If
there is no such element, it is null. <span class=impl>If the body
element is null, then when the specification requires that events be
fired at "the body element", they must instead be fired at the
<code><a href=#document>Document</a></code> object.</span></p>
there is no such element, it is null.</p>

<div class=impl>

Expand Down Expand Up @@ -71637,7 +71634,10 @@ interface <dfn id=navigatorstorageutils>NavigatorStorageUtils</dfn> {
<p>When an element is <i>focused</i>, key events received by the
document must be targeted at that element. There may be no element
focused; when no element is focused, key events received by the
document must be targeted at <a href=#the-body-element-0>the body element</a>.</p>
document must be targeted at <a href=#the-body-element-0>the body element</a>, if there
is one, or else at the <code><a href=#document>Document</a></code>'s root element, if
there is one. If there is no root element, key events must not be
fired.</p>

<p>User agents may track focus for each <a href=#browsing-context>browsing
context</a> or <code><a href=#document>Document</a></code> individually, or may support
Expand Down Expand Up @@ -74262,16 +74262,11 @@ dictionary <dfn id=drageventinit>DragEventInit</dfn> : <a href=#mouseeventinit>M
<dd>

<p><a href=#fire-a-dnd-event>Fire a DND event</a> named <code title=event-dragenter><a href=#event-dragenter>dragenter</a></code> at <a href=#the-body-element-0>the body
element</a>, and set the <a href=#current-target-element>current target
element</a> to <a href=#the-body-element-0>the body element</a>, regardless
of whether that event was canceled or not.</p>

<p class=note>If <a href=#the-body-element-0>the body element</a> is null,
then the event will be fired at the <code><a href=#document>Document</a></code>
object (as required by the definition of <a href=#the-body-element-0>the body
element</a>), but the <a href=#current-target-element>current target element</a>
would be set to null, not the <code><a href=#document>Document</a></code>
object.</dd>
element</a>, if there is one, or at the
<code><a href=#document>Document</a></code> object, if not. Then, and set the
<a href=#current-target-element>current target element</a> to <a href=#the-body-element-0>the body
element</a>, regardless of whether that event was
canceled or not.</p>

</dl></dd>

Expand Down
25 changes: 10 additions & 15 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -9750,10 +9750,7 @@ partial interface <span>Document</span> {
<p><dfn>The body element</dfn> of a document is the first child of
<span>the <code>html</code> element</span> that is either a
<code>body</code> element or a <code>frameset</code> element. If
there is no such element, it is null. <span class="impl">If the body
element is null, then when the specification requires that events be
fired at "the body element", they must instead be fired at the
<code>Document</code> object.</span></p>
there is no such element, it is null.</p>

<div class="impl">

Expand Down Expand Up @@ -81522,7 +81519,10 @@ interface <dfn>NavigatorStorageUtils</dfn> {
<p>When an element is <i>focused</i>, key events received by the
document must be targeted at that element. There may be no element
focused; when no element is focused, key events received by the
document must be targeted at <span>the body element</span>.</p>
document must be targeted at <span>the body element</span>, if there
is one, or else at the <code>Document</code>'s root element, if
there is one. If there is no root element, key events must not be
fired.</p>

<p>User agents may track focus for each <span>browsing
context</span> or <code>Document</code> individually, or may support
Expand Down Expand Up @@ -84608,16 +84608,11 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {

<p><span>Fire a DND event</span> named <code
title="event-dragenter">dragenter</code> at <span>the body
element</span>, and set the <span>current target
element</span> to <span>the body element</span>, regardless
of whether that event was canceled or not.</p>

<p class="note">If <span>the body element</span> is null,
then the event will be fired at the <code>Document</code>
object (as required by the definition of <span>the body
element</span>), but the <span>current target element</span>
would be set to null, not the <code>Document</code>
object.</p></dd>
element</span>, if there is one, or at the
<code>Document</code> object, if not. Then, and set the
<span>current target element</span> to <span>the body
element</span>, regardless of whether that event was
canceled or not.</p>

</dl>

Expand Down

0 comments on commit b20ab9b

Please sign in to comment.