Set Attr.ownerDocument in Element#setAttributeNode()
[WebKit-https.git] / LayoutTests / fast / dom / Attr / set-attribute-node-from-iframe.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <iframe></iframe>
8 <div id="toBeMoved"></div>
9 <script>
10 description("ownerDocument of Attr should be set on setAttributeNode");
11
12 var elementToBeMoved = document.getElementById("toBeMoved");
13 iframeElement = document.getElementsByTagName("iframe")[0];
14 iframeDocument = iframeElement.contentWindow.document;
15
16 shouldBe('attr = iframeDocument.createAttribute("foo"); attr.ownerDocument', 'iframeDocument');
17 shouldBe('elementToBeMoved.setAttributeNode(attr); attr.ownerDocument', 'document');
18 shouldBe('iframeDocument.documentElement.appendChild(elementToBeMoved); attr.ownerDocument', 'iframeDocument');
19 </script>
20 <script src="../../js/resources/js-test-post.js"></script>
21 </body>
22 </html>