https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 39d421b20be6cd2be21eea4861271d7312837ba6 authored by Hiroki Nakagawa on 27 March 2018, 21:19:33 UTC
Worker: Add tests for import.meta.url on DedicatedWorker
Tip revision: 39d421b
outerHTML.tentative.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./support/helper.js"></script>
<body>
<div id="container"></div>
<script>
  var container = document.querySelector('#container')
  test(t => {
    var html = TrustedHTML.escape(STRINGS.unescapedHTML);

    var d = document.createElement('div');
    document.querySelector('#container').appendChild(d);
    d.outerHTML = html;
    assert_equals(container.innerText, STRINGS.unescapedHTML);
    while (container.firstChild)
      container.firstChild.remove();
  }, "outerHTML = TrustedHTML.escape().");

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

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