<?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>12998</bug_id>
          
          <creation_ts>2011-06-20 06:38:39 +0000</creation_ts>
          <short_desc>Some attributes are not overridable with &apos;var&apos; in browsers. See http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1035</short_desc>
          <delta_ts>2012-04-20 17:15:36 +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>LC1 HTML5 spec</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/#window</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>cam</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>zcorpan</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>49889</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-06-20 06:38:39 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html
Multipage: http://www.whatwg.org/C#window
Complete: http://www.whatwg.org/c#window

Comment:
Some attributes are not overridable with &apos;var&apos; in browsers. See
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1035

Posted from: 85.227.159.4 by simonp@opera.com
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.5.8; U; en) Presto/2.8.131 Version/11.11</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49890</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-06-20 06:41:46 +0000</bug_when>
    <thetext>Firefox
log: window
log: navigator
log: location
log: window
log: document
log: navigator
log: location

Chrome
log: top
log: window
log: location
log: document threw TypeError: const &apos;document&apos; has already been declared
log: webkitNotifications
log: sessionStorage
log: webkitIndexedDB
log: applicationCache
log: pageXOffset
log: webkitStorageInfo
log: localStorage
log: defaultstatus
log: styleMedia

Opera
log: devicePixelRatio
log: document
log: frameElement
log: localStorage
log: location
log: outerHeight
log: outerWidth
log: parent
log: screenX
log: screenY
log: self
log: sessionStorage
log: top
log: window</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49891</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-06-20 06:44:20 +0000</bug_when>
    <thetext>Also see http://www.w3.org/Bugs/Public/show_bug.cgi?id=11267</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49897</commentid>
    <comment_count>3</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-20 07:05:36 +0000</bug_when>
    <thetext>I would those readonly attributes in Opera and Chrome to become overridable once properties for IDL attributes are moved to the prototype as accessor properties.

(I think it doesn&apos;t matter here, but note that doing `eval(&quot;var x&quot;)` is different from `var x` in ES5, as the former creates properties that are configurable while the latter creates them non-configurable.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49903</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-06-20 08:38:27 +0000</bug_when>
    <thetext>Also http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1037

Firefox
doesn&apos;t like messing with the location prototype at all (Location.prototype[x] also throws)

Chrome
log: Non-configurable: replace, origin, assign, pathname, host, hostname, port, search, hash, reload, href, protocol
log: Normal: getParameter

Opera
log: Non-configurable: hash, host, hostname, href, pathname, port, protocol, search
log: Normal: reload, toString, valueOf, replace, assign</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49905</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-06-20 08:47:11 +0000</bug_when>
    <thetext>http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1038

Firefox and Opera override location there. Chrome does not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50202</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-06-24 00:34:40 +0000</bug_when>
    <thetext>What does this translate to in the IDL?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50205</commentid>
    <comment_count>7</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-24 00:42:58 +0000</bug_when>
    <thetext>Bug 11267 has a proposal for a [NonConfigurable] extended attribute that you can put on readonly IDL attributes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53359</commentid>
    <comment_count>8</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:13:07 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54853</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-13 01:43:24 +0000</bug_when>
    <thetext>So... what, do I just mark all the attributes in comment 1 as [NonConfigurable]? How does this relate to [Replaceable]?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54855</commentid>
    <comment_count>10</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-08-13 02:09:44 +0000</bug_when>
    <thetext>If the goal is to make these properties not overridable with &quot;var&quot;, then you wouldn&apos;t want to make them [Replaceable].  It sounds like putting [Unforgeable] on the IDL attributes whose properties you want to be non-configurable and non-overridable on the object itself is the thing to do.  (I renamed [NonConfigurable] to [Unforgeable] to reflect its purpose better, since the effect is also to make [[DefineOwnProperty]] on the object itself to refuse to create a property with the given name.)

I haven&apos;t done the testing myself, so I won&apos;t on which specific IDL attributes need this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54858</commentid>
    <comment_count>11</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-08-13 02:13:40 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; I haven&apos;t done the testing myself, so I won&apos;t on which specific IDL attributes
&gt; need this.

*won&apos;t comment</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57097</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-21 20:01:01 +0000</bug_when>
    <thetext>Ok, I&apos;ll mark the following as [Unforgeable]:
  Window.window
  Window.location
  Window.document

(That&apos;s the common subset in comment 1, it seems.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57153</commentid>
    <comment_count>13</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-09-22 14:14:52 +0000</bug_when>
    <thetext>IIRC Flash uses something like

javascript:top.location.href

as part of its &quot;origin&quot; security checks, so &apos;top&apos; should be unforgeable in order to keep Flash security in check.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57210</commentid>
    <comment_count>14</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-22 23:50:05 +0000</bug_when>
    <thetext>How does Firefox avoid Flash&apos;s origin checks getting owned?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57211</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-22 23:51:40 +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: see diff given below
Rationale: see comment 12 and comment 13.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57212</commentid>
    <comment_count>16</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-09-22 23:54:00 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6569.
Check-in comment: Mark some Window properties [Unforgeable].
http://html5.org/tools/web-apps-tracker?from=6568&amp;to=6569</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66902</commentid>
    <comment_count>17</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-04-20 17:15:36 +0000</bug_when>
    <thetext>&gt; How does Firefox avoid Flash&apos;s origin checks getting owned?

Recently, https://wiki.mozilla.org/NPAPI:DocumentOrigin

I don&apos;t recall seeing &quot;top&quot; in the javascript that Flash used to evaluate, but I&apos;ll see if I can double-check.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>