Skip to content

Commit

Permalink
[] (0) add the text that makes event handler attributes work; also: m…
Browse files Browse the repository at this point in the history
…ake 'event handler attribute' an actual term with a DFN element; move the issue about non-JS listeners to lower in the prose

git-svn-id: http://svn.whatwg.org/webapps@537 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 1, 2007
1 parent c673027 commit 2e649bd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 19 deletions.
45 changes: 31 additions & 14 deletions index
Original file line number Diff line number Diff line change
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; 31 January 2007</h2>
<h2 class="no-num no-toc" id=working>Working Draft &mdash; 1 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 @@ -2391,7 +2391,7 @@
attribute boolean <a href="#draggable1" title=dom-draggable>draggable</a>;
attribute DOMString <a href="#contenteditable1" title=dom-contenteditable>contenteditable</a>;

// <a href="#event2">event handler DOM attributes</a>
// <a href="#event3">event handler DOM attributes</a>
attribute <span>EventListener</span> <a href="#onclick" title=handler-onclick>onclick</a>;
...more events...
};</pre>
Expand Down Expand Up @@ -5622,7 +5622,7 @@ data:text/xml,<script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[ alert('test
<dd><code title=attr-title><a href="#title1">title</a></code>
</dl>

<p>In addition, the following <a href="#event1">event handler content
<p>In addition, the following <a href="#event2">event handler content
attributes</a> may be specified on any <span>HTML element</span>:

<ul class=brief>
Expand Down Expand Up @@ -19210,8 +19210,8 @@ XXX selection ranges -->
href="#style0">style</a></code> element block).

<li>Event handlers, whether registered through the DOM using <code
title="">addEventListener()</code>, by explicit <a href="#event1">event
handler content attributes</a>, by <a href="#event2">event handler DOM
title="">addEventListener()</code>, by explicit <a href="#event2">event
handler content attributes</a>, by <a href="#event3">event handler DOM
attributes</a>, or otherwise.

<li>Processing of technologies like XBL or SVG that have their own
Expand Down Expand Up @@ -19462,13 +19462,13 @@ XXX selection ranges -->
<h5 id=event-handler-attributes><span class=secno>4.2.7.1. </span>Event
handler attributes</h5>

<p><a href="#html-elements">HTML elements</a> can have event handler
attributes specified. These act as bubbling event listeners for the
element on which they are specified.
<p><a href="#html-elements">HTML elements</a> can have <dfn id=event1>event
handler attributes</dfn> specified. These act as bubbling event listeners
for the element on which they are specified.

<p>Each event handler attribute has two parts, an <a href="#event1"
<p>Each event handler attribute has two parts, an <a href="#event2"
title="event handler content attributes">event handler content
attribute</a> and an <a href="#event2" title="event handler DOM
attribute</a> and an <a href="#event3" title="event handler DOM
attributes">event handler DOM attribute</a>. Event handler attributes must
initially be set to null. When their value changes (through the changing
of their event handler content attribute or their event handler DOM
Expand All @@ -19490,13 +19490,11 @@ XXX selection ranges -->
<code>preventDefault()</code> method must be called when the function
returns true instead.

<p><dfn id=event1>Event handler content attributes</dfn>, when specified,
<p><dfn id=event2>Event handler content attributes</dfn>, when specified,
must contain valid ECMAScript code matching the ECMAScript <code
title="">FunctionBody</code> production. <a
href="#refsECMA262">[ECMA262]</a>

<p class=issue>How do we allow non-JS event handlers?

<p>When an event handler content attribute is set, its new value must be
interpreted as the body of an anonymous function with a single argument
called <code>event</code>, with the new function's scope chain being
Expand All @@ -19514,7 +19512,9 @@ XXX selection ranges -->
<p class=note>See ECMA262 Edition 3, sections 10.1.6 and 10.2.3, for more
details on activation objects. <a href="#refsECMA262">[ECMA262]</a>

<p><dfn id=event2>Event handler DOM attributes</dfn>, on setting, must set
<p class=issue>How do we allow non-JS event handlers?

<p><dfn id=event3>Event handler DOM attributes</dfn>, on setting, must set
the corresponding event handler attribute to their new value, and on
getting, must return whatever the current value of the corresponding event
handler attribute is (possibly null).
Expand All @@ -19532,6 +19532,23 @@ XXX selection ranges -->
<dt>...more events...
</dl>

<p>All event handler attributes on an element, whether set to null or to a
function, must be registered as event listeners on the element, as if the
<code title=dom-EventTarget-addEventListenerNS>addEventListenerNS()</code>
method on the <code>Element</code> object's <code>EventTarget</code>
interface had been invoked when the element was created, with the event
type (<code title=dom-event-type>type</code> argument) equal to the type
described for the event handler attribute in the list above, the namespace
(<code title=dom-event-namespaceURI>namespaceURI</code> argument) set to
null, the listener set to be a target and bubbling phase listener (<code
title=dom-event-useCapture>useCapture</code> argument set to false), the
event group set to the default group (<code
title=dom-event-evtGroup>evtGroup</code> argument set to null), and the
event listener itself (<code title=dom-event-listener>listener</code>
argument) set to do nothing while the event handler attribute is null, and
set to invoke the function associated with the event handler attribute
otherwise.

<h5 id=event><span class=secno>4.2.7.2. </span>Event firing</h5>

<p class=big-issue>maybe _this_ should be moved higher up (terminology?
Expand Down
30 changes: 25 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -17375,9 +17375,9 @@ XXX selection ranges -->

<h5 id="event-handler-attributes">Event handler attributes</h5>

<p><span>HTML elements</span> can have event handler attributes
specified. These act as bubbling event listeners for the element on
which they are specified.</p>
<p><span>HTML elements</span> can have <dfn>event handler
attributes</dfn> specified. These act as bubbling event listeners
for the element on which they are specified.</p>

<p>Each event handler attribute has two parts, an <span title="event
handler content attributes">event handler content attribute</span>
Expand Down Expand Up @@ -17408,8 +17408,6 @@ XXX selection ranges -->
title="">FunctionBody</code> production. <a
href="#refsECMA262">[ECMA262]</a></p>

<p class="issue">How do we allow non-JS event handlers?</p>

<p>When an event handler content attribute is set, its new value
must be interpreted as the body of an anonymous function with a
single argument called <code>event</code>, with the new function's
Expand All @@ -17429,6 +17427,8 @@ XXX selection ranges -->
for more details on activation objects. <a
href="#refsECMA262">[ECMA262]</a></p>

<p class="issue">How do we allow non-JS event handlers?</p>

<p><dfn>Event handler DOM attributes</dfn>, on setting, must set the
corresponding event handler attribute to their new value, and on
getting, must return whatever the current value of the corresponding
Expand All @@ -17450,6 +17450,26 @@ XXX selection ranges -->

</dl>

<p>All event handler attributes on an element, whether set to null
or to a function, must be registered as event listeners on the
element, as if the <code
title="dom-EventTarget-addEventListenerNS">addEventListenerNS()</code>
method on the <code>Element</code> object's <code>EventTarget</code>
interface had been invoked when the element was created, with the
event type (<code title="dom-event-type">type</code> argument) equal
to the type described for the event handler attribute in the list
above, the namespace (<code
title="dom-event-namespaceURI">namespaceURI</code> argument) set to
null, the listener set to be a target and bubbling phase listener
(<code title="dom-event-useCapture">useCapture</code> argument set
to false), the event group set to the default group (<code
title="dom-event-evtGroup">evtGroup</code> argument set to null),
and the event listener itself (<code
title="dom-event-listener">listener</code> argument) set to do
nothing while the event handler attribute is null, and set to invoke
the function associated with the event handler attribute
otherwise.</p>



<h5>Event firing</h5>
Expand Down

0 comments on commit 2e649bd

Please sign in to comment.