<?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>27381</bug_id>
          
          <creation_ts>2014-11-20 15:11:14 +0000</creation_ts>
          <short_desc>Basing Object.observe() for IDL objects on internal slots</short_desc>
          <delta_ts>2016-06-02 21:04: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>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          <dependson>27354</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>adamk</cc>
    
    <cc>bugs</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>d</cc>
    
    <cc>hemanth.hm</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>115226</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-11-20 15:11:14 +0000</bug_when>
    <thetext>Once we have internal slots, and define things in such a way that e.g. innerHTML does not use them, could we perhaps base whether Object.observe() works for a given IDL attribute on whether or not it declares an internal slot? That would be rather nice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115227</commentid>
    <comment_count>1</comment_count>
    <who name="Hemanth.HM">hemanth.hm</who>
    <bug_when>2014-11-20 15:15:03 +0000</bug_when>
    <thetext>+1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115229</commentid>
    <comment_count>2</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-11-20 15:21:54 +0000</bug_when>
    <thetext>Still sounds like a possible performance nightmare, at least given the current implementations.
&quot;slot&quot; in this case is quite faraway from JS engine internal slots, so
whenever the internal state, which implementations calculate often lazily when
the someone calls the JS getter to access the state, changes, implementation would need to check if there are observers, and then synchronously inform JS engine about the state.

And why would innerHTML behave differently to some other attributes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115230</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-11-20 15:25:14 +0000</bug_when>
    <thetext>innerHTML does not need an internal slot as it can be computed based on the tree (innerHTML doesn&apos;t represent a primitive). Therefore Object.observe() would not work for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115232</commentid>
    <comment_count>4</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2014-11-20 15:31:25 +0000</bug_when>
    <thetext>That still doesn&apos;t explain why innerHTML wouldn&apos;t be observable.
Why would certain attributes behave differently? Does a js author need to look at
the specs all the time to see whether the attribute he/she is going to use can be
observed.

It is like MutationObserver could observe changes to only certain attributes but not to some others.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>115235</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-11-20 15:46:27 +0000</bug_when>
    <thetext>We could think about it.

The requirement to _actually_ have an internal slot (to have the old value available) as opposed to conceptually having an internal slot as a specification device should not be made lightly, because it can affect the ability of engines to space-optimize.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126667</commentid>
    <comment_count>6</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2016-06-02 21:04:22 +0000</bug_when>
    <thetext>Object.observe is dead.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>