blob: 0d5e9bcaa5499e6f402e621b6939ebe3b619e807 [file] [log] [blame]
Philip Jägenstedtb344fa72017-04-06 12:08:201<!DOCTYPE html>
2<html>
3 <head>
4 <title>CSS Test: cssom view window screen attribute</title>
5 <link rel="author" title="jingke" href="mailto:jingkewhu@gmail.com">
6 <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface">
7 <meta name="flags" content="dom">
8 <meta name="assert" content="window screen interface">
9 <script src="/resources/testharness.js"></script>
10 <script src="/resources/testharnessreport.js"></script>
11 </head>
12 <body>
13 <div id="myDiv"></div>
14 <div id="log"></div>
15 <script>
16 /*test readonly*/
17 test(function(){assert_readonly(window.screen, "availWidth");}, "Screen.availWidth is readonly");
18 test(function(){assert_readonly(window.screen, "availHeight");}, "Screen.availHeight is readonly");
19 test(function(){assert_readonly(window.screen, "width");}, "Screen.width is readonly");
20 test(function(){assert_readonly(window.screen, "height");}, "Screen.height is readonly");
21 test(function(){assert_readonly(window.screen, "colorDepth");}, "Screen.colorDepth is readonly");
22 test(function(){assert_readonly(window.screen, "pixelDepth");}, "Screen.pixelDepth is readonly");
23
24
25 test(function(){assert_true(window.screen.width >= 0 && window.screen.width < 6000000);},
26 "window.screen.width >= 0 && window.screen.width < 6000000");
27 test(function(){assert_true(window.screen.height >= 0 && window.screen.height < 6000000);},
28 "window.screen.height >= 0 && window.screen.height < 6000000");
29 test(function(){assert_true(window.screen.availWidth >= 0 && window.screen.availWidth <= window.screen.width);},
30 "window.screen.availWidth >= 0 && window.screen.availWidth <= window.screen.width");
31 test(function(){assert_true(window.screen.availHeight >= 0 && window.screen.availHeight <= window.screen.height);},
32 "window.screen.availHeight >= 0 && window.screen.availHeight <= window.screen.height");
33 test(function(){assert_true(window.screen.colorDepth == 0 || window.screen.colorDepth == 16 || window.screen.colorDepth == 24 || window.screen.colorDepth == 32);},
34 "window.screen.colorDepth == 0 || window.screen.colorDepth == 16 || window.screen.colorDepth == 24 || window.screen.colorDepth == 32");
35 test(function(){assert_equals(window.screen.pixelDepth, window.screen.colorDepth);},
36 "window.screen.pixelDepth must return the value returned by window.screen.colorDepth");
37 </script>
38
39 </body>
40</html>