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

LibWeb: Expose Node.ownerDocument

Required by jQuery.
This commit is contained in:
Luke 2021-05-02 21:03:50 +01:00 committed by Andreas Kling
parent 329cb134d6
commit 8bafbdddc6
3 changed files with 11 additions and 0 deletions

View file

@ -539,4 +539,12 @@ bool Node::is_host_including_inclusive_ancestor_of(const Node& other) const
return is_inclusive_ancestor_of(other) || (is<DocumentFragment>(other.root()) && downcast<DocumentFragment>(other.root())->host() && is_inclusive_ancestor_of(*downcast<DocumentFragment>(other.root())->host().ptr()));
}
// https://dom.spec.whatwg.org/#dom-node-ownerdocument
RefPtr<Document> Node::owner_document() const
{
if (is_document())
return nullptr;
return m_document;
}
}