mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
LibWeb: Add Node::in_a_document_tree()
This is "in a document tree" from the DOM spec.
This commit is contained in:
parent
d660e86d13
commit
71087422f6
Notes:
sideshowbarker
2024-07-18 03:19:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/71087422f67
2 changed files with 9 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -71,6 +71,8 @@ public:
|
|||
virtual bool requires_svg_container() const { return false; }
|
||||
virtual bool is_svg_container() const { return false; }
|
||||
|
||||
bool in_a_document_tree() const;
|
||||
|
||||
// NOTE: This is intended for the JS bindings.
|
||||
u16 node_type() const { return (u16)m_type; }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue