https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 52a48c977da042e363ee1b708ceab69af9a4214a authored by Ian Clelland on 13 April 2018, 01:59:02 UTC
Allow feature policy to be used in opaque origins.
Tip revision: 52a48c9
object-in-svg-foreignobject.sub.html
<!DOCTYPE html>
<html>
<head>
    <title>Object inside SVG foreignobject respect csp</title>
    <meta http-equiv="Content-Security-Policy" content="object-src 'none'">
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script>
      async_test(function(t) {
        document.addEventListener("securitypolicyviolation", t.step_func(function(e) {
          if (e.blockedURI != "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/media/flash.swf")
            return;

          assert_equals(e.violatedDirective, "object-src");
          t.done();
        }));
      }, "Should throw a securitypolicyviolation");
    </script>
</head>
<body>
    <svg>
        <foreignObject>
            <embed type="application/x-shockwave-flash" src="/content-security-policy/support/media/flash.swf">
        </foreignObject>
    </svg>
</body>
</html>
back to top