| <!doctype html> |
| <html> |
| <head> |
| <script src="resources/polyfill.js"></script> |
| <script src="../../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <div></div> |
| <script> |
| var div = document.querySelector("div"); |
| document.body.appendChild(div); |
| var shadowRoot = div.webkitCreateShadowRoot(); |
| |
| //Window named properties |
| var namedElements = ['a', 'applet', 'area', 'embed', 'form', 'frame', |
| 'frameset', 'iframe','img', 'object']; |
| |
| var element; |
| namedElements.forEach(function (tagName) { |
| element = document.createElement(tagName); |
| element.name = 'named_' + tagName; |
| |
| debug("<" + tagName + ">: Before appendChild, " + element.name + " should not be in document."); |
| shouldBeFalse("element.name in document"); |
| shouldBeFalse("element.name in window"); |
| shadowRoot.appendChild(element); |
| debug("<" + tagName + ">: After appendChild, " + element.name + " should not still be in document, because the element was inserted into a shadow DOM tree."); |
| shouldBeFalse("element.name in document"); |
| shouldBeFalse("element.name in window"); |
| |
| element.setAttribute('name', 'renamed_' + tagName); |
| debug("<" + tagName + ">: After changing its name attribute into " + element.name + " by using setAttribute, the name should not still be in document."); |
| shouldBeFalse("element.name in document"); |
| shouldBeFalse("element.name in window"); |
| element.name = 're-renamed_' + tagName; |
| debug("<" + tagName + ">: After changing its name attribute into " + element.name + " by using '.name=', the name should not still be in document."); |
| shouldBeFalse("element.name in document"); |
| shouldBeFalse("element.name in window"); |
| }); |
| </script> |
| </body> |
| </html> |