Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
Rust ai-agentsai-toolsbrowserbrowser-automationcloud-browserheadlessheadless-browserkitesurfplaywrightpuppeteerrustservoweb-crawlerweb-crawlingweb-scraperweb-scraping
<!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 node = document.createElement("div");
assert_true("remove" in node);
assert_equals(typeof node.remove, "function");
assert_equals(node.remove.length, 0);
assert_equals(node.parentNode, null);
assert_equals(node.remove(), undefined);
assert_equals(node.parentNode, null);
}, "Element.remove() exists and is a no-op without a parent");
test(function () {
const parent = document.createElement("div");
const before = document.createComment("before");
const node = document.createElement("span");
const after = document.createComment("after");
parent.append(before, node, after);
assert_equals(node.parentNode, parent);
assert_equals(node.remove(), undefined);
assert_equals(node.parentNode, null);
assert_equals(parent.childNodes.length, 2);
assert_equals(parent.childNodes[0], before);
assert_equals(parent.childNodes[1], after);
}, "Element.remove() detaches the node and preserves sibling order");
test(function () {
const parent = document.createElement("div");
const child = document.createElement("section");
const grandchild = document.createTextNode("leaf");
const outsider = document.createElement("div");
child.appendChild(grandchild);
parent.appendChild(child);
assert_false(parent.contains(null));
assert_true(parent.contains(parent));
assert_true(parent.contains(child));
assert_true(parent.contains(grandchild));
assert_false(child.contains(parent));
assert_false(parent.contains(outsider));
}, "Node.contains() reports inclusive descendants and rejects null");
test(function () {
const element = document.createElement("p");
const sameReference = element;
const sameShape = document.createElement("p");
const text = document.createTextNode("data");
const textCopy = document.createTextNode("data");
const comment = document.createComment("data");
const fragment = document.createDocumentFragment();
assert_true(element.isSameNode(element));
assert_true(element.isSameNode(sameReference));
assert_false(element.isSameNode(sameShape));
assert_false(element.isSameNode(null));
assert_false(element.isSameNode(undefined));
assert_true(text.isSameNode(text));
assert_false(text.isSameNode(textCopy));
assert_true(comment.isSameNode(comment));
assert_true(fragment.isSameNode(fragment));
}, "Node.isSameNode() compares object identity across node types");
</script>