mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-14 03:36:28 +00:00
LibWeb: Expose Node.ownerDocument
Required by jQuery.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
Document& document() { return *m_document; }
|
||||
const Document& document() const { return *m_document; }
|
||||
|
||||
RefPtr<Document> owner_document() const;
|
||||
|
||||
const HTML::HTMLAnchorElement* enclosing_link_element() const;
|
||||
const HTML::HTMLElement* enclosing_html_element() const;
|
||||
const HTML::HTMLElement* enclosing_html_element_with_attribute(const FlyString&) const;
|
||||
|
||||
@@ -13,6 +13,7 @@ interface Node : EventTarget {
|
||||
readonly attribute Node? parentNode;
|
||||
readonly attribute Element? parentElement;
|
||||
readonly attribute boolean isConnected;
|
||||
readonly attribute Document? ownerDocument;
|
||||
attribute DOMString textContent;
|
||||
|
||||
Node appendChild(Node node);
|
||||
|
||||
Reference in New Issue
Block a user