blob: 8bc10681d6b16fb4056c8de73c3acdb05401beea [file] [log] [blame]
<!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("&lt;" + tagName + "&gt;: Before appendChild, " + element.name + " should not be in document.");
shouldBeFalse("element.name in document");
shouldBeFalse("element.name in window");
shadowRoot.appendChild(element);
debug("&lt;" + tagName + "&gt;: 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("&lt;" + tagName + "&gt;: 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("&lt;" + tagName + "&gt;: 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>