Skip to content

Commit

Permalink
[e] (0) move the activation behavior stuff into the interactive eleme…
Browse files Browse the repository at this point in the history
…nts section for now

git-svn-id: http://svn.whatwg.org/webapps@541 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 2, 2007
1 parent 122c778 commit 13ef39f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 95 deletions.
75 changes: 28 additions & 47 deletions index
Expand Up @@ -1483,9 +1483,6 @@
3D scenes</a>

<li><a href="#timers"><span class=secno>11.4. </span>Timers</a>

<li><a href="#event-handling"><span class=secno>11.5. </span>Event
handling</a>
</ul>

<li class=no-num><a href="#references">References</a>
Expand Down Expand Up @@ -1930,10 +1927,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 term <dfn id=activation0>activation behavior</dfn> is used as
defined in the DOM3 Events specification. <a
href="#refsDOM3EVENTS">[DOM3EVENTS]</a> <span class=big-issue>At the time
of writing, DOM3 Events hadn't yet been updated to define that
phrase.</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
Expand Down Expand Up @@ -5526,7 +5524,15 @@ 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 class=big-issue>Parts of this section should eventually be moved to DOM3
Events.</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>Certain elements in HTML can be activated, for instance <code><a
href="#a0">a</a></code> elements, <code>button</code> elements, or
Expand All @@ -5542,13 +5548,20 @@ data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test

<p>The default action of this <code title=event-click>click</code> event,
or of the real <code title=event-click>click</code> event if the element
was activated by clicking a pointing device, must be to dispatch yet
another event, namely <a
href="http://www.w3.org/TR/DOM-Level-3-Events/events.html#event-DOMActivate"><code>DOMActivate</code></a>.
It is the default action of <em>that</em> event that then performs the
actual action.</p>
<!-- XXX need to define the dispatching of
DOMActivate in the same way we define the dispatching of click -->
was activated by clicking a pointing device, must be to <span title="fire
a DOMActivate event">fire 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.

<p class=note>The above doesn't happen for arbitrary synthetic events
dispatched by author script. However, the <code title=dom-click><a
href="#click">click()</a></code> method can be used to make it happen
programmatically.

<p>For certain form controls, this process is complicated further by <a
href="http://whatwg.org/specs/web-forms/current-work/#the-click">changes
Expand Down Expand Up @@ -33638,38 +33651,6 @@ interface <dfn id=timeouthandler>TimeoutHandler</dfn> {
<p>Timeouts must never fire while another script is executing. (Thus the
HTML scripting model is strictly single-threaded and not reentrant.)

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

<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>

<p class=big-issue>This section will be written in a future
Expand Down
78 changes: 30 additions & 48 deletions source
Expand Up @@ -582,10 +582,11 @@
event-DOMActivate, etc, here, and just have the section be a general
"defined in other specifications" section -->

<p>The term <!--<dfn>--><span>activation
behavior</span><!--</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>
<p>The term <dfn>activation behavior</dfn> is used as defined in the
DOM3 Events specification. <a
href="#refsDOM3EVENTS">[DOM3EVENTS]</a> <span class="big-issue">At
the time of writing, DOM3 Events hadn't yet been updated to define
that phrase.</span></p>

<p>The terms <dfn>browsing context</dfn> and <dfn>top-level browsing
context</dfn> are used as defined in the Window Object
Expand Down Expand Up @@ -4357,7 +4358,16 @@ data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test

<h5><dfn>Interactive elements</dfn></h5>

<p class="big-issue">this should be moved to DOM3 Events</p>
<p class="big-issue">Parts of this section should eventually be
moved to DOM3 Events.</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>Certain elements in HTML can be activated, for instance
<code>a</code> elements, <code>button</code> elements, or
Expand All @@ -4369,17 +4379,25 @@ data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test
<p>When activation is performed via some method other than clicking
the pointing device, the default action of the event that triggers
the activation must, instead of being activating the element
directly, be to <span>fire a <code title="">click</code> event</span>
on the same element.</p>
directly, be to <span>fire a <code title="">click</code>
event</span> on the same element.</p>

<p>The default action of this <code title="event-click">click</code>
event, or of the real <code title="event-click">click</code> event
if the element was activated by clicking a pointing device, must be
to dispatch yet another event, namely <a
href="http://www.w3.org/TR/DOM-Level-3-Events/events.html#event-DOMActivate"><code>DOMActivate</code></a>.
It is the default action of <em>that</em> event that then performs
the actual action.</p> <!-- XXX need to define the dispatching of
DOMActivate in the same way we define the dispatching of click -->
to <span title="fire a DOMActivate event">fire 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
<span>activation behavior</span>; the first element, in reverse tree
order, to have one, must have its activation behavior executed.</p>

<p class="note">The above doesn't happen for arbitrary synthetic
events dispatched by author script. However, the <code
title="dom-click">click()</code> method can be used to make it
happen programmatically.</p>

<p>For certain form controls, this process is complicated further by
<a
Expand Down Expand Up @@ -30548,42 +30566,6 @@ interface <dfn>TimeoutHandler</dfn> {
reentrant.)</p>


<h3 id="event-handling">Event handling</h3>

<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)</p>

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

<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.</p>



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

Expand Down

0 comments on commit 13ef39f

Please sign in to comment.