author | Frederic Wang <fred.wang@free.fr> |
Tue, 27 Oct 2020 14:10:22 +0000 | |
changeset 554667 | e6dcf7fa653df399dd51a398bb2ff72a1bb866bf |
parent 554666 | fbac66dafee12b30fa951cfd9edcdc04b494117d |
child 554668 | ab66bd46c2d6874336d5fad4faceaa9b9448ff5f |
push id | 37897 |
push user | ncsoregi@mozilla.com |
push date | Tue, 27 Oct 2020 21:20:52 +0000 |
treeherder | mozilla-central@ab66bd46c2d6 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smaug |
bugs | 1631464 |
milestone | 84.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -980,17 +980,16 @@ void Navigator::CheckProtocolHandlerAllo if (!Preferences::GetBool(specificPref.get(), defaultExternal)) { raisePermissionDeniedScheme(); return; } } void Navigator::RegisterProtocolHandler(const nsAString& aScheme, const nsAString& aURI, - const nsAString& aTitle, ErrorResult& aRv) { if (!mWindow || !mWindow->GetOuterWindow() || !mWindow->GetDocShell() || !mWindow->GetDoc()) { return; } nsCOMPtr<nsILoadContext> loadContext = do_GetInterface(mWindow); if (loadContext->UsePrivateBrowsing()) { // If we're a private window, don't alert the user or webpage. We log to the @@ -1009,30 +1008,34 @@ void Navigator::RegisterProtocolHandler( nsCOMPtr<nsIURI> handlerURI; NS_NewURI(getter_AddRefs(handlerURI), NS_ConvertUTF16toUTF8(aURI), doc->GetDocumentCharacterSet(), docURI); CheckProtocolHandlerAllowed(aScheme, handlerURI, docURI, aRv); if (aRv.Failed()) { return; } + // Determine a title from the document URI. + nsAutoCString docDisplayHostPort; + docURI->GetDisplayHostPort(docDisplayHostPort); + NS_ConvertASCIItoUTF16 title(docDisplayHostPort); + if (XRE_IsContentProcess()) { nsAutoString scheme(aScheme); - nsAutoString title(aTitle); RefPtr<BrowserChild> browserChild = BrowserChild::GetFrom(mWindow); browserChild->SendRegisterProtocolHandler(scheme, handlerURI, title, docURI); return; } nsCOMPtr<nsIWebProtocolHandlerRegistrar> registrar = do_GetService(NS_WEBPROTOCOLHANDLERREGISTRAR_CONTRACTID); if (registrar) { - aRv = registrar->RegisterProtocolHandler(aScheme, handlerURI, aTitle, - docURI, mWindow->GetOuterWindow()); + aRv = registrar->RegisterProtocolHandler(aScheme, handlerURI, title, docURI, + mWindow->GetOuterWindow()); } } Geolocation* Navigator::GetGeolocation(ErrorResult& aRv) { if (mGeolocation) { return mGeolocation; }
--- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -118,17 +118,17 @@ class Navigator final : public nsISuppor ErrorResult& aRv) const; void GetUserAgent(nsAString& aUserAgent, CallerType aCallerType, ErrorResult& aRv) const; bool OnLine(); void CheckProtocolHandlerAllowed(const nsAString& aScheme, nsIURI* aHandlerURI, nsIURI* aDocumentURI, ErrorResult& aRv); void RegisterProtocolHandler(const nsAString& aScheme, const nsAString& aURL, - const nsAString& aTitle, ErrorResult& aRv); + ErrorResult& aRv); nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv); nsPluginArray* GetPlugins(ErrorResult& aRv); Permissions* GetPermissions(ErrorResult& aRv); void GetDoNotTrack(nsAString& aResult); Geolocation* GetGeolocation(ErrorResult& aRv); Promise* GetBattery(ErrorResult& aRv); Promise* Share(const ShareData& aData, ErrorResult& aRv);
--- a/dom/webidl/Navigator.webidl +++ b/dom/webidl/Navigator.webidl @@ -79,17 +79,17 @@ interface mixin NavigatorOnLine { readonly attribute boolean onLine; }; interface mixin NavigatorContentUtils { // content handler registration [Throws, ChromeOnly] void checkProtocolHandlerAllowed(DOMString scheme, URI handlerURI, URI documentURI); [Throws, SecureContext] - void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title); + void registerProtocolHandler(DOMString scheme, DOMString url); // NOT IMPLEMENTED //void unregisterProtocolHandler(DOMString scheme, DOMString url); }; [SecureContext] interface mixin NavigatorStorage { [Pref="dom.storageManager.enabled"] readonly attribute StorageManager storage;
--- a/testing/web-platform/meta/html/dom/idlharness.https.html.ini +++ b/testing/web-platform/meta/html/dom/idlharness.https.html.ini @@ -706,19 +706,16 @@ prefs: [dom.security.featurePolicy.exper expected: FAIL [OffscreenCanvas interface: operation convertToBlob(optional ImageEncodeOptions)] expected: FAIL [OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)] expected: FAIL - [Navigator interface: operation registerProtocolHandler(DOMString, USVString)] - expected: FAIL - [ElementInternals interface: operation setValidity(optional ValidityStateFlags, optional DOMString, optional HTMLElement)] expected: FAIL [ElementInternals interface: attribute shadowRoot] expected: FAIL [idlharness.https.html?include=(Document|Window)]