Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / subtree-modified-attributes.html
blob8c7fd58feb8180abed7b14f07c2a17ffee615fdc
1 <!DOCTYPE html>
2 <body>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 description('DOMSubtreeModified should fire when attributes are added or removed, but not modified (see bug 81141)');
7 var div = document.createElement('div');
8 document.body.appendChild(div);
9 var expected = false;
10 div.addEventListener('DOMSubtreeModified', function(evt) {
11 shouldBeTrue('expected');
12 });
13 expected = true;
14 div.setAttribute('foo', 'bar');
15 expected = false;
16 div.setAttribute('foo', 'baz');
17 expected = true;
18 div.removeAttribute('foo');
20 var attr = document.createAttribute('bar');
21 attr.value = 'foo';
22 expected = true;
23 div.setAttributeNode(attr);
24 expected = false;
25 attr.value = 'bar';
26 expected = true;
27 div.removeAttributeNode(attr);
28 </script>
29 </body>