Revision df4bdf53c4e851fe1006f0fcc2943fc8cd7f3a92 authored by Florian Rivoal on 29 March 2018, 06:13:03 UTC, committed by Florian Rivoal on 29 March 2018, 06:13:03 UTC
1 parent 55846d5
Raw File
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