<?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>19611</bug_id>
          
          <creation_ts>2012-10-18 22:20:47 +0000</creation_ts>
          <short_desc>Should DOMStringMap use [OverrideBuiltins]?</short_desc>
          <delta_ts>2013-09-02 09:58:18 +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/#domstringmap-0</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>has-testcase</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>annevk</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>cam</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>76627</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-10-18 22:20:47 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html
Multipage: http://www.whatwg.org/C#domstringmap-0
Complete: http://www.whatwg.org/c#domstringmap-0

Comment:
Should DOMStringMap use [OverrideBuiltins]?

Posted from: 173.48.30.113 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/19.0 Firefox/19.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76628</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-10-18 22:21:31 +0000</bug_when>
    <thetext>It seems like there&apos;s not that much value in allowing through stuff from up the proto chain on DOMStringMap, in general.  Certainly not for the dataset use of it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76749</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-10-19 20:11:47 +0000</bug_when>
    <thetext>If it&apos;s the done thing, sure. Fine by me. heycam, any advice?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78804</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-11-26 04:49:25 +0000</bug_when>
    <thetext>So what arussell would say here is that we should just use an ES Map for dataset, I bet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78805</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-11-26 04:50:14 +0000</bug_when>
    <thetext>And the problem then becomes one of implementing in a way that updates the Map lazily, because most of the time no one cares about it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80834</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-01-02 15:50:52 +0000</bug_when>
    <thetext>Using ES Map at this point is not backwards compatible, but we should probably use something like it the next time we have such an API.

OverrideBuiltins makes sense to me, or maybe we should empty the prototype chain? Like Object.create(null)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80835</commentid>
    <comment_count>6</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-02 16:04:14 +0000</bug_when>
    <thetext>If you do that, then instanceof DOMStringMap would always return false...  Might be ok, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84037</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-06 20:50:43 +0000</bug_when>
    <thetext>So... what&apos;s the story here? Why would we use [OverrideBuiltins] at this point?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84042</commentid>
    <comment_count>8</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-03-06 22:14:44 +0000</bug_when>
    <thetext>Do we want to allow storing something with the key &quot;toString&quot; in the DOMStringMap?  What about the key &quot;constructor&quot;?  What about &quot;toSource&quot;, &quot;valueOf&quot;, &quot;toLocaleString&quot;, &quot;hasOwnProperty&quot;, &quot;isPrototypeOf&quot;, &quot;propertyIsEnumerable&quot;, and whatever else ES adds to Object.prototype in the future?

That&apos;s the real question here.

(Note also that here are other unsafe keys depending on what browser you&apos;re in: &quot;watch&quot;, &quot;__proto__&quot;, &quot;__lookupGetter__&quot;, etc).

Note that as far as I can tell WebKit already implements this with [OverrideBuiltins] or something.  Try this in Chrome or Safari:

&lt;script&gt;
  var d = document.documentElement;
  alert(d.dataset.__proto__Z);
  d.dataset.__proto__ = 5;
  alert(d.dataset.__proto__);
&lt;/script&gt;

or similar with valueOf or whatnot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84043</commentid>
    <comment_count>9</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-03-06 22:17:17 +0000</bug_when>
    <thetext>Or even simpler:

&lt;!DOCTYPE html&gt;
&lt;script&gt;
  var d = document.documentElement;
  Object.prototype.foo = 7;
  alert(d.dataset.foo);
  d.dataset.foo = 5;
  alert(d.dataset.foo);
&lt;/script&gt;

(and compare to the Gecko or Presto behavior, which follows the current spec).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86131</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-13 15:12:06 +0000</bug_when>
    <thetext>&lt;heycam&gt; Hixie, so my opinion on the DOMStringMap thing is that it would be nicer if it were [OverrideBuiltins], so you don&apos;t get the other properties from Object.prototype shining through</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87662</commentid>
    <comment_count>11</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-05-14 16:20:41 +0000</bug_when>
    <thetext>For what it&apos;s worth, I plan to switch this object to [OverrideBuiltins] in Gecko sometime in the next few weeks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88049</commentid>
    <comment_count>12</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-05-22 04:41:24 +0000</bug_when>
    <thetext>Changing the Gecko behavior in https://bugzilla.mozilla.org/show_bug.cgi?id=874758</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89124</commentid>
    <comment_count>13</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-06-11 22:09:12 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7956.
Check-in comment: Make DOMStringMap use [OverrideBuiltins]
http://html5.org/tools/web-apps-tracker?from=7955&amp;to=7956</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92795</commentid>
    <comment_count>14</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2013-09-01 18:00:45 +0000</bug_when>
    <thetext>https://github.com/w3c/web-platform-tests/pull/318</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>