blob: 92cbe475cd6d633739c0578fa2318ce9e02469a1 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("Checks that HTMLIframeElement.sandbox is a DOMTokenList.");
var iframe = document.createElement("iframe");
shouldBe("iframe.sandbox.__proto__", "DOMTokenList.prototype");
debug("");
evalAndLog("iframe.sandbox = 'allow-popups allow-scripts allow-scripts allow-same-origin'");
shouldBe("iframe.sandbox.length", "3");
shouldBeEqualToString("iframe.sandbox[0]", "allow-popups");
shouldBeEqualToString("iframe.sandbox[1]", "allow-scripts");
shouldBeEqualToString("iframe.sandbox[2]", "allow-same-origin");
shouldBeEqualToString("String(iframe.sandbox)", "allow-popups allow-scripts allow-scripts allow-same-origin");
shouldBeEqualToString("iframe.getAttribute('sandbox')", 'allow-popups allow-scripts allow-scripts allow-same-origin');
debug("");
evalAndLog("iframe.setAttribute('sandbox', 'allow-popups allow-scripts')");
shouldBe("iframe.sandbox.length", "2");
shouldBeEqualToString("iframe.sandbox[0]", "allow-popups");
shouldBeEqualToString("iframe.sandbox[1]", "allow-scripts");
shouldBeEqualToString("String(iframe.sandbox)", "allow-popups allow-scripts");
shouldBeEqualToString("iframe.getAttribute('sandbox')", "allow-popups allow-scripts");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>