| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta http-equiv="Content-Security-Policy" content="font-src 'none'; script-src 'unsafe-inline'"> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| </script> |
| </head> |
| <body> |
| <p>Tests that a SVG font-face element, in a user agent shadow tree, is allowed to load an external SVG font when the page has CSP policy: <code>font-src 'none'</code>. This test PASSED if there are no console warning messages.</p> |
| <svg id="shadow-host" viewBox="0 0 100 100"> |
| </svg> |
| <script> |
| function runTest() |
| { |
| |
| var userAgentShadowRoot = internals.ensureUserAgentShadowRoot(document.getElementById("shadow-host")); |
| var fontFace = document.createElementNS("http://www.w3.org/2000/svg", "font-face"); |
| userAgentShadowRoot.appendChild(fontFace); |
| var fontFaceSrc = document.createElementNS("http://www.w3.org/2000/svg", "font-face-src"); |
| fontFace.appendChild(fontFaceSrc); |
| var fontFaceURI = document.createElementNS("http://www.w3.org/2000/svg", "font-face-uri"); |
| fontFaceSrc.appendChild(fontFaceURI); |
| |
| fontFace.setAttributeNS(null, "font-family", "ABCFont"); |
| fontFaceURI.setAttributeNS("http://www.w3.org/1999/xlink", "href", "../resources/ABCFont.svg#ABCFont"); |
| } |
| |
| runTest(); |
| </script> |
| </body> |
| </html> |