1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibWeb: Add Node::in_a_document_tree()

This is "in a document tree" from the DOM spec.
This commit is contained in:
Andreas Kling 2021-09-29 22:23:28 +02:00
parent d660e86d13
commit 71087422f6
2 changed files with 9 additions and 0 deletions

View file

@ -866,4 +866,11 @@ bool Node::is_equal_node(Node const* other_node) const
return true;
}
// https://dom.spec.whatwg.org/#in-a-document-tree
bool Node::in_a_document_tree() const
{
// An element is in a document tree if its root is a document.
return root().is_document();
}
}