tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

window-screen-width-immutable.html (936B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4    <title>CSSOM View - 4.2 - screen.width immutability</title>
      5    <link rel="author" title="Neils Christoffersen" href="mailto:neils.christoffersen@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="screen.width is immutable">
      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        var originalVal = window.screen.width;
     17 
     18        // try to set window.screen.width
     19        window.screen.width = 0;
     20 
     21        // verify window.screen.width didn't change
     22        test(function() {
     23            assert_equals(window.screen.width, originalVal, "window.screen.width should be immutable")
     24        }, "immutability test");
     25    </script>
     26 </body>
     27 </html>