https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 951ade940eacfdad4de7530058690a10637a277d authored by Geoffrey Sneddon on 09 April 2018, 11:49:58 UTC
fixup! Move the config into its own class
Tip revision: 951ade9
innerHTML.tentative.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./support/helper.js"></script>
<body>
<script>
  test(t => {
    var html = TrustedHTML.escape(STRINGS.unescapedHTML);

    var d = document.createElement('div');
    d.innerHTML = html;
    assert_equals(d.innerText, STRINGS.unescapedHTML);
  }, "innerHTML = TrustedHTML.escape().");

  test(t => {
    var html = TrustedHTML.unsafelyCreate(STRINGS.unescapedHTML);

    var d = document.createElement('div');
    d.innerHTML = html;
    assert_equals(d.innerText, STRINGS.unescapedText);
  }, "innerHTML = TrustedHTML.unsafelyCreate().");
</script>
back to top