<?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>24662</bug_id>
          
          <creation_ts>2014-02-14 16:52:34 +0000</creation_ts>
          <short_desc>Spec for indexed access on Window doesn&apos;t match most browsers</short_desc>
          <delta_ts>2014-02-27 22:16:37 +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/#accessing-other-browsing-contexts</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>adamk</cc>
    
    <cc>adrianba</cc>
    
    <cc>annevk</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>dburns</cc>
    
    <cc>eric</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>travil</cc>
    
    <cc>w3c</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>100593</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-02-14 16:52:34 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html
Multipage: http://www.whatwg.org/C#accessing-other-browsing-contexts
Complete: http://www.whatwg.org/c#accessing-other-browsing-contexts
Referrer: 

Comment:
Spec for indexed access on Window doesn&apos;t match most browsers

Posted from: 98.110.194.132 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:30.0) Gecko/20100101 Firefox/30.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100594</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-02-14 16:53:31 +0000</bug_when>
    <thetext>See http://jsfiddle.net/vJ3PX/

IE is the only browser that maps [0] to the first frame in DOM order here.  Gecko, Blink, WebKit, and Presto all map it to the first frame in insertion order.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100619</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-02-14 21:09:44 +0000</bug_when>
    <thetext>Yeah, this was intentional because matching insertion order seems highly unhelpful and since IE did the other one I presumed there was only a low risk of compat problems.

Are there actual compat problems here, or do you think it&apos;s better for authors to do the insertion order?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100640</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-02-14 22:26:19 +0000</bug_when>
    <thetext>I don&apos;t know.  I&apos;m a bit worried about compat problems, yes, but have no hard data.  Insertion order is also a lot easier to implement in a performant way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101022</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-02-20 21:05:05 +0000</bug_when>
    <thetext>The three implementations using insertion order is a compelling argument, but it does seem quite inferior for authors, which seems more important than implementation complexity.

Anyone else have an opinion here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101094</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-02-21 04:59:46 +0000</bug_when>
    <thetext>This API is pretty useless for authors in practice, I suspect, given ad scripts and like buttons and the like which may or may not insert iframes, more or less randomly from the author&apos;s point of view....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101303</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Seidel">eric</who>
    <bug_when>2014-02-25 01:21:13 +0000</bug_when>
    <thetext>Depending on frames[x] would be an extremely brittle way to code your page.  I suspect (but don&apos;t have any data!) that authors use window.frames just for iterating over all frames and not for depending on a specific frame ordering (which might change every time they redesign their page).  Maybe the first frame, frames[0] is stable enough that sites depend on that?

We could use-counter and possibly remove this accessor all together.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101376</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-02-25 19:22:38 +0000</bug_when>
    <thetext>I doubt we can remove the accessor. In static pages, regardless of whether the order is tree order or insertion order, the order is predictable and stable (since the frames would be inserted in tree order). Even in dynamic pages, most of the time it&apos;ll be close to tree order.

Anyway, I&apos;m happy to change the spec if we don&apos;t think tree order is actually that useful or if there&apos;s a compat need or if you&apos;re just not willing to change or something. IE using tree order seems like a sign that maybe we could use tree order if we agree it&apos;s better for authors. But if we don&apos;t, and you won&apos;t change, then three vs one seems like a slam dunk for the insertion order side.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101538</commentid>
    <comment_count>8</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-02-27 22:16:37 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8515.
Check-in comment: Make the spec match more UAs (frames[] is in insertion order, not tree order)
http://html5.org/tools/web-apps-tracker?from=8514&amp;to=8515</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>