[Bug 20131] [MutationObservers] Unclear whether unique record instances are required in 5.3.2 "Queuing a mutation record"

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20131

--- Comment #14 from Rafael Weinstein <rafaelw@chromium.org> ---
I don't think so, but maybe we're talking at cross purposes. To make it more
concrete:

<script>
var MutationObserver = MutationObserver || WebKitMutationObserver;
var div = document.createElement('div');
div.setAttribute('foo', 'foo');

function makeHandler(name) {
  return function handler(recs) {
    console.log('observer ' + name);
    console.log('count: ' + recs.length);
    console.log('oldValue: ' + recs[0].oldValue);
    if (recs[0].expando) {
      console.log('exando found');
    } else {
      recs[0].expando = 1;
      console.log('expando not found, and written');
    }
  };
}

var A = new MutationObserver(makeHandler('A'));
A.observe(div, { attributes: true, attributeOldValue: true });

var B = new MutationObserver(makeHandler('B'));
B.observe(div, { attributes: true });

var C = new MutationObserver(makeHandler('C'));
C.observe(div, { attributes: true, attributeOldValue: true });

var D = new MutationObserver(makeHandler('D'));
D.observe(div, { attributes: true });

div.setAttribute('foo', 'bar');
</script>

In WebKit this outputs:

observer A ---------
count: 1
oldValue: foo
expando not found, and written
observer B ---------
count: 1
oldValue: null
expando not found, and written
observer C ---------
count: 1
oldValue: foo
exando found
observer D ---------
count: 1
oldValue: null
exando found 

In Gecko this outputs:

observer A ---------
count: 1
oldValue: foo
expando not found, and written
observer B ---------
count: 1
oldValue: null
expando not found, and written
observer C ---------
count: 1
oldValue: foo
exando not found, and written
observer D ---------
count: 1
oldValue: null
exando not found, and written

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 28 November 2012 22:35:27 UTC