Clean up presentation api leftovers.
parent
c398281a47
commit
e57592c1ba
|
@ -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*
|
/* static */ nsIDocShell*
|
||||||
nsContentUtils::GetDocShellForEventTarget(EventTarget* aTarget)
|
nsContentUtils::GetDocShellForEventTarget(EventTarget* aTarget)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2679,12 +2679,6 @@ public:
|
||||||
|
|
||||||
static void SetScrollbarsVisibility(nsIDocShell* aDocShell, bool aVisible);
|
static void SetScrollbarsVisibility(nsIDocShell* aDocShell, bool aVisible);
|
||||||
|
|
||||||
/*
|
|
||||||
* Return the associated presentation URL of the presented content.
|
|
||||||
* Will return empty string if the docshell is not in a presented content.
|
|
||||||
*/
|
|
||||||
static void GetPresentationURL(nsIDocShell* aDocShell, nsAString& aPresentationUrl);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to find the docshell corresponding to the given event target.
|
* Try to find the docshell corresponding to the given event target.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3102,14 +3102,6 @@ nsFrameLoader::ApplySandboxFlags(uint32_t sandboxFlags)
|
||||||
// The child can only add restrictions, never remove them.
|
// The child can only add restrictions, never remove them.
|
||||||
sandboxFlags |= parentSandboxFlags;
|
sandboxFlags |= parentSandboxFlags;
|
||||||
|
|
||||||
// If this frame is a receiving browsing context, we should add
|
|
||||||
// sandboxed auxiliary navigation flag to sandboxFlags. See
|
|
||||||
// https://w3c.github.io/presentation-api/#creating-a-receiving-browsing-context
|
|
||||||
nsAutoString presentationURL;
|
|
||||||
nsContentUtils::GetPresentationURL(mDocShell, presentationURL);
|
|
||||||
if (!presentationURL.IsEmpty()) {
|
|
||||||
sandboxFlags |= SANDBOXED_AUXILIARY_NAVIGATION;
|
|
||||||
}
|
|
||||||
mDocShell->SetSandboxFlags(sandboxFlags);
|
mDocShell->SetSandboxFlags(sandboxFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3427,11 +3419,6 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
||||||
rv = PopulateUserContextIdFromAttribute(attrs);
|
rv = PopulateUserContextIdFromAttribute(attrs);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoString presentationURLStr;
|
|
||||||
mOwnerContent->GetAttr(kNameSpaceID_None,
|
|
||||||
nsGkAtoms::mozpresentation,
|
|
||||||
presentationURLStr);
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDocShell> docShell = mOwnerContent->OwnerDoc()->GetDocShell();
|
nsCOMPtr<nsIDocShell> docShell = mOwnerContent->OwnerDoc()->GetDocShell();
|
||||||
nsCOMPtr<nsILoadContext> parentContext = do_QueryInterface(docShell);
|
nsCOMPtr<nsILoadContext> parentContext = do_QueryInterface(docShell);
|
||||||
NS_ENSURE_STATE(parentContext);
|
NS_ENSURE_STATE(parentContext);
|
||||||
|
@ -3459,8 +3446,7 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
|
||||||
containingApp,
|
containingApp,
|
||||||
showAccelerators,
|
showAccelerators,
|
||||||
showFocusRings,
|
showFocusRings,
|
||||||
attrs,
|
attrs);
|
||||||
presentationURLStr);
|
|
||||||
NS_ENSURE_STATE(tabContextUpdated);
|
NS_ENSURE_STATE(tabContextUpdated);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -1038,7 +1038,6 @@ GK_ATOM(predicate, "predicate")
|
||||||
GK_ATOM(prefix, "prefix")
|
GK_ATOM(prefix, "prefix")
|
||||||
GK_ATOM(preload, "preload")
|
GK_ATOM(preload, "preload")
|
||||||
GK_ATOM(prerendered, "prerendered")
|
GK_ATOM(prerendered, "prerendered")
|
||||||
GK_ATOM(mozpresentation, "mozpresentation")
|
|
||||||
GK_ATOM(preserve, "preserve")
|
GK_ATOM(preserve, "preserve")
|
||||||
GK_ATOM(preserveSpace, "preserve-space")
|
GK_ATOM(preserveSpace, "preserve-space")
|
||||||
GK_ATOM(preventdefault, "preventdefault")
|
GK_ATOM(preventdefault, "preventdefault")
|
||||||
|
|
|
@ -48,11 +48,6 @@ struct FrameIPCTabContext
|
||||||
// Whether this TabContext should work in prerender mode.
|
// Whether this TabContext should work in prerender mode.
|
||||||
bool isPrerendered;
|
bool isPrerendered;
|
||||||
|
|
||||||
// The requested presentation URL.
|
|
||||||
// This value would be empty if the TabContext isn't created for
|
|
||||||
// presented content.
|
|
||||||
nsString presentationURL;
|
|
||||||
|
|
||||||
// Keyboard indicator state inherited from the parent.
|
// Keyboard indicator state inherited from the parent.
|
||||||
UIStateChangeType showAccelerators;
|
UIStateChangeType showAccelerators;
|
||||||
UIStateChangeType showFocusRings;
|
UIStateChangeType showFocusRings;
|
||||||
|
|
|
@ -770,11 +770,6 @@ TabChild::NotifyTabContextUpdated(bool aIsPreallocated)
|
||||||
if (aIsPreallocated) {
|
if (aIsPreallocated) {
|
||||||
nsDocShell::Cast(docShell)->SetOriginAttributes(OriginAttributesRef());
|
nsDocShell::Cast(docShell)->SetOriginAttributes(OriginAttributesRef());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set SANDBOXED_AUXILIARY_NAVIGATION flag if this is a receiver page.
|
|
||||||
if (!PresentationURL().IsEmpty()) {
|
|
||||||
docShell->SetSandboxFlags(SANDBOXED_AUXILIARY_NAVIGATION);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -190,12 +190,6 @@ TabContext::OriginAttributesRef() const
|
||||||
return mOriginAttributes;
|
return mOriginAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
const nsAString&
|
|
||||||
TabContext::PresentationURL() const
|
|
||||||
{
|
|
||||||
return mPresentationURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
UIStateChangeType
|
UIStateChangeType
|
||||||
TabContext::ShowAccelerators() const
|
TabContext::ShowAccelerators() const
|
||||||
{
|
{
|
||||||
|
@ -215,8 +209,7 @@ TabContext::SetTabContext(bool aIsMozBrowserElement,
|
||||||
mozIApplication* aAppFrameOwnerApp,
|
mozIApplication* aAppFrameOwnerApp,
|
||||||
UIStateChangeType aShowAccelerators,
|
UIStateChangeType aShowAccelerators,
|
||||||
UIStateChangeType aShowFocusRings,
|
UIStateChangeType aShowFocusRings,
|
||||||
const DocShellOriginAttributes& aOriginAttributes,
|
const DocShellOriginAttributes& aOriginAttributes)
|
||||||
const nsAString& aPresentationURL)
|
|
||||||
{
|
{
|
||||||
NS_ENSURE_FALSE(mInitialized, false);
|
NS_ENSURE_FALSE(mInitialized, false);
|
||||||
|
|
||||||
|
@ -248,7 +241,6 @@ TabContext::SetTabContext(bool aIsMozBrowserElement,
|
||||||
mContainingAppId = containingAppId;
|
mContainingAppId = containingAppId;
|
||||||
mOwnApp = aOwnApp;
|
mOwnApp = aOwnApp;
|
||||||
mContainingApp = aAppFrameOwnerApp;
|
mContainingApp = aAppFrameOwnerApp;
|
||||||
mPresentationURL = aPresentationURL;
|
|
||||||
mShowAccelerators = aShowAccelerators;
|
mShowAccelerators = aShowAccelerators;
|
||||||
mShowFocusRings = aShowFocusRings;
|
mShowFocusRings = aShowFocusRings;
|
||||||
return true;
|
return true;
|
||||||
|
@ -261,7 +253,6 @@ TabContext::AsIPCTabContext() const
|
||||||
mContainingAppId,
|
mContainingAppId,
|
||||||
mIsMozBrowserElement,
|
mIsMozBrowserElement,
|
||||||
mIsPrerendered,
|
mIsPrerendered,
|
||||||
mPresentationURL,
|
|
||||||
mShowAccelerators,
|
mShowAccelerators,
|
||||||
mShowFocusRings));
|
mShowFocusRings));
|
||||||
}
|
}
|
||||||
|
@ -285,7 +276,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
|
||||||
bool isPrerendered = false;
|
bool isPrerendered = false;
|
||||||
uint32_t containingAppId = NO_APP_ID;
|
uint32_t containingAppId = NO_APP_ID;
|
||||||
DocShellOriginAttributes originAttributes;
|
DocShellOriginAttributes originAttributes;
|
||||||
nsAutoString presentationURL;
|
|
||||||
UIStateChangeType showAccelerators = UIStateChangeType_NoChange;
|
UIStateChangeType showAccelerators = UIStateChangeType_NoChange;
|
||||||
UIStateChangeType showFocusRings = UIStateChangeType_NoChange;
|
UIStateChangeType showFocusRings = UIStateChangeType_NoChange;
|
||||||
|
|
||||||
|
@ -348,7 +338,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
|
||||||
isMozBrowserElement = ipcContext.isMozBrowserElement();
|
isMozBrowserElement = ipcContext.isMozBrowserElement();
|
||||||
isPrerendered = ipcContext.isPrerendered();
|
isPrerendered = ipcContext.isPrerendered();
|
||||||
containingAppId = ipcContext.frameOwnerAppId();
|
containingAppId = ipcContext.frameOwnerAppId();
|
||||||
presentationURL = ipcContext.presentationURL();
|
|
||||||
showAccelerators = ipcContext.showAccelerators();
|
showAccelerators = ipcContext.showAccelerators();
|
||||||
showFocusRings = ipcContext.showFocusRings();
|
showFocusRings = ipcContext.showFocusRings();
|
||||||
originAttributes = ipcContext.originAttributes();
|
originAttributes = ipcContext.originAttributes();
|
||||||
|
@ -395,8 +384,7 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
|
||||||
containingApp,
|
containingApp,
|
||||||
showAccelerators,
|
showAccelerators,
|
||||||
showFocusRings,
|
showFocusRings,
|
||||||
originAttributes,
|
originAttributes);
|
||||||
presentationURL);
|
|
||||||
if (!rv) {
|
if (!rv) {
|
||||||
mInvalidReason = "Couldn't initialize TabContext.";
|
mInvalidReason = "Couldn't initialize TabContext.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,12 +125,6 @@ public:
|
||||||
*/
|
*/
|
||||||
const DocShellOriginAttributes& OriginAttributesRef() const;
|
const DocShellOriginAttributes& OriginAttributesRef() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the presentation URL associated with the tab if this tab is
|
|
||||||
* created for presented content
|
|
||||||
*/
|
|
||||||
const nsAString& PresentationURL() const;
|
|
||||||
|
|
||||||
UIStateChangeType ShowAccelerators() const;
|
UIStateChangeType ShowAccelerators() const;
|
||||||
UIStateChangeType ShowFocusRings() const;
|
UIStateChangeType ShowFocusRings() const;
|
||||||
|
|
||||||
|
@ -169,8 +163,7 @@ protected:
|
||||||
mozIApplication* aAppFrameOwnerApp,
|
mozIApplication* aAppFrameOwnerApp,
|
||||||
UIStateChangeType aShowAccelerators,
|
UIStateChangeType aShowAccelerators,
|
||||||
UIStateChangeType aShowFocusRings,
|
UIStateChangeType aShowFocusRings,
|
||||||
const DocShellOriginAttributes& aOriginAttributes,
|
const DocShellOriginAttributes& aOriginAttributes);
|
||||||
const nsAString& aPresentationURL);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify this TabContext to match the given TabContext. This is a special
|
* Modify this TabContext to match the given TabContext. This is a special
|
||||||
|
@ -225,11 +218,6 @@ private:
|
||||||
*/
|
*/
|
||||||
DocShellOriginAttributes mOriginAttributes;
|
DocShellOriginAttributes mOriginAttributes;
|
||||||
|
|
||||||
/**
|
|
||||||
* The requested presentation URL.
|
|
||||||
*/
|
|
||||||
nsString mPresentationURL;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keyboard indicator state (focus rings, accelerators).
|
* Keyboard indicator state (focus rings, accelerators).
|
||||||
*/
|
*/
|
||||||
|
@ -257,8 +245,7 @@ public:
|
||||||
mozIApplication* aAppFrameOwnerApp,
|
mozIApplication* aAppFrameOwnerApp,
|
||||||
UIStateChangeType aShowAccelerators,
|
UIStateChangeType aShowAccelerators,
|
||||||
UIStateChangeType aShowFocusRings,
|
UIStateChangeType aShowFocusRings,
|
||||||
const DocShellOriginAttributes& aOriginAttributes,
|
const DocShellOriginAttributes& aOriginAttributes)
|
||||||
const nsAString& aPresentationURL = EmptyString())
|
|
||||||
{
|
{
|
||||||
return TabContext::SetTabContext(aIsMozBrowserElement,
|
return TabContext::SetTabContext(aIsMozBrowserElement,
|
||||||
aIsPrerendered,
|
aIsPrerendered,
|
||||||
|
@ -266,8 +253,7 @@ public:
|
||||||
aAppFrameOwnerApp,
|
aAppFrameOwnerApp,
|
||||||
aShowAccelerators,
|
aShowAccelerators,
|
||||||
aShowFocusRings,
|
aShowFocusRings,
|
||||||
aOriginAttributes,
|
aOriginAttributes);
|
||||||
aPresentationURL);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5169,21 +5169,6 @@ pref("dom.udpsocket.enabled", false);
|
||||||
// Disable before keyboard events and after keyboard events by default.
|
// Disable before keyboard events and after keyboard events by default.
|
||||||
pref("dom.beforeAfterKeyboardEvent.enabled", false);
|
pref("dom.beforeAfterKeyboardEvent.enabled", false);
|
||||||
|
|
||||||
// Presentation API
|
|
||||||
pref("dom.presentation.enabled", false);
|
|
||||||
pref("dom.presentation.controller.enabled", false);
|
|
||||||
pref("dom.presentation.receiver.enabled", false);
|
|
||||||
|
|
||||||
// Presentation Device
|
|
||||||
pref("dom.presentation.tcp_server.debug", false);
|
|
||||||
pref("dom.presentation.discovery.enabled", false);
|
|
||||||
pref("dom.presentation.discovery.legacy.enabled", false);
|
|
||||||
pref("dom.presentation.discovery.timeout_ms", 10000);
|
|
||||||
pref("dom.presentation.discoverable", false);
|
|
||||||
pref("dom.presentation.discoverable.encrypted", true);
|
|
||||||
pref("dom.presentation.discoverable.retry_ms", 5000);
|
|
||||||
pref("dom.presentation.session_transport.data_channel.enable", false);
|
|
||||||
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
// In debug builds we crash by default on insecure text input (when a
|
// In debug builds we crash by default on insecure text input (when a
|
||||||
|
|
Loading…
Reference in New Issue