ma1 pushed to branch tor-browser-140.11.0esr-15.0-1 at The Tor Project / Applications / Tor Browser Commits: 008d95b0 by Dimi at 2026-05-17T10:23:55+02:00 Bug 1962625 - Add locationspecific to PopupAutoComplete a=dmeehan DONTBUILD Original Revision: https://phabricator.services.mozilla.com/D299380 Differential Revision: https://phabricator.services.mozilla.com/D300231 - - - - - da9bf4d8 by Edgar Chen at 2026-05-17T10:24:01+02:00 Bug 2038439 - Clean up stylesheets when destroying Document/ShadowRoot; a=dmeehan DONTBUILD Original Revision: https://phabricator.services.mozilla.com/D299725 Differential Revision: https://phabricator.services.mozilla.com/D300239 - - - - - b3693a31 by Nika Layzell at 2026-05-17T10:24:02+02:00 Bug 2038678 - Clean up unnecessary object traversal for remoteType, a=dmeehan Original Revision: https://phabricator.services.mozilla.com/D299731 Differential Revision: https://phabricator.services.mozilla.com/D300374 - - - - - 13 changed files: - browser/base/content/main-popupset.inc.xhtml - browser/components/aboutlogins/AboutLoginsParent.sys.mjs - browser/components/migration/MigrationWizardParent.sys.mjs - dom/base/Document.cpp - dom/base/DocumentOrShadowRoot.cpp - dom/base/ShadowRoot.cpp - dom/chrome-webidl/WindowGlobalActors.webidl - dom/ipc/WindowGlobalParent.cpp - dom/ipc/WindowGlobalParent.h - services/fxaccounts/FxAccountsWebChannel.sys.mjs - toolkit/actors/WebChannelParent.sys.mjs - toolkit/components/extensions/ConduitsParent.sys.mjs - toolkit/modules/WebChannel.sys.mjs Changes: ===================================== browser/base/content/main-popupset.inc.xhtml ===================================== @@ -133,7 +133,8 @@ hidden="true" overflowpadding="4" norolluponanchor="true" - nomaxresults="true" /> + nomaxresults="true" + locationspecific="true" /> <!-- for search with one-off buttons --> <panel is="search-autocomplete-richlistbox-popup" ===================================== browser/components/aboutlogins/AboutLoginsParent.sys.mjs ===================================== @@ -87,12 +87,9 @@ export class AboutLoginsParent extends JSWindowActorParent { // Only respond to messages sent from a privlegedabout process. Ideally // we would also check the contentPrincipal.originNoSuffix but this // check has been removed due to bug 1576722. - if ( - this.browsingContext.embedderElement.remoteType != - EXPECTED_ABOUTLOGINS_REMOTE_TYPE - ) { + if (this.manager.remoteType != EXPECTED_ABOUTLOGINS_REMOTE_TYPE) { throw new Error( - `AboutLoginsParent: Received ${message.name} message the remote type didn't match expectations: ${this.browsingContext.embedderElement.remoteType} == ${EXPECTED_ABOUTLOGINS_REMOTE_TYPE}` + `AboutLoginsParent: Received ${message.name} message the remote type didn't match expectations: ${this.manager.remoteType} == ${EXPECTED_ABOUTLOGINS_REMOTE_TYPE}` ); } ===================================== browser/components/migration/MigrationWizardParent.sys.mjs ===================================== @@ -62,9 +62,8 @@ export class MigrationWizardParent extends JSWindowActorParent { // make sure that any messages from content are coming from the privileged // about content process type. if ( - !this.browsingContext.currentWindowGlobal.isInProcess && - this.browsingContext.currentRemoteType != - E10SUtils.PRIVILEGEDABOUT_REMOTE_TYPE + !this.manager.isInProcess && + this.manager.remoteType != E10SUtils.PRIVILEGEDABOUT_REMOTE_TYPE ) { throw new Error( "MigrationWizardParent: received message from the wrong content process type." ===================================== dom/base/Document.cpp ===================================== @@ -2565,6 +2565,8 @@ Document::~Document() { mDocGroup->GetBrowsingContextGroup()->RemoveDocument(this, mDocGroup); } + DocumentOrShadowRoot::Unlink(this); + UnlinkOriginalDocumentIfStatic(); UnregisterFromMemoryReportingForDataDocument(); ===================================== dom/base/DocumentOrShadowRoot.cpp ===================================== @@ -62,9 +62,7 @@ void DocumentOrShadowRoot::AddSizeOfExcludingThis(nsWindowSizes& aSizes) const { } DocumentOrShadowRoot::~DocumentOrShadowRoot() { - for (StyleSheet* sheet : mStyleSheets) { - sheet->ClearAssociatedDocumentOrShadowRoot(); - } + MOZ_ASSERT(mStyleSheets.IsEmpty()); } StyleSheetList* DocumentOrShadowRoot::StyleSheets() { ===================================== dom/base/ShadowRoot.cpp ===================================== @@ -105,6 +105,8 @@ ShadowRoot::~ShadowRoot() { MOZ_DIAGNOSTIC_ASSERT(!OwnerDoc()->IsComposedDocShadowRoot(*this)); + DocumentOrShadowRoot::Unlink(this); + UnsetFlags(NODE_IS_IN_SHADOW_TREE); // nsINode destructor expects mSubtreeRoot == this. ===================================== dom/chrome-webidl/WindowGlobalActors.webidl ===================================== @@ -80,6 +80,9 @@ interface WindowGlobalParent : WindowContext { readonly attribute long osPid; + // The remote type of `this.domProcess`. + readonly attribute UTF8String? remoteType; + // A WindowGlobalParent is the root in its process if it has no parent, or its // embedder is in a different process. readonly attribute boolean isProcessRoot; ===================================== dom/ipc/WindowGlobalParent.cpp ===================================== @@ -591,6 +591,10 @@ const nsACString& WindowGlobalParent::GetRemoteType() { return NOT_REMOTE_TYPE; } +void WindowGlobalParent::GetRemoteType(nsACString& aRemoteType) { + aRemoteType = GetRemoteType(); +} + void WindowGlobalParent::NotifyContentBlockingEvent( uint32_t aEvent, nsIRequest* aRequest, bool aBlocked, const nsACString& aTrackingOrigin, ===================================== dom/ipc/WindowGlobalParent.h ===================================== @@ -218,6 +218,7 @@ class WindowGlobalParent final : public WindowContext, nsITransportSecurityInfo* GetSecurityInfo() { return mSecurityInfo; } const nsACString& GetRemoteType() override; + void GetRemoteType(nsACString& aRemoteType); void NotifySessionStoreUpdatesComplete(Element* aEmbedder); ===================================== services/fxaccounts/FxAccountsWebChannel.sys.mjs ===================================== @@ -244,10 +244,12 @@ FxAccountsWebChannel.prototype = { lazy.accountServer.asciiHost.endsWith("." + val) ); }); - let { currentRemoteType } = sendingContext.browsingContext; - if (shouldCheckRemoteType && currentRemoteType != "privilegedmozilla") { + if ( + shouldCheckRemoteType && + sendingContext.remoteType != "privilegedmozilla" + ) { log.error( - `Rejected FxA webchannel message from remoteType = ${currentRemoteType}` + `Rejected FxA webchannel message from remoteType = ${sendingContext.remoteType}` ); return; } @@ -471,6 +473,9 @@ FxAccountsWebChannel.prototype = { * The <EventTarget> where the message was sent. * @param sendingContext.principal {Principal} * The <Principal> of the EventTarget where the message was sent. + * @param sendingContext.remoteType {String} + * The remoteType from which the + * WebChannelMessageToChrome was sent. * @private * */ ===================================== toolkit/actors/WebChannelParent.sys.mjs ===================================== @@ -18,6 +18,7 @@ export class WebChannelParent extends JSWindowActorParent { browser: this.browsingContext.top.embedderElement, eventTarget: msg.data.eventTarget, principal: this.manager.documentPrincipal, + remoteType: this.manager.remoteType, }; // data must be a string except for a few legacy origins allowed by browser-content.js. if (typeof data == "string") { ===================================== toolkit/components/extensions/ConduitsParent.sys.mjs ===================================== @@ -165,19 +165,23 @@ const Hub = { let windowGlobal = actor.manager; while (windowGlobal) { - let { browsingContext: bc, documentPrincipal: prin } = windowGlobal; + let { + parentWindowContext: parent, + documentPrincipal: prin, + remoteType, + } = windowGlobal; if (prin.addonId !== extensionId) { throw new Error(`Bad ${extensionId} principal: ${prin.URI.spec}`); } - if (bc.currentRemoteType !== prin.addonPolicy.extension.remoteType) { - throw new Error(`Bad ${extensionId} process: ${bc.currentRemoteType}`); + if (remoteType !== prin.addonPolicy.extension.remoteType) { + throw new Error(`Bad ${extensionId} process: ${remoteType}`); } - if (!bc.parent) { + if (!parent) { return true; } - windowGlobal = bc.embedderWindowGlobal; + windowGlobal = parent; } throw new Error(`Missing WindowGlobalParent for ${extensionId}`); }, ===================================== toolkit/modules/WebChannel.sys.mjs ===================================== @@ -170,6 +170,9 @@ WebChannel.prototype = { * @param sendingContext.principal {Principal} * The <Principal> of the EventTarget where the * message was sent. + * @param sendingContext.remoteType {String} + * The remoteType from which the + * WebChannelMessageToChrome was sent. */ listen(callback) { if (this._deliverCallback) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/9782537... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/9782537... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help