diff options
Diffstat (limited to 'dom/base/nsINode.cpp')
-rw-r--r-- | dom/base/nsINode.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index 749a3ee4a2..37980db614 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -273,6 +273,18 @@ nsINode* nsINode::GetRootNode(const GetRootNodeOptions& aOptions) return SubtreeRoot(); } +// TODO: was marked as constant. +nsINode* +nsINode::GetParentOrHostNode() +{ + if (mParent) { + return mParent; + } + + ShadowRoot* shadowRoot = ShadowRoot::FromNode(this); + return shadowRoot ? shadowRoot->GetHost() : nullptr; +} + nsINode* nsINode::SubtreeRoot() const { |