tor-browser

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

background-332.html (3021B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <title>CSS Backgrounds and Borders Test: background shorthand - all values specified</title>
      5    <link rel="author" title="Intel" href="http://www.intel.com" />
      6    <link rel="help" href="http://www.w3.org/TR/css3-background/#the-background" />
      7    <meta name="flags" content="dom image" />
      8    <meta name="assert" content="Check that given a valid declaration, for each layer the shorthand 'backgound' first sets the corresponding layer of each of 'background-image', 'background-position', 'background-size', 'background-repeat', 'background-origin', 'background-clip' and 'background-attachment' to that property's initial value, then assigns any explicit values specified for this layer in the declaration" />
      9    <style>
     10        #test {
     11            background: url("support/60x60-green.png") 40% / 10em gray round fixed border-box;
     12        }
     13    </style>
     14    <script src="/resources/testharness.js"></script>
     15    <script src="/resources/testharnessreport.js"></script>
     16  </head>
     17  <body>
     18    <div id="log"></div>
     19    <div id="test"></div>
     20    <script>
     21        var cs = getComputedStyle(document.getElementById("test"), null);
     22 
     23        test(function() {
     24            assert_equals(cs.getPropertyValue("background-image"),
     25                'url("' + new URL("support/60x60-green.png", window.location.href).href + '")');
     26        }, "Computed value for background-image after setting background shorthand");
     27 
     28        test(function() {
     29            assert_equals(cs.getPropertyValue("background-position"),
     30                "40% 50%", "background specified value for background-position");
     31        }, "background_specified_position");
     32 
     33        test(function() {
     34            assert_equals(cs.getPropertyValue("background-size"),
     35                "160px auto", "background specified value for background-size");
     36        }, "background_specified_size");
     37 
     38        test(function() {
     39            assert_equals(cs.getPropertyValue("background-repeat"),
     40                "round", "background specified value for background-repeat");
     41        }, "background_specified_repeat");
     42 
     43        test(function() {
     44            assert_equals(cs.getPropertyValue("background-attachment"),
     45                "fixed", "background specified value for background-attachment");
     46        }, "background_specified_attachment");
     47 
     48        test(function() {
     49            assert_equals(cs.getPropertyValue("background-origin"),
     50                "border-box", "background specified value for background-origin");
     51        }, "background_specified_origin");
     52 
     53        test(function() {
     54            assert_equals(cs.getPropertyValue("background-clip"),
     55                "border-box", "background specified value for background-clip");
     56        }, "background_specified_clip");
     57 
     58        test(function() {
     59            assert_equals(cs.getPropertyValue("background-color"),
     60                "rgb(128, 128, 128)", "background specified value for background-color");
     61        }, "background_specified_color");
     62    </script>
     63  </body>
     64 </html>