blob: b593ad7a620481f81b4f84a917ed3c82a990c7c0 [file] [log] [blame]
<!DOCTYPE html>
<head>
<style id="style" media="screen"></style>
</head>
<body>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("Tests the behavior of indexed property getters returning a DOMString with regards to out-of-bounds access");
debug("* Indexed property getters returning a non-nullable DOMString");
debug("DOMTokenList.item()");
shouldBeNull("document.body.classList.item(666)");
shouldBeUndefined("document.body.classList[666]");
debug("Storage.getItem()");
shouldBeNull("localStorage.getItem(666)");
shouldBeUndefined("localStorage[666]");
debug("MediaList.item()");
var stylesheet = document.getElementById("style").sheet;
shouldBeNull("stylesheet.media.item(666)");
shouldBeUndefined("stylesheet.media[666]");
debug("");
debug("* Indexed property getters returning a non-nullable DOMString");
debug("CSSStyleDeclaration.item()");
shouldBeEmptyString("document.body.style.item(666)");
shouldBeUndefined("document.body.style[666]");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>