url-request-modifiers-computed.sub.html (5356B)
1 <!DOCTYPE html> 2 <link rel="help" href="https://drafts.csswg.org/css-values-5/#request-url-modifiers"> 3 <link rel="author" title="Sam Weinig" href="mailto:weinig@webkit.org"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/css/support/computed-testcommon.js"></script> 7 <div id="container" style="font-size: 20"> 8 <div id="target"></div> 9 </div> 10 <script> 11 12 // No modifiers 13 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png")'); 14 15 // <cross-origin-modifier> = cross-origin(anonymous | use-credentials) 16 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous))'); 17 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(use-credentials))'); 18 19 // <integrity-modifier> = integrity(<string>) 20 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" integrity("sha384-foobar"))'); 21 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" integrity(""))'); 22 23 // <referrer-policy-modifier> = referrer-policy(no-referrer | no-referrer-when-downgrade | same-origin | origin | strict-origin | origin-when-cross-origin | strict-origin-when-cross-origin | unsafe-url) 24 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(no-referrer))'); 25 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(no-referrer-when-downgrade))'); 26 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(same-origin))'); 27 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(origin))'); 28 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(strict-origin))'); 29 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(origin-when-cross-origin))'); 30 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(strict-origin-when-cross-origin))'); 31 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(unsafe-url))'); 32 33 // Multiple modifiers 34 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar"))'); 35 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" integrity("sha384-foobar") cross-origin(anonymous))', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar"))'); 36 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer))'); 37 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(no-referrer) integrity("sha384-foobar"))', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer))'); 38 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous) referrer-policy(no-referrer))'); 39 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(no-referrer) cross-origin(anonymous))', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous) referrer-policy(no-referrer))'); 40 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); 41 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" integrity("sha384-foobar") referrer-policy(no-referrer) cross-origin(anonymous))', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); 42 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(no-referrer) cross-origin(anonymous) integrity("sha384-foobar"))', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); 43 test_computed_value('background-image', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" referrer-policy(no-referrer) integrity("sha384-foobar") cross-origin(anonymous))', 'url("http://{{hosts[][]}}:{{ports[http][0]}}/css/support/1x1-green.png" cross-origin(anonymous) integrity("sha384-foobar") referrer-policy(no-referrer))'); 44 45 </script>