tor-browser

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

background-position-x-computed.html (1728B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <title>CSS Backgrounds and Borders Module Level 4: getComputedStyle().backgroundPositionX</title>
      6 <link rel="help" href="https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position-x">
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 <script src="/css/support/computed-testcommon.js"></script>
     10 <style>
     11  #target {
     12    font-size: 40px;
     13  }
     14 </style>
     15 </head>
     16 <body>
     17 <div id="target"></div>
     18 <script>
     19 test_computed_value("background-position-x", "center", "50%");
     20 test_computed_value("background-position-x", "left", "0%");
     21 test_computed_value("background-position-x", "right", "100%");
     22 test_computed_value("background-position-x", "x-start");
     23 test_computed_value("background-position-x", "x-end");
     24 test_computed_value("background-position-x", "-20%");
     25 test_computed_value("background-position-x", "10px");
     26 test_computed_value("background-position-x", "0.5em", "20px");
     27 test_computed_value("background-position-x", "calc(10px - 0.5em)", "-10px");
     28 test_computed_value("background-position-x", "left -20%", "-20%");
     29 test_computed_value("background-position-x", "right -10px", "calc(100% + 10px)");
     30 test_computed_value("background-position-x", "-20%, 10px", "-20%");
     31 test_computed_value("background-position-x", "center, left, right", "50%");
     32 test_computed_value("background-position-x", "0.5em, x-start, x-end", "20px");
     33 
     34 // See background-computed.html for a test with multiple background images.
     35 test_computed_value("background-position-x", "calc(10px - 0.5em), -20%, 10px", "-10px");
     36 test_computed_value("background-position-x", "calc(10px - 0.5em), left -20%, right 10px", "-10px");
     37 </script>
     38 </body>
     39 </html>