Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: LayoutTests/fast/dom/MutationObserver/observe-options-attributes.html

Issue 1158433004: Remove Attr child nodes (making Attr a Node, not a ContainerNode) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address feedback Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <script>
4
5 description('Test MutationObserver.observe options related to attributes');
6
7 var observer = new MutationObserver(function() {});
8 var element = document.createElement('div');
9 element.setAttribute('data-test', '1');
10
11 observer.observe(element, {attributeOldValue: true});
12 element.setAttribute('data-test', '1');
13 var records = observer.takeRecords();
14 shouldBe('records.length', '1');
15 shouldBeEqualToString('records[0].oldValue', '1');
16 observer.disconnect();
17
18 observer.observe(element, {attributeOldValue: false});
19 element.setAttribute('data-test', '1');
20 var records = observer.takeRecords();
21 shouldBe('records.length', '1');
22 shouldBeNull('records[0].oldValue');
23 observer.disconnect();
24
25 observer.observe(element, {attributeFilter: ['data-test']});
26 element.setAttribute('data-test', '2');
27 var records = observer.takeRecords();
28 shouldBe('records.length', '1');
29 shouldBeNull('records[0].oldValue');
30 observer.disconnect();
31
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698