[whatwg/dom] add changed value to mutation record (#376)

https://www.w3.org/TR/dom/#interface-mutationrecord

A sequence of mutations observed and recorded by a mutation observer may involve the same attribute twice. Say a timer element is observed and suffers this sequence:

    timer.setAttribute('enabled', false);
    timer.setAttribute('cycleInterval', 10);    
    timer.setAttribute('enabled', true);

The callback of the mutation observer then is invoked after the 'enabled' attribute is reset to true, and the sequence of mutations passed to the callback includes all three changes. Currently, the callback cannot know that the 'enabled' value was set to false after the first change occurred. Information is lost.

As a remedy, the MutationRecord interface could include a
`readonly attribute DOMString? value;`
attribute which holds the value of the changed attribute at the time when the record was observed. This way the sequence of recorded mutations contains a complete history and no information is lost.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/376

Received on Friday, 18 November 2016 21:21:22 UTC