<?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>103916</bug_id>
          
          <creation_ts>2012-12-03 12:20:32 -0800</creation_ts>
          <short_desc>MutationObservers should be passed unique MutationRecords</short_desc>
          <delta_ts>2017-07-18 08:29:22 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>WebExposed</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>68729</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Klein">adamk</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bedney</cc>
    
    <cc>rafaelw</cc>
    
    <cc>rniwa</cc>
    
    <cc>syoichi</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>781757</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-12-03 12:20:32 -0800</bug_when>
    <thetext>This is per a change to the DOM spec: see https://www.w3.org/Bugs/Public/show_bug.cgi?id=20131 and https://github.com/whatwg/dom/commit/b5d05659b682b2560af6c24e2e2cdbace82811d3

To minimize the memory impact/mutation-time cost,  we could create these unique records only at delivery time (when we&apos;re already walking through the list of records to move them from a WTF::Vector to a JS array). Or if we want to get fancy we could build machinery to give each observer its own JS wrapper around a single record.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1059892</commentid>
    <comment_count>1</comment_count>
    <who name="William J. Edney">bedney</who>
    <bug_when>2015-01-08 11:43:09 -0800</bug_when>
    <thetext>This bug really caused me a lot of confusion. I have a long-lived MO that observes changes on the #document node (observing both childList and subtree, of course). I wondered why I was seeing a lot of the same Mutation Records over and over again (and this list grows as my app runs).

For now, I mark these objects with an expando slot to let me know the record has already been processed, but this should be unnecessary (and it&apos;s wildly inefficient to be called with records I&apos;ve already processed).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>