1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

LibWeb: Implement Node.contains

Used by Web Components Polyfills.
This commit is contained in:
Luke 2021-07-05 05:55:02 +01:00 committed by Andreas Kling
parent a826df773e
commit 9cae827f07
3 changed files with 9 additions and 0 deletions

View file

@ -649,4 +649,10 @@ bool Node::is_scripting_disabled() const
return !document().browsing_context();
}
// https://dom.spec.whatwg.org/#dom-node-contains
bool Node::contains(RefPtr<Node> other) const
{
return other && other->is_inclusive_descendant_of(*this);
}
}