<?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>23956</bug_id>
          
          <creation_ts>2013-12-02 19:28:04 +0000</creation_ts>
          <short_desc>what if there&apos;s no browsing context when you &quot;get the current value of the event handler&quot;?</short_desc>
          <delta_ts>2014-01-06 22:10:44 +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/#getting-the-current-value-of-the-event-handler</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>bugs</cc>
    
    <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>96975</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-12-02 19:28:04 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/
Multipage: http://www.whatwg.org/C#getting-the-current-value-of-the-event-handler
Complete: http://www.whatwg.org/c#getting-the-current-value-of-the-event-handler
Referrer: 

Comment:
what if there&apos;s no browsing context when you &quot;get the current value of the
event handler&quot;?

Posted from: 2620:0:1000:167c:84ad:7d24:e50b:d745 by ian@hixie.ch
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1712.4 Safari/537.36</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96993</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-12-02 21:53:54 +0000</bug_when>
    <thetext>Set attribute, import node, click:
  http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2672
  http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2675
Set attribute, click, import node, click:
  http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2673
  http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2674

If I&apos;m interpreting this right:
Firefox acts as if it compiled the script in the context of the original document.
Chrome fails to compile the script if it&apos;s not in a document with a global object.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96994</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-12-02 22:11:04 +0000</bug_when>
    <thetext>Yeah, the Firefox behavior here is rather wacky.  I don&apos;t think we object to changing it.

If we do want to always compile the script, using the global that would be used for the JS reflection of the node&apos;s ownerDocument would make sense to me.

Olli, thoughts?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96995</commentid>
    <comment_count>3</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-12-02 22:13:41 +0000</bug_when>
    <thetext>Yeah, I was planning to change Gecko&apos;s behavior even before this bug.
(because of https://bugzilla.mozilla.org/show_bug.cgi?id=944847)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97202</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-12-05 19:01:50 +0000</bug_when>
    <thetext>Ok so if the event handler is on an Element and the Element&apos;s Document has no browsing context, we should just set it to null when we&apos;re compiling?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97210</commentid>
    <comment_count>5</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-12-05 19:36:25 +0000</bug_when>
    <thetext>...and keep the uncompiled handler so that if the element is adopted to a document which is in a browsing context the element gets the handler compiled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97543</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-12-12 22:37:37 +0000</bug_when>
    <thetext>Wow, you&apos;re not kidding. Thanks for pointing that out, I would never have thought to even check for that.

  http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2692
  http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2693</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98042</commentid>
    <comment_count>7</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-01-06 21:35:31 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8375.
Check-in comment: Rearrange requirements for handling internal raw uncompiled handlers
http://html5.org/tools/web-apps-tracker?from=8374&amp;to=8375</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98045</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-01-06 22:10:33 +0000</bug_when>
    <thetext>  http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2711
  http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2714
  http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2718

Ok I think the spec now matches what Firefox does on these tests. (Chrome is a little different, e.g. in 2718.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98046</commentid>
    <comment_count>9</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-01-06 22:10:44 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8376.
Check-in comment: Make content attribute event handlers work slightly more like in more browsers.
http://html5.org/tools/web-apps-tracker?from=8375&amp;to=8376</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>