REGRESSION (r179497): Crash inside setAttributeNode
[WebKit-https.git] / LayoutTests / fast / dom / Attr / make-unique-element-data-while-replacing-attr.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6
7 description('Test making the element data unique while replacing an Attr node.');
8
9 let element = document.createElement('div');
10 element.setAttribute('foo', 'bar');
11
12 let oldAttr = document.createAttributeNS('http://www.w3.org/XML/1998/namespace', 'width');
13 oldAttr.value = 'a';
14 element.setAttributeNode(oldAttr);
15
16 element.addEventListener('DOMSubtreeModified', () => { element.cloneNode(); }, true);
17
18 let newAttr = document.createAttributeNS('http://www.w3.org/1999/xhtml','width');
19 newAttr.value = 'b';
20 element.setAttributeNode(newAttr);
21
22 shouldBeEqualToString('element.getAttribute("width")', 'b');
23
24 </script>               
25 </body>
26 </html>