1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="../js/resources/js-test-pre.js"></script>
6 if (window.layoutTestController) {
7 window.layoutTestController.waitUntilDone();
16 var headElement = document.getElementById("myhead");
17 var linkElement = document.createElement("link");
18 linkElement.rel = "stylesheet";
19 linkElement.media = "screen and (device-aspect-ratio: " + screen.width + "/" + screen.height + ")";
20 linkElement.href = "resources/device-aspect-ratio.css";
21 headElement.appendChild(linkElement);
22 description("This text is green if the device-aspect-ratio media query works properly.");
23 setTimeout("waitForStylesheetLoad()", timeout);
26 function waitForStylesheetLoad()
30 if (document.defaultView.getComputedStyle(document.getElementById('description'), null).color == "rgb(0, 128, 0)") {
31 shouldBe("document.defaultView.getComputedStyle(document.getElementById('description'), null).color", "'rgb(0, 128, 0)'");
32 isSuccessfullyParsed();
33 if (window.layoutTestController) {
34 window.layoutTestController.notifyDone();
39 if (count > maxCount) {
40 testFailed("Stylesheet did not load in " + (maxCount * timeout / 1000) + " second(s).");
44 setTimeout("waitForStylesheetLoad()", timeout);
48 <body onload="doTest()">