Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

1.1 KB
Raw Blame
<!doctype html>
<meta charset="utf-8">
<script src="/wpt/resources/testharness.js"></script>
<script src="/wpt/resources/testharnessreport.js"></script>
<script src="/wpt/resources/moli-wpt-adapter.js"></script>
<script>
test(function () {
  const implementation = document.implementation;

  assert_true(implementation instanceof DOMImplementation);
  assert_equals(document.implementation, implementation);
  assert_equals(typeof implementation.hasFeature, "function");
  assert_equals(typeof implementation.createHTMLDocument, "function");
  assert_equals(typeof implementation.createDocument, "function");
  assert_equals(typeof implementation.createDocumentType, "function");
}, "Getting implementation off the same document returns a stable DOMImplementation");

test(function () {
  const other = document.implementation.createHTMLDocument("other");

  assert_true(other instanceof Document);
  assert_true(other.implementation instanceof DOMImplementation);
  assert_true(document.implementation !== other.implementation);
}, "Different documents expose different DOMImplementation objects");
</script>