diff --git a/Makefile b/Makefile index 8d43476..0ee143c 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,10 @@ ff-dbg: setup # Only apply patches to help debug vanilla Firefox make patch ./patches/chromeutil.patch make patch ./patches/debug-url-navigation.patch - echo "\nLOCAL_INCLUDES += ['/camoucfg']" >> $(cf_source_dir)/dom/base/moz.build + echo "LOCAL_INCLUDES += ['/camoucfg']" >> $(cf_source_dir)/dom/base/moz.build touch $(cf_source_dir)/_READY make checkpoint + make build revert: cd $(cf_source_dir) && git reset --hard unpatched diff --git a/additions/juggler/NetworkObserver.js b/additions/juggler/NetworkObserver.js index aa6f866..60765c8 100644 --- a/additions/juggler/NetworkObserver.js +++ b/additions/juggler/NetworkObserver.js @@ -145,10 +145,13 @@ class NetworkRequest { } this._expectingInterception = false; this._expectingResumedRequest = undefined; // { method, headers, postData } + this._overriddenHeadersForRedirect = redirectedFrom?._overriddenHeadersForRedirect; this._sentOnResponse = false; this._fulfilled = false; - if (this._pageNetwork) + if (this._overriddenHeadersForRedirect) + overrideRequestHeaders(httpChannel, this._overriddenHeadersForRedirect); + else if (this._pageNetwork) appendExtraHTTPHeaders(httpChannel, this._pageNetwork.combinedExtraHTTPHeaders()); this._responseBodyChunks = []; @@ -230,20 +233,13 @@ class NetworkRequest { if (!this._expectingResumedRequest) return; const { method, headers, postData } = this._expectingResumedRequest; + this._overriddenHeadersForRedirect = headers; this._expectingResumedRequest = undefined; - if (headers) { - for (const header of requestHeaders(this.httpChannel)) { - // We cannot remove the "host" header. - if (header.name.toLowerCase() === 'host') - continue; - this.httpChannel.setRequestHeader(header.name, '', false /* merge */); - } - for (const header of headers) - this.httpChannel.setRequestHeader(header.name, header.value, false /* merge */); - } else if (this._pageNetwork) { + if (headers) + overrideRequestHeaders(this.httpChannel, headers); + else if (this._pageNetwork) appendExtraHTTPHeaders(this.httpChannel, this._pageNetwork.combinedExtraHTTPHeaders()); - } if (method) this.httpChannel.requestMethod = method; if (postData !== undefined) @@ -773,6 +769,20 @@ function requestHeaders(httpChannel) { return headers; } +function clearRequestHeaders(httpChannel) { + for (const header of requestHeaders(httpChannel)) { + // We cannot remove the "host" header. + if (header.name.toLowerCase() === 'host') + continue; + httpChannel.setRequestHeader(header.name, '', false /* merge */); + } +} + +function overrideRequestHeaders(httpChannel, headers) { + clearRequestHeaders(httpChannel); + appendExtraHTTPHeaders(httpChannel, headers); +} + function causeTypeToString(causeType) { for (let key in Ci.nsIContentPolicy) { if (Ci.nsIContentPolicy[key] === causeType) @@ -954,4 +964,4 @@ PageNetwork.Events = { var EXPORTED_SYMBOLS = ['NetworkObserver', 'PageNetwork']; this.NetworkObserver = NetworkObserver; -this.PageNetwork = PageNetwork; +this.PageNetwork = PageNetwork; \ No newline at end of file diff --git a/additions/juggler/components/Juggler.js b/additions/juggler/components/Juggler.js index acc38b2..7709778 100644 --- a/additions/juggler/components/Juggler.js +++ b/additions/juggler/components/Juggler.js @@ -4,6 +4,7 @@ var EXPORTED_SYMBOLS = ["Juggler", "JugglerFactory"]; +const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {ComponentUtils} = ChromeUtils.import("resource://gre/modules/ComponentUtils.jsm"); const {Dispatcher} = ChromeUtils.import("chrome://juggler/content/protocol/Dispatcher.js"); @@ -105,7 +106,12 @@ class Juggler { }; // Force create hidden window here, otherwise its creation later closes the web socket! - Services.appShell.hiddenDOMWindow; + // In FF132, the hidden window has been removed on Linux and Windows. Only enable it on Mac. + // https://bugzilla.mozilla.org/show_bug.cgi?id=71895 + if (AppConstants.platform === "macosx") { + ChromeUtils.camouDebug('Creating hidden window'); + Services.appShell.hiddenDOMWindow; + } let pipeStopped = false; let browserHandler; diff --git a/additions/juggler/content/FrameTree.js b/additions/juggler/content/FrameTree.js index c83844e..b6b4e66 100644 --- a/additions/juggler/content/FrameTree.js +++ b/additions/juggler/content/FrameTree.js @@ -46,8 +46,6 @@ class FrameTree { Ci.nsISupportsWeakReference, ]); - this._addedScrollbarsStylesheetSymbol = Symbol('_addedScrollbarsStylesheetSymbol'); - this._wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"].createInstance(Ci.nsIWorkerDebuggerManager); this._wdmListener = { QueryInterface: ChromeUtils.generateQI([Ci.nsIWorkerDebuggerManagerListener]), @@ -130,24 +128,12 @@ class FrameTree { } _onDOMWindowCreated(window) { - if (!window[this._addedScrollbarsStylesheetSymbol] && this.scrollbarsHidden) { - const styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService); - const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); - const uri = ioService.newURI('chrome://juggler/content/content/hidden-scrollbars.css', null, null); - const sheet = styleSheetService.preloadSheet(uri, styleSheetService.AGENT_SHEET); - window.windowUtils.addSheet(sheet, styleSheetService.AGENT_SHEET); - window[this._addedScrollbarsStylesheetSymbol] = true; - } const frame = this.frameForDocShell(window.docShell); if (!frame) return; frame._onGlobalObjectCleared(); } - setScrollbarsHidden(hidden) { - this.scrollbarsHidden = hidden; - } - setJavaScriptDisabled(javaScriptDisabled) { this._javaScriptDisabled = javaScriptDisabled; for (const frame of this.frames()) diff --git a/additions/juggler/content/PageAgent.js b/additions/juggler/content/PageAgent.js index 70dcf04..255b84f 100644 --- a/additions/juggler/content/PageAgent.js +++ b/additions/juggler/content/PageAgent.js @@ -120,7 +120,8 @@ class PageAgent { // After the dragStart event is dispatched and handled by Web, // it might or might not create a new drag session, depending on its preventing default. setTimeout(() => { - this._browserPage.emit('pageInputEvent', { type: 'juggler-drag-finalized', dragSessionStarted: !!dragService.getCurrentSession() }); + const session = this._getCurrentDragSession(); + this._browserPage.emit('pageInputEvent', { type: 'juggler-drag-finalized', dragSessionStarted: !!session }); }, 0); } }), @@ -526,8 +527,14 @@ class PageAgent { }); } + _getCurrentDragSession() { + const frame = this._frameTree.mainFrame(); + const domWindow = frame?.domWindow(); + return domWindow ? dragService.getCurrentSession(domWindow) : undefined; + } + async _dispatchDragEvent({type, x, y, modifiers}) { - const session = dragService.getCurrentSession(); + const session = this._getCurrentDragSession(); const dropEffect = session.dataTransfer.dropEffect; if ((type === 'drop' && dropEffect !== 'none') || type === 'dragover') { @@ -551,9 +558,8 @@ class PageAgent { return; } if (type === 'dragend') { - const session = dragService.getCurrentSession(); - if (session) - dragService.endDragSession(true); + const session = this._getCurrentDragSession(); + session?.endDragSession(true); return; } } diff --git a/additions/juggler/content/main.js b/additions/juggler/content/main.js index 15986bb..7eaa704 100644 --- a/additions/juggler/content/main.js +++ b/additions/juggler/content/main.js @@ -45,10 +45,6 @@ function initialize(browsingContext, docShell) { docShell.languageOverride = locale; }, - scrollbarsHidden: (hidden) => { - data.frameTree.setScrollbarsHidden(hidden); - }, - javaScriptDisabled: (javaScriptDisabled) => { data.frameTree.setJavaScriptDisabled(javaScriptDisabled); }, diff --git a/additions/juggler/protocol/BrowserHandler.js b/additions/juggler/protocol/BrowserHandler.js index 7de276d..6a4688e 100644 --- a/additions/juggler/protocol/BrowserHandler.js +++ b/additions/juggler/protocol/BrowserHandler.js @@ -255,10 +255,6 @@ class BrowserHandler { await this._targetRegistry.browserContextForId(browserContextId).setDefaultViewport(nullToUndefined(viewport)); } - async ['Browser.setScrollbarsHidden']({browserContextId, hidden}) { - await this._targetRegistry.browserContextForId(browserContextId).applySetting('scrollbarsHidden', nullToUndefined(hidden)); - } - async ['Browser.setInitScripts']({browserContextId, scripts}) { await this._targetRegistry.browserContextForId(browserContextId).setInitScripts(scripts); } diff --git a/additions/juggler/protocol/Protocol.js b/additions/juggler/protocol/Protocol.js index 2b7ad56..2b93186 100644 --- a/additions/juggler/protocol/Protocol.js +++ b/additions/juggler/protocol/Protocol.js @@ -394,12 +394,6 @@ const Browser = { viewport: t.Nullable(pageTypes.Viewport), } }, - 'setScrollbarsHidden': { - params: { - browserContextId: t.Optional(t.String), - hidden: t.Boolean, - } - }, 'setInitScripts': { params: { browserContextId: t.Optional(t.String), diff --git a/patches/librewolf/ui-patches/allow_cookies_for_site.patch b/patches/librewolf/ui-patches/allow_cookies_for_site.patch deleted file mode 100644 index 3d7a55c..0000000 --- a/patches/librewolf/ui-patches/allow_cookies_for_site.patch +++ /dev/null @@ -1,76 +0,0 @@ -diff --git a/browser/base/content/browser-siteIdentity.js b/browser/base/content/browser-siteIdentity.js -index 4efbba2..5445b03 100644 ---- a/browser/base/content/browser-siteIdentity.js -+++ b/browser/base/content/browser-siteIdentity.js -@@ -414,6 +414,33 @@ var gIdentityHandler = { - event.stopPropagation(); - }, - -+ async refreshSiteData() { -+ document.getElementById("identity-popup-allow-sitedata-toggle").toggleAttribute( -+ "pressed", -+ Services.perms.testExactPermissionFromPrincipal( -+ gBrowser.contentPrincipal, -+ "cookie" -+ ) === Services.perms.ALLOW_ACTION -+ ); -+ }, -+ -+ async toggleSiteData() { -+ const pressed = document.getElementById("identity-popup-allow-sitedata-toggle").toggleAttribute( -+ "pressed" -+ ); -+ -+ if (pressed) { -+ Services.perms.addFromPrincipal( -+ gBrowser.contentPrincipal, -+ "cookie", -+ Services.perms.ALLOW_ACTION, -+ Services.perms.EXPIRE_NEVER -+ ); -+ } else { -+ Services.perms.removeFromPrincipal(gBrowser.contentPrincipal, "cookie"); -+ } -+ }, -+ - /** - * Handler for mouseclicks on the "More Information" button in the - * "identity-popup" panel. -@@ -1151,6 +1178,8 @@ var gIdentityHandler = { - this._identityPopupContentOwner.textContent = owner; - this._identityPopupContentSupp.textContent = supplemental; - this._identityPopupContentVerif.textContent = verifier; -+ -+ this.refreshSiteData(); - }, - - setURI(uri) { -diff --git a/browser/components/controlcenter/content/identityPanel.inc.xhtml b/browser/components/controlcenter/content/identityPanel.inc.xhtml -index 8bc64fa..4a4a1af 100644 ---- a/browser/components/controlcenter/content/identityPanel.inc.xhtml -+++ b/browser/components/controlcenter/content/identityPanel.inc.xhtml -@@ -96,6 +96,12 @@ - data-l10n-id="identity-clear-site-data" - class="subviewbutton" - oncommand="gIdentityHandler.clearSiteData(event);"/> -+ -+ -+ -+ - - - -diff --git a/browser/locales/en-US/browser/browser.ftl b/browser/locales/en-US/browser/browser.ftl -index 0dbdc78..e183f1a 100644 ---- a/browser/locales/en-US/browser/browser.ftl -+++ b/browser/locales/en-US/browser/browser.ftl -@@ -402,6 +402,7 @@ identity-permissions-storage-access-learn-more = Learn more - identity-permissions-reload-hint = You may need to reload the page for changes to apply. - identity-clear-site-data = - .label = Clear cookies and site data… -+identity-allow-site-data = Camoufox: Always store cookies/data for this site - identity-connection-not-secure-security-view = You are not securely connected to this site. - identity-connection-verified = You are securely connected to this site. - identity-ev-owner-label = Certificate issued to: diff --git a/patches/playwright/0-playwright-updated.patch b/patches/playwright/0-playwright-updated.patch index 09eddef..f2b61c2 100644 --- a/patches/playwright/0-playwright-updated.patch +++ b/patches/playwright/0-playwright-updated.patch @@ -106,10 +106,10 @@ index 213a99ed43..ee4f6484cd 100644 browser/chrome/browser/content/activity-stream/data/content/tippytop/favicons/allegro-pl.ico browser/defaults/settings/main/search-config-icons/96327a73-c433-5eb4-a16d-b090cadfb80b diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in -index da760e1437..a7579b3eae 100644 +index 8aa6bf6563..49e98523b3 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in -@@ -189,6 +189,9 @@ +@@ -196,6 +196,9 @@ @RESPATH@/chrome/remote.manifest #endif @@ -167,10 +167,10 @@ index d49c6fbf1b..7ea3540947 100644 const transportProvider = { setListener(upgradeListener) { diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp -index e1721f31d4..b3bc2d575d 100644 +index 9b5c8143cb..104ec4e522 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp -@@ -106,8 +106,15 @@ struct ParamTraits +@@ -106,8 +106,11 @@ struct ParamTraits template <> struct ParamTraits @@ -181,14 +181,10 @@ index e1721f31d4..b3bc2d575d 100644 +template <> +struct ParamTraits + : public mozilla::dom::WebIDLEnumSerializer {}; -+ -+template <> -+struct ParamTraits -+ : public mozilla::dom::WebIDLEnumSerializer {}; template <> - struct ParamTraits -@@ -2818,6 +2825,40 @@ void BrowsingContext::DidSet(FieldIndex, + struct ParamTraits +@@ -2865,6 +2868,23 @@ void BrowsingContext::DidSet(FieldIndex, PresContextAffectingFieldChanged(); } @@ -208,29 +204,12 @@ index e1721f31d4..b3bc2d575d 100644 + } + }); +} -+ -+void BrowsingContext::DidSet(FieldIndex, -+ dom::ForcedColorsOverride aOldValue) { -+ MOZ_ASSERT(IsTop()); -+ if (ForcedColorsOverride() == aOldValue) { -+ return; -+ } -+ PreOrderWalk([&](BrowsingContext* aContext) { -+ if (nsIDocShell* shell = aContext->GetDocShell()) { -+ if (nsPresContext* pc = shell->GetPresContext()) { -+ pc->MediaFeatureValuesChanged( -+ {MediaFeatureChangeReason::SystemMetricsChange}, -+ MediaFeatureChangePropagation::JustThisDocument); -+ } -+ } -+ }); -+} + void BrowsingContext::DidSet(FieldIndex, nsString&& aOldValue) { MOZ_ASSERT(IsTop()); diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h -index 61135ab0d7..cc8eb043f1 100644 +index 98a34cab1f..2ba028dd27 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h @@ -203,10 +203,10 @@ struct EmbedderColorSchemes { @@ -246,18 +225,16 @@ index 61135ab0d7..cc8eb043f1 100644 FIELD(EmbedderElementType, Maybe) \ FIELD(MessageManagerGroup, nsString) \ FIELD(MaxTouchPointsOverride, uint8_t) \ -@@ -244,6 +244,10 @@ struct EmbedderColorSchemes { +@@ -246,6 +246,8 @@ struct EmbedderColorSchemes { * embedder element. */ \ FIELD(EmbedderColorSchemes, EmbedderColorSchemes) \ FIELD(DisplayMode, dom::DisplayMode) \ + /* playwright addition */ \ + FIELD(PrefersReducedMotionOverride, dom::PrefersReducedMotionOverride) \ -+ /* playwright addition */ \ -+ FIELD(ForcedColorsOverride, dom::ForcedColorsOverride) \ /* The number of entries added to the session history because of this \ * browsing context. */ \ FIELD(HistoryEntryCount, uint32_t) \ -@@ -937,6 +941,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -942,6 +944,10 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { return GetPrefersColorSchemeOverride(); } @@ -265,14 +242,10 @@ index 61135ab0d7..cc8eb043f1 100644 + return GetPrefersReducedMotionOverride(); + } + -+ dom::ForcedColorsOverride ForcedColorsOverride() const { -+ return GetForcedColorsOverride(); -+ } -+ - bool IsInBFCache() const; - - bool AllowJavascript() const { return GetAllowJavascript(); } -@@ -1101,6 +1113,23 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { + dom::ForcedColorsOverride ForcedColorsOverride() const { + return GetForcedColorsOverride(); + } +@@ -1125,6 +1131,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { void WalkPresContexts(Callback&&); void PresContextAffectingFieldChanged(); @@ -283,33 +256,24 @@ index 61135ab0d7..cc8eb043f1 100644 + + void DidSet(FieldIndex, + dom::PrefersReducedMotionOverride aOldValue); -+ -+ -+ bool CanSet(FieldIndex, -+ dom::ForcedColorsOverride, ContentParent*) { -+ return IsTop(); -+ } -+ -+ void DidSet(FieldIndex, -+ dom::ForcedColorsOverride aOldValue); + void DidSet(FieldIndex, nsString&& aOldValue); bool CanSet(FieldIndex, bool, ContentParent*) { diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp -index f0d8cb2539..a680d44583 100644 +index 57bd331851..68dda82744 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp -@@ -324,6 +324,8 @@ void CanonicalBrowsingContext::ReplacedBy( - txn.SetHasRestoreData(GetHasRestoreData()); +@@ -325,6 +325,8 @@ void CanonicalBrowsingContext::ReplacedBy( txn.SetShouldDelayMediaFromStart(GetShouldDelayMediaFromStart()); txn.SetForceOffline(GetForceOffline()); + txn.SetTopInnerSizeForRFP(GetTopInnerSizeForRFP()); + txn.SetPrefersReducedMotionOverride(GetPrefersReducedMotionOverride()); + txn.SetForcedColorsOverride(GetForcedColorsOverride()); // Propagate some settings on BrowsingContext replacement so they're not lost // on bfcached navigations. These are important for GeckoView (see bug -@@ -1594,6 +1596,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, +@@ -1610,6 +1612,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, return; } @@ -323,7 +287,7 @@ index f0d8cb2539..a680d44583 100644 } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp -index c15a424a05..fa9989e313 100644 +index 17f0d7fa70..e1728e7cb1 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -15,6 +15,12 @@ @@ -385,7 +349,7 @@ index c15a424a05..fa9989e313 100644 mAllowAuth(mItemType == typeContent), mAllowKeywordFixup(false), mDisableMetaRefreshWhenInactive(false), -@@ -3046,6 +3063,214 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { +@@ -3018,6 +3035,214 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { return NS_OK; } @@ -600,7 +564,7 @@ index c15a424a05..fa9989e313 100644 NS_IMETHODIMP nsDocShell::GetIsNavigating(bool* aOut) { *aOut = mIsNavigating; -@@ -4739,7 +4964,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { +@@ -4714,7 +4939,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { } void nsDocShell::ActivenessMaybeChanged() { @@ -609,7 +573,7 @@ index c15a424a05..fa9989e313 100644 if (RefPtr presShell = GetPresShell()) { presShell->ActivenessMaybeChanged(); } -@@ -6688,6 +6913,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, +@@ -6641,6 +6866,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, return false; // no entry to save into } @@ -620,7 +584,7 @@ index c15a424a05..fa9989e313 100644 MOZ_ASSERT(!mozilla::SessionHistoryInParent(), "mOSHE cannot be non-null with SHIP"); nsCOMPtr viewer = mOSHE->GetDocumentViewer(); -@@ -8420,6 +8649,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { +@@ -8373,6 +8602,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { true, // aForceNoOpener getter_AddRefs(newBC)); MOZ_ASSERT(!newBC); @@ -633,7 +597,7 @@ index c15a424a05..fa9989e313 100644 return rv; } -@@ -9556,6 +9791,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, +@@ -9520,6 +9755,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr); nsCOMPtr req; @@ -650,7 +614,7 @@ index c15a424a05..fa9989e313 100644 rv = DoURILoad(aLoadState, aCacheKey, getter_AddRefs(req)); if (NS_SUCCEEDED(rv)) { -@@ -12754,6 +12999,9 @@ class OnLinkClickEvent : public Runnable { +@@ -12724,6 +12969,9 @@ class OnLinkClickEvent : public Runnable { mHandler->OnLinkClickSync(mContent, mLoadState, mNoOpenerImplied, mTriggeringPrincipal); } @@ -660,7 +624,7 @@ index c15a424a05..fa9989e313 100644 return NS_OK; } -@@ -12843,6 +13091,8 @@ nsresult nsDocShell::OnLinkClick( +@@ -12813,6 +13061,8 @@ nsresult nsDocShell::OnLinkClick( nsCOMPtr ev = new OnLinkClickEvent(this, aContent, loadState, noOpenerImplied, aIsTrusted, aTriggeringPrincipal); @@ -670,7 +634,7 @@ index c15a424a05..fa9989e313 100644 } diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h -index 0ea84df4dd..b00bc444a5 100644 +index 0cf72f8fff..0b09b28777 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -15,6 +15,7 @@ @@ -689,7 +653,7 @@ index 0ea84df4dd..b00bc444a5 100644 class nsGlobalWindowOuter; class FramingChecker; -@@ -401,6 +403,15 @@ class nsDocShell final : public nsDocLoader, +@@ -403,6 +405,15 @@ class nsDocShell final : public nsDocLoader, void SetWillChangeProcess() { mWillChangeProcess = true; } bool WillChangeProcess() { return mWillChangeProcess; } @@ -705,7 +669,7 @@ index 0ea84df4dd..b00bc444a5 100644 // Create a content viewer within this nsDocShell for the given // `WindowGlobalChild` actor. nsresult CreateDocumentViewerForActor( -@@ -1004,6 +1015,8 @@ class nsDocShell final : public nsDocLoader, +@@ -1006,6 +1017,8 @@ class nsDocShell final : public nsDocLoader, bool CSSErrorReportingEnabled() const { return mCSSErrorReportingEnabled; } @@ -714,7 +678,7 @@ index 0ea84df4dd..b00bc444a5 100644 // Handles retrieval of subframe session history for nsDocShell::LoadURI. If a // load is requested in a subframe of the current DocShell, the subframe // loadType may need to reflect the loadType of the parent document, or in -@@ -1291,6 +1304,16 @@ class nsDocShell final : public nsDocLoader, +@@ -1283,6 +1296,16 @@ class nsDocShell final : public nsDocLoader, bool mAllowDNSPrefetch : 1; bool mAllowWindowControl : 1; bool mCSSErrorReportingEnabled : 1; @@ -781,10 +745,10 @@ index fdc04f16c6..199f8fdb06 100644 * This attempts to save any applicable layout history state (like * scroll position) in the nsISHEntry. This is normally done diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp -index 79f3524037..2b75a1eaff 100644 +index b460181916..2c0c4c57d7 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp -@@ -3783,6 +3783,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { +@@ -3745,6 +3745,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { } void Document::ApplySettingsFromCSP(bool aSpeculative) { @@ -794,7 +758,7 @@ index 79f3524037..2b75a1eaff 100644 nsresult rv = NS_OK; if (!aSpeculative) { // 1) apply settings from regular CSP -@@ -3840,6 +3843,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { +@@ -3802,6 +3805,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { MOZ_ASSERT(!mScriptGlobalObject, "CSP must be initialized before mScriptGlobalObject is set!"); @@ -806,7 +770,7 @@ index 79f3524037..2b75a1eaff 100644 // If this is a data document - no need to set CSP. if (mLoadedAsData) { return NS_OK; -@@ -4641,6 +4649,10 @@ bool Document::HasFocus(ErrorResult& rv) const { +@@ -4603,6 +4611,10 @@ bool Document::HasFocus(ErrorResult& rv) const { return false; } @@ -817,7 +781,7 @@ index 79f3524037..2b75a1eaff 100644 if (!fm->IsInActiveWindow(bc)) { return false; } -@@ -19139,6 +19151,66 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { +@@ -19462,6 +19474,66 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { return PreferenceSheet::PrefsFor(*this).mColorScheme; } @@ -885,10 +849,10 @@ index 79f3524037..2b75a1eaff 100644 if (!sLoadingForegroundTopLevelContentDocument) { return false; diff --git a/dom/base/Document.h b/dom/base/Document.h -index 7a8d8f2a71..e030e6b7ad 100644 +index 9b748acbce..cab7ff150d 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h -@@ -4077,6 +4077,9 @@ class Document : public nsINode, +@@ -4108,6 +4108,9 @@ class Document : public nsINode, // color-scheme meta tag. ColorScheme DefaultColorScheme() const; @@ -899,7 +863,7 @@ index 7a8d8f2a71..e030e6b7ad 100644 static bool AutomaticStorageAccessPermissionCanBeGranted( diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp -index e26e0968c1..8e577bd9fd 100644 +index d7ed73aee3..4c84c3e9d9 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -344,14 +344,18 @@ void Navigator::GetAppName(nsAString& aAppName) const { @@ -938,7 +902,7 @@ index e26e0968c1..8e577bd9fd 100644 // The returned value is cached by the binding code. The window listens to the // accept languages change and will clear the cache when needed. It has to -@@ -2287,6 +2297,10 @@ dom::PrivateAttribution* Navigator::PrivateAttribution() { +@@ -2278,6 +2288,10 @@ dom::PrivateAttribution* Navigator::PrivateAttribution() { /* static */ bool Navigator::Webdriver() { @@ -949,7 +913,7 @@ index e26e0968c1..8e577bd9fd 100644 #ifdef ENABLE_WEBDRIVER nsCOMPtr marionette = do_GetService(NS_MARIONETTE_CONTRACTID); if (marionette) { -@@ -2306,8 +2320,6 @@ bool Navigator::Webdriver() { +@@ -2297,8 +2311,6 @@ bool Navigator::Webdriver() { } } #endif @@ -972,88 +936,82 @@ index 6abf6cef23..46ead1f32e 100644 dom::MediaCapabilities* MediaCapabilities(); dom::MediaSession* MediaSession(); diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp -index 8518005d29..9065f304a3 100644 +index 80df23b73f..0b82f71178 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp -@@ -8809,7 +8809,8 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8793,7 +8793,8 @@ nsresult nsContentUtils::SendMouseEvent( bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, PreventDefaultResult* aPreventDefault, bool aIsDOMEventSynthesized, - bool aIsWidgetEventSynthesized) { -+ bool aIsWidgetEventSynthesized, bool convertToPointer, -+ uint32_t aJugglerEventId) { ++ bool aIsWidgetEventSynthesized, ++ bool convertToPointer, uint32_t aJugglerEventId) { nsPoint offset; nsCOMPtr widget = GetWidget(aPresShell, &offset); if (!widget) return NS_ERROR_FAILURE; -@@ -8817,6 +8818,7 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8801,6 +8802,7 @@ nsresult nsContentUtils::SendMouseEvent( EventMessage msg; Maybe exitFrom; bool contextMenuKey = false; -+ bool isDragEvent = false; ++ bool isPWDragEventMessage = false; if (aType.EqualsLiteral("mousedown")) { msg = eMouseDown; } else if (aType.EqualsLiteral("mouseup")) { -@@ -8841,6 +8843,12 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8826,6 +8828,12 @@ nsresult nsContentUtils::SendMouseEvent( msg = eMouseHitTest; } else if (aType.EqualsLiteral("MozMouseExploreByTouch")) { msg = eMouseExploreByTouch; + } else if (aType.EqualsLiteral("dragover")) { + msg = eDragOver; -+ isDragEvent = true; ++ isPWDragEventMessage = true; + } else if (aType.EqualsLiteral("drop")) { + msg = eDrop; -+ isDragEvent = true; ++ isPWDragEventMessage = true; } else { return NS_ERROR_FAILURE; } -@@ -8851,6 +8859,8 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8836,7 +8844,14 @@ nsresult nsContentUtils::SendMouseEvent( Maybe pointerEvent; Maybe mouseEvent; -+ Maybe dragEvent; +- if (IsPointerEventMessage(msg)) { ++ Maybe pwDragEvent; + - if (IsPointerEventMessage(msg)) { - MOZ_ASSERT(!aIsWidgetEventSynthesized, - "The event shouldn't be dispatched as a synthesized event"); -@@ -8862,6 +8872,11 @@ nsresult nsContentUtils::SendMouseEvent( - pointerEvent.emplace(true, msg, widget, - contextMenuKey ? WidgetMouseEvent::eContextMenuKey - : WidgetMouseEvent::eNormal); -+ } else if (isDragEvent) { -+ dragEvent.emplace(true, msg, widget); -+ dragEvent->mReason = aIsWidgetEventSynthesized ++ if (isPWDragEventMessage) { ++ pwDragEvent.emplace(true, msg, widget); ++ pwDragEvent->mReason = aIsWidgetEventSynthesized + ? WidgetMouseEvent::eSynthesized + : WidgetMouseEvent::eReal; - } else { - mouseEvent.emplace(true, msg, widget, - aIsWidgetEventSynthesized -@@ -8871,7 +8886,9 @@ nsresult nsContentUtils::SendMouseEvent( ++ } else if (IsPointerEventMessage(msg)) { + MOZ_ASSERT(!aIsWidgetEventSynthesized, + "The event shouldn't be dispatched as a synthesized event"); + if (MOZ_UNLIKELY(aIsWidgetEventSynthesized)) { +@@ -8855,8 +8870,11 @@ nsresult nsContentUtils::SendMouseEvent( + contextMenuKey ? WidgetMouseEvent::eContextMenuKey : WidgetMouseEvent::eNormal); } ++ WidgetMouseEvent& mouseOrPointerEvent = -- pointerEvent.isSome() ? pointerEvent.ref() : mouseEvent.ref(); -+ pointerEvent.isSome() ? pointerEvent.ref() : -+ dragEvent.isSome() ? dragEvent.ref() : mouseEvent.ref(); ++ pwDragEvent.isSome() ? pwDragEvent.ref() : + pointerEvent.isSome() ? pointerEvent.ref() : mouseEvent.ref(); + mouseOrPointerEvent.pointerId = aIdentifier; mouseOrPointerEvent.mModifiers = GetWidgetModifiers(aModifiers); mouseOrPointerEvent.mButton = aButton; -@@ -8882,8 +8899,10 @@ nsresult nsContentUtils::SendMouseEvent( - mouseOrPointerEvent.mPressure = aPressure; - mouseOrPointerEvent.mInputSource = aInputSourceArg; +@@ -8869,6 +8887,8 @@ nsresult nsContentUtils::SendMouseEvent( mouseOrPointerEvent.mClickCount = aClickCount; -+ mouseOrPointerEvent.mJugglerEventId = aJugglerEventId; mouseOrPointerEvent.mFlags.mIsSynthesizedForTests = aIsDOMEventSynthesized; mouseOrPointerEvent.mExitFrom = exitFrom; ++ mouseOrPointerEvent.mJugglerEventId = aJugglerEventId; + mouseOrPointerEvent.convertToPointer = convertToPointer; nsPresContext* presContext = aPresShell->GetPresContext(); if (!presContext) return NS_ERROR_FAILURE; diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h -index b4b2244ddf..2d22cdf8b2 100644 +index d9556910b2..61fdbfda2c 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h -@@ -3047,7 +3047,8 @@ class nsContentUtils { +@@ -3039,7 +3039,8 @@ class nsContentUtils { int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, mozilla::PreventDefaultResult* aPreventDefault, @@ -1064,7 +1022,7 @@ index b4b2244ddf..2d22cdf8b2 100644 static void FirePageShowEventForFrameLoaderSwap( nsIDocShellTreeItem* aItem, diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp -index c77bf80d5e..2f61c71cdb 100644 +index 7e22693477..91379e3032 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -685,6 +685,26 @@ nsDOMWindowUtils::GetPresShellId(uint32_t* aPresShellId) { @@ -1142,10 +1100,10 @@ index 47ff326b20..b8e084b0c7 100644 MOZ_CAN_RUN_SCRIPT nsresult SendTouchEventCommon( diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp -index cbd5cb8e45..efde3a8206 100644 +index f24942e513..73eb58f8b1 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp -@@ -1697,6 +1697,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, +@@ -1712,6 +1712,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, (GetActiveBrowsingContext() == newRootBrowsingContext); } @@ -1156,7 +1114,7 @@ index cbd5cb8e45..efde3a8206 100644 // Exit fullscreen if a website focuses another window if (StaticPrefs::full_screen_api_exit_on_windowRaise() && !isElementInActiveWindow && (aFlags & FLAG_RAISE)) { -@@ -2328,6 +2332,12 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2343,6 +2347,12 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, return true; } @@ -1169,7 +1127,7 @@ index cbd5cb8e45..efde3a8206 100644 // Keep a ref to presShell since dispatching the DOM event may cause // the document to be destroyed. RefPtr presShell = docShell->GetPresShell(); -@@ -3005,7 +3015,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, +@@ -3020,7 +3030,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, } } @@ -1181,7 +1139,7 @@ index cbd5cb8e45..efde3a8206 100644 // care of lowering the present active window. This happens in // a separate runnable to avoid touching multiple windows in diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp -index f2aa07e2c1..2b1b406c4f 100644 +index 8973a1e401..0889b2ff12 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -2516,10 +2516,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, @@ -1226,7 +1184,7 @@ index f2aa07e2c1..2b1b406c4f 100644 void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) { diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h -index e2a2b560b5..81eaca3fb0 100644 +index b388bfb6ea..8685e4cece 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h @@ -317,6 +317,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, @@ -1238,10 +1196,10 @@ index e2a2b560b5..81eaca3fb0 100644 // Outer windows only. virtual void EnsureSizeAndPositionUpToDate() override; diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp -index 091d04dd79..40bb124fd7 100644 +index 03990e9ed3..2dd4ac45ad 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp -@@ -1402,6 +1402,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, +@@ -1426,6 +1426,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, mozilla::GetBoxQuadsFromWindowOrigin(this, aOptions, aResult, aRv); } @@ -1304,10 +1262,10 @@ index 091d04dd79..40bb124fd7 100644 DOMQuad& aQuad, const GeometryNode& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h -index 3bc7ff8a3d..dcb47740ca 100644 +index c7d56c4f8e..1a8469bb00 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h -@@ -2317,6 +2317,10 @@ class nsINode : public mozilla::dom::EventTarget { +@@ -2322,6 +2322,10 @@ class nsINode : public mozilla::dom::EventTarget { nsTArray>& aResult, ErrorResult& aRv); @@ -1347,10 +1305,10 @@ index 8b4c1492c6..ee66eaa21d 100644 static bool DumpEnabled(); diff --git a/dom/chrome-webidl/BrowsingContext.webidl b/dom/chrome-webidl/BrowsingContext.webidl -index 864890f6a2..a34005c323 100644 +index 28e8d8cb9c..54c9a2317f 100644 --- a/dom/chrome-webidl/BrowsingContext.webidl +++ b/dom/chrome-webidl/BrowsingContext.webidl -@@ -53,6 +53,24 @@ enum PrefersColorSchemeOverride { +@@ -53,12 +53,22 @@ enum PrefersColorSchemeOverride { "dark", }; @@ -1362,37 +1320,32 @@ index 864890f6a2..a34005c323 100644 + "reduce", + "no-preference", +}; -+ -+/** -+ * CSS forced-colors values. -+ */ -+enum ForcedColorsOverride { -+ "none", -+ "active", -+ "no-override", /* This clears the override. */ -+}; + /** - * Allowed overrides of platform/pref default behaviour for touch events. + * CSS forced-colors values. */ -@@ -209,6 +227,12 @@ interface BrowsingContext { - // Color-scheme simulation, for DevTools. - [SetterThrows] attribute PrefersColorSchemeOverride prefersColorSchemeOverride; + enum ForcedColorsOverride { + "none", + "active", ++ "no-override", /* This clears the override. */ + }; + + /** +@@ -220,6 +230,9 @@ interface BrowsingContext { + // Forced-colors simulation, for DevTools + [SetterThrows] attribute ForcedColorsOverride forcedColorsOverride; + // Reduced-Motion simulation, for DevTools. + [SetterThrows] attribute PrefersReducedMotionOverride prefersReducedMotionOverride; -+ -+ // Forced-Colors simulation, for DevTools. -+ [SetterThrows] attribute ForcedColorsOverride forcedColorsOverride; + /** * A unique identifier for the browser element that is hosting this * BrowsingContext tree. Every BrowsingContext in the element's tree will diff --git a/dom/geolocation/Geolocation.cpp b/dom/geolocation/Geolocation.cpp -index 21717aba55..274cdebc2e 100644 +index 140ad5a3e6..cae2d2af93 100644 --- a/dom/geolocation/Geolocation.cpp +++ b/dom/geolocation/Geolocation.cpp -@@ -24,6 +24,7 @@ +@@ -29,6 +29,7 @@ #include "nsComponentManagerUtils.h" #include "nsContentPermissionHelper.h" #include "nsContentUtils.h" @@ -1400,7 +1353,7 @@ index 21717aba55..274cdebc2e 100644 #include "nsGlobalWindowInner.h" #include "mozilla/dom/Document.h" #include "nsINamed.h" -@@ -264,10 +265,8 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { +@@ -432,10 +433,8 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { return NS_OK; } @@ -1413,7 +1366,7 @@ index 21717aba55..274cdebc2e 100644 CachedPositionAndAccuracy lastPosition = gs->GetCachedPosition(); if (lastPosition.position) { EpochTimeStamp cachedPositionTime_ms; -@@ -475,8 +474,7 @@ void nsGeolocationRequest::Shutdown() { +@@ -643,8 +642,7 @@ void nsGeolocationRequest::Shutdown() { // If there are no other high accuracy requests, the geolocation service will // notify the provider to switch to the default accuracy. if (mOptions && mOptions->mEnableHighAccuracy) { @@ -1423,7 +1376,7 @@ index 21717aba55..274cdebc2e 100644 if (gs) { gs->UpdateAccuracy(); } -@@ -785,8 +783,14 @@ void nsGeolocationService::StopDevice() { +@@ -961,8 +959,14 @@ void nsGeolocationService::StopDevice() { StaticRefPtr nsGeolocationService::sService; already_AddRefed @@ -1439,7 +1392,7 @@ index 21717aba55..274cdebc2e 100644 if (nsGeolocationService::sService) { result = nsGeolocationService::sService; -@@ -878,7 +882,9 @@ nsresult Geolocation::Init(nsPIDOMWindowInner* aContentDom) { +@@ -1054,7 +1058,9 @@ nsresult Geolocation::Init(nsPIDOMWindowInner* aContentDom) { // If no aContentDom was passed into us, we are being used // by chrome/c++ and have no mOwner, no mPrincipal, and no need // to prompt. @@ -1451,7 +1404,7 @@ index 21717aba55..274cdebc2e 100644 mService->AddLocator(this); } diff --git a/dom/geolocation/Geolocation.h b/dom/geolocation/Geolocation.h -index 7e1af00d05..e85af9718d 100644 +index 992de29b5d..cdc20567b6 100644 --- a/dom/geolocation/Geolocation.h +++ b/dom/geolocation/Geolocation.h @@ -31,6 +31,7 @@ @@ -1462,7 +1415,7 @@ index 7e1af00d05..e85af9718d 100644 class nsGeolocationService; class nsGeolocationRequest; -@@ -48,13 +49,14 @@ struct CachedPositionAndAccuracy { +@@ -51,13 +52,14 @@ struct CachedPositionAndAccuracy { bool isHighAccuracy; }; @@ -1478,9 +1431,9 @@ index 7e1af00d05..e85af9718d 100644 static mozilla::StaticRefPtr sService; NS_DECL_THREADSAFE_ISUPPORTS -@@ -179,6 +181,8 @@ class Geolocation final : public nsIGeolocationUpdate, public nsWrapperCache { - // null. - static already_AddRefed NonWindowSingleton(); +@@ -189,6 +191,8 @@ class Geolocation final : public nsIGeolocationUpdate, public nsWrapperCache { + BrowsingContext* aBrowsingContext, + geolocation::ParentRequestResolver&& aResolver); + nsGeolocationService* GetGeolocationService() { return mService; }; + @@ -1514,7 +1467,7 @@ index d40c2a230c..e2ddb846d2 100644 return NS_OK; } diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl -index 89202fa1ff..61ed40c845 100644 +index 4f0fc82a36..9076e43644 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -374,6 +374,26 @@ interface nsIDOMWindowUtils : nsISupports { @@ -1545,10 +1498,10 @@ index 89202fa1ff..61ed40c845 100644 * touchstart, touchend, touchmove, and touchcancel * diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp -index 0335a887fe..dfbb8dae40 100644 +index 017d579a4c..4be9d8ee6b 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp -@@ -1656,6 +1656,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, +@@ -1674,6 +1674,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, if (postLayerization) { postLayerization->Register(); } @@ -1585,11 +1538,11 @@ index 5aa445d2e0..671f71979b 100644 } diff --git a/dom/media/systemservices/video_engine/desktop_capture_impl.cc b/dom/media/systemservices/video_engine/desktop_capture_impl.cc -index d4b40fda96..44249fa7c9 100644 +index c43a1b3b24..bf5fd8cf32 100644 --- a/dom/media/systemservices/video_engine/desktop_capture_impl.cc +++ b/dom/media/systemservices/video_engine/desktop_capture_impl.cc -@@ -136,10 +136,11 @@ int32_t ScreenDeviceInfoImpl::GetOrientation(const char* aDeviceUniqueIdUTF8, - } +@@ -51,10 +51,11 @@ static void CaptureFrameOnThread(nsITimer* aTimer, void* aClosure) { + namespace webrtc { DesktopCaptureImpl* DesktopCaptureImpl::Create(const int32_t aModuleId, - const char* aUniqueId, @@ -1603,30 +1556,30 @@ index d4b40fda96..44249fa7c9 100644 + aCaptureCursor); } - int32_t WindowDeviceInfoImpl::Init() { -@@ -412,7 +413,7 @@ static bool UsePipewire() { + static DesktopCaptureOptions CreateDesktopCaptureOptions() { +@@ -155,7 +156,7 @@ static std::unique_ptr CreateTabCapturer( static std::unique_ptr CreateDesktopCapturerAndThread( CaptureDeviceType aDeviceType, DesktopCapturer::SourceId aSourceId, - nsIThread** aOutThread) { + nsIThread** aOutThread, bool aCaptureCursor) { DesktopCaptureOptions options = CreateDesktopCaptureOptions(); - std::unique_ptr capturer; + auto ensureThread = [&]() { + if (*aOutThread) { +@@ -228,8 +229,10 @@ static std::unique_ptr CreateDesktopCapturerAndThread( -@@ -462,8 +463,10 @@ static std::unique_ptr CreateDesktopCapturerAndThread( + capturer->SelectSource(aSourceId); - capturer->SelectSource(aSourceId); +- return std::make_unique(std::move(capturer), +- options); ++ if (aCaptureCursor) { ++ return std::make_unique(std::move(capturer), ++ options); ++ } + } -- capturer = std::make_unique(std::move(capturer), -- options); -+ if (aCaptureCursor) { -+ capturer = std::make_unique(std::move(capturer), -+ options); -+ } - } else if (aDeviceType == CaptureDeviceType::Browser) { - // XXX We don't capture cursors, so avoid the extra indirection layer. We - // could also pass null for the pMouseCursorMonitor. -@@ -480,7 +483,8 @@ static std::unique_ptr CreateDesktopCapturerAndThread( + if (aDeviceType == CaptureDeviceType::Browser) { +@@ -253,7 +256,8 @@ static std::unique_ptr CreateDesktopCapturerAndThread( } DesktopCaptureImpl::DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, @@ -1636,7 +1589,7 @@ index d4b40fda96..44249fa7c9 100644 : mModuleId(aId), mTrackingId(mozilla::TrackingId(CaptureEngineToTrackingSourceStr([&] { switch (aType) { -@@ -497,6 +501,7 @@ DesktopCaptureImpl::DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, +@@ -270,6 +274,7 @@ DesktopCaptureImpl::DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, aId)), mDeviceUniqueId(aUniqueId), mDeviceType(aType), @@ -1644,7 +1597,7 @@ index d4b40fda96..44249fa7c9 100644 mControlThread(mozilla::GetCurrentSerialEventTarget()), mNextFrameMinimumTime(Timestamp::Zero()), mCallbacks("DesktopCaptureImpl::mCallbacks") {} -@@ -521,6 +526,21 @@ void DesktopCaptureImpl::DeRegisterCaptureDataCallback( +@@ -294,6 +299,21 @@ void DesktopCaptureImpl::DeRegisterCaptureDataCallback( } } @@ -1666,7 +1619,7 @@ index d4b40fda96..44249fa7c9 100644 int32_t DesktopCaptureImpl::StopCaptureIfAllClientsClose() { { auto callbacks = mCallbacks.Lock(); -@@ -553,7 +573,7 @@ int32_t DesktopCaptureImpl::StartCapture( +@@ -333,7 +353,7 @@ int32_t DesktopCaptureImpl::StartCapture( DesktopCapturer::SourceId sourceId = std::stoi(mDeviceUniqueId); std::unique_ptr capturer = CreateDesktopCapturerAndThread( @@ -1675,7 +1628,7 @@ index d4b40fda96..44249fa7c9 100644 MOZ_ASSERT(!capturer == !mCaptureThread); if (!capturer) { -@@ -663,6 +683,14 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult, +@@ -441,6 +461,14 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult, frameInfo.height = aFrame->size().height(); frameInfo.videoType = VideoType::kARGB; @@ -1691,18 +1644,18 @@ index d4b40fda96..44249fa7c9 100644 frameInfo.width * frameInfo.height * DesktopFrame::kBytesPerPixel; diff --git a/dom/media/systemservices/video_engine/desktop_capture_impl.h b/dom/media/systemservices/video_engine/desktop_capture_impl.h -index 9aebaa3932..de9bd34256 100644 +index a76b7de569..3011a1445a 100644 --- a/dom/media/systemservices/video_engine/desktop_capture_impl.h +++ b/dom/media/systemservices/video_engine/desktop_capture_impl.h -@@ -25,6 +25,7 @@ - #include "modules/desktop_capture/desktop_capturer.h" - #include "modules/video_capture/video_capture.h" - #include "rtc_base/synchronization/mutex.h" +@@ -30,6 +30,7 @@ + #include "mozilla/Maybe.h" + #include "mozilla/TimeStamp.h" + #include "nsCOMPtr.h" +#include "rtc_base/deprecated/recursive_critical_section.h" - #include "desktop_device_info.h" - #include "MediaEngineSource.h" -@@ -45,6 +46,35 @@ namespace webrtc { + class nsIThread; + class nsITimer; +@@ -42,17 +43,47 @@ namespace webrtc { class VideoCaptureEncodeInterface; @@ -1735,10 +1688,7 @@ index 9aebaa3932..de9bd34256 100644 + int32_t capture_counter_ = 0; +}; + - // simulate deviceInfo interface for video engine, bridge screen/application and - // real screen/application device info - -@@ -160,13 +178,14 @@ class BrowserDeviceInfoImpl : public VideoCaptureModule::DeviceInfo { + // Reuses the video engine pipeline for screen sharing. // As with video, DesktopCaptureImpl is a proxy for screen sharing // and follows the video pipeline design class DesktopCaptureImpl : public DesktopCapturer::Callback, @@ -1755,7 +1705,7 @@ index 9aebaa3932..de9bd34256 100644 [[nodiscard]] static std::shared_ptr CreateDeviceInfo(const int32_t aId, -@@ -180,6 +199,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -66,6 +97,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, void DeRegisterCaptureDataCallback( rtc::VideoSinkInterface* aCallback) override; int32_t StopCaptureIfAllClientsClose() override; @@ -1764,7 +1714,7 @@ index 9aebaa3932..de9bd34256 100644 int32_t SetCaptureRotation(VideoRotation aRotation) override; bool SetApplyRotation(bool aEnable) override; -@@ -203,7 +224,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -89,7 +122,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, protected: DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, @@ -1774,9 +1724,9 @@ index 9aebaa3932..de9bd34256 100644 virtual ~DesktopCaptureImpl(); private: -@@ -211,6 +233,9 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, - static constexpr uint32_t kMaxDesktopCaptureCpuUsage = 50; +@@ -98,6 +132,9 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, void InitOnThread(std::unique_ptr aCapturer, int aFramerate); + void UpdateOnThread(int aFramerate); void ShutdownOnThread(); + + rtc::RecursiveCriticalSection mApiCs; @@ -1784,7 +1734,7 @@ index 9aebaa3932..de9bd34256 100644 // DesktopCapturer::Callback interface. void OnCaptureResult(DesktopCapturer::Result aResult, std::unique_ptr aFrame) override; -@@ -218,6 +243,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -105,6 +142,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, // Notifies all mCallbacks of OnFrame(). mCaptureThread only. void NotifyOnFrame(const VideoFrame& aFrame); @@ -1838,10 +1788,10 @@ index 3b39538e51..c7bf4f2d53 100644 return aGlobalOrNull; diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp -index ff2e907c0d..40ec25b558 100644 +index 17a205b260..90dc5c04f3 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp -@@ -22,6 +22,7 @@ +@@ -23,6 +23,7 @@ #include "nsSandboxFlags.h" #include "nsServiceManagerUtils.h" #include "nsWhitespaceTokenizer.h" @@ -1849,7 +1799,7 @@ index ff2e907c0d..40ec25b558 100644 #include "mozilla/Assertions.h" #include "mozilla/Components.h" -@@ -133,6 +134,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, +@@ -134,6 +135,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, return; } @@ -1885,10 +1835,10 @@ index 2f71b284ee..2640bd5712 100644 * returned quads are further translated relative to the window * origin -- which is not the layout origin. Further translation diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp -index 1ba2051ed3..c0d6f45ce1 100644 +index be23f9f192..6c14aa9dd7 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp -@@ -1007,7 +1007,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { +@@ -1005,7 +1005,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { AssertIsOnMainThread(); nsTArray languages; @@ -1897,7 +1847,7 @@ index 1ba2051ed3..c0d6f45ce1 100644 RuntimeService* runtime = RuntimeService::GetService(); if (runtime) { -@@ -1194,8 +1194,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { +@@ -1191,8 +1191,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { } // The navigator overridden properties should have already been read. @@ -1907,7 +1857,7 @@ index 1ba2051ed3..c0d6f45ce1 100644 mNavigatorPropertiesLoaded = true; } -@@ -1817,6 +1816,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( +@@ -1813,6 +1812,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( } } @@ -1921,7 +1871,7 @@ index 1ba2051ed3..c0d6f45ce1 100644 template void RuntimeService::BroadcastAllWorkers(const Func& aFunc) { AssertIsOnMainThread(); -@@ -2342,6 +2348,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( +@@ -2338,6 +2344,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( } } @@ -1963,10 +1913,10 @@ index 58894a8361..c481d40d79 100644 bool IsWorkerGlobal(JSObject* global); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp -index 2b48cc2980..d8dc909833 100644 +index ee89a9ffbe..9d9ec1aac7 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp -@@ -700,6 +700,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable { +@@ -718,6 +718,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable { } }; @@ -1985,7 +1935,7 @@ index 2b48cc2980..d8dc909833 100644 class UpdateLanguagesRunnable final : public WorkerThreadRunnable { nsTArray mLanguages; -@@ -2113,6 +2125,16 @@ void WorkerPrivate::UpdateContextOptions( +@@ -2131,6 +2143,16 @@ void WorkerPrivate::UpdateContextOptions( } } @@ -2002,7 +1952,7 @@ index 2b48cc2980..d8dc909833 100644 void WorkerPrivate::UpdateLanguages(const nsTArray& aLanguages) { AssertIsOnParentThread(); -@@ -5740,6 +5762,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( +@@ -5768,6 +5790,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( } } @@ -2019,10 +1969,10 @@ index 2b48cc2980..d8dc909833 100644 const nsTArray& aLanguages) { WorkerGlobalScope* globalScope = GlobalScope(); diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h -index da25a495a8..38f9282943 100644 +index 8ca40304e0..e0179f6db7 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h -@@ -432,6 +432,8 @@ class WorkerPrivate final +@@ -433,6 +433,8 @@ class WorkerPrivate final void UpdateContextOptionsInternal(JSContext* aCx, const JS::ContextOptions& aContextOptions); @@ -2031,7 +1981,7 @@ index da25a495a8..38f9282943 100644 void UpdateLanguagesInternal(const nsTArray& aLanguages); void UpdateJSWorkerMemoryParameterInternal(JSContext* aCx, JSGCParamKey key, -@@ -1069,6 +1071,8 @@ class WorkerPrivate final +@@ -1070,6 +1072,8 @@ class WorkerPrivate final void UpdateContextOptions(const JS::ContextOptions& aContextOptions); @@ -2093,10 +2043,10 @@ index 523e84c8c9..98d5b1176e 100644 inline ClippedTime TimeClip(double time); diff --git a/js/src/debugger/Object.cpp b/js/src/debugger/Object.cpp -index 6ca6c31830..3f963dbf61 100644 +index 880e716c24..6e046fbd2e 100644 --- a/js/src/debugger/Object.cpp +++ b/js/src/debugger/Object.cpp -@@ -2468,7 +2468,11 @@ Maybe DebuggerObject::call(JSContext* cx, +@@ -2474,7 +2474,11 @@ Maybe DebuggerObject::call(JSContext* cx, invokeArgs[i].set(args2[i]); } @@ -2263,10 +2213,10 @@ index 0ec6ee3eb3..885dba71bc 100644 // No boxes to return return; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp -index 2cc3c5673e..61093cd52f 100644 +index 27fd20e845..bcd1351884 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp -@@ -11163,7 +11163,9 @@ bool PresShell::ComputeActiveness() const { +@@ -11194,7 +11194,9 @@ bool PresShell::ComputeActiveness() const { if (!browserChild->IsVisible()) { MOZ_LOG(gLog, LogLevel::Debug, (" > BrowserChild %p is not visible", browserChild)); @@ -2278,10 +2228,10 @@ index 2cc3c5673e..61093cd52f 100644 // If the browser is visible but just due to be preserving layers diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp -index d8995d6d94..b370b56ba9 100644 +index 43d7e5008b..6ac296306e 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp -@@ -698,6 +698,7 @@ bool nsLayoutUtils::AllowZoomingForDocument( +@@ -699,6 +699,7 @@ bool nsLayoutUtils::AllowZoomingForDocument( !aDocument->GetPresShell()->AsyncPanZoomEnabled()) { return false; } @@ -2290,10 +2240,10 @@ index d8995d6d94..b370b56ba9 100644 // in RDM. BrowsingContext* bc = aDocument->GetBrowsingContext(); diff --git a/layout/style/GeckoBindings.h b/layout/style/GeckoBindings.h -index c18d38d8ad..22736c86eb 100644 +index acb5b24776..191ddd1f43 100644 --- a/layout/style/GeckoBindings.h +++ b/layout/style/GeckoBindings.h -@@ -595,6 +595,7 @@ float Gecko_MediaFeatures_GetResolution(const mozilla::dom::Document*); +@@ -593,6 +593,7 @@ float Gecko_MediaFeatures_GetResolution(const mozilla::dom::Document*); bool Gecko_MediaFeatures_PrefersReducedMotion(const mozilla::dom::Document*); bool Gecko_MediaFeatures_PrefersReducedTransparency( const mozilla::dom::Document*); @@ -2302,10 +2252,10 @@ index c18d38d8ad..22736c86eb 100644 const mozilla::dom::Document*); mozilla::StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme( diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp -index cc86d1abf6..8cce20c719 100644 +index 94f01a5337..0b84e22a28 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp -@@ -260,11 +260,11 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) { +@@ -265,11 +265,11 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) { } bool Gecko_MediaFeatures_PrefersReducedMotion(const Document* aDocument) { @@ -2323,7 +2273,7 @@ index cc86d1abf6..8cce20c719 100644 bool Gecko_MediaFeatures_PrefersReducedTransparency(const Document* aDocument) { diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp -index 21d5a5e1b4..fa435f229d 100644 +index 283e991f92..7ffc4ae0c3 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp @@ -693,6 +693,7 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) @@ -2331,10 +2281,10 @@ index 21d5a5e1b4..fa435f229d 100644 rhs.mHasInjectedCookieForCookieBannerHandling), mWasSchemelessInput(rhs.mWasSchemelessInput), + mJugglerLoadIdentifier(rhs.mJugglerLoadIdentifier), - mHttpsUpgradeTelemetry(rhs.mHttpsUpgradeTelemetry) { + mHttpsUpgradeTelemetry(rhs.mHttpsUpgradeTelemetry), + mIsNewWindowTarget(rhs.mIsNewWindowTarget) { } - -@@ -2461,4 +2462,16 @@ LoadInfo::SetHttpsUpgradeTelemetry( +@@ -2488,4 +2489,16 @@ LoadInfo::SetSkipHTTPSUpgrade(bool aSkipHTTPSUpgrade) { return NS_OK; } @@ -2352,23 +2302,26 @@ index 21d5a5e1b4..fa435f229d 100644 + } // namespace mozilla::net diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h -index 6ba1d8e11e..0e8f199852 100644 +index 0598c9703f..96e0eb1c04 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h -@@ -414,6 +414,8 @@ class LoadInfo final : public nsILoadInfo { +@@ -414,8 +414,10 @@ class LoadInfo final : public nsILoadInfo { bool mHasInjectedCookieForCookieBannerHandling = false; bool mWasSchemelessInput = false; + uint64_t mJugglerLoadIdentifier = 0; + nsILoadInfo::HTTPSUpgradeTelemetryType mHttpsUpgradeTelemetry = - nsILoadInfo::NOT_INITIALIZED; - }; +- nsILoadInfo::NOT_INITIALIZED; ++ nsILoadInfo::NO_UPGRADE; + + bool mIsNewWindowTarget = false; + bool mSkipHTTPSUpgrade = false; diff --git a/netwerk/base/TRRLoadInfo.cpp b/netwerk/base/TRRLoadInfo.cpp -index 9dc2bb0da6..b71cf63934 100644 +index d1aad5d3a3..8b3640504c 100644 --- a/netwerk/base/TRRLoadInfo.cpp +++ b/netwerk/base/TRRLoadInfo.cpp -@@ -903,5 +903,15 @@ TRRLoadInfo::SetHttpsUpgradeTelemetry( +@@ -923,5 +923,15 @@ TRRLoadInfo::SetSkipHTTPSUpgrade(bool aSkipHTTPSUpgrade) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -2385,7 +2338,7 @@ index 9dc2bb0da6..b71cf63934 100644 } // namespace net } // namespace mozilla diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl -index daccd1dc75..48505702ef 100644 +index afe180f91f..4507801556 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl @@ -1568,6 +1568,8 @@ interface nsILoadInfo : nsISupports @@ -2410,10 +2363,10 @@ index 7f91d2df6f..ba6569f4be 100644 /** * Set the status and reason for the forthcoming synthesized response. diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp -index ef946929c9..a2814c5c89 100644 +index 82c6137d8c..5f31e5e1c9 100644 --- a/netwerk/ipc/DocumentLoadListener.cpp +++ b/netwerk/ipc/DocumentLoadListener.cpp -@@ -171,6 +171,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, +@@ -172,6 +172,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, loadInfo->SetTextDirectiveUserActivation( aLoadState->GetTextDirectiveUserActivation()); loadInfo->SetIsMetaRefresh(aLoadState->IsMetaRefresh()); @@ -2460,10 +2413,10 @@ index e81a4538fd..d7945f8129 100644 if (mPump && mLoadFlags & LOAD_CALL_CONTENT_SNIFFERS) { mPump->PeekStream(CallTypeSniffers, static_cast(this)); diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp -index 071ed8da41..063b516001 100644 +index d05b06c3f9..9b2cc35c50 100644 --- a/parser/html/nsHtml5TreeOpExecutor.cpp +++ b/parser/html/nsHtml5TreeOpExecutor.cpp -@@ -1391,6 +1391,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( +@@ -1334,6 +1334,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( void nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); @@ -2548,10 +2501,10 @@ index 6dfd07d6b6..e3c6794363 100644 readonly attribute boolean securityCheckDisabled; }; diff --git a/services/settings/Utils.sys.mjs b/services/settings/Utils.sys.mjs -index 73c83e526b..db5977c542 100644 +index 12fef6cde8..0f7f06d100 100644 --- a/services/settings/Utils.sys.mjs +++ b/services/settings/Utils.sys.mjs -@@ -95,7 +95,7 @@ function _isUndefined(value) { +@@ -97,7 +97,7 @@ const _cdnURLs = {}; export var Utils = { get SERVER_URL() { @@ -2560,7 +2513,7 @@ index 73c83e526b..db5977c542 100644 ? lazy.gServerURL : AppConstants.REMOTE_SETTINGS_SERVER_URL; }, -@@ -108,6 +108,9 @@ export var Utils = { +@@ -110,6 +110,9 @@ export var Utils = { log, get shouldSkipRemoteActivityDueToTests() { @@ -2571,10 +2524,10 @@ index 73c83e526b..db5977c542 100644 (lazy.isRunningTests || Cu.isInAutomation) && this.SERVER_URL == "data:,#remote-settings-dummy/v1" diff --git a/servo/components/style/gecko/media_features.rs b/servo/components/style/gecko/media_features.rs -index df1c5e464b..34451e791b 100644 +index 19d536fadc..2e770542f7 100644 --- a/servo/components/style/gecko/media_features.rs +++ b/servo/components/style/gecko/media_features.rs -@@ -303,10 +303,16 @@ impl ForcedColors { +@@ -297,10 +297,16 @@ impl ForcedColors { /// https://drafts.csswg.org/mediaqueries-5/#forced-colors fn eval_forced_colors(context: &Context, query_value: Option) -> bool { @@ -2609,10 +2562,10 @@ index 75555352b8..72855a404e 100644 // ignored for Linux. const unsigned long CHROME_SUPPRESS_ANIMATION = 1 << 24; diff --git a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp -index 6a40d03244..1468d38355 100644 +index 3aeddf503d..85f5f06ca3 100644 --- a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp +++ b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp -@@ -553,7 +553,7 @@ void PopulateLanguages() { +@@ -487,7 +487,7 @@ void PopulateLanguages() { // sufficient to only collect this information as the other properties are // just reformats of Navigator::GetAcceptLanguages. nsTArray languages; @@ -2622,10 +2575,10 @@ index 6a40d03244..1468d38355 100644 for (const auto& language : languages) { diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp -index 3314cb813f..5aac63649e 100644 +index 76d85f007b..689f0656de 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp -@@ -371,7 +371,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) { +@@ -365,7 +365,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) { nsCOMPtr windowEnumerator; nsCOMPtr mediator( do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); @@ -2650,10 +2603,10 @@ index 654903fadb..815b3dc24c 100644 int32_t aMaxSelfProgress, int32_t aCurTotalProgress, diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.cpp b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -index e3f616c4ef..abb7772184 100644 +index 585a957fd8..16ad38c3b7 100644 --- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp +++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -@@ -1881,7 +1881,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( +@@ -1875,7 +1875,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( // Open a minimal popup. *aIsPopupRequested = true; @@ -2714,10 +2667,10 @@ index 7eb9e11046..a8315d6dec 100644 // Only run this code if LauncherProcessWin.h was included beforehand, thus // signalling that the hosting process should support launcher mode. diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp -index fe72a2715d..a5959143ba 100644 +index 01ca680039..36f3f9a13b 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp -@@ -813,6 +813,12 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout, +@@ -812,6 +812,12 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout, ("DocLoader:%p: Firing load event for document.open\n", this)); @@ -2731,7 +2684,7 @@ index fe72a2715d..a5959143ba 100644 // nsDocumentViewer::LoadComplete that doesn't do various things // that are not relevant here because this wasn't an actual diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp -index 139a43a178..2a855c3ae8 100644 +index 2c27ae5c68..29b1916903 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -112,6 +112,7 @@ @@ -2742,7 +2695,7 @@ index 139a43a178..2a855c3ae8 100644 #include "mozilla/Preferences.h" #include "mozilla/ipc/URIUtils.h" -@@ -872,6 +873,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension( +@@ -864,6 +865,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension( return NS_OK; } @@ -2755,7 +2708,7 @@ index 139a43a178..2a855c3ae8 100644 nsresult nsExternalHelperAppService::GetFileTokenForPath( const char16_t* aPlatformAppPath, nsIFile** aFile) { nsDependentString platformAppPath(aPlatformAppPath); -@@ -1494,7 +1501,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { +@@ -1485,7 +1492,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { // Strip off the ".part" from mTempLeafName mTempLeafName.Truncate(mTempLeafName.Length() - ArrayLength(".part") + 1); @@ -2768,7 +2721,7 @@ index 139a43a178..2a855c3ae8 100644 mSaver = do_CreateInstance(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); -@@ -1683,7 +1695,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1671,7 +1683,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { return NS_OK; } @@ -2806,7 +2759,7 @@ index 139a43a178..2a855c3ae8 100644 if (NS_FAILED(rv)) { nsresult transferError = rv; -@@ -1744,6 +1785,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1732,6 +1773,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { bool alwaysAsk = true; mMimeInfo->GetAlwaysAskBeforeHandling(&alwaysAsk); @@ -2816,7 +2769,7 @@ index 139a43a178..2a855c3ae8 100644 if (alwaysAsk) { // But we *don't* ask if this mimeInfo didn't come from // our user configuration datastore and the user has said -@@ -2260,6 +2304,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, +@@ -2248,6 +2292,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, NotifyTransfer(aStatus); } @@ -2833,7 +2786,7 @@ index 139a43a178..2a855c3ae8 100644 return NS_OK; } -@@ -2743,6 +2797,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { +@@ -2731,6 +2785,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { } } @@ -2850,7 +2803,7 @@ index 139a43a178..2a855c3ae8 100644 // OnStartRequest) mDialog = nullptr; diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h -index e880b90b2d..dbadd74dea 100644 +index 2dd4ff87bd..83e8a3d328 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.h +++ b/uriloader/exthandler/nsExternalHelperAppService.h @@ -258,6 +258,8 @@ class nsExternalHelperAppService : public nsIExternalHelperAppService, @@ -2862,7 +2815,7 @@ index e880b90b2d..dbadd74dea 100644 }; /** -@@ -463,6 +465,9 @@ class nsExternalAppHandler final : public nsIStreamListener, +@@ -455,6 +457,9 @@ class nsExternalAppHandler final : public nsIStreamListener, * Upon successful return, both mTempFile and mSaver will be valid. */ nsresult SetUpTempFile(nsIChannel* aChannel); @@ -2944,47 +2897,27 @@ index 1c25e9d9a1..22cf67b0f6 100644 } #endif diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h -index 3d469853bb..7085d1f271 100644 +index 413b3f00a9..3d26a1c5c1 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h -@@ -263,7 +263,8 @@ class WidgetMouseEvent : public WidgetMouseEventBase, - : WidgetMouseEventBase(aIsTrusted, aMessage, aWidget, aEventClassID, - aTime), - mReason(aReason), -- mContextMenuTrigger(aContextMenuTrigger) {} -+ mContextMenuTrigger(aContextMenuTrigger), -+ mJugglerEventId(0) {} - - #ifdef DEBUG - void AssertContextMenuEventButtonConsistency() const; -@@ -279,7 +280,8 @@ class WidgetMouseEvent : public WidgetMouseEventBase, - : WidgetMouseEventBase(aIsTrusted, aMessage, aWidget, eMouseEventClass, - aTime), - mReason(aReason), -- mContextMenuTrigger(aContextMenuTrigger) { -+ mContextMenuTrigger(aContextMenuTrigger), -+ mJugglerEventId(0) { - MOZ_ASSERT_IF(aIsTrusted, !IsPointerEventMessage(mMessage)); - if (aMessage == eContextMenu) { - mButton = (mContextMenuTrigger == eNormal) ? MouseButton::eSecondary -@@ -327,6 +329,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, +@@ -363,6 +363,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, // Otherwise, this must be 0. uint32_t mClickCount = 0; + // Unique event ID -+ uint32_t mJugglerEventId; ++ uint32_t mJugglerEventId = 0; + // Whether the event should ignore scroll frame bounds during dispatch. bool mIgnoreRootScrollFrame = false; -@@ -341,6 +346,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, +@@ -386,6 +389,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, mContextMenuTrigger = aEvent.mContextMenuTrigger; mExitFrom = aEvent.mExitFrom; mClickCount = aEvent.mClickCount; + mJugglerEventId = aEvent.mJugglerEventId; mIgnoreRootScrollFrame = aEvent.mIgnoreRootScrollFrame; + mIgnoreCapturingContent = aEvent.mIgnoreCapturingContent; mClickEventPrevented = aEvent.mClickEventPrevented; - } diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.mm index e4bdf715e2..3554f91948 100644 --- a/widget/cocoa/NativeKeyBindings.mm @@ -3240,10 +3173,10 @@ index 9856991ef3..948947a421 100644 ~HeadlessWidget(); bool mEnabled; diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h -index 02775a7f27..6c1ae0e371 100644 +index cfededb82a..d3469a594f 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h -@@ -234,6 +234,7 @@ struct ParamTraits { +@@ -244,6 +244,7 @@ struct ParamTraits { aParam.mExitFrom.value())); } WriteParam(aWriter, aParam.mClickCount); @@ -3251,7 +3184,7 @@ index 02775a7f27..6c1ae0e371 100644 } static bool Read(MessageReader* aReader, paramType* aResult) { -@@ -258,6 +259,7 @@ struct ParamTraits { +@@ -268,6 +269,7 @@ struct ParamTraits { aResult->mExitFrom = Some(static_cast(exitFrom)); } rv = rv && ReadParam(aReader, &aResult->mClickCount); diff --git a/patches/upstream-dns-leak-fix.patch b/patches/upstream-dns-leak-fix.patch deleted file mode 100644 index 4efd0a1..0000000 --- a/patches/upstream-dns-leak-fix.patch +++ /dev/null @@ -1,875 +0,0 @@ - -# HG changeset patch -# User Kershaw Chang -# Date 1725998669 0 -# Node ID eb748cbf195dc2195a5a26910efb0f35a0967e03 -# Parent f2a1d0b442ab14b7d00c4229444d4845d14cbb68 -Bug 1910593 - Don't prefetch HTTPS RR if proxyDNS is enabled, r=necko-reviewers,valentin - -Differential Revision: https://phabricator.services.mozilla.com/D219528 - -diff --git a/dom/chrome-webidl/NetDashboard.webidl b/dom/chrome-webidl/NetDashboard.webidl ---- a/dom/chrome-webidl/NetDashboard.webidl -+++ b/dom/chrome-webidl/NetDashboard.webidl -@@ -63,16 +63,17 @@ dictionary WebSocketDict { - dictionary DnsCacheEntry { - DOMString hostname = ""; - sequence hostaddr; - DOMString family = ""; - double expiration = 0; - boolean trr = false; - DOMString originAttributesSuffix = ""; - DOMString flags = ""; -+ unsigned short type = 0; - }; - - [GenerateConversionToJS] - dictionary DNSCacheDict { - sequence entries; - }; - - [GenerateConversionToJS] -diff --git a/netwerk/base/Dashboard.cpp b/netwerk/base/Dashboard.cpp ---- a/netwerk/base/Dashboard.cpp -+++ b/netwerk/base/Dashboard.cpp -@@ -907,20 +907,23 @@ nsresult Dashboard::GetDNSCacheEntries(D - nsString* addr = addrs.AppendElement(fallible); - if (!addr) { - JS_ReportOutOfMemory(cx); - return NS_ERROR_OUT_OF_MEMORY; - } - CopyASCIItoUTF16(dnsData->mData[i].hostaddr[j], *addr); - } - -- if (dnsData->mData[i].family == PR_AF_INET6) { -- entry.mFamily.AssignLiteral(u"ipv6"); -- } else { -- entry.mFamily.AssignLiteral(u"ipv4"); -+ entry.mType = dnsData->mData[i].resolveType; -+ if (entry.mType == nsIDNSService::RESOLVE_TYPE_DEFAULT) { -+ if (dnsData->mData[i].family == PR_AF_INET6) { -+ entry.mFamily.AssignLiteral(u"ipv6"); -+ } else { -+ entry.mFamily.AssignLiteral(u"ipv4"); -+ } - } - - entry.mOriginAttributesSuffix = - NS_ConvertUTF8toUTF16(dnsData->mData[i].originAttributesSuffix); - entry.mFlags = NS_ConvertUTF8toUTF16(dnsData->mData[i].flags); - } - - JS::Rooted val(cx); -diff --git a/netwerk/base/DashboardTypes.h b/netwerk/base/DashboardTypes.h ---- a/netwerk/base/DashboardTypes.h -+++ b/netwerk/base/DashboardTypes.h -@@ -30,22 +30,22 @@ inline bool operator==(const SocketInfo& - - struct DnsAndConnectSockets { - bool speculative; - }; - - struct DNSCacheEntries { - nsCString hostname; - nsTArray hostaddr; -- uint16_t family; -- int64_t expiration; -- nsCString netInterface; -- bool TRR; -+ uint16_t family{0}; -+ int64_t expiration{0}; -+ bool TRR{false}; - nsCString originAttributesSuffix; - nsCString flags; -+ uint16_t resolveType{0}; - }; - - struct HttpConnInfo { - uint32_t ttl; - uint32_t rtt; - nsString protocolVersion; - - void SetHTTPProtocolVersion(HttpVersion pv); -@@ -94,27 +94,31 @@ template <> - struct ParamTraits { - typedef mozilla::net::DNSCacheEntries paramType; - - static void Write(MessageWriter* aWriter, const paramType& aParam) { - WriteParam(aWriter, aParam.hostname); - WriteParam(aWriter, aParam.hostaddr); - WriteParam(aWriter, aParam.family); - WriteParam(aWriter, aParam.expiration); -- WriteParam(aWriter, aParam.netInterface); - WriteParam(aWriter, aParam.TRR); -+ WriteParam(aWriter, aParam.originAttributesSuffix); -+ WriteParam(aWriter, aParam.flags); -+ WriteParam(aWriter, aParam.resolveType); - } - - static bool Read(MessageReader* aReader, paramType* aResult) { - return ReadParam(aReader, &aResult->hostname) && - ReadParam(aReader, &aResult->hostaddr) && - ReadParam(aReader, &aResult->family) && - ReadParam(aReader, &aResult->expiration) && -- ReadParam(aReader, &aResult->netInterface) && -- ReadParam(aReader, &aResult->TRR); -+ ReadParam(aReader, &aResult->TRR) && -+ ReadParam(aReader, &aResult->originAttributesSuffix) && -+ ReadParam(aReader, &aResult->flags) && -+ ReadParam(aReader, &aResult->resolveType); - } - }; - - template <> - struct ParamTraits { - typedef mozilla::net::DnsAndConnectSockets paramType; - - static void Write(MessageWriter* aWriter, const paramType& aParam) { -diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp ---- a/netwerk/dns/nsHostResolver.cpp -+++ b/netwerk/dns/nsHostResolver.cpp -@@ -2030,50 +2030,44 @@ void nsHostResolver::GetDNSCacheEntries( - // Also require a host. - nsHostRecord* rec = recordEntry.GetWeak(); - MOZ_ASSERT(rec, "rec should never be null here!"); - - if (!rec) { - continue; - } - -- // For now we only show A/AAAA records. -- if (!rec->IsAddrRecord()) { -+ DNSCacheEntries info; -+ info.resolveType = rec->type; -+ info.hostname = rec->host; -+ info.family = rec->af; -+ if (rec->mValidEnd.IsNull()) { - continue; - } -- -- RefPtr addrRec = do_QueryObject(rec); -- MOZ_ASSERT(addrRec); -- if (!addrRec || !addrRec->addr_info) { -- continue; -- } -- -- DNSCacheEntries info; -- info.hostname = rec->host; -- info.family = rec->af; - info.expiration = - (int64_t)(rec->mValidEnd - TimeStamp::NowLoRes()).ToSeconds(); - if (info.expiration <= 0) { - // We only need valid DNS cache entries - continue; - } - -- { -+ info.originAttributesSuffix = recordEntry.GetKey().originSuffix; -+ info.flags = nsPrintfCString("%u|0x%x|%u|%d|%s", rec->type, rec->flags, -+ rec->af, rec->pb, rec->mTrrServer.get()); -+ -+ RefPtr addrRec = do_QueryObject(rec); -+ if (addrRec && addrRec->addr_info) { - MutexAutoLock lock(addrRec->addr_info_lock); - for (const auto& addr : addrRec->addr_info->Addresses()) { - char buf[kIPv6CStrBufSize]; - if (addr.ToStringBuffer(buf, sizeof(buf))) { - info.hostaddr.AppendElement(buf); - } - } - info.TRR = addrRec->addr_info->IsTRR(); - } - -- info.originAttributesSuffix = recordEntry.GetKey().originSuffix; -- info.flags = nsPrintfCString("%u|0x%x|%u|%d|%s", rec->type, rec->flags, -- rec->af, rec->pb, rec->mTrrServer.get()); -- - args->AppendElement(std::move(info)); - } - } - - #undef LOG - #undef LOG_ENABLED -diff --git a/netwerk/protocol/http/nsHttp.cpp b/netwerk/protocol/http/nsHttp.cpp ---- a/netwerk/protocol/http/nsHttp.cpp -+++ b/netwerk/protocol/http/nsHttp.cpp -@@ -30,16 +30,18 @@ - #include - #include - #include "nsLiteralString.h" - #include - - namespace mozilla { - namespace net { - -+extern const char kProxyType_SOCKS[]; -+ - const uint32_t kHttp3VersionCount = 5; - const nsCString kHttp3Versions[] = {"h3-29"_ns, "h3-30"_ns, "h3-31"_ns, - "h3-32"_ns, "h3"_ns}; - - // https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/#section-4.3 - constexpr uint64_t kWebTransportErrorCodeStart = 0x52e4a40fa8db; - constexpr uint64_t kWebTransportErrorCodeEnd = 0x52e4a40fa9e2; - -@@ -1173,10 +1175,24 @@ nsLiteralCString HttpVersionToTelemetryL - case HttpVersion::v3_0: - return "http_3"_ns; - default: - break; - } - return "unknown"_ns; - } - -+ProxyDNSStrategy GetProxyDNSStrategyHelper(const char* aType, uint32_t aFlag) { -+ if (!aType) { -+ return ProxyDNSStrategy::ORIGIN; -+ } -+ -+ if (!(aFlag & nsIProxyInfo::TRANSPARENT_PROXY_RESOLVES_HOST)) { -+ if (aType == kProxyType_SOCKS) { -+ return ProxyDNSStrategy::ORIGIN; -+ } -+ } -+ -+ return ProxyDNSStrategy::PROXY; -+} -+ - } // namespace net - } // namespace mozilla -diff --git a/netwerk/protocol/http/nsHttp.h b/netwerk/protocol/http/nsHttp.h ---- a/netwerk/protocol/http/nsHttp.h -+++ b/netwerk/protocol/http/nsHttp.h -@@ -524,12 +524,22 @@ uint64_t WebTransportErrorToHttp3Error(u - uint8_t Http3ErrorToWebTransportError(uint64_t aErrorCode); - - bool PossibleZeroRTTRetryError(nsresult aReason); - - void DisallowHTTPSRR(uint32_t& aCaps); - - nsLiteralCString HttpVersionToTelemetryLabel(HttpVersion version); - -+enum class ProxyDNSStrategy : uint8_t { -+ // To resolve the origin of the end server we are connecting -+ // to. -+ ORIGIN = 1 << 0, -+ // To resolve the host name of the proxy. -+ PROXY = 1 << 1 -+}; -+ -+ProxyDNSStrategy GetProxyDNSStrategyHelper(const char* aType, uint32_t aFlag); -+ - } // namespace net - } // namespace mozilla - - #endif // nsHttp_h__ -diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp ---- a/netwerk/protocol/http/nsHttpChannel.cpp -+++ b/netwerk/protocol/http/nsHttpChannel.cpp -@@ -773,16 +773,20 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRF - return aStatus; - } - - if (mURI->SchemeIs("https") || aShouldUpgrade || !LoadUseHTTPSSVC()) { - return ContinueOnBeforeConnect(aShouldUpgrade, aStatus); - } - - auto shouldSkipUpgradeWithHTTPSRR = [&]() -> bool { -+ if (mCaps & NS_HTTP_DISALLOW_HTTPS_RR) { -+ return true; -+ } -+ - // Skip using HTTPS RR to upgrade when this is not a top-level load and the - // loading principal is http. - if ((mLoadInfo->GetExternalContentPolicyType() != - ExtContentPolicy::TYPE_DOCUMENT) && - (mLoadInfo->GetLoadingPrincipal() && - mLoadInfo->GetLoadingPrincipal()->SchemeIs("http"))) { - return true; - } -@@ -795,16 +799,21 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRF - return true; - } - - // Don't block the channel when TRR is not used. - if (!trrEnabled) { - return true; - } - -+ auto dnsStrategy = GetProxyDNSStrategy(); -+ if (dnsStrategy != ProxyDNSStrategy::ORIGIN) { -+ return true; -+ } -+ - nsAutoCString uriHost; - mURI->GetAsciiHost(uriHost); - - return gHttpHandler->IsHostExcludedForHTTPSRR(uriHost); - }; - - if (shouldSkipUpgradeWithHTTPSRR()) { - StoreUseHTTPSSVC(false); -@@ -819,21 +828,16 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRF - LOG(( - "nsHttpChannel::MaybeUseHTTPSRRForUpgrade [%p] mHTTPSSVCRecord is some", - this)); - StoreWaitHTTPSSVCRecord(false); - bool hasHTTPSRR = (mHTTPSSVCRecord.ref() != nullptr); - return ContinueOnBeforeConnect(hasHTTPSRR, aStatus, hasHTTPSRR); - } - -- auto dnsStrategy = GetProxyDNSStrategy(); -- if (!(dnsStrategy & DNS_PREFETCH_ORIGIN)) { -- return ContinueOnBeforeConnect(aShouldUpgrade, aStatus); -- } -- - LOG(("nsHttpChannel::MaybeUseHTTPSRRForUpgrade [%p] wait for HTTPS RR", - this)); - - OriginAttributes originAttributes; - StoragePrincipalHelper::GetOriginAttributesForHTTPSRR(this, originAttributes); - - RefPtr resolver = - new nsDNSPrefetch(mURI, originAttributes, nsIRequest::GetTRRMode()); -@@ -1346,23 +1350,23 @@ void nsHttpChannel::SpeculativeConnect() - if (LoadAllowStaleCacheContent()) { - return; - } - - nsCOMPtr callbacks; - NS_NewNotificationCallbacksAggregation(mCallbacks, mLoadGroup, - getter_AddRefs(callbacks)); - if (!callbacks) return; -- -- Unused << gHttpHandler->SpeculativeConnect( -+ bool httpsRRAllowed = !(mCaps & NS_HTTP_DISALLOW_HTTPS_RR); -+ Unused << gHttpHandler->MaybeSpeculativeConnectWithHTTPSRR( - mConnectionInfo, callbacks, - mCaps & (NS_HTTP_DISALLOW_SPDY | NS_HTTP_TRR_MODE_MASK | - NS_HTTP_DISABLE_IPV4 | NS_HTTP_DISABLE_IPV6 | - NS_HTTP_DISALLOW_HTTP3 | NS_HTTP_REFRESH_DNS), -- gHttpHandler->EchConfigEnabled()); -+ gHttpHandler->EchConfigEnabled() && httpsRRAllowed); - } - - void nsHttpChannel::DoNotifyListenerCleanup() { - // We don't need this info anymore - CleanRedirectCacheChainIfNecessary(); - } - - void nsHttpChannel::ReleaseListeners() { -@@ -6755,39 +6759,26 @@ nsHttpChannel::GetOrCreateChannelClassif - LOG(("nsHttpChannel [%p] created nsChannelClassifier [%p]\n", this, - mChannelClassifier.get())); - } - - RefPtr classifier = mChannelClassifier; - return classifier.forget(); - } - --uint16_t nsHttpChannel::GetProxyDNSStrategy() { -- // This function currently only supports returning DNS_PREFETCH_ORIGIN. -- // Support for the rest of the DNS_* flags will be added later. -- -+ProxyDNSStrategy nsHttpChannel::GetProxyDNSStrategy() { - // When network_dns_force_use_https_rr is true, return DNS_PREFETCH_ORIGIN. - // This ensures that we always perform HTTPS RR query. -- if (!mProxyInfo || StaticPrefs::network_dns_force_use_https_rr()) { -- return DNS_PREFETCH_ORIGIN; -- } -- -- uint32_t flags = 0; -- nsAutoCString type; -- mProxyInfo->GetFlags(&flags); -- mProxyInfo->GetType(type); -+ nsCOMPtr proxyInfo(static_cast(mProxyInfo.get())); -+ if (!proxyInfo || StaticPrefs::network_dns_force_use_https_rr()) { -+ return ProxyDNSStrategy::ORIGIN; -+ } - - // If the proxy is not to perform name resolution itself. -- if (!(flags & nsIProxyInfo::TRANSPARENT_PROXY_RESOLVES_HOST)) { -- if (type.EqualsLiteral("socks")) { -- return DNS_PREFETCH_ORIGIN; -- } -- } -- -- return 0; -+ return GetProxyDNSStrategyHelper(proxyInfo->Type(), proxyInfo->Flags()); - } - - // BeginConnect() SHOULD NOT call AsyncAbort(). AsyncAbort will be called by - // functions that called BeginConnect if needed. Only - // MaybeResolveProxyAndBeginConnect and OnProxyAvailable ever call - // BeginConnect. - nsresult nsHttpChannel::BeginConnect() { - LOG(("nsHttpChannel::BeginConnect [this=%p]\n", this)); -@@ -6962,21 +6953,23 @@ nsresult nsHttpChannel::BeginConnect() { - } else { - LOG(("nsHttpChannel %p Using default connection info", this)); - - mConnectionInfo = connInfo; - Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_USE_ALTSVC, false); - } - - bool trrEnabled = false; -+ auto dnsStrategy = GetProxyDNSStrategy(); - bool httpsRRAllowed = - !LoadBeConservative() && !(mCaps & NS_HTTP_BE_CONSERVATIVE) && - !(mLoadInfo->TriggeringPrincipal()->IsSystemPrincipal() && - mLoadInfo->GetExternalContentPolicyType() != - ExtContentPolicy::TYPE_DOCUMENT) && -+ dnsStrategy == ProxyDNSStrategy::ORIGIN && - !mConnectionInfo->UsingConnect() && canUseHTTPSRRonNetwork(&trrEnabled) && - StaticPrefs::network_dns_use_https_rr_as_altsvc(); - if (!httpsRRAllowed) { - DisallowHTTPSRR(mCaps); - } else if (trrEnabled) { - if (nsIRequest::GetTRRMode() != nsIRequest::TRR_DISABLED_MODE) { - mCaps |= NS_HTTP_FORCE_WAIT_HTTP_RR; - } -@@ -7077,26 +7070,17 @@ nsresult nsHttpChannel::BeginConnect() { - "[this=%p]\n", - this)); - return NS_OK; - } - - ReEvaluateReferrerAfterTrackingStatusIsKnown(); - } - -- rv = MaybeStartDNSPrefetch(); -- if (NS_FAILED(rv)) { -- auto dnsStrategy = GetProxyDNSStrategy(); -- if (dnsStrategy & DNS_BLOCK_ON_ORIGIN_RESOLVE) { -- // TODO: Should this be fatal? -- return rv; -- } -- // Otherwise this shouldn't be fatal. -- return NS_OK; -- } -+ MaybeStartDNSPrefetch(); - - rv = CallOrWaitForResume( - [](nsHttpChannel* self) { return self->PrepareToConnect(); }); - if (NS_FAILED(rv)) { - return rv; - } - - if (shouldBeClassified) { -@@ -7106,69 +7090,57 @@ nsresult nsHttpChannel::BeginConnect() { - LOG(("nsHttpChannel::Starting nsChannelClassifier %p [this=%p]", - channelClassifier.get(), this)); - channelClassifier->Start(); - } - - return NS_OK; - } - --nsresult nsHttpChannel::MaybeStartDNSPrefetch() { -+void nsHttpChannel::MaybeStartDNSPrefetch() { - // Start a DNS lookup very early in case the real open is queued the DNS can - // happen in parallel. Do not do so in the presence of an HTTP proxy as - // all lookups other than for the proxy itself are done by the proxy. - // Also we don't do a lookup if the LOAD_NO_NETWORK_IO or - // LOAD_ONLY_FROM_CACHE flags are set. - // - // We keep the DNS prefetch object around so that we can retrieve - // timing information from it. There is no guarantee that we actually - // use the DNS prefetch data for the real connection, but as we keep - // this data around for 3 minutes by default, this should almost always - // be correct, and even when it isn't, the timing still represents _a_ - // valid DNS lookup timing for the site, even if it is not _the_ - // timing we used. - if ((mLoadFlags & (LOAD_NO_NETWORK_IO | LOAD_ONLY_FROM_CACHE)) || - LoadAuthRedirectedChannel()) { -- return NS_OK; -+ return; - } - - auto dnsStrategy = GetProxyDNSStrategy(); - - LOG( - ("nsHttpChannel::MaybeStartDNSPrefetch [this=%p, strategy=%u] " - "prefetching%s\n", -- this, dnsStrategy, -+ this, static_cast(dnsStrategy), - mCaps & NS_HTTP_REFRESH_DNS ? ", refresh requested" : "")); - -- if (dnsStrategy & DNS_PREFETCH_ORIGIN) { -+ if (dnsStrategy == ProxyDNSStrategy::ORIGIN) { - OriginAttributes originAttributes; - StoragePrincipalHelper::GetOriginAttributesForNetworkState( - this, originAttributes); - - mDNSPrefetch = - new nsDNSPrefetch(mURI, originAttributes, nsIRequest::GetTRRMode(), - this, LoadTimingEnabled()); - nsIDNSService::DNSFlags dnsFlags = nsIDNSService::RESOLVE_DEFAULT_FLAGS; - if (mCaps & NS_HTTP_REFRESH_DNS) { - dnsFlags |= nsIDNSService::RESOLVE_BYPASS_CACHE; - } -- nsresult rv = mDNSPrefetch->PrefetchHigh(dnsFlags); -- -- if (dnsStrategy & DNS_BLOCK_ON_ORIGIN_RESOLVE) { -- LOG((" blocking on prefetching origin")); -- -- if (NS_WARN_IF(NS_FAILED(rv))) { -- LOG((" lookup failed with 0x%08" PRIx32 ", aborting request", -- static_cast(rv))); -- return rv; -- } -- -- // Resolved in OnLookupComplete. -- mDNSBlockingThenable = mDNSBlockingPromise.Ensure(__func__); -- } -+ -+ Unused << mDNSPrefetch->PrefetchHigh(dnsFlags); - - if (StaticPrefs::network_dns_use_https_rr_as_altsvc() && !mHTTPSSVCRecord && - !(mCaps & NS_HTTP_DISALLOW_HTTPS_RR) && canUseHTTPSRRonNetwork()) { - MOZ_ASSERT(!mHTTPSSVCRecord); - - OriginAttributes originAttributes; - StoragePrincipalHelper::GetOriginAttributesForHTTPSRR(this, - originAttributes); -@@ -7176,18 +7148,16 @@ nsresult nsHttpChannel::MaybeStartDNSPre - RefPtr resolver = - new nsDNSPrefetch(mURI, originAttributes, nsIRequest::GetTRRMode()); - Unused << resolver->FetchHTTPSSVC(mCaps & NS_HTTP_REFRESH_DNS, true, - [](nsIDNSHTTPSSVCRecord*) { - // Do nothing. This is a DNS prefetch. - }); - } - } -- -- return NS_OK; - } - - NS_IMETHODIMP - nsHttpChannel::GetEncodedBodySize(uint64_t* aEncodedBodySize) { - if (mCacheEntry && !LoadCacheEntryIsWriteOnly()) { - int64_t dataSize = 0; - mCacheEntry->GetDataSize(&dataSize); - *aEncodedBodySize = dataSize; -diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h ---- a/netwerk/protocol/http/nsHttpChannel.h -+++ b/netwerk/protocol/http/nsHttpChannel.h -@@ -304,33 +304,21 @@ class nsHttpChannel final : public HttpB - bool RequestIsConditional(); - void HandleContinueCancellingByURLClassifier(nsresult aErrorCode); - nsresult CancelInternal(nsresult status); - void ContinueCancellingByURLClassifier(nsresult aErrorCode); - - // Connections will only be established in this function. - // (including DNS prefetch and speculative connection.) - void MaybeResolveProxyAndBeginConnect(); -- nsresult MaybeStartDNSPrefetch(); -- -- // Tells the channel to resolve the origin of the end server we are connecting -- // to. -- static uint16_t const DNS_PREFETCH_ORIGIN = 1 << 0; -- // Tells the channel to resolve the host name of the proxy. -- static uint16_t const DNS_PREFETCH_PROXY = 1 << 1; -- // Will be set if the current channel uses an HTTP/HTTPS proxy. -- static uint16_t const DNS_PROXY_IS_HTTP = 1 << 2; -- // Tells the channel to wait for the result of the origin server resolution -- // before any connection attempts are made. -- static uint16_t const DNS_BLOCK_ON_ORIGIN_RESOLVE = 1 << 3; -+ void MaybeStartDNSPrefetch(); - - // Based on the proxy configuration determine the strategy for resolving the - // end server host name. -- // Returns a combination of the above flags. -- uint16_t GetProxyDNSStrategy(); -+ ProxyDNSStrategy GetProxyDNSStrategy(); - - // We might synchronously or asynchronously call BeginConnect, - // which includes DNS prefetch and speculative connection, according to - // whether an async tracker lookup is required. If the tracker lookup - // is required, this funciton will just return NS_OK and BeginConnect() - // will be called when callback. See Bug 1325054 for more information. - nsresult BeginConnect(); - [[nodiscard]] nsresult PrepareToConnect(); -diff --git a/netwerk/protocol/http/nsHttpConnectionInfo.h b/netwerk/protocol/http/nsHttpConnectionInfo.h ---- a/netwerk/protocol/http/nsHttpConnectionInfo.h -+++ b/netwerk/protocol/http/nsHttpConnectionInfo.h -@@ -122,16 +122,23 @@ class nsHttpConnectionInfo final : publi - return mProxyInfo ? mProxyInfo->Type() : nullptr; - } - const char* ProxyUsername() const { - return mProxyInfo ? mProxyInfo->Username().get() : nullptr; - } - const char* ProxyPassword() const { - return mProxyInfo ? mProxyInfo->Password().get() : nullptr; - } -+ uint32_t ProxyFlag() const { -+ uint32_t flags = 0; -+ if (mProxyInfo) { -+ mProxyInfo->GetFlags(&flags); -+ } -+ return flags; -+ } - - const nsCString& ProxyAuthorizationHeader() const { - return mProxyInfo ? mProxyInfo->ProxyAuthorizationHeader() : EmptyCString(); - } - const nsCString& ConnectionIsolationKey() const { - return mProxyInfo ? mProxyInfo->ConnectionIsolationKey() : EmptyCString(); - } - -diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp ---- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp -+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp -@@ -3570,19 +3570,25 @@ void nsHttpConnectionMgr::DoSpeculativeC - MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - MOZ_ASSERT(aTrans); - MOZ_ASSERT(aEnt); - if (!gHttpHandler->Active()) { - // Do nothing if we are shutting down. - return; - } - -- if (aFetchHTTPSRR && NS_SUCCEEDED(aTrans->FetchHTTPSRR())) { -- // nsHttpConnectionMgr::DoSpeculativeConnection will be called again when -- // HTTPS RR is available. -+ ProxyDNSStrategy strategy = GetProxyDNSStrategyHelper( -+ aEnt->mConnInfo->ProxyType(), aEnt->mConnInfo->ProxyFlag()); -+ // Speculative connections can be triggered by non-Necko consumers, -+ // so add an extra check to ensure HTTPS RR isn't fetched when a proxy is -+ // used. -+ if (aFetchHTTPSRR && strategy == ProxyDNSStrategy::ORIGIN && -+ NS_SUCCEEDED(aTrans->FetchHTTPSRR())) { -+ // nsHttpConnectionMgr::DoSpeculativeConnection will be called again -+ // when HTTPS RR is available. - return; - } - - uint32_t parallelSpeculativeConnectLimit = - aTrans->ParallelSpeculativeConnectLimit() - ? *aTrans->ParallelSpeculativeConnectLimit() - : gHttpHandler->ParallelSpeculativeConnectLimit(); - bool ignoreIdle = aTrans->IgnoreIdle() ? *aTrans->IgnoreIdle() : false; -diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp ---- a/netwerk/protocol/http/nsHttpHandler.cpp -+++ b/netwerk/protocol/http/nsHttpHandler.cpp -@@ -2403,17 +2403,19 @@ nsresult nsHttpHandler::SpeculativeConne - if (!neckoParent) { - continue; - } - Unused << neckoParent->SendSpeculativeConnectRequest(); - } - } - } - -- return SpeculativeConnect(ci, aCallbacks); -+ // When ech is enabled, always do speculative connect with HTTPS RR. -+ return MaybeSpeculativeConnectWithHTTPSRR(ci, aCallbacks, 0, -+ EchConfigEnabled()); - } - - NS_IMETHODIMP - nsHttpHandler::SpeculativeConnect(nsIURI* aURI, nsIPrincipal* aPrincipal, - nsIInterfaceRequestor* aCallbacks, - bool aAnonymous) { - return SpeculativeConnectInternal(aURI, aPrincipal, Nothing(), aCallbacks, - aAnonymous); -diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h ---- a/netwerk/protocol/http/nsHttpHandler.h -+++ b/netwerk/protocol/http/nsHttpHandler.h -@@ -291,24 +291,23 @@ class nsHttpHandler final : public nsIHt - [[nodiscard]] nsresult ProcessPendingQ() { - return mConnMgr->ProcessPendingQ(); - } - - [[nodiscard]] nsresult GetSocketThreadTarget(nsIEventTarget** target) { - return mConnMgr->GetSocketThreadTarget(target); - } - -- [[nodiscard]] nsresult SpeculativeConnect(nsHttpConnectionInfo* ci, -- nsIInterfaceRequestor* callbacks, -- uint32_t caps = 0, -- bool aFetchHTTPSRR = false) { -+ [[nodiscard]] nsresult MaybeSpeculativeConnectWithHTTPSRR( -+ nsHttpConnectionInfo* ci, nsIInterfaceRequestor* callbacks, uint32_t caps, -+ bool aFetchHTTPSRR) { - TickleWifi(callbacks); - RefPtr clone = ci->Clone(); - return mConnMgr->SpeculativeConnect(clone, callbacks, caps, nullptr, -- aFetchHTTPSRR | EchConfigEnabled()); -+ aFetchHTTPSRR); - } - - [[nodiscard]] nsresult SpeculativeConnect(nsHttpConnectionInfo* ci, - nsIInterfaceRequestor* callbacks, - uint32_t caps, - SpeculativeTransaction* aTrans) { - RefPtr clone = ci->Clone(); - return mConnMgr->SpeculativeConnect(clone, callbacks, caps, aTrans); -diff --git a/netwerk/test/unit/test_proxyDNS_leak.js b/netwerk/test/unit/test_proxyDNS_leak.js -new file mode 100644 ---- /dev/null -+++ b/netwerk/test/unit/test_proxyDNS_leak.js -@@ -0,0 +1,111 @@ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+// Test when socks proxy is registered, we don't try to resolve HTTPS record. -+// Steps: -+// 1. Use addHTTPSRecordOverride to add an override for service.com. -+// 2. Add a proxy filter to use socks proxy. -+// 3. Create a request to load service.com. -+// 4. See if the HTTPS record is in DNS cache entries. -+ -+"use strict"; -+ -+const gDashboard = Cc["@mozilla.org/network/dashboard;1"].getService( -+ Ci.nsIDashboard -+); -+const pps = Cc["@mozilla.org/network/protocol-proxy-service;1"].getService(); -+ -+add_task(async function setup() { -+ Services.prefs.setBoolPref("network.dns.native_https_query", true); -+ Services.prefs.setBoolPref("network.dns.native_https_query_win10", true); -+ const override = Cc["@mozilla.org/network/native-dns-override;1"].getService( -+ Ci.nsINativeDNSResolverOverride -+ ); -+ -+ let rawBuffer = [ -+ 0, 0, 128, 0, 0, 0, 0, 1, 0, 0, 0, 0, 7, 115, 101, 114, 118, 105, 99, 101, -+ 3, 99, 111, 109, 0, 0, 65, 0, 1, 0, 0, 0, 55, 0, 13, 0, 1, 0, 0, 1, 0, 6, 2, -+ 104, 50, 2, 104, 51, -+ ]; -+ override.addHTTPSRecordOverride("service.com", rawBuffer, rawBuffer.length); -+ override.addIPOverride("service.com", "127.0.0.1"); -+ registerCleanupFunction(() => { -+ Services.prefs.clearUserPref("network.dns.native_https_query"); -+ Services.prefs.clearUserPref("network.dns.native_https_query_win10"); -+ Services.prefs.clearUserPref("network.dns.localDomains"); -+ override.clearOverrides(); -+ }); -+}); -+ -+function makeChan(uri) { -+ let chan = NetUtil.newChannel({ -+ uri, -+ loadUsingSystemPrincipal: true, -+ contentPolicyType: Ci.nsIContentPolicy.TYPE_DOCUMENT, -+ }).QueryInterface(Ci.nsIHttpChannel); -+ chan.loadFlags = Ci.nsIChannel.LOAD_INITIAL_DOCUMENT_URI; -+ return chan; -+} -+ -+function channelOpenPromise(chan, flags) { -+ return new Promise(resolve => { -+ function finish(req, buffer) { -+ resolve([req, buffer]); -+ } -+ chan.asyncOpen(new ChannelListener(finish, null, flags)); -+ }); -+} -+ -+async function isRecordFound(hostname) { -+ return new Promise(resolve => { -+ gDashboard.requestDNSInfo(function (data) { -+ let found = false; -+ for (let i = 0; i < data.entries.length; i++) { -+ if ( -+ data.entries[i].hostname == hostname && -+ data.entries[i].type == Ci.nsIDNSService.RESOLVE_TYPE_HTTPSSVC -+ ) { -+ found = true; -+ break; -+ } -+ } -+ resolve(found); -+ }); -+ }); -+} -+ -+async function do_test_with_proxy_filter(filter) { -+ pps.registerFilter(filter, 10); -+ -+ let chan = makeChan(`https://service.com/`); -+ await channelOpenPromise(chan, CL_EXPECT_LATE_FAILURE | CL_ALLOW_UNKNOWN_CL); -+ -+ let found = await isRecordFound("service.com"); -+ pps.unregisterFilter(filter); -+ -+ return found; -+} -+ -+add_task(async function test_proxyDNS_do_leak() { -+ let filter = new NodeProxyFilter("socks", "localhost", 443, 0); -+ -+ let res = await do_test_with_proxy_filter(filter); -+ -+ Assert.ok(res, "Should find a DNS entry"); -+}); -+ -+add_task(async function test_proxyDNS_dont_leak() { -+ Services.dns.clearCache(false); -+ -+ let filter = new NodeProxyFilter( -+ "socks", -+ "localhost", -+ 443, -+ Ci.nsIProxyInfo.TRANSPARENT_PROXY_RESOLVES_HOST -+ ); -+ -+ let res = await do_test_with_proxy_filter(filter); -+ -+ Assert.ok(!res, "Should not find a DNS entry"); -+}); -diff --git a/netwerk/test/unit/xpcshell.toml b/netwerk/test/unit/xpcshell.toml ---- a/netwerk/test/unit/xpcshell.toml -+++ b/netwerk/test/unit/xpcshell.toml -@@ -974,16 +974,22 @@ skip-if = [ - - ["test_proxy-slow-upload.js"] - - ["test_proxy_cancel.js"] - run-sequentially = "node server exceptions dont replay well" - - ["test_proxy_pac.js"] - -+["test_proxyDNS_leak.js"] -+skip-if = [ -+ "os == 'android'", -+ "socketprocess_networking", -+] -+ - ["test_proxyconnect.js"] - skip-if = [ - "tsan", - "socketprocess_networking", # Bug 1614708 - ] - - ["test_proxyconnect_https.js"] - skip-if = [ -diff --git a/toolkit/content/aboutNetworking.js b/toolkit/content/aboutNetworking.js ---- a/toolkit/content/aboutNetworking.js -+++ b/toolkit/content/aboutNetworking.js -@@ -111,16 +111,21 @@ function displayDns(data) { - prevURL.parentNode.replaceChild(trr_url_tbody, prevURL); - - let cont = document.getElementById("dns_content"); - let parent = cont.parentNode; - let new_cont = document.createElement("tbody"); - new_cont.setAttribute("id", "dns_content"); - - for (let i = 0; i < data.entries.length; i++) { -+ // TODO: Will be supported in bug 1889387. -+ if (data.entries[i].type != Ci.nsIDNSService.RESOLVE_TYPE_DEFAULT) { -+ continue; -+ } -+ - let row = document.createElement("tr"); - row.appendChild(col(data.entries[i].hostname)); - row.appendChild(col(data.entries[i].family)); - row.appendChild(col(data.entries[i].trr)); - let column = document.createElement("td"); - - for (let j = 0; j < data.entries[i].hostaddr.length; j++) { - column.appendChild(document.createTextNode(data.entries[i].hostaddr[j])); - diff --git a/patches/webgl-spoofing.patch b/patches/webgl-spoofing.patch index cd5e3af..8b2d403 100644 --- a/patches/webgl-spoofing.patch +++ b/patches/webgl-spoofing.patch @@ -1,5 +1,5 @@ diff --git a/dom/canvas/ClientWebGLContext.cpp b/dom/canvas/ClientWebGLContext.cpp -index db60868f65..7361f0fc9c 100644 +index a1e5c4792d..be99491bf8 100644 --- a/dom/canvas/ClientWebGLContext.cpp +++ b/dom/canvas/ClientWebGLContext.cpp @@ -4,6 +4,9 @@ @@ -12,8 +12,8 @@ index db60868f65..7361f0fc9c 100644 #include -@@ -744,6 +747,13 @@ void ClientWebGLContext::SetDrawingBufferColorSpace( - Run(*mDrawingBufferColorSpace); +@@ -750,6 +753,13 @@ void ClientWebGLContext::SetUnpackColorSpace( + Run(*mUnpackColorSpace); } +bool ClientWebGLContext::MBoolVal(const std::string& key, bool defaultValue) { @@ -26,7 +26,7 @@ index db60868f65..7361f0fc9c 100644 void ClientWebGLContext::GetContextAttributes( dom::Nullable& retval) { retval.SetNull(); -@@ -754,14 +764,38 @@ void ClientWebGLContext::GetContextAttributes( +@@ -760,15 +770,40 @@ void ClientWebGLContext::GetContextAttributes( const auto& options = mNotLost->info.options; @@ -38,6 +38,7 @@ index db60868f65..7361f0fc9c 100644 - result.mPreserveDrawingBuffer = options.preserveDrawingBuffer; - result.mFailIfMajorPerformanceCaveat = options.failIfMajorPerformanceCaveat; - result.mPowerPreference = options.powerPreference; +- result.mForceSoftwareRendering = options.forceSoftwareRendering; + result.mAlpha.Construct(MBoolVal("alpha", options.alpha)); + result.mDepth = MBoolVal("depth", options.depth); + result.mStencil = MBoolVal("stencil", options.stencil); @@ -70,10 +71,12 @@ index db60868f65..7361f0fc9c 100644 + } else { + result.mPowerPreference = options.powerPreference; + } ++ result.mForceSoftwareRendering = MBoolVal( ++ "forceSoftwareRendering", options.forceSoftwareRendering); } // ----------------------- -@@ -979,18 +1013,28 @@ bool ClientWebGLContext::CreateHostContext(const uvec2& requestedSize) { +@@ -986,18 +1021,28 @@ bool ClientWebGLContext::CreateHostContext(const uvec2& requestedSize) { std::unordered_map webgl::MakeIsEnabledMap(const bool webgl2) { auto ret = std::unordered_map{}; @@ -112,7 +115,7 @@ index db60868f65..7361f0fc9c 100644 } return ret; -@@ -2058,6 +2102,57 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, +@@ -2066,6 +2111,57 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, const auto& state = State(); // - @@ -170,7 +173,7 @@ index db60868f65..7361f0fc9c 100644 const auto fnSetRetval_Buffer = [&](const GLenum target) { const auto buffer = *MaybeFind(state.mBoundBufferByTarget, target); -@@ -2163,49 +2258,84 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, +@@ -2171,49 +2267,84 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, // 2 floats case LOCAL_GL_DEPTH_RANGE: @@ -268,7 +271,7 @@ index db60868f65..7361f0fc9c 100644 return; } -@@ -2385,6 +2515,10 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, +@@ -2393,6 +2524,10 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, switch (pname) { case dom::WEBGL_debug_renderer_info_Binding::UNMASKED_RENDERER_WEBGL: @@ -279,7 +282,7 @@ index db60868f65..7361f0fc9c 100644 ret = GetUnmaskedRenderer(); if (ret && StaticPrefs::webgl_sanitize_unmasked_renderer()) { *ret = webgl::SanitizeRenderer(*ret); -@@ -2392,6 +2526,10 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, +@@ -2400,6 +2535,10 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, break; case dom::WEBGL_debug_renderer_info_Binding::UNMASKED_VENDOR_WEBGL: @@ -290,7 +293,7 @@ index db60868f65..7361f0fc9c 100644 ret = GetUnmaskedVendor(); break; -@@ -2482,7 +2620,9 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, +@@ -2490,7 +2629,9 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, case LOCAL_GL_COLOR_WRITEMASK: { const auto mask = uint8_t(*maybe); const auto bs = std::bitset<4>(mask); @@ -301,7 +304,7 @@ index db60868f65..7361f0fc9c 100644 JS::Rooted arr(cx); if (!dom::ToJSValue(cx, src.data(), src.size(), &arr)) { rv = NS_ERROR_OUT_OF_MEMORY; -@@ -2865,6 +3005,24 @@ ClientWebGLContext::GetShaderPrecisionFormat(const GLenum shadertype, +@@ -2873,6 +3014,24 @@ ClientWebGLContext::GetShaderPrecisionFormat(const GLenum shadertype, const GLenum precisiontype) { if (IsContextLost()) return nullptr; const auto info = [&]() { @@ -326,7 +329,7 @@ index db60868f65..7361f0fc9c 100644 const auto& inProcess = mNotLost->inProcess; if (inProcess) { return inProcess->GetShaderPrecisionFormat(shadertype, precisiontype); -@@ -5822,6 +5980,17 @@ bool ClientWebGLContext::IsSupported(const WebGLExtensionID ext, +@@ -5853,6 +6012,17 @@ bool ClientWebGLContext::IsSupported(const WebGLExtensionID ext, return false; } @@ -344,7 +347,7 @@ index db60868f65..7361f0fc9c 100644 const auto& limits = Limits(); return limits.supportedExtensions[ext]; } -@@ -5833,6 +6002,18 @@ void ClientWebGLContext::GetSupportedExtensions( +@@ -5864,6 +6034,18 @@ void ClientWebGLContext::GetSupportedExtensions( if (!mNotLost) return; auto& retarr = retval.SetValue(); @@ -364,10 +367,10 @@ index db60868f65..7361f0fc9c 100644 if (!IsSupported(i, callerType)) continue; diff --git a/dom/canvas/ClientWebGLContext.h b/dom/canvas/ClientWebGLContext.h -index 9e8b3c0f00..16e3fc7aa5 100644 +index 62957ee445..dfb2b8ff53 100644 --- a/dom/canvas/ClientWebGLContext.h +++ b/dom/canvas/ClientWebGLContext.h -@@ -1067,6 +1067,9 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal, +@@ -1074,6 +1074,9 @@ class ClientWebGLContext final : public nsICanvasRenderingContextInternal, // - diff --git a/upstream.sh b/upstream.sh index b6e73c9..d479b2e 100644 --- a/upstream.sh +++ b/upstream.sh @@ -1,2 +1,2 @@ -version=130.0.1 -release=beta.13 +version=132.0 +release=beta.14