external-stylesheet.html (1541B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS integration - styling SVG from external stylesheet</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/common/utils.js"></script> 8 <!-- Common global functions for referrer-policy tests. --> 9 <script src="/common/security-features/resources/common.sub.js"></script> 10 <!-- Helper functions for referrer-policy css tests. --> 11 <script src="/referrer-policy/css-integration/css-test-helper.js"></script> 12 <meta name="referrer" content="never"> 13 </head> 14 <body> 15 <p>Check that resources from external stylesheets are loaded with 16 the referrer and referrer policy from the external stylesheet.</p> 17 18 <script> 19 function addLinkStyleSheet(test) { 20 let css_url = url_prefix + "stylesheet.py?id=" + test.id + 21 "&type=svg" + "&property=" + test.property; 22 test.expected = css_url; 23 24 let stylesheet = 25 document.createElementNS("http://www.w3.org/1999/xhtml", "link"); 26 stylesheet.setAttribute("type", "text/css"); 27 stylesheet.setAttribute("rel", "stylesheet"); 28 stylesheet.setAttribute("href", css_url); 29 let svg = createSvg(); 30 document.body.appendChild(svg); 31 svg.appendChild(stylesheet); 32 } 33 34 runSvgTests(svg_test_properties, 35 "Test styling SVG from external style", 36 addLinkStyleSheet); 37 </script> 38 39 <div id="log"></div> 40 </body> 41 </html>