<?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>17712</bug_id>
          
          <creation_ts>2012-07-07 15:47:46 +0000</creation_ts>
          <short_desc>Window name lookup algorithm is wrong for named subwindows</short_desc>
          <delta_ts>2012-09-21 10:29:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Silvia Pfeiffer">silviapfeiffer1</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69691</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-07-07 15:47:46 +0000</bug_when>
    <thetext>Consider this testcase:

  &lt;iframe name=&quot;bar&quot; 
          src=&quot;data:text/html,&lt;script&gt;window.name=&apos;foo&apos;&lt;/script&gt;&quot;&gt;&lt;/iframe&gt;
  &lt;script&gt;
    window.onload = function() { 
      alert(window.foo); 
      alert(window.bar); 
    }
  &lt;/script&gt;

This interoperably alerts a Window object and then &quot;undefined&quot; in Chrome, Safari, Opera, Firefox.  IE9 seems to go the other way around: undefined and then a window object (have to test with a second real document, afaict, because data: doesn&apos;t work in IE9 there).

The Chrome, Safari, Opera, Firefox behavior is wrong as the spec is currently written, since the spec only looks at name attributes on &lt;iframe&gt;, not at window names.  But it sure looks pretty interoperable except for IE.

Note also that the spec as currently written would completely break child window lookup by name in framesets, as far as I can tell, since it only considers &lt;iframe&gt; and not &lt;frame&gt; in step 2 of &quot;determine the value of a named property name when the Window object is indexed for property retrieval&quot;.  I&apos;m 100% sure this is not web-compatible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69697</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-07-07 23:53:32 +0000</bug_when>
    <thetext>The lack of checking for &lt;frame&gt; is totally an oversight on my part.

The other part was because I was testing IE when speccing this, I believe. I can definitely change the &quot;named elements&quot; algorithm to refer to the browsing context name for &lt;iframe&gt; and &lt;frame&gt; elements instead of their name=&quot;&quot; attributes, if that&apos;s better for compat. What would be ideal is to see if there are any pages that depend on this one way or the other.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70247</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 07:12:45 +0000</bug_when>
    <thetext>This bug was cloned to create bug 17888 as part of operation convergence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74198</commentid>
    <comment_count>3</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2012-09-21 10:29:01 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If
   you are satisfied with this response, please change the state of
   this bug to CLOSED. If you have additional information and would
   like the Editor to reconsider, please reopen this bug. If you would
   like to escalate the issue to the full HTML Working Group, please
   add the TrackerRequest keyword to this bug, and suggest title and
   text for the Tracker Issue; or you may create a Tracker Issue
   yourself, if you are able to do so. For more details, see this
   document:       http://dev.w3.org/html5/decision-policy/decision-policy.html

   Status: Accepted
   Change Description: Patch applied
https://github.com/w3c/html/commit/e17fea4b70a2ffc15c15784eaf8c68a36f2c432e
   Rationale: adopted from WHATWG</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>