Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / min-device-aspect-ratio.html
blob04b686bcb8f7f896a836d925f4234b35f3436c8a
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head id="myhead">
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 if (window.testRunner) {
7 window.testRunner.waitUntilDone();
10 var count = 0;
11 var maxCount = 10;
12 var timeout = 100;
14 function doTest()
16 var headElement = document.getElementById("myhead");
17 var linkElement = document.createElement("link");
18 linkElement.rel = "stylesheet";
19 var width;
20 var height;
21 if (screen.width > screen.height) {
22 // For a landscape screen, a ratio of 1/1 will always be less than the screen (e.g., 16/9)
23 width = 1;
24 height = 1;
25 } else {
26 // For a portrait screen, a ratio of 1/100 should always be less than the screen (e.g., 9/16)
27 // For a square screen, a ratio of 1/100 will always be less than the screen (e.g., 9/9)
28 width = 1;
29 height = 100;
31 linkElement.media = "screen and (min-device-aspect-ratio: " + width + "/" + height + ")";
32 linkElement.href = "resources/device-aspect-ratio.css";
33 headElement.appendChild(linkElement);
34 description("This text is green if the min-device-aspect-ratio media query works properly.");
35 setTimeout("waitForStylesheetLoad()", timeout);
38 function waitForStylesheetLoad()
40 count++;
42 if (document.defaultView.getComputedStyle(document.getElementById('description'), null).color == "rgb(0, 128, 0)") {
43 shouldBe("document.defaultView.getComputedStyle(document.getElementById('description'), null).color", "'rgb(0, 128, 0)'");
44 isSuccessfullyParsed();
45 if (window.testRunner) {
46 window.testRunner.notifyDone();
48 return;
51 if (count > maxCount) {
52 testFailed("Stylesheet did not load in " + (maxCount * timeout / 1000) + " second(s).");
53 return;
56 setTimeout("waitForStylesheetLoad()", timeout);
58 </script>
59 </head>
60 <body onload="doTest()">
61 </body>
62 </html>