<?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>11267</bug_id>
          
          <creation_ts>2010-11-08 23:22:02 +0000</creation_ts>
          <short_desc>Add a [NonConfigurable] extended attribute</short_desc>
          <delta_ts>2011-06-27 01:26:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>All</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="Cameron McCormack">cam</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>allen</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>jonas</cc>
    
    <cc>jwalden+w3</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>42290</commentid>
    <comment_count>0</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2010-11-08 23:22:02 +0000</bug_when>
    <thetext>Certain properties, such as document and location on Window, may need to be non-configurable for security reasons.  If in general we have read only IDL attributes exposed as configurable accessor properties with only a getter, then we would need [NonConfigurable] or similar to make the property non-configurable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49875</commentid>
    <comment_count>1</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-20 02:42:48 +0000</bug_when>
    <thetext>It&apos;s not clear to me that properties like this would really need to be non-configurable, in fact.  If someone can clearly demonstrate that they do, please reopen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49880</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-06-20 04:14:39 +0000</bug_when>
    <thetext>NPAPI plug-ins commonly determine the location of the document (which affects what they will let it do and their same-origin checks) by loading the URI &quot;javascript:window.location&quot; via NPAPI and then examining the resulting string.

While it&apos;s desirable to add hooks to NPAPI to ask for this information directly, there is an existing installed base of plug-ins where this needs to keep working...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49883</commentid>
    <comment_count>3</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-06-20 05:21:37 +0000</bug_when>
    <thetext>But do we really need WebIDL support for this? You can always describe things in prose if it&apos;s just a one-off (especially one that we long term would like to see go away)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49884</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-06-20 05:41:53 +0000</bug_when>
    <thetext>I guess I&apos;d be fine with that too.  For our internal use we may end up sticking this in the IDL, of course....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49892</commentid>
    <comment_count>5</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-20 06:46:26 +0000</bug_when>
    <thetext>Is there a list of which properties would require this, beyond document and location?  If it&apos;s just a couple like this, defined only on Window, maybe overriding Web IDL in prose is indeed simpler.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49894</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2011-06-20 06:53:24 +0000</bug_when>
    <thetext>See http://www.w3.org/Bugs/Public/show_bug.cgi?id=12998</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49901</commentid>
    <comment_count>7</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-20 08:25:35 +0000</bug_when>
    <thetext>If plugins are evaluating window.location, I guess we need to prevent own properties of the Window object from being defined with the name &quot;location&quot;, as well as prevent redefinition of it on Window.prototype?  What about when an &lt;iframe name=location&gt; is in the document? :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49908</commentid>
    <comment_count>8</comment_count>
    <who name="Allen Wirfs-Brock">allen</who>
    <bug_when>2011-06-20 09:43:02 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; If plugins are evaluating window.location, I guess we need to prevent own
&gt; properties of the Window object from being defined with the name &quot;location&quot;, as
&gt; well as prevent redefinition of it on Window.prototype?  What about when an
&gt; &lt;iframe name=location&gt; is in the document? :)

The best way to prevent the creation of such a property is to predefine a non-configurable own &apos;location&apos; on all Window objects.  The method would be the same as the one that would be inherited from Window.prototype</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49917</commentid>
    <comment_count>9</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-06-20 15:01:48 +0000</bug_when>
    <thetext>&gt; I guess we need to prevent own properties of the Window object from being
&gt; defined with the name &quot;location&quot;, as well as prevent redefinition of it on
&gt; Window.prototype?

In Gecko, &apos;location&apos; is a non-configurable own property on the window.

&gt; What about when an &lt;iframe name=location&gt; is in the document?

This case can be buggy in Gecko right now, but that&apos;s just an internal Gecko bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50203</commentid>
    <comment_count>10</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-24 00:36:54 +0000</bug_when>
    <thetext>I&apos;ve come around to the idea that this should be specified in Web IDL.

Proposal: make

  interface A {
    [NonConfigurable] readonly attribute Type name;
  };

mean that there is no property &quot;name&quot; on A.prototype, but there is an own non-configurable property &quot;name&quot; on every A instance.  (We&apos;ll work under the assumption that the proxies will support this.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50206</commentid>
    <comment_count>11</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-06-24 01:55:46 +0000</bug_when>
    <thetext>Sorry to bikeshed, but isn&apos;t the bigger effect that [NonConfigureable] has the fact that it moves the property from the prototype to the leaf object? If so, wouldn&apos;t something like [LeafProperty] or [ObjectProperty] be a better name?

Also, what happens for if something has [NonConfigureable] (or [LeafProperty] or [ObjectProperty] or whatever) but isn&apos;t marked as readonly? Is that invalid IDL or does that have some meaning?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50207</commentid>
    <comment_count>12</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-24 02:24:58 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; Sorry to bikeshed, but isn&apos;t the bigger effect that [NonConfigureable] has the
&gt; fact that it moves the property from the prototype to the leaf object? If so,
&gt; wouldn&apos;t something like [LeafProperty] or [ObjectProperty] be a better name?

It&apos;s a fair point.  I was thinking of [Unforgeable] or something along those lines.

&gt; Also, what happens for if something has [NonConfigureable] (or [LeafProperty]
&gt; or [ObjectProperty] or whatever) but isn&apos;t marked as readonly? Is that invalid
&gt; IDL or does that have some meaning?

I&apos;d make it invalid IDL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50351</commentid>
    <comment_count>13</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2011-06-27 01:26:22 +0000</bug_when>
    <thetext>I added [Unforgeable], which causes properties corresponding to readonly attributes to non-configurable and to go on the object itself rather than the prototype.

http://dev.w3.org/2006/webapi/WebIDL/#Unforgeable
http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.318;r2=1.319;f=h</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>