1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/bugs/test_bug492925.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=492925 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 492925</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 + <style> 1.14 + @media tv, print { 1.15 + #div2 { 1.16 + overflow: hidden; 1.17 + } 1.18 + } 1.19 + </style> 1.20 +</head> 1.21 +<body> 1.22 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=492925">Mozilla Bug 492925</a> 1.23 +<p id="display"></p> 1.24 +<div id="content" style="display: none"> 1.25 + 1.26 +</div> 1.27 +<pre id="test"> 1.28 +<script type="application/javascript"> 1.29 + 1.30 +/** Test for Bug 492925 **/ 1.31 + 1.32 +var sheet = document.styleSheets[1]; 1.33 +var rule = sheet.cssRules[0]; 1.34 +var media = rule.media; 1.35 + 1.36 +is(media.mediaText, "tv, print", "Unexpected media string"); 1.37 +is(media[0], "tv", "[0] should be 'tv'"); 1.38 +is(media[1], "print", "[1] should be 'print'"); 1.39 +is(media.item(0), "tv", ".item(0) should be 'tv'"); 1.40 +is(media.item(1), "print", ".item(1) should be 'print'"); 1.41 + 1.42 + 1.43 + 1.44 + 1.45 +</script> 1.46 +</pre> 1.47 +</body> 1.48 +</html>