<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>126522</bug_id>
          
          <creation_ts>2014-01-06 06:37:13 -0800</creation_ts>
          <short_desc>Named object access properties should be configurable or don&apos;t exist at all</short_desc>
          <delta_ts>2018-06-04 06:02:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://github.com/ajaxorg/ace/issues/1741</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Derk-Jan Hartman">hartman.wiki</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>964615</commentid>
    <comment_count>0</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2014-01-06 06:37:13 -0800</bug_when>
    <thetext>This is about the side effects of http://www.w3.org/TR/html5/browsers.html#named-access-on-the-window-object

It seems the properties that this named access creates on the window object are non-configureable. This makes it &apos;randomly&apos;/&apos;DOM dependent&apos; impossible to create properties on the window object. Apparently Safari is the only browser that has them unconfigurable and the only browser that has them defined as actually properties. There might be a good reason for this (security ?). However, it&apos;s annoying, especially for JS libraries that might be deployed. This impredictability of which properties on your window object are defined makes this a nuisance to developers and more so. I think this should be changed.

I ran into this problem here: https://github.com/ajaxorg/ace/issues/1741


Additionally specific to Safari, this seems to create a problem with local declared but uninitialized variables, which might be even more problematic. This problem is detailed in the console.log example in http://dertompson.com/2013/08/07/named-access-on-the-window-object-in-safari/
This might give a scripter unintentional and obscured access to these named objects causing unpredictable results.

Further background reading materials:
http://tjvantoll.com/2012/07/19/dom-element-references-as-global-variables/
https://www.w3.org/Bugs/Public/show_bug.cgi?id=11960</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105790</commentid>
    <comment_count>1</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2015-06-30 13:55:49 -0700</bug_when>
    <thetext>This seems to be fixed in Safari 9 Seed 1 ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1228860</commentid>
    <comment_count>2</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2016-09-12 12:42:23 -0700</bug_when>
    <thetext>Hmm, or not, it seems that this issue still exists and I just ran into it again.

Had a header with id=&quot;addOnloadHook&quot;, then was trying to define a property on window with the key &apos;addOnloadHook&apos;. This was impossible due to named access.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1229528</commentid>
    <comment_count>3</comment_count>
      <attachid>288806</attachid>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2016-09-14 05:05:31 -0700</bug_when>
    <thetext>Created attachment 288806
Reduced testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429799</commentid>
    <comment_count>4</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2018-06-04 06:02:57 -0700</bug_when>
    <thetext>This problem seems resolved in at least Safari 11.1

Not sure when the fix was made.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>288806</attachid>
            <date>2016-09-14 05:05:31 -0700</date>
            <delta_ts>2016-09-14 05:05:31 -0700</delta_ts>
            <desc>Reduced testcase</desc>
            <filename>namedaccess.html</filename>
            <type>text/html</type>
            <size>458</size>
            <attacher name="Derk-Jan Hartman">hartman.wiki</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICA8dGl0bGU+dW5uYW1lZCBhY2Nlc3M8L3Rp
dGxlPgogIDxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4vLzwhW0NEQVRBWwogIHdpbmRv
dy5vbmxvYWQ9ZnVuY3Rpb24oKXsKICAJT2JqZWN0LmRlZmluZVByb3BlcnR5KCB3aW5kb3csICdu
YW1lZGFjY2VzcycsIHsKICAgIAljb25maWd1cmFibGU6IHRydWUsCiAgICAgIGVudW1lcmFibGU6
IHRydWUsCiAgICAgIGdldDogZnVuY3Rpb24oKSB7CiAgICAgIAljb25zb2xlLmxvZyggJ2dldCcg
KTsKICAgICAgfSwKICAgICAgc2V0OiBmdW5jdGlvbihuZXdWYWwpIHsKICAgICAgCWNvbnNvbGUu
bG9nKCAnc2V0JyApOwogICAgICB9CiAgICB9KTsKICB9Ly9dXT4KICA8L3NjcmlwdD4KPC9oZWFk
Pgo8Ym9keT4KICA8aDIgaWQ9Im5hbWVkYWNjZXNzIj5IZWFkZXI8L2gyPgo8L2JvZHk+CjwvaHRt
bD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>