Skip to content

armgit / moli

Public Imported from GitHub
0

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

1.3 KB
Raw Blame
<!doctype html>
<meta charset="utf-8">
<div id="target"></div>
<script src="/wpt/resources/testharness.js"></script>
<script src="/wpt/resources/testharnessreport.js"></script>
<script src="/wpt/resources/moli-wpt-adapter.js"></script>
<script src="/wpt/resources/WebIDLParser.js"></script>
<script src="/wpt/resources/idlharness.js"></script>
<script>
idl_test([`
callback MutationCallback = undefined (sequence<MutationRecord> mutations, MutationObserver observer);

interface MutationObserver {
  constructor(MutationCallback callback);
  undefined observe(Node target, optional MutationObserverInit options = {});
  undefined disconnect();
  sequence<MutationRecord> takeRecords();
};
`], [], function (idlArray) {
  idlArray.enable_function_length_assertions();
  idlArray.enable_interface_descriptor_assertions();
  idlArray.enable_operation_descriptor_assertions();
  idlArray.enable_object_brand_assertions();
  idlArray.add_objects({
    MutationObserver: ["new MutationObserver(function () {})"]
  });
});

test(function () {
  const target = document.getElementById("target");
  const observer = new MutationObserver(function () {});
  observer.observe(target, { attributes: true });
  assert_array_equals(observer.takeRecords(), []);
  observer.disconnect();
}, "MutationObserver idlharness sample operations accept an Element target");
</script>