diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 18721ed6febe..b0a6742ec358 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -2231,20 +2231,6 @@ nsContentUtils::InProlog(nsINode *aNode) return !root || doc->ComputeIndexOf(aNode) < doc->ComputeIndexOf(root); } -nsIDocument* -nsContentUtils::GetDocumentFromCaller() -{ - AutoJSContext cx; - - nsCOMPtr win = - do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(JS::CurrentGlobalOrNull(cx))); - if (!win) { - return nullptr; - } - - return win->GetExtantDoc(); -} - bool nsContentUtils::IsCallerChrome() { diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 19ab2659e4bf..f17589379d94 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -630,18 +630,6 @@ public: */ static bool IsAbsoluteURL(const nsACString& aURL); - /** - * GetDocumentFromCaller gets its document by looking at the last called - * function and finding the document that the function itself relates to. - * For example, consider two windows A and B in the same origin. B has a - * function which does something that ends up needing the current document. - * If a script in window A were to call B's function, GetDocumentFromCaller - * would find that function (in B) and return B's document. - * - * @return The document or null if no JS Context. - */ - static nsIDocument* GetDocumentFromCaller(); - // Check if a node is in the document prolog, i.e. before the document // element. static bool InProlog(nsINode *aNode);