<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20549</bug_id>
          
          <creation_ts>2013-01-02 18:14:40 +0000</creation_ts>
          <short_desc>Need to define &quot;corresponding event handler&quot;</short_desc>
          <delta_ts>2013-03-06 22:38:28 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#events</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>80843</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-01-02 18:14:40 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html
Multipage: http://www.whatwg.org/C#events
Complete: http://www.whatwg.org/c#events

Comment:
Need to define &quot;corresponding event handler&quot;

Posted from: 173.48.81.109 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20121217 Firefox/20.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80844</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-02 18:15:42 +0000</bug_when>
    <thetext>The spec uses the term &quot;corresponding event handler&quot; a lot, but doesn&apos;t actually define it anywhere.  This is especially relevant for things like what setAttribute and removeAttribute should do.  Specifically, document.body.removeAttribute(&quot;onload&quot;) should remove the load event handler on the _Window_, as far as I can tell, and this is entirely non-obvious as things stand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80920</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-01-05 04:03:51 +0000</bug_when>
    <thetext>In theory, this is defined here:

   http://whatwg.org/html/#handler-window-onload

...using the definitions here:

   http://whatwg.org/html/#event-handler-attributes

Is that insufficient?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80922</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-05 04:17:35 +0000</bug_when>
    <thetext>That wasn&apos;t exactly clear to me when I read this.

It&apos;s worth just explicitly defining the term &quot;corresponding event handler&quot; in terms of these tables, I think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80924</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-01-05 04:40:21 +0000</bug_when>
    <thetext>As in this?:

&lt;p&gt;An &lt;span title=&quot;event handlers&quot;&gt;event handler&lt;/span&gt; has a name. Its &lt;spantitle=&quot;event handler IDL attributes&quot;&gt;event handler IDL attribute&lt;/span&gt;, if any, has the same name. Similarly, its &lt;span title=&quot;event handler content attributes&quot;&gt;event handler content attribute&lt;/span&gt;, if any, has the same name.&lt;/p&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80925</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-05 05:18:23 +0000</bug_when>
    <thetext>What I&apos;m after is something that defines the actual word combination &quot;corresponding event handler&quot; when one starts with an attribute.  That means defining that it has the same name, yes, but also defining which object it lives on.  Saying that the tables in question determine this last is fine, but it just needs to be said.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80928</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-01-05 06:45:28 +0000</bug_when>
    <thetext>&quot;Corresponding&quot; here is just used in its English meaning... I don&apos;t understand why this needs a definition beyond that. What other interpretation could there be?

The spec explicitly says that the event handlers have &quot;corresponding content attributes and IDL attributes exposed on the body and frameset elements&quot; already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80929</commentid>
    <comment_count>7</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-05 06:50:27 +0000</bug_when>
    <thetext>You&apos;re the one who keeps telling people to not read between the lines...

The spec is assuming a bijective relationship between attributes and event handlers, but not making it clear anywhere.  It defines a mapping from event handlers to attributes, but not the other direction.  So for an event handler there is a corresponding attribute, but it&apos;s not actually stated that for the attribute there is a corresponding event handler.

The English meaning of corresponding just implies a function, not anything about the function being invertible...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80944</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-01-05 19:57:18 +0000</bug_when>
    <thetext>I really don&apos;t understand what interpretation of the spec is possible other than the one that is intended. I&apos;m not saying you need to read between the lines, I&apos;m saying the text is unambiguous as written as far as I can tell...

I&apos;ve tried to clarify it a bit (see patch below). If that&apos;s not enough, please try to explain what other interpretation is possible, and what text you would suggest that would make it unambiguous.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80945</commentid>
    <comment_count>9</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-01-05 19:58:21 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7637.
Check-in comment: Try to clarify event handler stuff
http://html5.org/tools/web-apps-tracker?from=7636&amp;to=7637</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80951</commentid>
    <comment_count>10</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-06 00:51:07 +0000</bug_when>
    <thetext>&gt; I really don&apos;t understand what interpretation of the spec is possible

The code I was looking at tried removing an event handler on the &lt;body&gt; itself when removeAttribute(&quot;onload&quot;) was called.

Will take a look at the diff later.  Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80952</commentid>
    <comment_count>11</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-06 01:32:29 +0000</bug_when>
    <thetext>The new setup is better, yeah.  Thank you!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84048</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-06 22:38:28 +0000</bug_when>
    <thetext>Marking fixed based on comment 11; please reopen if I missed something.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>