summaryrefslogtreecommitdiff
path: root/dom/base/nsContentUtils.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2021-01-25 17:19:43 -0500
committerMatt A. Tobin <email@mattatobin.com>2021-01-25 17:38:49 -0500
commit9f5326587cdc102b1aa7fef98f61d1de0de49ec0 (patch)
tree2390bda35f6b3bcdd31956b3e71cee66bae3b6c9 /dom/base/nsContentUtils.cpp
parentec2b6aab8a32454d69625aca38587143c9de3a58 (diff)
downloaduxp-9f5326587cdc102b1aa7fef98f61d1de0de49ec0.tar.gz
Issue mcp-graveyard/UXP#1390 - Clean up presentation api leftovers
Diffstat (limited to 'dom/base/nsContentUtils.cpp')
-rw-r--r--dom/base/nsContentUtils.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index a347525545..107daaede6 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -9341,62 +9341,6 @@ nsContentUtils::SetScrollbarsVisibility(nsIDocShell* aDocShell, bool aVisible)
}
}
-/* static */ void
-nsContentUtils::GetPresentationURL(nsIDocShell* aDocShell, nsAString& aPresentationUrl)
-{
- MOZ_ASSERT(aDocShell);
-
- // Simulate receiver context for web platform test
- if (Preferences::GetBool("dom.presentation.testing.simulate-receiver")) {
- nsCOMPtr<nsIDocument> doc;
-
- nsCOMPtr<nsPIDOMWindowOuter> docShellWin =
- do_QueryInterface(aDocShell->GetScriptGlobalObject());
- if (docShellWin) {
- doc = docShellWin->GetExtantDoc();
- }
-
- if (NS_WARN_IF(!doc)) {
- return;
- }
-
- nsCOMPtr<nsIURI> uri = doc->GetDocumentURI();
- if (NS_WARN_IF(!uri)) {
- return;
- }
-
- nsAutoCString uriStr;
- uri->GetSpec(uriStr);
- aPresentationUrl = NS_ConvertUTF8toUTF16(uriStr);
- return;
- }
-
- if (XRE_IsContentProcess()) {
- nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
- aDocShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
- nsCOMPtr<nsIDocShellTreeItem> root;
- aDocShell->GetRootTreeItem(getter_AddRefs(root));
- if (sameTypeRoot.get() == root.get()) {
- // presentation URL is stored in TabChild for the top most
- // <iframe mozbrowser> in content process.
- TabChild* tabChild = TabChild::GetFrom(aDocShell);
- if (tabChild) {
- aPresentationUrl = tabChild->PresentationURL();
- }
- return;
- }
- }
-
- nsCOMPtr<nsILoadContext> loadContext(do_QueryInterface(aDocShell));
- nsCOMPtr<nsIDOMElement> topFrameElement;
- loadContext->GetTopFrameElement(getter_AddRefs(topFrameElement));
- if (!topFrameElement) {
- return;
- }
-
- topFrameElement->GetAttribute(NS_LITERAL_STRING("mozpresentation"), aPresentationUrl);
-}
-
/* static */ nsIDocShell*
nsContentUtils::GetDocShellForEventTarget(EventTarget* aTarget)
{