Skip to content

Commit

Permalink
[] (0) activation behavior; remove redundant comments; define .click(…
Browse files Browse the repository at this point in the history
…) better; remove some mentions of xml-events namespace; and some notes of stuff that DOM3 Events should say; note duplication in such notes.

git-svn-id: http://svn.whatwg.org/webapps@539 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 2, 2007
1 parent 2c5bb89 commit 4ee3fcf
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 64 deletions.
97 changes: 64 additions & 33 deletions index
Expand Up @@ -22,7 +22,7 @@

<h1 id=web-applications>Web Applications 1.0</h1>

<h2 class="no-num no-toc" id=working>Working Draft &mdash; 1 February 2007</h2>
<h2 class="no-num no-toc" id=working>Working Draft &mdash; 2 February 2007</h2>

<p>You can take part in this work. <a
href="http://www.whatwg.org/mailing-list">Join the working group's
Expand Down Expand Up @@ -1930,6 +1930,11 @@
event-DOMActivate, etc, here, and just have the section be a general
"defined in other specifications" section -->

<p>The term <!--<dfn>--><a href="#activation0">activation
behavior</a><!--</dfn>--> is used as defined in the DOM Events
specification. <span class=big-issue>at time of writing, it wasn't there
yet. see the section at the end of this spec.</span>

<p>The terms <dfn id=browsing>browsing context</dfn> and <dfn
id=top-level>top-level browsing context</dfn> are used as defined in the
Window Object specification. <a href="#refsWINDOW">[WINDOW]</a>
Expand Down Expand Up @@ -2395,11 +2400,6 @@
attribute <span>EventListener</span> <a href="#onclick" title=handler-onclick>onclick</a>;
...more events...
};</pre>
<!-- XXX
click() https://bugzilla.mozilla.org/attachment.cgi?id=176950
also focus(), blur(), etc.
should the click, focus, blur methods be recursible?
-->

<p>As with the <code><a href="#htmldocument">HTMLDocument</a></code>
interface, the <code><a href="#htmlelement">HTMLElement</a></code>
Expand Down Expand Up @@ -5526,6 +5526,8 @@ data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test
<h5 id=interactive0><span class=secno>3.3.3.5. </span><dfn
id=interactive3>Interactive elements</dfn></h5>

<p class=big-issue>this should be moved to DOM3 Events

<p>Certain elements in HTML can be activated, for instance <code><a
href="#a0">a</a></code> elements, <code>button</code> elements, or
<code>input</code> elements when their <code>type</code> attribute is set
Expand Down Expand Up @@ -6159,7 +6161,15 @@ DOCUMENT
<h4 id=activation><span class=secno>3.5.1. </span>Activation</h4>

<p>The <dfn id=click title=dom-click>click()</dfn> method must <a
href="#firing">fire a <code>click</code> event</a> at the element.
href="#firing">fire a <code>click</code> event</a> at the element, whose
default action is the <span title="fire a DOMActivate event">firing of a
further <code title=event-DOMActivate>DOMActivate</code> event</span> at
the same element, whose own default action is to go through all the
elements the <code title=event-DOMActivate>DOMActivate</code> event
bubbled through (starting at the target node and going towards the
<code>Document</code> node), looking for an element with an <a
href="#activation0">activation behavior</a>; the first element, in reverse
tree order, to have one, must have its activation behavior executed.

<h4 id=focus><span class=secno>3.5.2. </span>Focus</h4>

Expand All @@ -6180,7 +6190,8 @@ DOCUMENT
id=blur title=dom-blur><code>blur()</code></dfn> methods must focus and
unfocus the element respectively, if the element is focusable.

<p class=big-issue>Well that clearly needs more.
<p class=big-issue>Well that clearly needs more.</p>
<!-- XXX e.g. should the click, focus, blur methods be recursible? -->

<p>The <dfn id=activeelement
title=dom-document-activeElement><code>activeElement</code></dfn>
Expand Down Expand Up @@ -19563,9 +19574,8 @@ XXX selection ranges -->
<p><dfn id=firing title="fire a click event">Firing a <code
title=event-click>click</code> event</dfn> means that a <a
href="http://www.w3.org/TR/DOM-Level-3-Events/events.html#event-click"><code>click</code></a>
event in the <code>http://www.w3.org/2001/xml-events</code> namespace,
which bubbles and is cancelable, and which uses the
<code>MouseEvent</code> interface, must be dispatched at the given
event with no namespace, which bubbles and is cancelable, and which uses
the <code>MouseEvent</code> interface, must be dispatched at the given
element. 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 set
Expand All @@ -19581,26 +19591,24 @@ XXX selection ranges -->
<p><dfn id=firing0 title="fire a change event">Firing a <code
title=event-change>change</code> event</dfn> means that a <a
href="http://www.w3.org/TR/DOM-Level-3-Events/events.html#event-change"><code>change</code></a>
event in the <code>http://www.w3.org/2001/xml-events</code> namespace,
which bubbles but is not cancelable, and which uses the <code>Event</code>
interface, must be dispatched at the given element. The event object must
have its <code title="">detail</code> attribute set to 0.
event with no namespace, which bubbles but is not cancelable, and which
uses the <code>Event</code> interface, must be dispatched at the given
element. The event object must have its <code title="">detail</code>
attribute set to 0.

<p><dfn id=firing1 title="fire a contextmenu event">Firing a <code
title=event-contextmenu>contextmenu</code> event</dfn> means that a <code
title=event-contextmenu>contextmenu</code> event in the
<code>http://www.w3.org/2001/xml-events</code> namespace, which bubbles
and is cancelable, and which uses the <code>Event</code> interface, must
be dispatched at the given element. The event object must have its <code
title="">detail</code> attribute set to 0.
title=event-contextmenu>contextmenu</code> event with no namespace, which
bubbles and is cancelable, and which uses the <code>Event</code>
interface, must be dispatched at the given element. The event object must
have its <code title="">detail</code> attribute set to 0.

<p><dfn id=firing2 title="fire a simple event">Firing a simple event called
<var title="">e</var></dfn> means that an event with the name <var
title="">e</var>, in the <code>http://www.w3.org/2001/xml-events</code>
namespace, which does not bubble but is cancelable, and which uses the
<code>Event</code> interface, must be dispatched at the given element. The
event object must have its <code title="">detail</code> attribute set to
0.
title="">e</var>, with no namespace, which does not bubble but is
cancelable, and which uses the <code>Event</code> interface, must be
dispatched at the given element. The event object must have its <code
title="">detail</code> attribute set to 0.

<p><dfn id=firing3 title="fire a show event">Firing a <code
title=event-show>show</code> event</dfn> means <a href="#firing2"
Expand Down Expand Up @@ -33647,12 +33655,35 @@ interface <dfn id=timeouthandler>TimeoutHandler</dfn> {

<h3 id=event-handling><span class=secno>11.5. </span>Event handling</h3>

<p class=big-issue>We need a section to define how events all work, default
actions, etc. For example, how does clicking on a span in a link that is
in another link actually cause a link to be followed? which one? (where
should this section be?)</p>
<!-- XXX "following hyperlinks" is the default action of DOMActivate -->
<!-- (doing this for 'trusted' events only must be allowed) -->
<p class=note>This section's requirements are expected to be moved to the
DOM3 Events specification.</p>
<!--
TESTS:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cp%20tabindex%3D1%3Etest%20%3Ca%20href%3D%22%22%3E%20%3Cem%3Etest%3C/em%3E%20%3C/a%3E%0A%3Cscript%3E%0A%20function%20test%20%28e%29%20%7B%20w%28e.type%20+%20%27%20on%20%27%20+%20e.target.tagName%20+%20%27%20through%20%27%20+%20e.currentTarget.tagName%29%3B%20%7D%0A%20document.getElementsByTagName%28%27a%27%29%5B0%5D.addEventListener%28%27click%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27a%27%29%5B0%5D.addEventListener%28%27DOMActivate%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27p%27%29%5B0%5D.addEventListener%28%27click%27%2C%20test%2C%20false%29%3B%0A%20document.getElementsByTagName%28%27p%27%29%5B0%5D.addEventListener%28%27DOMActivate%27%2C%20test%2C%20false%29%3B%0A%3C/script%3E%0A
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Ca%20href%3Dhttp%3A//google.com/%20target%3Da%3EA%3C/a%3E%3Ca%20href%3Dhttp%3A//yahoo.com/%20target%3Db%3EB%3C/a%3E%3Cbr%3E%0A%3Ciframe%20name%3Da%3E%3C/iframe%3E%3Ciframe%20name%3Db%3E%3C/iframe%3E%0A%3Cscript%3E%0A%20var%20a%20%3D%20document.getElementsByTagName%28%27a%27%29%5B0%5D%3B%0A%20var%20b%20%3D%20document.getElementsByTagName%28%27a%27%29%5B1%5D%3B%0A%20a.appendChild%28b%29%3B%0A%3C/script%3E
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Cform%20action%3D%22http%3A//google.com/%22%20onsubmit%3D%22w%28%27onsubmit%27%29%22%3E%3Cem%3EA%3C/em%3E%3C/form%3E%0A%3Cscript%3E%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.attachEvent%28%27onsubmit%27%2C%20function%20%28%29%20%7B%20w%28%27submit%20fired%27%29%20%7D%29%3B%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.fireEvent%28%27onsubmit%27%29%3B%0A%3C/script%3E
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%0A%3Cform%20action%3D%22http%3A//google.com/%22%3EX%3C/form%3E%0A%3Cscript%3E%0Avar%20evt%20%3D%20document.createEvent%28%22Events%22%29%3B%0Aevt.initEvent%28%22submit%22%2C%20true%2C%20true%29%3B%0Adocument.getElementsByTagName%28%27form%27%29%5B0%5D.dispatchEvent%28evt%29%3B%0A%3C/script%3E
-->

<p>When device specific events, such as <code
title=event-mousedown>mousedown</code>/<code
title=event-mouseup>mouseup</code> or <code
title=event-keydown>keydown</code>/<code title=event-keyup>keyup</code>,
whether triggered by the user or by synthetic event dispatch, are fired,
they must result in a <code title=event-click>click</code> event being
fired, whose default action is the firing of a further <code
title=event-DOMActivate>DOMActivate</code> event. <span
class=big-issue>(need to define what the targets should be, what the event
details should be, etc)</span>

<p>That DOMActivate event's default action is to go through all the
elements it bubbled through, looking for one with an <dfn
id=activation0>activation behavior</dfn>. The first element, in reverse
tree order, to have one, must have its activation behavior executed.

<p>Synthetic events (those dispatched using <code
title=dom-EventTarget-dispatchEvent>dispatchEvent()</code> by author code)
must not have any user-agent-defined default actions.

<h2 class=no-num id=references>References</h2>

Expand Down Expand Up @@ -35040,8 +35071,8 @@ screen contains top left width height pixelDepth colorDepth availWidth availHeig
and Checked State of the command defined by a <code
title="command-element">command</code> element are as described
above. The Action of a <code title="command-element">command</code>
element is that a <code>{"http://www.w3.org/2001/xml-events",
"click"}</code> event is fired on the element.</p>
element is that a <code>{null, "click"}</code> event is fired on the
element.</p>

<p>If the Type of the command is "checkbox", when a
<code>click</code> event is dispatched on the element, user agents
Expand Down

0 comments on commit 4ee3fcf

Please sign in to comment.