diff --git a/browser_patches/firefox/UPSTREAM_CONFIG.sh b/browser_patches/firefox/UPSTREAM_CONFIG.sh index b2cb184ed21ba..6a4345ea78398 100644 --- a/browser_patches/firefox/UPSTREAM_CONFIG.sh +++ b/browser_patches/firefox/UPSTREAM_CONFIG.sh @@ -1,3 +1,3 @@ REMOTE_URL="https://github.com/mozilla-firefox/firefox" BASE_BRANCH="release" -BASE_REVISION="c7fa3c91990bac266ee99a9e31863c202469f369" +BASE_REVISION="d4faced9e237d6431856c0873cb035cbbc25817b" diff --git a/browser_patches/firefox/juggler/NetworkObserver.js b/browser_patches/firefox/juggler/NetworkObserver.js index 878587afd52ee..85264a49dff62 100644 --- a/browser_patches/firefox/juggler/NetworkObserver.js +++ b/browser_patches/firefox/juggler/NetworkObserver.js @@ -106,7 +106,10 @@ class NetworkRequest { this.httpChannel = httpChannel; const loadInfo = this.httpChannel.loadInfo; - const browsingContext = loadInfo?.frameBrowsingContext || loadInfo?.workerAssociatedBrowsingContext || loadInfo?.browsingContext; + const browsingContext = loadInfo?.frameBrowsingContext + || loadInfo?.associatedBrowsingContext + || loadInfo?.workerAssociatedBrowsingContext + || loadInfo?.browsingContext; this._frameId = helper.browsingContextToFrameId(browsingContext); @@ -906,13 +909,18 @@ class ResponseStorage { const encodingHeader = request.httpChannel.getResponseHeader("Content-Encoding"); encodings = encodingHeader.split(/\s*\t*,\s*\t*/); } - this._responses.set(request.requestId, {body, encodings}); + this._responses.set(request.requestId, { + body, + encodings, + httpChannel: encodings.length ? request.httpChannel : null, + }); this._totalSize += body.length; if (this._totalSize > this._maxTotalSize) { for (let [requestId, response] of this._responses) { this._totalSize -= response.body.length; response.body = ''; response.evicted = true; + response.httpChannel = null; if (this._totalSize < this._maxTotalSize) break; } @@ -928,7 +936,7 @@ class ResponseStorage { let result = response.body; if (response.encodings && response.encodings.length) { for (const encoding of response.encodings) - result = convertString(result, encoding, 'uncompressed'); + result = convertString(result, encoding, 'uncompressed', response.httpChannel); } return {base64body: btoa(result)}; } @@ -984,7 +992,7 @@ function setPostData(httpChannel, postData, headers) { httpChannel.explicitSetUploadStream(synthesized, contentType, -1, httpChannel.requestMethod, false); } -function convertString(s, source, dest) { +function convertString(s, source, dest, request) { const is = Cc["@mozilla.org/io/string-input-stream;1"].createInstance( Ci.nsIStringInputStream ); @@ -1018,9 +1026,9 @@ function convertString(s, source, dest) { listener, null ); - converter.onStartRequest(null, null); - converter.onDataAvailable(null, is, 0, s.length); - converter.onStopRequest(null, null, null); + converter.onStartRequest(request, null); + converter.onDataAvailable(request, is, 0, s.length); + converter.onStopRequest(request, null, null); return result.join(''); } @@ -1047,4 +1055,3 @@ PageNetwork.Events = { RequestFinished: Symbol('PageNetwork.Events.RequestFinished'), RequestFailed: Symbol('PageNetwork.Events.RequestFailed'), }; - diff --git a/browser_patches/firefox/juggler/TargetRegistry.js b/browser_patches/firefox/juggler/TargetRegistry.js index 1f3c79f1d5924..e9ceb32fc420d 100644 --- a/browser_patches/firefox/juggler/TargetRegistry.js +++ b/browser_patches/firefox/juggler/TargetRegistry.js @@ -24,6 +24,8 @@ let globalTabAndWindowActivationChain = Promise.resolve(); let didCreateFirstPage = false; let globalNewPageChain = Promise.resolve(); +let globalContextCloseCounter = 0; + class DownloadInterceptor { constructor(registry) { this._registry = registry @@ -414,6 +416,8 @@ export class PageTarget { this._browserContext = browserContext; this._viewportSize = undefined; this._deviceScaleFactor = undefined; + this._screenSize = undefined; + this._isMobile = undefined; this._zoom = 1; this._initialDPPX = this._linkedBrowser.browsingContext.overrideDPPX; this._url = 'about:blank'; @@ -447,6 +451,7 @@ export class PageTarget { this._registry._browserToTarget.set(this._linkedBrowser, this); const browserId = this._linkedBrowser.browsingContext.browserId; + this._browserId = browserId; this._registry._browserIdToTarget.set(browserId, this); const actor = this._registry._browserIdToActor.get(browserId); if (actor) @@ -456,7 +461,7 @@ export class PageTarget { } async activateAndRun(callback = () => {}, { muteNotificationsPopup = false } = {}) { - const ownerWindow = this._tab.linkedBrowser.ownerGlobal; + const ownerWindow = this._tab.linkedBrowser.documentGlobal; const tabBrowser = ownerWindow.gBrowser; // Serialize all tab-switching commands per tabbed browser // to disallow concurrent tab switching. @@ -528,6 +533,7 @@ export class PageTarget { this.updateLanguageOverride(browsingContext); this.updatePlatform(browsingContext); this.updateDPPXOverride(browsingContext); + this.updateScreenEmulation(browsingContext); this.updateZoom(browsingContext); this.updateEmulatedMedia(browsingContext); this.updateColorSchemeOverride(browsingContext); @@ -568,7 +574,8 @@ export class PageTarget { } updateLanguageOverride(browsingContext = undefined) { - (browsingContext || this._linkedBrowser.browsingContext).languageOverride = this._browserContext.languageOverride; + browsingContext ||= this._linkedBrowser.browsingContext; + browsingContext.languageOverride = this._browserContext.languageOverride || ''; } updatePlatform(browsingContext = undefined) { @@ -582,6 +589,32 @@ export class PageTarget { browsingContext.overrideDPPX = dppx; } + updateScreenEmulation(browsingContext = undefined) { + browsingContext ||= this._linkedBrowser.browsingContext; + const screenSize = this._screenSize || this._browserContext.screenSize; + const isMobile = this._isMobile ?? this._browserContext.isMobile; + + // `isRDMPane` is a "mobile mode": viewport media queries, touch/pointer + // support, viewport media queries. + browsingContext.inRDMPane = !!isMobile; + + // Set window.screen.width and window.screen.height + if (screenSize) { + browsingContext.setScreenAreaOverride(screenSize.width, screenSize.height); + } else { + browsingContext.resetScreenAreaOverride(); + } + + // Derive the orientation from the emulated screen size and keep it in sync + // with the screen area override. + if (screenSize && isMobile) { + const isPortrait = screenSize.height >= screenSize.width; + browsingContext.setOrientationOverride(isPortrait ? 'portrait-primary' : 'landscape-primary', isPortrait ? 0 : 90); + } else { + browsingContext.resetOrientationOverride(); + } + } + async updateZoom(browsingContext = undefined) { browsingContext ||= this._linkedBrowser.browsingContext; // Update dpr first, and then UI zoom. @@ -611,6 +644,7 @@ export class PageTarget { async updateViewportSize() { await waitForWindowReady(this._window); this.updateDPPXOverride(); + this.updateScreenEmulation(); // Viewport size is defined by three arguments: // 1. default size. Could be explicit if set as part of `window.open` call, e.g. @@ -630,7 +664,6 @@ export class PageTarget { this._linkedBrowser.closest('.browserStack').style.setProperty('overflow', 'auto'); this._linkedBrowser.closest('.browserStack').style.setProperty('contain', 'size'); this._linkedBrowser.closest('.browserStack').style.setProperty('scrollbar-width', 'none'); - this._linkedBrowser.browsingContext.inRDMPane = true; const stackRect = this._linkedBrowser.closest('.browserStack').getBoundingClientRect(); const toolbarTop = stackRect.y; @@ -644,7 +677,6 @@ export class PageTarget { this._linkedBrowser.closest('.browserStack').style.removeProperty('overflow'); this._linkedBrowser.closest('.browserStack').style.removeProperty('contain'); this._linkedBrowser.closest('.browserStack').style.removeProperty('scrollbar-width'); - this._linkedBrowser.browsingContext.inRDMPane = false; const actualSize = this._linkedBrowser.getBoundingClientRect(); await this._channel.connect('').send('awaitViewportDimensions', { @@ -706,9 +738,11 @@ export class PageTarget { await this._channel.connect('').send('setInterceptFileChooserDialog', enabled).catch(e => {}); } - async setViewportSize(viewportSize, deviceScaleFactor) { + async setViewportSize(viewportSize, deviceScaleFactor, screenSize, isMobile) { this._viewportSize = viewportSize; this._deviceScaleFactor = deviceScaleFactor; + this._screenSize = screenSize; + this._isMobile = isMobile; await this.updateViewportSize(); } @@ -749,7 +783,7 @@ export class PageTarget { } _updateCrossProcessCookie() { - Services.ppmm.sharedData.set('juggler:page-cookie-' + this._linkedBrowser.browsingContext.browserId, this.crossProcessCookie); + Services.ppmm.sharedData.set('juggler:page-cookie-' + this._browserId, this.crossProcessCookie); Services.ppmm.sharedData.flush(); } @@ -787,7 +821,7 @@ export class PageTarget { if (width < 10 || width > 10000 || height < 10 || height > 10000) throw new Error("Invalid size"); - const docShell = this._gBrowser.ownerGlobal.docShell; + const docShell = this._gBrowser.documentGlobal.docShell; // Exclude address bar and navigation control from the video. const rect = this.linkedBrowser().getBoundingClientRect(); const devicePixelRatio = this._window.devicePixelRatio; @@ -841,7 +875,9 @@ export class PageTarget { this.stopScreencast(); this._browserContext.pages.delete(this); this._registry._browserToTarget.delete(this._linkedBrowser); - this._registry._browserIdToTarget.delete(this._linkedBrowser.browsingContext.browserId); + this._registry._browserIdToTarget.delete(this._browserId); + Services.ppmm.sharedData.delete('juggler:page-cookie-' + this._browserId); + Services.ppmm.sharedData.flush(); try { helper.removeListeners(this._eventListeners); } catch (e) { @@ -917,6 +953,8 @@ class BrowserContext { this.downloadOptions = undefined; this.defaultViewportSize = undefined; this.deviceScaleFactor = undefined; + this.screenSize = undefined; + this.isMobile = undefined; this.defaultUserAgent = null; this.timezoneOverride = undefined; this.languageOverride = undefined; @@ -983,7 +1021,18 @@ class BrowserContext { } this._registry._browserContextIdToBrowserContext.delete(this.browserContextId); this._registry._userContextIdToBrowserContext.delete(this.userContextId); + Services.ppmm.sharedData.delete('juggler:context-cookie-' + this.userContextId); + Services.ppmm.sharedData.flush(); this._registry._updateProxiesWithSameAuthCacheAndDifferentCredentials(); + // Clean the memory. on every 10'th context closure. On M1 Max, this method + // takes ~150ms, so we spread them out. + if (++globalContextCloseCounter % 10 === 0) { + await new Promise(x => { + Cc["@mozilla.org/memory-reporter-manager;1"] + .getService(Ci.nsIMemoryReporterManager) + .minimizeMemoryUsage(x); + }); + } } setProxy(proxy) { @@ -1056,6 +1105,8 @@ class BrowserContext { async setDefaultViewport(viewport) { this.defaultViewportSize = viewport ? viewport.viewportSize : undefined; this.deviceScaleFactor = viewport ? viewport.deviceScaleFactor : undefined; + this.screenSize = viewport ? viewport.screenSize : undefined; + this.isMobile = viewport ? viewport.isMobile : undefined; await Promise.all(Array.from(this.pages).map(page => page.updateViewportSize())); } diff --git a/browser_patches/firefox/juggler/content/FrameTree.js b/browser_patches/firefox/juggler/content/FrameTree.js index 09d550958bcc6..edf89e5524189 100644 --- a/browser_patches/firefox/juggler/content/FrameTree.js +++ b/browser_patches/firefox/juggler/content/FrameTree.js @@ -79,7 +79,7 @@ export class FrameTree { } workers() { - return [...this._workers.values()]; + return [...this._workers.values()].filter(worker => worker.isInitialized()); } runtime() { @@ -141,9 +141,11 @@ export class FrameTree { const frame = this._frameForWorker(workerDebugger); if (!frame) return; - const worker = new Worker(frame, workerDebugger); + const worker = new Worker(frame, workerDebugger, () => { + if (this._workers.has(workerDebugger)) + this.emit(FrameTree.Events.WorkerCreated, worker); + }); this._workers.set(workerDebugger, worker); - this.emit(FrameTree.Events.WorkerCreated, worker); } _onWorkerDestroyed(workerDebugger) { @@ -152,7 +154,8 @@ export class FrameTree { return; worker.dispose(); this._workers.delete(workerDebugger); - this.emit(FrameTree.Events.WorkerDestroyed, worker); + if (worker.isInitialized()) + this.emit(FrameTree.Events.WorkerDestroyed, worker); } allFramesInBrowsingContextGroup(group) { @@ -236,10 +239,10 @@ export class FrameTree { } onWindowEvent(event) { - if (event.type !== 'DOMDocElementInserted' || !event.target.ownerGlobal) + if (event.type !== 'DOMDocElementInserted' || !event.target.documentGlobal) return; - const docShell = event.target.ownerGlobal.docShell; + const docShell = event.target.documentGlobal.docShell; const frame = this.frameForDocShell(docShell); if (!frame) { dump(`WARNING: ${event.type} for unknown frame ${helper.browsingContextToFrameId(docShell.browsingContext)}\n`); @@ -249,7 +252,6 @@ export class FrameTree { docShell.QueryInterface(Ci.nsIWebNavigation); this._frameNavigationCommitted(frame, docShell.currentURI.spec); } - if (frame === this._mainFrame) { helper.removeListeners(this._dragEventListeners); const chromeEventHandler = docShell.chromeEventHandler; @@ -273,6 +275,7 @@ export class FrameTree { frame._lastCommittedNavigationId = navigationId; frame._url = url; this.emit(FrameTree.Events.NavigationCommitted, frame); + frame._initializeExecutionContexts(); if (frame === this._mainFrame) this.forcePageReady(); } @@ -422,6 +425,7 @@ class Frame { wsid: webSocketSerialID + '', opcode: frame.opCode, data: frame.opCode !== 1 ? btoa(frame.payload) : frame.payload, + timestamp: frame.timeStamp / 1_000_000, }); this._webSocketListener = { QueryInterface: ChromeUtils.generateQI([Ci.nsIWebSocketEventListener, ]), @@ -492,6 +496,7 @@ class Frame { wsid: webSocketSerialID + '', opcode: frame.opCode, data: frame.opCode !== 1 ? btoa(frame.payload) : frame.payload, + timestamp: frame.timeStamp / 1_000_000, }); }, }; @@ -547,6 +552,21 @@ class Frame { this._runtime.destroyExecutionContext(context); this._worldNameToContext.clear(); + if (this.domWindow().document?.documentElement) { + // Sometimes FrameTree is created too early, before the location has been set. + this._url = this.domWindow().location?.href; + this._frameTree.emit(FrameTree.Events.NavigationCommitted, this); + this._initializeExecutionContexts(); + } + + this._updateJavaScriptDisabled(); + } + + _initializeExecutionContexts() { + // A global object may see multiple document element insertions and/or commits + // (document.open/write, initial about:blank) - only initialize once. + if (this._worldNameToContext.has('')) + return; this._worldNameToContext.set('', this._runtime.createExecutionContext(this.domWindow(), this.domWindow(), { frameId: this._frameId, name: '', @@ -561,15 +581,6 @@ class Frame { for (const script of world._scriptsToEvaluateOnNewDocument) executionContext.evaluateScriptSafely(script); } - - const url = this.domWindow().location?.href; - if (url === 'about:blank' && !this._url) { - // Sometimes FrameTree is created too early, before the location has been set. - this._url = url; - this._frameTree.emit(FrameTree.Events.NavigationCommitted, this); - } - - this._updateJavaScriptDisabled(); } _updateJavaScriptDisabled() { @@ -628,10 +639,11 @@ class Frame { } class Worker { - constructor(frame, workerDebugger) { + constructor(frame, workerDebugger, onReady) { this._frame = frame; this._workerId = helper.generateId(); this._workerDebugger = workerDebugger; + this._initialized = false; workerDebugger.initialize('chrome://juggler/content/content/WorkerMain.js'); @@ -640,6 +652,12 @@ class Worker { sendMessage: obj => workerDebugger.postMessage(JSON.stringify(obj)), dispose: () => {}, }); + this._channel.register('worker', { + ready: () => { + this._initialized = true; + onReady(); + }, + }); this._workerDebuggerListener = { QueryInterface: ChromeUtils.generateQI([Ci.nsIWorkerDebuggerListener]), onMessage: msg => void this._channel._onMessage(JSON.parse(msg)), @@ -651,6 +669,10 @@ class Worker { workerDebugger.addListener(this._workerDebuggerListener); } + isInitialized() { + return this._initialized; + } + channel() { return this._channel; } diff --git a/browser_patches/firefox/juggler/content/PageAgent.js b/browser_patches/firefox/juggler/content/PageAgent.js index 7e6e072c76157..4edfc61a19c96 100644 --- a/browser_patches/firefox/juggler/content/PageAgent.js +++ b/browser_patches/firefox/juggler/content/PageAgent.js @@ -218,7 +218,7 @@ export class PageAgent { } _linkClicked(sync, anchorElement) { - if (anchorElement.ownerGlobal.docShell !== this._docShell) + if (anchorElement.documentGlobal.docShell !== this._docShell) return; this._browserPage.emit('pageLinkClicked', { phase: sync ? 'after' : 'before' }); } @@ -251,9 +251,9 @@ export class PageAgent { onWindowEvent(event) { if (event.type !== 'DOMContentLoaded' && event.type !== 'load') return; - if (!event.target.ownerGlobal) + if (!event.target.documentGlobal) return; - const docShell = event.target.ownerGlobal.docShell; + const docShell = event.target.documentGlobal.docShell; const frame = this._frameTree.frameForDocShell(docShell); if (!frame) return; @@ -273,7 +273,7 @@ export class PageAgent { } _onDocumentOpenLoad(document) { - const docShell = document.ownerGlobal.docShell; + const docShell = document.documentGlobal.docShell; const frame = this._frameTree.frameForDocShell(docShell); if (!frame) return; diff --git a/browser_patches/firefox/juggler/content/WorkerMain.js b/browser_patches/firefox/juggler/content/WorkerMain.js index 9be68851c59f3..99a6623e7623f 100644 --- a/browser_patches/firefox/juggler/content/WorkerMain.js +++ b/browser_patches/firefox/juggler/content/WorkerMain.js @@ -52,6 +52,7 @@ class RuntimeAgent { disposeObject: this._runtime.disposeObject.bind(this._runtime), }), ]; + channel.connect('worker').emit('ready'); } _onExecutionContextCreated(executionContext) { diff --git a/browser_patches/firefox/juggler/protocol/PageHandler.js b/browser_patches/firefox/juggler/protocol/PageHandler.js index cec3c08e28e4f..a4ab723611ae7 100644 --- a/browser_patches/firefox/juggler/protocol/PageHandler.js +++ b/browser_patches/firefox/juggler/protocol/PageHandler.js @@ -227,8 +227,8 @@ export class PageHandler { }); } - async ['Page.setViewportSize']({viewportSize, deviceScaleFactor}) { - await this._pageTarget.setViewportSize(viewportSize === null ? undefined : viewportSize, deviceScaleFactor); + async ['Page.setViewportSize']({viewportSize, deviceScaleFactor, screenSize, isMobile}) { + await this._pageTarget.setViewportSize(viewportSize === null ? undefined : viewportSize, deviceScaleFactor, screenSize, isMobile); } async ['Page.setZoom']({zoom}) { @@ -313,7 +313,7 @@ export class PageHandler { return await this._contentPage.send('adoptNode', options); } - async ['Page.screenshot']({ mimeType, clip, omitDeviceScaleFactor, quality = 80}) { + async ['Page.screenshot']({ mimeType, clip, omitDeviceScaleFactor, quality }) { const rect = new DOMRect(clip.x, clip.y, clip.width, clip.height); const browsingContext = this._pageTarget.linkedBrowser().browsingContext; @@ -349,7 +349,7 @@ export class PageHandler { } } - const win = browsingContext.topChromeWindow.ownerGlobal; + const win = browsingContext.topChromeWindow; const canvas = win.document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'); canvas.width = canvasWidth; canvas.height = canvasHeight; @@ -357,7 +357,8 @@ export class PageHandler { ctx.drawImage(snapshot, 0, 0); snapshot.close(); - if (mimeType === 'image/jpeg') { + if (mimeType === 'image/jpeg' || mimeType === 'image/webp') { + quality ??= mimeType === 'image/webp' ? 100 : 80; if (quality < 0 || quality > 100) throw new Error('Quality must be an integer value between 0 and 100; received ' + quality); quality /= 100; diff --git a/browser_patches/firefox/juggler/protocol/Protocol.js b/browser_patches/firefox/juggler/protocol/Protocol.js index 6aca7c22fced5..db4f203fbaebc 100644 --- a/browser_patches/firefox/juggler/protocol/Protocol.js +++ b/browser_patches/firefox/juggler/protocol/Protocol.js @@ -77,6 +77,8 @@ pageTypes.Size = { pageTypes.Viewport = { viewportSize: pageTypes.Size, deviceScaleFactor: t.Optional(t.Number), + screenSize: t.Optional(pageTypes.Size), + isMobile: t.Optional(t.Boolean), }; pageTypes.DOMQuad = { @@ -716,12 +718,14 @@ const Page = { wsid: t.String, opcode: t.Number, data: t.String, + timestamp: t.Number, }, 'webSocketFrameReceived': { frameId: t.String, wsid: t.String, opcode: t.Number, data: t.String, + timestamp: t.Number, }, 'screencastFrame': { data: t.String, @@ -755,6 +759,8 @@ const Page = { params: { viewportSize: t.Nullable(pageTypes.Size), deviceScaleFactor: t.Optional(t.Number), + screenSize: t.Optional(pageTypes.Size), + isMobile: t.Optional(t.Boolean), }, }, 'setZoom': { @@ -843,7 +849,7 @@ const Page = { }, 'screenshot': { params: { - mimeType: t.Enum(['image/png', 'image/jpeg']), + mimeType: t.Enum(['image/png', 'image/jpeg', 'image/webp']), clip: pageTypes.Clip, quality: t.Optional(t.Number), omitDeviceScaleFactor: t.Optional(t.Boolean), diff --git a/browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.cpp b/browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.cpp index 960294819da0d..38bc3ddcc9515 100644 --- a/browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.cpp +++ b/browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.cpp @@ -4,6 +4,8 @@ #include "HeadlessWindowCapturer.h" +#include + #include "api/video/i420_buffer.h" #include "HeadlessWidget.h" #include "libyuv.h" @@ -40,12 +42,9 @@ void HeadlessWindowCapturer::RegisterCaptureDataCallback(webrtc::VideoSinkInterf void HeadlessWindowCapturer::RegisterCaptureDataCallback(webrtc::RawVideoSinkInterface* dataCallback) { } -void HeadlessWindowCapturer::DeRegisterCaptureDataCallback(webrtc::VideoSinkInterface* dataCallback) { +void HeadlessWindowCapturer::DeRegisterCaptureDataCallback() { webrtc::CritScope lock2(&_callBackCs); - auto it = _dataCallBacks.find(dataCallback); - if (it != _dataCallBacks.end()) { - _dataCallBacks.erase(it); - } + _dataCallBacks.clear(); } void HeadlessWindowCapturer::RegisterRawFrameCallback(webrtc::RawFrameCallback* rawFrameCallback) { @@ -67,14 +66,6 @@ void HeadlessWindowCapturer::NotifyFrameCaptured(const webrtc::VideoFrame& frame dataCallBack->OnFrame(frame); } -int32_t HeadlessWindowCapturer::StopCaptureIfAllClientsClose() { - if (_dataCallBacks.empty()) { - return StopCapture(); - } else { - return 0; - } -} - int32_t HeadlessWindowCapturer::StartCapture(const webrtc::VideoCaptureCapability& capability) { mWindow->SetSnapshotListener([this] (RefPtr&& dataSurface){ if (!NS_IsInCompositorThread()) { @@ -90,11 +81,11 @@ int32_t HeadlessWindowCapturer::StartCapture(const webrtc::VideoCaptureCapabilit webrtc::VideoCaptureCapability frameInfo; frameInfo.width = dataSurface->GetSize().width; frameInfo.height = dataSurface->GetSize().height; -#if MOZ_LITTLE_ENDIAN() - frameInfo.videoType = VideoType::kARGB; -#else - frameInfo.videoType = VideoType::kBGRA; -#endif + if constexpr (std::endian::native == std::endian::little) { + frameInfo.videoType = VideoType::kARGB; + } else { + frameInfo.videoType = VideoType::kBGRA; + } { webrtc::CritScope lock2(&_callBackCs); @@ -115,16 +106,19 @@ int32_t HeadlessWindowCapturer::StartCapture(const webrtc::VideoCaptureCapabilit return; } -#if MOZ_LITTLE_ENDIAN() - const int conversionResult = libyuv::ARGBToI420( -#else - const int conversionResult = libyuv::BGRAToI420( -#endif - map.GetData(), map.GetStride(), - buffer->MutableDataY(), buffer->StrideY(), - buffer->MutableDataU(), buffer->StrideU(), - buffer->MutableDataV(), buffer->StrideV(), - width, height); + const int conversionResult = std::endian::native == std::endian::little ? libyuv::ARGBToI420( + map.GetData(), map.GetStride(), + buffer->MutableDataY(), buffer->StrideY(), + buffer->MutableDataU(), buffer->StrideU(), + buffer->MutableDataV(), buffer->StrideV(), + width, height + ) : libyuv::BGRAToI420( + map.GetData(), map.GetStride(), + buffer->MutableDataY(), buffer->StrideY(), + buffer->MutableDataU(), buffer->StrideU(), + buffer->MutableDataV(), buffer->StrideV(), + width, height + ); if (conversionResult != 0) { fprintf(stderr, "Failed to convert capture frame to I420: %d\n", conversionResult); return; diff --git a/browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.h b/browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.h index 66538444d30dd..371b604207e0f 100644 --- a/browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.h +++ b/browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.h @@ -26,9 +26,7 @@ class HeadlessWindowCapturer : public webrtc::VideoCaptureModuleEx { void RegisterCaptureDataCallback( webrtc::VideoSinkInterface* dataCallback) override; - void DeRegisterCaptureDataCallback( - webrtc::VideoSinkInterface* dataCallback) override; - int32_t StopCaptureIfAllClientsClose() override; + void DeRegisterCaptureDataCallback() override; void RegisterRawFrameCallback(webrtc::RawFrameCallback* rawFrameCallback) override; void RegisterCaptureDataCallback(webrtc::RawVideoSinkInterface* dataCallback) override; diff --git a/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp b/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp index 3e61e71a297e5..a8d2fd49913b2 100644 --- a/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp +++ b/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp @@ -4,6 +4,8 @@ #include "nsScreencastService.h" +#include + #include "gfxPlatform.h" #include "HeadlessWidget.h" #include "HeadlessWindowCapturer.h" @@ -212,17 +214,17 @@ class nsScreencastService::Session : public webrtc::RawFrameCallback { info.image_width = screenshotWidth; info.image_height = screenshotHeight; -#if MOZ_LITTLE_ENDIAN() - if (frameInfo.videoType == webrtc::VideoType::kARGB) - info.in_color_space = JCS_EXT_BGRA; - if (frameInfo.videoType == webrtc::VideoType::kBGRA) - info.in_color_space = JCS_EXT_ARGB; -#else - if (frameInfo.videoType == webrtc::VideoType::kARGB) - info.in_color_space = JCS_EXT_ARGB; - if (frameInfo.videoType == webrtc::VideoType::kBGRA) - info.in_color_space = JCS_EXT_BGRA; -#endif + if constexpr (std::endian::native == std::endian::little) { + if (frameInfo.videoType == webrtc::VideoType::kARGB) + info.in_color_space = JCS_EXT_BGRA; + if (frameInfo.videoType == webrtc::VideoType::kBGRA) + info.in_color_space = JCS_EXT_ARGB; + } else { + if (frameInfo.videoType == webrtc::VideoType::kARGB) + info.in_color_space = JCS_EXT_ARGB; + if (frameInfo.videoType == webrtc::VideoType::kBGRA) + info.in_color_space = JCS_EXT_BGRA; + } // # of color components in input image info.input_components = 4; diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diff index f5485ca04b46c..2703f59f58001 100644 --- a/browser_patches/firefox/patches/bootstrap.diff +++ b/browser_patches/firefox/patches/bootstrap.diff @@ -1,8 +1,8 @@ diff --git a/browser/app/winlauncher/LauncherProcessWin.cpp b/browser/app/winlauncher/LauncherProcessWin.cpp -index c63afe6dc5e00fadbc57ef556505a313728981f7..19d27fac991c44a3e8a6f28eb1b7aa51c30c1672 100644 +index 8337336dc894b44ea696bb780e448dfbdd8b6357..9eb83f33bb0415f28d1bcf66507d33d0cb9ad605 100644 --- a/browser/app/winlauncher/LauncherProcessWin.cpp +++ b/browser/app/winlauncher/LauncherProcessWin.cpp -@@ -20,6 +20,7 @@ +@@ -18,6 +18,7 @@ #include "mozilla/WinHeaderOnlyUtils.h" #include "nsWindowsHelpers.h" @@ -10,7 +10,7 @@ index c63afe6dc5e00fadbc57ef556505a313728981f7..19d27fac991c44a3e8a6f28eb1b7aa51 #include #include #include -@@ -492,8 +493,18 @@ Maybe LauncherMain(int& argc, wchar_t* argv[]) { +@@ -490,8 +491,18 @@ Maybe LauncherMain(int& argc, wchar_t* argv[]) { HANDLE stdHandles[] = {::GetStdHandle(STD_INPUT_HANDLE), ::GetStdHandle(STD_OUTPUT_HANDLE), ::GetStdHandle(STD_ERROR_HANDLE)}; @@ -31,7 +31,7 @@ index c63afe6dc5e00fadbc57ef556505a313728981f7..19d27fac991c44a3e8a6f28eb1b7aa51 DWORD creationFlags = CREATE_SUSPENDED | CREATE_UNICODE_ENVIRONMENT; diff --git a/browser/installer/allowed-dupes.mn b/browser/installer/allowed-dupes.mn -index 1f3a406c8714a65ec1437109921e862ff738bd0a..d3d90bf19771652af107bd79dac01929fe43320c 100644 +index 5a388458295a771c0a4e86d7230515e72bc207c2..10a82bb86a590e4c2534ed81d4d3b675baca33ec 100644 --- a/browser/installer/allowed-dupes.mn +++ b/browser/installer/allowed-dupes.mn @@ -66,6 +66,12 @@ browser/chrome/browser/builtin-addons/webcompat/shims/empty-shim.txt @@ -48,10 +48,10 @@ index 1f3a406c8714a65ec1437109921e862ff738bd0a..d3d90bf19771652af107bd79dac01929 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 36eafe35063f02fe3d4acaab24a08dc1b7b0ae24..33fe25fc507ff32b532c8e1d429b5bc05c8d6f94 100644 +index 83e52b260c380b8a4fdcb9146c36a048adffba68..3ab0c47c7153a4226cf1bf0543305365e84f5b14 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in -@@ -200,6 +200,9 @@ +@@ -204,6 +204,9 @@ @RESPATH@/chrome/remote.manifest #endif @@ -109,10 +109,10 @@ index 257e87fe0c618684eb4216c8028ac886ef2d5562..8c13f020100dad9bc4e093d50bd3a1f9 const transportProvider = { setListener(upgradeListener) { diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp -index a469a6fffc489a0927a748d347bf7bdde98570b4..f92cb8162ba6b93b04ae6b7a55ff8d964eb442e2 100644 +index e8b50c654849f00d968a43cffd99ef88116bd0c9..e1a54b40fb828dc6917bd4314cf3e27aa801e2a5 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp -@@ -117,8 +117,15 @@ struct ParamTraits +@@ -116,8 +116,11 @@ struct ParamTraits template <> struct ParamTraits @@ -121,16 +121,25 @@ index a469a6fffc489a0927a748d347bf7bdde98570b4..f92cb8162ba6b93b04ae6b7a55ff8d96 + : public mozilla::dom::WebIDLEnumSerializer {}; + +template <> -+struct ParamTraits -+ : public mozilla::dom::WebIDLEnumSerializer {}; -+ -+template <> +struct ParamTraits + : public mozilla::dom::WebIDLEnumSerializer {}; template <> struct ParamTraits -@@ -3355,6 +3362,32 @@ void BrowsingContext::DidSet(FieldIndex, +@@ -487,7 +490,11 @@ already_AddRefed BrowsingContext::CreateDetached( + + fields.Get() = true; + +- fields.Get() = TouchEventsOverride::None; ++ // Playwright: make sure touch events override is propagated to the nested ++ // browsing context. See https://bugzilla.mozilla.org/show_bug.cgi?id=2014330 ++ fields.Get() = ++ inherit ? inherit->GetTouchEventsOverrideInternal() : ++ TouchEventsOverride::None; + + fields.Get() = + inherit ? inherit->GetAllowJavascript() : true; +@@ -3555,6 +3562,15 @@ void BrowsingContext::DidSet(FieldIndex, }); } @@ -142,28 +151,11 @@ index a469a6fffc489a0927a748d347bf7bdde98570b4..f92cb8162ba6b93b04ae6b7a55ff8d96 + } + PresContextAffectingFieldChanged(); +} -+ -+void BrowsingContext::DidSet(FieldIndex, -+ dom::PrefersReducedMotionOverride aOldValue) { -+ MOZ_ASSERT(IsTop()); -+ if (PrefersReducedMotionOverride() == 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()); -@@ -3702,7 +3735,7 @@ void BrowsingContext::SetGeolocationServiceOverride( +@@ -3835,7 +3851,7 @@ void BrowsingContext::SetGeolocationServiceOverride( if (aGeolocationOverride.WasPassed()) { if (!mGeolocationServiceOverride) { mGeolocationServiceOverride = new nsGeolocationService(); @@ -173,10 +165,10 @@ index a469a6fffc489a0927a748d347bf7bdde98570b4..f92cb8162ba6b93b04ae6b7a55ff8d96 mGeolocationServiceOverride->Update(aGeolocationOverride.Value()); } else if (RefPtr serviceOverride = diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h -index e86ce5dd594315898c21e8b9016145358b026106..0aad51333679f94fe2cc28ad7f512e958297ee72 100644 +index 02abb6ab9562a7b41f4a95a6289c80da8d1176e8..ca04e2314cc16b3e3aa861bea3baaf153c3c274a 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h -@@ -212,11 +212,11 @@ struct EmbedderColorSchemes { +@@ -211,11 +211,11 @@ struct EmbedderColorSchemes { FIELD(HasScreenAreaOverride, bool) \ /* ScreenOrientation-related APIs */ \ FIELD(CurrentOrientationAngle, float) \ @@ -190,32 +182,27 @@ index e86ce5dd594315898c21e8b9016145358b026106..0aad51333679f94fe2cc28ad7f512e95 FIELD(EmbedderElementType, Maybe) \ FIELD(MessageManagerGroup, nsString) \ FIELD(MaxTouchPointsOverride, uint8_t) \ -@@ -259,6 +259,9 @@ struct EmbedderColorSchemes { +@@ -260,6 +260,8 @@ struct EmbedderColorSchemes { * embedder element. */ \ FIELD(EmbedderColorSchemes, EmbedderColorSchemes) \ FIELD(DisplayMode, dom::DisplayMode) \ + /* playwright addition */ \ -+ FIELD(PrefersReducedMotionOverride, dom::PrefersReducedMotionOverride) \ + FIELD(PrefersContrastOverride, dom::PrefersContrastOverride) \ /* The number of entries added to the session history because of this \ * browsing context. */ \ FIELD(HistoryEntryCount, uint32_t) \ -@@ -1110,6 +1113,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -1118,6 +1120,10 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { return Top()->GetAnimationsPlayBackRateMultiplier(); } -+ dom::PrefersReducedMotionOverride PrefersReducedMotionOverride() const { -+ return GetPrefersReducedMotionOverride(); -+ } -+ + dom::PrefersContrastOverride PrefersContrastOverride() const { + return GetPrefersContrastOverride(); + } + bool IsInBFCache() const; - - bool AllowJavascript() const { return GetAllowJavascript(); } -@@ -1291,6 +1302,11 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { + bool IsEnteringBFCache() const { return mIsEnteringBFCache; } + void DeactivateDocuments(); +@@ -1320,6 +1326,11 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { return IsTop(); } @@ -227,7 +214,7 @@ index e86ce5dd594315898c21e8b9016145358b026106..0aad51333679f94fe2cc28ad7f512e95 bool CanSet(FieldIndex, dom::ForcedColorsOverride, ContentParent*) { return IsTop(); -@@ -1319,6 +1335,9 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -1356,6 +1367,9 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { void DidSet(FieldIndex, double aOldValue); @@ -237,36 +224,23 @@ index e86ce5dd594315898c21e8b9016145358b026106..0aad51333679f94fe2cc28ad7f512e95 template void WalkPresContexts(Callback&&); void PresContextAffectingFieldChanged(); -@@ -1327,6 +1346,15 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { - - void DidSet(FieldIndex, nsString&& aOldValue); - -+ bool CanSet(FieldIndex, -+ dom::PrefersReducedMotionOverride, ContentParent*) { -+ return IsTop(); -+ } -+ -+ void DidSet(FieldIndex, -+ dom::PrefersReducedMotionOverride aOldValue); -+ -+ - void DidSet(FieldIndex, nsString&& aOldValue); - - bool CanSet(FieldIndex, bool, ContentParent*) { diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp -index 43e87830dd3c9b4083b66d87856fcc30f8ed42c6..a984087b80e0da01f51edbc1d09dc46304996963 100644 +index 6a5e8fba0a0cd96834ebcbd9f8b5ba8ea5266972..f5a174d14ba1e6f8482956dd18da5bd4651511b1 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp -@@ -272,6 +272,8 @@ void CanonicalBrowsingContext::ReplacedBy( +@@ -303,6 +303,11 @@ void CanonicalBrowsingContext::ReplacedBy( txn.SetInnerSizeSpoofedForRFP(GetInnerSizeSpoofedForRFP()); txn.SetIPAddressSpace(GetIPAddressSpace()); txn.SetParentalControlsEnabled(GetParentalControlsEnabled()); + txn.SetPrefersReducedMotionOverride(GetPrefersReducedMotionOverride()); + txn.SetForcedColorsOverride(GetForcedColorsOverride()); ++ // Playwright: make sure touch events override is propagated to the nested ++ // browsing context. See https://bugzilla.mozilla.org/show_bug.cgi?id=2014330 ++ txn.SetTouchEventsOverrideInternal(GetTouchEventsOverrideInternal()); if (!GetLanguageOverride().IsEmpty()) { // Reapply language override to update the corresponding realm. -@@ -1885,6 +1887,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, +@@ -1946,6 +1951,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, (void)SetIsCaptivePortalTab(true); } @@ -280,10 +254,10 @@ index 43e87830dd3c9b4083b66d87856fcc30f8ed42c6..a984087b80e0da01f51edbc1d09dc463 } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp -index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62e9a1c026 100644 +index 69d45a59b43350ca86a5a7740c6ebf5ed4e5926d..46cc80b5c8e4d8c866f2fdfab66508aacc9dafd0 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp -@@ -17,6 +17,12 @@ +@@ -16,6 +16,12 @@ #endif #include "nsDeviceContext.h" @@ -296,7 +270,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 #include "mozilla/Attributes.h" #include "mozilla/AutoRestore.h" #include "mozilla/BasePrincipal.h" -@@ -64,6 +70,7 @@ +@@ -63,6 +69,7 @@ #include "mozilla/dom/DocGroup.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/FragmentDirective.h" @@ -304,7 +278,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 #include "mozilla/dom/HTMLAnchorElement.h" #include "mozilla/dom/HTMLIFrameElement.h" #include "mozilla/dom/Navigation.h" -@@ -96,6 +103,7 @@ +@@ -95,6 +102,7 @@ #include "mozilla/dom/DocumentBinding.h" #include "mozilla/glean/DocshellMetrics.h" #include "mozilla/ipc/ProtocolUtils.h" @@ -312,7 +286,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 #include "mozilla/net/DocumentChannel.h" #include "mozilla/net/DocumentChannelChild.h" #include "mozilla/net/ParentChannelWrapper.h" -@@ -120,6 +128,7 @@ +@@ -119,6 +127,7 @@ #include "nsIDocumentViewer.h" #include "mozilla/dom/Document.h" #include "nsHTMLDocument.h" @@ -320,7 +294,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 #include "nsIDocumentLoaderFactory.h" #include "nsIDOMWindow.h" #include "nsIEditingSession.h" -@@ -216,6 +225,7 @@ +@@ -214,6 +223,7 @@ #include "nsGlobalWindowInner.h" #include "nsGlobalWindowOuter.h" #include "nsJSEnvironment.h" @@ -328,7 +302,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 #include "nsNetCID.h" #include "nsNetUtil.h" #include "nsObjectLoadingContent.h" -@@ -357,6 +367,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, +@@ -353,6 +363,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, mAllowDNSPrefetch(true), mAllowWindowControl(true), mCSSErrorReportingEnabled(false), @@ -343,7 +317,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 mAllowAuth(mItemType == typeContent), mAllowKeywordFixup(false), mDisableMetaRefreshWhenInactive(false), -@@ -3107,6 +3125,174 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { +@@ -2957,6 +2975,174 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { return NS_OK; } @@ -518,7 +492,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 NS_IMETHODIMP nsDocShell::GetIsNavigating(bool* aOut) { *aOut = mIsNavigating; -@@ -4895,7 +5081,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { +@@ -4624,7 +4810,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { } void nsDocShell::ActivenessMaybeChanged() { @@ -527,18 +501,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 if (RefPtr presShell = GetPresShell()) { presShell->ActivenessMaybeChanged(); } -@@ -7054,6 +7240,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, - return false; // no entry to save into - } - -+ if (mDisallowBFCache) { -+ return false; -+ } -+ - MOZ_ASSERT(!mozilla::SessionHistoryInParent(), - "mOSHE cannot be non-null with SHIP"); - nsCOMPtr viewer = mOSHE->GetDocumentViewer(); -@@ -8755,6 +8945,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { +@@ -7625,6 +7811,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { true, // aForceNoOpener getter_AddRefs(newBC)); MOZ_ASSERT(!newBC); @@ -551,7 +514,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 return rv; } -@@ -10164,6 +10360,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, +@@ -8854,6 +9046,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, attrs.SetFirstPartyDomain(isTopLevelDoc, aLoadState->URI()); nsCOMPtr req; @@ -568,7 +531,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 rv = DoURILoad(aLoadState, aCacheKey, getter_AddRefs(req)); if (NS_SUCCEEDED(rv)) { -@@ -13835,6 +14041,9 @@ class OnLinkClickEvent : public Runnable { +@@ -11985,6 +12187,9 @@ class OnLinkClickEvent : public Runnable { mHandler->OnLinkClickSync(mContent, mLoadState, mNoOpenerImplied, mTriggeringPrincipal); } @@ -578,7 +541,7 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 return NS_OK; } -@@ -13952,6 +14161,8 @@ nsresult nsDocShell::OnLinkClick( +@@ -12102,6 +12307,8 @@ nsresult nsDocShell::OnLinkClick( nsCOMPtr ev = new OnLinkClickEvent( this, aContent, loadState, noOpenerImplied, aTriggeringPrincipal); @@ -588,18 +551,18 @@ index b87acffba7db71c1312194e11d2339aae3252103..fe1d61f2ae10b452b012c6d4072bfe62 } diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h -index 7ca79a65b91dcd317d852ace29786f4d139d60ed..4070b70f35f401a66c21f05db1c143caf78ee560 100644 +index ac51e58b454bf97aa475416978f97b9dbca45290..52dd403b39d5e38c055873aff55001eb565f2df4 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h -@@ -16,6 +16,7 @@ - #include "mozilla/WeakPtr.h" +@@ -15,6 +15,7 @@ #include "mozilla/dom/BrowsingContext.h" #include "mozilla/dom/NavigationBinding.h" + #include "mozilla/dom/SessionHistoryEntry.h" +#include "mozilla/dom/Element.h" #include "mozilla/dom/WindowProxyHolder.h" #include "nsCOMPtr.h" #include "nsCharsetSource.h" -@@ -85,6 +86,7 @@ class nsCommandManager; +@@ -84,6 +85,7 @@ class nsCommandManager; class nsDocShellEditorData; class nsDOMNavigationTiming; class nsDSURIContentListener; @@ -607,7 +570,7 @@ index 7ca79a65b91dcd317d852ace29786f4d139d60ed..4070b70f35f401a66c21f05db1c143ca class nsGlobalWindowOuter; class FramingChecker; -@@ -424,6 +426,15 @@ class nsDocShell final : public nsDocLoader, +@@ -397,6 +399,15 @@ class nsDocShell final : public nsDocLoader, void SetWillChangeProcess() { mWillChangeProcess = true; } bool WillChangeProcess() { return mWillChangeProcess; } @@ -623,7 +586,7 @@ index 7ca79a65b91dcd317d852ace29786f4d139d60ed..4070b70f35f401a66c21f05db1c143ca // Creates a real network channel (not a DocumentChannel) using the specified // parameters. // Used by nsDocShell when not using DocumentChannel, by DocumentLoadListener -@@ -1084,6 +1095,8 @@ class nsDocShell final : public nsDocLoader, +@@ -987,6 +998,8 @@ class nsDocShell final : public nsDocLoader, bool CSSErrorReportingEnabled() const { return mCSSErrorReportingEnabled; } @@ -632,7 +595,7 @@ index 7ca79a65b91dcd317d852ace29786f4d139d60ed..4070b70f35f401a66c21f05db1c143ca // 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 -@@ -1415,6 +1428,16 @@ class nsDocShell final : public nsDocLoader, +@@ -1298,6 +1311,16 @@ class nsDocShell final : public nsDocLoader, bool mAllowDNSPrefetch : 1; bool mAllowWindowControl : 1; bool mCSSErrorReportingEnabled : 1; @@ -650,10 +613,10 @@ index 7ca79a65b91dcd317d852ace29786f4d139d60ed..4070b70f35f401a66c21f05db1c143ca bool mAllowKeywordFixup : 1; bool mDisableMetaRefreshWhenInactive : 1; diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl -index 888d99bae849fcd2988388489edcfc56443d3e23..75d8bd5e9f20b4ea4d2b198c13ec3c1bba63537f 100644 +index 4aa56b4ce16915d334f32c18953604765699e05a..ef80a46511d870c909dda6182e332c155a8e250c 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl -@@ -44,6 +44,7 @@ interface nsIURI; +@@ -43,6 +43,7 @@ interface nsIURI; interface nsIChannel; interface nsIPolicyContainer; interface nsIDocumentViewer; @@ -661,7 +624,7 @@ index 888d99bae849fcd2988388489edcfc56443d3e23..75d8bd5e9f20b4ea4d2b198c13ec3c1b interface nsIEditor; interface nsIEditingSession; interface nsIInputStream; -@@ -719,6 +720,41 @@ interface nsIDocShell : nsIDocShellTreeItem +@@ -692,6 +693,41 @@ interface nsIDocShell : nsIDocShellTreeItem */ void synchronizeLayoutHistoryState(); @@ -704,10 +667,10 @@ index 888d99bae849fcd2988388489edcfc56443d3e23..75d8bd5e9f20b4ea4d2b198c13ec3c1b * 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 b837e66d4fd5b6a96ad3d9c35f8e50e911cd168b..bfc4d2d58af06169cdb1167a38507abdaab3d608 100644 +index 328b7524810322561700347fa7f26403897635a8..6b98c45166075950aea3e8f23044ca5975862c49 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp -@@ -3812,6 +3812,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { +@@ -3696,6 +3696,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { } void Document::ApplySettingsFromCSP(bool aSpeculative) { @@ -717,7 +680,7 @@ index b837e66d4fd5b6a96ad3d9c35f8e50e911cd168b..bfc4d2d58af06169cdb1167a38507abd nsresult rv = NS_OK; if (!aSpeculative) { nsIContentSecurityPolicy* csp = PolicyContainer::GetCSP(mPolicyContainer); -@@ -3900,6 +3903,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { +@@ -3784,6 +3787,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { MOZ_ASSERT(mPolicyContainer, "Policy container must be initialized before CSP!"); @@ -729,7 +692,7 @@ index b837e66d4fd5b6a96ad3d9c35f8e50e911cd168b..bfc4d2d58af06169cdb1167a38507abd // If this is a data document - no need to set CSP. if (mLoadedAsData) { return NS_OK; -@@ -4818,6 +4826,10 @@ bool Document::HasFocus(ErrorResult& rv) const { +@@ -4739,6 +4747,10 @@ bool Document::HasFocus(ErrorResult& rv) const { return false; } @@ -740,60 +703,11 @@ index b837e66d4fd5b6a96ad3d9c35f8e50e911cd168b..bfc4d2d58af06169cdb1167a38507abd if (!fm->IsInActiveWindow(bc)) { return false; } -@@ -20473,6 +20485,35 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { - return PreferenceSheet::PrefsFor(*this).mColorScheme; - } - -+bool Document::PrefersReducedMotion() const { -+ auto* docShell = static_cast(GetDocShell()); -+ nsIDocShell::ReducedMotionOverride reducedMotion; -+ if (docShell && docShell->GetReducedMotionOverride(&reducedMotion) == NS_OK && -+ reducedMotion != nsIDocShell::REDUCED_MOTION_OVERRIDE_NONE) { -+ switch (reducedMotion) { -+ case nsIDocShell::REDUCED_MOTION_OVERRIDE_REDUCE: -+ return true; -+ case nsIDocShell::REDUCED_MOTION_OVERRIDE_NO_PREFERENCE: -+ return false; -+ case nsIDocShell::REDUCED_MOTION_OVERRIDE_NONE: -+ break; -+ }; -+ } -+ -+ if (auto* bc = GetBrowsingContext()) { -+ switch (bc->Top()->PrefersReducedMotionOverride()) { -+ case dom::PrefersReducedMotionOverride::Reduce: -+ return true; -+ case dom::PrefersReducedMotionOverride::No_preference: -+ return false; -+ case dom::PrefersReducedMotionOverride::None: -+ break; -+ } -+ } -+ -+ return LookAndFeel::GetInt(LookAndFeel::IntID::PrefersReducedMotion, 0) == 1; -+} -+ - bool Document::HasRecentlyStartedForegroundLoads() { - if (!sLoadingForegroundTopLevelContentDocument) { - return false; -diff --git a/dom/base/Document.h b/dom/base/Document.h -index a902c1ac14dd5a3345695ee64845abe754abc112..60b6e8acce1c430133393d8c68be32d65a158e9a 100644 ---- a/dom/base/Document.h -+++ b/dom/base/Document.h -@@ -4395,6 +4395,8 @@ class Document : public nsINode, - // color-scheme meta tag. - ColorScheme DefaultColorScheme() const; - -+ bool PrefersReducedMotion() const; -+ - static bool HasRecentlyStartedForegroundLoads(); - - static bool AutomaticStorageAccessPermissionCanBeGranted( diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp -index df1ff164347bc1672c36e87184b2804ee0712537..56543649b9a6ff6f5b0f961cd26c4ca3d125399f 100644 +index 2f945e2f1a80524337c21cba7aee9b6cf4f70dbf..3ee7a92aff13c4f82bf792e709ae1c06456d4ccc 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp -@@ -2340,7 +2340,8 @@ bool Navigator::Webdriver() { +@@ -2370,7 +2370,8 @@ bool Navigator::Webdriver() { } #endif @@ -804,10 +718,10 @@ index df1ff164347bc1672c36e87184b2804ee0712537..56543649b9a6ff6f5b0f961cd26c4ca3 AutoplayPolicy Navigator::GetAutoplayPolicy(AutoplayPolicyMediaType aType) { diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp -index c0db239852ce2d8d28a9abb6cf2c3abdf4b9896a..a2911baa33ac2868543d4d7fc3d93305993da705 100644 +index 8f53fc6dbe9058bad535ee704b9184932cdbaf4c..6a470df22ff8134ef2206c650413a0a4394aca38 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp -@@ -9769,6 +9769,7 @@ Result nsContentUtils::SynthesizeMouseEvent( +@@ -9790,6 +9790,7 @@ Result nsContentUtils::SynthesizeMouseEvent( EventMessage msg; Maybe exitFrom; bool contextMenuKey = false; @@ -815,7 +729,7 @@ index c0db239852ce2d8d28a9abb6cf2c3abdf4b9896a..a2911baa33ac2868543d4d7fc3d93305 if (aType.EqualsLiteral("mousedown")) { msg = eMouseDown; } else if (aType.EqualsLiteral("mouseup")) { -@@ -9795,13 +9796,26 @@ Result nsContentUtils::SynthesizeMouseEvent( +@@ -9816,13 +9817,26 @@ Result nsContentUtils::SynthesizeMouseEvent( msg = eMouseHitTest; } else if (aType.EqualsLiteral("MozMouseExploreByTouch")) { msg = eMouseExploreByTouch; @@ -843,7 +757,7 @@ index c0db239852ce2d8d28a9abb6cf2c3abdf4b9896a..a2911baa33ac2868543d4d7fc3d93305 if (MOZ_UNLIKELY(aOptions.mIsWidgetEventSynthesized)) { MOZ_ASSERT_UNREACHABLE( "The event shouldn't be dispatched as a synthesized event"); -@@ -9829,6 +9843,7 @@ Result nsContentUtils::SynthesizeMouseEvent( +@@ -9850,6 +9864,7 @@ Result nsContentUtils::SynthesizeMouseEvent( mozilla::widget::AutoSynthesizedEventCallbackNotifier notifier(callback); WidgetMouseEvent& mouseOrPointerEvent = @@ -851,19 +765,19 @@ index c0db239852ce2d8d28a9abb6cf2c3abdf4b9896a..a2911baa33ac2868543d4d7fc3d93305 pointerEvent.isSome() ? pointerEvent.ref() : mouseEvent.ref(); mouseOrPointerEvent.pointerId = aMouseEventData.mIdentifier; mouseOrPointerEvent.mModifiers = -@@ -9850,6 +9865,7 @@ Result nsContentUtils::SynthesizeMouseEvent( +@@ -9875,6 +9890,7 @@ Result nsContentUtils::SynthesizeMouseEvent( aOptions.mIsDOMEventSynthesized; - mouseOrPointerEvent.mExitFrom = exitFrom; + mouseOrPointerEvent.mExitFrom = std::move(exitFrom); mouseOrPointerEvent.mCallbackId = notifier.SaveCallback(); + mouseOrPointerEvent.convertToPointer = aOptions.mJugglerConvertToPointer; nsPresContext* presContext = aPresShell->GetPresContext(); if (!presContext) { diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp -index 1a373169b3be65f45571eff08879efe1127c3fdf..f972450bc3f4566a8ab29dad5269f3451a286392 100644 +index a2af624fec7930cfd78d7e59516007fc9ac2833b..365d29520195e907515a4971da3ef6fdb18a4168 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp -@@ -1840,6 +1840,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, +@@ -1875,6 +1875,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, (GetActiveBrowsingContext() == newRootBrowsingContext); } @@ -874,7 +788,7 @@ index 1a373169b3be65f45571eff08879efe1127c3fdf..f972450bc3f4566a8ab29dad5269f345 // Exit fullscreen if a website focuses another window if (StaticPrefs::full_screen_api_exit_on_windowRaise() && !isElementInActiveWindow && (aFlags & FLAG_RAISE)) { -@@ -2401,6 +2405,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2436,6 +2440,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, bool aIsLeavingDocument, bool aAdjustWidget, bool aRemainActive, Element* aElementToFocus, uint64_t aActionId) { @@ -882,7 +796,7 @@ index 1a373169b3be65f45571eff08879efe1127c3fdf..f972450bc3f4566a8ab29dad5269f345 LOGFOCUS(("<>", aActionId)); // hold a reference to the focused content, which may be null -@@ -2444,6 +2449,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2479,6 +2484,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, return true; } @@ -894,7 +808,7 @@ index 1a373169b3be65f45571eff08879efe1127c3fdf..f972450bc3f4566a8ab29dad5269f345 // Keep a ref to presShell since dispatching the DOM event may cause // the document to be destroyed. RefPtr presShell = docShell->GetPresShell(); -@@ -3143,7 +3153,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, +@@ -3187,7 +3197,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, } } @@ -906,10 +820,10 @@ index 1a373169b3be65f45571eff08879efe1127c3fdf..f972450bc3f4566a8ab29dad5269f345 // 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 81c0df391ec757f310b73885d4dab2620400abb8..406b3d96f1fe0ebe8fa626c26c700e0a897b3813 100644 +index f8428e5926fbd43aa66667dabe009c3b455883d8..39d0fae07570dfe72db7f4518c61185a315a3074 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp -@@ -2515,10 +2515,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, +@@ -2539,10 +2539,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, }(); if (!isAboutBlankInChromeDocshell) { @@ -930,7 +844,7 @@ index 81c0df391ec757f310b73885d4dab2620400abb8..406b3d96f1fe0ebe8fa626c26c700e0a } } -@@ -2638,6 +2644,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() { +@@ -2662,6 +2668,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() { } } @@ -951,10 +865,10 @@ index 81c0df391ec757f310b73885d4dab2620400abb8..406b3d96f1fe0ebe8fa626c26c700e0a void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) { diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h -index 4eadbdaef2e2a6c8fb980b715bcd7f0b14084314..b28a9b339d22c44bc95221324ca64b892cafa40d 100644 +index 6b29e4a8854729ed7919b1e6e83871d7a15d3f7d..5980d18660df8e7a731ec0ce034452d8d638d5a7 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h -@@ -312,6 +312,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, +@@ -302,6 +302,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, // Outer windows only. void DispatchDOMWindowCreated(); @@ -963,10 +877,10 @@ index 4eadbdaef2e2a6c8fb980b715bcd7f0b14084314..b28a9b339d22c44bc95221324ca64b89 // Outer windows only. virtual void EnsureSizeAndPositionUpToDate() override; diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp -index b99f4aa5507ea5414346156d85f5b54353915e7c..b06b512688cc77f30b1cb5398f260d3cea713fdc 100644 +index 361f78eb02c6e567c77738f0e0f65085fa147c04..e59d8a06bbc84cf7cd6360170816a34247a7fee4 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp -@@ -1536,6 +1536,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, +@@ -1622,6 +1622,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, mozilla::GetBoxQuadsFromWindowOrigin(this, aOptions, aResult, aRv); } @@ -1014,8 +928,8 @@ index b99f4aa5507ea5414346156d85f5b54353915e7c..b06b512688cc77f30b1cb5398f260d3c + } + presShell->ScrollFrameIntoView( + primaryFrame, Some(rect), -+ ScrollAxis(WhereToScroll::Center, WhenToScroll::IfNotFullyVisible), -+ ScrollAxis(WhereToScroll::Center, WhenToScroll::IfNotFullyVisible), ++ AxisScrollParams(WhereToScroll::Center, WhenToScroll::IfNotFullyVisible), ++ AxisScrollParams(WhereToScroll::Center, WhenToScroll::IfNotFullyVisible), + ScrollFlags::ScrollOverflowHidden); + // If a _visual_ scroll update is pending, cancel it; otherwise, it will + // clobber next scroll (e.g. subsequent window.scrollTo(0, 0) wlll break). @@ -1029,10 +943,10 @@ index b99f4aa5507ea5414346156d85f5b54353915e7c..b06b512688cc77f30b1cb5398f260d3c DOMQuad& aQuad, const GeometryNode& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h -index 169c7149364a92d03fa360fcafe71941023d339c..fd53ee27538ce8e721000dbe78a1b94bee20c67f 100644 +index bd8c0993aacd8f88ee2970541ac074a0f11969ef..b3ebfe9a8480e04284d2d12527480d03b1388c9b 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h -@@ -2518,6 +2518,10 @@ class nsINode : public mozilla::dom::EventTarget { +@@ -2509,6 +2509,10 @@ class nsINode : public mozilla::dom::EventTarget { nsTArray>& aResult, ErrorResult& aRv); @@ -1044,22 +958,13 @@ index 169c7149364a92d03fa360fcafe71941023d339c..fd53ee27538ce8e721000dbe78a1b94b DOMQuad& aQuad, const TextOrElementOrDocument& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/chrome-webidl/BrowsingContext.webidl b/dom/chrome-webidl/BrowsingContext.webidl -index d80abcf58e0c684487772f1f85f4100a27eeba14..fd4fbce8c9cdf4556188ec40919ee96abcdb5009 100644 +index d0508a8c29e5bd008213f781beb8eb1fcb458fb8..518580aa7a2eb355f690d904d091e80c34a98912 100644 --- a/dom/chrome-webidl/BrowsingContext.webidl +++ b/dom/chrome-webidl/BrowsingContext.webidl -@@ -63,6 +63,26 @@ enum ForcedColorsOverride { - "active", +@@ -72,6 +72,17 @@ enum PrefersReducedMotionOverride { + "no-preference", }; -+/** -+ * CSS prefers-reduced-motion values. -+ */ -+enum PrefersReducedMotionOverride { -+ "none", -+ "reduce", -+ "no-preference", -+}; -+ +/** + * CSS prefers-contrast values. + */ @@ -1074,24 +979,60 @@ index d80abcf58e0c684487772f1f85f4100a27eeba14..fd4fbce8c9cdf4556188ec40919ee96a /** * Allowed overrides of platform/pref default behaviour for touch events. */ -@@ -246,6 +266,12 @@ interface BrowsingContext { +@@ -258,6 +269,9 @@ interface BrowsingContext { // Animation playbackRate multiplier, for Devtools [SetterThrows] attribute double animationsPlayBackRateMultiplier; -+ // Reduced-Motion simulation, for DevTools. -+ [SetterThrows] attribute PrefersReducedMotionOverride prefersReducedMotionOverride; -+ + // Contrast simulation, for DevTools. + [SetterThrows] attribute PrefersContrastOverride prefersContrastOverride; + /** * 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/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp +index 4fe9337e868911439c92e62dce20dcf3e6cd4f77..dcda39bb4190af115b0d9edd311f9b299e93ef11 100644 +--- a/dom/events/EventStateManager.cpp ++++ b/dom/events/EventStateManager.cpp +@@ -2049,6 +2049,25 @@ static BrowserParent* GetBrowserParentAncestor(BrowserParent* aBrowserParent) { + return bbp->Manager(); + } + ++// Playwright: automation can move the mouse between different top-level ++// windows while expecting the previous window to keep its hover state. ++// Suppress the old remote's synthesized exit for that cross-window handoff. ++// See https://github.com/microsoft/playwright/issues/40562 ++static bool PlaywrightSuppressMouseExit( ++ const WidgetMouseEvent* aMouseEvent, BrowserParent* aRemoteTarget, ++ BrowserParent* aOldRemoteTarget) { ++ if (!aMouseEvent->mFlags.mIsSynthesizedForTests || !aRemoteTarget || ++ !aOldRemoteTarget) { ++ return false; ++ } ++ ++ nsCOMPtr remoteTopLevelWidget = aRemoteTarget->GetTopLevelWidget(); ++ nsCOMPtr oldRemoteTopLevelWidget = ++ aOldRemoteTarget->GetTopLevelWidget(); ++ return remoteTopLevelWidget && oldRemoteTopLevelWidget && ++ remoteTopLevelWidget != oldRemoteTopLevelWidget; ++} ++ + static void DispatchCrossProcessMouseExitEvents(WidgetMouseEvent* aMouseEvent, + BrowserParent* aRemoteTarget, + BrowserParent* aStopAncestor, +@@ -2172,7 +2191,7 @@ void EventStateManager::DispatchCrossProcessEvent(WidgetEvent* aEvent, + if (mouseEvent->mReason == WidgetMouseEvent::eReal && + remote != oldRemote) { + MOZ_ASSERT(mouseEvent->mMessage != eMouseExitFromWidget); +- if (oldRemote) { ++ if (oldRemote && !PlaywrightSuppressMouseExit(mouseEvent, remote, oldRemote)) { + BrowserParent* commonAncestor = + nsContentUtils::GetCommonBrowserParentAncestor(remote, oldRemote); + if (commonAncestor == oldRemote) { diff --git a/dom/fetch/FetchService.cpp b/dom/fetch/FetchService.cpp -index 14c8fb1a2657d0880666acf365223baeb1b399f3..aa8801e345b1653b22316e9fb57b5677c85676c7 100644 +index 180065668131acf3738117c84b6a11117fcb6979..a4a77ca8e006fb298769270bb3342ff48616acb4 100644 --- a/dom/fetch/FetchService.cpp +++ b/dom/fetch/FetchService.cpp -@@ -267,6 +267,14 @@ RefPtr FetchService::FetchInstance::Fetch() { +@@ -266,6 +266,14 @@ RefPtr FetchService::FetchInstance::Fetch() { net::ClassificationFlags({0, 0}) // TrackingFlags ); @@ -1107,22 +1048,35 @@ index 14c8fb1a2657d0880666acf365223baeb1b399f3..aa8801e345b1653b22316e9fb57b5677 auto& args = mArgs.as(); mFetchDriver->SetWorkerScript(args.mWorkerScript); diff --git a/dom/geolocation/Geolocation.cpp b/dom/geolocation/Geolocation.cpp -index 001d064b2d94fa5a4bf22e8b268e2ccafe628f73..ef8353a10443c90aa5f5a37a2948c82c11143a16 100644 +index 20a3eded3ad1af3bdfde461c26297b10d115cd9c..323900e22a195abd3262f89d70693ad0e35b5f2d 100644 --- a/dom/geolocation/Geolocation.cpp +++ b/dom/geolocation/Geolocation.cpp -@@ -393,7 +393,10 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { +@@ -119,8 +119,12 @@ class nsGeolocationRequest final : public ContentPermissionRequestBase, + + NS_IMETHOD GetIgnoreAllowSitePermission( + bool* aIgnoreAllowSitePermission) override { ++ RefPtr gs = ++ nsGeolocationService::GetGeolocationService( ++ mLocator->GetBrowsingContext()); + *aIgnoreAllowSitePermission = +- mBehavior != geolocation::SystemGeolocationPermissionBehavior::NoPrompt; ++ mBehavior != geolocation::SystemGeolocationPermissionBehavior::NoPrompt && ++ !gs->IsOverride(); return NS_OK; } +@@ -409,7 +413,9 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { + self->Cancel(); + }; + - if (mBehavior != SystemGeolocationPermissionBehavior::NoPrompt) { + RefPtr gs = nsGeolocationService::GetGeolocationService( + mLocator->GetBrowsingContext()); -+ + if (mBehavior != SystemGeolocationPermissionBehavior::NoPrompt && !gs->IsOverride()) { // Asynchronously present the system dialog or open system preferences // (RequestGeolocationPermissionFromUser will know which to do), and wait // for the permission to change or the request to be canceled. If the -@@ -425,8 +428,6 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { +@@ -433,8 +439,6 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { return NS_OK; } @@ -1131,7 +1085,7 @@ index 001d064b2d94fa5a4bf22e8b268e2ccafe628f73..ef8353a10443c90aa5f5a37a2948c82c bool canUseCache = false; CachedPositionAndAccuracy lastPosition = gs->GetCachedPosition(); if (lastPosition.position) { -@@ -713,11 +714,16 @@ NS_INTERFACE_MAP_END +@@ -721,11 +725,16 @@ NS_INTERFACE_MAP_END NS_IMPL_ADDREF(nsGeolocationService) NS_IMPL_RELEASE(nsGeolocationService) @@ -1149,7 +1103,7 @@ index 001d064b2d94fa5a4bf22e8b268e2ccafe628f73..ef8353a10443c90aa5f5a37a2948c82c if (XRE_IsContentProcess()) { return NS_OK; } -@@ -796,6 +802,10 @@ nsresult nsGeolocationService::Init() { +@@ -804,6 +813,10 @@ nsresult nsGeolocationService::Init() { return NS_OK; } @@ -1160,7 +1114,7 @@ index 001d064b2d94fa5a4bf22e8b268e2ccafe628f73..ef8353a10443c90aa5f5a37a2948c82c nsGeolocationService::~nsGeolocationService() = default; NS_IMETHODIMP -@@ -939,6 +949,10 @@ bool nsGeolocationService::HighAccuracyRequested() { +@@ -947,6 +960,10 @@ bool nsGeolocationService::HighAccuracyRequested() { } void nsGeolocationService::UpdateAccuracy(bool aForceHigh) { @@ -1172,10 +1126,10 @@ index 001d064b2d94fa5a4bf22e8b268e2ccafe628f73..ef8353a10443c90aa5f5a37a2948c82c if (XRE_IsContentProcess()) { diff --git a/dom/geolocation/Geolocation.h b/dom/geolocation/Geolocation.h -index d46e2e88b121688f62bbd43755791a077cfa1fe8..e69d62ffb4e732137b7a0ec0385358f3347630f3 100644 +index 2194983e91bad4d6d54c1543de799aed09a336df..79c0e97ad80784dbcca3218356b7d15531771a15 100644 --- a/dom/geolocation/Geolocation.h +++ b/dom/geolocation/Geolocation.h -@@ -64,7 +64,7 @@ class nsGeolocationService final : public nsIGeolocationUpdate, +@@ -63,7 +63,7 @@ class nsGeolocationService final : public nsIGeolocationUpdate, nsGeolocationService() = default; @@ -1184,7 +1138,7 @@ index d46e2e88b121688f62bbd43755791a077cfa1fe8..e69d62ffb4e732137b7a0ec0385358f3 // Management of the Geolocation objects void AddLocator(mozilla::dom::Geolocation* aLocator); -@@ -89,6 +89,8 @@ class nsGeolocationService final : public nsIGeolocationUpdate, +@@ -88,6 +88,8 @@ class nsGeolocationService final : public nsIGeolocationUpdate, void UpdateAccuracy(bool aForceHigh = false); bool HighAccuracyRequested(); @@ -1193,7 +1147,7 @@ index d46e2e88b121688f62bbd43755791a077cfa1fe8..e69d62ffb4e732137b7a0ec0385358f3 private: ~nsGeolocationService(); -@@ -115,6 +117,8 @@ class nsGeolocationService final : public nsIGeolocationUpdate, +@@ -114,6 +116,8 @@ class nsGeolocationService final : public nsIGeolocationUpdate, // Nothing() if not being started, or a boolean reflecting the requested // accuracy. mozilla::Maybe mStarting; @@ -1203,10 +1157,10 @@ index d46e2e88b121688f62bbd43755791a077cfa1fe8..e69d62ffb4e732137b7a0ec0385358f3 namespace mozilla::dom { diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp -index 8074eb6f2507538d2c78068295bfca5c16a5fd0a..c6cef9f3b03d68e4a59345d0cae3c557474c20d4 100644 +index e3698a2cbcfd13ce6075e0a155c46191dfc15a57..65e7834f2df7e55c5958aa01d4cb1adeec85da88 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp -@@ -61,6 +61,7 @@ +@@ -60,6 +60,7 @@ #include "nsBaseCommandController.h" #include "nsCRTGlue.h" #include "nsColorControlFrame.h" @@ -1214,7 +1168,7 @@ index 8074eb6f2507538d2c78068295bfca5c16a5fd0a..c6cef9f3b03d68e4a59345d0cae3c557 #include "nsError.h" #include "nsFileControlFrame.h" #include "nsFocusManager.h" -@@ -934,6 +935,13 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { +@@ -929,6 +930,13 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { return NS_ERROR_FAILURE; } @@ -1229,23 +1183,23 @@ index 8074eb6f2507538d2c78068295bfca5c16a5fd0a..c6cef9f3b03d68e4a59345d0cae3c557 return NS_OK; } diff --git a/dom/media/systemservices/video_engine/desktop_capture_impl.cc b/dom/media/systemservices/video_engine/desktop_capture_impl.cc -index d6cb5c68b6afd8c5ae333a2f06daed7966870814..62fedf543e636269c9e98c4837a73c7a7c24ef9e 100644 +index 9e1086527c293e95f92bd60b7f39de5e955a36ed..7b3b482cf10e87eb8e9f2423aef7b6ac7f8696bc 100644 --- a/dom/media/systemservices/video_engine/desktop_capture_impl.cc +++ b/dom/media/systemservices/video_engine/desktop_capture_impl.cc -@@ -53,9 +53,10 @@ namespace webrtc { +@@ -52,9 +52,10 @@ namespace webrtc { - DesktopCaptureImpl* DesktopCaptureImpl::Create(const int32_t aModuleId, + DesktopCaptureImpl* DesktopCaptureImpl::Create(int32_t aCaptureId, const char* aUniqueId, - const CaptureDeviceType aType) { + const CaptureDeviceType aType, + bool aCaptureCursor) { - return new webrtc::RefCountedObject(aModuleId, aUniqueId, + return new webrtc::RefCountedObject(aCaptureId, aUniqueId, - aType); + aType, aCaptureCursor); } static DesktopCaptureOptions CreateDesktopCaptureOptions() { -@@ -156,8 +157,10 @@ static std::unique_ptr CreateTabCapturer( +@@ -154,8 +155,10 @@ static std::unique_ptr CreateTabCapturer( static std::unique_ptr CreateDesktopCapturerAndThread( CaptureDeviceType aDeviceType, DesktopCapturer::SourceId aSourceId, @@ -1257,26 +1211,33 @@ index d6cb5c68b6afd8c5ae333a2f06daed7966870814..62fedf543e636269c9e98c4837a73c7a auto ensureThread = [&]() { if (*aOutThread) { return *aOutThread; -@@ -254,7 +257,8 @@ static std::unique_ptr CreateDesktopCapturerAndThread( - } +@@ -253,7 +256,8 @@ static std::unique_ptr CreateDesktopCapturerAndThread( - DesktopCaptureImpl::DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, + DesktopCaptureImpl::DesktopCaptureImpl(int32_t aCaptureId, + const char* aUniqueId, - const CaptureDeviceType aType) + const CaptureDeviceType aType, + bool aCaptureCursor) - : mModuleId(aId), - mTrackingId(mozilla::TrackingId(CaptureEngineToTrackingSourceStr([&] { + : mTrackingId(mozilla::TrackingId(CaptureEngineToTrackingSourceStr([&] { switch (aType) { -@@ -271,6 +275,7 @@ DesktopCaptureImpl::DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, - aId)), + case CaptureDeviceType::Screen: +@@ -269,9 +273,13 @@ DesktopCaptureImpl::DesktopCaptureImpl(int32_t aCaptureId, + aCaptureId)), mDeviceUniqueId(aUniqueId), mDeviceType(aType), + capture_cursor_(aCaptureCursor), mControlThread(mozilla::GetCurrentSerialEventTarget()), mNextFrameMinimumTime(Timestamp::Zero()), - mCallbacks("DesktopCaptureImpl::mCallbacks"), -@@ -296,6 +301,19 @@ void DesktopCaptureImpl::DeRegisterCaptureDataCallback( - } +- mCallback("DesktopCaptureImpl::mCallback"), ++ // Playwright: make sure mCallback is initialized with nullptr instead of ++ // a random garbage; we'll use this to assert existance of data callback. ++ mCallback(static_cast*>(nullptr), ++ "DesktopCaptureImpl::mCallback"), + mBufferPool(false, 2) {} + + DesktopCaptureImpl::~DesktopCaptureImpl() { +@@ -290,6 +298,19 @@ void DesktopCaptureImpl::DeRegisterCaptureDataCallback() { + *callback = nullptr; } +void DesktopCaptureImpl::RegisterRawFrameCallback(RawFrameCallback* rawFrameCallback) { @@ -1292,10 +1253,10 @@ index d6cb5c68b6afd8c5ae333a2f06daed7966870814..62fedf543e636269c9e98c4837a73c7a + } +} + - int32_t DesktopCaptureImpl::StopCaptureIfAllClientsClose() { - { - auto callbacks = mCallbacks.Lock(); -@@ -351,7 +369,7 @@ int32_t DesktopCaptureImpl::StartCapture( + int32_t DesktopCaptureImpl::SetCaptureRotation(VideoRotation aRotation) { + MOZ_ASSERT_UNREACHABLE("Unused"); + return -1; +@@ -335,7 +356,7 @@ int32_t DesktopCaptureImpl::StartCapture( return -1; } std::unique_ptr capturer = CreateDesktopCapturerAndThread( @@ -1304,7 +1265,7 @@ index d6cb5c68b6afd8c5ae333a2f06daed7966870814..62fedf543e636269c9e98c4837a73c7a MOZ_ASSERT(!capturer == !mCaptureThread); if (!capturer) { -@@ -461,6 +479,13 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult, +@@ -445,6 +466,21 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult, frameInfo.height = aFrame->size().height(); frameInfo.videoType = VideoType::kARGB; @@ -1314,15 +1275,23 @@ index d6cb5c68b6afd8c5ae333a2f06daed7966870814..62fedf543e636269c9e98c4837a73c7a + rawFrameCallback->OnRawFrame(videoFrame, aFrame->stride(), frameInfo); + } + } ++ ++ // Playwright: fast-return if only raw callback is registered. ++ { ++ auto callback = mCallback.Lock(); ++ if (!*callback) { ++ return; ++ } ++ } + size_t videoFrameLength = 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 75851401d724338f45eb7f41761575036345abf9..dc36c41f64cd29bfceb566eeebe14a998ccb224c 100644 +index 7f3e2e0360b5fb16265f5581faf3a5ee30f7b94a..7a01c0c3f474feb75d683a482ff08deed7edc98f 100644 --- a/dom/media/systemservices/video_engine/desktop_capture_impl.h +++ b/dom/media/systemservices/video_engine/desktop_capture_impl.h -@@ -27,6 +27,7 @@ +@@ -26,6 +26,7 @@ #include "common_video/include/video_frame_buffer_pool.h" #include "modules/desktop_capture/desktop_capturer.h" #include "modules/video_capture/video_capture.h" @@ -1330,7 +1299,7 @@ index 75851401d724338f45eb7f41761575036345abf9..dc36c41f64cd29bfceb566eeebe14a99 #include "mozilla/DataMutex.h" #include "mozilla/Maybe.h" #include "mozilla/TimeStamp.h" -@@ -43,17 +44,44 @@ namespace webrtc { +@@ -43,18 +44,45 @@ namespace webrtc { class VideoCaptureEncodeInterface; @@ -1364,39 +1333,40 @@ index 75851401d724338f45eb7f41761575036345abf9..dc36c41f64cd29bfceb566eeebe14a99 // 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, + class DesktopCaptureImpl : public mozilla::DesktopCaptureInterface, + public DesktopCapturer::Callback, - public VideoCaptureModule { + public VideoCaptureModuleEx { public: /* Create a screen capture modules object */ static DesktopCaptureImpl* Create( - const int32_t aModuleId, const char* aUniqueId, + int32_t aCaptureId, const char* aUniqueId, - const mozilla::camera::CaptureDeviceType aType); + const mozilla::camera::CaptureDeviceType aType, bool aCaptureCursor = true); [[nodiscard]] static std::shared_ptr - CreateDeviceInfo(const int32_t aId, -@@ -67,6 +95,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, - void DeRegisterCaptureDataCallback( - webrtc::VideoSinkInterface* aCallback) override; - int32_t StopCaptureIfAllClientsClose() override; + CreateDeviceInfo(const mozilla::camera::CaptureDeviceType aType); +@@ -65,6 +93,8 @@ class DesktopCaptureImpl : public mozilla::DesktopCaptureInterface, + void RegisterCaptureDataCallback( + RawVideoSinkInterface* dataCallback) override {} + void DeRegisterCaptureDataCallback() override; + void RegisterRawFrameCallback(RawFrameCallback* rawFrameCallback) override; + void DeRegisterRawFrameCallback(RawFrameCallback* rawFrameCallback) override; int32_t SetCaptureRotation(VideoRotation aRotation) override; bool SetApplyRotation(bool aEnable) override; -@@ -90,7 +120,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -87,7 +117,8 @@ class DesktopCaptureImpl : public mozilla::DesktopCaptureInterface, protected: - DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, + DesktopCaptureImpl(const int32_t aCaptureId, const char* aUniqueId, - const mozilla::camera::CaptureDeviceType aType); + const mozilla::camera::CaptureDeviceType aType, + bool aCaptureCusor); virtual ~DesktopCaptureImpl(); private: -@@ -99,6 +130,9 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -96,6 +127,9 @@ class DesktopCaptureImpl : public mozilla::DesktopCaptureInterface, void InitOnThread(std::unique_ptr aCapturer, int aFramerate); void UpdateOnThread(int aFramerate); void ShutdownOnThread(); @@ -1406,7 +1376,7 @@ index 75851401d724338f45eb7f41761575036345abf9..dc36c41f64cd29bfceb566eeebe14a99 // DesktopCapturer::Callback interface. void OnCaptureResult(DesktopCapturer::Result aResult, std::unique_ptr aFrame) override; -@@ -106,6 +140,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -103,6 +137,8 @@ class DesktopCaptureImpl : public mozilla::DesktopCaptureInterface, // Notifies all mCallbacks of OnFrame(). mCaptureThread only. void NotifyOnFrame(const VideoFrame& aFrame); @@ -1416,10 +1386,10 @@ index 75851401d724338f45eb7f41761575036345abf9..dc36c41f64cd29bfceb566eeebe14a99 const nsCOMPtr mControlThread; // Set in StartCapture. diff --git a/dom/script/ScriptSettings.cpp b/dom/script/ScriptSettings.cpp -index f22e318c063870443f3f849a990aa5139cd33acf..b0034cfc1ccecf8765ab239a4ccc22320dd0cd28 100644 +index 9cdecc7f348068fe01e29b6509f098794f6f0d1a..e3aae194a3f2f86a5498a5fd412c211e17817420 100644 --- a/dom/script/ScriptSettings.cpp +++ b/dom/script/ScriptSettings.cpp -@@ -148,6 +148,30 @@ ScriptSettingsStackEntry::~ScriptSettingsStackEntry() { +@@ -146,6 +146,30 @@ ScriptSettingsStackEntry::~ScriptSettingsStackEntry() { MOZ_ASSERT_IF(mGlobalObject, mGlobalObject->HasJSGlobal()); } @@ -1450,7 +1420,7 @@ index f22e318c063870443f3f849a990aa5139cd33acf..b0034cfc1ccecf8765ab239a4ccc2232 // If the entry or incumbent global ends up being something that the subject // principal doesn't subsume, we don't want to use it. This never happens on // the web, but can happen with asymmetric privilege relationships (i.e. -@@ -175,7 +199,7 @@ static nsIGlobalObject* ClampToSubject(nsIGlobalObject* aGlobalOrNull) { +@@ -173,7 +197,7 @@ static nsIGlobalObject* ClampToSubject(nsIGlobalObject* aGlobalOrNull) { NS_ENSURE_TRUE(globalPrin, GetCurrentGlobal()); if (!nsContentUtils::SubjectPrincipalOrSystemIfNativeCaller() ->SubsumesConsideringDomain(globalPrin)) { @@ -1460,10 +1430,10 @@ index f22e318c063870443f3f849a990aa5139cd33acf..b0034cfc1ccecf8765ab239a4ccc2232 return aGlobalOrNull; diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp -index 39c210e7b444384fbb55145ac448def3ef540edc..11be3082d6f96a397c5e78d867143a0e6bdc8deb 100644 +index 11de03cf6eaf8fa6fff602cc12a78acc08f2e25f..51e5abd2ee8174d672ce70310b9d03fdda170a26 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp -@@ -33,6 +33,7 @@ +@@ -31,6 +31,7 @@ #include "nsSandboxFlags.h" #include "nsServiceManagerUtils.h" #include "nsWhitespaceTokenizer.h" @@ -1471,7 +1441,7 @@ index 39c210e7b444384fbb55145ac448def3ef540edc..11be3082d6f96a397c5e78d867143a0e using namespace mozilla; using mozilla::dom::SRIMetadata; -@@ -136,6 +137,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, +@@ -134,6 +135,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, return; } @@ -1484,10 +1454,10 @@ index 39c210e7b444384fbb55145ac448def3ef540edc..11be3082d6f96a397c5e78d867143a0e nsContentUtils::TrimWhitespace( aPolicyStr)); diff --git a/dom/webidl/GeometryUtils.webidl b/dom/webidl/GeometryUtils.webidl -index aee376e971ae01ac1e512c3920b115bfaf06afa8..1701311534bf77e6cd9bafc0e3a283610476aa8f 100644 +index 584d39da5f04f6d8fc6a87547557b0eeeb35d168..65eb7014356a90aa01ab517c9937ed650c2ee8fd 100644 --- a/dom/webidl/GeometryUtils.webidl +++ b/dom/webidl/GeometryUtils.webidl -@@ -17,6 +17,8 @@ dictionary GeometryUtilsOptions { +@@ -16,6 +16,8 @@ dictionary GeometryUtilsOptions { boolean createFramesForSuppressedWhitespace = true; [ChromeOnly] boolean flush = true; @@ -1496,7 +1466,7 @@ index aee376e971ae01ac1e512c3920b115bfaf06afa8..1701311534bf77e6cd9bafc0e3a28361 }; dictionary BoxQuadOptions : GeometryUtilsOptions { -@@ -35,6 +37,9 @@ interface mixin GeometryUtils { +@@ -34,6 +36,9 @@ interface mixin GeometryUtils { [Throws, Func="nsINode::HasBoxQuadsSupport", NeedsCallerType] sequence getBoxQuads(optional BoxQuadOptions options = {}); @@ -1507,10 +1477,10 @@ index aee376e971ae01ac1e512c3920b115bfaf06afa8..1701311534bf77e6cd9bafc0e3a28361 * returned quads are further translated relative to the window * origin -- which is not the layout origin. Further translation diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl -index 129bec94e2f69cbe4e9f90769d582d03a1e36639..f61df8c851e76fa7f06128c38e5943b1519b5008 100644 +index ae2d14e105bc70dc4a5c7f1fa3481c550a74dd4d..83f090b0512dbf2fde42e152838d4bd8315e6616 100644 --- a/dom/webidl/Window.webidl +++ b/dom/webidl/Window.webidl -@@ -463,6 +463,8 @@ dictionary SynthesizeMouseEventOptions : SynthesizeEventOptions { +@@ -442,6 +442,8 @@ dictionary SynthesizeMouseEventOptions : SynthesizeEventOptions { boolean ignoreRootScrollFrame = false; // Controls WidgetMouseEvent.mReason value. boolean isWidgetEventSynthesized = false; @@ -1520,10 +1490,10 @@ index 129bec94e2f69cbe4e9f90769d582d03a1e36639..f61df8c851e76fa7f06128c38e5943b1 // Mozilla-specific stuff diff --git a/js/src/debugger/Object.cpp b/js/src/debugger/Object.cpp -index e8270a137ac58342daba109c24a3995ff99a85a1..de48226281fb0286e66049c717c5297cc3c11773 100644 +index 57cd28a445025fb9f3a18ce7083ee683069015f0..398b82832bbf373d443b846b7b5cd4d10888d2a3 100644 --- a/js/src/debugger/Object.cpp +++ b/js/src/debugger/Object.cpp -@@ -2515,7 +2515,11 @@ Maybe DebuggerObject::call(JSContext* cx, +@@ -2510,7 +2510,11 @@ Maybe DebuggerObject::call(JSContext* cx, invokeArgs[i].set(args2[i]); } @@ -1536,10 +1506,10 @@ index e8270a137ac58342daba109c24a3995ff99a85a1..de48226281fb0286e66049c717c5297c } diff --git a/js/src/vm/DateTime.cpp b/js/src/vm/DateTime.cpp -index 12cf8713d26c0b84e8bf78a92d7c886b234cdb95..8a007bd79a0c8a74e0722021a35c3f9351628f0b 100644 +index 50657afb4aaf2305b01b581ee09eb9ea712b2614..38384eea6216358b40e8440fa2a78a17fca83592 100644 --- a/js/src/vm/DateTime.cpp +++ b/js/src/vm/DateTime.cpp -@@ -814,7 +814,6 @@ void js::DateTimeInfo::internalResyncICUDefaultTimeZone() { +@@ -810,7 +810,6 @@ void js::DateTimeInfo::internalResyncICUDefaultTimeZone() { #if JS_HAS_INTL_API if (const char* tzenv = std::getenv("TZ")) { std::string_view tz(tzenv); @@ -1548,10 +1518,10 @@ index 12cf8713d26c0b84e8bf78a92d7c886b234cdb95..8a007bd79a0c8a74e0722021a35c3f93 # if defined(XP_WIN) diff --git a/layout/base/GeometryUtils.cpp b/layout/base/GeometryUtils.cpp -index 67673c5c306e7237613b0560c7b3f888bd6ad1b8..fe4a278dad4b1747b41b5a824978636a70a9dea8 100644 +index eaaf69687f669a4859a37f3f97b99e6ca519c420..6f965a110db3a1c86466d72f09ead23bef767e5e 100644 --- a/layout/base/GeometryUtils.cpp +++ b/layout/base/GeometryUtils.cpp -@@ -23,6 +23,7 @@ +@@ -21,6 +21,7 @@ #include "nsContentUtils.h" #include "nsIFrame.h" #include "nsLayoutUtils.h" @@ -1559,7 +1529,7 @@ index 67673c5c306e7237613b0560c7b3f888bd6ad1b8..fe4a278dad4b1747b41b5a824978636a using namespace mozilla; using namespace mozilla::dom; -@@ -265,10 +266,27 @@ static bool CheckFramesInSameTopLevelBrowsingContext(nsIFrame* aFrame1, +@@ -263,10 +264,27 @@ static bool CheckFramesInSameTopLevelBrowsingContext(nsIFrame* aFrame1, return false; } @@ -1588,8 +1558,8 @@ index 67673c5c306e7237613b0560c7b3f888bd6ad1b8..fe4a278dad4b1747b41b5a824978636a if (!frame) { // No boxes to return return; -@@ -281,7 +299,8 @@ void GetBoxQuads(nsINode* aNode, const dom::BoxQuadOptions& aOptions, - // EnsureFrameForTextNode call. We need to get the first frame again +@@ -280,7 +298,8 @@ void GetBoxQuads(nsINode* aNode, const dom::BoxQuadOptions& aOptions, + // EnsureFrameForTextNode call. We need to get the first frame again // when that happens and re-check it. if (!weakFrame.IsAlive()) { - frame = GetFrameForNode(aNode, aOptions); @@ -1599,10 +1569,10 @@ index 67673c5c306e7237613b0560c7b3f888bd6ad1b8..fe4a278dad4b1747b41b5a824978636a // No boxes to return return; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp -index d96107f892f09d1b036769cefe30d11989109add..6797255a8e4c7cc8e42ba08c948a71e8f0a9be8c 100644 +index 38891d8d9f00dbe49a6d4eac94b8e72b13baba96..0c649cec87cfabe2106949cb9cc3beb72f898de6 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp -@@ -11660,7 +11660,9 @@ bool PresShell::ComputeActiveness() const { +@@ -11791,7 +11791,9 @@ bool PresShell::ComputeActiveness() const { if (!browserChild->IsVisible()) { MOZ_LOG(gLog, LogLevel::Debug, (" > BrowserChild %p is not visible", browserChild)); @@ -1614,35 +1584,22 @@ index d96107f892f09d1b036769cefe30d11989109add..6797255a8e4c7cc8e42ba08c948a71e8 // 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 8533e0494f1ed552d0a1b9abd09e2852efaf7628..0d8439203e02cbca1230de7eecc204a2b6be955c 100644 +index 46967151f9d91dd99b9ae4d026098abe05619537..447e4e43ee46345cfda18c15540d6a2bc9651379 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp -@@ -702,6 +702,10 @@ bool nsLayoutUtils::AllowZoomingForDocument( +@@ -702,6 +702,7 @@ bool nsLayoutUtils::AllowZoomingForDocument( !aDocument->GetPresShell()->AsyncPanZoomEnabled()) { return false; } -+ -+ /* Playwright: disable zooming as we don't support meta viewport tag */ -+ if (1 == 1) return false; + // True if we allow zooming for all documents on this platform, or if we are // in RDM. BrowsingContext* bc = aDocument->GetBrowsingContext(); -@@ -9768,6 +9772,9 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont, - - /* static */ - bool nsLayoutUtils::ShouldHandleMetaViewport(const Document* aDocument) { -+ /* Playwright: disable meta viewport handling since we don't require one */ -+ if (1 == 1) return false; -+ - BrowsingContext* bc = aDocument->GetBrowsingContext(); - return StaticPrefs::dom_meta_viewport_enabled() || (bc && bc->InRDMPane()); - } diff --git a/layout/style/GeckoBindings.h b/layout/style/GeckoBindings.h -index 8f07ee0bae8f93ac90b52a4fe5004f79caae7510..56d1514f17b449e8cb2a81759266ecef8fbe3c1c 100644 +index b8317e006298c1345a6f13d26ca20980875e5bd1..001fd4dbe5612588857924b902cf7ccb359885e5 100644 --- a/layout/style/GeckoBindings.h +++ b/layout/style/GeckoBindings.h -@@ -611,6 +611,7 @@ bool Gecko_MediaFeatures_PrefersReducedMotion(const mozilla::dom::Document*); +@@ -623,6 +623,7 @@ bool Gecko_MediaFeatures_PrefersReducedMotion(const mozilla::dom::Document*); bool Gecko_MediaFeatures_PrefersReducedTransparency( const mozilla::dom::Document*); bool Gecko_MediaFeatures_MacRTL(const mozilla::dom::Document*); @@ -1651,23 +1608,10 @@ index 8f07ee0bae8f93ac90b52a4fe5004f79caae7510..56d1514f17b449e8cb2a81759266ecef const mozilla::dom::Document*); mozilla::StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme( diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp -index bcfd66022bf3cd26fc5c7bdba9fb1715240030d2..9c3d5ea64a9ff1cdf8580aeed26ea7eedbfbdcf4 100644 +index 1f9613b8cd936fa9d884be010a8dd6167251faa6..0346bccc1c469446376c5bee3250e3dcfd9b6d81 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp -@@ -276,11 +276,7 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) { - } - - bool Gecko_MediaFeatures_PrefersReducedMotion(const Document* aDocument) { -- if (aDocument->ShouldResistFingerprinting( -- RFPTarget::CSSPrefersReducedMotion)) { -- return false; -- } -- return LookAndFeel::GetInt(LookAndFeel::IntID::PrefersReducedMotion, 0) == 1; -+ return aDocument->PrefersReducedMotion(); - } - - bool Gecko_MediaFeatures_PrefersReducedTransparency(const Document* aDocument) { -@@ -310,6 +306,20 @@ bool Gecko_MediaFeatures_MacRTL(const Document* aDocument) { +@@ -322,6 +322,20 @@ bool Gecko_MediaFeatures_MacRTL(const Document* aDocument) { // as a signal. StylePrefersContrast Gecko_MediaFeatures_PrefersContrast( const Document* aDocument) { @@ -1683,16 +1627,16 @@ index bcfd66022bf3cd26fc5c7bdba9fb1715240030d2..9c3d5ea64a9ff1cdf8580aeed26ea7ee + return StylePrefersContrast::Custom; + } + } -+ -+ ++ ++ if (aDocument->ShouldResistFingerprinting(RFPTarget::CSSPrefersContrast)) { return StylePrefersContrast::NoPreference; } diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml -index 262eee800b3f2bf7b84809cd1f4a7aa2020eafb6..ebed6c29b9be37e6d85d8a30907331fb7af7b037 100644 +index b96e9d02beda72c92c295a2799c851b94945ada6..55ab1a450f06225d0bec9e33e0b660e642ce42c3 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml -@@ -12811,18 +12811,20 @@ +@@ -13109,18 +13109,20 @@ # Use the libwebrtc ScreenCaptureKit desktop capture backend on Mac by default. # When disabled, or on a host where not supported (< macOS 14), the older # CoreGraphics backend is used instead. @@ -1716,10 +1660,10 @@ index 262eee800b3f2bf7b84809cd1f4a7aa2020eafb6..ebed6c29b9be37e6d85d8a30907331fb # Use the libwebrtc ScreenCaptureKit desktop capture backend on Mac for screen diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp -index fa7db176b1dfe023c9aaccdb2324696f9d226542..6ac5774da83a1249f42e2b2e1b5d4ef71ecd23fa 100644 +index a9abddc425e6570afbda8c27ed11052ab65bcac1..ee23f9ae179fdb3c2f9099b39888f569cc4f69b6 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp -@@ -750,7 +750,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) +@@ -751,7 +751,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) mInterceptionInfo(rhs.mInterceptionInfo), mSchemelessInput(rhs.mSchemelessInput), mUserNavigationInvolvement(rhs.mUserNavigationInvolvement), @@ -1729,7 +1673,7 @@ index fa7db176b1dfe023c9aaccdb2324696f9d226542..6ac5774da83a1249f42e2b2e1b5d4ef7 } LoadInfo::LoadInfo( -@@ -2104,4 +2105,16 @@ void LoadInfo::UpdateParentAddressSpaceInfo() { +@@ -2105,4 +2106,16 @@ void LoadInfo::UpdateParentAddressSpaceInfo() { } } @@ -1747,7 +1691,7 @@ index fa7db176b1dfe023c9aaccdb2324696f9d226542..6ac5774da83a1249f42e2b2e1b5d4ef7 + } // namespace mozilla::net diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h -index 6d8ce05b11257cdbc90e327ffc1638ba9c60a4a9..ee10457b694e810edb35e4162c83f7a37aa9ba58 100644 +index 797517e695981ddddfef253cd5eb227fd08e686d..93927bb84e4a81068b1772a913c4b405605cc063 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h @@ -550,6 +550,8 @@ class LoadInfo final : public nsILoadInfo { @@ -1760,10 +1704,10 @@ index 6d8ce05b11257cdbc90e327ffc1638ba9c60a4a9..ee10457b694e810edb35e4162c83f7a3 // This is exposed solely for testing purposes and should not be used outside of // LoadInfo diff --git a/netwerk/base/TRRLoadInfo.cpp b/netwerk/base/TRRLoadInfo.cpp -index be0f8bcb6ff861c942d8615f381b99a398ad80d1..00f07714532a12624f8f5925492da521f5e8606e 100644 +index 8acc7468ae67a75c53569c8d9498b0b27d6bcaa2..5cf23f8a3906f923c0368e8cf5b8fc99df4858f5 100644 --- a/netwerk/base/TRRLoadInfo.cpp +++ b/netwerk/base/TRRLoadInfo.cpp -@@ -562,5 +562,15 @@ TRRLoadInfo::GetFetchDestination(nsACString& aDestination) { +@@ -555,5 +555,15 @@ TRRLoadInfo::GetFetchDestination(nsACString& aDestination) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -1780,10 +1724,10 @@ index be0f8bcb6ff861c942d8615f381b99a398ad80d1..00f07714532a12624f8f5925492da521 } // namespace net } // namespace mozilla diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl -index 884f8f0c44f66a74484065f048939b46024528a5..e195cc2062811c230dff45e56a896c65266c23e7 100644 +index f6a22a498d99ee75c7c9985e278b4331ec3eddc4..cbc8f92fabc7272a2f04b0e37214e7a51a9a0dda 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl -@@ -1715,4 +1715,6 @@ interface nsILoadInfo : nsISupports +@@ -1720,4 +1720,6 @@ interface nsILoadInfo : nsISupports return static_cast(userNavigationInvolvement); } %} @@ -1791,10 +1735,10 @@ index 884f8f0c44f66a74484065f048939b46024528a5..e195cc2062811c230dff45e56a896c65 + [infallible] attribute unsigned long long jugglerLoadIdentifier; }; diff --git a/netwerk/base/nsINetworkInterceptController.idl b/netwerk/base/nsINetworkInterceptController.idl -index 7f91d2df6f8bb4020c75c132dc8f6bf26625fa1e..aaa5541a17039d6b13ad83ab176fdaaf79edb2a0 100644 +index 3654f3ed20f6b22d36c4238be40417e77e8f6867..f685e7668ad3310cac8bc8425124a6fe6ed0405d 100644 --- a/netwerk/base/nsINetworkInterceptController.idl +++ b/netwerk/base/nsINetworkInterceptController.idl -@@ -60,6 +60,16 @@ interface nsIInterceptedChannel : nsISupports +@@ -59,6 +59,16 @@ interface nsIInterceptedChannel : nsISupports */ void resetInterception(in boolean bypass); @@ -1812,10 +1756,10 @@ index 7f91d2df6f8bb4020c75c132dc8f6bf26625fa1e..aaa5541a17039d6b13ad83ab176fdaaf * Set the status and reason for the forthcoming synthesized response. * Multiple calls overwrite existing values. diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp -index 81eeeb14ffe5eb40f57a18cd3d4bd714ad59454c..6d1f4acb69f1028300be5925a0d85649f616f4e8 100644 +index 29c5421f664406fc5be9134372d9959b4a3fa626..0ab0296f647e3339167f4c1d5693af24ad160c58 100644 --- a/netwerk/ipc/DocumentLoadListener.cpp +++ b/netwerk/ipc/DocumentLoadListener.cpp -@@ -198,6 +198,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, +@@ -195,6 +195,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, aLoadState->GetTextDirectiveUserActivation() || aLoadState->HasLoadFlags(nsIWebNavigation::LOAD_FLAGS_FROM_EXTERNAL)); loadInfo->SetIsMetaRefresh(aLoadState->IsMetaRefresh()); @@ -1824,10 +1768,10 @@ index 81eeeb14ffe5eb40f57a18cd3d4bd714ad59454c..6d1f4acb69f1028300be5925a0d85649 return loadInfo.forget(); } diff --git a/netwerk/protocol/http/InterceptedHttpChannel.cpp b/netwerk/protocol/http/InterceptedHttpChannel.cpp -index d79401c3cbd38a297dc2d25e713422eaa8784018..2f5e2229ad881b0621b654b33ecd1d4bb4555893 100644 +index 60626cc9b3f7495b3f0ffc13346d1319ffd86dab..99c85a483d9e325bc3f7fd86bf772968ece31724 100644 --- a/netwerk/protocol/http/InterceptedHttpChannel.cpp +++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp -@@ -722,10 +722,33 @@ NS_IMPL_ISUPPORTS(ResetInterceptionHeaderVisitor, nsIHttpHeaderVisitor) +@@ -726,10 +726,33 @@ NS_IMPL_ISUPPORTS(ResetInterceptionHeaderVisitor, nsIHttpHeaderVisitor) } // anonymous namespace @@ -1861,7 +1805,7 @@ index d79401c3cbd38a297dc2d25e713422eaa8784018..2f5e2229ad881b0621b654b33ecd1d4b if (mCanceled) { return mStatus; } -@@ -1139,11 +1162,18 @@ InterceptedHttpChannel::OnStartRequest(nsIRequest* aRequest) { +@@ -1143,11 +1166,18 @@ InterceptedHttpChannel::OnStartRequest(nsIRequest* aRequest) { GetCallback(mProgressSink); } @@ -1879,12 +1823,12 @@ index d79401c3cbd38a297dc2d25e713422eaa8784018..2f5e2229ad881b0621b654b33ecd1d4b + */ if (mPump && mLoadFlags & LOAD_CALL_CONTENT_SNIFFERS) { - mPump->PeekStream(CallTypeSniffers, static_cast(this)); + RefPtr pump(mPump); diff --git a/netwerk/protocol/http/InterceptedHttpChannel.h b/netwerk/protocol/http/InterceptedHttpChannel.h -index eb287a6fc9f782c1e0232c298a3759d3e639d29a..fdd5acedb69d6ba3df2aa337c6817b3c5f2f8344 100644 +index 430646881b927d2dddda1e0bcf5fd3427580224f..6b5bbb2a411794e9275d1ab83ea02d4cfca88e0e 100644 --- a/netwerk/protocol/http/InterceptedHttpChannel.h +++ b/netwerk/protocol/http/InterceptedHttpChannel.h -@@ -91,6 +91,11 @@ class InterceptedHttpChannel final +@@ -89,6 +89,11 @@ class InterceptedHttpChannel final Atomic mCallingStatusAndProgress; bool mInterceptionReset{false}; @@ -1897,10 +1841,10 @@ index eb287a6fc9f782c1e0232c298a3759d3e639d29a..fdd5acedb69d6ba3df2aa337c6817b3c * InterceptionTimeStamps is used to record the time stamps of the * interception. diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp -index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65f5f6d7dd 100644 +index 42ee24d0b93641cae705d8709467141125a3f7ea..276a10796fd2f647fa0e469e2f1ceb365eb2ba3f 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp -@@ -947,11 +947,9 @@ nsresult nsHttpChannel::OnBeforeConnect() { +@@ -941,11 +941,9 @@ nsresult nsHttpChannel::OnBeforeConnect() { // SecurityInfo.sys.mjs mLoadInfo->SetHstsStatus(isSecureURI); @@ -1913,7 +1857,7 @@ index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65 BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass())) { return NS_ERROR_OFFLINE; } -@@ -1064,9 +1062,7 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRForUpgrade(bool aShouldUpgrade, +@@ -1058,9 +1056,7 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRForUpgrade(bool aShouldUpgrade, return aStatus; } @@ -1924,7 +1868,7 @@ index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65 if (mURI->SchemeIs("https") || aShouldUpgrade || !LoadUseHTTPSSVC() || forceOffline) { -@@ -1543,15 +1539,14 @@ nsresult nsHttpChannel::ContinueConnect() { +@@ -1523,15 +1519,14 @@ nsresult nsHttpChannel::ContinueConnect() { "CORS preflight must have been finished by the time we " "do the rest of ContinueConnect"); @@ -1942,7 +1886,7 @@ index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65 BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass())) { return NS_ERROR_OFFLINE; } -@@ -1593,7 +1588,7 @@ nsresult nsHttpChannel::ContinueConnect() { +@@ -1573,7 +1568,7 @@ nsresult nsHttpChannel::ContinueConnect() { } // We're about to hit the network. Don't if we're forced offline. @@ -1951,7 +1895,7 @@ index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65 return NS_ERROR_OFFLINE; } -@@ -1701,12 +1696,9 @@ void nsHttpChannel::SpeculativeConnect() { +@@ -1681,12 +1676,9 @@ void nsHttpChannel::SpeculativeConnect() { // don't speculate if we are offline, when doing http upgrade (i.e. // websockets bootstrap), or if we can't do keep-alive (because then we // couldn't reuse the speculative connection anyhow). @@ -1965,17 +1909,7 @@ index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65 return; } -@@ -4947,9 +4939,6 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) { - uint32_t cacheEntryOpenFlags; - bool offline = gIOService->IsOffline(); - -- RefPtr bc; -- mLoadInfo->GetBrowsingContext(getter_AddRefs(bc)); -- - bool maybeRCWN = false; - - nsAutoCString cacheControlRequestHeader; -@@ -4960,7 +4949,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) { +@@ -4962,7 +4954,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) { return NS_OK; } @@ -1984,7 +1918,7 @@ index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65 if (offline || (mLoadFlags & INHIBIT_CACHING) || forceOffline) { if (BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass()) && !offline && !forceOffline) { -@@ -8274,6 +8263,20 @@ void nsHttpChannel::MaybeStartDNSPrefetch() { +@@ -8196,6 +8188,20 @@ void nsHttpChannel::MaybeStartDNSPrefetch() { } } @@ -1995,7 +1929,7 @@ index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65 + return true; + + RefPtr wbc; -+ mLoadInfo->GetWorkerAssociatedBrowsingContext(getter_AddRefs(wbc)); ++ mLoadInfo->GetAssociatedBrowsingContext(getter_AddRefs(wbc)); + if (wbc && wbc->Top()->GetForceOffline()) + return true; + @@ -2006,10 +1940,10 @@ index 92fcaae7a12d9915abd865b079b5b4edcdef5a21..baa5b40d8ae796c245b4d673f42a9d65 nsHttpChannel::GetEncodedBodySize(uint64_t* aEncodedBodySize) { if (mCacheEntry && !LoadCacheEntryIsWriteOnly()) { diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h -index ec9960bbacab75e07f6f67dac6bee9a725d756c6..02e92938551cfe4a19717be81ee57cffcc535e1e 100644 +index 4576bdef9b5667a54f88600bce04753bb6152b85..c023312fd12f3f390c0e7773ae4f5625e78642ac 100644 --- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h -@@ -314,6 +314,10 @@ class nsHttpChannel final : public HttpBaseChannel, +@@ -305,6 +305,10 @@ class nsHttpChannel final : public HttpBaseChannel, void MaybeResolveProxyAndBeginConnect(); void MaybeStartDNSPrefetch(); @@ -2019,12 +1953,12 @@ index ec9960bbacab75e07f6f67dac6bee9a725d756c6..02e92938551cfe4a19717be81ee57cff + // Based on the proxy configuration determine the strategy for resolving the // end server host name. - ProxyDNSStrategy GetProxyDNSStrategy(); + nsIHttpChannelInternal::ProxyDNSStrategy ComputeProxyDNSStrategy(); diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp -index aa6b6c81f0eeba728a6c9c76f038d5f46ba1c5f3..7e97f7f023ec46e184a598b78020a437a7645cc0 100644 +index 9d085e0a5f75ef4c87f4e443ffb2d271dba82610..928862ea7641b1cb23dcc120597992e228239d19 100644 --- a/parser/html/nsHtml5TreeOpExecutor.cpp +++ b/parser/html/nsHtml5TreeOpExecutor.cpp -@@ -1377,6 +1377,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( +@@ -1448,6 +1448,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( void nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); @@ -2036,10 +1970,10 @@ index aa6b6c81f0eeba728a6c9c76f038d5f46ba1c5f3..7e97f7f023ec46e184a598b78020a437 nsCOMPtr preloadCsp = mDocument->GetPreloadCsp(); if (!preloadCsp) { diff --git a/security/manager/ssl/nsCertOverrideService.cpp b/security/manager/ssl/nsCertOverrideService.cpp -index 9d262dbf33be49f64dbfc7ff4c87db05344ecdc5..495afbbe2b830218cf6e8332cc871ab709e21b38 100644 +index 068d9702fd015c974d698d2c8c741b5d2b0d8316..9ff49d6de9d712b7e5ab9711da7f22269dc2fe49 100644 --- a/security/manager/ssl/nsCertOverrideService.cpp +++ b/security/manager/ssl/nsCertOverrideService.cpp -@@ -626,6 +626,8 @@ void nsCertOverrideService::CountPermanentOverrideTelemetry( +@@ -624,6 +624,8 @@ void nsCertOverrideService::CountPermanentOverrideTelemetry( } static bool IsDebugger() { @@ -2072,10 +2006,10 @@ index da12049e14b38adcbf074f87ecc5a5745cd9a2eb..24621137e2c8c8fac881ce4320266441 (lazy.isRunningTests || Cu.isInAutomation) && this.SERVER_URL == "data:,#remote-settings-dummy/v1" diff --git a/toolkit/components/browser/nsIWebBrowserChrome.idl b/toolkit/components/browser/nsIWebBrowserChrome.idl -index e2b69d51df97f5bb22eba0a4b9ead3f47256dfb6..2168b1381616ef747875e1137d748c8fcd2b8ec3 100644 +index a665bd039d49aeeb6896e224080a7cc00b0eacbc..099c3b08d7de697cc8edcd5bb1d8000fc28aeefb 100644 --- a/toolkit/components/browser/nsIWebBrowserChrome.idl +++ b/toolkit/components/browser/nsIWebBrowserChrome.idl -@@ -88,6 +88,9 @@ interface nsIWebBrowserChrome : nsISupports +@@ -87,6 +87,9 @@ interface nsIWebBrowserChrome : nsISupports // Whether this is a Document Picture-in-Picture window const unsigned long CHROME_DOCUMENT_PIP = 1 << 22; @@ -2086,10 +2020,10 @@ index e2b69d51df97f5bb22eba0a4b9ead3f47256dfb6..2168b1381616ef747875e1137d748c8f // ignored for Linux. const unsigned long CHROME_SUPPRESS_ANIMATION = 1 << 24; diff --git a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs -index fff3c6b3e433678e01ce87a2a5253ce77f9cc2e1..4643e246bb4c506d98778dc3ea0b8b10f2c813b8 100644 +index 0d081a03a92d4bcf8642aabeabaea3e87008665f..647db4d2f61ee7b6a45de30937932a98d9eae48d 100644 --- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs +++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs -@@ -106,7 +106,9 @@ EnterprisePoliciesManager.prototype = { +@@ -115,7 +115,9 @@ EnterprisePoliciesManager.prototype = { Services.prefs.clearUserPref(PREF_POLICIES_APPLIED); } @@ -2100,7 +2034,7 @@ index fff3c6b3e433678e01ce87a2a5253ce77f9cc2e1..4643e246bb4c506d98778dc3ea0b8b10 if (provider.failed) { this.status = Ci.nsIEnterprisePolicies.FAILED; -@@ -619,6 +621,19 @@ class JSONPoliciesProvider { +@@ -687,6 +689,19 @@ class JSONPoliciesProvider { } } @@ -2121,10 +2055,10 @@ index fff3c6b3e433678e01ce87a2a5253ce77f9cc2e1..4643e246bb4c506d98778dc3ea0b8b10 constructor() { this._policies = null; diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp -index c5eddf7f3f91ec617fd65840a1a2482cf0ed32c1..43e2d7c71b0b95946d1a69d94b674f56224d0730 100644 +index 772232ea098016e010e7d9ff04754216f91666bf..75a959d89463957fd4da7bee2c0ae42e16ca7c90 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp -@@ -360,7 +360,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) { +@@ -359,7 +359,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) { nsCOMPtr windowEnumerator; nsCOMPtr mediator( do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); @@ -2134,10 +2068,10 @@ index c5eddf7f3f91ec617fd65840a1a2482cf0ed32c1..43e2d7c71b0b95946d1a69d94b674f56 if (windowEnumerator) { bool more; diff --git a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp -index 36fe2d427ee8e6c52e32930367cbddfa22e0444b..593795dfb21d215895521a1cfb998339a71c5a81 100644 +index efe8ff5541915c0fc632e75572d1e3968c60139d..e0157515ded811e47d21705f13f475d61998fd78 100644 --- a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp +++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp -@@ -176,8 +176,8 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress* aWebProgress, +@@ -175,8 +175,8 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress* aWebProgress, } NS_IMETHODIMP @@ -2149,10 +2083,10 @@ index 36fe2d427ee8e6c52e32930367cbddfa22e0444b..593795dfb21d215895521a1cfb998339 int32_t aMaxSelfProgress, int32_t aCurTotalProgress, diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.cpp b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -index af0e6b01844fc52b1ee771eb80f414024545493a..f563ee4a69f33f463be59a7eeb55230c790bcfad 100644 +index 387727f68ca95bd1da6788b909da69881aa949f3..9925947e126e3186616a0d00e6f118b612f48cb4 100644 --- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp +++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -@@ -1918,7 +1918,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( +@@ -1922,7 +1922,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( // Open a minimal popup. *aIsPopupRequested = true; @@ -2166,10 +2100,10 @@ index af0e6b01844fc52b1ee771eb80f414024545493a..f563ee4a69f33f463be59a7eeb55230c /** diff --git a/toolkit/mozapps/update/UpdateService.sys.mjs b/toolkit/mozapps/update/UpdateService.sys.mjs -index 2a02e586524384ea45d31f084f9a10ef47cc60b6..d8ae08c71a068bb93254d9e5fa8793c2b9237d46 100644 +index db167b74f040cdb477f68c87c4dfe50ef1173c32..78690b35f701df5a683ea3e392b2f7757f66c73e 100644 --- a/toolkit/mozapps/update/UpdateService.sys.mjs +++ b/toolkit/mozapps/update/UpdateService.sys.mjs -@@ -4026,6 +4026,8 @@ export class UpdateService { +@@ -4024,6 +4024,8 @@ export class UpdateService { } get disabledForTesting() { @@ -2179,10 +2113,10 @@ index 2a02e586524384ea45d31f084f9a10ef47cc60b6..d8ae08c71a068bb93254d9e5fa8793c2 } diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild -index 24f86c7c546995f0dee045d05122a0f70ed70b11..580d38caec31b84e88e22a002cd27add7b2dab79 100644 +index f3c59b08567c9b4ed1b5ccb3eeea845cf7a4808b..70bf13928f67e96c92369f5df2fee2aee78d000c 100644 --- a/toolkit/toolkit.mozbuild +++ b/toolkit/toolkit.mozbuild -@@ -155,6 +155,7 @@ if CONFIG["ENABLE_WEBDRIVER"]: +@@ -154,6 +154,7 @@ if CONFIG["ENABLE_WEBDRIVER"]: "/remote", "/testing/firefox-ui", "/testing/marionette", @@ -2226,10 +2160,10 @@ index b7c376eadc1460b0f4e378ca3047eb82a079c19c..44385776349e13f7452d7c1b382cf738 // 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 25b07226295c1aa3a35468fd6a86d92ac1d10d12..911380185f6377e8c9435c1baa0ac037e33519ad 100644 +index 059ef152a4c7146ed01ff8c3601584feed23cad4..772c7428afa6ebea5dae97a62daa0fb0f0152609 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp -@@ -885,6 +885,12 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout, +@@ -884,6 +884,12 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout, mIsLoadingJavascriptURI ? "javascript URI" : "document.open")); @@ -2243,10 +2177,10 @@ index 25b07226295c1aa3a35468fd6a86d92ac1d10d12..911380185f6377e8c9435c1baa0ac037 // 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 45919614755ee5ebbdd27df065808f699168c4bc..cfce3eac34664e2eaf778db1a169ef84d37d7109 100644 +index bad0ab78783560b0f3871ddd89c78f315fa13087..f126f30d3940f4b911e3c69ad466933e9eb3ed7a 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp -@@ -112,6 +112,7 @@ +@@ -110,6 +110,7 @@ #include "mozilla/Components.h" #include "mozilla/ClearOnShutdown.h" @@ -2254,7 +2188,7 @@ index 45919614755ee5ebbdd27df065808f699168c4bc..cfce3eac34664e2eaf778db1a169ef84 #include "mozilla/Preferences.h" #include "mozilla/ipc/URIUtils.h" -@@ -867,6 +868,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension( +@@ -884,6 +885,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension( return NS_OK; } @@ -2267,7 +2201,7 @@ index 45919614755ee5ebbdd27df065808f699168c4bc..cfce3eac34664e2eaf778db1a169ef84 nsresult nsExternalHelperAppService::GetFileTokenForPath( const char16_t* aPlatformAppPath, nsIFile** aFile) { nsDependentString platformAppPath(aPlatformAppPath); -@@ -1498,7 +1505,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { +@@ -1517,7 +1524,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { // Strip off the ".part" from mTempLeafName mTempLeafName.Truncate(mTempLeafName.Length() - std::size(".part") + 1); @@ -2280,7 +2214,7 @@ index 45919614755ee5ebbdd27df065808f699168c4bc..cfce3eac34664e2eaf778db1a169ef84 mSaver = do_CreateInstance(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); -@@ -1682,7 +1694,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1701,7 +1713,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { return NS_OK; } @@ -2318,7 +2252,7 @@ index 45919614755ee5ebbdd27df065808f699168c4bc..cfce3eac34664e2eaf778db1a169ef84 if (NS_FAILED(rv)) { nsresult transferError = rv; -@@ -1743,6 +1784,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1763,6 +1804,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { bool alwaysAsk = true; mMimeInfo->GetAlwaysAskBeforeHandling(&alwaysAsk); @@ -2328,7 +2262,7 @@ index 45919614755ee5ebbdd27df065808f699168c4bc..cfce3eac34664e2eaf778db1a169ef84 if (alwaysAsk) { // But we *don't* ask if this mimeInfo didn't come from // our user configuration datastore and the user has said -@@ -2259,6 +2303,15 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, +@@ -2279,6 +2323,15 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, NotifyTransfer(aStatus); } @@ -2344,7 +2278,7 @@ index 45919614755ee5ebbdd27df065808f699168c4bc..cfce3eac34664e2eaf778db1a169ef84 return NS_OK; } -@@ -2742,6 +2795,14 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { +@@ -2764,6 +2817,14 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { } } @@ -2360,10 +2294,10 @@ index 45919614755ee5ebbdd27df065808f699168c4bc..cfce3eac34664e2eaf778db1a169ef84 // OnStartRequest) mDialog = nullptr; diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h -index 968d7ab01fabcb03cbf2dd1d1ea085556a4c617f..b58b60ae6c2269b85c07a0d7ef9e8c698334e340 100644 +index 3f8586ed7ee54af197a82b7a69651b4be2f84dad..929fe5b2b58ceef4055415cfc36a6698b73cba4c 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.h +++ b/uriloader/exthandler/nsExternalHelperAppService.h -@@ -270,6 +270,8 @@ class nsExternalHelperAppService : public nsIExternalHelperAppService, +@@ -269,6 +269,8 @@ class nsExternalHelperAppService : public nsIExternalHelperAppService, mozilla::dom::BrowsingContext* aContentContext, bool aForceSave, nsIInterfaceRequestor* aWindowContext, nsIStreamListener** aStreamListener); @@ -2383,10 +2317,10 @@ index 968d7ab01fabcb03cbf2dd1d1ea085556a4c617f..b58b60ae6c2269b85c07a0d7ef9e8c69 * When we download a helper app, we are going to retarget all load * notifications into our own docloader and load group instead of diff --git a/uriloader/exthandler/nsIExternalHelperAppService.idl b/uriloader/exthandler/nsIExternalHelperAppService.idl -index e6490ebb086eb4dca9db560c14e073a9e7722e29..2792373dcb30ebc787a9bdca306ac12e72aa19ec 100644 +index f5c40986adad5a9354d1ef1b86e058c83064a7f6..99708fe18ddb939334a9f830ca809b77e8e146bd 100644 --- a/uriloader/exthandler/nsIExternalHelperAppService.idl +++ b/uriloader/exthandler/nsIExternalHelperAppService.idl -@@ -6,8 +6,11 @@ +@@ -5,8 +5,11 @@ #include "nsICancelable.idl" @@ -2398,7 +2332,7 @@ index e6490ebb086eb4dca9db560c14e073a9e7722e29..2792373dcb30ebc787a9bdca306ac12e interface nsIStreamListener; interface nsIFile; interface nsIMIMEInfo; -@@ -15,6 +18,17 @@ interface nsIWebProgressListener2; +@@ -14,6 +17,17 @@ interface nsIWebProgressListener2; interface nsIInterfaceRequestor; webidl BrowsingContext; @@ -2416,7 +2350,7 @@ index e6490ebb086eb4dca9db560c14e073a9e7722e29..2792373dcb30ebc787a9bdca306ac12e /** * The external helper app service is used for finding and launching * platform specific external applications for a given mime content type. -@@ -87,6 +101,8 @@ interface nsIExternalHelperAppService : nsISupports +@@ -86,6 +100,8 @@ interface nsIExternalHelperAppService : nsISupports * `DownloadIntegration.sys.mjs`, which is implemented on all platforms. */ nsIFile getPreferredDownloadsDirectory(); @@ -2456,38 +2390,10 @@ index 777157e17e0db442262b1a9522b0b1b39058789a..54c4dde2ee4847e79b07fffe3ec57a34 } #endif diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.mm -index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf56dbd408e 100644 +index 9711cfaf4e3e2974567ea7f7d4074b3541b0248f..34292be04676193f1b8efce45d4fa370c15e970f 100644 --- a/widget/cocoa/NativeKeyBindings.mm +++ b/widget/cocoa/NativeKeyBindings.mm -@@ -549,6 +549,13 @@ - break; - case KEY_NAME_INDEX_ArrowLeft: - if (aEvent.IsAlt()) { -+ if (aEvent.IsMeta() || aEvent.IsControl()) -+ break; -+ instance->AppendEditCommandsForSelector( -+ !aEvent.IsShift() -+ ? ToObjcSelectorPtr(@selector(moveWordLeft:)) -+ : ToObjcSelectorPtr(@selector(moveWordLeftAndModifySelection:)), -+ aCommands); - break; - } - if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) { -@@ -571,6 +578,13 @@ - break; - case KEY_NAME_INDEX_ArrowRight: - if (aEvent.IsAlt()) { -+ if (aEvent.IsMeta() || aEvent.IsControl()) -+ break; -+ instance->AppendEditCommandsForSelector( -+ !aEvent.IsShift() -+ ? ToObjcSelectorPtr(@selector(moveWordRight:)) -+ : ToObjcSelectorPtr(@selector(moveWordRightAndModifySelection:)), -+ aCommands); - break; - } - if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) { -@@ -593,6 +607,10 @@ +@@ -618,6 +618,10 @@ break; case KEY_NAME_INDEX_ArrowUp: if (aEvent.IsControl()) { @@ -2498,16 +2404,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5 break; } if (aEvent.IsMeta()) { -@@ -603,7 +621,7 @@ - !aEvent.IsShift() - ? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:)) - : ToObjcSelectorPtr( -- @selector(moveToBegginingOfDocumentAndModifySelection:)), -+ @selector(moveToBeginningOfDocumentAndModifySelection:)), - aCommands); - break; - } -@@ -630,6 +648,10 @@ +@@ -655,6 +659,10 @@ break; case KEY_NAME_INDEX_ArrowDown: if (aEvent.IsControl()) { @@ -2519,10 +2416,10 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5 } if (aEvent.IsMeta()) { diff --git a/widget/headless/HeadlessCompositorWidget.cpp b/widget/headless/HeadlessCompositorWidget.cpp -index bb4ee9175e66dc40de1871a7f91368fe309494a3..7153fc6b8cd9a0288245f82963dfaa17101bd89e 100644 +index cbaa021c9d31cd57e253afd984c5076acab1941e..6cf72e6006e33eac7720958f7d0cd91983f2d782 100644 --- a/widget/headless/HeadlessCompositorWidget.cpp +++ b/widget/headless/HeadlessCompositorWidget.cpp -@@ -3,6 +3,8 @@ +@@ -2,6 +2,8 @@ * 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/. */ @@ -2531,7 +2428,7 @@ index bb4ee9175e66dc40de1871a7f91368fe309494a3..7153fc6b8cd9a0288245f82963dfaa17 #include "mozilla/widget/PlatformWidgetTypes.h" #include "HeadlessCompositorWidget.h" #include "VsyncDispatcher.h" -@@ -15,9 +17,30 @@ HeadlessCompositorWidget::HeadlessCompositorWidget( +@@ -14,9 +16,30 @@ HeadlessCompositorWidget::HeadlessCompositorWidget( const layers::CompositorOptions& aOptions, HeadlessWidget* aWindow) : CompositorWidget(aOptions), mWidget(aWindow), @@ -2562,7 +2459,7 @@ index bb4ee9175e66dc40de1871a7f91368fe309494a3..7153fc6b8cd9a0288245f82963dfaa17 void HeadlessCompositorWidget::ObserveVsync(VsyncObserver* aObserver) { if (RefPtr cvd = mWidget->GetCompositorVsyncDispatcher()) { -@@ -31,6 +54,59 @@ void HeadlessCompositorWidget::NotifyClientSizeChanged( +@@ -30,6 +53,59 @@ void HeadlessCompositorWidget::NotifyClientSizeChanged( const LayoutDeviceIntSize& aClientSize) { auto size = mClientSize.Lock(); *size = aClientSize; @@ -2623,10 +2520,10 @@ index bb4ee9175e66dc40de1871a7f91368fe309494a3..7153fc6b8cd9a0288245f82963dfaa17 LayoutDeviceIntSize HeadlessCompositorWidget::GetClientSize() { diff --git a/widget/headless/HeadlessCompositorWidget.h b/widget/headless/HeadlessCompositorWidget.h -index facd2bc65afab8ec1aa322faa20a67464964dfb9..3c5751ad1b7f042bc7cd9a63895cebcd2942ccd3 100644 +index 8374cd00944eddad27563624cd33bb046b6cf143..0345d19d1da862ccd31afa49b123e9f16755c886 100644 --- a/widget/headless/HeadlessCompositorWidget.h +++ b/widget/headless/HeadlessCompositorWidget.h -@@ -6,6 +6,7 @@ +@@ -5,6 +5,7 @@ #ifndef widget_headless_HeadlessCompositorWidget_h #define widget_headless_HeadlessCompositorWidget_h @@ -2634,7 +2531,7 @@ index facd2bc65afab8ec1aa322faa20a67464964dfb9..3c5751ad1b7f042bc7cd9a63895cebcd #include "mozilla/widget/CompositorWidget.h" #include "HeadlessWidget.h" -@@ -23,8 +24,11 @@ class HeadlessCompositorWidget final : public CompositorWidget, +@@ -22,8 +23,11 @@ class HeadlessCompositorWidget final : public CompositorWidget, HeadlessWidget* aWindow); void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize); @@ -2646,7 +2543,7 @@ index facd2bc65afab8ec1aa322faa20a67464964dfb9..3c5751ad1b7f042bc7cd9a63895cebcd uintptr_t GetWidgetKey() override; -@@ -42,10 +46,18 @@ class HeadlessCompositorWidget final : public CompositorWidget, +@@ -41,10 +45,18 @@ class HeadlessCompositorWidget final : public CompositorWidget, } private: @@ -2665,11 +2562,36 @@ index facd2bc65afab8ec1aa322faa20a67464964dfb9..3c5751ad1b7f042bc7cd9a63895cebcd }; } // namespace widget +diff --git a/widget/headless/HeadlessLookAndFeelGTK.cpp b/widget/headless/HeadlessLookAndFeelGTK.cpp +index 34ef4bf32bc4c348bd226f1c3ea5a4f03ad4fac1..394e892cdf35c351b9d8536dcb82c1a130cb2095 100644 +--- a/widget/headless/HeadlessLookAndFeelGTK.cpp ++++ b/widget/headless/HeadlessLookAndFeelGTK.cpp +@@ -3,6 +3,7 @@ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + #include "HeadlessLookAndFeel.h" ++#include "mozilla/ServoTypes.h" + #include "nsStyleConsts.h" + + namespace mozilla::widget { +@@ -153,10 +154,9 @@ nsresult HeadlessLookAndFeel::NativeGetInt(IntID aID, int32_t& aResult) { + aResult = 0; + break; + case IntID::PrimaryPointerCapabilities: +- aResult = 0; +- break; + case IntID::AllPointerCapabilities: +- aResult = 0; ++ aResult = static_cast(PointerCapabilities::Fine | ++ PointerCapabilities::Hover); + break; + default: + aResult = 0; diff --git a/widget/headless/HeadlessWidget.cpp b/widget/headless/HeadlessWidget.cpp -index d47d8992b767403459a75334ff027d609567a2f7..0e76476a68b6e5ab166c084861e82ee343e5b86f 100644 +index 867b4a9fd9926c5b560057656fd0641b1e5d198c..0d239412f9802f3ece3b5f85aedca3ce4b2a661b 100644 --- a/widget/headless/HeadlessWidget.cpp +++ b/widget/headless/HeadlessWidget.cpp -@@ -113,6 +113,8 @@ void HeadlessWidget::Destroy() { +@@ -112,6 +112,8 @@ void HeadlessWidget::Destroy() { } } @@ -2678,7 +2600,7 @@ index d47d8992b767403459a75334ff027d609567a2f7..0e76476a68b6e5ab166c084861e82ee3 nsIWidget::OnDestroy(); nsIWidget::Destroy(); -@@ -573,5 +575,14 @@ nsresult HeadlessWidget::SynthesizeNativeTouchpadPan( +@@ -572,5 +574,14 @@ nsresult HeadlessWidget::SynthesizeNativeTouchpadPan( return NS_OK; } @@ -2694,10 +2616,10 @@ index d47d8992b767403459a75334ff027d609567a2f7..0e76476a68b6e5ab166c084861e82ee3 } // namespace widget } // namespace mozilla diff --git a/widget/headless/HeadlessWidget.h b/widget/headless/HeadlessWidget.h -index 81c583f4cb8c8ded1802bb56dbe701594d5760a0..d0c835d584f7dda23afe2e4b1a323e311a575a75 100644 +index ca31e584b77cee280dc61ce15ffaf13380ba17c8..1dff8fd40c2d7debe348c7c82309aeee394acb7c 100644 --- a/widget/headless/HeadlessWidget.h +++ b/widget/headless/HeadlessWidget.h -@@ -128,6 +128,9 @@ class HeadlessWidget final : public nsIWidget { +@@ -127,6 +127,9 @@ class HeadlessWidget final : public nsIWidget { double aDeltaX, double aDeltaY, int32_t aModifierFlags, nsISynthesizedEventCallback* aCallback) override; @@ -2708,10 +2630,10 @@ index 81c583f4cb8c8ded1802bb56dbe701594d5760a0..d0c835d584f7dda23afe2e4b1a323e31 ~HeadlessWidget(); bool mEnabled; diff --git a/xpcom/reflect/xptinfo/xptinfo.h b/xpcom/reflect/xptinfo/xptinfo.h -index 1c0aff31b98e61fb1154e914b4af50c899b24187..bbac5fa58a7047ababf27cc9be53dcca643d98a7 100644 +index 2888ffaf432e16d67d348ff008372fbb96c06991..cd4cce73f69bee86d4fb7cb510cd60de0cbcd0b8 100644 --- a/xpcom/reflect/xptinfo/xptinfo.h +++ b/xpcom/reflect/xptinfo/xptinfo.h -@@ -505,7 +505,7 @@ static_assert(sizeof(nsXPTMethodInfo) == 8, "wrong size"); +@@ -503,7 +503,7 @@ static_assert(sizeof(nsXPTMethodInfo) == 8, "wrong size"); #if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) # define PARAM_BUFFER_COUNT 18 #else diff --git a/browser_patches/firefox/preferences/playwright.cfg b/browser_patches/firefox/preferences/playwright.cfg index 85deeb3816bc4..f6a3cd845c1f9 100644 --- a/browser_patches/firefox/preferences/playwright.cfg +++ b/browser_patches/firefox/preferences/playwright.cfg @@ -8,6 +8,8 @@ pref("dom.input_events.security.minTimeElapsedInMS", 0); pref("dom.iframe_lazy_loading.enabled", false); +pref("dom.permissions.testing.enabled", true); + // Allows a custom "policies.json" file. pref("browser.policies.alternatePath", getenv("PLAYWRIGHT_FIREFOX_POLICIES_JSON") || ""); @@ -95,6 +97,9 @@ pref("geo.provider.testing", true); // ================================================================= // THESE ARE NICHE PROPERTIES THAT ARE NICE TO HAVE // ================================================================= +// When true, cookies without '=' are parsed as valueless (name="foo", value="") +// instead of nameless (name="", value="foo") +pref("network.cookie.valueless_cookie", false); // We never want to have interactive screen capture picker enabled in FF build. pref("media.getdisplaymedia.screencapturekit.enabled", false); diff --git a/packages/playwright-core/browsers.json b/packages/playwright-core/browsers.json index 9eeec34e9f999..5f22720fa96b1 100644 --- a/packages/playwright-core/browsers.json +++ b/packages/playwright-core/browsers.json @@ -31,7 +31,7 @@ }, { "name": "firefox", - "revision": "1535", + "revision": "1536", "installByDefault": true, "browserVersion": "152.0.4", "title": "Firefox"