summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/trusted-types/TrustedTypePolicyFactory-getAttributeType-svg.html
blob: e6f6cbdb1de5f07ba01b3ee3b92beee83ce20a0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<script src="/resources/testharness.js" ></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/helper.sub.js"></script>

<body>
<div id="target"></div>
<script>
  test(t => {
    assert_equals(trustedTypes.getAttributeType("script", "href"), null);
  }, "trustedTypes.getAttributeType html script[href]");
  test(t => {
    assert_equals(trustedTypes.getAttributeType("script", "href", "http://www.w3.org/2000/svg"), "TrustedScriptURL");
  }, "trustedTypes.getAttributeType svg script[href]");
  test(t => {
    assert_equals(trustedTypes.getAttributeType("script", "href", "http://www.w3.org/2000/svg", "http://www.w3.org/1999/xlink"), "TrustedScriptURL");
  }, "trustedTypes.getAttributeType svg script[href] xlink href");
  test(t => {
    assert_equals(trustedTypes.getAttributeType("script", "href", "http://www.w3.org/2000/svg", "http://www.w3.org/other"), null);
  }, "trustedTypes.getAttributeType svg script[href] other href");
</script>
</body>