blob: 0551120c61cf11d6a8b9f18dc9f2518c2280bdc3 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<script>
description("This tests indexing outside the range of the media list object.");
var styleElement = document.createElement('style');
styleElement.setAttribute('media', 'screen, print');
document.documentElement.appendChild(styleElement)
var mediaList = document.styleSheets[document.styleSheets.length - 1].media;
shouldEvaluateTo('mediaList.length', 2);
shouldBeEqualToString('mediaList[0]', 'screen');
shouldBeEqualToString('mediaList[1]', 'print');
shouldBeUndefined('mediaList[2]');
shouldBeUndefined('mediaList[-1]')
document.documentElement.removeChild(styleElement);
</script>
</body>
</html>