HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
763720549Try to clarify event handler stuff2013-01-05 19:58
@@ -86478,66 +86478,78 @@ interface <dfn>NavigatorOnLine</dfn> {
 
   <h5 id="event-handler-attributes">Event handlers</h5>
 
   </div>
 
   <!--test: <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Cscript%3E%0Aw(a%3Ddocument.implementation.createDocument(null%2C%20null%2C%20null))%3B%0Aw(a.appendChild(a.createElementNS('http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml'%2C%20'html')))%3B%0Aw(b%3Da.firstChild.appendChild(a.createElementNS('http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml'%2C%20'body')))%3B%0Aw(b.test%20%3D%20w)%3B%0Aw(b.setAttribute('onclick'%2C%20'test(%22fire%3A%20%22%20%2B%20event)'))%3B%0Aw(b.onclick)%3B%0Aw(e%3Da.createEvent('Event'))%3B%0Aw(e.initEvent('click'%2C%20false%2C%20false))%3B%0Aw(b.dispatchEvent(e))%3B%0A%3C%2Fscript%3E">test</a>-->
 
   <p>Many objects can have <dfn>event handlers</dfn> specified. These act as non-capture event
   listeners for the object on which they are specified. <a href="#refsDOM">[DOM]</a></p>
 
+  <p>An <span title="event handlers">event handler</span> has a name, which always starts with
+  "<code title="">on</code>" and is followed by the name of the event for which it is intended.</p>
+
   <p>An <span title="event handlers">event handler</span> can either have the value null or be set
   to a callback object. This is defined using the <code>EventHandler</code> callback interface type.
   <span class="impl">Initially, event handlers must be set to null.</span></p>
 
   <p>Event handlers are exposed in one of two ways.</p>
 
   <p>The first way, common to all event handlers, is as an <span title="event handler IDL
   attributes">event handler IDL attribute</span>.</p>
 
   <p>The second way is as an <span title="event handler content attributes">event handler content
   attribute</span>. Event handlers on <span>HTML elements</span> and some of the event handlers on
   <code>Window</code> objects are exposed in this way.</p>
 
   <div class="impl">
 
   <hr>
 
-  <p><dfn>Event handler IDL attributes</dfn>, on setting, must set the corresponding event handler
+  <p>An <dfn title="event handler IDL attributes">event handler IDL attribute</dfn> is an IDL
+  attribute for a specific <span title="event handlers">event handler</span>. The name of the IDL
+  attribute is the same as the name of the <span title="event handlers">event handler</span>.</p>
+
+  <p><span>Event handler IDL attributes</span>, on setting, must set the corresponding event handler
   to their new value, and on getting, must return whatever the current value of the corresponding
   event handler is (possibly null).</p>
 
   <p>If an <span title="event handler IDL attributes">event handler IDL attribute</span> exposes an
   <span title="event handlers">event handler</span> of an object that doesn't exist, it must always
   return null on getting and must do nothing on setting.</p>
 
   <p class="note">This can happen in particular for <span title="event handler IDL attributes">event
   handler IDL attribute</span> on <code>body</code> elements that do not have corresponding
   <code>Window</code> objects.</p>
 
   <p class="note">Certain event handler IDL attributes have additional requirements, in particular
   the <code title="handler-MessagePort-onmessage">onmessage</code> attribute of
   <code>MessagePort</code> objects.</p>
 
   <p>On getting, <span>event handler IDL attributes</span> must return the value of their
-  corresponding event handlers, except when the value is an <span
+  corresponding <span>event handlers</span>, except when the value is an <span
   title="concept-handler-error">internal error value</span>, in which case the user agent must set
   the corresponding event handler to null, and then throw an exception corresponding to the error
   condition.</p>
 
   <hr>
 
   </div>
 
-  <p><dfn>Event handler content attributes</dfn>, when specified, must contain valid JavaScript code
-  which, when parsed, would match the <code title="">FunctionBody</code> production after automatic
-  semicolon insertion. <a href="#refsECMA262">[ECMA262]</a></p>
+  <p>An <dfn title="event handler content attributes">event handler content attribute</dfn> is a
+  content attribute for a specific <span title="event handlers">event handler</span>. The name of
+  the content attribute is the same as the name of the <span title="event handlers">event
+  handler</span>.</p>
+
+  <p><span>Event handler content attributes</span>, when specified, must contain valid JavaScript
+  code which, when parsed, would match the <code title="">FunctionBody</code> production after
+  automatic semicolon insertion. <a href="#refsECMA262">[ECMA262]</a></p>
 
   <div class="impl">
 
   <!-- SCRIPT EXEC -->
   <p>When an <span title="event handler content attributes">event handler content attribute</span>
   is set, if the element is owned by a <code>Document</code> that is in a <span>browsing
   context</span>, and <span title="concept-bc-script">scripting is enabled</span> for that
   <span>browsing context</span>, the user agent must run the following steps to create a <span
   title="concept-script">script</span> after setting the content attribute to its new value:</p>
 

|