presentation-attribute.html (1571B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS integration - styling SVG from external stylesheet from 5 presentation attribute</title> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="/common/utils.js"></script> 9 <!-- Common global functions for referrer-policy tests. --> 10 <script src="/common/security-features/resources/common.sub.js"></script> 11 <!-- Helper functions for referrer-policy css tests. --> 12 <script src="/referrer-policy/css-integration/css-test-helper.js"></script> 13 <meta name="referrer" content="origin"> 14 </head> 15 <body> 16 <p>Check that resources from presentation attributes are loaded with 17 the referrer and referrer policy from the document.</p> 18 <script> 19 function setPresentationAttribute(test) 20 { 21 test.expected = location.origin + "/"; 22 let svg = createSvg(); 23 document.body.appendChild(svg); 24 let element = svg.getElementsByTagName("path")[0]; 25 // The test property should have map 1:1 with presentation attribute. 26 let attr = test.property; 27 element.setAttribute(attr, "url(" + url_prefix + "svg.py?id=" + 28 test.id + "#invalidFragment)"); 29 } 30 31 // mask-image is not the presentation attribute. 32 runSvgTests(svg_test_properties.filter(p => p != 'mask-image'), 33 "Styling SVG from presentation attributes", 34 setPresentationAttribute); 35 </script> 36 37 <div id="log"></div> 38 </body> 39 </html>