diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000000000..54cf652ae21b6 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,17 @@ +name: "Copilot Setup Steps" +on: workflow_dispatch +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + - run: npm ci + - run: npm run build + - run: npx playwright install --with-deps diff --git a/.github/workflows/merge.config.ts b/.github/workflows/merge.config.ts index 71031b1c96d45..222b728f7c134 100644 --- a/.github/workflows/merge.config.ts +++ b/.github/workflows/merge.config.ts @@ -1,4 +1,4 @@ export default { testDir: '../../tests', - reporter: [[require.resolve('../../packages/playwright-dashboard/lib/ghaMarkdownReporter')], ['html']] + reporter: [[require.resolve('../../tests/config/ghaMarkdownReporter')], ['html']] }; \ No newline at end of file diff --git a/.github/workflows/pr_check_client_side_changes.yml b/.github/workflows/pr_check_client_side_changes.yml index c40c0661f3bc9..12b7e5dff9131 100644 --- a/.github/workflows/pr_check_client_side_changes.yml +++ b/.github/workflows/pr_check_client_side_changes.yml @@ -46,7 +46,7 @@ jobs: const title = '[Ports]: Backport client side changes for ' + currentPlaywrightVersion; for (const repo of ['playwright-python', 'playwright-java', 'playwright-dotnet']) { const { data: issuesData } = await github.rest.search.issuesAndPullRequests({ - q: `is:issue is:open repo:microsoft/${repo} in:title "${title}" author:playwrightmachine` + q: `is:issue is:open repo:microsoft/${repo} in:title "${title}"` }) let issueNumber = null; let issueBody = ''; diff --git a/.github/workflows/roll_browser_into_playwright.yml b/.github/workflows/roll_browser_into_playwright.yml index d167e01fd578b..3dc822638e361 100644 --- a/.github/workflows/roll_browser_into_playwright.yml +++ b/.github/workflows/roll_browser_into_playwright.yml @@ -3,25 +3,18 @@ name: Roll Browser into Playwright on: repository_dispatch: types: [roll_into_pw] - workflow_dispatch: - inputs: - browser: - description: 'Browser name, e.g. chromium' - required: true - type: string - revision: - description: 'Browser revision without v prefix, e.g. 1234' - required: true - type: string env: ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - BROWSER: ${{ github.event.client_payload.browser || github.event.inputs.browser }} - REVISION: ${{ github.event.client_payload.revision || github.event.inputs.revision }} + BROWSER: ${{ github.event.client_payload.browser }} + REVISION: ${{ github.event.client_payload.revision }} permissions: contents: write +concurrency: + group: 'roll-browser-into-playwright-${{ github.event.client_payload.browser }}-${{ github.event.client_payload.revision }}' + jobs: roll: runs-on: ubuntu-24.04 @@ -43,6 +36,15 @@ jobs: run: | BRANCH_NAME="roll-into-pw-${BROWSER}/${REVISION}" echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT + + git fetch origin $BRANCH_NAME:$BRANCH_NAME || true + if git show-ref --verify --quiet refs/heads/$BRANCH_NAME; then + echo "exists=1" >> $GITHUB_OUTPUT + echo "branch $BRANCH_NAME already exists, exiting" + exit 0 + fi + echo "exists=0" >> $GITHUB_OUTPUT + git config --global user.name microsoft-playwright-automation[bot] git config --global user.email 203992400+microsoft-playwright-automation[bot]@users.noreply.github.com git checkout -b "$BRANCH_NAME" @@ -56,6 +58,7 @@ jobs: private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }} - name: Create Pull Request uses: actions/github-script@v7 + if: ${{ steps.prepare-branch.outputs.exists == '0' }} with: github-token: ${{ steps.app-token.outputs.token }} script: | diff --git a/README.md b/README.md index b4b24c6903bd6..b5dcab4d78cfc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🎭 Playwright -[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) [![Chromium version](https://img.shields.io/badge/chromium-136.0.7103.25-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-137.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-18.4-blue.svg?logo=safari)](https://webkit.org/) [![Join Discord](https://img.shields.io/badge/join-discord-infomational)](https://aka.ms/playwright/discord) +[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) [![Chromium version](https://img.shields.io/badge/chromium-138.0.7204.23-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-139.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-18.5-blue.svg?logo=safari)](https://webkit.org/) [![Join Discord](https://img.shields.io/badge/join-discord-infomational)](https://aka.ms/playwright/discord) ## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright) @@ -8,9 +8,9 @@ Playwright is a framework for Web Testing and Automation. It allows testing [Chr | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 136.0.7103.25 | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| WebKit 18.4 | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Firefox 137.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 138.0.7204.23 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| WebKit 18.5 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 139.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | Headless execution is supported for all browsers on all platforms. Check out [system requirements](https://playwright.dev/docs/intro#system-requirements) for details. diff --git a/browser_patches/firefox/UPSTREAM_CONFIG.sh b/browser_patches/firefox/UPSTREAM_CONFIG.sh index 2b6979cfaba4a..db9424fcf3779 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/gecko-dev" BASE_BRANCH="release" -BASE_REVISION="4764531b2bb14867dde520d74f6a3c88690e0751" +BASE_REVISION="9cbfae27052e4aaeb064d2d08e7e869f31ee4288" diff --git a/browser_patches/firefox/juggler/Helper.js b/browser_patches/firefox/juggler/Helper.js index f5a64d6c8bc33..875dd5ac2e8b3 100644 --- a/browser_patches/firefox/juggler/Helper.js +++ b/browser_patches/firefox/juggler/Helper.js @@ -4,9 +4,9 @@ const uuidGen = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator); -class Helper { +export class Helper { decorateAsEventEmitter(objectToDecorate) { - const { EventEmitter } = ChromeUtils.import('resource://gre/modules/EventEmitter.jsm'); + const { EventEmitter } = ChromeUtils.importESModule('resource://gre/modules/EventEmitter.sys.mjs'); const emitter = new EventEmitter(); objectToDecorate.on = emitter.on.bind(emitter); objectToDecorate.addEventListener = emitter.on.bind(emitter); @@ -172,7 +172,7 @@ class Helper { const helper = new Helper(); -class EventWatcher { +export class EventWatcher { constructor(receiver, eventNames, pendingEventWatchers = new Set()) { this._pendingEventWatchers = pendingEventWatchers; this._pendingEventWatchers.add(this); @@ -233,7 +233,3 @@ class EventWatcher { } } -var EXPORTED_SYMBOLS = [ "Helper", "EventWatcher" ]; -this.Helper = Helper; -this.EventWatcher = EventWatcher; - diff --git a/browser_patches/firefox/juggler/JugglerFrameParent.jsm b/browser_patches/firefox/juggler/JugglerFrameParent.jsm index e621fab240680..9c3b58898955e 100644 --- a/browser_patches/firefox/juggler/JugglerFrameParent.jsm +++ b/browser_patches/firefox/juggler/JugglerFrameParent.jsm @@ -1,13 +1,11 @@ "use strict"; -const { TargetRegistry } = ChromeUtils.import('chrome://juggler/content/TargetRegistry.js'); -const { Helper } = ChromeUtils.import('chrome://juggler/content/Helper.js'); +const { TargetRegistry } = ChromeUtils.importESModule('chrome://juggler/content/TargetRegistry.js'); +const { Helper } = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); const helper = new Helper(); -var EXPORTED_SYMBOLS = ['JugglerFrameParent']; - -class JugglerFrameParent extends JSWindowActorParent { +export class JugglerFrameParent extends JSWindowActorParent { constructor() { super(); } diff --git a/browser_patches/firefox/juggler/NetworkObserver.js b/browser_patches/firefox/juggler/NetworkObserver.js index 2ee599606888e..e3df3b15b7bb0 100644 --- a/browser_patches/firefox/juggler/NetworkObserver.js +++ b/browser_patches/firefox/juggler/NetworkObserver.js @@ -4,9 +4,9 @@ "use strict"; -const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {NetUtil} = ChromeUtils.import('resource://gre/modules/NetUtil.jsm'); -const { ChannelEventSinkFactory } = ChromeUtils.import("chrome://remote/content/cdp/observers/ChannelEventSink.jsm"); +const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); +const {NetUtil} = ChromeUtils.importESModule('resource://gre/modules/NetUtil.sys.mjs'); +const { ChannelEventSinkFactory } = ChromeUtils.importESModule("chrome://remote/content/cdp/observers/ChannelEventSink.sys.mjs"); const Cc = Components.classes; @@ -28,7 +28,7 @@ const MAX_RESPONSE_STORAGE_SIZE = 100 * 1024 * 1024; const pageNetworkSymbol = Symbol('PageNetwork'); -class PageNetwork { +export class PageNetwork { static forPageTarget(target) { if (!target) return undefined; @@ -143,9 +143,10 @@ class NetworkRequest { const target = this._networkObserver._targetRegistry.targetForBrowserId(browsingContext.browserId); this._pageNetwork = PageNetwork.forPageTarget(target); } - this._expectingInterception = false; + this._shouldYieldInterceptionToServiceWorker = false; this._expectingResumedRequest = undefined; // { method, headers, postData } this._overriddenHeadersForRedirect = redirectedFrom?._overriddenHeadersForRedirect; + this._sentOnRequest = false; this._sentOnResponse = false; this._fulfilled = false; @@ -204,11 +205,13 @@ class NetworkRequest { this._interceptedChannel.synthesizeHeader(header.name, header.value); if (header.name.toLowerCase() === 'set-cookie') { Services.cookies.QueryInterface(Ci.nsICookieService); - Services.cookies.setCookieStringFromHttp(this.httpChannel.URI, header.value, this.httpChannel); + for (const cookieString of header.value.split('\n')) + Services.cookies.setCookieStringFromHttp(this.httpChannel.URI, cookieString, this.httpChannel); } } const synthesized = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream); - synthesized.data = base64body ? atob(base64body) : ''; + if (base64body) + synthesized.setByteStringData(atob(base64body)); this._interceptedChannel.startSynthesizedResponse(synthesized, null, null, '', false); this._interceptedChannel.finishSynthesizedResponse(); this._interceptedChannel = undefined; @@ -316,9 +319,8 @@ class NetworkRequest { const interceptController = this._fallThroughInterceptController(); if (interceptController && interceptController.shouldPrepareForIntercept(aURI, channel)) { // We assume that interceptController is a service worker if there is one, - // and yield interception to it. We are not going to intercept ourselves, - // so we send onRequest now. - this._sendOnRequest(false); + // and yield interception to it. + this._shouldYieldInterceptionToServiceWorker = true; return true; } @@ -327,12 +329,6 @@ class NetworkRequest { return false; } - // We do not want to intercept any redirects, because we are not able - // to intercept subresource redirects, and it's unreliable for main requests. - // We do not sendOnRequest here, because redirects do that in constructor. - if (this.redirectedFromId) - return false; - const shouldIntercept = this._shouldIntercept(); if (!shouldIntercept) { // We are not intercepting - ready to issue onRequest. @@ -340,21 +336,24 @@ class NetworkRequest { return false; } - this._expectingInterception = true; return true; } // nsINetworkInterceptController channelIntercepted(intercepted) { - if (!this._expectingInterception) { - // We are not intercepting, fall-through. - const interceptController = this._fallThroughInterceptController(); - if (interceptController) - interceptController.channelIntercepted(intercepted); + // Yield to a service worker if determined so in shouldPrepareForIntercept(). + const serviceWorker = this._shouldYieldInterceptionToServiceWorker ? this._fallThroughInterceptController() : undefined; + // Clear the flag to avoid an infinite loop. After service worker, we should intercept ourselves. + this._shouldYieldInterceptionToServiceWorker = false; + + if (serviceWorker) { + const interceptedChannel = intercepted.QueryInterface(Ci.nsIInterceptedChannel); + // If service worker will not actually intercept the request, we want to be called again. + interceptedChannel.interceptAfterServiceWorkerResets(); + serviceWorker.channelIntercepted(intercepted); return; } - this._expectingInterception = false; this._interceptedChannel = intercepted.QueryInterface(Ci.nsIInterceptedChannel); const pageNetwork = this._pageNetwork; @@ -408,6 +407,7 @@ class NetworkRequest { // See https://github.com/microsoft/playwright/issues/9418#issuecomment-944836244 if (aRequest !== this.httpChannel) return; + this._sendOnRequest(false); try { this._originalListener.onStartRequest(aRequest); } catch (e) { @@ -445,6 +445,10 @@ class NetworkRequest { } _shouldIntercept() { + // We do not want to intercept any redirects, because we are not able + // to intercept subresource redirects, and it's unreliable for main requests. + if (this.redirectedFromId) + return false; const pageNetwork = this._pageNetwork; if (!pageNetwork) return false; @@ -465,8 +469,15 @@ class NetworkRequest { } _sendOnRequest(isIntercepted) { - // Note: we call _sendOnRequest either after we intercepted the request, - // or at the first moment we know that we are not going to intercept. + if (this._sentOnRequest) { + // We can come here twice because: + // - Redirects call _sendOnRequest in the constructor and from inside interception. + // - All other requests might call _sendOnRequest from onStartRequest and from inside interception. + // - All requests call _sendOnRequest from _sendOnResponse to avoid responses without requests. + return; + } + this._sentOnRequest = true; + const pageNetwork = this._pageNetwork; if (!pageNetwork) return; @@ -489,11 +500,21 @@ class NetworkRequest { } _sendOnResponse(fromCache, opt_statusCode, opt_statusText) { + // For internal redirects, and perhaps something else that we lack test coverage for, + // we can arrive here before onStartRequest has fired. Make sure we + // notify about the request first. + this._sendOnRequest(false); + if (this._sentOnResponse) { - // We can come here twice because of internal redirects, e.g. service workers. + // We can come here twice because of an internal redirect, for example: + // - request was intercepted by a service worker; + // - HSTS redirect; + // - CORS preflight; + // - who knows what else? return; } this._sentOnResponse = true; + const pageNetwork = this._pageNetwork; if (!pageNetwork) return; @@ -574,7 +595,7 @@ class NetworkRequest { } } -class NetworkObserver { +export class NetworkObserver { static instance() { return NetworkObserver._instance || null; } @@ -774,6 +795,10 @@ function clearRequestHeaders(httpChannel) { // We cannot remove the "host" header. if (header.name.toLowerCase() === 'host') continue; + // Keep the "cookie" header. If there is an override, it will be set anyway. + // Otherwise, we may delete a cookie that was set for a redirect. + if (header.name.toLowerCase() === 'cookie') + continue; httpChannel.setRequestHeader(header.name, '', false /* merge */); } } @@ -870,7 +895,7 @@ function setPostData(httpChannel, postData, headers) { return; const synthesized = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream); const body = atob(postData); - synthesized.setData(body, body.length); + synthesized.setByteStringData(body); const overriddenHeader = (lowerCaseName) => { if (headers) { @@ -902,7 +927,7 @@ function convertString(s, source, dest) { const is = Cc["@mozilla.org/io/string-input-stream;1"].createInstance( Ci.nsIStringInputStream ); - is.setData(s, s.length); + is.setByteStringData(s); const listener = Cc["@mozilla.org/network/stream-loader;1"].createInstance( Ci.nsIStreamLoader ); @@ -962,6 +987,3 @@ PageNetwork.Events = { RequestFailed: Symbol('PageNetwork.Events.RequestFailed'), }; -var EXPORTED_SYMBOLS = ['NetworkObserver', 'PageNetwork']; -this.NetworkObserver = NetworkObserver; -this.PageNetwork = PageNetwork; diff --git a/browser_patches/firefox/juggler/SimpleChannel.js b/browser_patches/firefox/juggler/SimpleChannel.js index a4e1b19df4c6d..cc555451cdd49 100644 --- a/browser_patches/firefox/juggler/SimpleChannel.js +++ b/browser_patches/firefox/juggler/SimpleChannel.js @@ -79,7 +79,7 @@ class SimpleChannel { _setTimeout(cb, timeout) { // Lazy load on first call. - this._setTimeout = ChromeUtils.import('resource://gre/modules/Timer.jsm').setTimeout; + this._setTimeout = ChromeUtils.importESModule('resource://gre/modules/Timer.sys.mjs').setTimeout; this._setTimeout(cb, timeout); } @@ -251,6 +251,3 @@ class SimpleChannel { } } } - -var EXPORTED_SYMBOLS = ['SimpleChannel']; -this.SimpleChannel = SimpleChannel; diff --git a/browser_patches/firefox/juggler/TargetRegistry.js b/browser_patches/firefox/juggler/TargetRegistry.js index fb6280faebf5b..4bdf162ab64f7 100644 --- a/browser_patches/firefox/juggler/TargetRegistry.js +++ b/browser_patches/firefox/juggler/TargetRegistry.js @@ -2,12 +2,11 @@ * 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/. */ -const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {SimpleChannel} = ChromeUtils.import('chrome://juggler/content/SimpleChannel.js'); -const {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm"); -const {ContextualIdentityService} = ChromeUtils.import("resource://gre/modules/ContextualIdentityService.jsm"); -const {NetUtil} = ChromeUtils.import('resource://gre/modules/NetUtil.jsm'); -const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); +const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); +const {Preferences} = ChromeUtils.importESModule("resource://gre/modules/Preferences.sys.mjs"); +const {ContextualIdentityService} = ChromeUtils.importESModule("resource://gre/modules/ContextualIdentityService.sys.mjs"); +const {NetUtil} = ChromeUtils.importESModule('resource://gre/modules/NetUtil.sys.mjs'); +const {AppConstants} = ChromeUtils.importESModule("resource://gre/modules/AppConstants.sys.mjs"); const Cr = Components.results; @@ -22,6 +21,9 @@ const ALL_PERMISSIONS = [ ]; let globalTabAndWindowActivationChain = Promise.resolve(); +// This is a workaround for https://github.com/microsoft/playwright/issues/34586 +let didCreateFirstPage = false; +let globalNewPageChain = Promise.resolve(); class DownloadInterceptor { constructor(registry) { @@ -102,7 +104,7 @@ class DownloadInterceptor { const screencastService = Cc['@mozilla.org/juggler/screencast;1'].getService(Ci.nsIScreencastService); -class TargetRegistry { +export class TargetRegistry { static instance() { return TargetRegistry._instance || null; } @@ -308,6 +310,16 @@ class TargetRegistry { } async newPage({browserContextId}) { + // When creating the very first page, we cannot create multiple in parallel. + // See https://github.com/microsoft/playwright/issues/34586. + if (didCreateFirstPage) + return this._newPageInternal({browserContextId}); + const result = globalNewPageChain.then(() => this._newPageInternal({browserContextId})); + globalNewPageChain = result.catch(error => { /* swallow errors to keep chain running */ }); + return result; + } + + async _newPageInternal({browserContextId}) { const browserContext = this.browserContextForId(browserContextId); const features = "chrome,dialog=no,all"; // See _callWithURIToLoad in browser.js for the structure of window.arguments @@ -356,6 +368,7 @@ class TargetRegistry { if (await target.hasFailedToOverrideTimezone()) throw new Error('Failed to override timezone'); } + didCreateFirstPage = true; return target.id(); } @@ -372,7 +385,7 @@ class TargetRegistry { } } -class PageTarget { +export class PageTarget { constructor(registry, win, tab, browserContext, opener) { helper.decorateAsEventEmitter(this); @@ -501,6 +514,7 @@ class PageTarget { this.updateEmulatedMedia(browsingContext); this.updateColorSchemeOverride(browsingContext); this.updateReducedMotionOverride(browsingContext); + this.updateContrastOverride(browsingContext); this.updateForcedColorsOverride(browsingContext); this.updateForceOffline(browsingContext); this.updateCacheDisabled(browsingContext); @@ -640,6 +654,15 @@ class PageTarget { (browsingContext || this._linkedBrowser.browsingContext).prefersReducedMotionOverride = this.reducedMotion || this._browserContext.reducedMotion || 'none'; } + setContrast(contrast) { + this.contrast = fromProtocolContrast(contrast); + this.updateContrastOverride(); + } + + updateContrastOverride(browsingContext = undefined) { + (browsingContext || this._linkedBrowser.browsingContext).prefersContrastOverride = this.contrast || this._browserContext.contrast || 'none'; + } + setForcedColors(forcedColors) { this.forcedColors = fromProtocolForcedColors(forcedColors); this.updateForcedColorsOverride(); @@ -875,6 +898,14 @@ function fromProtocolReducedMotion(reducedMotion) { throw new Error('Unknown reduced motion: ' + reducedMotion); } +function fromProtocolContrast(contrast) { + if (contrast === 'more' || contrast === 'less' || contrast === 'custom' || contrast === 'no-preference') + return contrast; + if (contrast === null) + return undefined; + throw new Error('Unknown contrast: ' + contrast); +} + function fromProtocolForcedColors(forcedColors) { if (forcedColors === 'active' || forcedColors === 'none') return forcedColors; @@ -915,6 +946,7 @@ class BrowserContext { this.colorScheme = 'none'; this.forcedColors = 'none'; this.reducedMotion = 'none'; + this.contrast = 'none'; this.videoRecordingOptions = undefined; this.crossProcessCookie = { initScripts: [], @@ -941,6 +973,12 @@ class BrowserContext { page.updateReducedMotionOverride(); } + setContrast(contrast) { + this.contrast = fromProtocolContrast(contrast); + for (const page of this.pages) + page.updateContrastOverride(); + } + setForcedColors(forcedColors) { this.forcedColors = fromProtocolForcedColors(forcedColors); for (const page of this.pages) @@ -1255,7 +1293,3 @@ TargetRegistry.Events = { DownloadFinished: Symbol('TargetRegistry.Events.DownloadFinished'), ScreencastStopped: Symbol('TargetRegistry.ScreencastStopped'), }; - -var EXPORTED_SYMBOLS = ['TargetRegistry', 'PageTarget']; -this.TargetRegistry = TargetRegistry; -this.PageTarget = PageTarget; diff --git a/browser_patches/firefox/juggler/components/Juggler.js b/browser_patches/firefox/juggler/components/Juggler.js index aa51a8887929f..6121c4d3928bc 100644 --- a/browser_patches/firefox/juggler/components/Juggler.js +++ b/browser_patches/firefox/juggler/components/Juggler.js @@ -2,16 +2,17 @@ * 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/. */ -var EXPORTED_SYMBOLS = ["Juggler", "JugglerFactory"]; - -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); -const {ComponentUtils} = ChromeUtils.import("resource://gre/modules/ComponentUtils.jsm"); -const {Dispatcher} = ChromeUtils.import("chrome://juggler/content/protocol/Dispatcher.js"); -const {BrowserHandler} = ChromeUtils.import("chrome://juggler/content/protocol/BrowserHandler.js"); -const {NetworkObserver} = ChromeUtils.import("chrome://juggler/content/NetworkObserver.js"); -const {TargetRegistry} = ChromeUtils.import("chrome://juggler/content/TargetRegistry.js"); -const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {ActorManagerParent} = ChromeUtils.import('resource://gre/modules/ActorManagerParent.jsm'); +// Load SimpleChannel in browser-process global. +Services.scriptloader.loadSubScript('chrome://juggler/content/SimpleChannel.js'); + +const {XPCOMUtils} = ChromeUtils.importESModule("resource://gre/modules/XPCOMUtils.sys.mjs"); +const {ComponentUtils} = ChromeUtils.importESModule("resource://gre/modules/ComponentUtils.sys.mjs"); +const {Dispatcher} = ChromeUtils.importESModule("chrome://juggler/content/protocol/Dispatcher.js"); +const {BrowserHandler} = ChromeUtils.importESModule("chrome://juggler/content/protocol/BrowserHandler.js"); +const {NetworkObserver} = ChromeUtils.importESModule("chrome://juggler/content/NetworkObserver.js"); +const {TargetRegistry} = ChromeUtils.importESModule("chrome://juggler/content/TargetRegistry.js"); +const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); +const {ActorManagerParent} = ChromeUtils.importESModule('resource://gre/modules/ActorManagerParent.sys.mjs'); const helper = new Helper(); const Cc = Components.classes; @@ -21,10 +22,10 @@ const Ci = Components.interfaces; ActorManagerParent.addJSWindowActors({ JugglerFrame: { parent: { - moduleURI: 'chrome://juggler/content/JugglerFrameParent.jsm', + esModuleURI: 'chrome://juggler/content/JugglerFrameParent.jsm', }, child: { - moduleURI: 'chrome://juggler/content/content/JugglerFrameChild.jsm', + esModuleURI: 'chrome://juggler/content/content/JugglerFrameChild.jsm', events: { // Normally, we instantiate an actor when a new window is created. DOMWindowCreated: {}, @@ -45,7 +46,7 @@ ActorManagerParent.addJSWindowActors({ let browserStartupFinishedCallback; let browserStartupFinishedPromise = new Promise(x => browserStartupFinishedCallback = x); -class Juggler { +export class Juggler { get classDescription() { return "Sample command-line handler"; } get classID() { return Components.ID('{f7a74a33-e2ab-422d-b022-4fb213dd2639}'); } get contractID() { return "@mozilla.org/remote/juggler;1" } @@ -154,7 +155,7 @@ class Juggler { const jugglerInstance = new Juggler(); // This is used by the XPCOM codepath which expects a constructor -var JugglerFactory = function() { +export var JugglerFactory = function() { return jugglerInstance; }; diff --git a/browser_patches/firefox/juggler/components/components.conf b/browser_patches/firefox/juggler/components/components.conf index e5bc6523b10cd..955b38ab9ccec 100644 --- a/browser_patches/firefox/juggler/components/components.conf +++ b/browser_patches/firefox/juggler/components/components.conf @@ -11,7 +11,7 @@ Classes = [ "command-line-handler": "m-remote", "profile-after-change": "Juggler", }, - "jsm": "chrome://juggler/content/components/Juggler.js", + "esModule": "chrome://juggler/content/components/Juggler.js", "constructor": "JugglerFactory", }, ] diff --git a/browser_patches/firefox/juggler/content/FrameTree.js b/browser_patches/firefox/juggler/content/FrameTree.js index 721f392b9bccb..09a95b3548df9 100644 --- a/browser_patches/firefox/juggler/content/FrameTree.js +++ b/browser_patches/firefox/juggler/content/FrameTree.js @@ -7,13 +7,11 @@ const Ci = Components.interfaces; const Cr = Components.results; const Cu = Components.utils; -const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {SimpleChannel} = ChromeUtils.import('chrome://juggler/content/SimpleChannel.js'); -const {Runtime} = ChromeUtils.import('chrome://juggler/content/content/Runtime.js'); +const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); const helper = new Helper(); -class FrameTree { +export class FrameTree { constructor(rootBrowsingContext) { helper.decorateAsEventEmitter(this); @@ -690,6 +688,3 @@ function channelId(channel) { } -var EXPORTED_SYMBOLS = ['FrameTree']; -this.FrameTree = FrameTree; - diff --git a/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm b/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm index 05d91473d3a8d..af060c57aac90 100644 --- a/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm +++ b/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm @@ -1,7 +1,7 @@ "use strict"; -const { Helper } = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const { initialize } = ChromeUtils.import('chrome://juggler/content/content/main.js'); +const { Helper } = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); +const { initialize } = ChromeUtils.importESModule('chrome://juggler/content/content/main.js'); const Ci = Components.interfaces; const helper = new Helper(); @@ -10,7 +10,7 @@ let sameProcessInstanceNumber = 0; const topBrowingContextToAgents = new Map(); -class JugglerFrameChild extends JSWindowActorChild { +export class JugglerFrameChild extends JSWindowActorChild { constructor() { super(); @@ -83,4 +83,3 @@ class JugglerFrameChild extends JSWindowActorChild { receiveMessage() { } } -var EXPORTED_SYMBOLS = ['JugglerFrameChild']; diff --git a/browser_patches/firefox/juggler/content/PageAgent.js b/browser_patches/firefox/juggler/content/PageAgent.js index 255b84f726662..2ff5e6b922b55 100644 --- a/browser_patches/firefox/juggler/content/PageAgent.js +++ b/browser_patches/firefox/juggler/content/PageAgent.js @@ -8,9 +8,9 @@ const Ci = Components.interfaces; const Cr = Components.results; const Cu = Components.utils; -const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {NetUtil} = ChromeUtils.import('resource://gre/modules/NetUtil.jsm'); -const {setTimeout} = ChromeUtils.import('resource://gre/modules/Timer.jsm'); +const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); +const {NetUtil} = ChromeUtils.importESModule('resource://gre/modules/NetUtil.sys.mjs'); +const {setTimeout} = ChromeUtils.importESModule('resource://gre/modules/Timer.sys.mjs'); const dragService = Cc["@mozilla.org/widget/dragservice;1"].getService( Ci.nsIDragService @@ -51,7 +51,7 @@ class WorkerData { } } -class PageAgent { +export class PageAgent { constructor(browserChannel, frameTree) { this._browserChannel = browserChannel; this._browserPage = browserChannel.connect('page'); @@ -575,7 +575,7 @@ class PageAgent { // We crash by using js-ctypes and dereferencing // a bad pointer. The crash should happen immediately // upon loading this frame script. - const { ctypes } = ChromeUtils.import('resource://gre/modules/ctypes.jsm'); + const { ctypes } = ChromeUtils.importESModule('resource://gre/modules/ctypes.sys.mjs'); ChromeUtils.privateNoteIntentionalCrash(); const zero = new ctypes.intptr_t(8); const badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t)); @@ -709,6 +709,3 @@ class PageAgent { } } -var EXPORTED_SYMBOLS = ['PageAgent']; -this.PageAgent = PageAgent; - diff --git a/browser_patches/firefox/juggler/content/Runtime.js b/browser_patches/firefox/juggler/content/Runtime.js index a5fa7a03dd343..ad8720a1d3e36 100644 --- a/browser_patches/firefox/juggler/content/Runtime.js +++ b/browser_patches/firefox/juggler/content/Runtime.js @@ -8,8 +8,8 @@ if (!this.Debugger) { // Worker has a Debugger defined already. - const {addDebuggerToGlobal} = ChromeUtils.import("resource://gre/modules/jsdebugger.jsm", {}); - addDebuggerToGlobal(Components.utils.getGlobalForObject(this)); + const {addDebuggerToGlobal} = ChromeUtils.importESModule("resource://gre/modules/jsdebugger.sys.mjs"); + addDebuggerToGlobal(Components.utils.getGlobalForObject(globalThis)); } let lastId = 0; @@ -596,5 +596,5 @@ function emitEvent(event, ...args) { listener.call(null, ...args); } -var EXPORTED_SYMBOLS = ['Runtime']; -this.Runtime = Runtime; +// Export Runtime to global. +globalThis.Runtime = Runtime; diff --git a/browser_patches/firefox/juggler/content/main.js b/browser_patches/firefox/juggler/content/main.js index 7eaa704059711..68fb364eadb4e 100644 --- a/browser_patches/firefox/juggler/content/main.js +++ b/browser_patches/firefox/juggler/content/main.js @@ -2,14 +2,20 @@ * 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/. */ -const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {FrameTree} = ChromeUtils.import('chrome://juggler/content/content/FrameTree.js'); -const {SimpleChannel} = ChromeUtils.import('chrome://juggler/content/SimpleChannel.js'); -const {PageAgent} = ChromeUtils.import('chrome://juggler/content/content/PageAgent.js'); +// Load SimpleChannel and Runtime in content process's global. +// NOTE: since these have to exist in both Worker and main threads, and we do +// not know a way to load ES Modules in worker threads, we have to use the loadSubScript +// utility instead. +Services.scriptloader.loadSubScript('chrome://juggler/content/SimpleChannel.js'); +Services.scriptloader.loadSubScript('chrome://juggler/content/content/Runtime.js'); + +const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); +const {FrameTree} = ChromeUtils.importESModule('chrome://juggler/content/content/FrameTree.js'); +const {PageAgent} = ChromeUtils.importESModule('chrome://juggler/content/content/PageAgent.js'); const helper = new Helper(); -function initialize(browsingContext, docShell) { +export function initialize(browsingContext, docShell) { const data = { channel: undefined, pageAgent: undefined, frameTree: undefined, failedToOverrideTimezone: false }; const applySetting = { @@ -114,6 +120,3 @@ function initialize(browsingContext, docShell) { return data; } - -var EXPORTED_SYMBOLS = ['initialize']; -this.initialize = initialize; diff --git a/browser_patches/firefox/juggler/protocol/BrowserHandler.js b/browser_patches/firefox/juggler/protocol/BrowserHandler.js index 6a4688e541eb5..035a53bb688c9 100644 --- a/browser_patches/firefox/juggler/protocol/BrowserHandler.js +++ b/browser_patches/firefox/juggler/protocol/BrowserHandler.js @@ -4,15 +4,15 @@ "use strict"; -const {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm"); -const {TargetRegistry} = ChromeUtils.import("chrome://juggler/content/TargetRegistry.js"); -const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {PageHandler} = ChromeUtils.import("chrome://juggler/content/protocol/PageHandler.js"); -const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); +const {AddonManager} = ChromeUtils.importESModule("resource://gre/modules/AddonManager.sys.mjs"); +const {TargetRegistry} = ChromeUtils.importESModule("chrome://juggler/content/TargetRegistry.js"); +const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); +const {PageHandler} = ChromeUtils.importESModule("chrome://juggler/content/protocol/PageHandler.js"); +const {AppConstants} = ChromeUtils.importESModule("resource://gre/modules/AppConstants.sys.mjs"); const helper = new Helper(); -class BrowserHandler { +export class BrowserHandler { constructor(session, dispatcher, targetRegistry, startCompletePromise, onclose) { this._session = session; this._dispatcher = dispatcher; @@ -219,6 +219,10 @@ class BrowserHandler { await this._targetRegistry.browserContextForId(browserContextId).setForcedColors(nullToUndefined(forcedColors)); } + async ['Browser.setContrast']({browserContextId, contrast}) { + await this._targetRegistry.browserContextForId(browserContextId).setContrast(nullToUndefined(contrast)); + } + async ['Browser.setVideoRecordingOptions']({browserContextId, options}) { await this._targetRegistry.browserContextForId(browserContextId).setVideoRecordingOptions(options); } @@ -309,6 +313,3 @@ async function waitForWindowClosed(browserWindow) { function nullToUndefined(value) { return value === null ? undefined : value; } - -var EXPORTED_SYMBOLS = ['BrowserHandler']; -this.BrowserHandler = BrowserHandler; diff --git a/browser_patches/firefox/juggler/protocol/Dispatcher.js b/browser_patches/firefox/juggler/protocol/Dispatcher.js index 8542461d529eb..7a65d0a1170c1 100644 --- a/browser_patches/firefox/juggler/protocol/Dispatcher.js +++ b/browser_patches/firefox/juggler/protocol/Dispatcher.js @@ -2,12 +2,13 @@ * 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/. */ -const {protocol, checkScheme} = ChromeUtils.import("chrome://juggler/content/protocol/Protocol.js"); -const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); +const {protocol} = ChromeUtils.importESModule("chrome://juggler/content/protocol/Protocol.js"); +const {checkScheme} = ChromeUtils.importESModule("chrome://juggler/content/protocol/PrimitiveTypes.js"); +const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); const helper = new Helper(); -class Dispatcher { +export class Dispatcher { /** * @param {Connection} connection */ @@ -132,7 +133,3 @@ class ProtocolSession { return await this._handler[method](params); } } - -this.EXPORTED_SYMBOLS = ['Dispatcher']; -this.Dispatcher = Dispatcher; - diff --git a/browser_patches/firefox/juggler/protocol/PageHandler.js b/browser_patches/firefox/juggler/protocol/PageHandler.js index e8367070a86fe..1dab7d8803782 100644 --- a/browser_patches/firefox/juggler/protocol/PageHandler.js +++ b/browser_patches/firefox/juggler/protocol/PageHandler.js @@ -4,11 +4,11 @@ "use strict"; -const {Helper, EventWatcher} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {NetUtil} = ChromeUtils.import('resource://gre/modules/NetUtil.jsm'); -const {NetworkObserver, PageNetwork} = ChromeUtils.import('chrome://juggler/content/NetworkObserver.js'); -const {PageTarget} = ChromeUtils.import('chrome://juggler/content/TargetRegistry.js'); -const {setTimeout} = ChromeUtils.import('resource://gre/modules/Timer.jsm'); +const {Helper, EventWatcher} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); +const {NetUtil} = ChromeUtils.importESModule('resource://gre/modules/NetUtil.sys.mjs'); +const {NetworkObserver, PageNetwork} = ChromeUtils.importESModule('chrome://juggler/content/NetworkObserver.js'); +const {PageTarget} = ChromeUtils.importESModule('chrome://juggler/content/TargetRegistry.js'); +const {setTimeout} = ChromeUtils.importESModule('resource://gre/modules/Timer.sys.mjs'); const Cc = Components.classes; const Ci = Components.interfaces; @@ -65,7 +65,7 @@ class WorkerHandler { } } -class PageHandler { +export class PageHandler { constructor(target, session, contentChannel) { this._session = session; this._contentChannel = contentChannel; @@ -302,10 +302,11 @@ class PageHandler { return await this._contentPage.send('setFileInputFiles', options); } - async ['Page.setEmulatedMedia']({colorScheme, type, reducedMotion, forcedColors}) { + async ['Page.setEmulatedMedia']({colorScheme, type, reducedMotion, forcedColors, contrast}) { this._pageTarget.setColorScheme(colorScheme || null); this._pageTarget.setReducedMotion(reducedMotion || null); this._pageTarget.setForcedColors(forcedColors || null); + this._pageTarget.setContrast(contrast || null); this._pageTarget.setEmulatedMedia(type); } @@ -690,6 +691,3 @@ class PageHandler { return await worker.sendMessage(JSON.parse(message)); } } - -var EXPORTED_SYMBOLS = ['PageHandler']; -this.PageHandler = PageHandler; diff --git a/browser_patches/firefox/juggler/protocol/PrimitiveTypes.js b/browser_patches/firefox/juggler/protocol/PrimitiveTypes.js index 5799038f19cbc..ca6d1ec4f60f2 100644 --- a/browser_patches/firefox/juggler/protocol/PrimitiveTypes.js +++ b/browser_patches/firefox/juggler/protocol/PrimitiveTypes.js @@ -2,7 +2,7 @@ * 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/. */ -const t = {}; +export const t = {}; t.String = function(x, details = {}, path = ['']) { if (typeof x === 'string' || typeof x === 'String') @@ -96,7 +96,7 @@ function beauty(path, obj) { return `property "${path.join('.')}" - ${JSON.stringify(obj, null, 2)}`; } -function checkScheme(scheme, x, details = {}, path = ['']) { +export function checkScheme(scheme, x, details = {}, path = ['']) { if (!scheme) throw new Error(`ILLDEFINED SCHEME: ${path.join('.')}`); if (typeof scheme === 'object') { @@ -142,6 +142,3 @@ test(t.Either(t.String, t.Number), {}); */ -this.t = t; -this.checkScheme = checkScheme; -this.EXPORTED_SYMBOLS = ['t', 'checkScheme']; diff --git a/browser_patches/firefox/juggler/protocol/Protocol.js b/browser_patches/firefox/juggler/protocol/Protocol.js index 6fa3dc855540a..4cb44d679ce0b 100644 --- a/browser_patches/firefox/juggler/protocol/Protocol.js +++ b/browser_patches/firefox/juggler/protocol/Protocol.js @@ -2,7 +2,7 @@ * 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/. */ -const {t, checkScheme} = ChromeUtils.import('chrome://juggler/content/protocol/PrimitiveTypes.js'); +const {t} = ChromeUtils.importESModule('chrome://juggler/content/protocol/PrimitiveTypes.js'); // Protocol-specific types. const browserTypes = {}; @@ -463,6 +463,12 @@ const Browser = { forcedColors: t.Nullable(t.Enum(['active', 'none'])), }, }, + 'setContrast': { + params: { + browserContextId: t.Optional(t.String), + contrast: t.Nullable(t.Enum(['less', 'more', 'custom', 'no-preference'])), + }, + }, 'setVideoRecordingOptions': { params: { browserContextId: t.Optional(t.String), @@ -809,6 +815,7 @@ const Page = { colorScheme: t.Optional(t.Enum(['dark', 'light', 'no-preference'])), reducedMotion: t.Optional(t.Enum(['reduce', 'no-preference'])), forcedColors: t.Optional(t.Enum(['active', 'none'])), + contrast: t.Optional(t.Enum(['less', 'more', 'custom', 'no-preference'])), }, }, 'setCacheDisabled': { @@ -1011,8 +1018,6 @@ const Accessibility = { } } -this.protocol = { +export const protocol = { domains: {Browser, Heap, Page, Runtime, Network, Accessibility}, }; -this.checkScheme = checkScheme; -this.EXPORTED_SYMBOLS = ['protocol', 'checkScheme']; diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diff index 9fecd89256e77..8cb0e71d92a20 100644 --- a/browser_patches/firefox/patches/bootstrap.diff +++ b/browser_patches/firefox/patches/bootstrap.diff @@ -1,5 +1,5 @@ diff --git a/accessible/base/NotificationController.h b/accessible/base/NotificationController.h -index 137963f1170927ae0262e0dc26ef721d496376f4..41fa27bc4a3da41814a7f326792990df3424e81f 100644 +index 1bcd464d3bd6b8465f78c62b074b0d57dbc6a082..f878ac9db2d800542dabcc2f48e8ae4727ec4b9a 100644 --- a/accessible/base/NotificationController.h +++ b/accessible/base/NotificationController.h @@ -244,6 +244,8 @@ class NotificationController final : public EventQueue, @@ -89,7 +89,7 @@ index 8167d2b81c918e02ce757f7f448f22e07c29d140..3ae798880acfd8aa965ae08051f2f818 DWORD creationFlags = CREATE_SUSPENDED | CREATE_UNICODE_ENVIRONMENT; diff --git a/browser/installer/allowed-dupes.mn b/browser/installer/allowed-dupes.mn -index 213a99ed433d5219c2b9a64baad82d14cdbcd432..ee4f6484cdfe80899c28a1d9607494e520bfc93d 100644 +index a097c2c56a665204ff7b5593c7faf836366801cf..235a4e224e08c22870c6913e335f0b6020b3e7da 100644 --- a/browser/installer/allowed-dupes.mn +++ b/browser/installer/allowed-dupes.mn @@ -67,6 +67,12 @@ browser/features/webcompat@mozilla.org/shims/empty-shim.txt @@ -106,7 +106,7 @@ index 213a99ed433d5219c2b9a64baad82d14cdbcd432..ee4f6484cdfe80899c28a1d9607494e5 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 90c2e7a69076df56392f6d14aacadada7f413e89..9ed24d7d690eca04ef07e9715444227ecf32a008 100644 +index 89cff6b562a82bd3a9a5d268abd4373199b31fac..e58dbf0ab0b06e84f6dac64698d11c6268091204 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -196,6 +196,9 @@ @@ -167,10 +167,10 @@ index d49c6fbf1bf83b832795fa674f6b41f223eef812..7ea3540947ff5f61b15f27fbf4b95564 const transportProvider = { setListener(upgradeListener) { diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp -index b30dab9ecdee37d7db842acaad30ded30fc326b2..534a89916e34f3d4d960dfcf660c38e2d1000e0c 100644 +index 2425779a7767e9350ee2afc4aea111a090c7f909..393eb86bf2d9a8f778bfce560a9fb3bf528ba558 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp -@@ -106,8 +106,11 @@ struct ParamTraits +@@ -108,8 +108,15 @@ struct ParamTraits template <> struct ParamTraits @@ -181,13 +181,26 @@ index b30dab9ecdee37d7db842acaad30ded30fc326b2..534a89916e34f3d4d960dfcf660c38e2 +template <> +struct ParamTraits + : public mozilla::dom::WebIDLEnumSerializer {}; ++ ++template <> ++struct ParamTraits ++ : public mozilla::dom::WebIDLEnumSerializer {}; template <> struct ParamTraits -@@ -2887,6 +2890,23 @@ void BrowsingContext::DidSet(FieldIndex, +@@ -2891,6 +2898,32 @@ void BrowsingContext::DidSet(FieldIndex, PresContextAffectingFieldChanged(); } ++void BrowsingContext::DidSet(FieldIndex, ++ dom::PrefersContrastOverride aOldValue) { ++ MOZ_ASSERT(IsTop()); ++ if (PrefersContrastOverride() == aOldValue) { ++ return; ++ } ++ PresContextAffectingFieldChanged(); ++} ++ +void BrowsingContext::DidSet(FieldIndex, + dom::PrefersReducedMotionOverride aOldValue) { + MOZ_ASSERT(IsTop()); @@ -209,7 +222,7 @@ index b30dab9ecdee37d7db842acaad30ded30fc326b2..534a89916e34f3d4d960dfcf660c38e2 nsString&& aOldValue) { MOZ_ASSERT(IsTop()); diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h -index e0310bbed02a805a247e04bdc88ae142bcbe5637..19fe77791b055f7f907a0ab00b03e100a0aac1e8 100644 +index eb183cb5c0751e43ea674f9e52441a5a82f186e0..79c5d8110faa89779dd0c16ba00620e7e65d06f5 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h @@ -203,10 +203,10 @@ struct EmbedderColorSchemes { @@ -225,27 +238,51 @@ index e0310bbed02a805a247e04bdc88ae142bcbe5637..19fe77791b055f7f907a0ab00b03e100 FIELD(EmbedderElementType, Maybe) \ FIELD(MessageManagerGroup, nsString) \ FIELD(MaxTouchPointsOverride, uint8_t) \ -@@ -246,6 +246,8 @@ struct EmbedderColorSchemes { +@@ -246,6 +246,9 @@ 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) \ -@@ -947,6 +949,10 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -950,6 +953,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { return GetForcedColorsOverride(); } + dom::PrefersReducedMotionOverride PrefersReducedMotionOverride() const { + return GetPrefersReducedMotionOverride(); + } ++ ++ dom::PrefersContrastOverride PrefersContrastOverride() const { ++ return GetPrefersContrastOverride(); ++ } + bool IsInBFCache() const; bool AllowJavascript() const { return GetAllowJavascript(); } -@@ -1128,6 +1134,15 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -1112,6 +1123,11 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { + return IsTop(); + } + ++ bool CanSet(FieldIndex, ++ dom::PrefersContrastOverride, ContentParent*) { ++ return IsTop(); ++ } ++ + bool CanSet(FieldIndex, dom::ForcedColorsOverride, + ContentParent*) { + return IsTop(); +@@ -1130,10 +1146,22 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { + void DidSet(FieldIndex, + dom::ForcedColorsOverride aOldValue); + ++ void DidSet(FieldIndex, ++ dom::PrefersContrastOverride aOldValue); ++ + template void WalkPresContexts(Callback&&); void PresContextAffectingFieldChanged(); @@ -262,10 +299,10 @@ index e0310bbed02a805a247e04bdc88ae142bcbe5637..19fe77791b055f7f907a0ab00b03e100 bool CanSet(FieldIndex, bool, ContentParent*) { diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp -index e73d56380ff6802103896bd63d2e11c26c8ee3f5..2ce283bcc4e6690a26a6483b6b50b24093797e45 100644 +index bef42c91d6f88922c8c101f3675325d828872aaf..8eb68c441fbef8ecbe5e90c118ccc00813564577 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp -@@ -323,6 +323,8 @@ void CanonicalBrowsingContext::ReplacedBy( +@@ -324,6 +324,8 @@ void CanonicalBrowsingContext::ReplacedBy( txn.SetShouldDelayMediaFromStart(GetShouldDelayMediaFromStart()); txn.SetForceOffline(GetForceOffline()); txn.SetTopInnerSizeForRFP(GetTopInnerSizeForRFP()); @@ -274,7 +311,7 @@ index e73d56380ff6802103896bd63d2e11c26c8ee3f5..2ce283bcc4e6690a26a6483b6b50b240 // Propagate some settings on BrowsingContext replacement so they're not lost // on bfcached navigations. These are important for GeckoView (see bug -@@ -1608,6 +1610,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, +@@ -1635,6 +1637,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, return; } @@ -288,7 +325,7 @@ index e73d56380ff6802103896bd63d2e11c26c8ee3f5..2ce283bcc4e6690a26a6483b6b50b240 } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp -index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b296603846d84 100644 +index 32c537d6be90247af8d778048c6d27f3800d4b02..b72196b0694828489f8ad27c209f49f0d41c43cb 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -15,6 +15,12 @@ @@ -311,16 +348,16 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 +#include "mozilla/dom/Geolocation.h" #include "mozilla/dom/HTMLAnchorElement.h" #include "mozilla/dom/HTMLIFrameElement.h" - #include "mozilla/dom/PerformanceNavigation.h" -@@ -90,6 +97,7 @@ - #include "mozilla/dom/JSWindowActorChild.h" + #include "mozilla/dom/Navigation.h" +@@ -94,6 +101,7 @@ #include "mozilla/dom/DocumentBinding.h" + #include "mozilla/glean/DocshellMetrics.h" #include "mozilla/ipc/ProtocolUtils.h" +#include "mozilla/dom/WorkerCommon.h" #include "mozilla/net/DocumentChannel.h" #include "mozilla/net/DocumentChannelChild.h" #include "mozilla/net/ParentChannelWrapper.h" -@@ -113,6 +121,7 @@ +@@ -117,6 +125,7 @@ #include "nsIDocumentViewer.h" #include "mozilla/dom/Document.h" #include "nsHTMLDocument.h" @@ -328,7 +365,7 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 #include "nsIDocumentLoaderFactory.h" #include "nsIDOMWindow.h" #include "nsIEditingSession.h" -@@ -207,6 +216,7 @@ +@@ -211,6 +220,7 @@ #include "nsGlobalWindowInner.h" #include "nsGlobalWindowOuter.h" #include "nsJSEnvironment.h" @@ -336,7 +373,7 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 #include "nsNetCID.h" #include "nsNetUtil.h" #include "nsObjectLoadingContent.h" -@@ -347,6 +357,13 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, +@@ -352,6 +362,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, mAllowDNSPrefetch(true), mAllowWindowControl(true), mCSSErrorReportingEnabled(false), @@ -347,10 +384,11 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 + mDisallowBFCache(false), + mReducedMotionOverride(REDUCED_MOTION_OVERRIDE_NONE), + mForcedColorsOverride(FORCED_COLORS_OVERRIDE_NO_OVERRIDE), ++ mContrastOverride(CONTRAST_OVERRIDE_NONE), mAllowAuth(mItemType == typeContent), mAllowKeywordFixup(false), mDisableMetaRefreshWhenInactive(false), -@@ -3019,6 +3036,214 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { +@@ -3024,6 +3042,232 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { return NS_OK; } @@ -560,12 +598,30 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 + return NS_OK; +} + ++NS_IMETHODIMP ++nsDocShell::GetContrastOverride(ContrastOverride* aContrastOverride) { ++ *aContrastOverride = GetRootDocShell()->mContrastOverride; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP ++nsDocShell::SetContrastOverride(ContrastOverride aContrastOverride) { ++ mContrastOverride = aContrastOverride; ++ RefPtr presContext = GetPresContext(); ++ if (presContext) { ++ presContext->MediaFeatureValuesChanged( ++ {MediaFeatureChangeReason::SystemMetricsChange}, ++ MediaFeatureChangePropagation::JustThisDocument); ++ } ++ return NS_OK; ++} ++ +// =============== Juggler End ======================= + NS_IMETHODIMP nsDocShell::GetIsNavigating(bool* aOut) { *aOut = mIsNavigating; -@@ -4695,7 +4920,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { +@@ -4731,7 +4975,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { } void nsDocShell::ActivenessMaybeChanged() { @@ -574,7 +630,7 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 if (RefPtr presShell = GetPresShell()) { presShell->ActivenessMaybeChanged(); } -@@ -6619,6 +6844,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, +@@ -6658,6 +6902,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, return false; // no entry to save into } @@ -585,7 +641,7 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 MOZ_ASSERT(!mozilla::SessionHistoryInParent(), "mOSHE cannot be non-null with SHIP"); nsCOMPtr viewer = mOSHE->GetDocumentViewer(); -@@ -8352,6 +8581,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { +@@ -8399,6 +8647,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { true, // aForceNoOpener getter_AddRefs(newBC)); MOZ_ASSERT(!newBC); @@ -598,7 +654,7 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 return rv; } -@@ -9506,6 +9741,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, +@@ -9572,6 +9826,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr); nsCOMPtr req; @@ -615,7 +671,7 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 rv = DoURILoad(aLoadState, aCacheKey, getter_AddRefs(req)); if (NS_SUCCEEDED(rv)) { -@@ -12708,6 +12953,9 @@ class OnLinkClickEvent : public Runnable { +@@ -12791,6 +13055,9 @@ class OnLinkClickEvent : public Runnable { mHandler->OnLinkClickSync(mContent, mLoadState, mNoOpenerImplied, mTriggeringPrincipal); } @@ -625,7 +681,7 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 return NS_OK; } -@@ -12794,6 +13042,8 @@ nsresult nsDocShell::OnLinkClick( +@@ -12877,6 +13144,8 @@ nsresult nsDocShell::OnLinkClick( nsCOMPtr ev = new OnLinkClickEvent( this, aContent, loadState, noOpenerImplied, aTriggeringPrincipal); @@ -635,7 +691,7 @@ index 4851148d889bdfc12a4b9a463c05d3fb9f1f593f..9f4e3fd0cdfc66b49b1650a05f4b2966 } diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h -index 888741f8490d6f0e885ed0ce73115c16e7bbe821..0958824d57a082fecae6dde1eb568f457c42f443 100644 +index f22a333733322ad17f097d7edd46af21a687906c..6bcf8ca9f9cd64dc9f5695d00e0a3e6a97978f02 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -15,6 +15,7 @@ @@ -646,7 +702,7 @@ index 888741f8490d6f0e885ed0ce73115c16e7bbe821..0958824d57a082fecae6dde1eb568f45 #include "mozilla/dom/WindowProxyHolder.h" #include "nsCOMPtr.h" #include "nsCharsetSource.h" -@@ -76,6 +77,7 @@ class nsCommandManager; +@@ -77,6 +78,7 @@ class nsCommandManager; class nsDocShellEditorData; class nsDOMNavigationTiming; class nsDSURIContentListener; @@ -654,7 +710,7 @@ index 888741f8490d6f0e885ed0ce73115c16e7bbe821..0958824d57a082fecae6dde1eb568f45 class nsGlobalWindowOuter; class FramingChecker; -@@ -402,6 +404,15 @@ class nsDocShell final : public nsDocLoader, +@@ -403,6 +405,15 @@ class nsDocShell final : public nsDocLoader, void SetWillChangeProcess() { mWillChangeProcess = true; } bool WillChangeProcess() { return mWillChangeProcess; } @@ -670,7 +726,7 @@ index 888741f8490d6f0e885ed0ce73115c16e7bbe821..0958824d57a082fecae6dde1eb568f45 // Create a content viewer within this nsDocShell for the given // `WindowGlobalChild` actor. nsresult CreateDocumentViewerForActor( -@@ -1005,6 +1016,8 @@ class nsDocShell final : public nsDocLoader, +@@ -1006,6 +1017,8 @@ class nsDocShell final : public nsDocLoader, bool CSSErrorReportingEnabled() const { return mCSSErrorReportingEnabled; } @@ -679,7 +735,7 @@ index 888741f8490d6f0e885ed0ce73115c16e7bbe821..0958824d57a082fecae6dde1eb568f45 // 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 -@@ -1282,6 +1295,16 @@ class nsDocShell final : public nsDocLoader, +@@ -1285,6 +1298,17 @@ class nsDocShell final : public nsDocLoader, bool mAllowDNSPrefetch : 1; bool mAllowWindowControl : 1; bool mCSSErrorReportingEnabled : 1; @@ -692,12 +748,13 @@ index 888741f8490d6f0e885ed0ce73115c16e7bbe821..0958824d57a082fecae6dde1eb568f45 + RefPtr mGeolocationServiceOverride; + ReducedMotionOverride mReducedMotionOverride; + ForcedColorsOverride mForcedColorsOverride; ++ ContrastOverride mContrastOverride; + bool mAllowAuth : 1; bool mAllowKeywordFixup : 1; bool mDisableMetaRefreshWhenInactive : 1; diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl -index 84e821e33e8164829dfee4f05340784e189b90ee..397742551b98d0d9e6fcf94f55efda5ea628b9ac 100644 +index 84e821e33e8164829dfee4f05340784e189b90ee..aa690eb747cb73bc6bff40a62546037c2e64c485 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -44,6 +44,7 @@ interface nsIURI; @@ -708,7 +765,7 @@ index 84e821e33e8164829dfee4f05340784e189b90ee..397742551b98d0d9e6fcf94f55efda5e interface nsIEditor; interface nsIEditingSession; interface nsIInputStream; -@@ -719,6 +720,36 @@ interface nsIDocShell : nsIDocShellTreeItem +@@ -719,6 +720,45 @@ interface nsIDocShell : nsIDocShellTreeItem */ void synchronizeLayoutHistoryState(); @@ -740,16 +797,25 @@ index 84e821e33e8164829dfee4f05340784e189b90ee..397742551b98d0d9e6fcf94f55efda5e + }; + [infallible] attribute nsIDocShell_ForcedColorsOverride forcedColorsOverride; + ++ cenum ContrastOverride : 8 { ++ CONTRAST_OVERRIDE_LESS, ++ CONTRAST_OVERRIDE_MORE, ++ CONTRAST_OVERRIDE_CUSTOM, ++ CONTRAST_OVERRIDE_NO_PREFERENCE, ++ CONTRAST_OVERRIDE_NONE, /* This clears the override. */ ++ }; ++ [infallible] attribute nsIDocShell_ContrastOverride contrastOverride; ++ + void setGeolocationOverride(in nsIDOMGeoPosition position); + /** * 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 8680bd4e64abc48233b5babb3b4123fea0e76f3b..44ea1267771cd925df74c716cc26d7ab51b2b985 100644 +index fd2d0be5f7755e64fc134515ea138c4ed0d28daf..ae48159ddbfb98d03e538d077a33260c639a74ac 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp -@@ -3741,6 +3741,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { +@@ -3752,6 +3752,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { } void Document::ApplySettingsFromCSP(bool aSpeculative) { @@ -759,7 +825,7 @@ index 8680bd4e64abc48233b5babb3b4123fea0e76f3b..44ea1267771cd925df74c716cc26d7ab nsresult rv = NS_OK; if (!aSpeculative) { // 1) apply settings from regular CSP -@@ -3798,6 +3801,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { +@@ -3809,6 +3812,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { MOZ_ASSERT(!mScriptGlobalObject, "CSP must be initialized before mScriptGlobalObject is set!"); @@ -771,7 +837,7 @@ index 8680bd4e64abc48233b5babb3b4123fea0e76f3b..44ea1267771cd925df74c716cc26d7ab // If this is a data document - no need to set CSP. if (mLoadedAsData) { return NS_OK; -@@ -4605,6 +4613,10 @@ bool Document::HasFocus(ErrorResult& rv) const { +@@ -4617,6 +4625,10 @@ bool Document::HasFocus(ErrorResult& rv) const { return false; } @@ -782,7 +848,7 @@ index 8680bd4e64abc48233b5babb3b4123fea0e76f3b..44ea1267771cd925df74c716cc26d7ab if (!fm->IsInActiveWindow(bc)) { return false; } -@@ -19488,6 +19500,35 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { +@@ -19688,6 +19700,35 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { return PreferenceSheet::PrefsFor(*this).mColorScheme; } @@ -819,10 +885,10 @@ index 8680bd4e64abc48233b5babb3b4123fea0e76f3b..44ea1267771cd925df74c716cc26d7ab if (!sLoadingForegroundTopLevelContentDocument) { return false; diff --git a/dom/base/Document.h b/dom/base/Document.h -index ee5800c51cacc7ac3517c03274ed4e0a35e57f9f..91a8ea64eb40dc0e642e8ab515b78c93e11d7d5a 100644 +index 622f54e369d324a4cc2800dd4b331bd628339bed..2ef6ed20cf35febeff75b22dfa5bb2fbb4e295fe 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h -@@ -4123,6 +4123,8 @@ class Document : public nsINode, +@@ -4140,6 +4140,8 @@ class Document : public nsINode, // color-scheme meta tag. ColorScheme DefaultColorScheme() const; @@ -832,7 +898,7 @@ index ee5800c51cacc7ac3517c03274ed4e0a35e57f9f..91a8ea64eb40dc0e642e8ab515b78c93 static bool AutomaticStorageAccessPermissionCanBeGranted( diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp -index 0f159ad09a2a4b8962307b9f20abf30323377a36..e0cbb3f1f8af42825696d7152eb9993ab3802f90 100644 +index a13cae5b990fb2f750e62f5117ad63aa981d787f..bc0f2d674aadd8eba867f56e873595a8885d1798 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -344,14 +344,18 @@ void Navigator::GetAppName(nsAString& aAppName) const { @@ -895,20 +961,17 @@ index 6abf6cef230c97815f17f6b7abf9f1b1de274a6f..46ead1f32e0d710b5b32e61dff72a4f7 dom::MediaCapabilities* MediaCapabilities(); dom::MediaSession* MediaSession(); diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp -index 13ba7fa81c67f41e419a13c74f9c382193e0eb27..f438d58b594e1434d090eecc89accc66b9f62fcd 100644 +index f362a444a0f5ed247582646754dffd54d0b4540a..bbd72dab7ff4fbac8c247961e530764cb5c68d11 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp -@@ -8773,7 +8773,8 @@ nsresult nsContentUtils::SendMouseEvent( - bool aIgnoreRootScrollFrame, float aPressure, - unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, - PreventDefaultResult* aPreventDefault, bool aIsDOMEventSynthesized, +@@ -9151,11 +9151,13 @@ nsresult nsContentUtils::SendMouseEvent( + int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame, + float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, + bool aToWindow, bool* aPreventDefault, bool aIsDOMEventSynthesized, - bool aIsWidgetEventSynthesized) { + bool aIsWidgetEventSynthesized, + bool convertToPointer, uint32_t aJugglerEventId) { - nsPoint offset; - nsCOMPtr widget = GetWidget(aPresShell, &offset); - if (!widget) return NS_ERROR_FAILURE; -@@ -8781,6 +8782,7 @@ nsresult nsContentUtils::SendMouseEvent( + MOZ_ASSERT(aWidget); EventMessage msg; Maybe exitFrom; bool contextMenuKey = false; @@ -916,7 +979,7 @@ index 13ba7fa81c67f41e419a13c74f9c382193e0eb27..f438d58b594e1434d090eecc89accc66 if (aType.EqualsLiteral("mousedown")) { msg = eMouseDown; } else if (aType.EqualsLiteral("mouseup")) { -@@ -8806,6 +8808,12 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9181,6 +9183,12 @@ nsresult nsContentUtils::SendMouseEvent( msg = eMouseHitTest; } else if (aType.EqualsLiteral("MozMouseExploreByTouch")) { msg = eMouseExploreByTouch; @@ -929,7 +992,7 @@ index 13ba7fa81c67f41e419a13c74f9c382193e0eb27..f438d58b594e1434d090eecc89accc66 } else { return NS_ERROR_FAILURE; } -@@ -8816,7 +8824,14 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9191,7 +9199,14 @@ nsresult nsContentUtils::SendMouseEvent( Maybe pointerEvent; Maybe mouseEvent; @@ -937,7 +1000,7 @@ index 13ba7fa81c67f41e419a13c74f9c382193e0eb27..f438d58b594e1434d090eecc89accc66 + Maybe pwDragEvent; + + if (isPWDragEventMessage) { -+ pwDragEvent.emplace(true, msg, widget); ++ pwDragEvent.emplace(true, msg, aWidget); + pwDragEvent->mReason = aIsWidgetEventSynthesized + ? WidgetMouseEvent::eSynthesized + : WidgetMouseEvent::eReal; @@ -945,7 +1008,7 @@ index 13ba7fa81c67f41e419a13c74f9c382193e0eb27..f438d58b594e1434d090eecc89accc66 MOZ_ASSERT(!aIsWidgetEventSynthesized, "The event shouldn't be dispatched as a synthesized event"); if (MOZ_UNLIKELY(aIsWidgetEventSynthesized)) { -@@ -8835,8 +8850,11 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9210,8 +9225,11 @@ nsresult nsContentUtils::SendMouseEvent( contextMenuKey ? WidgetMouseEvent::eContextMenuKey : WidgetMouseEvent::eNormal); } @@ -957,7 +1020,7 @@ index 13ba7fa81c67f41e419a13c74f9c382193e0eb27..f438d58b594e1434d090eecc89accc66 mouseOrPointerEvent.pointerId = aIdentifier; mouseOrPointerEvent.mModifiers = GetWidgetModifiers(aModifiers); mouseOrPointerEvent.mButton = aButton; -@@ -8849,6 +8867,8 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9224,6 +9242,8 @@ nsresult nsContentUtils::SendMouseEvent( mouseOrPointerEvent.mClickCount = aClickCount; mouseOrPointerEvent.mFlags.mIsSynthesizedForTests = aIsDOMEventSynthesized; mouseOrPointerEvent.mExitFrom = exitFrom; @@ -967,24 +1030,26 @@ index 13ba7fa81c67f41e419a13c74f9c382193e0eb27..f438d58b594e1434d090eecc89accc66 nsPresContext* presContext = aPresShell->GetPresContext(); if (!presContext) return NS_ERROR_FAILURE; diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h -index a1efe3efc7f48f9ff8e2b1a1a50e5dd7bf81f263..caf55fa9dae74ce4ce9ad0369c8cfc8eea061778 100644 +index 779cd9e544bfb2d135f12c3558c0ca8164b37029..041eba4bcbf40f51fc40ce7609ea81408e6a788d 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h -@@ -3033,7 +3033,8 @@ class nsContentUtils { +@@ -3015,8 +3015,9 @@ class nsContentUtils { + int32_t aButton, int32_t aButtons, int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, - mozilla::PreventDefaultResult* aPreventDefault, -- bool aIsDOMEventSynthesized, bool aIsWidgetEventSynthesized); +- bool* aPreventDefault, bool aIsDOMEventSynthesized, +- bool aIsWidgetEventSynthesized); ++ bool* aPreventDefault, + bool aIsDOMEventSynthesized, bool aIsWidgetEventSynthesized, + bool convertToPointer = true, uint32_t aJugglerEventId = 0); static void FirePageShowEventForFrameLoaderSwap( nsIDocShellTreeItem* aItem, diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp -index aae46b9bd2e7756fc025c0597db221c579cac679..5e8ae13a9d1747312cd7df9d80cbb1677530465c 100644 +index 15fe1db8a28ed2592b61aaf2006ddaa656f12389..2642c18bebcdfdd467be557171ba4ee204fcabde 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp -@@ -686,6 +686,26 @@ nsDOMWindowUtils::GetPresShellId(uint32_t* aPresShellId) { +@@ -710,6 +710,26 @@ nsDOMWindowUtils::GetPresShellId(uint32_t* aPresShellId) { return NS_ERROR_FAILURE; } @@ -1011,7 +1076,7 @@ index aae46b9bd2e7756fc025c0597db221c579cac679..5e8ae13a9d1747312cd7df9d80cbb167 NS_IMETHODIMP nsDOMWindowUtils::SendMouseEvent( const nsAString& aType, float aX, float aY, int32_t aButton, -@@ -700,7 +720,7 @@ nsDOMWindowUtils::SendMouseEvent( +@@ -724,7 +744,7 @@ nsDOMWindowUtils::SendMouseEvent( aOptionalArgCount >= 7 ? aIdentifier : DEFAULT_MOUSE_POINTER_ID, false, aPreventDefault, aOptionalArgCount >= 4 ? aIsDOMEventSynthesized : true, aOptionalArgCount >= 5 ? aIsWidgetEventSynthesized : false, @@ -1020,7 +1085,7 @@ index aae46b9bd2e7756fc025c0597db221c579cac679..5e8ae13a9d1747312cd7df9d80cbb167 } NS_IMETHODIMP -@@ -718,7 +738,7 @@ nsDOMWindowUtils::SendMouseEventToWindow( +@@ -742,7 +762,7 @@ nsDOMWindowUtils::SendMouseEventToWindow( aOptionalArgCount >= 7 ? aIdentifier : DEFAULT_MOUSE_POINTER_ID, true, nullptr, aOptionalArgCount >= 4 ? aIsDOMEventSynthesized : true, aOptionalArgCount >= 5 ? aIsWidgetEventSynthesized : false, @@ -1029,27 +1094,29 @@ index aae46b9bd2e7756fc025c0597db221c579cac679..5e8ae13a9d1747312cd7df9d80cbb167 } NS_IMETHODIMP -@@ -727,13 +747,13 @@ nsDOMWindowUtils::SendMouseEventCommon( +@@ -751,7 +771,7 @@ nsDOMWindowUtils::SendMouseEventCommon( int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aPointerId, bool aToWindow, bool* aPreventDefault, bool aIsDOMEventSynthesized, - bool aIsWidgetEventSynthesized, int32_t aButtons) { + bool aIsWidgetEventSynthesized, int32_t aButtons, bool aConvertToPointer, uint32_t aJugglerEventId) { RefPtr presShell = GetPresShell(); - PreventDefaultResult preventDefaultResult; - nsresult rv = nsContentUtils::SendMouseEvent( - presShell, aType, aX, aY, aButton, aButtons, aClickCount, aModifiers, - aIgnoreRootScrollFrame, aPressure, aInputSourceArg, aPointerId, aToWindow, -- &preventDefaultResult, aIsDOMEventSynthesized, aIsWidgetEventSynthesized); -+ &preventDefaultResult, aIsDOMEventSynthesized, aIsWidgetEventSynthesized, aConvertToPointer, aJugglerEventId); - - if (aPreventDefault) { - *aPreventDefault = preventDefaultResult != PreventDefaultResult::No; + if (!presShell) { + return NS_ERROR_FAILURE; +@@ -768,7 +788,7 @@ nsDOMWindowUtils::SendMouseEventCommon( + presShell, widget, aType, refPoint, aButton, aButtons, aClickCount, + aModifiers, aIgnoreRootScrollFrame, aPressure, aInputSourceArg, + aPointerId, aToWindow, aPreventDefault, aIsDOMEventSynthesized, +- aIsWidgetEventSynthesized); ++ aIsWidgetEventSynthesized, aConvertToPointer, aJugglerEventId); + } + + NS_IMETHODIMP diff --git a/dom/base/nsDOMWindowUtils.h b/dom/base/nsDOMWindowUtils.h -index 47ff326b202266b1d7d6af8bdfb72776df8a6a93..b8e084b0c788c46345b1455b8257f1719c851404 100644 +index a8a48d28fc4ef612f8234bc2490a41672f1704f5..f702b0c9a0783ec547a41bbefd68e18a27a239fe 100644 --- a/dom/base/nsDOMWindowUtils.h +++ b/dom/base/nsDOMWindowUtils.h -@@ -93,7 +93,7 @@ class nsDOMWindowUtils final : public nsIDOMWindowUtils, +@@ -94,7 +94,7 @@ class nsDOMWindowUtils final : public nsIDOMWindowUtils, int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, bool* aPreventDefault, bool aIsDOMEventSynthesized, @@ -1059,10 +1126,10 @@ index 47ff326b202266b1d7d6af8bdfb72776df8a6a93..b8e084b0c788c46345b1455b8257f171 MOZ_CAN_RUN_SCRIPT nsresult SendTouchEventCommon( diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp -index 54cf5e2647a8fa097481e972e0ab67928b2abc8b..37ff283278cebc0e058b0345a157036283847de8 100644 +index 555a08b4b3fcd0d0c7986014d2e3516c6e5991c0..74a39e000b0e68042f1f51f6fafbc39ac9b42e51 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp -@@ -1712,6 +1712,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, +@@ -1720,6 +1720,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, (GetActiveBrowsingContext() == newRootBrowsingContext); } @@ -1073,7 +1140,7 @@ index 54cf5e2647a8fa097481e972e0ab67928b2abc8b..37ff283278cebc0e058b0345a1570362 // Exit fullscreen if a website focuses another window if (StaticPrefs::full_screen_api_exit_on_windowRaise() && !isElementInActiveWindow && (aFlags & FLAG_RAISE)) { -@@ -2297,6 +2301,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2306,6 +2310,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, bool aIsLeavingDocument, bool aAdjustWidget, bool aRemainActive, Element* aElementToFocus, uint64_t aActionId) { @@ -1081,7 +1148,7 @@ index 54cf5e2647a8fa097481e972e0ab67928b2abc8b..37ff283278cebc0e058b0345a1570362 LOGFOCUS(("<>", aActionId)); // hold a reference to the focused content, which may be null -@@ -2343,6 +2348,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2352,6 +2357,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, return true; } @@ -1093,7 +1160,7 @@ index 54cf5e2647a8fa097481e972e0ab67928b2abc8b..37ff283278cebc0e058b0345a1570362 // Keep a ref to presShell since dispatching the DOM event may cause // the document to be destroyed. RefPtr presShell = docShell->GetPresShell(); -@@ -3020,7 +3030,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, +@@ -3066,7 +3076,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, } } @@ -1105,10 +1172,10 @@ index 54cf5e2647a8fa097481e972e0ab67928b2abc8b..37ff283278cebc0e058b0345a1570362 // 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 d8ba9e36c98197a7dd7e1b0781f2477c451fc5fd..f3b5b0417ed9433678c7379d304de263c7bc1f80 100644 +index 99a5049a3aff2efb208895d60622fd9c8d7f337a..9a9b039a46f1294a8b4af0613fb4f4173ac6a8a0 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp -@@ -2516,10 +2516,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, +@@ -2512,10 +2512,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, }(); if (!isContentAboutBlankInChromeDocshell) { @@ -1129,7 +1196,7 @@ index d8ba9e36c98197a7dd7e1b0781f2477c451fc5fd..f3b5b0417ed9433678c7379d304de263 } } -@@ -2639,6 +2645,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() { +@@ -2635,6 +2641,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() { } } @@ -1150,10 +1217,10 @@ index d8ba9e36c98197a7dd7e1b0781f2477c451fc5fd..f3b5b0417ed9433678c7379d304de263 void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) { diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h -index d4347e7a508742986f634e97394a9e3dd435d170..5088520537c8c5c6cc79c1dffd91a68de09f27eb 100644 +index 0453a18ec10c1434d1692f10b1b4acee754e6b7e..ee7bad691515bb51f6b4345e88944b02ad173180 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h -@@ -317,6 +317,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, +@@ -320,6 +320,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, // Outer windows only. void DispatchDOMWindowCreated(); @@ -1162,10 +1229,10 @@ index d4347e7a508742986f634e97394a9e3dd435d170..5088520537c8c5c6cc79c1dffd91a68d // Outer windows only. virtual void EnsureSizeAndPositionUpToDate() override; diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp -index 855ba87b5b6db67d7dd207cb54001190c494c61a..f96eb49056dafcbd0ca244dac6d1d4a38e7819ce 100644 +index 8e2bbed21c13f23745e2eaad4ded831106ebd930..a17b0c7b9730737f178c05703b08d0f5f6d9ecd1 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp -@@ -1438,6 +1438,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, +@@ -1449,6 +1449,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, mozilla::GetBoxQuadsFromWindowOrigin(this, aOptions, aResult, aRv); } @@ -1228,10 +1295,10 @@ index 855ba87b5b6db67d7dd207cb54001190c494c61a..f96eb49056dafcbd0ca244dac6d1d4a3 DOMQuad& aQuad, const GeometryNode& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h -index e1fb6c2aeb67ab600b668b342bee0c716427d116..55e573dce8ad4d34542f89b9179a1da14f45d1bc 100644 +index eb75f281630f8ca1b901686207c9fc97336d675f..e607f0ae454d52fc2bfe19046b492352a84b4ebd 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h -@@ -2356,6 +2356,10 @@ class nsINode : public mozilla::dom::EventTarget { +@@ -2397,6 +2397,10 @@ class nsINode : public mozilla::dom::EventTarget { nsTArray>& aResult, ErrorResult& aRv); @@ -1271,10 +1338,10 @@ index f32e21752d5013bf143eb45391ab9218debab08e..83763d2354dade2f8d2b7930ba18ae91 static bool DumpEnabled(); diff --git a/dom/chrome-webidl/BrowsingContext.webidl b/dom/chrome-webidl/BrowsingContext.webidl -index 28e8d8cb9c61ff8362b2d191d47c3630d2cb0b34..0058e60aaab21f8003bbe1bf3f271c63ed78f29a 100644 +index 6ec88536141126c97c9b599e3237bb5670d42ce8..41c6cc56738bdaf711adf2cf5b00c7fad5d71ba8 100644 --- a/dom/chrome-webidl/BrowsingContext.webidl +++ b/dom/chrome-webidl/BrowsingContext.webidl -@@ -61,6 +61,15 @@ enum ForcedColorsOverride { +@@ -61,6 +61,26 @@ enum ForcedColorsOverride { "active", }; @@ -1286,25 +1353,75 @@ index 28e8d8cb9c61ff8362b2d191d47c3630d2cb0b34..0058e60aaab21f8003bbe1bf3f271c63 + "reduce", + "no-preference", +}; ++ ++/** ++ * CSS prefers-contrast values. ++ */ ++enum PrefersContrastOverride { ++ "none", ++ "no-preference", ++ "more", ++ "less", ++ "custom", ++}; + /** * Allowed overrides of platform/pref default behaviour for touch events. */ -@@ -220,6 +229,9 @@ interface BrowsingContext { +@@ -220,6 +240,12 @@ interface BrowsingContext { // Forced-colors simulation, for DevTools [SetterThrows] attribute ForcedColorsOverride forcedColorsOverride; + // 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/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp +index 0bd219694282347309680fc9b53b945e1fd0ad92..c5c2e2d32a380ec72379b05a8b84f187431f7309 100644 +--- a/dom/fetch/Fetch.cpp ++++ b/dom/fetch/Fetch.cpp +@@ -701,6 +701,12 @@ already_AddRefed FetchRequest(nsIGlobalObject* aGlobal, + ipcArgs.hasCSPEventListener() = false; + ipcArgs.isWorkerRequest() = false; + ++ /* --> Playwright: associate keep-alive fetch with the window */ ++ BrowsingContext* bc = window ? window->GetBrowsingContext() : nullptr; ++ if (bc) ++ ipcArgs.associatedBrowsingContextID() = bc->Id(); ++ /* <-- Playwright */ ++ + actor->DoFetchOp(ipcArgs); + + mozilla::glean::networking::fetch_keepalive_request_count.Get("main"_ns) +diff --git a/dom/fetch/FetchService.cpp b/dom/fetch/FetchService.cpp +index b5e60bbd27fbb2f033d233e9ae2ebc728f442512..0adc568ece34d2c0f35eeacd81e2db9125b7c327 100644 +--- a/dom/fetch/FetchService.cpp ++++ b/dom/fetch/FetchService.cpp +@@ -268,6 +268,14 @@ RefPtr FetchService::FetchInstance::Fetch() { + false // IsTrackingFetch + ); + ++ /* --> Playwright: associate keep-alive fetch with the window */ ++ if (mArgsType == FetchArgsType::MainThreadFetch) { ++ auto& args = mArgs.as(); ++ mFetchDriver->SetAssociatedBrowsingContextID( ++ args.mAssociatedBrowsingContextID); ++ } ++ /* <-- Playwright */ ++ + if (mArgsType == FetchArgsType::WorkerFetch) { + auto& args = mArgs.as(); + mFetchDriver->SetWorkerScript(args.mWorkerScript); diff --git a/dom/geolocation/Geolocation.cpp b/dom/geolocation/Geolocation.cpp -index 6a624e4c0f5fb8ffff06419a29f6e6acc6108773..370625634f7846d0545ec7ee964d7fa1a15b3ac0 100644 +index 7c653fe131dc34d35ffdc030950071adb31a9fc9..b23442a42ba8ee270e8e38930e59ae15c2a29039 100644 --- a/dom/geolocation/Geolocation.cpp +++ b/dom/geolocation/Geolocation.cpp -@@ -29,6 +29,7 @@ +@@ -28,6 +28,7 @@ #include "nsComponentManagerUtils.h" #include "nsContentPermissionHelper.h" #include "nsContentUtils.h" @@ -1312,7 +1429,7 @@ index 6a624e4c0f5fb8ffff06419a29f6e6acc6108773..370625634f7846d0545ec7ee964d7fa1 #include "nsGlobalWindowInner.h" #include "mozilla/dom/Document.h" #include "nsINamed.h" -@@ -429,10 +430,8 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { +@@ -428,10 +429,8 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { return NS_OK; } @@ -1325,7 +1442,7 @@ index 6a624e4c0f5fb8ffff06419a29f6e6acc6108773..370625634f7846d0545ec7ee964d7fa1 CachedPositionAndAccuracy lastPosition = gs->GetCachedPosition(); if (lastPosition.position) { EpochTimeStamp cachedPositionTime_ms; -@@ -640,8 +639,7 @@ void nsGeolocationRequest::Shutdown() { +@@ -639,8 +638,7 @@ void nsGeolocationRequest::Shutdown() { // If there are no other high accuracy requests, the geolocation service will // notify the provider to switch to the default accuracy. if (mOptions && mOptions->mEnableHighAccuracy) { @@ -1335,7 +1452,7 @@ index 6a624e4c0f5fb8ffff06419a29f6e6acc6108773..370625634f7846d0545ec7ee964d7fa1 if (gs) { gs->UpdateAccuracy(); } -@@ -958,8 +956,14 @@ void nsGeolocationService::StopDevice() { +@@ -957,8 +955,14 @@ void nsGeolocationService::StopDevice() { StaticRefPtr nsGeolocationService::sService; already_AddRefed @@ -1351,7 +1468,7 @@ index 6a624e4c0f5fb8ffff06419a29f6e6acc6108773..370625634f7846d0545ec7ee964d7fa1 if (nsGeolocationService::sService) { result = nsGeolocationService::sService; -@@ -1051,7 +1055,9 @@ nsresult Geolocation::Init(nsPIDOMWindowInner* aContentDom) { +@@ -1050,7 +1054,9 @@ nsresult Geolocation::Init(nsPIDOMWindowInner* aContentDom) { // If no aContentDom was passed into us, we are being used // by chrome/c++ and have no mOwner, no mPrincipal, and no need // to prompt. @@ -1400,10 +1517,10 @@ index 992de29b5d2d09c19e55ebb2502215ec9d05a171..cdc20567b693283b0fd5a5923f7ea542 ~Geolocation(); diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp -index 4b6686880b9fca9bb7c08e850918a4c0f15dac88..825a006b05947ede8ffdfefa4cd12dd5663fb98f 100644 +index c3e7de8f41e06e11155620b75c4d8a830d908b37..39eb9d31258693dce3a26c3227f28d92bccdb019 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp -@@ -62,6 +62,7 @@ +@@ -64,6 +64,7 @@ #include "mozilla/dom/Document.h" #include "mozilla/dom/HTMLDataListElement.h" #include "mozilla/dom/HTMLOptionElement.h" @@ -1411,7 +1528,7 @@ index 4b6686880b9fca9bb7c08e850918a4c0f15dac88..825a006b05947ede8ffdfefa4cd12dd5 #include "nsIFrame.h" #include "nsRangeFrame.h" #include "nsError.h" -@@ -789,6 +790,13 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { +@@ -790,6 +791,13 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { return NS_ERROR_FAILURE; } @@ -1426,7 +1543,7 @@ index 4b6686880b9fca9bb7c08e850918a4c0f15dac88..825a006b05947ede8ffdfefa4cd12dd5 return NS_OK; } diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl -index b4d065ff3197404f92e099afea9a0dcb4ff79bf1..59448d3c4f1054a8a1c8cb415f36fdeb2983040d 100644 +index 5e417145c4f21d8f2aa65088611477b681c9c327..bc84c509659c7556077e69c652e5b19639eb88bb 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -374,6 +374,26 @@ interface nsIDOMWindowUtils : nsISupports { @@ -1457,10 +1574,10 @@ index b4d065ff3197404f92e099afea9a0dcb4ff79bf1..59448d3c4f1054a8a1c8cb415f36fdeb * touchstart, touchend, touchmove, and touchcancel * diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp -index 067e8551685497a8d7681296bbb7d7eae1d7587b..5667fbbfff99b77992eac181304093d8afbff367 100644 +index 93f20a36acef74947d5377df5ff916546218d8b8..22b706b985d22a8c0c278a12ab4944e26ded51a4 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp -@@ -1674,6 +1674,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, +@@ -1676,6 +1676,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, if (postLayerization) { postLayerization->Register(); } @@ -1730,7 +1847,7 @@ index 3b39538e51840cd9b1685b2efd2ff2e9ec83608a..c7bf4f2d53b58bbacb22b3ebebf6f3fc return aGlobalOrNull; diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp -index 8c4364190dadd1a58bfd99e2c0dae1524a4e2c0c..ffadb3b4665a804320724b5a12e09cb29ef31498 100644 +index 5ec21c1c7f975a372399748e8bab2b21ce347f20..ed16831e549afa3d6623398d35eb61e26ab5f2b0 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -23,6 +23,7 @@ @@ -1741,7 +1858,7 @@ index 8c4364190dadd1a58bfd99e2c0dae1524a4e2c0c..ffadb3b4665a804320724b5a12e09cb2 #include "mozilla/Assertions.h" #include "mozilla/Components.h" -@@ -134,6 +135,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, +@@ -135,6 +136,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, return; } @@ -1777,10 +1894,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/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp -index 996b5699166711901ff0d11fe64352b6c9c97d1e..5b08ea6145e6052058a55d6a678fd7539f70baa1 100644 +index a23637c4a887b66a1b4c709a648762b84151bf01..d8da9063261482f1da3257e3f95a8a49d94325f8 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp -@@ -1005,7 +1005,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { +@@ -1026,7 +1026,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { AssertIsOnMainThread(); nsTArray languages; @@ -1789,7 +1906,7 @@ index 996b5699166711901ff0d11fe64352b6c9c97d1e..5b08ea6145e6052058a55d6a678fd753 RuntimeService* runtime = RuntimeService::GetService(); if (runtime) { -@@ -1193,8 +1193,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { +@@ -1214,8 +1214,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { } // The navigator overridden properties should have already been read. @@ -1799,7 +1916,7 @@ index 996b5699166711901ff0d11fe64352b6c9c97d1e..5b08ea6145e6052058a55d6a678fd753 mNavigatorPropertiesLoaded = true; } -@@ -1815,6 +1814,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( +@@ -1836,6 +1835,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( } } @@ -1813,7 +1930,7 @@ index 996b5699166711901ff0d11fe64352b6c9c97d1e..5b08ea6145e6052058a55d6a678fd753 template void RuntimeService::BroadcastAllWorkers(const Func& aFunc) { AssertIsOnMainThread(); -@@ -2340,6 +2346,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( +@@ -2361,6 +2367,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( } } @@ -1855,7 +1972,7 @@ index 58894a8361c7ef1dddd481ca5877a209a8b8ff5c..c481d40d79b6397b7f1d571bd9f6ae5c bool IsWorkerGlobal(JSObject* global); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp -index 0076a8463fa9ff05b32edfe21462987610432b5d..9f810c9728b7d7caf9fbeb3e24346c219326637d 100644 +index 5d918a82708a26125f7322e43f6436d7eafaa812..b230baead02e05d87a211c276066ec7939ea8251 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -736,6 +736,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable { @@ -1877,7 +1994,7 @@ index 0076a8463fa9ff05b32edfe21462987610432b5d..9f810c9728b7d7caf9fbeb3e24346c21 class UpdateLanguagesRunnable final : public WorkerThreadRunnable { nsTArray mLanguages; -@@ -2149,6 +2161,16 @@ void WorkerPrivate::UpdateContextOptions( +@@ -2159,6 +2171,16 @@ void WorkerPrivate::UpdateContextOptions( } } @@ -1894,7 +2011,7 @@ index 0076a8463fa9ff05b32edfe21462987610432b5d..9f810c9728b7d7caf9fbeb3e24346c21 void WorkerPrivate::UpdateLanguages(const nsTArray& aLanguages) { AssertIsOnParentThread(); -@@ -5833,6 +5855,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( +@@ -5946,6 +5968,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( } } @@ -1911,7 +2028,7 @@ index 0076a8463fa9ff05b32edfe21462987610432b5d..9f810c9728b7d7caf9fbeb3e24346c21 const nsTArray& aLanguages) { WorkerGlobalScope* globalScope = GlobalScope(); diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h -index c2ade467934d08587d4e3589b310c6302534d699..414814c03180b50d218ad84a0db262fff19f78a7 100644 +index 7bccdc8c0c2cd53f7aa7a6d9a74435344dd27980..86bba2128a7c0f4e5efa4bfbc939937aec146695 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -443,6 +443,8 @@ class WorkerPrivate final @@ -1923,7 +2040,7 @@ index c2ade467934d08587d4e3589b310c6302534d699..414814c03180b50d218ad84a0db262ff void UpdateLanguagesInternal(const nsTArray& aLanguages); void UpdateJSWorkerMemoryParameterInternal(JSContext* aCx, JSGCParamKey key, -@@ -1086,6 +1088,8 @@ class WorkerPrivate final +@@ -1091,6 +1093,8 @@ class WorkerPrivate final void UpdateContextOptions(const JS::ContextOptions& aContextOptions); @@ -1985,10 +2102,10 @@ index 523e84c8c93f4221701f90f2e8ee146ec8e1adbd..98d5b1176e5378431b859a2dbd4d4e77 inline ClippedTime TimeClip(double time); diff --git a/js/src/debugger/Object.cpp b/js/src/debugger/Object.cpp -index 880e716c24464c93283410417f8e69d6d233d105..6e046fbd2e643dace5ad7796740253df3ddf2cbe 100644 +index b7ea4b6f66d14db0324397cdc1b0ed8c5ea167e2..1c59e328079e7e43b65f7cb7bc31636a48a93263 100644 --- a/js/src/debugger/Object.cpp +++ b/js/src/debugger/Object.cpp -@@ -2474,7 +2474,11 @@ Maybe DebuggerObject::call(JSContext* cx, +@@ -2484,7 +2484,11 @@ Maybe DebuggerObject::call(JSContext* cx, invokeArgs[i].set(args2[i]); } @@ -2001,7 +2118,7 @@ index 880e716c24464c93283410417f8e69d6d233d105..6e046fbd2e643dace5ad7796740253df } diff --git a/js/src/vm/DateTime.cpp b/js/src/vm/DateTime.cpp -index cf63b124f39223a1a42c322dcc0ad108947d54f5..9e3a7b757cbad57ee6cfe2254d0355f62f7c8662 100644 +index a57b8fefa104f966393a99f5a81876b9a95f9743..adc42dd227e52643b06fb101170aeafb490c0acc 100644 --- a/js/src/vm/DateTime.cpp +++ b/js/src/vm/DateTime.cpp @@ -185,6 +185,11 @@ void js::DateTimeInfo::internalResetTimeZone(ResetTimeZoneMode mode) { @@ -2156,10 +2273,10 @@ index 4bfd336ddcbee8004ac538ca7b7d8216d04a61c3..cd22351c4aeacea8afc9828972222aca // No boxes to return return; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp -index c533494e49d59904b839ea770475ec726c4c897e..1da4eeb774dadb4e3463cbeb17d857ccb6ef76ea 100644 +index e8fb3a8304b27814e6e84355f24410c820667f9d..211c86fe55b8b650e40275a427b30a1ee8a9a3d7 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp -@@ -11278,7 +11278,9 @@ bool PresShell::ComputeActiveness() const { +@@ -11512,7 +11512,9 @@ bool PresShell::ComputeActiveness() const { if (!browserChild->IsVisible()) { MOZ_LOG(gLog, LogLevel::Debug, (" > BrowserChild %p is not visible", browserChild)); @@ -2171,7 +2288,7 @@ index c533494e49d59904b839ea770475ec726c4c897e..1da4eeb774dadb4e3463cbeb17d857cc // 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 1fba8697d48f35e20a69ff861f5da9689c6d6769..77d0de76f346c0563d9b74b667c8400e26a98694 100644 +index 315d532eab56dab13b6c8bc2380a5cda2a17ffc1..7c4552137149e8c7fc9ac08a09bd4242952b53b6 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -708,6 +708,10 @@ bool nsLayoutUtils::AllowZoomingForDocument( @@ -2185,7 +2302,7 @@ index 1fba8697d48f35e20a69ff861f5da9689c6d6769..77d0de76f346c0563d9b74b667c8400e // True if we allow zooming for all documents on this platform, or if we are // in RDM. BrowsingContext* bc = aDocument->GetBrowsingContext(); -@@ -9709,6 +9713,9 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont, +@@ -9770,6 +9774,9 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont, /* static */ bool nsLayoutUtils::ShouldHandleMetaViewport(const Document* aDocument) { @@ -2196,10 +2313,10 @@ index 1fba8697d48f35e20a69ff861f5da9689c6d6769..77d0de76f346c0563d9b74b667c8400e return StaticPrefs::dom_meta_viewport_enabled() || (bc && bc->InRDMPane()); } diff --git a/layout/style/GeckoBindings.h b/layout/style/GeckoBindings.h -index acb5b24776c8591933d1abcbcc7b254cf2ceb4e4..191ddd1f43bd704294727555c3d5137d69c1460c 100644 +index c7cf59c2661c7e203384c9b82789879f756b44b7..21e32dab4e60112c073bdd5070a308da2b4e0373 100644 --- a/layout/style/GeckoBindings.h +++ b/layout/style/GeckoBindings.h -@@ -593,6 +593,7 @@ float Gecko_MediaFeatures_GetResolution(const mozilla::dom::Document*); +@@ -596,6 +596,7 @@ float Gecko_MediaFeatures_GetResolution(const mozilla::dom::Document*); bool Gecko_MediaFeatures_PrefersReducedMotion(const mozilla::dom::Document*); bool Gecko_MediaFeatures_PrefersReducedTransparency( const mozilla::dom::Document*); @@ -2208,7 +2325,7 @@ index acb5b24776c8591933d1abcbcc7b254cf2ceb4e4..191ddd1f43bd704294727555c3d5137d const mozilla::dom::Document*); mozilla::StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme( diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp -index ca382a3cfba8ce5839890d6e4cb3cf9789287e3b..b1f1b579d7609c6ab93cc0bc52417ea54ab4aeed 100644 +index ca382a3cfba8ce5839890d6e4cb3cf9789287e3b..5800fc23dc77ee5764beddd6fa48a7fd701d2939 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -264,11 +264,7 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) { @@ -2224,8 +2341,29 @@ index ca382a3cfba8ce5839890d6e4cb3cf9789287e3b..b1f1b579d7609c6ab93cc0bc52417ea5 } bool Gecko_MediaFeatures_PrefersReducedTransparency(const Document* aDocument) { +@@ -293,6 +289,20 @@ StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme( + // as a signal. + StylePrefersContrast Gecko_MediaFeatures_PrefersContrast( + const Document* aDocument) { ++ if (auto* bc = aDocument->GetBrowsingContext()) { ++ switch (bc->Top()->PrefersContrastOverride()) { ++ case dom::PrefersContrastOverride::No_preference: ++ return StylePrefersContrast::NoPreference; ++ case dom::PrefersContrastOverride::Less: ++ return StylePrefersContrast::Less; ++ case dom::PrefersContrastOverride::More: ++ return StylePrefersContrast::More; ++ case dom::PrefersContrastOverride::Custom: ++ return StylePrefersContrast::Custom; ++ } ++ } ++ ++ + if (aDocument->ShouldResistFingerprinting(RFPTarget::CSSPrefersContrast)) { + return StylePrefersContrast::NoPreference; + } diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp -index 06acdc629c2b6ee0e29c50d8edc5a96d343b1ef2..6c263edf54117fd9cbf4a77abc396f1238730880 100644 +index 1ec2c64193206d31702e22e5c4783f084b1cff31..fb463eb12ee39cd1e448369f3b47fbcfbb2473b9 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp @@ -696,7 +696,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) @@ -2238,7 +2376,7 @@ index 06acdc629c2b6ee0e29c50d8edc5a96d343b1ef2..6c263edf54117fd9cbf4a77abc396f12 } LoadInfo::LoadInfo( -@@ -2515,4 +2516,16 @@ LoadInfo::SetSkipHTTPSUpgrade(bool aSkipHTTPSUpgrade) { +@@ -2534,4 +2535,16 @@ LoadInfo::SetSkipHTTPSUpgrade(bool aSkipHTTPSUpgrade) { return NS_OK; } @@ -2256,10 +2394,10 @@ index 06acdc629c2b6ee0e29c50d8edc5a96d343b1ef2..6c263edf54117fd9cbf4a77abc396f12 + } // namespace mozilla::net diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h -index c78602f6b46c983aa4d96c5727ebbaf7e2c7d984..e292766a0f34306ea1101be4ecd8848764726bad 100644 +index 93cc8d3630f7029303240555ae72d41b68047375..8a09863af399e25ba3f01caff2f6b3af1260e8b8 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h -@@ -423,6 +423,8 @@ class LoadInfo final : public nsILoadInfo { +@@ -426,6 +426,8 @@ class LoadInfo final : public nsILoadInfo { bool mIsNewWindowTarget = false; bool mSkipHTTPSUpgrade = false; @@ -2269,10 +2407,10 @@ index c78602f6b46c983aa4d96c5727ebbaf7e2c7d984..e292766a0f34306ea1101be4ecd88487 // This is exposed solely for testing purposes and should not be used outside of diff --git a/netwerk/base/TRRLoadInfo.cpp b/netwerk/base/TRRLoadInfo.cpp -index 5984a0a196615cca5544de052874cbb163a8233b..3617816a06651ae65c214ebd5f0affedc4d11390 100644 +index d1650595f8cf28a704f94a99c1f6bfe1deb9cc77..2072a3990ff6f4496626dcebb277291ad845cac3 100644 --- a/netwerk/base/TRRLoadInfo.cpp +++ b/netwerk/base/TRRLoadInfo.cpp -@@ -936,5 +936,15 @@ TRRLoadInfo::GetFetchDestination(nsACString& aDestination) { +@@ -950,5 +950,15 @@ TRRLoadInfo::GetFetchDestination(nsACString& aDestination) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -2289,33 +2427,42 @@ index 5984a0a196615cca5544de052874cbb163a8233b..3617816a06651ae65c214ebd5f0affed } // namespace net } // namespace mozilla diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl -index 50dfc8767a99eef5e8748d648995f3cd7cc81a73..32a171eac26376144482bc7d90e8662a0e719f47 100644 +index 774ec045c0b18310e8cb86e8a9d6b1788d028435..cbf303a0ed872c27d580b4b6615f3dd9c76a8a19 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl -@@ -1616,4 +1616,6 @@ interface nsILoadInfo : nsISupports - * When true, this load will never be upgraded to HTTPS. - */ - [infallible] attribute boolean skipHTTPSUpgrade; +@@ -1626,4 +1626,6 @@ interface nsILoadInfo : nsISupports + return static_cast(userNavigationInvolvement); + } + %} + + [infallible] attribute unsigned long long jugglerLoadIdentifier; }; diff --git a/netwerk/base/nsINetworkInterceptController.idl b/netwerk/base/nsINetworkInterceptController.idl -index 7f91d2df6f8bb4020c75c132dc8f6bf26625fa1e..ba6569f4be8fc54ec96ee44d5de45a0904c077ba 100644 +index 7f91d2df6f8bb4020c75c132dc8f6bf26625fa1e..aaa5541a17039d6b13ad83ab176fdaaf79edb2a0 100644 --- a/netwerk/base/nsINetworkInterceptController.idl +++ b/netwerk/base/nsINetworkInterceptController.idl -@@ -59,6 +59,7 @@ interface nsIInterceptedChannel : nsISupports - * results in the resulting client not being controlled. +@@ -60,6 +60,16 @@ interface nsIInterceptedChannel : nsISupports */ void resetInterception(in boolean bypass); -+ void resetInterceptionWithURI(in nsIURI aURI); ++ // ----- Playwright begin ----- ++ ++ // Same as resetInterception, but updates the URI. ++ void resetInterceptionWithURI(in nsIURI aURI); ++ ++ // After resetInterception is called, this request will be intercepted again. ++ void interceptAfterServiceWorkerResets(); ++ ++ // ----- Playwright end ------- ++ /** * 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 8b392845d07f50dddf016770836107614b6b9753..b0817d1b660dbb2dd856daf30ec9ec0fcb3d2aeb 100644 +index 771ae1fbe3d54aa25443eea675cf3abd26a21ce9..a916cb49c16dc6c7809ccbb7c8d4172446a5ac07 100644 --- a/netwerk/ipc/DocumentLoadListener.cpp +++ b/netwerk/ipc/DocumentLoadListener.cpp -@@ -172,6 +172,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, +@@ -177,6 +177,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, loadInfo->SetTextDirectiveUserActivation( aLoadState->GetTextDirectiveUserActivation()); loadInfo->SetIsMetaRefresh(aLoadState->IsMetaRefresh()); @@ -2324,13 +2471,19 @@ index 8b392845d07f50dddf016770836107614b6b9753..b0817d1b660dbb2dd856daf30ec9ec0f return loadInfo.forget(); } diff --git a/netwerk/protocol/http/InterceptedHttpChannel.cpp b/netwerk/protocol/http/InterceptedHttpChannel.cpp -index b7c129dcc21cb5d5478765f6aa06ed047aee6de0..6f3881c002c5f6d3e48865d253515ffd4d24bcf6 100644 +index fbf4bdf1e24d1102df113984be6c8dc3a7d0d810..787bf014d3bf0b8537f99bf5eb4074e100c78c18 100644 --- a/netwerk/protocol/http/InterceptedHttpChannel.cpp +++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp -@@ -726,6 +726,14 @@ NS_IMPL_ISUPPORTS(ResetInterceptionHeaderVisitor, nsIHttpHeaderVisitor) +@@ -728,10 +728,33 @@ NS_IMPL_ISUPPORTS(ResetInterceptionHeaderVisitor, nsIHttpHeaderVisitor) } // anonymous namespace ++NS_IMETHODIMP ++InterceptedHttpChannel::InterceptAfterServiceWorkerResets() { ++ mInterceptAfterServiceWorkerResets = true; ++ return NS_OK; ++} ++ +NS_IMETHODIMP +InterceptedHttpChannel::ResetInterceptionWithURI(nsIURI* aURI) { + if (aURI) { @@ -2342,7 +2495,20 @@ index b7c129dcc21cb5d5478765f6aa06ed047aee6de0..6f3881c002c5f6d3e48865d253515ffd NS_IMETHODIMP InterceptedHttpChannel::ResetInterception(bool aBypass) { INTERCEPTED_LOG(("InterceptedHttpChannel::ResetInterception [%p] bypass: %s", -@@ -1139,11 +1147,18 @@ InterceptedHttpChannel::OnStartRequest(nsIRequest* aRequest) { + this, aBypass ? "true" : "false")); ++ if (mInterceptAfterServiceWorkerResets) { ++ mInterceptAfterServiceWorkerResets = false; ++ nsCOMPtr controller; ++ GetCallback(controller); ++ if (!controller) ++ return NS_ERROR_DOM_INVALID_STATE_ERR; ++ return controller->ChannelIntercepted(this); ++ } ++ + if (mCanceled) { + return mStatus; + } +@@ -1146,11 +1169,18 @@ InterceptedHttpChannel::OnStartRequest(nsIRequest* aRequest) { GetCallback(mProgressSink); } @@ -2361,11 +2527,27 @@ index b7c129dcc21cb5d5478765f6aa06ed047aee6de0..6f3881c002c5f6d3e48865d253515ffd if (mPump && mLoadFlags & LOAD_CALL_CONTENT_SNIFFERS) { mPump->PeekStream(CallTypeSniffers, static_cast(this)); +diff --git a/netwerk/protocol/http/InterceptedHttpChannel.h b/netwerk/protocol/http/InterceptedHttpChannel.h +index 704404c9f094640ad63b685d64bd5a396e733e4b..92bdc21b4d6a015cc2f2bb22781ec6750c7789ec 100644 +--- a/netwerk/protocol/http/InterceptedHttpChannel.h ++++ b/netwerk/protocol/http/InterceptedHttpChannel.h +@@ -90,6 +90,11 @@ class InterceptedHttpChannel final + Atomic mCallingStatusAndProgress; + bool mInterceptionReset{false}; + ++ // ----- Playwright begin ----- ++ // After resetInterception is called, this request will call into interceptors again. ++ bool mInterceptAfterServiceWorkerResets{false}; ++ // ----- Playwright end ------- ++ + /** + * InterceptionTimeStamps is used to record the time stamps of the + * interception. diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp -index d05b06c3f9ddba3b40d5969730474eaf0d843cb1..9b2cc35c504e1044ac681c62c107f8feb6c16938 100644 +index d3b44cc62d3df49bbf842356cbdb153c82c3163c..23cf9bc83fb1faaf1c7406331b78e522b307cbf0 100644 --- a/parser/html/nsHtml5TreeOpExecutor.cpp +++ b/parser/html/nsHtml5TreeOpExecutor.cpp -@@ -1334,6 +1334,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( +@@ -1349,6 +1349,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( void nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); @@ -2377,10 +2559,10 @@ index d05b06c3f9ddba3b40d5969730474eaf0d843cb1..9b2cc35c504e1044ac681c62c107f8fe nsCOMPtr preloadCsp = mDocument->GetPreloadCsp(); if (!preloadCsp) { diff --git a/security/manager/ssl/nsCertOverrideService.cpp b/security/manager/ssl/nsCertOverrideService.cpp -index b2e328e7c7d7a89be34b84fd176c306a3620c77c..54f24b213bcdc78c702e15d4d45a3943bc082281 100644 +index 8413eb5916f1f857e18972a14292d14f32684aee..66a3c7b01fdc56c29d789ff786aa91d8b0f02cd6 100644 --- a/security/manager/ssl/nsCertOverrideService.cpp +++ b/security/manager/ssl/nsCertOverrideService.cpp -@@ -439,7 +439,12 @@ nsCertOverrideService::HasMatchingOverride( +@@ -433,7 +433,12 @@ nsCertOverrideService::HasMatchingOverride( bool disableAllSecurityCheck = false; { MutexAutoLock lock(mMutex); @@ -2394,7 +2576,7 @@ index b2e328e7c7d7a89be34b84fd176c306a3620c77c..54f24b213bcdc78c702e15d4d45a3943 } if (disableAllSecurityCheck) { *aIsTemporary = false; -@@ -651,14 +656,24 @@ static bool IsDebugger() { +@@ -645,14 +650,24 @@ static bool IsDebugger() { NS_IMETHODIMP nsCertOverrideService:: @@ -2450,7 +2632,7 @@ index 6dfd07d6b676a99993408921de8dea9d561f201d..e3c6794363cd6336effbeac83a179f37 readonly attribute boolean securityCheckDisabled; }; diff --git a/services/settings/Utils.sys.mjs b/services/settings/Utils.sys.mjs -index 12fef6cde815a9301944c399a58f27a7e4c4d5d7..0f7f06d1002a089547d1b15d7d8ddf264f28b529 100644 +index d3643aedf21a26594268a47bc0f6ac53e3977f75..795c6f3b28278b9f65a596799d4e424880fcffa7 100644 --- a/services/settings/Utils.sys.mjs +++ b/services/settings/Utils.sys.mjs @@ -97,7 +97,7 @@ const _cdnURLs = {}; @@ -2487,7 +2669,7 @@ index 75555352b8a15a50e4a21e34fc8ede4e9246c7cc..72855a404effa42b6c55cd0c2fcb8bdd // 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 8b975a8b11bcf2eabbb7fa51a431ff99ff69a5bc..0eeb5924c43a21b8561dd4b68fa89228ddcbc708 100644 +index 76fb919603e8d2b7864d351eb47be2a38e40e31e..cdfef96e20bea13799751154f4076bbcc2f827d4 100644 --- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs +++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs @@ -108,6 +108,12 @@ EnterprisePoliciesManager.prototype = { @@ -2504,10 +2686,10 @@ index 8b975a8b11bcf2eabbb7fa51a431ff99ff69a5bc..0eeb5924c43a21b8561dd4b68fa89228 if (provider.failed) { diff --git a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp -index 77496e700eebbf286e8c5175ea1f77f8576fde1f..3d13e9b316284eaef5d4c82087117020ca8aba71 100644 +index 253171bed4dea54fc28bb4ddc9920823dbd9351c..6dc0e620b399ed9ee6b53f97bc080ec17ee4e1b5 100644 --- a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp +++ b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp -@@ -488,7 +488,7 @@ void PopulateLanguages() { +@@ -490,7 +490,7 @@ void PopulateLanguages() { // sufficient to only collect this information as the other properties are // just reformats of Navigator::GetAcceptLanguages. nsTArray languages; @@ -2517,10 +2699,10 @@ index 77496e700eebbf286e8c5175ea1f77f8576fde1f..3d13e9b316284eaef5d4c82087117020 for (const auto& language : languages) { diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp -index 9297e5eacd65658289dda764ad39e182c22d192b..15926f106850637a5bbd27e56834dc5c82791250 100644 +index dc0826f72134b91482e30d183ddf52e95146e12f..119a324e162b6965ddd3d6b2d53bd2856a174452 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp -@@ -365,7 +365,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) { +@@ -361,7 +361,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) { nsCOMPtr windowEnumerator; nsCOMPtr mediator( do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); @@ -2545,10 +2727,10 @@ index 654903fadb709be976b72f36f155e23bc0622152..815b3dc24c9fda6b1db6c4666ac68904 int32_t aMaxSelfProgress, int32_t aCurTotalProgress, diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.cpp b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -index 585a957fd8a1467dc262bd1ca2058584fd8762c9..16ad38c3b7d753c386e091af700d1bebd4c59e3e 100644 +index 811fb16410e8cf900ad873797269e5fe715579a5..821f5b0c2af8e1dc8754cd023571d1d0ff09eeb6 100644 --- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp +++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -@@ -1875,7 +1875,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( +@@ -1880,7 +1880,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( // Open a minimal popup. *aIsPopupRequested = true; @@ -2562,10 +2744,10 @@ index 585a957fd8a1467dc262bd1ca2058584fd8762c9..16ad38c3b7d753c386e091af700d1beb /** diff --git a/toolkit/mozapps/update/UpdateService.sys.mjs b/toolkit/mozapps/update/UpdateService.sys.mjs -index eeec31f4d77de0f9622692eeb761392ed54b90ad..8907773fb6212f4e9cc184f87b840c91a0db67b6 100644 +index 40f04aeace0efd701e9454bb8dc6260dec90807e..5b70f65f3e78fc0889b15651ff203bb82e79d202 100644 --- a/toolkit/mozapps/update/UpdateService.sys.mjs +++ b/toolkit/mozapps/update/UpdateService.sys.mjs -@@ -3811,6 +3811,8 @@ export class UpdateService { +@@ -3814,6 +3814,8 @@ export class UpdateService { } get disabledForTesting() { @@ -2586,22 +2768,6 @@ index c50b7f3932e18da9fad4b673e353974a001e78c4..708e0d75594ddcd62276d4e08c4bd5c6 "/toolkit/components/telemetry/tests/marionette", ] -diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp -index 795fc8669cc6f03a57139745f58963ffefe5aeff..46651bb0b53be9a522e1deb90140bf386a9f8b51 100644 ---- a/toolkit/xre/nsAppRunner.cpp -+++ b/toolkit/xre/nsAppRunner.cpp -@@ -5633,7 +5633,10 @@ nsresult XREMain::XRE_mainRun() { - - if (!AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) { - #ifdef XP_MACOSX -- if (!BackgroundTasks::IsBackgroundTaskMode()) { -+# if defined(MOZ_BACKGROUNDTASKS) -+ if (!BackgroundTasks::IsBackgroundTaskMode()) -+# endif // defined(MOZ_BACKGROUNDTASKS) -+ { - rv = appStartup->CreateHiddenWindow(); - NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); - } diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp index 7eb9e1104682d4eb47060654f43a1efa8b2a6bb2..a8315d6decf654b5302bea5beeea34140c300ded 100644 --- a/toolkit/xre/nsWindowsWMain.cpp @@ -2655,7 +2821,7 @@ index e5cc386651e192710b61858ab5625c97a02b92da..e560ad4fef232a26ce1e1b244f4ccea0 // 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 c4dc15918032a34d8be9f1cda94a9375466980f6..20756dc9166f9665d408cd007e9df55b5937b73c 100644 +index e23df8e6f982ea71eb1f07dd677ed13109d2831b..d98f49d34a346113fd0ed5c242d5ef228ea0e0cd 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -112,6 +112,7 @@ @@ -2666,7 +2832,7 @@ index c4dc15918032a34d8be9f1cda94a9375466980f6..20756dc9166f9665d408cd007e9df55b #include "mozilla/Preferences.h" #include "mozilla/ipc/URIUtils.h" -@@ -864,6 +865,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension( +@@ -865,6 +866,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension( return NS_OK; } @@ -2679,7 +2845,7 @@ index c4dc15918032a34d8be9f1cda94a9375466980f6..20756dc9166f9665d408cd007e9df55b nsresult nsExternalHelperAppService::GetFileTokenForPath( const char16_t* aPlatformAppPath, nsIFile** aFile) { nsDependentString platformAppPath(aPlatformAppPath); -@@ -1485,7 +1492,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { +@@ -1486,7 +1493,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { // Strip off the ".part" from mTempLeafName mTempLeafName.Truncate(mTempLeafName.Length() - std::size(".part") + 1); @@ -2692,7 +2858,7 @@ index c4dc15918032a34d8be9f1cda94a9375466980f6..20756dc9166f9665d408cd007e9df55b mSaver = do_CreateInstance(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); -@@ -1671,7 +1683,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1672,7 +1684,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { return NS_OK; } @@ -2730,7 +2896,7 @@ index c4dc15918032a34d8be9f1cda94a9375466980f6..20756dc9166f9665d408cd007e9df55b if (NS_FAILED(rv)) { nsresult transferError = rv; -@@ -1732,6 +1773,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1733,6 +1774,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { bool alwaysAsk = true; mMimeInfo->GetAlwaysAskBeforeHandling(&alwaysAsk); @@ -2740,7 +2906,7 @@ index c4dc15918032a34d8be9f1cda94a9375466980f6..20756dc9166f9665d408cd007e9df55b if (alwaysAsk) { // But we *don't* ask if this mimeInfo didn't come from // our user configuration datastore and the user has said -@@ -2248,6 +2292,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, +@@ -2249,6 +2293,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, NotifyTransfer(aStatus); } @@ -2757,7 +2923,7 @@ index c4dc15918032a34d8be9f1cda94a9375466980f6..20756dc9166f9665d408cd007e9df55b return NS_OK; } -@@ -2731,6 +2785,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { +@@ -2732,6 +2786,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { } } @@ -2868,10 +3034,10 @@ index 1c25e9d9a101233f71e92288a0f93125b81ac1c5..22cf67b0f6e3ddd2b3ed725a314ba6a9 } #endif diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h -index c4e510441cf6329b2ad898034fbe39fa1a701ad4..e34d797ee3e3f2985e6d4472afce133e97a0caa4 100644 +index 5ca1a6fa13233b1bd00ee0467732c5875c51d343..0d3b8ebe127e59516802e8819f4bbed961f0992b 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h -@@ -363,6 +363,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, +@@ -368,6 +368,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, // Otherwise, this must be 0. uint32_t mClickCount = 0; @@ -2881,7 +3047,7 @@ index c4e510441cf6329b2ad898034fbe39fa1a701ad4..e34d797ee3e3f2985e6d4472afce133e // Whether the event should ignore scroll frame bounds during dispatch. bool mIgnoreRootScrollFrame = false; -@@ -386,6 +389,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, +@@ -391,6 +394,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, mContextMenuTrigger = aEvent.mContextMenuTrigger; mExitFrom = aEvent.mExitFrom; mClickCount = aEvent.mClickCount; @@ -2890,10 +3056,10 @@ index c4e510441cf6329b2ad898034fbe39fa1a701ad4..e34d797ee3e3f2985e6d4472afce133e mIgnoreCapturingContent = aEvent.mIgnoreCapturingContent; mClickEventPrevented = aEvent.mClickEventPrevented; diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.mm -index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce8050630a1aa 100644 +index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf56dbd408e 100644 --- a/widget/cocoa/NativeKeyBindings.mm +++ b/widget/cocoa/NativeKeyBindings.mm -@@ -528,6 +528,13 @@ +@@ -549,6 +549,13 @@ break; case KEY_NAME_INDEX_ArrowLeft: if (aEvent.IsAlt()) { @@ -2907,7 +3073,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805 break; } if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) { -@@ -550,6 +557,13 @@ +@@ -571,6 +578,13 @@ break; case KEY_NAME_INDEX_ArrowRight: if (aEvent.IsAlt()) { @@ -2921,7 +3087,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805 break; } if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) { -@@ -572,6 +586,10 @@ +@@ -593,6 +607,10 @@ break; case KEY_NAME_INDEX_ArrowUp: if (aEvent.IsControl()) { @@ -2932,7 +3098,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805 break; } if (aEvent.IsMeta()) { -@@ -582,7 +600,7 @@ +@@ -603,7 +621,7 @@ !aEvent.IsShift() ? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:)) : ToObjcSelectorPtr( @@ -2941,7 +3107,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805 aCommands); break; } -@@ -609,6 +627,10 @@ +@@ -630,6 +648,10 @@ break; case KEY_NAME_INDEX_ArrowDown: if (aEvent.IsControl()) { @@ -2953,7 +3119,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805 } if (aEvent.IsMeta()) { diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp -index ad56ab325bb3b3c348259f852453eec1190d892b..272731c25d19e83a2da988ec3176e5227dc4da5b 100644 +index f4bded345e95674c66e4d4ad56b50844fce0871b..321e22d334a8bbc6057ee78e77e139a2804b2403 100644 --- a/widget/gtk/nsFilePicker.cpp +++ b/widget/gtk/nsFilePicker.cpp @@ -21,6 +21,7 @@ @@ -3114,7 +3280,7 @@ index facd2bc65afab8ec1aa322faa20a67464964dfb9..d6dea95472bec6006411753c3dfdab2e } // namespace widget diff --git a/widget/headless/HeadlessWidget.cpp b/widget/headless/HeadlessWidget.cpp -index b8b3f6a09f3fd480f67c28a2d3c6daa960946324..8b9ea637e18c404254ca8a72dabf860452699096 100644 +index daa2d455374fd9f75a5c6ac9f7b91696d88b065c..f45184137b52db0a5774bf3365b15f784532fbdf 100644 --- a/widget/headless/HeadlessWidget.cpp +++ b/widget/headless/HeadlessWidget.cpp @@ -111,6 +111,8 @@ void HeadlessWidget::Destroy() { @@ -3126,7 +3292,7 @@ index b8b3f6a09f3fd480f67c28a2d3c6daa960946324..8b9ea637e18c404254ca8a72dabf8604 nsBaseWidget::OnDestroy(); nsBaseWidget::Destroy(); -@@ -591,5 +593,14 @@ nsresult HeadlessWidget::SynthesizeNativeTouchpadPan( +@@ -593,5 +595,14 @@ nsresult HeadlessWidget::SynthesizeNativeTouchpadPan( return NS_OK; } @@ -3142,10 +3308,10 @@ index b8b3f6a09f3fd480f67c28a2d3c6daa960946324..8b9ea637e18c404254ca8a72dabf8604 } // namespace widget } // namespace mozilla diff --git a/widget/headless/HeadlessWidget.h b/widget/headless/HeadlessWidget.h -index f07f7284495cf5e48409866aaef6fd4d529568be..daefaa8f58c3c8392ce229c814807bc5fff77dc7 100644 +index 39833c28e40c61e354119cde429b8389056bafac..a638fb7520b857219ce58fcbf9ca0ed939528924 100644 --- a/widget/headless/HeadlessWidget.h +++ b/widget/headless/HeadlessWidget.h -@@ -136,6 +136,9 @@ class HeadlessWidget : public nsBaseWidget { +@@ -132,6 +132,9 @@ class HeadlessWidget final : public nsBaseWidget { int32_t aModifierFlags, nsIObserver* aObserver) override; @@ -3156,7 +3322,7 @@ index f07f7284495cf5e48409866aaef6fd4d529568be..daefaa8f58c3c8392ce229c814807bc5 ~HeadlessWidget(); bool mEnabled; diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h -index a1f48167403f5bfb30a66809ec3e64bea468fa05..eac7fccf3493e162629918462294456e6ee6b6e1 100644 +index f7262978239665cbe20470da0790d4d177d4c501..70d11aca3d5b509cf5b37d626299a23fede73ba3 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h @@ -244,6 +244,7 @@ struct ParamTraits { diff --git a/browser_patches/firefox/preferences/playwright.cfg b/browser_patches/firefox/preferences/playwright.cfg index db47c4f0c39e4..8c0404cbe73ac 100644 --- a/browser_patches/firefox/preferences/playwright.cfg +++ b/browser_patches/firefox/preferences/playwright.cfg @@ -8,6 +8,10 @@ pref("dom.input_events.security.minTimeElapsedInMS", 0); pref("dom.iframe_lazy_loading.enabled", false); +// This setting is experimental and is only enabled on early betas. +// Disable it unconditionally since it breaks proxy tests. +pref("dom.security.https_first", false); + pref("datareporting.policy.dataSubmissionEnabled", false); pref("datareporting.policy.dataSubmissionPolicyAccepted", false); pref("datareporting.policy.dataSubmissionPolicyBypassNotification", true); @@ -92,6 +96,14 @@ pref("geo.provider.testing", true); pref("media.getdisplaymedia.screencapturekit.enabled", false); pref("media.getdisplaymedia.screencapturekit.picker.enabled", false); +// Allow proxying loopback URLs; see https://phabricator.services.mozilla.com/D237187 +pref("network.proxy.allow_hijacking_localhost", true); +pref("network.proxy.testing_localhost_is_secure_when_hijacked", true); + +// Disable double-dispatching of "input" event for the text composition. +// See https://phabricator.services.mozilla.com/D234620 for details. +pref("dom.input_events.dispatch_before_compositionend", false); + // Enable software-backed webgl. See https://phabricator.services.mozilla.com/D164016 pref("webgl.forbid-software", false); diff --git a/browser_patches/webkit/UPSTREAM_CONFIG.sh b/browser_patches/webkit/UPSTREAM_CONFIG.sh index ddac1019b9811..a5ab8feea5500 100644 --- a/browser_patches/webkit/UPSTREAM_CONFIG.sh +++ b/browser_patches/webkit/UPSTREAM_CONFIG.sh @@ -1,3 +1,3 @@ REMOTE_URL="https://github.com/WebKit/WebKit.git" BASE_BRANCH="main" -BASE_REVISION="71b1107b4656f116936a278cb4948cc2db56998c" +BASE_REVISION="4dd862e5ce1c10d77f72be94260164c5f13aafbd" diff --git a/browser_patches/webkit/embedder/Playwright/win/MainWindow.cpp b/browser_patches/webkit/embedder/Playwright/win/MainWindow.cpp index e74590c491860..f8430a601d6ef 100644 --- a/browser_patches/webkit/embedder/Playwright/win/MainWindow.cpp +++ b/browser_patches/webkit/embedder/Playwright/win/MainWindow.cpp @@ -140,7 +140,7 @@ void MainWindow::createToolbar(HINSTANCE hInstance) SendMessage(m_hToolbarWnd, TB_ADDBUTTONS, _countof(tbButtons), reinterpret_cast(&tbButtons)); ShowWindow(m_hToolbarWnd, true); - m_hURLBarWnd = CreateWindow(L"EDIT", 0, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, 0, 0, 0, 0, m_hToolbarWnd, 0, hInstance, 0); + m_hURLBarWnd = CreateWindow(L"EDIT", 0, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOHSCROLL, 0, 0, 0, 0, m_hToolbarWnd, 0, hInstance, 0); DefEditProc = reinterpret_cast(GetWindowLongPtr(m_hURLBarWnd, GWLP_WNDPROC)); SetWindowLongPtr(m_hURLBarWnd, GWLP_WNDPROC, reinterpret_cast(EditProc)); @@ -210,7 +210,9 @@ bool MainWindow::init(HINSTANCE hInstance, WKPageConfigurationRef conf) resizeSubViews(); if (s_headless) { + auto menu = GetMenu(m_hMainWnd); SetMenu(m_hMainWnd, NULL); + DestroyMenu(menu); } else { SetFocus(m_hURLBarWnd); ShowWindow(m_hMainWnd, SW_SHOW); diff --git a/browser_patches/webkit/embedder/Playwright/win/Playwright.ico b/browser_patches/webkit/embedder/Playwright/win/Playwright.ico index 0137fe83a54dd..cea0bdebc38b2 100644 Binary files a/browser_patches/webkit/embedder/Playwright/win/Playwright.ico and b/browser_patches/webkit/embedder/Playwright/win/Playwright.ico differ diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff index a067098b83aa0..573fbebe440b2 100644 --- a/browser_patches/webkit/patches/bootstrap.diff +++ b/browser_patches/webkit/patches/bootstrap.diff @@ -1,8 +1,8 @@ diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt -index 37aca585f67028500a828354396c9e59ccfe273d..f32c64abe10c08b44a75b4682ab2885a4d258799 100644 +index 27178e3306f1a1957516fbf90e101d1da144a8bd..ed99032196ff06fbe32cc3d88cdca110d0a29d30 100644 --- a/Source/JavaScriptCore/CMakeLists.txt +++ b/Source/JavaScriptCore/CMakeLists.txt -@@ -1402,22 +1402,27 @@ set(JavaScriptCore_INSPECTOR_DOMAINS +@@ -1405,21 +1405,26 @@ set(JavaScriptCore_INSPECTOR_DOMAINS ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json @@ -10,7 +10,6 @@ index 37aca585f67028500a828354396c9e59ccfe273d..f32c64abe10c08b44a75b4682ab2885a ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOM.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMDebugger.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMStorage.json - ${JAVASCRIPTCORE_DIR}/inspector/protocol/Database.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json + ${JAVASCRIPTCORE_DIR}/inspector/protocol/Emulation.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/GenericTypes.json @@ -31,10 +30,10 @@ index 37aca585f67028500a828354396c9e59ccfe273d..f32c64abe10c08b44a75b4682ab2885a ${JAVASCRIPTCORE_DIR}/inspector/protocol/ServiceWorker.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Target.json diff --git a/Source/JavaScriptCore/DerivedSources-input.xcfilelist b/Source/JavaScriptCore/DerivedSources-input.xcfilelist -index 7b9566ebe6355e6cb853e59a478a17a29953e856..a8d3266e69c4700a8b5ed806f456e8d1bc3194b9 100644 +index 4ebffbf7b080143afc4d9da6c516174cd08ffb5c..ddf59a7c8f336d9ee13b052c3ff685f1cadacd30 100644 --- a/Source/JavaScriptCore/DerivedSources-input.xcfilelist +++ b/Source/JavaScriptCore/DerivedSources-input.xcfilelist -@@ -100,21 +100,26 @@ $(PROJECT_DIR)/inspector/protocol/CPUProfiler.json +@@ -97,20 +97,25 @@ $(PROJECT_DIR)/inspector/protocol/CPUProfiler.json $(PROJECT_DIR)/inspector/protocol/CSS.json $(PROJECT_DIR)/inspector/protocol/Canvas.json $(PROJECT_DIR)/inspector/protocol/Console.json @@ -42,7 +41,6 @@ index 7b9566ebe6355e6cb853e59a478a17a29953e856..a8d3266e69c4700a8b5ed806f456e8d1 $(PROJECT_DIR)/inspector/protocol/DOM.json $(PROJECT_DIR)/inspector/protocol/DOMDebugger.json $(PROJECT_DIR)/inspector/protocol/DOMStorage.json - $(PROJECT_DIR)/inspector/protocol/Database.json $(PROJECT_DIR)/inspector/protocol/Debugger.json +$(PROJECT_DIR)/inspector/protocol/Emulation.json $(PROJECT_DIR)/inspector/protocol/GenericTypes.json @@ -62,10 +60,10 @@ index 7b9566ebe6355e6cb853e59a478a17a29953e856..a8d3266e69c4700a8b5ed806f456e8d1 $(PROJECT_DIR)/inspector/protocol/Security.json $(PROJECT_DIR)/inspector/protocol/ServiceWorker.json diff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make -index 103f0b77b93558944be1770a00e1a149d7257812..a580b33ea9a7f2f74547f77c1dab4caa019dce81 100644 +index a37d9dfd55e0d0e20db0c984e594b685fbb96a9e..11e68adc7db68a30be854177a93984d074dbac85 100644 --- a/Source/JavaScriptCore/DerivedSources.make +++ b/Source/JavaScriptCore/DerivedSources.make -@@ -303,22 +303,27 @@ INSPECTOR_DOMAINS := \ +@@ -300,21 +300,26 @@ INSPECTOR_DOMAINS := \ $(JavaScriptCore)/inspector/protocol/CSS.json \ $(JavaScriptCore)/inspector/protocol/Canvas.json \ $(JavaScriptCore)/inspector/protocol/Console.json \ @@ -73,7 +71,6 @@ index 103f0b77b93558944be1770a00e1a149d7257812..a580b33ea9a7f2f74547f77c1dab4caa $(JavaScriptCore)/inspector/protocol/DOM.json \ $(JavaScriptCore)/inspector/protocol/DOMDebugger.json \ $(JavaScriptCore)/inspector/protocol/DOMStorage.json \ - $(JavaScriptCore)/inspector/protocol/Database.json \ $(JavaScriptCore)/inspector/protocol/Debugger.json \ + $(JavaScriptCore)/inspector/protocol/Emulation.json \ $(JavaScriptCore)/inspector/protocol/GenericTypes.json \ @@ -172,10 +169,10 @@ index 1f5d0adbf624bd24ef1e525967e6e82e8c37b4e5..4fe0f364b4ccd11774bf29f772e0a568 // We could be called re-entrantly from a nested run loop, so restore the previous id. SetForScope scopedRequestId(m_currentRequestId, requestId); diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h -index 2eba743177c016a3415d4a5deafc552e842dd0fa..939d14be7a2703777652467f0f60e67ef1c5e0f8 100644 +index 28f4cdacf6ebd7037a42a75872618436332d90ec..463f014be2bd29a75bee7b2113b6f929da13aca5 100644 --- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h +++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h -@@ -83,8 +83,11 @@ public: +@@ -95,8 +95,11 @@ public: ServerError }; @@ -394,7 +391,7 @@ index 04377b714a6ccb5294c65d592e74350621d470ba..b6de937bfa3e6185ce29f4e432d327a3 // FrontendChannel FrontendChannel::ConnectionType connectionType() const; diff --git a/Source/JavaScriptCore/inspector/protocol/DOM.json b/Source/JavaScriptCore/inspector/protocol/DOM.json -index 27c65fbda226f1cd5bfd68944fe87fb9b2a688a6..b036f050859ee88004a7bf6daa4bb73835360615 100644 +index 3fbb38e3ce2676cc569dc706d74b3fc7431eb3fb..e1dec7287ce55077bfeaa1a601c7ffdea0a61008 100644 --- a/Source/JavaScriptCore/inspector/protocol/DOM.json +++ b/Source/JavaScriptCore/inspector/protocol/DOM.json @@ -80,6 +80,16 @@ @@ -414,24 +411,7 @@ index 27c65fbda226f1cd5bfd68944fe87fb9b2a688a6..b036f050859ee88004a7bf6daa4bb738 { "id": "EventListener", "type": "object", -@@ -268,6 +278,16 @@ - { "name": "width", "type": "number" }, - { "name": "height", "type": "number" } - ] -+ }, -+ { -+ "id": "FilePayload", -+ "type": "object", -+ "description": "Data to construct File object.", -+ "properties": [ -+ { "name": "name", "type": "string", "description": "File name." }, -+ { "name": "type", "type": "string", "description": "File type." }, -+ { "name": "data", "type": "string", "description": "Base64-encoded file data." } -+ ] - } - ], - "commands": [ -@@ -697,7 +717,10 @@ +@@ -717,7 +727,10 @@ "description": "Resolves JavaScript node object for given node id.", "targetTypes": ["page"], "parameters": [ @@ -443,7 +423,7 @@ index 27c65fbda226f1cd5bfd68944fe87fb9b2a688a6..b036f050859ee88004a7bf6daa4bb738 { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." } ], "returns": [ -@@ -774,6 +797,47 @@ +@@ -794,6 +807,46 @@ "returns": [ { "name": "mediaStats", "$ref": "MediaStats", "description": "An interleaved array of node attribute names and values." } ] @@ -484,8 +464,7 @@ index 27c65fbda226f1cd5bfd68944fe87fb9b2a688a6..b036f050859ee88004a7bf6daa4bb738 + "description": "Sets input files for given ", + "parameters": [ + { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Input element handle." }, -+ { "name": "files", "type": "array", "items": { "$ref": "FilePayload" }, "optional": true, "description": "Files to set" }, -+ { "name": "paths", "type": "array", "items": { "type": "string" }, "optional": true, "description": "File paths to set" } ++ { "name": "paths", "type": "array", "items": { "type": "string" }, "description": "File paths to set" } + ], + "async": true } @@ -1218,10 +1197,10 @@ index 3d032713a7f3bb9645bfc7d42455a0494b5376c0..913dda5e90b86cc5f8e4ca6881f6db57 } diff --git a/Source/JavaScriptCore/inspector/protocol/Playwright.json b/Source/JavaScriptCore/inspector/protocol/Playwright.json new file mode 100644 -index 0000000000000000000000000000000000000000..978d6f92b18498633c982969299f068332eb2884 +index 0000000000000000000000000000000000000000..440dd95173e066a886de120fb3dab7597d85feb6 --- /dev/null +++ b/Source/JavaScriptCore/inspector/protocol/Playwright.json -@@ -0,0 +1,307 @@ +@@ -0,0 +1,315 @@ +{ + "domain": "Playwright", + "availability": ["web"], @@ -1397,6 +1376,14 @@ index 0000000000000000000000000000000000000000..978d6f92b18498633c982969299f0683 + ] + }, + { ++ "name": "setPageZoomFactor", ++ "description": "Changes page zoom factor.", ++ "parameters": [ ++ { "name": "pageProxyId", "$ref": "PageProxyID", "description": "Unique identifier of the page proxy." }, ++ { "name": "zoomFactor", "type": "number" } ++ ] ++ }, ++ { + "name": "getAllCookies", + "description": "Returns all cookies in the given browser context.", + "async": true, @@ -1692,7 +1679,7 @@ index 24891ad836086fd23024fcb4d08ca63f6974c812..29f4b6b1923383fec7a99d28a4e815dc private: enum ArgumentRequirement { ArgumentRequired, ArgumentNotRequired }; diff --git a/Source/ThirdParty/libwebrtc/CMakeLists.txt b/Source/ThirdParty/libwebrtc/CMakeLists.txt -index d21b38eb4e5f27c12ca755799669883e71ce6de2..89cebf78b4599e5595ba570286a82e6aaa0f0f38 100644 +index ca4f3508a44e3c6677a72fbe3d7c853714b4f2c6..ae117f5f402a7eb259e376ca9440e00062e22d9f 100644 --- a/Source/ThirdParty/libwebrtc/CMakeLists.txt +++ b/Source/ThirdParty/libwebrtc/CMakeLists.txt @@ -532,6 +532,11 @@ set(webrtc_SOURCES @@ -1707,15 +1694,7 @@ index d21b38eb4e5f27c12ca755799669883e71ce6de2..89cebf78b4599e5595ba570286a82e6a Source/third_party/libyuv/source/compare.cc Source/third_party/libyuv/source/compare_common.cc Source/third_party/libyuv/source/compare_gcc.cc -@@ -695,7 +700,6 @@ set(webrtc_SOURCES - Source/webrtc/api/video_codecs/builtin_video_encoder_factory.cc - Source/webrtc/api/video_codecs/h264_profile_level_id.cc - Source/webrtc/api/video_codecs/h265_profile_tier_level.cc -- Source/webrtc/api/video_codecs/libaom_av1_encoder_factory.cc - Source/webrtc/api/video_codecs/scalability_mode.cc - Source/webrtc/api/video_codecs/scalability_mode_helper.cc - Source/webrtc/api/video_codecs/sdp_video_format.cc -@@ -2354,6 +2358,11 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE +@@ -2348,6 +2353,11 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE Source/third_party/libsrtp/config Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include @@ -1741,13 +1720,13 @@ index 0c5c8e689bdddec766f9de5bffd4444a5e068d77..330dd1f585e530722178c65c883641a2 // FIXME: Set WEBRTC_USE_BUILTIN_ISAC_FIX and WEBRTC_USE_BUILTIN_ISAC_FLOAT for iOS and Mac diff --git a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp -index 6c754858a3ea883a65ad022ce16b6c45ae65ee35..15f968472712e1a2a88672ed290b103cf9d620ec 100644 +index f7995f8f8b7af9fb6b28fe81b371a16700549cdf..c372447fbe21912803997876f95b5ca263cb47b5 100644 --- a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp +++ b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp -@@ -421,3 +421,16 @@ __ZNK8mkvmuxer7Segment16GetTrackByNumberEy - __ZN8mkvmuxer6Tracks11kAv1CodecIdE - __ZN8mkvmuxer6Tracks11kVp8CodecIdE - __ZN8mkvmuxer6Tracks11kVp9CodecIdE +@@ -425,3 +425,16 @@ __ZN6webrtc21SdpSerializeCandidateERKN7cricket9CandidateE + __ZNK6webrtc18VideoFrameMetadata8GetCsrcsEv + __ZN6webrtc15CloneAudioFrameEPNS_32TransformableAudioFrameInterfaceE + __ZN6webrtc15CloneVideoFrameEPNS_32TransformableVideoFrameInterfaceE +__ZN8mkvmuxer11SegmentInfo4InitEv +__ZN8mkvmuxer9MkvWriterC1EP7__sFILE +_ARGBToI420 @@ -1762,10 +1741,10 @@ index 6c754858a3ea883a65ad022ce16b6c45ae65ee35..15f968472712e1a2a88672ed290b103c +_vpx_codec_version_str +_vpx_codec_vp8_cx diff --git a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj -index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd55066c8fede 100644 +index 7585b2e5e9bffdc8cabd888dd822313d53b30141..5909d33b9726cdc7d2d53b538f7da18bc221e30b 100644 --- a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj +++ b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj -@@ -35,6 +35,20 @@ +@@ -56,6 +56,20 @@ }; /* End PBXAggregateTarget section */ @@ -1786,7 +1765,7 @@ index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd550 /* Begin PBXBuildFile section */ 2D6BFF60280A93DF00A1A74F /* video_coding.h in Headers */ = {isa = PBXBuildFile; fileRef = 4131C45B234C81710028A615 /* video_coding.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2D6BFF61280A93EC00A1A74F /* video_codec_initializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4131C45E234C81720028A615 /* video_codec_initializer.h */; settings = {ATTRIBUTES = (Public, ); }; }; -@@ -5618,6 +5632,13 @@ +@@ -5786,6 +5800,13 @@ remoteGlobalIDString = DDF30D0527C5C003006A526F; remoteInfo = absl; }; @@ -1800,7 +1779,7 @@ index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd550 /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ -@@ -23874,6 +23895,7 @@ +@@ -24271,6 +24292,7 @@ ); dependencies = ( 410B3827292B73E90003E515 /* PBXTargetDependency */, @@ -1808,7 +1787,7 @@ index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd550 DD2E76E827C6B69A00F2A74C /* PBXTargetDependency */, CDEBB4CC24C01AB400ADBD44 /* PBXTargetDependency */, 411ED040212E0811004320BA /* PBXTargetDependency */, -@@ -23956,6 +23978,7 @@ +@@ -24364,6 +24386,7 @@ 4460B8B92B155B6A00392062 /* vp9_qp_parser_fuzzer */, 444A6EF02AEADFC9005FE121 /* vp9_replay_fuzzer */, 44945C512B9BA1C300447FFD /* webm_fuzzer */, @@ -1816,7 +1795,7 @@ index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd550 ); }; /* End PBXProject section */ -@@ -24059,6 +24082,23 @@ +@@ -24467,6 +24490,23 @@ shellPath = /bin/sh; shellScript = "[ -z \"${WK_DERIVED_SDK_HEADERS_DIR}\" -o -d \"${WK_DERIVED_SDK_HEADERS_DIR}\" ] && touch \"${SCRIPT_OUTPUT_FILE_0}\"\n"; }; @@ -1840,7 +1819,7 @@ index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd550 /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ -@@ -26874,6 +26914,11 @@ +@@ -27437,6 +27477,11 @@ target = DDF30D0527C5C003006A526F /* absl */; targetProxy = DD2E76E727C6B69A00F2A74C /* PBXContainerItemProxy */; }; @@ -1852,7 +1831,7 @@ index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd550 /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ -@@ -27449,6 +27494,27 @@ +@@ -28204,6 +28249,27 @@ }; name = Production; }; @@ -1880,7 +1859,7 @@ index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd550 FB39D0711200ED9200088E69 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D7C59C71208C68B001C873E /* DebugRelease.xcconfig */; -@@ -27751,6 +27817,16 @@ +@@ -28586,6 +28652,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; @@ -1898,7 +1877,7 @@ index 635e7cd52a3eae41c82d989cda47563d0750dab5..8a10d9970972598bf270e12cce5fd550 isa = XCConfigurationList; buildConfigurations = ( diff --git a/Source/ThirdParty/skia/CMakeLists.txt b/Source/ThirdParty/skia/CMakeLists.txt -index b7e56daffbaac1c8c5bc94bd76826fea1826918b..5365dbfeae72ce5dc6be37e2f07a973bccddfd78 100644 +index 6bfc5cba986488f3d808ebd0583c476cd93da70e..f4c4222d17bce640355ba52e00152069d5b14432 100644 --- a/Source/ThirdParty/skia/CMakeLists.txt +++ b/Source/ThirdParty/skia/CMakeLists.txt @@ -10,6 +10,8 @@ if (USE_SKIA_ENCODERS) @@ -1910,7 +1889,7 @@ index b7e56daffbaac1c8c5bc94bd76826fea1826918b..5365dbfeae72ce5dc6be37e2f07a973b if (ANDROID) find_package(EXPAT REQUIRED) endif () -@@ -1054,6 +1056,7 @@ endif () +@@ -948,6 +950,7 @@ endif () target_link_libraries(Skia PRIVATE JPEG::JPEG PNG::PNG @@ -1918,11 +1897,23 @@ index b7e56daffbaac1c8c5bc94bd76826fea1826918b..5365dbfeae72ce5dc6be37e2f07a973b ) WEBKIT_ADD_TARGET_CXX_FLAGS(Skia +diff --git a/Source/ThirdParty/skia/src/opts/SkOpts_SetTarget.h b/Source/ThirdParty/skia/src/opts/SkOpts_SetTarget.h +index 525cfcb862ae96bf8573d00b67dc9e5e23c10d22..f2debc0444cb8f5b80a0e99a2214bceaab3960c1 100644 +--- a/Source/ThirdParty/skia/src/opts/SkOpts_SetTarget.h ++++ b/Source/ThirdParty/skia/src/opts/SkOpts_SetTarget.h +@@ -65,6 +65,7 @@ + // Each of the specific intrinsic headers also checks to ensure that immintrin.h has been + // included, so do that here, first. + #if defined(__clang__) && defined(_MSC_VER) ++ #define __RTMINTRIN_H // Workaround for https://github.com/llvm/llvm-project/issues/95133 + #include + #endif + diff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed6021684077078903bf422d 100644 +index e6e1af5d1973c991229948e0b1eb0d5c456f846f..7fb6e2455bd489c5b5f9f2169fea5a2f9865bf91 100644 --- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml +++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -@@ -628,6 +628,7 @@ ApplePayEnabled: +@@ -602,6 +602,7 @@ ApplePayEnabled: richJavaScript: true # FIXME: This is on by default in WebKit2 PLATFORM(COCOA). Perhaps we should consider turning it on for WebKitLegacy as well. @@ -1930,7 +1921,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 AsyncClipboardAPIEnabled: type: bool status: mature -@@ -638,7 +639,7 @@ AsyncClipboardAPIEnabled: +@@ -612,7 +613,7 @@ AsyncClipboardAPIEnabled: default: false WebKit: "PLATFORM(COCOA) || PLATFORM(GTK)" : true @@ -1939,7 +1930,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 WebCore: default: false -@@ -883,13 +884,10 @@ BlobFileAccessEnforcementEnabled: +@@ -871,13 +872,10 @@ BlobFileAccessEnforcementEnabled: sharedPreferenceForWebProcess: true defaultValue: WebKitLegacy: @@ -1953,7 +1944,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 default: false BlobRegistryTopOriginPartitioningEnabled: -@@ -2257,6 +2255,7 @@ CrossOriginEmbedderPolicyEnabled: +@@ -2312,6 +2310,7 @@ CrossOriginEmbedderPolicyEnabled: WebCore: default: false @@ -1961,7 +1952,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 CrossOriginOpenerPolicyEnabled: type: bool status: stable -@@ -2297,7 +2296,7 @@ CustomPasteboardDataEnabled: +@@ -2352,7 +2351,7 @@ CustomPasteboardDataEnabled: WebKitLegacy: default: false WebKit: @@ -1969,8 +1960,8 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 + "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)": true default: false - DNSPrefetchingEnabled: -@@ -2342,6 +2341,7 @@ DOMAudioSessionFullEnabled: + DOMAudioSessionEnabled: +@@ -2385,6 +2384,7 @@ DOMAudioSessionFullEnabled: WebCore: default: false @@ -1978,7 +1969,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 DOMPasteAccessRequestsEnabled: type: bool status: internal -@@ -2353,7 +2353,7 @@ DOMPasteAccessRequestsEnabled: +@@ -2396,7 +2396,7 @@ DOMPasteAccessRequestsEnabled: default: false WebKit: "PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(VISION)": true @@ -1987,7 +1978,29 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 WebCore: default: false -@@ -2691,7 +2691,7 @@ DirectoryUploadEnabled: +@@ -2462,10 +2462,10 @@ DataListElementEnabled: + WebKitLegacy: + default: false + WebKit: +- "(PLATFORM(COCOA) && !PLATFORM(WATCHOS)) || PLATFORM(GTK)": true ++ "(PLATFORM(COCOA) && !PLATFORM(WATCHOS)) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)": true + default: false + WebCore: +- "(PLATFORM(COCOA) && !PLATFORM(WATCHOS)) || PLATFORM(GTK)": true ++ "(PLATFORM(COCOA) && !PLATFORM(WATCHOS)) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)": true + default: false + sharedPreferenceForWebProcess: true + +@@ -2478,7 +2478,7 @@ DataTransferItemsEnabled: + WebKitLegacy: + default: true + WebKit: +- "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true ++ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)": true + default: false + WebCore: + default: false +@@ -2734,7 +2734,7 @@ DirectoryUploadEnabled: WebKitLegacy: default: false WebKit: @@ -1996,7 +2009,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 default: false WebCore: default: false -@@ -3144,10 +3144,10 @@ FullScreenEnabled: +@@ -3202,10 +3202,10 @@ FullScreenEnabled: WebKitLegacy: default: false WebKit: @@ -2009,48 +2022,60 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 default: false sharedPreferenceForWebProcess: true -@@ -3852,6 +3852,7 @@ InspectorAttachmentSide: +@@ -3811,7 +3811,7 @@ InputTypeColorEnabled: + WebKitLegacy: + default: false + WebKit: +- "PLATFORM(COCOA) && !PLATFORM(WATCHOS) || PLATFORM(GTK)": true ++ "PLATFORM(COCOA) && !PLATFORM(WATCHOS) || PLATFORM(GTK) || PLATFORM(WPE)": true + default: false + WebCore: + default: false +@@ -3844,7 +3844,7 @@ InputTypeDateEnabled: + "PLATFORM(IOS_FAMILY)": true + default: false + WebKit: +- "PLATFORM(COCOA) || PLATFORM(GTK)": true ++ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true + default: false + WebCore: + default: false +@@ -3860,7 +3860,7 @@ InputTypeDateTimeLocalEnabled: + "PLATFORM(IOS_FAMILY)": true + default: false + WebKit: +- "PLATFORM(COCOA) || PLATFORM(GTK)": true ++ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true + default: false + WebCore: + default: false +@@ -3892,7 +3892,7 @@ InputTypeTimeEnabled: + "PLATFORM(IOS_FAMILY)": true + default: false WebKit: - default: 0 +- "PLATFORM(COCOA) || PLATFORM(GTK)": true ++ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true + default: false + WebCore: + default: false +@@ -3953,6 +3953,7 @@ InspectorMaximumResourcesContentSize: + "PLATFORM(WPE)": 50 + default: 200 +# Playwright: disable setting. InspectorStartsAttached: type: bool status: embedder -@@ -3859,7 +3860,7 @@ InspectorStartsAttached: +@@ -3960,7 +3961,7 @@ InspectorStartsAttached: exposed: [ WebKit ] defaultValue: WebKit: - default: true + default: false - InspectorWindowFrame: - type: String -@@ -4210,9 +4211,10 @@ LayoutViewportHeightExpansionFactor: - WebCore: - default: 0 - -+# Playwright: disable setting. - LazyIframeLoadingEnabled: - type: bool -- status: stable -+ status: preview - category: html - humanReadableName: "Lazy iframe loading" - humanReadableDescription: "Enable lazy iframe loading support" -@@ -4220,9 +4222,9 @@ LazyIframeLoadingEnabled: - WebKitLegacy: - default: true - WebKit: -- default: true -+ default: false - WebCore: -- default: true -+ default: false - - LazyImageLoadingEnabled: + InspectorSupportsShowingCertificate: type: bool -@@ -5781,7 +5783,7 @@ PermissionsAPIEnabled: +@@ -5911,7 +5912,7 @@ PermissionsAPIEnabled: WebKitLegacy: default: false WebKit: @@ -2059,7 +2084,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 default: false WebCore: default: false -@@ -5844,6 +5846,19 @@ PitchCorrectionAlgorithm: +@@ -5990,6 +5991,19 @@ PitchCorrectionAlgorithm: WebCore: default: MediaPlayerEnums::PitchCorrectionAlgorithm::BestAllAround @@ -2079,7 +2104,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 PointerLockOptionsEnabled: type: bool status: stable -@@ -6435,7 +6450,7 @@ ScreenOrientationAPIEnabled: +@@ -6586,7 +6600,7 @@ ScreenOrientationAPIEnabled: WebKitLegacy: default: false WebKit: @@ -2088,7 +2113,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 WebCore: default: false sharedPreferenceForWebProcess: true -@@ -7849,6 +7864,7 @@ UseCGDisplayListsForDOMRendering: +@@ -8063,6 +8077,7 @@ UseCGDisplayListsForDOMRendering: default: true sharedPreferenceForWebProcess: true @@ -2096,7 +2121,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 UseGPUProcessForCanvasRenderingEnabled: type: bool status: stable -@@ -7861,7 +7877,7 @@ UseGPUProcessForCanvasRenderingEnabled: +@@ -8075,7 +8090,7 @@ UseGPUProcessForCanvasRenderingEnabled: defaultValue: WebKit: "ENABLE(GPU_PROCESS_BY_DEFAULT)": true @@ -2105,7 +2130,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 default: false UseGPUProcessForDOMRenderingEnabled: -@@ -7906,6 +7922,7 @@ UseGPUProcessForMediaEnabled: +@@ -8120,6 +8135,7 @@ UseGPUProcessForMediaEnabled: sharedPreferenceForWebProcess: true mediaPlaybackRelated: true @@ -2113,7 +2138,7 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 UseGPUProcessForWebGLEnabled: type: bool status: internal -@@ -7917,7 +7934,7 @@ UseGPUProcessForWebGLEnabled: +@@ -8131,7 +8147,7 @@ UseGPUProcessForWebGLEnabled: default: false WebKit: "ENABLE(GPU_PROCESS_BY_DEFAULT) && ENABLE(GPU_PROCESS_WEBGL_BY_DEFAULT)": true @@ -2123,10 +2148,10 @@ index a18d2cc93197ef89e9148907cdc47cf7c4359085..d377bee3c2c192e1ed60216840770789 WebCore: "ENABLE(GPU_PROCESS_BY_DEFAULT) && ENABLE(GPU_PROCESS_WEBGL_BY_DEFAULT)": true diff --git a/Source/WTF/wtf/PlatformEnable.h b/Source/WTF/wtf/PlatformEnable.h -index 960b0ee2c7d012bb2ce8f8d22d0cc43176e6285d..9bc7ad7d36dfe90d296143567252bece6f1d56fb 100644 +index 0652dc379f7322cd7af4078cf1b6c54588565aea..51ce8260d8889c6e3dbef09bfff48177b9cf9f0a 100644 --- a/Source/WTF/wtf/PlatformEnable.h +++ b/Source/WTF/wtf/PlatformEnable.h -@@ -409,7 +409,7 @@ +@@ -387,7 +387,7 @@ // ORIENTATION_EVENTS should never get enabled on Desktop, only Mobile. #if !defined(ENABLE_ORIENTATION_EVENTS) @@ -2135,7 +2160,7 @@ index 960b0ee2c7d012bb2ce8f8d22d0cc43176e6285d..9bc7ad7d36dfe90d296143567252bece #endif #if !defined(ENABLE_OVERFLOW_SCROLLING_TOUCH) -@@ -514,7 +514,7 @@ +@@ -504,7 +504,7 @@ #endif #if !defined(ENABLE_TOUCH_EVENTS) @@ -2145,10 +2170,10 @@ index 960b0ee2c7d012bb2ce8f8d22d0cc43176e6285d..9bc7ad7d36dfe90d296143567252bece #if !defined(ENABLE_TOUCH_ACTION_REGIONS) diff --git a/Source/WTF/wtf/PlatformEnableCocoa.h b/Source/WTF/wtf/PlatformEnableCocoa.h -index e744e5190e18a46421335614ba7e46abd9321ede..3da0354adfac2df0570273859448435a0ecfc869 100644 +index e416fc014aa5731d77f7a3a440b762a9814f6ef5..00a67ad2516627e982763f4684fb951741517817 100644 --- a/Source/WTF/wtf/PlatformEnableCocoa.h +++ b/Source/WTF/wtf/PlatformEnableCocoa.h -@@ -808,7 +808,7 @@ +@@ -817,7 +817,7 @@ #endif #if !defined(ENABLE_SEC_ITEM_SHIM) @@ -2158,10 +2183,10 @@ index e744e5190e18a46421335614ba7e46abd9321ede..3da0354adfac2df0570273859448435a #if !defined(ENABLE_SERVER_PRECONNECT) diff --git a/Source/WTF/wtf/PlatformHave.h b/Source/WTF/wtf/PlatformHave.h -index 26ff5ab72c69aa405a6834b4ba1a6192f3030f2f..8c60bc012661a840bea7524b454c92c67fdd6919 100644 +index e4a8591c4a4e0d682cdf3d4232e25e6af963ba16..96a65e06d788995714bafc95bde3ad8bf21bc2e8 100644 --- a/Source/WTF/wtf/PlatformHave.h +++ b/Source/WTF/wtf/PlatformHave.h -@@ -1230,7 +1230,8 @@ +@@ -1198,7 +1198,8 @@ #endif #if PLATFORM(MAC) @@ -2188,10 +2213,10 @@ index 007b8fe3292f326504013be8198ae020f7aacf35..1c722c473732ffe05fdb61010fa4417e namespace Unicode { diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make -index 18d8c41490fb662d6f5bfb14689469d53244fb82..73ce4360870e6053f79a0c6d6055ffd17da9f7b7 100644 +index d0e3444bd9699dfe2bc1c85dde2ad5543d71b0df..b624441883bfa4ea04ee22fef2c38ad0daabe479 100644 --- a/Source/WebCore/DerivedSources.make +++ b/Source/WebCore/DerivedSources.make -@@ -1218,6 +1218,10 @@ JS_BINDING_IDLS := \ +@@ -1229,6 +1229,10 @@ JS_BINDING_IDLS := \ $(WebCore)/dom/SubscriberCallback.idl \ $(WebCore)/dom/SubscriptionObserver.idl \ $(WebCore)/dom/SubscriptionObserverCallback.idl \ @@ -2202,7 +2227,7 @@ index 18d8c41490fb662d6f5bfb14689469d53244fb82..73ce4360870e6053f79a0c6d6055ffd1 $(WebCore)/dom/Text.idl \ $(WebCore)/dom/TextDecoder.idl \ $(WebCore)/dom/TextDecoderStream.idl \ -@@ -1812,9 +1816,6 @@ JS_BINDING_IDLS := \ +@@ -1829,9 +1833,6 @@ JS_BINDING_IDLS := \ ADDITIONAL_BINDING_IDLS = \ DocumentTouch.idl \ GestureEvent.idl \ @@ -2213,10 +2238,10 @@ index 18d8c41490fb662d6f5bfb14689469d53244fb82..73ce4360870e6053f79a0c6d6055ffd1 vpath %.in $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp -index 90bf15adb6a36e190f68448a125b5446a0674631..d64af222f0c824a7cd719e250c1023071465d24e 100644 +index 05091a46212f00333ed97939a6ec18d8656657e9..3fb779a3eba806cf416d0dd7586be871d4782651 100644 --- a/Source/WebCore/Modules/geolocation/Geolocation.cpp +++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp -@@ -360,8 +360,9 @@ bool Geolocation::shouldBlockGeolocationRequests() +@@ -361,8 +361,9 @@ bool Geolocation::shouldBlockGeolocationRequests() bool isSecure = SecurityOrigin::isSecure(document->url()) || document->isSecureContext(); bool hasMixedContent = !document->foundMixedContent().isEmpty(); bool isLocalOrigin = securityOrigin()->isLocal(); @@ -2277,10 +2302,10 @@ index 7bbcd501126a7b83986f5d1f5a077779441dc1fe..13e68ac853603d8e7da1b42f5c8073eb set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/wpe/RenderThemeWPE.cpp) diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt -index 79893c978df4277dacc7a90f9b0bca73cee6458a..949f92cc972e59af642e548b00d6788568513fa0 100644 +index 06a9accfc8e6c46493733663b5d76b07fc80db22..4946d012d166c84b25d4d954266c4dc528f7d8ad 100644 --- a/Source/WebCore/SourcesCocoa.txt +++ b/Source/WebCore/SourcesCocoa.txt -@@ -728,3 +728,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm +@@ -734,3 +734,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify platform/graphics/cocoa/GraphicsContextGLCocoa.mm @no-unify platform/graphics/cv/GraphicsContextGLCVCocoa.mm @no-unify @@ -2291,10 +2316,10 @@ index 79893c978df4277dacc7a90f9b0bca73cee6458a..949f92cc972e59af642e548b00d67885 +JSTouchList.cpp +// Playwright end diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt -index 5838137f6ae130f6ce1e97942078641096d406b6..fcdc7611e36297c1b836ccf44a073781a04809ff 100644 +index 9cc9f51e48b3058ea29da389629c021bcf05e202..978ac405073534ba6fa79f483d885643a4722fd8 100644 --- a/Source/WebCore/SourcesGTK.txt +++ b/Source/WebCore/SourcesGTK.txt -@@ -113,3 +113,10 @@ platform/unix/LoggingUnix.cpp +@@ -112,3 +112,10 @@ platform/unix/LoggingUnix.cpp platform/unix/SharedMemoryUnix.cpp platform/xdg/MIMETypeRegistryXdg.cpp @@ -2306,7 +2331,7 @@ index 5838137f6ae130f6ce1e97942078641096d406b6..fcdc7611e36297c1b836ccf44a073781 +JSSpeechSynthesisEventInit.cpp +// Playwright: end. diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt -index 3c68a8ed10cd24cffd26b4b70c3adad8eb6ba91f..b36dee714fdceba5248922bfb6d2046922ca6b34 100644 +index 5fd26e859ef215fccd597ca475a320abcad83b98..f422c4023eb1c9f101d989ce56e4b4b42e203c83 100644 --- a/Source/WebCore/SourcesWPE.txt +++ b/Source/WebCore/SourcesWPE.txt @@ -46,6 +46,8 @@ editing/libwpe/EditorLibWPE.cpp @@ -2318,7 +2343,7 @@ index 3c68a8ed10cd24cffd26b4b70c3adad8eb6ba91f..b36dee714fdceba5248922bfb6d20469 page/linux/ResourceUsageOverlayLinux.cpp page/linux/ResourceUsageThreadLinux.cpp -@@ -90,6 +92,17 @@ platform/text/LocaleICU.cpp +@@ -91,6 +93,17 @@ platform/android/SharedMemoryAndroid.cpp platform/unix/LoggingUnix.cpp platform/unix/SharedMemoryUnix.cpp @@ -2337,12 +2362,12 @@ index 3c68a8ed10cd24cffd26b4b70c3adad8eb6ba91f..b36dee714fdceba5248922bfb6d20469 +JSSpeechSynthesisEventInit.cpp +// Playwright: end. diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c71ba243c 100644 +index 656e474f969c44c344c87d53aca6981071b39ef5..c8cf5ab6da2a5d2a2c2a723e52a32e2bee261846 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -@@ -6358,6 +6358,13 @@ - EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; }; +@@ -6432,6 +6432,13 @@ EE0C7E042CE845CB0043DAF8 /* CSSPositionTryRule.h in Headers */ = {isa = PBXBuildFile; fileRef = EE0C7E002CE845CB0043DAF8 /* CSSPositionTryRule.h */; }; + EE0D3C492D2F4B4C00072978 /* StageModeOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = EE0D3C482D2F4AE600072978 /* StageModeOperations.h */; settings = {ATTRIBUTES = (Private, ); }; }; EFCC6C8F20FE914400A2321B /* CanvasActivityRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */; settings = {ATTRIBUTES = (Private, ); }; }; + F050E16823AC9C080011CE47 /* PlatformTouchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F050E16623AC9C070011CE47 /* PlatformTouchEvent.h */; settings = {ATTRIBUTES = (Private, ); }; }; + F050E16A23AD660C0011CE47 /* Touch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F050E16923AD660C0011CE47 /* Touch.cpp */; }; @@ -2354,7 +2379,7 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F12171F416A8BC63000053CA /* WebVTTElement.h */; }; F32BDCD92363AACA0073B6AE /* UserGestureEmulationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = F32BDCD72363AACA0073B6AE /* UserGestureEmulationScope.h */; }; F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; -@@ -20908,6 +20915,14 @@ +@@ -21095,6 +21102,14 @@ EE7A169F2C607BFA0057B563 /* StartViewTransitionOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StartViewTransitionOptions.h; sourceTree = ""; }; EFB7287B2124C73D005C2558 /* CanvasActivityRecord.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasActivityRecord.cpp; sourceTree = ""; }; EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasActivityRecord.h; sourceTree = ""; }; @@ -2369,7 +2394,7 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c F12171F316A8BC63000053CA /* WebVTTElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebVTTElement.cpp; sourceTree = ""; }; F12171F416A8BC63000053CA /* WebVTTElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTElement.h; sourceTree = ""; }; F32BDCD52363AAC90073B6AE /* UserGestureEmulationScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserGestureEmulationScope.cpp; sourceTree = ""; }; -@@ -28654,6 +28669,11 @@ +@@ -28876,6 +28891,11 @@ BC4A5324256055590028C592 /* TextDirectionSubmenuInclusionBehavior.h */, 2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */, 2D4F96F21A1ECC240098BF88 /* TextIndicator.h */, @@ -2381,7 +2406,7 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c F48570A42644C76D00C05F71 /* TranslationContextMenuInfo.h */, F4E1965F21F26E4E00285078 /* UndoItem.cpp */, 2ECDBAD521D8906300F00ECD /* UndoItem.h */, -@@ -35537,6 +35557,8 @@ +@@ -35855,6 +35875,8 @@ 29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */, 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */, 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */, @@ -2390,7 +2415,7 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c FE3DC9932D0C063C0021B6FC /* PlatformTZoneImpls.cpp */, 0FD7C21D23CE41E30096D102 /* PlatformWheelEvent.cpp */, 935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */, -@@ -38326,6 +38348,7 @@ +@@ -38674,6 +38696,7 @@ AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */, 6BDB5DC1227BD3B800919770 /* DocumentStorageAccess.cpp */, 6BDB5DC0227BD3B800919770 /* DocumentStorageAccess.h */, @@ -2398,7 +2423,7 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c 7CE7FA5B1EF882300060C9D6 /* DocumentTouch.cpp */, 7CE7FA591EF882300060C9D6 /* DocumentTouch.h */, A8185F3209765765005826D9 /* DocumentType.cpp */, -@@ -43197,6 +43220,8 @@ +@@ -43613,6 +43636,8 @@ F4E90A3C2B52038E002DA469 /* PlatformTextAlternatives.h in Headers */, 0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */, 074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */, @@ -2407,7 +2432,7 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c CDD08ABD277E542600EA3755 /* PlatformTrackConfiguration.h in Headers */, CD1F9B022700323D00617EB6 /* PlatformVideoColorPrimaries.h in Headers */, CD1F9B01270020B700617EB6 /* PlatformVideoColorSpace.h in Headers */, -@@ -44527,6 +44552,7 @@ +@@ -44969,6 +44994,7 @@ 0F54DD081881D5F5003EEDBB /* Touch.h in Headers */, 71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */, 0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */, @@ -2415,7 +2440,7 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c 0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */, 070334D71459FFD5008D8D45 /* TrackBase.h in Headers */, BE88E0C21715CE2600658D98 /* TrackListBase.h in Headers */, -@@ -45707,6 +45733,8 @@ +@@ -46169,6 +46195,8 @@ 2D22830323A8470700364B7E /* CursorMac.mm in Sources */, 5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */, 07E4BDBF2A3A5FAB000D5509 /* DictationCaretAnimator.cpp in Sources */, @@ -2424,7 +2449,7 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c 7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */, 4667EA3E2968D9DA00BAB1E2 /* GameControllerHapticEffect.mm in Sources */, 46FE73D32968E52000B8064C /* GameControllerHapticEngines.mm in Sources */, -@@ -45798,6 +45826,9 @@ +@@ -46260,6 +46288,9 @@ CE88EE262414467B007F29C2 /* TextAlternativeWithRange.mm in Sources */, BE39137129B267F500FA5D4F /* TextTransformCocoa.cpp in Sources */, 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */, @@ -2435,10 +2460,10 @@ index c10b3c0d8d918e2ca0c33e4820b492465ef2fd97..51a6ace79f76cfbee26c96fc75cd9b5c 538EC8021F96AF81004D22A8 /* UnifiedSource1.cpp in Sources */, 538EC8051F96AF81004D22A8 /* UnifiedSource2-mm.mm in Sources */, diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp -index f9800e07148d1c3b269a129d90147a1763aa2119..d9e2a2a01162c1b4106b06281dc1c61fbe11ea13 100644 +index a38a54553f430b96fa7744a442676d6136f5eda9..4ff2eaeab053a186e5e6bacab94a6b3b129eb7ab 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityObject.cpp -@@ -70,6 +70,7 @@ +@@ -71,6 +71,7 @@ #include "HTMLTableSectionElement.h" #include "HTMLTextAreaElement.h" #include "HitTestResult.h" @@ -2446,7 +2471,7 @@ index f9800e07148d1c3b269a129d90147a1763aa2119..d9e2a2a01162c1b4106b06281dc1c61f #include "LocalFrame.h" #include "LocalizedStrings.h" #include "MathMLNames.h" -@@ -3963,7 +3964,12 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const +@@ -3910,7 +3911,12 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const if (roleValue() == AccessibilityRole::ApplicationDialog) return AccessibilityObjectInclusion::IncludeObject; @@ -2461,10 +2486,10 @@ index f9800e07148d1c3b269a129d90147a1763aa2119..d9e2a2a01162c1b4106b06281dc1c61f bool AccessibilityObject::isWithinHiddenWebArea() const diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h -index 9470f5d46c83bb5d0c4f65b75e6a18a7dfaefccb..79eed13cfdf942a04d41032622fad89231a64e9b 100644 +index a9d9ee8f0cb26fd47f9fea85e0856d2849362e6c..e2c58e571f41da4f65388fd36a9de56c92a404a8 100644 --- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h +++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h -@@ -186,6 +186,8 @@ namespace WebCore { +@@ -189,6 +189,8 @@ namespace WebCore { macro(DelayNode) \ macro(DeprecationReportBody) \ macro(DigitalCredential) \ @@ -2474,10 +2499,10 @@ index 9470f5d46c83bb5d0c4f65b75e6a18a7dfaefccb..79eed13cfdf942a04d41032622fad892 macro(DynamicsCompressorNode) \ macro(ElementInternals) \ diff --git a/Source/WebCore/css/query/MediaQueryFeatures.cpp b/Source/WebCore/css/query/MediaQueryFeatures.cpp -index 83e2a42d3f09289d61217f63a121611a92aae85d..f4dfda8e9dc1dd9ad221272f09e1bd7f49afa1e0 100644 +index aec43490053f95341ef979385b5e6c1daf03a090..4e44b7e341c8247f916f8597092248d8ec884518 100644 --- a/Source/WebCore/css/query/MediaQueryFeatures.cpp +++ b/Source/WebCore/css/query/MediaQueryFeatures.cpp -@@ -496,7 +496,11 @@ static const IdentifierSchema& forcedColorsFeatureSchema() +@@ -498,7 +498,11 @@ static const IdentifierSchema& forcedColorsFeatureSchema() "forced-colors"_s, FixedVector { CSSValueNone, CSSValueActive }, OptionSet(), @@ -2490,7 +2515,7 @@ index 83e2a42d3f09289d61217f63a121611a92aae85d..f4dfda8e9dc1dd9ad221272f09e1bd7f return MatchingIdentifiers { CSSValueNone }; } }; -@@ -682,6 +686,9 @@ static const IdentifierSchema& prefersReducedMotionFeatureSchema() +@@ -686,6 +690,9 @@ static const IdentifierSchema& prefersReducedMotionFeatureSchema() [](auto& context) { bool userPrefersReducedMotion = [&] { Ref frame = *context.document->frame(); @@ -2501,10 +2526,10 @@ index 83e2a42d3f09289d61217f63a121611a92aae85d..f4dfda8e9dc1dd9ad221272f09e1bd7f case ForcedAccessibilityValue::On: return true; diff --git a/Source/WebCore/dom/DataTransfer.cpp b/Source/WebCore/dom/DataTransfer.cpp -index a3c4d925cded155b15360793d54c57ca54fa2986..80773b244e3ee7aa7e585617c408f7d851154e7f 100644 +index c6f2dca0d4aede2bea015d1cca45dff434425938..e6f41af39befe69f47d0e0953f7d689c338ca184 100644 --- a/Source/WebCore/dom/DataTransfer.cpp +++ b/Source/WebCore/dom/DataTransfer.cpp -@@ -520,6 +520,14 @@ Ref DataTransfer::createForDrag(const Document& document) +@@ -523,6 +523,14 @@ Ref DataTransfer::createForDrag(const Document& document) return adoptRef(*new DataTransfer(StoreMode::ReadWrite, Pasteboard::createForDragAndDrop(PagePasteboardContext::create(document.pageID())), Type::DragAndDropData)); } @@ -2520,7 +2545,7 @@ index a3c4d925cded155b15360793d54c57ca54fa2986..80773b244e3ee7aa7e585617c408f7d8 { auto dataTransfer = adoptRef(*new DataTransfer(StoreMode::ReadWrite, makeUnique(), Type::DragAndDropData)); diff --git a/Source/WebCore/dom/DataTransfer.h b/Source/WebCore/dom/DataTransfer.h -index 6327b8ff7709ed58bfd8140e59af87cb3a1f2b51..562812425187e2bae137abb4903a1497d6c4fbab 100644 +index 34ef2f454a732d39acae04987584cab5638b8c60..5e7b788612718dffe3423c89d96141b5b53621fb 100644 --- a/Source/WebCore/dom/DataTransfer.h +++ b/Source/WebCore/dom/DataTransfer.h @@ -92,6 +92,9 @@ public: @@ -2594,16 +2619,15 @@ index 9b344003de17b96d8b9ca8c7f32143a27543b1ea..2208a3f2b7d930bcd291e65b474d4c30 ] partial interface Element { // Returns Promise if PointerLockOptionsEnabled Runtime Flag is set, otherwise returns undefined. diff --git a/Source/WebCore/dom/PointerEvent.cpp b/Source/WebCore/dom/PointerEvent.cpp -index 2a728c134f837ee36c033971e1c47792f4a3caf2..b1ecb3b2dd2efc43d679bb0f678457188cb2cb3a 100644 +index e0a0916f197cd80b728b89f95fb240374acdb78a..54eb987c3b53784263de9bdc2ee05c6ca8d68f53 100644 --- a/Source/WebCore/dom/PointerEvent.cpp +++ b/Source/WebCore/dom/PointerEvent.cpp -@@ -27,10 +27,13 @@ - #include "PointerEvent.h" +@@ -28,9 +28,12 @@ #include "EventNames.h" + #include "MouseEventTypes.h" +#include "MouseEvent.h" #include "Node.h" - #include "PlatformMouseEvent.h" +#include "PlatformTouchEvent.h" #include "PointerEventTypeNames.h" #include @@ -2730,7 +2754,7 @@ index 7813532cc52d582c42aebc979a1ecd1137765f08..c01cbd53ad2430a6ffab9a80fc73e74a #endif // USE(LIBWPE) diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp -index 26e7ca561e3923e2b11da48e777348d3928bff53..a151c289dcd1aef5e0f26faaa7785137296829b8 100644 +index 75de5d5611953b830cf07d940ca1eedb789d2a9c..6adabe7a8250e02bc6b1e9fa28b0575d6a5e4dd7 100644 --- a/Source/WebCore/html/FileInputType.cpp +++ b/Source/WebCore/html/FileInputType.cpp @@ -37,6 +37,7 @@ @@ -2742,33 +2766,22 @@ index 26e7ca561e3923e2b11da48e777348d3928bff53..a151c289dcd1aef5e0f26faaa7785137 #include "LocalizedStrings.h" #include "MIMETypeRegistry.h" @@ -160,6 +161,11 @@ void FileInputType::handleDOMActivateEvent(Event& event) - if (input.isDisabledFormControl()) + if (protectedElement()->isDisabledFormControl()) return; + bool intercept = false; -+ InspectorInstrumentation::runOpenPanel(input.document().frame(), element(), &intercept); ++ InspectorInstrumentation::runOpenPanel(element()->document().frame(), element(), &intercept); + if (intercept) + return; + if (!UserGestureIndicator::processingUserGesture()) return; -@@ -348,7 +354,9 @@ void FileInputType::setFiles(RefPtr&& files, RequestIcon shouldRequest - pathsChanged = true; - else { - for (unsigned i = 0; i < length; ++i) { -- if (files->file(i).path() != m_fileList->file(i).path() || !FileSystem::fileIDsAreEqual(files->file(i).fileID(), m_fileList->file(i).fileID())) { -+ if (files->file(i).path() != m_fileList->file(i).path() || !FileSystem::fileIDsAreEqual(files->file(i).fileID(), m_fileList->file(i).fileID()) || -+ // Files created from Blob have empty path. -+ (files->file(i).path().isEmpty() && files->file(i).name() != m_fileList->file(i).name())) { - pathsChanged = true; - break; - } diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp -index ee592715641d111078aec266c9b35c0eea9a6f48..bc403a764837abce3c7771c31c4909b6c0de211e 100644 +index dac15af852ff335ffba6b4bff717682a99b52b48..29bceeebb5a3e1c6c5d9d782dd62530d75b57d9a 100644 --- a/Source/WebCore/inspector/InspectorController.cpp +++ b/Source/WebCore/inspector/InspectorController.cpp -@@ -300,6 +300,8 @@ void InspectorController::disconnectFrontend(FrontendChannel& frontendChannel) +@@ -295,6 +295,8 @@ void InspectorController::disconnectFrontend(FrontendChannel& frontendChannel) // Unplug all instrumentations since they aren't needed now. InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get()); @@ -2777,7 +2790,7 @@ index ee592715641d111078aec266c9b35c0eea9a6f48..bc403a764837abce3c7771c31c4909b6 } m_inspectorClient->frontendCountChanged(m_frontendRouter->frontendCount()); -@@ -319,6 +321,8 @@ void InspectorController::disconnectAllFrontends() +@@ -314,6 +316,8 @@ void InspectorController::disconnectAllFrontends() // The frontend should call setInspectorFrontendClient(nullptr) under closeWindow(). ASSERT(!m_inspectorFrontendClient); @@ -2786,7 +2799,7 @@ index ee592715641d111078aec266c9b35c0eea9a6f48..bc403a764837abce3c7771c31c4909b6 if (!m_frontendRouter->hasFrontends()) return; -@@ -402,8 +406,8 @@ void InspectorController::inspect(Node* node) +@@ -397,8 +401,8 @@ void InspectorController::inspect(Node* node) if (!enabled()) return; @@ -2797,7 +2810,7 @@ index ee592715641d111078aec266c9b35c0eea9a6f48..bc403a764837abce3c7771c31c4909b6 ensureDOMAgent().inspect(node); } -@@ -546,4 +550,34 @@ void InspectorController::didComposite(LocalFrame& frame) +@@ -541,4 +545,34 @@ void InspectorController::didComposite(LocalFrame& frame) InspectorInstrumentation::didComposite(frame); } @@ -2866,10 +2879,10 @@ index 4f5c1e836876710a554455ec53733f72db63de58..774c4a66af84664a7a83ba0790d147f7 } // namespace WebCore diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp -index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c70190240881270 100644 +index 3d97cbaf887e52fe5c269cd4bc8cf750de41ddcb..46dc1872991560e41cff9c8b1ede2b73708c3736 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.cpp +++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp -@@ -598,6 +598,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i +@@ -595,6 +595,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i pageAgent->applyUserAgentOverride(userAgent); } @@ -2882,7 +2895,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents& instrumentingAgents, AtomString& media) { if (auto* pageAgent = instrumentingAgents.enabledPageAgent()) -@@ -681,6 +687,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen +@@ -678,6 +684,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this. } @@ -2895,7 +2908,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 void InspectorInstrumentation::willLoadXHRSynchronouslyImpl(InstrumentingAgents& instrumentingAgents) { if (auto* networkAgent = instrumentingAgents.enabledNetworkAgent()) -@@ -713,20 +725,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& +@@ -710,20 +722,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { @@ -2919,7 +2932,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 } void InspectorInstrumentation::frameDetachedFromParentImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) -@@ -809,12 +818,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins +@@ -803,12 +812,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins pageDOMDebuggerAgent->frameDocumentUpdated(frame); } @@ -2932,7 +2945,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { if (frame.isMainFrame()) { -@@ -845,10 +848,10 @@ void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& inst +@@ -839,10 +842,10 @@ void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& inst inspectorPageAgent->frameStoppedLoading(frame); } @@ -2945,7 +2958,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 } void InspectorInstrumentation::frameClearedScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame) -@@ -863,6 +866,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA +@@ -857,6 +860,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA inspectorPageAgent->accessibilitySettingsDidChange(); } @@ -2958,7 +2971,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 #if ENABLE(DARK_MODE_CSS) void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents) { -@@ -915,6 +924,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru +@@ -909,6 +918,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru networkAgent->interceptResponse(response, identifier, WTFMove(handler)); } @@ -2971,7 +2984,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 // JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes. static bool isConsoleAssertMessage(MessageSource source, MessageType type) { -@@ -1051,6 +1066,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent +@@ -1027,6 +1042,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent canvasAgent->consoleStopRecordingCanvas(context); } @@ -2981,10 +2994,10 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 + pageRuntimeAgent->bindingCalled(globalObject, name, arg); +} + - void InspectorInstrumentation::didOpenDatabaseImpl(InstrumentingAgents& instrumentingAgents, Database& database) + void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents& instrumentingAgents, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin) { - if (auto* databaseAgent = instrumentingAgents.enabledDatabaseAgent()) -@@ -1357,6 +1378,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins + if (auto* domStorageAgent = instrumentingAgents.enabledDOMStorageAgent()) +@@ -1317,6 +1338,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins layerTreeAgent->renderLayerDestroyed(renderLayer); } @@ -3021,7 +3034,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(WorkerOrWorkletGlobalScope& globalScope) { return globalScope.inspectorController().m_instrumentingAgents; -@@ -1373,6 +1424,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(Page& page) +@@ -1333,6 +1384,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(Page& page) return page.inspectorController().m_instrumentingAgents.get(); } @@ -3036,7 +3049,7 @@ index 98e75f2aec7f7defae1e0260f0a563517a61940e..64e9b1713e600a6aa3f02c2c4c701902 { // Using RefPtr makes us hit the m_inRemovedLastRefFunction assert. diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h -index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821befb7818c5b 100644 +index 0fb5a57841daca73bbc452b6bbe97d8bbb25500e..7aac51c58d0fc3640fcaf7f9cdf0776367020f9e 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.h +++ b/Source/WebCore/inspector/InspectorInstrumentation.h @@ -31,6 +31,7 @@ @@ -3047,7 +3060,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef #include "CSSSelector.h" #include "CanvasBase.h" #include "CanvasRenderingContext.h" -@@ -45,6 +46,7 @@ +@@ -44,6 +45,7 @@ #include "LocalFrame.h" #include "LocalFrameView.h" #include "Page.h" @@ -3055,7 +3068,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef #include "ResourceLoader.h" #include "ResourceLoaderIdentifier.h" #include "StorageArea.h" -@@ -78,6 +80,7 @@ class DOMWrapperWorld; +@@ -77,6 +79,7 @@ class DOMWrapperWorld; class Document; class DocumentLoader; class EventListener; @@ -3063,7 +3076,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef class HTTPHeaderMap; class InspectorTimelineAgent; class InstrumentingAgents; -@@ -193,6 +196,7 @@ public: +@@ -196,6 +199,7 @@ public: static void didRecalculateStyle(Document&); static void didScheduleStyleRecalculation(Document&); static void applyUserAgentOverride(LocalFrame&, String&); @@ -3071,7 +3084,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef static void applyEmulatedMedia(LocalFrame&, AtomString&); static void flexibleBoxRendererBeganLayout(const RenderObject&); -@@ -205,6 +209,7 @@ public: +@@ -208,6 +212,7 @@ public: static void didReceiveData(LocalFrame*, ResourceLoaderIdentifier, const SharedBuffer*, int encodedDataLength); static void didFinishLoading(LocalFrame*, DocumentLoader*, ResourceLoaderIdentifier, const NetworkLoadMetrics&, ResourceLoader*); static void didFailLoading(LocalFrame*, DocumentLoader*, ResourceLoaderIdentifier, const ResourceError&); @@ -3079,7 +3092,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef static void willSendRequest(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, ResourceRequest&); static void didReceiveResourceResponse(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, const ResourceResponse&); -@@ -231,13 +236,13 @@ public: +@@ -234,13 +239,13 @@ public: static void frameDetachedFromParent(LocalFrame&); static void didCommitLoad(LocalFrame&, DocumentLoader*); static void frameDocumentUpdated(LocalFrame&); @@ -3095,7 +3108,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef #if ENABLE(DARK_MODE_CSS) static void defaultAppearanceDidChange(Page&); #endif -@@ -248,6 +253,7 @@ public: +@@ -251,6 +256,7 @@ public: static bool shouldInterceptResponse(const LocalFrame&, const ResourceResponse&); static void interceptRequest(ResourceLoader&, Function&&); static void interceptResponse(const LocalFrame&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); @@ -3103,15 +3116,15 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef static void addMessageToConsole(Page&, std::unique_ptr); static void addMessageToConsole(WorkerOrWorkletGlobalScope&, std::unique_ptr); -@@ -269,6 +275,7 @@ public: - static void stopProfiling(Page&, JSC::JSGlobalObject*, const String& title); +@@ -272,6 +278,7 @@ public: + static void stopProfiling(Page&, const String& title); static void consoleStartRecordingCanvas(CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options); static void consoleStopRecordingCanvas(CanvasRenderingContext&); + static void bindingCalled(Page& , JSC::JSGlobalObject*, const String& name, const String& arg); - static void performanceMark(ScriptExecutionContext&, const String&, std::optional, LocalFrame*); + static void performanceMark(ScriptExecutionContext&, const String&, std::optional); -@@ -327,6 +334,12 @@ public: +@@ -325,6 +332,12 @@ public: static void layerTreeDidChange(Page*); static void renderLayerDestroyed(Page*, const RenderLayer&); @@ -3124,7 +3137,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef static void frontendCreated(); static void frontendDeleted(); static bool hasFrontends() { return InspectorInstrumentationPublic::hasFrontends(); } -@@ -343,6 +356,8 @@ public: +@@ -341,6 +354,8 @@ public: static void registerInstrumentingAgents(InstrumentingAgents&); static void unregisterInstrumentingAgents(InstrumentingAgents&); @@ -3173,15 +3186,15 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr); -@@ -479,6 +497,7 @@ private: - static void stopProfilingImpl(InstrumentingAgents&, JSC::JSGlobalObject*, const String& title); +@@ -477,6 +495,7 @@ private: + static void stopProfilingImpl(InstrumentingAgents&, const String& title); static void consoleStartRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options); static void consoleStopRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&); + static void bindingCalledImpl(InstrumentingAgents&, JSC::JSGlobalObject*, const String& name, const String& arg); - static void performanceMarkImpl(InstrumentingAgents&, const String& label, std::optional, LocalFrame*); + static void performanceMarkImpl(InstrumentingAgents&, const String& label, std::optional); -@@ -537,6 +556,12 @@ private: +@@ -530,6 +549,12 @@ private: static void layerTreeDidChangeImpl(InstrumentingAgents&); static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&); @@ -3194,7 +3207,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef static InstrumentingAgents& instrumentingAgents(Page&); static InstrumentingAgents& instrumentingAgents(WorkerOrWorkletGlobalScope&); static InstrumentingAgents& instrumentingAgents(ServiceWorkerGlobalScope&); -@@ -1070,6 +1095,13 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame, +@@ -1089,6 +1114,13 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame, applyUserAgentOverrideImpl(*agents, userAgent); } @@ -3208,7 +3221,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef inline void InspectorInstrumentation::applyEmulatedMedia(LocalFrame& frame, AtomString& media) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1172,6 +1204,13 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& g +@@ -1191,6 +1223,13 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& g didFailLoadingImpl(instrumentingAgents(globalScope), identifier, nullptr, error); } @@ -3222,7 +3235,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(LocalFrame& frame, ResourceLoaderIdentifier identifier, DocumentLoader& loader, const ResourceResponse& response) { // Treat the same as didReceiveResponse. -@@ -1262,13 +1301,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame) +@@ -1281,13 +1320,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame) frameDocumentUpdatedImpl(*agents, frame); } @@ -3236,7 +3249,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef inline void InspectorInstrumentation::frameStartedLoading(LocalFrame& frame) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1290,11 +1322,11 @@ inline void InspectorInstrumentation::frameStoppedLoading(LocalFrame& frame) +@@ -1309,11 +1341,11 @@ inline void InspectorInstrumentation::frameStoppedLoading(LocalFrame& frame) frameStoppedLoadingImpl(*agents, frame); } @@ -3250,7 +3263,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef } inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& frame) -@@ -1310,6 +1342,13 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page) +@@ -1329,6 +1361,13 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page) accessibilitySettingsDidChangeImpl(instrumentingAgents(page)); } @@ -3264,7 +3277,7 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef #if ENABLE(DARK_MODE_CSS) inline void InspectorInstrumentation::defaultAppearanceDidChange(Page& page) { -@@ -1362,6 +1401,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame, +@@ -1381,6 +1420,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame, interceptResponseImpl(*agents, response, identifier, WTFMove(handler)); } @@ -3275,11 +3288,11 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef + setStoppingLoadingDueToProcessSwapImpl(*agents, value); +} + - inline void InspectorInstrumentation::didOpenDatabase(Database& database) + inline void InspectorInstrumentation::didDispatchDOMStorageEvent(Page& page, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1698,6 +1744,11 @@ inline void InspectorInstrumentation::performanceMark(ScriptExecutionContext& co - performanceMarkImpl(*agents, label, WTFMove(startTime), frame); +@@ -1697,6 +1743,11 @@ inline void InspectorInstrumentation::performanceMark(ScriptExecutionContext& co + performanceMarkImpl(*agents, label, WTFMove(startTime)); } +inline void InspectorInstrumentation::bindingCalled(Page& page, JSC::JSGlobalObject* globalObject, const String& name, const String& arg) @@ -3287,10 +3300,10 @@ index 81d38dfe2e63476b86b87fccc3544090454ae683..7dfb4d6ed4a795bae882e70c80821bef + bindingCalledImpl(instrumentingAgents(page), globalObject, name, arg); +} + - inline void InspectorInstrumentation::didRequestAnimationFrame(Document& document, int callbackId) + inline void InspectorInstrumentation::didRequestAnimationFrame(ScriptExecutionContext& scriptExecutionContext, int callbackId) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1754,6 +1805,42 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren +@@ -1753,6 +1804,42 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren renderLayerDestroyedImpl(*agents, renderLayer); } @@ -3386,34 +3399,33 @@ index c028341e84e59a6b1b16107fd74feb21f70b12ab..d385418ac34e8f315f201801a2c65226 + } diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp -index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da0729510cbf 100644 +index 5bd7a42c19fd11234eea0520ebf61f7f820f765e..a70339c639682820de7ff09d62e8cfd42a7d7060 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp -@@ -55,6 +55,7 @@ - #include "ContainerNode.h" +@@ -56,6 +56,7 @@ #include "Cookie.h" #include "CookieJar.h" + #include "CustomElementRegistry.h" +#include "DirectoryFileListCreator.h" #include "DOMEditor.h" #include "DOMException.h" #include "DOMPatchSupport.h" -@@ -65,10 +66,15 @@ +@@ -67,9 +68,14 @@ #include "Event.h" #include "EventListener.h" #include "EventNames.h" +#include "File.h" +#include +#include "FileList.h" - #include "FrameTree.h" - #include "FullscreenManager.h" +#include "FloatQuad.h" + #include "FrameTree.h" #include "HTMLElement.h" #include "HTMLFrameOwnerElement.h" +#include "HTMLInputElement.h" #include "HTMLMediaElement.h" #include "HTMLNames.h" #include "HTMLScriptElement.h" -@@ -102,12 +108,14 @@ +@@ -104,12 +110,14 @@ #include "Pasteboard.h" #include "PseudoElement.h" #include "RenderGrid.h" @@ -3428,7 +3440,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 #include "StaticNodeList.h" #include "StyleProperties.h" #include "StyleResolver.h" -@@ -149,7 +157,8 @@ using namespace HTMLNames; +@@ -151,7 +159,8 @@ using namespace HTMLNames; static const size_t maxTextSize = 10000; static const UChar horizontalEllipsisUChar[] = { horizontalEllipsis, 0 }; @@ -3438,7 +3450,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 { if (!colorObject) return std::nullopt; -@@ -168,7 +177,7 @@ static std::optional parseColor(RefPtr&& colorObject) +@@ -170,7 +179,7 @@ static std::optional parseColor(RefPtr&& colorObject) static std::optional parseRequiredConfigColor(const String& fieldName, JSON::Object& configObject) { @@ -3447,7 +3459,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 } static Color parseOptionalConfigColor(const String& fieldName, JSON::Object& configObject) -@@ -195,6 +204,20 @@ static bool parseQuad(Ref&& quadArray, FloatQuad* quad) +@@ -197,6 +206,20 @@ static bool parseQuad(Ref&& quadArray, FloatQuad* quad) return true; } @@ -3468,7 +3480,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 class RevalidateStyleAttributeTask final : public CanMakeCheckedPtr { WTF_MAKE_TZONE_ALLOCATED(RevalidateStyleAttributeTask); WTF_OVERRIDE_DELETE_FOR_CHECKED_PTR(RevalidateStyleAttributeTask); -@@ -475,6 +498,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin +@@ -477,6 +500,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin return node.get(); } @@ -3489,7 +3501,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 Document* InspectorDOMAgent::assertDocument(Inspector::Protocol::ErrorString& errorString, Inspector::Protocol::DOM::NodeId nodeId) { RefPtr node = assertNode(errorString, nodeId); -@@ -1549,16 +1586,7 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::o +@@ -1595,16 +1632,7 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::o Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::optional&& nodeId, const Inspector::Protocol::Runtime::RemoteObjectId& objectId, Ref&& highlightInspectorObject, RefPtr&& gridOverlayInspectorObject, RefPtr&& flexOverlayInspectorObject, std::optional&& showRulers) { Inspector::Protocol::ErrorString errorString; @@ -3507,7 +3519,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 if (!node) return makeUnexpected(errorString); -@@ -1813,15 +1841,155 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setInspectedNode(Ins +@@ -1859,15 +1887,159 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setInspectedNode(Ins return { }; } @@ -3517,13 +3529,17 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 + return containingView.convertToRootView(point - toFloatSize(containingView.documentScrollPositionRelativeToViewOrigin())); +} + -+static void frameQuadToViewport(LocalFrameView& containingView, FloatQuad& quad, float pageScaleFactor) ++static void frameQuadToViewport(LocalFrameView& containingView, FloatQuad& quad, Page& inspectedPage) +{ ++ float pageScaleFactor = inspectedPage.pageScaleFactor(); ++ auto mainFrame = inspectedPage.localMainFrame(); ++ float scale = pageScaleFactor * mainFrame->pageZoomFactor(); ++ + // Return css (not dip) coordinates by scaling back. -+ quad.setP1(contentsToRootView(containingView, quad.p1()).scaled(1 / pageScaleFactor)); -+ quad.setP2(contentsToRootView(containingView, quad.p2()).scaled(1 / pageScaleFactor)); -+ quad.setP3(contentsToRootView(containingView, quad.p3()).scaled(1 / pageScaleFactor)); -+ quad.setP4(contentsToRootView(containingView, quad.p4()).scaled(1 / pageScaleFactor)); ++ quad.setP1(contentsToRootView(containingView, quad.p1()).scaled(1 / scale)); ++ quad.setP2(contentsToRootView(containingView, quad.p2()).scaled(1 / scale)); ++ quad.setP3(contentsToRootView(containingView, quad.p3()).scaled(1 / scale)); ++ quad.setP4(contentsToRootView(containingView, quad.p4()).scaled(1 / scale)); +} + +static Ref buildObjectForQuad(const FloatQuad& quad) @@ -3581,7 +3597,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 + if (!node) + return makeUnexpected("Node not found"_s); + -+ m_inspectedPage.isolatedUpdateRendering(); ++ m_inspectedPage->isolatedUpdateRendering(); + if (!node->isConnected()) + return makeUnexpected("Node is detached from document"_s); + @@ -3627,7 +3643,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 + return makeUnexpected("Node not found"_s); + + // Ensure quads are up to date. -+ m_inspectedPage.isolatedUpdateRendering(); ++ m_inspectedPage->isolatedUpdateRendering(); + + LocalFrameView* containingView = node->document().view(); + if (!containingView) @@ -3636,7 +3652,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 + Vector quads; + CollectQuads(node, quads); + for (auto& quad : quads) -+ frameQuadToViewport(*containingView, quad, m_inspectedPage.pageScaleFactor()); ++ frameQuadToViewport(*containingView, quad, m_inspectedPage.get()); + return buildArrayOfQuads(quads); +} + @@ -3666,7 +3682,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 if (!object) return makeUnexpected("Missing injected script for given nodeId"_s); -@@ -3087,7 +3255,7 @@ Inspector::Protocol::ErrorStringOr InspectorDO +@@ -3133,7 +3305,7 @@ Inspector::Protocol::ErrorStringOr InspectorDO return makeUnexpected("Missing node for given path"_s); } @@ -3675,7 +3691,7 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 { Document* document = &node->document(); if (auto* templateHost = document->templateDocumentHost()) -@@ -3096,12 +3264,18 @@ RefPtr InspectorDOMAgent::resolveNod +@@ -3142,12 +3314,18 @@ RefPtr InspectorDOMAgent::resolveNod if (!frame) return nullptr; @@ -3697,11 +3713,11 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 } Node* InspectorDOMAgent::scriptValueAsNode(JSC::JSValue value) -@@ -3209,4 +3383,89 @@ Inspector::Protocol::ErrorStringOr> In +@@ -3255,4 +3433,53 @@ Inspector::Protocol::ErrorStringOr> In #endif } -+void InspectorDOMAgent::setInputFiles(const String& objectId, RefPtr&& files, RefPtr&& paths, Ref&& callback) { ++void InspectorDOMAgent::setInputFiles(const String& objectId, Ref&& paths, Ref&& callback) { + InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); + if (injectedScript.hasNoValue()) { + callback->sendFailure("Can not find element's context for given id"_s); @@ -3719,76 +3735,40 @@ index f671c06ea5c75e6f4df338ac6c404533a04a3cfd..0d6e106c19063b0ffaeca1cc6830da07 + return; + } + -+ if (!(bool(files) ^ bool(paths))) { -+ callback->sendFailure("Exactly one of files and paths should be specified"_s); -+ return; -+ } -+ + HTMLInputElement* element = static_cast(node); + Vector> fileObjects; -+ if (files) { -+ for (unsigned i = 0; i < files->length(); ++i) { -+ RefPtr item = files->get(i); -+ RefPtr obj = item->asObject(); -+ if (!obj) { -+ callback->sendFailure("Invalid file payload format"_s); -+ return; -+ } -+ -+ String name; -+ String type; -+ String data; -+ if (!obj->getString("name"_s, name) || !obj->getString("type"_s, type) || !obj->getString("data"_s, data)) { -+ callback->sendFailure("Invalid file payload format"_s); -+ return; -+ } -+ -+ std::optional> buffer = base64Decode(data); -+ if (!buffer) { -+ callback->sendFailure("Unable to decode given content"_s); ++ if (element->hasAttributeWithoutSynchronization(webkitdirectoryAttr)) { ++ auto directoryFileListCreator = DirectoryFileListCreator::create([element = RefPtr { element }, callback = WTFMove(callback)](Ref&& fileList) mutable { ++ ASSERT(isMainThread()); ++ element->setFiles(WTFMove(fileList)); ++ callback->sendSuccess(); ++ }); ++ Vector fileChooserFiles; ++ for (size_t i = 0; i < paths->length(); ++i) { ++ fileChooserFiles.append(FileChooserFileInfo { paths->get(i)->asString(), nullString(), { } }); ++ } ++ directoryFileListCreator->start(m_document.get(), fileChooserFiles); ++ } else { ++ for (unsigned i = 0; i < paths->length(); ++i) { ++ RefPtr item = paths->get(i); ++ String path = item->asString(); ++ if (path.isEmpty()) { ++ callback->sendFailure("Invalid file path"_s); + return; + } + + ScriptExecutionContext* context = element->scriptExecutionContext(); -+ fileObjects.append(File::create(context, Blob::create(context, WTFMove(*buffer), type), name)); ++ fileObjects.append(File::create(context, path)); + } + RefPtr fileList = FileList::create(WTFMove(fileObjects)); + element->setFiles(WTFMove(fileList)); + callback->sendSuccess(); -+ } else { -+ if (element->hasAttributeWithoutSynchronization(webkitdirectoryAttr)) { -+ auto directoryFileListCreator = DirectoryFileListCreator::create([element = RefPtr { element }, callback = WTFMove(callback)](Ref&& fileList) mutable { -+ ASSERT(isMainThread()); -+ element->setFiles(WTFMove(fileList)); -+ callback->sendSuccess(); -+ }); -+ Vector fileChooserFiles; -+ for (size_t i = 0; i < paths->length(); ++i) { -+ fileChooserFiles.append(FileChooserFileInfo { paths->get(i)->asString(), nullString(), { } }); -+ } -+ directoryFileListCreator->start(m_document.get(), fileChooserFiles); -+ } else { -+ for (unsigned i = 0; i < paths->length(); ++i) { -+ RefPtr item = paths->get(i); -+ String path = item->asString(); -+ if (path.isEmpty()) { -+ callback->sendFailure("Invalid file path"_s); -+ return; -+ } -+ -+ ScriptExecutionContext* context = element->scriptExecutionContext(); -+ fileObjects.append(File::create(context, path)); -+ } -+ RefPtr fileList = FileList::create(WTFMove(fileObjects)); -+ element->setFiles(WTFMove(fileList)); -+ callback->sendSuccess(); -+ } + } +} + } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.h b/Source/WebCore/inspector/agents/InspectorDOMAgent.h -index ab0499c5e381855f55fa89227f4da05c7bcf40b1..e506a903ba60173b47135d5b18cfa0d3cdd8783e 100644 +index c8602dd6236d299df04b28b456b4d4ab6348c6eb..15128978fa8d64b6413b82ce9991dd708d50271b 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.h +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.h @@ -59,6 +59,7 @@ namespace WebCore { @@ -3807,7 +3787,7 @@ index ab0499c5e381855f55fa89227f4da05c7bcf40b1..e506a903ba60173b47135d5b18cfa0d3 // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently. // We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics. -@@ -137,7 +139,7 @@ public: +@@ -139,7 +141,7 @@ public: Inspector::Protocol::ErrorStringOr> performSearch(const String& query, RefPtr&& nodeIds, std::optional&& caseSensitive); Inspector::Protocol::ErrorStringOr>> getSearchResults(const String& searchId, int fromIndex, int toIndex); Inspector::Protocol::ErrorStringOr discardSearchResults(const String& searchId); @@ -3816,18 +3796,18 @@ index ab0499c5e381855f55fa89227f4da05c7bcf40b1..e506a903ba60173b47135d5b18cfa0d3 Inspector::Protocol::ErrorStringOr>> getAttributes(Inspector::Protocol::DOM::NodeId); #if PLATFORM(IOS_FAMILY) Inspector::Protocol::ErrorStringOr setInspectModeEnabled(bool, RefPtr&& highlightConfig, RefPtr&& gridOverlayConfig, RefPtr&& flexOverlayConfig); -@@ -174,6 +176,10 @@ public: +@@ -176,6 +178,10 @@ public: Inspector::Protocol::ErrorStringOr setInspectedNode(Inspector::Protocol::DOM::NodeId); Inspector::Protocol::ErrorStringOr setAllowEditingUserAgentShadowTrees(bool); Inspector::Protocol::ErrorStringOr> getMediaStats(Inspector::Protocol::DOM::NodeId); + Inspector::Protocol::ErrorStringOr> describeNode(const String& objectId); + Inspector::Protocol::ErrorStringOr scrollIntoViewIfNeeded(const String& objectId, RefPtr&& rect); + Inspector::Protocol::ErrorStringOr>> getContentQuads(const String& objectId); -+ void setInputFiles(const String& objectId, RefPtr&& files, RefPtr&& paths, Ref&& callback); ++ void setInputFiles(const String& objectId, Ref&& paths, Ref&& callback); // InspectorInstrumentation Inspector::Protocol::DOM::NodeId identifierForNode(Node&); -@@ -215,7 +221,7 @@ public: +@@ -217,7 +223,7 @@ public: Node* nodeForId(Inspector::Protocol::DOM::NodeId); Inspector::Protocol::DOM::NodeId boundNodeId(const Node*); @@ -3836,7 +3816,7 @@ index ab0499c5e381855f55fa89227f4da05c7bcf40b1..e506a903ba60173b47135d5b18cfa0d3 bool handleMousePress(); void mouseDidMoveOverElement(const HitTestResult&, OptionSet); void inspect(Node*); -@@ -227,12 +233,15 @@ public: +@@ -229,12 +235,15 @@ public: void reset(); Node* assertNode(Inspector::Protocol::ErrorString&, Inspector::Protocol::DOM::NodeId); @@ -3852,7 +3832,7 @@ index ab0499c5e381855f55fa89227f4da05c7bcf40b1..e506a903ba60173b47135d5b18cfa0d3 private: #if ENABLE(VIDEO) void mediaMetricsTimerFired(); -@@ -262,7 +271,6 @@ private: +@@ -264,7 +273,6 @@ private: void processAccessibilityChildren(AXCoreObject&, JSON::ArrayOf&); Node* nodeForPath(const String& path); @@ -3861,18 +3841,18 @@ index ab0499c5e381855f55fa89227f4da05c7bcf40b1..e506a903ba60173b47135d5b18cfa0d3 void discardBindings(); diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp -index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21db2bb9814 100644 +index 263890779b1a012b1ae1fe9145f4a7af494a581c..dc83cf514b03a80ceff036248147203898a4e113 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp -@@ -59,6 +59,7 @@ +@@ -58,6 +58,7 @@ + #include "LocalFrame.h" #include "MIMETypeRegistry.h" #include "MemoryCache.h" - #include "NetworkResourcesData.h" +#include "NetworkStateNotifier.h" #include "Page.h" #include "PlatformStrategies.h" #include "ProgressTracker.h" -@@ -345,8 +346,8 @@ static Ref buildObjectForResourceRequest( +@@ -343,8 +344,8 @@ static Ref buildObjectForResourceRequest( .release(); if (request.httpBody() && !request.httpBody()->isEmpty()) { @@ -3883,7 +3863,7 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d } if (resourceLoader) { -@@ -399,6 +400,8 @@ RefPtr InspectorNetworkAgent::buildObjec +@@ -397,6 +398,8 @@ RefPtr InspectorNetworkAgent::buildObjec .setSource(responseSource(response.source())) .release(); @@ -3892,7 +3872,7 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d if (resourceLoader) { auto* metrics = response.deprecatedNetworkLoadMetricsOrNull(); responseObject->setTiming(buildObjectForTiming(metrics ? *metrics : NetworkLoadMetrics::emptyMetrics(), *resourceLoader)); -@@ -685,6 +688,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier, +@@ -683,6 +686,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier, String requestId = IdentifiersFactory::requestId(identifier.toUInt64()); if (loader && m_resourcesData->resourceType(requestId) == InspectorPageAgent::DocumentResource) { @@ -3902,7 +3882,7 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d auto* frame = loader->frame(); if (frame && frame->loader().documentLoader() && frame->document()) { m_resourcesData->addResourceSharedBuffer(requestId, -@@ -914,6 +920,7 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::disable() +@@ -912,6 +918,7 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::disable() m_instrumentingAgents.setEnabledNetworkAgent(nullptr); m_resourcesData->clear(); m_extraRequestHeaders.clear(); @@ -3910,7 +3890,7 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d continuePendingRequests(); continuePendingResponses(); -@@ -966,6 +973,7 @@ void InspectorNetworkAgent::continuePendingResponses() +@@ -957,6 +964,7 @@ void InspectorNetworkAgent::continuePendingResponses() Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setExtraHTTPHeaders(Ref&& headers) { @@ -3918,7 +3898,7 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d for (auto& entry : headers.get()) { auto stringValue = entry.value->asString(); if (!!stringValue) -@@ -1215,6 +1223,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response, +@@ -1206,6 +1214,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response, m_frontendDispatcher->responseIntercepted(requestId, resourceResponse.releaseNonNull()); } @@ -3930,7 +3910,7 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptContinue(const Inspector::Protocol::Network::RequestId& requestId, Inspector::Protocol::Network::NetworkStage networkStage) { switch (networkStage) { -@@ -1244,6 +1257,9 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptWithReq +@@ -1235,6 +1248,9 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptWithReq return makeUnexpected("Missing pending intercept request for given requestId"_s); auto& loader = *pendingRequest->m_loader; @@ -3940,7 +3920,7 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d ResourceRequest request = loader.request(); if (!!url) request.setURL(URL({ }, url)); -@@ -1339,14 +1355,23 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptRequest +@@ -1330,14 +1346,23 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptRequest response.setHTTPStatusCode(status); response.setHTTPStatusText(String { statusText }); HTTPHeaderMap explicitHeaders; @@ -3966,7 +3946,7 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d if (loader->reachedTerminalState()) return; -@@ -1409,6 +1434,12 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setEmulatedCondi +@@ -1400,6 +1425,12 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setEmulatedCondi #endif // ENABLE(INSPECTOR_NETWORK_THROTTLING) @@ -3980,19 +3960,19 @@ index 3c4c9d809004f683d1248be257980bbbc522d132..cfa772a5caa5f0a7db07dc853036e21d { return startsWithLettersIgnoringASCIICase(mimeType, "text/"_s) diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h -index eda400879afb10b687fcbb317c9fdbb3be9c94cd..f3a382c44b53e6b1507fc046e22bff684abd55f9 100644 +index de6b2dd844943074c5a383c7b9b8ccba1c96419a..7a3404f2380b5e62f1c0523a70f8ef442014759d 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h -@@ -34,6 +34,8 @@ - #include "InspectorInstrumentation.h" +@@ -35,6 +35,8 @@ #include "InspectorPageAgent.h" #include "InspectorWebAgentBase.h" + #include "NetworkResourcesData.h" +#include "ResourceError.h" +#include "SharedBuffer.h" #include "WebSocket.h" + #include #include - #include -@@ -102,6 +104,7 @@ public: +@@ -104,6 +106,7 @@ public: #if ENABLE(INSPECTOR_NETWORK_THROTTLING) Inspector::Protocol::ErrorStringOr setEmulatedConditions(std::optional&& bytesPerSecondLimit) final; #endif @@ -4000,7 +3980,7 @@ index eda400879afb10b687fcbb317c9fdbb3be9c94cd..f3a382c44b53e6b1507fc046e22bff68 // InspectorInstrumentation void willRecalculateStyle(); -@@ -133,6 +136,7 @@ public: +@@ -135,6 +138,7 @@ public: bool shouldInterceptResponse(const ResourceResponse&); void interceptResponse(const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); void interceptRequest(ResourceLoader&, Function&&); @@ -4008,7 +3988,7 @@ index eda400879afb10b687fcbb317c9fdbb3be9c94cd..f3a382c44b53e6b1507fc046e22bff68 void searchOtherRequests(const JSC::Yarr::RegularExpression&, Ref>&); void searchInRequest(Inspector::Protocol::ErrorString&, const Inspector::Protocol::Network::RequestId&, const String& query, bool caseSensitive, bool isRegex, RefPtr>&); -@@ -259,6 +263,7 @@ private: +@@ -275,6 +279,7 @@ private: bool m_enabled { false }; bool m_loadingXHRSynchronously { false }; bool m_interceptionEnabled { false }; @@ -4017,7 +3997,7 @@ index eda400879afb10b687fcbb317c9fdbb3be9c94cd..f3a382c44b53e6b1507fc046e22bff68 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp -index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e3527edffdf2 100644 +index c7c930db458419ffdf3d10b9a7db0d3c2b9615a1..6253804039ea38105bb7647082752cafdd08d895 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp @@ -32,19 +32,27 @@ @@ -4048,7 +4028,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 #include "HTMLNames.h" #include "ImageBuffer.h" #include "InspectorClient.h" -@@ -57,8 +65,12 @@ +@@ -57,24 +65,38 @@ #include "MIMETypeRegistry.h" #include "MemoryCache.h" #include "Page.h" @@ -4060,8 +4040,10 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 +#include "SimpleRange.h" #include "ScriptController.h" #include "ScriptSourceCode.h" ++#include "ScrollingCoordinator.h" #include "SecurityOrigin.h" -@@ -67,14 +79,23 @@ + #include "Settings.h" + #include "ShouldPartitionCookie.h" #include "StyleScope.h" #include "Theme.h" #include @@ -4085,7 +4067,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 #include #if ENABLE(APPLICATION_MANIFEST) -@@ -96,6 +117,11 @@ using namespace Inspector; +@@ -96,6 +118,11 @@ using namespace Inspector; WTF_MAKE_TZONE_ALLOCATED_IMPL(InspectorPageAgent); @@ -4097,7 +4079,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 static bool decodeBuffer(std::span buffer, const String& textEncodingName, String* result) { if (buffer.data()) { -@@ -348,6 +374,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien +@@ -348,6 +375,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien , m_frontendDispatcher(makeUnique(context.frontendRouter)) , m_backendDispatcher(Inspector::PageBackendDispatcher::create(context.backendDispatcher, this)) , m_inspectedPage(context.inspectedPage) @@ -4105,7 +4087,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 , m_client(client) , m_overlay(overlay) { -@@ -377,12 +404,20 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::enable() +@@ -377,12 +405,20 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::enable() defaultUserPreferencesDidChange(); @@ -4126,13 +4108,13 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 setShowPaintRects(false); #if !PLATFORM(IOS_FAMILY) -@@ -435,6 +470,22 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::reload(std::optiona +@@ -435,6 +471,22 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::reload(std::optiona return { }; } +Inspector::Protocol::ErrorStringOr InspectorPageAgent::goBack() +{ -+ if (!m_inspectedPage.backForward().goBack()) ++ if (!m_inspectedPage->backForward().goBack()) + return makeUnexpected("Failed to go back"_s); + + return { }; @@ -4140,7 +4122,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + +Inspector::Protocol::ErrorStringOr InspectorPageAgent::goForward() +{ -+ if (!m_inspectedPage.backForward().goForward()) ++ if (!m_inspectedPage->backForward().goForward()) + return makeUnexpected("Failed to go forward"_s); + + return { }; @@ -4148,8 +4130,8 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + Inspector::Protocol::ErrorStringOr InspectorPageAgent::navigate(const String& url) { - RefPtr localMainFrame = m_inspectedPage.localMainFrame(); -@@ -461,6 +512,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(c + RefPtr localMainFrame = m_inspectedPage->localMainFrame(); +@@ -461,6 +513,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(c return { }; } @@ -4162,8 +4144,8 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Inspector::Protocol::Page::Setting setting, std::optional&& value) { - auto& inspectedPageSettings = m_inspectedPage.settings(); -@@ -474,6 +532,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins + auto& inspectedPageSettings = m_inspectedPage->settings(); +@@ -474,6 +533,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setAuthorAndUserStylesEnabledInspectorOverride(value); return { }; @@ -4176,7 +4158,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 case Inspector::Protocol::Page::Setting::ICECandidateFilteringEnabled: inspectedPageSettings.setICECandidateFilteringEnabledInspectorOverride(value); return { }; -@@ -500,6 +564,45 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -500,6 +565,39 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins m_client->setDeveloperPreferenceOverride(InspectorClient::DeveloperPreference::NeedsSiteSpecificQuirks, value); return { }; @@ -4193,17 +4175,11 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 +#endif + + case Protocol::Page::Setting::InputTypeMonthEnabled: -+// Playwright client sends it even if it's not supported. -+#if ENABLE(INPUT_TYPE_MONTH) + inspectedPageSettings.setInputTypeMonthEnabled(value.value_or(false)); -+#endif + return { }; + + case Protocol::Page::Setting::InputTypeWeekEnabled: -+// Playwright client sends it even if it's not supported. -+#if ENABLE(INPUT_TYPE_WEEK) + inspectedPageSettings.setInputTypeWeekEnabled(value.value_or(false)); -+#endif + return { }; + + case Protocol::Page::Setting::FixedBackgroundsPaintRelativeToDocument: @@ -4222,7 +4198,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 case Inspector::Protocol::Page::Setting::ScriptEnabled: inspectedPageSettings.setScriptEnabledInspectorOverride(value); return { }; -@@ -512,6 +615,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -512,6 +610,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setShowRepaintCounterInspectorOverride(value); return { }; @@ -4235,7 +4211,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 case Inspector::Protocol::Page::Setting::WebSecurityEnabled: inspectedPageSettings.setWebSecurityEnabledInspectorOverride(value); return { }; -@@ -919,15 +1028,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(b +@@ -920,15 +1024,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(b return { }; } @@ -4257,33 +4233,24 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 } void InspectorPageAgent::frameNavigated(LocalFrame& frame) -@@ -935,13 +1045,38 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) +@@ -936,13 +1041,29 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame)); } +String InspectorPageAgent::serializeFrameID(FrameIdentifier frameID) +{ -+ return makeString(frameID.processIdentifier().toUInt64(), '.', frameID.object().toUInt64()); ++ return makeString(frameID.toUInt64()); +} + +std::optional InspectorPageAgent::parseFrameID(String frameID) +{ -+ size_t dotPos = frameID.find("."_s); -+ if (dotPos == notFound) -+ return std::nullopt; -+ + if (!frameID.containsOnlyASCII()) + return std::nullopt; + -+ String processIDString = frameID.left(dotPos); -+ uint64_t pid = strtoull(processIDString.ascii().data(), 0, 10); -+ auto processID = ObjectIdentifier(pid); -+ String frameIDString = frameID.substring(dotPos + 1); -+ uint64_t frameIDNumber = strtoull(frameIDString.ascii().data(), 0, 10); -+ return WebCore::FrameIdentifier { -+ ObjectIdentifier(frameIDNumber), -+ processID -+ }; ++WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN ++ uint64_t frameIDNumber = strtoull(frameID.ascii().data(), 0, 10); ++WTF_ALLOW_UNSAFE_BUFFER_USAGE_END ++ return WebCore::FrameIdentifier(frameIDNumber); +} + void InspectorPageAgent::frameDetached(LocalFrame& frame) @@ -4299,7 +4266,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 } Frame* InspectorPageAgent::frameForId(const Inspector::Protocol::Network::FrameId& frameId) -@@ -953,20 +1088,21 @@ String InspectorPageAgent::frameId(Frame* frame) +@@ -954,20 +1075,21 @@ String InspectorPageAgent::frameId(Frame* frame) { if (!frame) return emptyString(); @@ -4329,7 +4296,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 } LocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& errorString, const Inspector::Protocol::Network::FrameId& frameId) -@@ -977,11 +1113,6 @@ LocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& er +@@ -978,11 +1100,6 @@ LocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& er return frame; } @@ -4341,7 +4308,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 void InspectorPageAgent::frameStartedLoading(LocalFrame& frame) { m_frontendDispatcher->frameStartedLoading(frameId(&frame)); -@@ -992,9 +1123,9 @@ void InspectorPageAgent::frameStoppedLoading(LocalFrame& frame) +@@ -993,9 +1110,9 @@ void InspectorPageAgent::frameStoppedLoading(LocalFrame& frame) m_frontendDispatcher->frameStoppedLoading(frameId(&frame)); } @@ -4353,7 +4320,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 } void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame) -@@ -1041,6 +1172,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() +@@ -1042,6 +1159,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() m_frontendDispatcher->defaultUserPreferencesDidChange(WTFMove(defaultUserPreferences)); } @@ -4366,7 +4333,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 #if ENABLE(DARK_MODE_CSS) void InspectorPageAgent::defaultAppearanceDidChange() { -@@ -1054,6 +1191,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp +@@ -1055,6 +1178,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp return; if (m_bootstrapScript.isEmpty()) @@ -4376,7 +4343,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 return; frame.script().evaluateIgnoringException(ScriptSourceCode(m_bootstrapScript, JSC::SourceTaintedOrigin::Untainted, URL { "web-inspector://bootstrap.js"_str })); -@@ -1101,6 +1241,51 @@ void InspectorPageAgent::didRecalculateStyle() +@@ -1102,6 +1228,51 @@ void InspectorPageAgent::didRecalculateStyle() protectedOverlay()->update(); } @@ -4428,7 +4395,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 Ref InspectorPageAgent::buildObjectForFrame(LocalFrame* frame) { ASSERT_ARG(frame, frame); -@@ -1194,6 +1379,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) +@@ -1195,6 +1366,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) userAgent = m_userAgentOverride; } @@ -4441,7 +4408,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 void InspectorPageAgent::applyEmulatedMedia(AtomString& media) { if (!m_emulatedMedia.isEmpty()) -@@ -1221,11 +1412,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp +@@ -1222,11 +1399,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp return snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); } @@ -4455,24 +4422,24 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + options.flags.add(SnapshotFlags::OmitDeviceScaleFactor); IntRect rectangle(x, y, width, height); - RefPtr localMainFrame = m_inspectedPage.localMainFrame(); -@@ -1239,6 +1432,43 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int + RefPtr localMainFrame = m_inspectedPage->localMainFrame(); +@@ -1240,6 +1419,43 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int return snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); } +Protocol::ErrorStringOr InspectorPageAgent::setForcedColors(std::optional&& forcedColors) +{ + if (!forcedColors) { -+ m_inspectedPage.setUseForcedColorsOverride(std::nullopt); ++ m_inspectedPage->setUseForcedColorsOverride(std::nullopt); + return { }; + } + + switch (*forcedColors) { + case Protocol::Page::ForcedColors::Active: -+ m_inspectedPage.setUseForcedColorsOverride(true); ++ m_inspectedPage->setUseForcedColorsOverride(true); + return { }; + case Protocol::Page::ForcedColors::None: -+ m_inspectedPage.setUseForcedColorsOverride(false); ++ m_inspectedPage->setUseForcedColorsOverride(false); + return { }; + } + @@ -4492,7 +4459,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 +Protocol::ErrorStringOr InspectorPageAgent::setTouchEmulationEnabled(bool enabled) +{ + setScreenHasTouchDeviceOverride(enabled); -+ m_inspectedPage.settings().setTouchEventDOMAttributesEnabled(enabled); ++ m_inspectedPage->settings().setTouchEventDOMAttributesEnabled(enabled); + return { }; +} + @@ -4500,7 +4467,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 #if ENABLE(WEB_ARCHIVE) && USE(CF) Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() { -@@ -1255,7 +1485,6 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() +@@ -1256,7 +1472,6 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() } #endif @@ -4508,7 +4475,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverride(std::optional&& width, std::optional&& height) { if (width.has_value() != height.has_value()) -@@ -1273,6 +1502,498 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverri +@@ -1274,6 +1489,496 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverri localMainFrame->setOverrideScreenSize(FloatSize(width.value_or(0), height.value_or(0))); return { }; } @@ -4517,7 +4484,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 +Protocol::ErrorStringOr InspectorPageAgent::insertText(const String& text) +{ + UserGestureIndicator indicator { IsProcessingUserGesture::Yes }; -+ RefPtr frame = m_inspectedPage.checkedFocusController()->focusedOrMainFrame(); ++ RefPtr frame = m_inspectedPage->checkedFocusController()->focusedOrMainFrame(); + if (!frame) + return { }; + @@ -4525,7 +4492,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + frame->editor().confirmComposition(text); + } else { + Document* focusedDocument = frame->document(); -+ TypingCommand::insertText(*focusedDocument, text, { }); ++ TypingCommand::insertText(*focusedDocument, text, nullptr, { }); + } + return { }; +} @@ -4639,8 +4606,6 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + return "Image"_s; + case AccessibilityRole::ImageMap: + return "ImageMap"_s; -+ case AccessibilityRole::ImageMapLink: -+ return "ImageMapLink"_s; + case AccessibilityRole::Insertion: + return "Insertion"_s; + case AccessibilityRole::Label: @@ -4913,7 +4878,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + if (!WebCore::AXObjectCache::accessibilityEnabled()) + WebCore::AXObjectCache::enableAccessibility(); + -+ auto* localMainFrame = dynamicDowncast(m_inspectedPage.mainFrame()); ++ auto* localMainFrame = dynamicDowncast(m_inspectedPage->mainFrame()); + if (!localMainFrame) + return makeUnexpected("No local main frame"_s); + @@ -4925,7 +4890,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + if (!axObjectCache) + return makeUnexpected("No AXObjectCache for main document"_s); + -+ AXCoreObject* axObject = axObjectCache->rootObject(); ++ AXCoreObject* axObject = axObjectCache->rootObjectForFrame(*localMainFrame); + if (!axObject) + return makeUnexpected("No AXObject for main document"_s); + @@ -4952,7 +4917,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + +Protocol::ErrorStringOr InspectorPageAgent::setDefaultBackgroundColorOverride(RefPtr&& color) +{ -+ auto* localFrame = dynamicDowncast(m_inspectedPage.mainFrame()); ++ auto* localFrame = dynamicDowncast(m_inspectedPage->mainFrame()); + LocalFrameView* view = localFrame ? localFrame->view() : nullptr; + if (!view) + return makeUnexpected("Internal error: No frame view to set color two"_s); @@ -4979,7 +4944,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + +void InspectorPageAgent::ensureUserWorldsExistInAllFrames(const Vector& worlds) +{ -+ for (Frame* frame = &m_inspectedPage.mainFrame(); frame; frame = frame->tree().traverseNext()) { ++ for (Frame* frame = &m_inspectedPage->mainFrame(); frame; frame = frame->tree().traverseNext()) { + auto* localFrame = dynamicDowncast(frame); + for (auto* world : worlds) + localFrame->windowProxy().jsWindowProxy(*world)->window(); @@ -5000,7 +4965,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 + +Protocol::ErrorStringOr InspectorPageAgent::updateScrollingState() +{ -+ auto* scrollingCoordinator = m_inspectedPage.scrollingCoordinator(); ++ auto* scrollingCoordinator = m_inspectedPage->scrollingCoordinator(); + if (!scrollingCoordinator) + return {}; + scrollingCoordinator->commitTreeStateIfNeeded(); @@ -5009,7 +4974,7 @@ index 8cd529462736f59fa7b24bdb887faf61e88036dd..25df35396b5fd35a9431e8d47168e352 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h -index c72739aab6ddb20cac65cbe82a14a38d860ae0bd..502b0acd85fe625c13b45f287e38493a772fac1b 100644 +index 7daa8d1d5c96afe1829aa21ccb8ed1b8ebcc3861..da57245795d7cb287daaaaf5d09a523c0f88fcc7 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.h +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h @@ -32,8 +32,10 @@ @@ -5137,7 +5102,7 @@ index c72739aab6ddb20cac65cbe82a14a38d860ae0bd..502b0acd85fe625c13b45f287e38493a @@ -173,17 +205,22 @@ private: RefPtr m_backendDispatcher; - Page& m_inspectedPage; + WeakRef m_inspectedPage; + Inspector::InjectedScriptManager& m_injectedScriptManager; InspectorClient* m_client { nullptr }; WeakRef m_overlay; @@ -5159,7 +5124,7 @@ index c72739aab6ddb20cac65cbe82a14a38d860ae0bd..502b0acd85fe625c13b45f287e38493a } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp -index fe77f9c4f424a9bbf5cdd6c0721a368767aa374c..0a76877d74a791cd1659c173221ee18cf7bb9fb7 100644 +index 0cc351959aaa96bd427ecbf75dd2ba51e730fc30..fb2b6c842a2e2b819ce746403e33550c0d4e2440 100644 --- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp +++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp @@ -34,6 +34,7 @@ @@ -5223,7 +5188,7 @@ index fe77f9c4f424a9bbf5cdd6c0721a368767aa374c..0a76877d74a791cd1659c173221ee18c + +static void addBindingToFrame(LocalFrame& frame, const String& name) +{ -+ JSC::JSGlobalObject* globalObject = frame.script().globalObject(mainThreadNormalWorld()); ++ JSC::JSGlobalObject* globalObject = frame.script().globalObject(mainThreadNormalWorldSingleton()); + auto& vm = globalObject->vm(); + JSC::JSLockHolder lock(vm); + globalObject->putDirectNativeFunction(vm, globalObject, JSC::Identifier::fromString(vm, name), 1, bindingCallback, JSC::ImplementationVisibility::Public, JSC::NoIntrinsic, JSC::attributesForStructure(static_cast(JSC::PropertyAttribute::Function))); @@ -5234,7 +5199,7 @@ index fe77f9c4f424a9bbf5cdd6c0721a368767aa374c..0a76877d74a791cd1659c173221ee18c + if (!m_bindingNames.add(name).isNewEntry) + return {}; + -+ m_inspectedPage.forEachLocalFrame([&](LocalFrame& frame) { ++ m_inspectedPage->forEachLocalFrame([&](LocalFrame& frame) { + if (!frame.script().canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript)) + return; + @@ -5283,7 +5248,7 @@ index fe77f9c4f424a9bbf5cdd6c0721a368767aa374c..0a76877d74a791cd1659c173221ee18c @@ -142,9 +224,6 @@ void PageRuntimeAgent::reportExecutionContextCreation() return; - m_inspectedPage.forEachLocalFrame([&](LocalFrame& frame) { + m_inspectedPage->forEachLocalFrame([&](LocalFrame& frame) { - if (!frame.script().canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript)) - return; - @@ -5291,7 +5256,7 @@ index fe77f9c4f424a9bbf5cdd6c0721a368767aa374c..0a76877d74a791cd1659c173221ee18c // Always send the main world first. diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h -index b70ca7636463b9199bcbb21bfea055870ba33b34..25fdc23bfb71985fe1af04bddc360d118f329afe 100644 +index ab49ddd13fc6e1ed967cf501afb0230c1e795159..5ea038212cedc1a7b250588b616225edad6f643c 100644 --- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h +++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h @@ -38,6 +38,7 @@ @@ -5319,7 +5284,7 @@ index b70ca7636463b9199bcbb21bfea055870ba33b34..25fdc23bfb71985fe1af04bddc360d11 @@ -77,6 +81,7 @@ private: InstrumentingAgents& m_instrumentingAgents; - Page& m_inspectedPage; + WeakRef m_inspectedPage; + HashSet m_bindingNames; }; @@ -5347,25 +5312,25 @@ index 8fb27c1045b8073d1487d5b61ccdec23a395bfd1..5008052f587ca4ba90da973c539188de protected: static SameSiteInfo sameSiteInfo(const Document&, IsForDOMCookieAccess = IsForDOMCookieAccess::No); diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp -index 5aac9a91d7049e7ae7e3f98023db100b53db0e8d..dd4b841a49a8087aa2573ffd725a6351380a3724 100644 +index 0ed08d14f259f4c9ca92447222bb7bc5344f335b..8f04196baa58d2c9b627f59d5e2c0126bd2b4e01 100644 --- a/Source/WebCore/loader/DocumentLoader.cpp +++ b/Source/WebCore/loader/DocumentLoader.cpp -@@ -767,8 +767,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc +@@ -774,8 +774,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc if (!didReceiveRedirectResponse) return completionHandler(WTFMove(newRequest)); -+ InspectorInstrumentation::willCheckNavigationPolicy(*m_frame); - auto navigationPolicyCompletionHandler = [this, protectedThis = Ref { *this }, protectedFrame = Ref { *m_frame }, completionHandler = WTFMove(completionHandler)] (ResourceRequest&& request, WeakPtr&&, NavigationPolicyDecision navigationPolicyDecision) mutable { ++ InspectorInstrumentation::willCheckNavigationPolicy(*frame); + auto navigationPolicyCompletionHandler = [this, protectedThis = Ref { *this }, frame, completionHandler = WTFMove(completionHandler)] (ResourceRequest&& request, WeakPtr&&, NavigationPolicyDecision navigationPolicyDecision) mutable { m_waitingForNavigationPolicy = false; -+ InspectorInstrumentation::didCheckNavigationPolicy(protectedFrame.get(), navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad); ++ InspectorInstrumentation::didCheckNavigationPolicy(*frame, navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad); switch (navigationPolicyDecision) { case NavigationPolicyDecision::IgnoreLoad: case NavigationPolicyDecision::LoadWillContinueInAnotherProcess: -@@ -1558,11 +1560,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo +@@ -1574,11 +1576,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo if (auto navigationID = std::exchange(m_navigationID, { })) - m_frame->loader().client().documentLoaderDetached(*navigationID, loadWillContinueInAnotherProcess); + frame->loader().client().documentLoaderDetached(*navigationID, loadWillContinueInAnotherProcess); -- InspectorInstrumentation::loaderDetachedFromFrame(*m_frame, *this); +- InspectorInstrumentation::loaderDetachedFromFrame(*frame, *this); - observeFrame(nullptr); } @@ -5382,23 +5347,23 @@ index 5aac9a91d7049e7ae7e3f98023db100b53db0e8d..dd4b841a49a8087aa2573ffd725a6351 { m_navigationID = navigationID; diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h -index 710b76ba378d0242be7b9fb469203fcd9ec18252..23ebc0f38d5a5a19b23c748149fbbc8aa36059df 100644 +index 3b8896bcc5661929a7f96fb7a01de99b36109dbf..8c3421c5e6a0c36f82c0d7a82f796ca90ba61be7 100644 --- a/Source/WebCore/loader/DocumentLoader.h +++ b/Source/WebCore/loader/DocumentLoader.h -@@ -218,6 +218,8 @@ public: +@@ -224,6 +224,8 @@ public: WEBCORE_EXPORT virtual void detachFromFrame(LoadWillContinueInAnotherProcess); + void replacedByFragmentNavigation(LocalFrame&); + WEBCORE_EXPORT FrameLoader* frameLoader() const; - RefPtr protectedFrameLoader() const; + WEBCORE_EXPORT RefPtr protectedFrameLoader() const; WEBCORE_EXPORT SubresourceLoader* mainResourceLoader() const; diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp -index dee3c2e19c47f3451a2a1f52c101064dcd74c8e1..891f10b1871118cadaec7abc0a61016547b93b9f 100644 +index 0a408b9d3b2c4daa271691041eb1f4fd897d3e93..650180483ace8b8d031d1d022e847409e948a9a4 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp -@@ -1322,6 +1322,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat +@@ -1323,6 +1323,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat } m_client->dispatchDidNavigateWithinPage(); @@ -5406,7 +5371,7 @@ index dee3c2e19c47f3451a2a1f52c101064dcd74c8e1..891f10b1871118cadaec7abc0a610165 document->statePopped(stateObject ? stateObject.releaseNonNull() : SerializedScriptValue::nullValue()); m_client->dispatchDidPopStateWithinPage(); -@@ -1850,6 +1851,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1861,6 +1862,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t const String& httpMethod = loader->request().httpMethod(); if (shouldPerformFragmentNavigation(isFormSubmission, httpMethod, policyChecker().loadType(), newURL)) { @@ -5414,23 +5379,23 @@ index dee3c2e19c47f3451a2a1f52c101064dcd74c8e1..891f10b1871118cadaec7abc0a610165 RefPtr oldDocumentLoader = m_documentLoader; NavigationAction action { frame->protectedDocument().releaseNonNull(), loader->request(), InitiatedByMainFrame::Unknown, loader->isRequestFromClientOrUserInput(), policyChecker().loadType(), isFormSubmission }; -@@ -1887,7 +1889,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1898,7 +1900,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t auto policyDecisionMode = loader->triggeringAction().isFromNavigationAPI() ? PolicyDecisionMode::Synchronous : PolicyDecisionMode::Asynchronous; RELEASE_ASSERT(!isBackForwardLoadType(policyChecker().loadType()) || history().provisionalItem()); + InspectorInstrumentation::willCheckNavigationPolicy(m_frame); - policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTFMove(formState), [this, frame, allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr&& weakFormState, NavigationPolicyDecision navigationPolicyDecision) mutable { + policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTFMove(formState), [this, protectedThis = Ref { *this }, allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr&& weakFormState, NavigationPolicyDecision navigationPolicyDecision) mutable { + InspectorInstrumentation::didCheckNavigationPolicy(m_frame, navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad); continueLoadAfterNavigationPolicy(request, RefPtr { weakFormState.get() }.get(), navigationPolicyDecision, allowNavigationToInvalidURL); completionHandler(); }, policyDecisionMode); -@@ -3178,10 +3182,15 @@ String FrameLoader::userAgent(const URL& url) const +@@ -3210,10 +3214,15 @@ String FrameLoader::userAgent(const URL& url) const String FrameLoader::navigatorPlatform() const { + String platform; + - auto customNavigatorPlatform = m_frame->mainFrame().customNavigatorPlatform(); + auto customNavigatorPlatform = m_frame->protectedMainFrame()->customNavigatorPlatform(); if (!customNavigatorPlatform.isEmpty()) - return customNavigatorPlatform; - return String(); @@ -5442,7 +5407,7 @@ index dee3c2e19c47f3451a2a1f52c101064dcd74c8e1..891f10b1871118cadaec7abc0a610165 } void FrameLoader::dispatchOnloadEvents() -@@ -3655,6 +3664,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill +@@ -3672,6 +3681,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill checkCompleted(); if (frame->page()) checkLoadComplete(loadWillContinueInAnotherProcess); @@ -5451,7 +5416,7 @@ index dee3c2e19c47f3451a2a1f52c101064dcd74c8e1..891f10b1871118cadaec7abc0a610165 } void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, const SecurityOrigin* requesterOrigin, bool shouldContinue, NavigationHistoryBehavior historyHandling) -@@ -4538,9 +4549,6 @@ String FrameLoader::referrer() const +@@ -4566,9 +4577,6 @@ String FrameLoader::referrer() const void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() { @@ -5461,11 +5426,11 @@ index dee3c2e19c47f3451a2a1f52c101064dcd74c8e1..891f10b1871118cadaec7abc0a610165 Vector> worlds; ScriptController::getAllWorlds(worlds); for (auto& world : worlds) -@@ -4550,13 +4558,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() +@@ -4578,13 +4586,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world) { Ref frame = m_frame.get(); -- if (!frame->checkedScript()->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript) || !frame->windowProxy().existingJSWindowProxy(world)) +- if (!frame->checkedScript()->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript) || !frame->protectedWindowProxy()->existingJSWindowProxy(world)) - return; - - m_client->dispatchDidClearWindowObjectInWorld(world); @@ -5482,7 +5447,7 @@ index dee3c2e19c47f3451a2a1f52c101064dcd74c8e1..891f10b1871118cadaec7abc0a610165 InspectorInstrumentation::didClearWindowObjectInWorld(frame, world); } diff --git a/Source/WebCore/loader/LoaderStrategy.h b/Source/WebCore/loader/LoaderStrategy.h -index 91340dc21042f545592b442bc42dbceed06219b2..f3591fe333761b10a25ddaf4a4f8d72170dfe336 100644 +index 1b34dfdd2a8e56beab49591a3517aba02c510ee6..768b895c132b73d935198cbfc2126a227a656b46 100644 --- a/Source/WebCore/loader/LoaderStrategy.h +++ b/Source/WebCore/loader/LoaderStrategy.h @@ -86,6 +86,7 @@ public: @@ -5494,7 +5459,7 @@ index 91340dc21042f545592b442bc42dbceed06219b2..f3591fe333761b10a25ddaf4a4f8d721 virtual bool shouldPerformSecurityChecks() const { return false; } virtual bool havePerformedSecurityChecks(const ResourceResponse&) const { return false; } diff --git a/Source/WebCore/loader/NavigationScheduler.cpp b/Source/WebCore/loader/NavigationScheduler.cpp -index 9c950ef94e1f1257ade5560b2ac2c8f57d15c352..79d0034559c5ec7e1a9ee26452a87a2e73d52ca4 100644 +index 5f70f737d06ced029e3b86a4dc93fd49e8ff4cae..15e6c42cbd4733b526493c3c7dfbea62e70ddb0c 100644 --- a/Source/WebCore/loader/NavigationScheduler.cpp +++ b/Source/WebCore/loader/NavigationScheduler.cpp @@ -806,7 +806,7 @@ void NavigationScheduler::startTimer() @@ -5507,7 +5472,7 @@ index 9c950ef94e1f1257ade5560b2ac2c8f57d15c352..79d0034559c5ec7e1a9ee26452a87a2e } diff --git a/Source/WebCore/loader/ProgressTracker.cpp b/Source/WebCore/loader/ProgressTracker.cpp -index 171c80cd90bdc8cc16c5e037b25f07faef0dec4e..0869f1be1699dd1548a2e4df6612d7fff42e3093 100644 +index a1554c16a0b836bcf87fea0f4e7831d9e0d7baf0..354e4fef6de9c77b7cad96cc428056ae4e2ff067 100644 --- a/Source/WebCore/loader/ProgressTracker.cpp +++ b/Source/WebCore/loader/ProgressTracker.cpp @@ -163,6 +163,8 @@ void ProgressTracker::progressCompleted(LocalFrame& frame) @@ -5529,12 +5494,12 @@ index 171c80cd90bdc8cc16c5e037b25f07faef0dec4e..0869f1be1699dd1548a2e4df6612d7ff } diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -index 2b96086b987dca1f53d68599afa751ba84a083f9..2a44a06c6d5a462f76d39c7100ffc495dd874c81 100644 +index fb3e38627c8c3491f4994a74c6785cc9767fea2c..000de0c2f725d894cbdfa000d79ed48290eba00a 100644 --- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp +++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -@@ -1158,8 +1158,11 @@ ResourceErrorOr> CachedResourceLoader::requ +@@ -1173,8 +1173,11 @@ ResourceErrorOr> CachedResourceLoader::requ - request.updateReferrerPolicy(document() ? document()->referrerPolicy() : ReferrerPolicy::Default); + request.updateReferrerPolicy(document ? document->referrerPolicy() : ReferrerPolicy::Default); - if (InspectorInstrumentation::willIntercept(frame.ptr(), request.resourceRequest())) - request.setCachingPolicy(CachingPolicy::DisallowCaching); @@ -5546,7 +5511,7 @@ index 2b96086b987dca1f53d68599afa751ba84a083f9..2a44a06c6d5a462f76d39c7100ffc495 if (RefPtr documentLoader = m_documentLoader.get()) { bool madeHTTPS { request.resourceRequest().wasSchemeOptimisticallyUpgraded() }; -@@ -1785,8 +1788,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const +@@ -1811,8 +1814,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const ResourceErrorOr> CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequest&& request) { @@ -5556,13 +5521,13 @@ index 2b96086b987dca1f53d68599afa751ba84a083f9..2a44a06c6d5a462f76d39c7100ffc495 + // if (InspectorInstrumentation::willIntercept(protectedFrame().get(), request.resourceRequest())) + // return makeUnexpected(ResourceError { errorDomainWebKitInternal, 0, request.resourceRequest().url(), "Inspector intercept"_s }); - ASSERT(m_document); - if (request.charset().isEmpty() && m_document && (type == CachedResource::Type::Script || type == CachedResource::Type::CSSStyleSheet)) + RefPtr document = m_document.get(); + ASSERT(document); diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h -index 87eea1d9d7205eff67801b59345a0c3aa097eda1..4d17e0234a86f22abf874c6b08386b5410d2f771 100644 +index 51ac3768b20683f26e3a568f390bfe8eba7e1fb5..f6f285ddbe261ccb807e1a57f93f202296f100d2 100644 --- a/Source/WebCore/page/ChromeClient.h +++ b/Source/WebCore/page/ChromeClient.h -@@ -352,7 +352,7 @@ public: +@@ -364,7 +364,7 @@ public: #endif #if ENABLE(ORIENTATION_EVENTS) @@ -5570,12 +5535,12 @@ index 87eea1d9d7205eff67801b59345a0c3aa097eda1..4d17e0234a86f22abf874c6b08386b54 + virtual IntDegrees deviceOrientation() const { return 0; } #endif - #if ENABLE(INPUT_TYPE_COLOR) + virtual RefPtr createColorChooser(ColorChooserClient&, const Color&) = 0; diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp -index 27a216f1047914aef7ebfe50e2273368da439d49..4de0ff57188dbbfe73da33f49a6c6e5dbb178194 100644 +index 47392ed5c5888954373a1916f757ee9ccf1edbbd..8fb82ad84ea589efaf6074e79ca5a0c2a4df14ca 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp -@@ -4454,6 +4454,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr +@@ -4460,6 +4460,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr if (!document) return false; @@ -5588,7 +5553,7 @@ index 27a216f1047914aef7ebfe50e2273368da439d49..4de0ff57188dbbfe73da33f49a6c6e5d dragState().dataTransfer = DataTransfer::createForDrag(*document); auto hasNonDefaultPasteboardData = HasNonDefaultPasteboardData::No; -@@ -5040,6 +5046,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint& +@@ -5054,6 +5060,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint& return result; } @@ -5596,7 +5561,7 @@ index 27a216f1047914aef7ebfe50e2273368da439d49..4de0ff57188dbbfe73da33f49a6c6e5d HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& event) { Ref frame = m_frame.get(); -@@ -5114,7 +5121,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve +@@ -5127,7 +5134,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap. unsigned touchPointTargetKey = point.id() + 1; @@ -5605,7 +5570,7 @@ index 27a216f1047914aef7ebfe50e2273368da439d49..4de0ff57188dbbfe73da33f49a6c6e5d bool pointerCancelled = false; #endif RefPtr touchTarget; -@@ -5161,7 +5168,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve +@@ -5174,7 +5181,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve // we also remove it from the map. touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey); @@ -5614,7 +5579,7 @@ index 27a216f1047914aef7ebfe50e2273368da439d49..4de0ff57188dbbfe73da33f49a6c6e5d HitTestResult result = hitTestResultAtPoint(pagePoint, hitType | HitTestRequest::Type::AllowChildFrameContent); pointerTarget = result.targetElement(); pointerCancelled = (pointerTarget != touchTarget); -@@ -5184,7 +5191,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve +@@ -5197,7 +5204,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve if (!targetFrame) continue; @@ -5623,7 +5588,7 @@ index 27a216f1047914aef7ebfe50e2273368da439d49..4de0ff57188dbbfe73da33f49a6c6e5d // FIXME: WPE currently does not send touch stationary events, so create a naive TouchReleased PlatformTouchPoint // on release if the hit test result changed since the previous TouchPressed or TouchMoved if (pointState == PlatformTouchPoint::TouchReleased && pointerCancelled) { -@@ -5274,6 +5281,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve +@@ -5287,6 +5294,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve return swallowedEvent; } @@ -5632,7 +5597,7 @@ index 27a216f1047914aef7ebfe50e2273368da439d49..4de0ff57188dbbfe73da33f49a6c6e5d #if ENABLE(TOUCH_EVENTS) diff --git a/Source/WebCore/page/FocusController.cpp b/Source/WebCore/page/FocusController.cpp -index 1e2dd0f272078b2b4cbc11957f2458088b4c99c4..e736ffb95a51650c8365a55251ca692b152223ca 100644 +index f4a1e3408623e2b338149d1a129dc8075c764f59..571c4c6e9a873167bbc78b0708ffac44b7a8e641 100644 --- a/Source/WebCore/page/FocusController.cpp +++ b/Source/WebCore/page/FocusController.cpp @@ -586,13 +586,14 @@ bool FocusController::relinquishFocusToChrome(FocusDirection direction) @@ -5653,10 +5618,10 @@ index 1e2dd0f272078b2b4cbc11957f2458088b4c99c4..e736ffb95a51650c8365a55251ca692b } diff --git a/Source/WebCore/page/FrameSnapshotting.cpp b/Source/WebCore/page/FrameSnapshotting.cpp -index 0c099f95827d6f9fe307704ef9d7754fbb3d24f7..f14fd4dba17985d51d824a9b7c32853a33f4008a 100644 +index 3474800864049dcbe6c84746c4216e72a68fa48f..8f5d536921eeb41c77fe689c036dcb77e625e431 100644 --- a/Source/WebCore/page/FrameSnapshotting.cpp +++ b/Source/WebCore/page/FrameSnapshotting.cpp -@@ -111,7 +111,7 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -115,7 +115,7 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& // Other paint behaviors are set by paintContentsForSnapshot. frame.view()->setPaintBehavior(paintBehavior); @@ -5665,21 +5630,16 @@ index 0c099f95827d6f9fe307704ef9d7754fbb3d24f7..f14fd4dba17985d51d824a9b7c32853a if (options.flags.contains(SnapshotFlags::PaintWith3xBaseScale)) scaleFactor = 3; -@@ -129,7 +129,13 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& - if (!buffer) +@@ -134,6 +134,8 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& return nullptr; -+#if !PLATFORM(MAC) -+ buffer->context().scale(scaleFactor); -+#endif -+ buffer->context().translate(-imageRect.location()); + if (coordinateSpace != LocalFrameView::ViewCoordinates) + buffer->context().scale(1 / frame.page()->pageScaleFactor()); if (!clipRects.isEmpty()) { Path clipPath; -@@ -138,7 +144,10 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -142,7 +144,10 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& buffer->context().clipPath(clipPath); } @@ -5692,19 +5652,19 @@ index 0c099f95827d6f9fe307704ef9d7754fbb3d24f7..f14fd4dba17985d51d824a9b7c32853a } diff --git a/Source/WebCore/page/FrameSnapshotting.h b/Source/WebCore/page/FrameSnapshotting.h -index 3ab70c27fef52f5d933cd2338a7c2f96e2debc88..39fc13df5ce132f8d028cd5039c607fe8963ddcf 100644 +index 713cb9c3c59bbad23ef0b821ab27b3d669a7dea8..12077ebf0978b6b52e6af4602767c09d9f3cd9de 100644 --- a/Source/WebCore/page/FrameSnapshotting.h +++ b/Source/WebCore/page/FrameSnapshotting.h -@@ -56,6 +56,7 @@ enum class SnapshotFlags : uint16_t { - Accelerated = 1 << 8, - ExcludeReplacedContent = 1 << 9, - PaintWith3xBaseScale = 1 << 10, -+ OmitDeviceScaleFactor = 1 << 11, +@@ -58,6 +58,7 @@ enum class SnapshotFlags : uint16_t { + PaintWith3xBaseScale = 1 << 10, + ExcludeText = 1 << 11, + FixedAndStickyLayersOnly = 1 << 12, ++ OmitDeviceScaleFactor = 1 << 13, }; struct SnapshotOptions { diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp -index 7cffefe901da03913b16cbe560234ebf97ae7dc6..c6694621e0d39974785fbc5472708551b915f75b 100644 +index adc6185687b6fcee3a49819d0149cde24a4485bf..a33e5db46933c514abce86e3f264de9b7e7c20d9 100644 --- a/Source/WebCore/page/History.cpp +++ b/Source/WebCore/page/History.cpp @@ -32,6 +32,7 @@ @@ -5725,7 +5685,7 @@ index 7cffefe901da03913b16cbe560234ebf97ae7dc6..c6694621e0d39974785fbc5472708551 } diff --git a/Source/WebCore/page/LocalFrame.cpp b/Source/WebCore/page/LocalFrame.cpp -index 4af71417f15e0d93366168e3c22442a67c3dc77c..c002ef7b769b4b7e1d63d7c5ba42bedaef3f4035 100644 +index 54cab8376adfb6dd1e5ca32e170219290e4f0508..d212eece82066ba788d049e9aff212ff3493a6c3 100644 --- a/Source/WebCore/page/LocalFrame.cpp +++ b/Source/WebCore/page/LocalFrame.cpp @@ -41,6 +41,7 @@ @@ -5733,10 +5693,10 @@ index 4af71417f15e0d93366168e3c22442a67c3dc77c..c002ef7b769b4b7e1d63d7c5ba42beda #include "Chrome.h" #include "ChromeClient.h" +#include "ComposedTreeIterator.h" + #include "DiagnosticLoggingClient.h" + #include "DiagnosticLoggingKeys.h" #include "DocumentLoader.h" - #include "DocumentType.h" - #include "Editing.h" -@@ -57,6 +58,7 @@ +@@ -59,6 +60,7 @@ #include "FrameSelection.h" #include "GraphicsContext.h" #include "GraphicsLayer.h" @@ -5744,15 +5704,15 @@ index 4af71417f15e0d93366168e3c22442a67c3dc77c..c002ef7b769b4b7e1d63d7c5ba42beda #include "HTMLAttachmentElement.h" #include "HTMLFormControlElement.h" #include "HTMLFormElement.h" -@@ -79,6 +81,7 @@ +@@ -81,6 +83,7 @@ #include "Logging.h" #include "Navigator.h" #include "NodeList.h" +#include "NodeRenderStyle.h" #include "NodeTraversal.h" #include "Page.h" - #include "ProcessSyncClient.h" -@@ -200,6 +203,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifie + #include "PaymentSession.h" +@@ -205,6 +208,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifie void LocalFrame::init() { @@ -5760,7 +5720,7 @@ index 4af71417f15e0d93366168e3c22442a67c3dc77c..c002ef7b769b4b7e1d63d7c5ba42beda protectedLoader()->init(); } -@@ -421,7 +425,7 @@ void LocalFrame::orientationChanged() +@@ -442,7 +446,7 @@ void LocalFrame::orientationChanged() IntDegrees LocalFrame::orientation() const { if (RefPtr page = this->page()) @@ -5769,9 +5729,9 @@ index 4af71417f15e0d93366168e3c22442a67c3dc77c..c002ef7b769b4b7e1d63d7c5ba42beda return 0; } #endif // ENABLE(ORIENTATION_EVENTS) -@@ -1428,6 +1432,364 @@ void LocalFrame::showResourceMonitoringError() - - #endif +@@ -1549,6 +1553,364 @@ RefPtr LocalFrame::frameDocumentSecurityOrigin() const + return nullptr; + } +#if !PLATFORM(IOS_FAMILY) + @@ -6135,7 +6095,7 @@ index 4af71417f15e0d93366168e3c22442a67c3dc77c..c002ef7b769b4b7e1d63d7c5ba42beda #undef FRAME_RELEASE_LOG_ERROR diff --git a/Source/WebCore/page/LocalFrame.h b/Source/WebCore/page/LocalFrame.h -index 3611617df72251227ebd6a2f8c32bc9ab3da48aa..9b59492c8846cd8e91e58602010eb39b103747b7 100644 +index b46fd5f993569302c23b7302a493a37fd8c1f440..2d9bbfc639deba681ecb7465d87981a787901dac 100644 --- a/Source/WebCore/page/LocalFrame.h +++ b/Source/WebCore/page/LocalFrame.h @@ -28,8 +28,10 @@ @@ -6159,7 +6119,7 @@ index 3611617df72251227ebd6a2f8c32bc9ab3da48aa..9b59492c8846cd8e91e58602010eb39b class LocalFrame final : public Frame { public: -@@ -226,10 +228,6 @@ public: +@@ -227,10 +229,6 @@ public: WEBCORE_EXPORT DataDetectionResultsStorage& dataDetectionResults(); #endif @@ -6170,7 +6130,7 @@ index 3611617df72251227ebd6a2f8c32bc9ab3da48aa..9b59492c8846cd8e91e58602010eb39b WEBCORE_EXPORT Node* deepestNodeAtLocation(const FloatPoint& viewportLocation); WEBCORE_EXPORT Node* nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, SecurityOrigin* = nullptr); WEBCORE_EXPORT Node* nodeRespondingToDoubleClickEvent(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation); -@@ -237,6 +235,10 @@ public: +@@ -238,6 +236,10 @@ public: WEBCORE_EXPORT Node* nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation); WEBCORE_EXPORT Node* approximateNodeAtViewportLocationLegacy(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation); @@ -6181,7 +6141,7 @@ index 3611617df72251227ebd6a2f8c32bc9ab3da48aa..9b59492c8846cd8e91e58602010eb39b WEBCORE_EXPORT NSArray *wordsInCurrentParagraph() const; WEBCORE_EXPORT CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const; -@@ -304,6 +306,7 @@ public: +@@ -305,6 +307,7 @@ public: WEBCORE_EXPORT FloatSize screenSize() const; void setOverrideScreenSize(FloatSize&&); @@ -6189,7 +6149,7 @@ index 3611617df72251227ebd6a2f8c32bc9ab3da48aa..9b59492c8846cd8e91e58602010eb39b void selfOnlyRef(); void selfOnlyDeref(); -@@ -371,7 +374,6 @@ private: +@@ -373,7 +376,6 @@ private: #if ENABLE(DATA_DETECTION) std::unique_ptr m_dataDetectionResults; #endif @@ -6197,7 +6157,7 @@ index 3611617df72251227ebd6a2f8c32bc9ab3da48aa..9b59492c8846cd8e91e58602010eb39b void betterApproximateNode(const IntPoint& testPoint, const NodeQualifier&, Node*& best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect); bool hitTestResultAtViewportLocation(const FloatPoint& viewportLocation, HitTestResult&, IntPoint& center); -@@ -379,6 +381,7 @@ private: +@@ -381,6 +383,7 @@ private: enum class ShouldFindRootEditableElement : bool { No, Yes }; Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, const NodeQualifier&, ShouldApproximate, ShouldFindRootEditableElement = ShouldFindRootEditableElement::Yes); @@ -6206,10 +6166,10 @@ index 3611617df72251227ebd6a2f8c32bc9ab3da48aa..9b59492c8846cd8e91e58602010eb39b ViewportArguments m_viewportArguments; diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp -index 7cd56bf4f7fd05b85e61c26dbf1403e17c041867..0152d48d65ed21173df99ebec3e5abe29f7e6b2e 100644 +index a9369054928a0c9c1f3aef0252c2da3d33d4ce7c..2b151666e718fb037471ab7005c62623c4ee332d 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp -@@ -637,6 +637,45 @@ void Page::setOverrideViewportArguments(const std::optional& +@@ -655,6 +655,45 @@ void Page::setOverrideViewportArguments(const std::optional& localTopDocument->updateViewportArguments(); } @@ -6255,7 +6215,7 @@ index 7cd56bf4f7fd05b85e61c26dbf1403e17c041867..0152d48d65ed21173df99ebec3e5abe2 ScrollingCoordinator* Page::scrollingCoordinator() { if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) { -@@ -4126,6 +4165,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) +@@ -4214,6 +4253,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) appearanceDidChange(); } @@ -6283,11 +6243,11 @@ index 7cd56bf4f7fd05b85e61c26dbf1403e17c041867..0152d48d65ed21173df99ebec3e5abe2 { if (insets == m_fullscreenInsets) diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h -index 7a117d8981605065213f521200776f8373439400..694fffe20f596f8e9c655181ed2b5917949859d7 100644 +index 4e33885a4771eb8260c8cebb14991d780f95be3d..e413dde6db076f587cbf520f17bfa5078320f8cc 100644 --- a/Source/WebCore/page/Page.h +++ b/Source/WebCore/page/Page.h -@@ -364,6 +364,9 @@ public: - const std::optional& overrideViewportArguments() const { return m_overrideViewportArguments; } +@@ -366,6 +366,9 @@ public: + const ViewportArguments* overrideViewportArguments() const { return m_overrideViewportArguments.get(); } WEBCORE_EXPORT void setOverrideViewportArguments(const std::optional&); + WEBCORE_EXPORT FloatSize screenSize(); @@ -6295,8 +6255,8 @@ index 7a117d8981605065213f521200776f8373439400..694fffe20f596f8e9c655181ed2b5917 + static void refreshPlugins(bool reload); WEBCORE_EXPORT PluginData& pluginData(); - void clearPluginData(); -@@ -454,6 +457,10 @@ public: + WEBCORE_EXPORT Ref protectedPluginData(); +@@ -463,6 +466,10 @@ public: #if ENABLE(DRAG_SUPPORT) DragController& dragController() { return m_dragController.get(); } const DragController& dragController() const { return m_dragController.get(); } @@ -6307,7 +6267,7 @@ index 7a117d8981605065213f521200776f8373439400..694fffe20f596f8e9c655181ed2b5917 #endif FocusController& focusController() const { return *m_focusController; } WEBCORE_EXPORT CheckedRef checkedFocusController() const; -@@ -639,6 +646,10 @@ public: +@@ -648,6 +655,10 @@ public: WEBCORE_EXPORT void setUseColorAppearance(bool useDarkAppearance, bool useElevatedUserInterfaceLevel); bool defaultUseDarkAppearance() const { return m_useDarkAppearance; } void setUseDarkAppearanceOverride(std::optional); @@ -6318,7 +6278,7 @@ index 7a117d8981605065213f521200776f8373439400..694fffe20f596f8e9c655181ed2b5917 #if ENABLE(TEXT_AUTOSIZING) float textAutosizingWidth() const { return m_textAutosizingWidth; } -@@ -1094,6 +1105,11 @@ public: +@@ -1116,6 +1127,11 @@ public: WEBCORE_EXPORT void setInteractionRegionsEnabled(bool); #endif @@ -6330,17 +6290,17 @@ index 7a117d8981605065213f521200776f8373439400..694fffe20f596f8e9c655181ed2b5917 #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY) DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); } #endif -@@ -1358,6 +1374,9 @@ private: +@@ -1389,6 +1405,9 @@ private: #if ENABLE(DRAG_SUPPORT) - UniqueRef m_dragController; + const UniqueRef m_dragController; +#if PLATFORM(MAC) + String m_overrideDragPasteboardName; +#endif #endif std::unique_ptr m_focusController; #if ENABLE(CONTEXT_MENUS) -@@ -1435,6 +1454,8 @@ private: +@@ -1467,6 +1486,8 @@ private: bool m_useElevatedUserInterfaceLevel { false }; bool m_useDarkAppearance { false }; std::optional m_useDarkAppearanceOverride; @@ -6349,10 +6309,10 @@ index 7a117d8981605065213f521200776f8373439400..694fffe20f596f8e9c655181ed2b5917 #if ENABLE(TEXT_AUTOSIZING) float m_textAutosizingWidth { 0 }; -@@ -1615,6 +1636,11 @@ private: +@@ -1649,6 +1670,11 @@ private: #endif - std::optional m_overrideViewportArguments; + std::unique_ptr m_overrideViewportArguments; + std::optional m_overrideScreenSize; + +#if ENABLE(ORIENTATION_EVENTS) @@ -6362,7 +6322,7 @@ index 7a117d8981605065213f521200776f8373439400..694fffe20f596f8e9c655181ed2b5917 #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY) RefPtr m_deviceOrientationUpdateProvider; diff --git a/Source/WebCore/page/PageConsoleClient.cpp b/Source/WebCore/page/PageConsoleClient.cpp -index 585c224c08f5a8f8d8e660fa627c264f3386d1ef..26a58fb2fa2a15468a70912f879fe01f4915d0ca 100644 +index ad70f3c37261ab24afc23f7136ae3feb1fcbe154..ecf31d4aaf2080e705e9caec75596104bdfce786 100644 --- a/Source/WebCore/page/PageConsoleClient.cpp +++ b/Source/WebCore/page/PageConsoleClient.cpp @@ -456,4 +456,9 @@ Ref PageConsoleClient::protectedPage() const @@ -6388,10 +6348,10 @@ index 153fc36199f26adbfb61cbef6744ffe31a68b951..cc667e06700013fd5e994467e19536d2 Ref protectedPage() const; diff --git a/Source/WebCore/page/PointerCaptureController.cpp b/Source/WebCore/page/PointerCaptureController.cpp -index 671c31a3af5253634ffd9a55b99aa9462f4e5f9a..faea774b6987408fac036fd19c8f1cefffa917b1 100644 +index ad7f92bf398348be7823247931ce71d5a1c2296e..accabfd4f44199f026ca7bb9ea058bfe3d0ad8f8 100644 --- a/Source/WebCore/page/PointerCaptureController.cpp +++ b/Source/WebCore/page/PointerCaptureController.cpp -@@ -204,7 +204,7 @@ bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(Poi +@@ -205,7 +205,7 @@ bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(Poi return capturingData && capturingData->preventsCompatibilityMouseEvents; } @@ -6400,7 +6360,7 @@ index 671c31a3af5253634ffd9a55b99aa9462f4e5f9a..faea774b6987408fac036fd19c8f1cef static bool hierarchyHasCapturingEventListeners(Element* target, const AtomString& eventName) { for (RefPtr currentNode = target; currentNode; currentNode = currentNode->parentInComposedTree()) { -@@ -554,7 +554,7 @@ void PointerCaptureController::cancelPointer(PointerID pointerId, const IntPoint +@@ -555,7 +555,7 @@ void PointerCaptureController::cancelPointer(PointerID pointerId, const IntPoint capturingData->pendingTargetOverride = nullptr; capturingData->state = CapturingData::State::Cancelled; @@ -6410,7 +6370,7 @@ index 671c31a3af5253634ffd9a55b99aa9462f4e5f9a..faea774b6987408fac036fd19c8f1cef #endif diff --git a/Source/WebCore/page/PointerCaptureController.h b/Source/WebCore/page/PointerCaptureController.h -index 9245baa0c317bb3dfa8a2a1666953d320cb85ee1..55445eb29e095ef4b6d6918728885a267a3b8183 100644 +index b7e3f7cbd54e6ba9419de1bbf70594f3c2771d41..abb08ab5f5a979d7a40af30a27fddfe163db2b12 100644 --- a/Source/WebCore/page/PointerCaptureController.h +++ b/Source/WebCore/page/PointerCaptureController.h @@ -60,7 +60,7 @@ public: @@ -6482,10 +6442,10 @@ index 24ed7c019bea4df52f2883db0e40bdbc2dc74ebd..a788f534d9e0e8124153c7f380b4fdb2 } diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -index a67def78b37298d5efa0b14f337f58471c895169..ddfc9ae5b8391df70b3c6a4be2bcae6ae32b2b7c 100644 +index 4861e2276c172ea347cd31f68029b49df9350fe1..91c6eb5e3031f863d7b2483d9ba8be75c8718ea0 100644 --- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp +++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -@@ -347,6 +347,8 @@ bool ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtoc +@@ -372,6 +372,8 @@ bool ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtoc template typename std::enable_if::value, bool>::type ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, Predicate&& predicate, Args&&... args) const { @@ -6494,7 +6454,7 @@ index a67def78b37298d5efa0b14f337f58471c895169..ddfc9ae5b8391df70b3c6a4be2bcae6a bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; for (auto& policy : m_policies) { if (policy->isReportOnly() != isReportOnly) -@@ -360,6 +362,8 @@ typename std::enable_if bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, ViolatedDirectiveCallback&& callback, Predicate&& predicate, Args&&... args) const { @@ -6503,9 +6463,9 @@ index a67def78b37298d5efa0b14f337f58471c895169..ddfc9ae5b8391df70b3c6a4be2bcae6a bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; bool isAllowed = true; for (auto& policy : m_policies) { -@@ -376,6 +380,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit +@@ -401,6 +405,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit template - bool ContentSecurityPolicy::allPoliciesAllow(ViolatedDirectiveCallback&& callback, Predicate&& predicate, Args&&... args) const + bool ContentSecurityPolicy::allPoliciesAllow(NOESCAPE const ViolatedDirectiveCallback& callback, Predicate&& predicate, Args&&... args) const { + if (InspectorInstrumentation::shouldBypassCSP(m_scriptExecutionContext.get())) + return true; @@ -6599,10 +6559,10 @@ index 0000000000000000000000000000000000000000..803239911006cfb3b03ea911c003f2d2 + +} diff --git a/Source/WebCore/platform/Cairo.cmake b/Source/WebCore/platform/Cairo.cmake -index 29492dd39b08db28aad2bf2439eb3e2bbcf25ad7..2b603cb8440b1b5057c87fcbd6909c61bae4ceb8 100644 +index 96baa501801c5952d4b5b203dff278adb54aaa54..34c498f6050388d30e4190604e7af6f68b33fab9 100644 --- a/Source/WebCore/platform/Cairo.cmake +++ b/Source/WebCore/platform/Cairo.cmake -@@ -14,6 +14,7 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS +@@ -15,6 +15,7 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS platform/graphics/cairo/ImageBufferCairoBackend.h platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h @@ -6644,7 +6604,7 @@ index 2ebb3221cb3818f20abc7b7c3307ea7644f49d49..e0bffb6f5adee0b0a202340f633c2def bool m_disallowFileAccess { false }; }; diff --git a/Source/WebCore/platform/DragImage.cpp b/Source/WebCore/platform/DragImage.cpp -index c359242a7967dab94b8dc3c276a6df5473527145..64b0c6a0bfdf27a0305c25e8b8e0cda637450aa4 100644 +index 2f4e02e783ac512aeb76e0abe7e253b57bfda937..94e0c9335720324a746f300a26b17a28eedf2197 100644 --- a/Source/WebCore/platform/DragImage.cpp +++ b/Source/WebCore/platform/DragImage.cpp @@ -280,7 +280,7 @@ DragImage::~DragImage() @@ -6656,6 +6616,19 @@ index c359242a7967dab94b8dc3c276a6df5473527145..64b0c6a0bfdf27a0305c25e8b8e0cda6 IntSize dragImageSize(DragImageRef) { +diff --git a/Source/WebCore/platform/DragImage.h b/Source/WebCore/platform/DragImage.h +index 77286d8e715825c9c7c0d329480fc0fc497fe561..5ea53eb8b7e53dd5a5950c65a38c1d23bfe46681 100644 +--- a/Source/WebCore/platform/DragImage.h ++++ b/Source/WebCore/platform/DragImage.h +@@ -60,7 +60,7 @@ class Node; + typedef RetainPtr DragImageRef; + #elif PLATFORM(MAC) + typedef RetainPtr DragImageRef; +-#elif PLATFORM(WIN) ++#elif PLATFORM(WIN) && USE(CAIRO) + typedef HBITMAP DragImageRef; + #elif USE(CAIRO) + typedef RefPtr DragImageRef; diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h index 1b1a1147d4948e9281a114281e95d57d3b0ccf27..e21ccb98542cc582ad2489d301cb29c2b0c03f4b 100644 --- a/Source/WebCore/platform/Pasteboard.h @@ -6751,10 +6724,10 @@ index 63ffd6ca32c3baee03db2a9419c4f7e9de45388a..c60c7a8d1f110472117c8c4e969fd05f #endif diff --git a/Source/WebCore/platform/PlatformScreen.cpp b/Source/WebCore/platform/PlatformScreen.cpp -index ae46341ba71c7f6df7c607bd852338cdb7f83fe1..a11db190d86f5e3ec4c7cee6c5b3ea93f2380646 100644 +index ef0abc9a93e878897ffc9d2497a3da0fca5b37b7..abd96c6d1a6c3ab9e0121c1e78f2f75a5f805b32 100644 --- a/Source/WebCore/platform/PlatformScreen.cpp +++ b/Source/WebCore/platform/PlatformScreen.cpp -@@ -73,3 +73,25 @@ const ScreenData* screenData(PlatformDisplayID screenDisplayID) +@@ -85,3 +85,24 @@ OptionSet screenContentsFormatsForTesting() } // namespace WebCore #endif // PLATFORM(COCOA) || PLATFORM(GTK) || (PLATFORM(WPE) && ENABLE(WPE_PLATFORM)) @@ -6762,45 +6735,41 @@ index ae46341ba71c7f6df7c607bd852338cdb7f83fe1..a11db190d86f5e3ec4c7cee6c5b3ea93 +#if ENABLE(TOUCH_EVENTS) +namespace WebCore { + -+static std::optional screenHasTouchDeviceOverride = std::nullopt; ++static std::optional _screenHasTouchDeviceOverride = std::nullopt; ++ +void setScreenHasTouchDeviceOverride(bool value) { -+ screenHasTouchDeviceOverride = value; ++ _screenHasTouchDeviceOverride = value; ++} ++std::optional screenHasTouchDeviceOverride() { ++ return _screenHasTouchDeviceOverride; +} + +bool screenHasTouchDevice() { -+ if (screenHasTouchDeviceOverride) -+ return screenHasTouchDeviceOverride.value(); ++ if (screenHasTouchDeviceOverride()) ++ return screenHasTouchDeviceOverride().value(); + return platformScreenHasTouchDevice(); +} -+bool screenIsTouchPrimaryInputDevice() { -+ if (screenHasTouchDeviceOverride) -+ return screenHasTouchDeviceOverride.value(); -+ return platformScreenIsTouchPrimaryInputDevice(); -+} + +} // namespace WebCore +#endif diff --git a/Source/WebCore/platform/PlatformScreen.h b/Source/WebCore/platform/PlatformScreen.h -index 6ffb85dbfcc01be76ef498f4f7478747912ca7d7..a6e0a3347e36a01b9aeca524747d14ff63f4c529 100644 +index 82a54ac2de2ddf4650e4b48db129fe25f6562264..d144ba15d18d2e892c25988dab27636135353a99 100644 --- a/Source/WebCore/platform/PlatformScreen.h +++ b/Source/WebCore/platform/PlatformScreen.h -@@ -154,12 +154,16 @@ WEBCORE_EXPORT float screenScaleFactor(UIScreen * = nullptr); +@@ -160,10 +160,14 @@ WEBCORE_EXPORT float screenScaleFactor(UIScreen * = nullptr); #endif #if ENABLE(TOUCH_EVENTS) --#if PLATFORM(GTK) || PLATFORM(WPE) +-#if PLATFORM(GTK) +WEBCORE_EXPORT void setScreenHasTouchDeviceOverride(bool); ++WEBCORE_EXPORT std::optional screenHasTouchDeviceOverride(); + WEBCORE_EXPORT bool screenHasTouchDevice(); - WEBCORE_EXPORT bool screenIsTouchPrimaryInputDevice(); -+#if PLATFORM(GTK) || PLATFORM(WPE) ++#if PLATFORM(GTK) +bool platformScreenHasTouchDevice(); -+bool platformScreenIsTouchPrimaryInputDevice(); #else -constexpr bool screenHasTouchDevice() { return true; } --constexpr bool screenIsTouchPrimaryInputDevice() { return true; } +constexpr bool platformScreenHasTouchDevice() { return true; } -+constexpr bool platformScreenIsTouchPrimaryInputDevice() { return true; } #endif #endif @@ -6831,11 +6800,11 @@ index 34715d27b529750fc866db87cd330b5184286771..3eefa218af075f76d98012cdeae7e4b3 // create a PlatformTouchPoint of type TouchCancelled artificially PlatformTouchPoint(unsigned id, State state, IntPoint screenPos, IntPoint pos) diff --git a/Source/WebCore/platform/Skia.cmake b/Source/WebCore/platform/Skia.cmake -index 31460a79014b0a8b21fdfe71759af14ff2da46d7..f2594d701502102fed89d711694b64e05a863aaa 100644 +index c39b57e01190b833be46452c3d964fe243c216d3..6e4af1509037697421cf0c80e2459da0bad79ba8 100644 --- a/Source/WebCore/platform/Skia.cmake +++ b/Source/WebCore/platform/Skia.cmake -@@ -13,6 +13,7 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS - +@@ -14,6 +14,7 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS + platform/graphics/skia/FontCascadeSkiaInlines.h platform/graphics/skia/GraphicsContextSkia.h platform/graphics/skia/ImageBufferSkiaBackend.h + platform/graphics/skia/ImageBufferUtilitiesSkia.h @@ -6976,10 +6945,10 @@ index 3d0ab7eceaf2a6321685bc362eb9b25600fd98fd..2d7e9a399bf2e9dc3f373d5fa3db99fa namespace WebCore { diff --git a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp -index 3f0b75a0702db1ed10334c80e4813094571f588c..ea5ff6b7e7bd4c3b8babebc294d7d7c94fc6afb6 100644 +index 78ea08023ebd5f1b41b06cd843b6dce4ee80dd50..55fed94b774f033b4f75e2dee85dc27cf2e2689e 100644 --- a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp +++ b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp -@@ -169,6 +169,33 @@ static Vector stringIndicesFromClusters(const Vector& clusters, +@@ -168,6 +168,33 @@ static Vector stringIndicesFromClusters(const Vector& clusters, return stringIndices; } @@ -7013,7 +6982,7 @@ index 3f0b75a0702db1ed10334c80e4813094571f588c..ea5ff6b7e7bd4c3b8babebc294d7d7c9 void ComplexTextController::collectComplexTextRunsForCharacters(std::span cp, unsigned stringLocation, const Font* font) { if (!font) { -@@ -198,6 +225,8 @@ void ComplexTextController::collectComplexTextRunsForCharacters(std::span&& ac +@@ -54,72 +62,26 @@ void PlatformPasteboard::performAsDataOwner(DataOwnerType, NOESCAPE Function& types) const { @@ -7807,7 +7767,7 @@ index 64afe805b4418d9e57cc7a2704498a97162b93ab..86c385359352853d2884226f478168f8 - wpe_pasteboard_get_types(m_pasteboard, &pasteboardTypes); - for (auto& typeString : unsafeMakeSpan(pasteboardTypes.strings, pasteboardTypes.length)) { - const auto length = std::min(static_cast(typeString.length), std::numeric_limits::max()); -- types.append(String({ typeString.data, length })); +- types.append(String(unsafeMakeSpan(typeString.data, length))); - } - - wpe_pasteboard_string_vector_free(&pasteboardTypes); @@ -7823,7 +7783,7 @@ index 64afe805b4418d9e57cc7a2704498a97162b93ab..86c385359352853d2884226f478168f8 - return String(); - - const auto length = std::min(static_cast(string.length), std::numeric_limits::max()); -- String returnValue({ string.data, length }); +- String returnValue(unsafeMakeSpan(string.data, length)); - - wpe_pasteboard_string_free(&string); - return returnValue; @@ -7898,10 +7858,10 @@ index 1178c8fb001994bc9e6166376a367d9bc148913c..fcc6534568cad6b42a819a435f84ba2b m_commonHeaders.append(CommonHeader { name, value }); } diff --git a/Source/WebCore/platform/network/NetworkStorageSession.h b/Source/WebCore/platform/network/NetworkStorageSession.h -index f14a54120d571c14bb7a721a377a57131760cfca..832b6710f726d4d8a8ccaa35b2f634a7d5604ccb 100644 +index 18e1d04c6f984c1c3502542399ab1b8eeba1f239..2ec3ed7e28cdf802c017ca705bab3bf769f69a21 100644 --- a/Source/WebCore/platform/network/NetworkStorageSession.h +++ b/Source/WebCore/platform/network/NetworkStorageSession.h -@@ -195,6 +195,7 @@ public: +@@ -202,6 +202,7 @@ public: NetworkingContext* context() const; #endif @@ -7910,7 +7870,7 @@ index f14a54120d571c14bb7a721a377a57131760cfca..832b6710f726d4d8a8ccaa35b2f634a7 WEBCORE_EXPORT HTTPCookieAcceptPolicy cookieAcceptPolicy() const; WEBCORE_EXPORT void setCookie(const Cookie&); diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp -index 774748f1bb47fdefa53b820db5fc891077125de7..4f9220dace7d300d2326692383944f3a560d8cb8 100644 +index bc4d0a6059710f349685b9782079e17f19e289fa..f15d5944bf4259248c1dcc11bd536e5398cb7f03 100644 --- a/Source/WebCore/platform/network/ResourceResponseBase.cpp +++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp @@ -78,6 +78,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional d @@ -7921,7 +7881,7 @@ index 774748f1bb47fdefa53b820db5fc891077125de7..4f9220dace7d300d2326692383944f3a , m_networkLoadMetrics(data && data->networkLoadMetrics ? Box::create(*data->networkLoadMetrics) : Box { }) , m_certificateInfo(data ? data->certificateInfo : std::nullopt) , m_httpStatusCode(data ? data->httpStatusCode : 0) -@@ -901,6 +902,7 @@ std::optional ResourceResponseBase::getResponseData() cons +@@ -904,6 +905,7 @@ std::optional ResourceResponseBase::getResponseData() cons String { m_httpStatusText }, String { m_httpVersion }, HTTPHeaderMap { m_httpHeaderFields }, @@ -7929,7 +7889,7 @@ index 774748f1bb47fdefa53b820db5fc891077125de7..4f9220dace7d300d2326692383944f3a m_networkLoadMetrics ? std::optional(*m_networkLoadMetrics) : std::nullopt, m_source, m_type, -@@ -974,6 +976,11 @@ std::optional Coder Coder httpStatusCode; decoder >> httpStatusCode; if (!httpStatusCode) -@@ -1028,6 +1035,7 @@ std::optional Coder Coder m_networkLoadMetrics; mutable std::optional m_certificateInfo; -@@ -294,7 +299,7 @@ struct ResourceResponseData { +@@ -297,7 +302,7 @@ struct ResourceResponseData { ResourceResponseData() = default; ResourceResponseData(ResourceResponseData&&) = default; ResourceResponseData& operator=(ResourceResponseData&&) = default; -- ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseBaseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, bool isRangeRequested, std::optional certificateInfo) -+ ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, HTTPHeaderMap&& httpRequestHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseBaseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, bool isRangeRequested, std::optional certificateInfo) +- ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, String&& proxyName, bool isRangeRequested, std::optional certificateInfo) ++ ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, HTTPHeaderMap&& httpRequestHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, String&& proxyName, bool isRangeRequested, std::optional certificateInfo) : url(WTFMove(url)) , mimeType(WTFMove(mimeType)) , expectedContentLength(expectedContentLength) -@@ -303,6 +308,7 @@ struct ResourceResponseData { +@@ -306,6 +311,7 @@ struct ResourceResponseData { , httpStatusText(WTFMove(httpStatusText)) , httpVersion(WTFMove(httpVersion)) , httpHeaderFields(WTFMove(httpHeaderFields)) @@ -7982,7 +7942,7 @@ index ec38706084d826ae14aefc6febba137d3e51f1a6..01a916a312e99e405d3098b3df78ee00 , networkLoadMetrics(WTFMove(networkLoadMetrics)) , source(source) , type(type) -@@ -325,6 +331,7 @@ struct ResourceResponseData { +@@ -329,6 +335,7 @@ struct ResourceResponseData { String httpStatusText; String httpVersion; HTTPHeaderMap httpHeaderFields; @@ -7991,10 +7951,10 @@ index ec38706084d826ae14aefc6febba137d3e51f1a6..01a916a312e99e405d3098b3df78ee00 ResourceResponseBase::Source source; ResourceResponseBase::Type type; diff --git a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm -index 52c078b497e11adc41e2e31a09ebf2f052b6f272..051b5fe3f42eb72ff478693b1d9a74b251332840 100644 +index d938386a2a7bb9a338b781706434fbee753a5ad4..96b8e6d3b7fc65fb6f04162e4975467b3cbd3cf4 100644 --- a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm +++ b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm -@@ -536,6 +536,22 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSi +@@ -552,6 +552,22 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSi return false; } @@ -8004,14 +7964,14 @@ index 52c078b497e11adc41e2e31a09ebf2f052b6f272..051b5fe3f42eb72ff478693b1d9a74b2 + size_t count = cookieValues.size(); + auto* cookies = [NSMutableArray arrayWithCapacity:count]; + for (const auto& cookieValue : cookieValues) { -+ NSString* cookieString = (NSString *)cookieValue; ++ NSString* cookieString = cookieValue.createNSString().autorelease(); + NSString* cookieKey = @"Set-Cookie"; + NSDictionary* headers = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObject:cookieString] forKeys:[NSArray arrayWithObject:cookieKey]]; -+ NSArray* parsedCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:headers forURL:(NSURL *)url]; ++ NSArray* parsedCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:headers forURL:url.createNSURL().get()]; + [cookies addObject:parsedCookies[0]]; + } -+ NSURL *cookieURL = url; -+ setHTTPCookiesForURL(cookieStorage().get(), cookies, cookieURL, firstParty, sameSiteInfo); ++ NSURL *cookieURL = url.createNSURL().get(); ++ setHTTPCookiesForURL(cookieStorage().get(), cookies, cookieURL, firstParty.createNSURL().get(), sameSiteInfo); +} + static NSHTTPCookieAcceptPolicy httpCookieAcceptPolicy(CFHTTPCookieStorageRef cookieStorage) @@ -8111,10 +8071,10 @@ index 2d7a77d759aaea9a541030af5e6015a8ed9c97a4..a0c947d325c984045dbbdf2580d19a32 WEBCORE_EXPORT void send(CurlStreamID, UniqueArray&&, size_t); diff --git a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp -index 7567442a6bdccbe755b2cf5e3fa42265a065a9e1..4886cf0b5a6bc0b8a270d763ad481f5bc6f0d1c2 100644 +index 96289d8ae2e4feb60a91fab3f5cf1fc27b9e7c87..8c0b62c44a18571d1f3ea1ed81d59a0aae28d3f1 100644 --- a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp +++ b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp -@@ -135,6 +135,12 @@ void NetworkStorageSession::setCookieAcceptPolicy(CookieAcceptPolicy policy) con +@@ -136,6 +136,12 @@ void NetworkStorageSession::setCookieAcceptPolicy(CookieAcceptPolicy policy) con cookieDatabase().setAcceptPolicy(policy); } @@ -8128,11 +8088,11 @@ index 7567442a6bdccbe755b2cf5e3fa42265a065a9e1..4886cf0b5a6bc0b8a270d763ad481f5b { switch (cookieDatabase().acceptPolicy()) { diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp -index 98285739dff7050e61611a23075599dcbe259d6a..b05dd64c53accd98dbb9e9e467aae3e07de7b974 100644 +index 8750fc6d3ad81889da3d60685fc9a107bf4760c1..7a35cf7516b837084fafbfceae84147ab17bd161 100644 --- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp +++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp -@@ -424,6 +424,26 @@ void NetworkStorageSession::replaceCookies(const Vector& cookies) - g_signal_emit(jar, signalId, 0); +@@ -551,6 +551,26 @@ void NetworkStorageSession::replaceCookies(const Vector& cookies) + g_signal_emit(jar, signalId, 0, nullptr, nullptr); } +void NetworkStorageSession::setCookiesFromResponse(const URL& firstParty, const SameSiteInfo&, const URL& url, const String& setCookieValue) @@ -8159,7 +8119,7 @@ index 98285739dff7050e61611a23075599dcbe259d6a..b05dd64c53accd98dbb9e9e467aae3e0 { GUniquePtr targetCookie(cookie.toSoupCookie()); diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp -index 9af57876ef4adddcf713392a3946efc30e75d3b7..956859daed43591ee52b20b2dfa6d381b812fbda 100644 +index bbcc12d58f7b5df3462c93617f6ef19eef403cf2..b255b05da89248a99ff11965ceae840ef45b9fab 100644 --- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp +++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp @@ -40,6 +40,7 @@ @@ -8222,6 +8182,69 @@ index 0379437d84807e4a8d3846afac5ec8a70e743e70..5b0461bf12535d4900ffaddc2a878262 { if (!m_dragDataMap.isEmpty() || !m_platformDragData) return m_dragDataMap; +diff --git a/Source/WebCore/platform/win/DragImageWin.cpp b/Source/WebCore/platform/win/DragImageWin.cpp +index dd24e15115aeff41f0f4452a9cac292d75bc0d5d..8df467c008bdb3de59d301b14c1c20b8bb0b6a41 100644 +--- a/Source/WebCore/platform/win/DragImageWin.cpp ++++ b/Source/WebCore/platform/win/DragImageWin.cpp +@@ -62,16 +62,22 @@ IntSize dragImageSize(DragImageRef image) + { + if (!image) + return IntSize(); +- BITMAP b; +- GetObject(image, sizeof(BITMAP), &b); +- return IntSize(b.bmWidth, b.bmHeight); ++ return { image->width(), image->height() }; + } + ++#if USE(CAIRO) + void deleteDragImage(DragImageRef image) + { + if (image) + ::DeleteObject(image); + } ++#else ++void deleteDragImage(DragImageRef) ++{ ++ // Since this is a RefPtr, there's nothing additional we need to do to ++ // delete it. It will be released when it falls out of scope. ++} ++#endif + + DragImageRef dissolveDragImageToFraction(DragImageRef image, float) + { +@@ -79,8 +85,9 @@ DragImageRef dissolveDragImageToFraction(DragImageRef image, float) + return image; + } + +-DragImageRef createDragImageIconForCachedImageFilename(const String& filename) ++DragImageRef createDragImageIconForCachedImageFilename(const String&) + { ++#if USE(CAIRO) + SHFILEINFO shfi { }; + auto fname = filename.wideCharacters(); + if (FAILED(SHGetFileInfo(fname.data(), FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES))) +@@ -96,6 +103,9 @@ DragImageRef createDragImageIconForCachedImageFilename(const String& filename) + DeleteObject(iconInfo.hbmMask); + + return iconInfo.hbmColor; ++#else ++ return nullptr; ++#endif + } + + #if USE(CAIRO) +@@ -221,9 +231,9 @@ DragImageRef createDragImageForColor(const Color&, const FloatRect&, float, Path + } + + #if USE(SKIA) +-DragImageRef createDragImageFromImage(Image*, ImageOrientation, GraphicsClient*, float) ++DragImageRef createDragImageFromImage(Image* image, ImageOrientation, GraphicsClient*, float) + { +- return nullptr; ++ return image->currentNativeImage()->platformImage(); + } + + DragImageRef scaleDragImage(DragImageRef, FloatSize) diff --git a/Source/WebCore/platform/win/KeyEventWin.cpp b/Source/WebCore/platform/win/KeyEventWin.cpp index d450bf9d0fd1f0bf8f28db483ac9d3d60fa9d114..72a59403a0b5493aea4a8e28eb15eac24b652b09 100644 --- a/Source/WebCore/platform/win/KeyEventWin.cpp @@ -8398,7 +8421,7 @@ index 0000000000000000000000000000000000000000..fbd32d390129129fd5b213f7f9c3e96b +} diff --git a/Source/WebCore/platform/wpe/DragImageWPE.cpp b/Source/WebCore/platform/wpe/DragImageWPE.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..a2454253889d4c7d5129c2d7895c089f54bc2e3d +index 0000000000000000000000000000000000000000..5a20bfaacd42d27bee5f843483d6b60d9dee9dbd --- /dev/null +++ b/Source/WebCore/platform/wpe/DragImageWPE.cpp @@ -0,0 +1,73 @@ @@ -8451,7 +8474,7 @@ index 0000000000000000000000000000000000000000..a2454253889d4c7d5129c2d7895c089f + return image; +} + -+DragImageRef createDragImageFromImage(Image* image, ImageOrientation) ++DragImageRef createDragImageFromImage(Image* image, ImageOrientation, GraphicsClient*, float) +{ + return image->currentNativeImage()->platformImage(); +} @@ -8475,25 +8498,6 @@ index 0000000000000000000000000000000000000000..a2454253889d4c7d5129c2d7895c089f +} + +} -diff --git a/Source/WebCore/platform/wpe/PlatformScreenWPE.cpp b/Source/WebCore/platform/wpe/PlatformScreenWPE.cpp -index 77bdff686770e56f5445fa12216c6bff93bb5cfb..e16583ea6298864df9c8b82cb0686b2afb18ce95 100644 ---- a/Source/WebCore/platform/wpe/PlatformScreenWPE.cpp -+++ b/Source/WebCore/platform/wpe/PlatformScreenWPE.cpp -@@ -151,12 +151,12 @@ bool screenSupportsExtendedColor(Widget*) - } - - #if ENABLE(TOUCH_EVENTS) --bool screenHasTouchDevice() -+bool platformScreenHasTouchDevice() - { - return true; - } - --bool screenIsTouchPrimaryInputDevice() -+bool platformScreenIsTouchPrimaryInputDevice() - { - return true; - } diff --git a/Source/WebCore/platform/wpe/SelectionData.cpp b/Source/WebCore/platform/wpe/SelectionData.cpp new file mode 100644 index 0000000000000000000000000000000000000000..947bfe6576780038ecb87ea9bda116adb19dfd71 @@ -8743,10 +8747,10 @@ index 0000000000000000000000000000000000000000..a76b583a1e65cd6999fab4784c22dd9c + +} // namespace WebCore diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp -index 9d3de8e13762a270bc60d4201e8f35b62c908cbd..0e3eb8955cb8c751a600a0cce7690504899cbea8 100644 +index 015f1d0d829c0a1ef2c0cc137eb4967fa7bfe67a..25a6d41d2e08d50004749298f9555024a895b61c 100644 --- a/Source/WebCore/rendering/RenderTextControl.cpp +++ b/Source/WebCore/rendering/RenderTextControl.cpp -@@ -223,13 +223,13 @@ void RenderTextControl::layoutExcludedChildren(bool relayoutChildren) +@@ -228,13 +228,13 @@ void RenderTextControl::layoutExcludedChildren(RelayoutChildren relayoutChildren } } @@ -8762,12 +8766,12 @@ index 9d3de8e13762a270bc60d4201e8f35b62c908cbd..0e3eb8955cb8c751a600a0cce7690504 { auto innerText = innerTextElement(); diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h -index 8ff886aec15c960e06408f638892579a6c3f4879..a5f8889818e456504c82a99994dcf4b21774b99d 100644 +index faf34133df0bf205072145ffbab8163b93d3c874..fdc4554952e0e33f8827bb3d00c827dec966ad15 100644 --- a/Source/WebCore/rendering/RenderTextControl.h +++ b/Source/WebCore/rendering/RenderTextControl.h -@@ -37,9 +37,9 @@ public: - +@@ -38,9 +38,9 @@ public: WEBCORE_EXPORT HTMLTextFormControlElement& textFormControlElement() const; + WEBCORE_EXPORT Ref protectedTextFormControlElement() const; -#if PLATFORM(IOS_FAMILY) bool canScroll() const; @@ -8800,10 +8804,10 @@ index db95c8273bd0deb3f903a45d02fc07bbbd8ab305..bf88228b4c838b90d11d430cc9429d51 WorkerOrWorkletGlobalScope& m_globalScope; }; diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp -index fe493f26a5a49b6ec9404105e8012291e3c37aab..9dbd5fcbac6d48fe92e5f7d9174192517e31a015 100644 +index eb1ee28ea9a6bee86f68b4d0d4e16ae6dea32772..1968c70c80c1529ada0e76f1a5f45981924fa629 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp -@@ -96,6 +96,8 @@ +@@ -97,6 +97,8 @@ #if PLATFORM(COCOA) #include @@ -8812,7 +8816,7 @@ index fe493f26a5a49b6ec9404105e8012291e3c37aab..9dbd5fcbac6d48fe92e5f7d917419251 #endif #if ENABLE(APPLE_PAY_REMOTE_UI) -@@ -1148,6 +1150,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) +@@ -1231,6 +1233,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) storageSession->clearPageSpecificDataForResourceLoadStatistics(pageID); } @@ -8828,10 +8832,10 @@ index fe493f26a5a49b6ec9404105e8012291e3c37aab..9dbd5fcbac6d48fe92e5f7d917419251 { if (auto* storageSession = protectedNetworkProcess()->storageSession(m_sessionID)) diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h -index 7d2ad64026a920e5007965c2096d202ad611efa5..db7aa5bc9aa34ba43e5254b72d2d2bcf4eafeacc 100644 +index 3f1539237c6c8d1cd832cd3ece2ba20939e01a41..1259c36e38d46c0ebfdf98be20f217433f831ca5 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h -@@ -380,6 +380,8 @@ private: +@@ -388,6 +388,8 @@ private: void clearPageSpecificData(WebCore::PageIdentifier); @@ -8841,7 +8845,7 @@ index 7d2ad64026a920e5007965c2096d202ad611efa5..db7aa5bc9aa34ba43e5254b72d2d2bcf void logUserInteraction(RegistrableDomain&&); diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in -index 580195a8f0e1fc690ecab8903bca002496a8822f..ce9ec7f6f668d46f6a14889f081dfc485a56e215 100644 +index b10706aafd037a2b92a68b0d2c474ec2e42cd2fe..f80792c02d880dbd61849233fdbc348f1eeffb33 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in @@ -80,6 +80,8 @@ messages -> NetworkConnectionToWebProcess WantsDispatchMessage { @@ -8854,10 +8858,10 @@ index 580195a8f0e1fc690ecab8903bca002496a8822f..ce9ec7f6f668d46f6a14889f081dfc48 LogUserInteraction(WebCore::RegistrableDomain domain) ResourceLoadStatisticsUpdated(Vector statistics) -> () diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp -index d0fd9b84a4bd5ba0e81fde94d5f2200cf664d278..3696082965d7b51ac5404f4411ed9d2fb1b30a7e 100644 +index be181729d818871958a51ad54b95424be796cbd1..759be2137d58cfbc088e1e459fdfca5d329c3ff4 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp +++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp -@@ -645,6 +645,12 @@ void NetworkProcess::registrableDomainsExemptFromWebsiteDataDeletion(PAL::Sessio +@@ -670,6 +670,12 @@ void NetworkProcess::registrableDomainsExemptFromWebsiteDataDeletion(PAL::Sessio completionHandler({ }); } @@ -8871,7 +8875,7 @@ index d0fd9b84a4bd5ba0e81fde94d5f2200cf664d278..3696082965d7b51ac5404f4411ed9d2f { if (auto* session = networkSession(sessionID)) { diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h -index 2f73648e4ddbf622b5ed52e25cbd6835fa706048..d0f354db52d964f75cf20767d29549fa0bdfbff9 100644 +index aad6d1ad7d9735935f7d55d56ae8f3e8d0c5b852..a7421b51a4e8bbf9c695d2aca3ec6cfc98d14bf5 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.h +++ b/Source/WebKit/NetworkProcess/NetworkProcess.h @@ -84,6 +84,7 @@ class SessionID; @@ -8882,7 +8886,7 @@ index 2f73648e4ddbf622b5ed52e25cbd6835fa706048..d0f354db52d964f75cf20767d29549fa class CurlProxySettings; class ProtectionSpace; class NetworkStorageSession; -@@ -227,6 +228,9 @@ public: +@@ -235,6 +236,9 @@ public: void registrableDomainsWithLastAccessedTime(PAL::SessionID, CompletionHandler>)>&&); void registrableDomainsExemptFromWebsiteDataDeletion(PAL::SessionID, CompletionHandler)>&&); @@ -8893,10 +8897,10 @@ index 2f73648e4ddbf622b5ed52e25cbd6835fa706048..d0f354db52d964f75cf20767d29549fa void clearUserInteraction(PAL::SessionID, RegistrableDomain&&, CompletionHandler&&); void deleteAndRestrictWebsiteDataForRegistrableDomains(PAL::SessionID, OptionSet, RegistrableDomainsToDeleteOrRestrictWebsiteDataFor&&, CompletionHandler&&)>&&); diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in -index ef4f18038deef8bbed0d24507048050a19e6351a..b2961f2ac65cc44505e7ea6d191ab3b5ec8165db 100644 +index 64312176007bfc3c06ae2d624dbbabc4007e0fdf..8dfd79c77f27f13aa23927c9b2c6610cd40885d5 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in +++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in -@@ -86,6 +86,8 @@ messages -> NetworkProcess : AuxiliaryProcess WantsAsyncDispatchMessage { +@@ -91,6 +91,8 @@ messages -> NetworkProcess : AuxiliaryProcess WantsAsyncDispatchMessage { SetInspectionForServiceWorkersAllowed(PAL::SessionID sessionID, bool inspectable) @@ -8906,10 +8910,10 @@ index ef4f18038deef8bbed0d24507048050a19e6351a..b2961f2ac65cc44505e7ea6d191ab3b5 ClearUserInteraction(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain) -> () DumpResourceLoadStatistics(PAL::SessionID sessionID) -> (String dumpedStatistics) diff --git a/Source/WebKit/NetworkProcess/NetworkSession.h b/Source/WebKit/NetworkProcess/NetworkSession.h -index 53acfd4c7c13b7595a7be3f13f5edac01f82b891..319386e3c6a1f760d548385859c2f0410f2727a5 100644 +index 2a48fae7bd8cce5ee360df66e5bc49cb4d2b9c54..5fdec3ff3fb706a426717c95831ece36c43543ce 100644 --- a/Source/WebKit/NetworkProcess/NetworkSession.h +++ b/Source/WebKit/NetworkProcess/NetworkSession.h -@@ -205,6 +205,9 @@ public: +@@ -207,6 +207,9 @@ public: void lowMemoryHandler(WTF::Critical); @@ -8919,7 +8923,7 @@ index 53acfd4c7c13b7595a7be3f13f5edac01f82b891..319386e3c6a1f760d548385859c2f041 void removeSoftUpdateLoader(ServiceWorkerSoftUpdateLoader* loader) { m_softUpdateLoaders.remove(loader); } void addNavigationPreloaderTask(ServiceWorkerFetchTask&); ServiceWorkerFetchTask* navigationPreloaderTaskFromFetchIdentifier(WebCore::FetchIdentifier); -@@ -328,6 +331,7 @@ protected: +@@ -345,6 +348,7 @@ protected: bool m_privateClickMeasurementDebugModeEnabled { false }; std::optional m_ephemeralMeasurement; bool m_isRunningEphemeralMeasurementTest { false }; @@ -8928,22 +8932,23 @@ index 53acfd4c7c13b7595a7be3f13f5edac01f82b891..319386e3c6a1f760d548385859c2f041 HashSet> m_keptAliveLoads; diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -index 2a7bf5142aea077a0686c66d6fc0b2430be18c98..2640236a871e5a6455b32716d84711098802813b 100644 +index 846603d498fa5f0cfe8829340ed810558df54b41..6edf57edc6d0c2d7ba79319ddb2765b856a8cddc 100644 --- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm +++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -@@ -773,6 +773,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didRece +@@ -805,6 +805,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didRece if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { sessionCocoa->setClientAuditToken(challenge); + if (sessionCocoa->ignoreCertificateErrors()) + return completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); - NSURLSessionTaskTransactionMetrics *metrics = task._incompleteTaskMetrics.transactionMetrics.lastObject; - auto tlsVersion = (tls_protocol_version_t)metrics.negotiatedTLSProtocolVersion.unsignedShortValue; -@@ -1124,6 +1126,13 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data - - resourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics, networkDataTask->networkLoadMetrics())); + negotiatedLegacyTLS = checkForLegacyTLS(task._incompleteTaskMetrics.transactionMetrics.lastObject); + if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes && task._preconnect) +@@ -1148,6 +1150,14 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data + resourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics.get(), networkDataTask->networkLoadMetrics())); + resourceResponse.setProxyName(WTFMove(proxyName)); ++ + __block WebCore::HTTPHeaderMap requestHeaders; + NSURLSessionTaskTransactionMetrics *m = dataTask._incompleteTaskMetrics.transactionMetrics.lastObject; + [m.request.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(NSString *name, NSString *value, BOOL *) { @@ -8953,9 +8958,9 @@ index 2a7bf5142aea077a0686c66d6fc0b2430be18c98..2640236a871e5a6455b32716d8471109 + networkDataTask->didReceiveResponse(WTFMove(resourceResponse), negotiatedLegacyTLS, privateRelayed, [completionHandler = makeBlockPtr(completionHandler), taskIdentifier](WebCore::PolicyAction policyAction) { #if !LOG_DISABLED - LOG(NetworkSession, "%llu didReceiveResponse completionHandler (%d)", taskIdentifier, policyAction); + LOG(NetworkSession, "%llu didReceiveResponse completionHandler (%s)", taskIdentifier, toString(policyAction).characters()); diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp -index 1e1c7897c858ddd5a1c69a4d5942102f5649ef14..1d2a4835905018a39bc33488e9bc1450cb728179 100644 +index 1aa46419c05ba688a2ca79bfa48f4c7a9164375e..9b90036b16c587cd509bb35f067c9a9fddd8cfc2 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp +++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp @@ -80,10 +80,18 @@ NetworkDataTaskCurl::NetworkDataTaskCurl(NetworkSession& session, NetworkDataTas @@ -8989,7 +8994,7 @@ index 1e1c7897c858ddd5a1c69a4d5942102f5649ef14..1d2a4835905018a39bc33488e9bc1450 handleCookieHeaders(request.resourceRequest(), receivedResponse); -@@ -294,6 +303,36 @@ bool NetworkDataTaskCurl::shouldRedirectAsGET(const ResourceRequest& request, bo +@@ -293,6 +302,35 @@ bool NetworkDataTaskCurl::shouldRedirectAsGET(const ResourceRequest& request, bo return false; } @@ -9011,22 +9016,21 @@ index 1e1c7897c858ddd5a1c69a4d5942102f5649ef14..1d2a4835905018a39bc33488e9bc1450 + return; + } + -+ if (-1 == FileSystem::writeToFile(m_downloadDestinationFile, std::span(m_dataURLResult.value().data.data(), m_dataURLResult.value().data.size()))) { ++ if (!m_downloadDestinationFile.write(std::span(m_dataURLResult.value().data.data(), m_dataURLResult.value().data.size()))) { + deleteDownloadFile(); + download.didFail(ResourceError(CURLE_WRITE_ERROR, m_response.url()), std::span()); + return; + } + + download.didReceiveData(m_dataURLResult.value().data.size(), 0, 0); -+ FileSystem::closeFile(m_downloadDestinationFile); -+ m_downloadDestinationFile = FileSystem::invalidPlatformFileHandle; ++ m_downloadDestinationFile = { }; + download.didFinish(); +} + void NetworkDataTaskCurl::invokeDidReceiveResponse() { didReceiveResponse(ResourceResponse(m_response), NegotiatedLegacyTLS::No, PrivateRelayed::No, std::nullopt, [this, protectedThis = Ref { *this }](PolicyAction policyAction) { -@@ -323,6 +362,8 @@ void NetworkDataTaskCurl::invokeDidReceiveResponse() +@@ -322,6 +360,8 @@ void NetworkDataTaskCurl::invokeDidReceiveResponse() download->didCreateDestination(m_pendingDownloadLocation); if (m_curlRequest) m_curlRequest->completeDidReceiveResponse(); @@ -9035,7 +9039,7 @@ index 1e1c7897c858ddd5a1c69a4d5942102f5649ef14..1d2a4835905018a39bc33488e9bc1450 break; } default: -@@ -411,6 +452,8 @@ void NetworkDataTaskCurl::willPerformHTTPRedirection() +@@ -410,6 +450,8 @@ void NetworkDataTaskCurl::willPerformHTTPRedirection() m_curlRequest->setUserPass(m_initialCredential.user(), m_initialCredential.password()); m_curlRequest->setAuthenticationScheme(ProtectionSpace::AuthenticationScheme::HTTPBasic); } @@ -9045,7 +9049,7 @@ index 1e1c7897c858ddd5a1c69a4d5942102f5649ef14..1d2a4835905018a39bc33488e9bc1450 if (m_state != State::Suspended) { m_state = State::Suspended; diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h -index 0f7c70e405d00416c9e5e58f9c56423a4cf3947c..b730722c5bdb3949bedc1a578089bb3ea2d4af67 100644 +index 7babe41b8351f8adbffcf194310d4df41637b192..2d6f0055cfcb0ec8a4629ce41b19cecd17ab4fdc 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h +++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h @@ -28,6 +28,7 @@ @@ -9082,16 +9086,16 @@ index 0f7c70e405d00416c9e5e58f9c56423a4cf3947c..b730722c5bdb3949bedc1a578089bb3e + + std::optional m_dataURLResult; + - FileSystem::PlatformFileHandle m_downloadDestinationFile { FileSystem::invalidPlatformFileHandle }; + FileSystem::FileHandle m_downloadDestinationFile; bool m_blockingCookies { false }; diff --git a/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp -index 49685c872d0fb042a401612201a7448af6f1ac8b..e98efc1c2e7e5a85980c8d39afcb600a1f6c5d23 100644 +index a6f84189b7163563874a148c9bf1c8afb42bb446..8b5db0010c4be8e24efd121e4ccba0568e6f4bed 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp +++ b/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp @@ -68,7 +68,7 @@ void NetworkSessionCurl::clearAlternativeServices(WallTime) - std::unique_ptr NetworkSessionCurl::createWebSocketTask(WebPageProxyIdentifier webPageProxyID, std::optional, std::optional, NetworkSocketChannel& channel, const WebCore::ResourceRequest& request, const String& protocol, const WebCore::ClientOrigin& clientOrigin, bool, bool, OptionSet, ShouldRelaxThirdPartyCookieBlocking, StoredCredentialsPolicy) + std::unique_ptr NetworkSessionCurl::createWebSocketTask(WebPageProxyIdentifier webPageProxyID, std::optional, std::optional, NetworkSocketChannel& channel, const WebCore::ResourceRequest& request, const String& protocol, const WebCore::ClientOrigin& clientOrigin, bool, bool, OptionSet, StoredCredentialsPolicy) { - return makeUnique(channel, webPageProxyID, request, protocol, clientOrigin); + return makeUnique(channel, webPageProxyID, request, protocol, ignoreCertificateErrors(), clientOrigin); @@ -9135,7 +9139,7 @@ index 1853b717d021c5ec5c79abb61bec684460646a7a..625b921890a75c521bdf6fc3a5fd4bf3 didFail(WTFMove(errorReason)); }); diff --git a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h -index 70c88bf553159e26e63c6dc735ae2bb4358df698..967b2c849206784efe3b0d9a2364cd3e7600b1f9 100644 +index 0ef9f38c7662f922b7a8e4da81613799b0fddc68..45704b96df02cead2f21fd948455502793a1508c 100644 --- a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h +++ b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h @@ -55,7 +55,7 @@ class WebSocketTask : public CanMakeWeakPtr, public CanMakeChecke @@ -9156,7 +9160,7 @@ index 70c88bf553159e26e63c6dc735ae2bb4358df698..967b2c849206784efe3b0d9a2364cd3e WebCore::CurlStreamScheduler& m_scheduler; diff --git a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in -index a6d86f1388e8cae7c3939d1ecffb2c46eb5054c5..9e11224335211908fe8bf14edc4c22e9e4934582 100644 +index 9ecb3e28299aa54a8ac309e74afb6944833e8eae..383bdd7533fad2fd58b4d0cceee4e68962aa8455 100644 --- a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in +++ b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in @@ -451,9 +451,11 @@ @@ -9175,7 +9179,7 @@ index a6d86f1388e8cae7c3939d1ecffb2c46eb5054c5..9e11224335211908fe8bf14edc4c22e9 ;; Except deny access to new-style iOS Keychain folders which are UUIDs. (deny file-read* file-write* diff --git a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp -index d781f70f2c31ff5631773684893a40d738bd9856..6270cfd7707a190f123b9750a31162fbc64c3086 100644 +index 4fd4b7c714f0c6364f7c239b9e25af3428ffd1fd..56d6e55721c077a34dee36ea7043395331d453bb 100644 --- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp +++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp @@ -461,6 +461,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr&& inputStream) @@ -9197,7 +9201,7 @@ index d781f70f2c31ff5631773684893a40d738bd9856..6270cfd7707a190f123b9750a31162fb if (!error) return true; diff --git a/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp -index 599c405513ee38c74da12c01dafc23c6ece86aa0..5af7dc9306d211a5cff1736013716b08933e2278 100644 +index c0c9bf6f4f1879efb8dfdd24951ef67ae373fa2f..48aeb8ac1324a58dc59bdb125c8ec4e317e24fd2 100644 --- a/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp +++ b/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp @@ -100,6 +100,11 @@ void NetworkSessionSoup::clearCredentials(WallTime) @@ -9236,10 +9240,10 @@ index 599c405513ee38c74da12c01dafc23c6ece86aa0..5af7dc9306d211a5cff1736013716b08 } diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake -index 945c0ce1def2b3ed580e2f497b2347a8b2cebbac..722b30d805b005229b38fe4ef2c53c06b8fb2f24 100644 +index 2990740be0d39d16ebbc625639c57200cdd700a8..78d25fe109ac96343d4aeedbc1e6b0087b34299a 100644 --- a/Source/WebKit/PlatformGTK.cmake +++ b/Source/WebKit/PlatformGTK.cmake -@@ -328,6 +328,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES +@@ -321,6 +321,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES ${GSTREAMER_PBUTILS_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${LIBSOUP_INCLUDE_DIRS} @@ -9249,7 +9253,7 @@ index 945c0ce1def2b3ed580e2f497b2347a8b2cebbac..722b30d805b005229b38fe4ef2c53c06 ) list(APPEND WebKit_INTERFACE_INCLUDE_DIRECTORIES -@@ -364,6 +367,9 @@ if (USE_LIBWEBRTC) +@@ -360,6 +363,9 @@ if (USE_LIBWEBRTC) list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/libwebrtc/Source/" "${THIRDPARTY_DIR}/libwebrtc/Source/webrtc" @@ -9259,7 +9263,7 @@ index 945c0ce1def2b3ed580e2f497b2347a8b2cebbac..722b30d805b005229b38fe4ef2c53c06 ) endif () -@@ -415,6 +421,12 @@ else () +@@ -411,6 +417,12 @@ else () set(WebKitGTK_ENUM_HEADER_TEMPLATE ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitEnumTypesGtk3.h.in) endif () @@ -9273,10 +9277,10 @@ index 945c0ce1def2b3ed580e2f497b2347a8b2cebbac..722b30d805b005229b38fe4ef2c53c06 set(WebKitGTK_ENUM_GENERATION_HEADERS ${WebKitGTK_INSTALLED_HEADERS}) list(REMOVE_ITEM WebKitGTK_ENUM_GENERATION_HEADERS ${WebKitGTK_DERIVED_SOURCES_DIR}/webkit/WebKitEnumTypes.h) diff --git a/Source/WebKit/PlatformWPE.cmake b/Source/WebKit/PlatformWPE.cmake -index 3c5bdcf25c6f9c0c86d0c4550d5dc7486f99d703..259fce0cf15b4263148f6f6da59161001875b465 100644 +index d55e9837af868c774cadcd6791ec07ccee1a97a0..649c0668818d6f2d70036bb18ff108060318d0fb 100644 --- a/Source/WebKit/PlatformWPE.cmake +++ b/Source/WebKit/PlatformWPE.cmake -@@ -117,6 +117,8 @@ list(APPEND WebKit_SERIALIZATION_IN_FILES +@@ -121,6 +121,8 @@ list(APPEND WebKit_SERIALIZATION_IN_FILES Shared/glib/UserMessage.serialization.in Shared/soup/WebCoreArgumentCodersSoup.serialization.in @@ -9285,7 +9289,7 @@ index 3c5bdcf25c6f9c0c86d0c4550d5dc7486f99d703..259fce0cf15b4263148f6f6da5916100 ) list(APPEND WebKit_DERIVED_SOURCES -@@ -221,6 +223,7 @@ set(WPE_API_HEADER_TEMPLATES +@@ -220,6 +222,7 @@ set(WPE_API_HEADER_TEMPLATES ${WEBKIT_DIR}/UIProcess/API/glib/WebKitWindowProperties.h.in ${WEBKIT_DIR}/UIProcess/API/glib/WebKitWebsitePolicies.h.in ${WEBKIT_DIR}/UIProcess/API/glib/webkit.h.in @@ -9311,13 +9315,13 @@ index 3c5bdcf25c6f9c0c86d0c4550d5dc7486f99d703..259fce0cf15b4263148f6f6da5916100 list(APPEND WebKit_LIBRARIES WPE::libwpe diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake -index e0e9b52c43ee0742f705159c1369f2938b9c4956..05fa7d93a721f200143e9d3ac45a75ce942afc88 100644 +index 8429fc8b2e3721830edf197b3369f4f21bb70a9a..bb6779326529bfe16f47dd1b941f4e3d364cb4df 100644 --- a/Source/WebKit/PlatformWin.cmake +++ b/Source/WebKit/PlatformWin.cmake @@ -54,8 +54,13 @@ list(APPEND WebKit_SOURCES - UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp UIProcess/win/AutomationClientWin.cpp + UIProcess/win/AutomationSessionClientWin.cpp + + UIProcess/win/InspectorTargetProxyWin.cpp + UIProcess/win/InspectorPlaywrightAgentClientWin.cpp @@ -9336,7 +9340,7 @@ index e0e9b52c43ee0742f705159c1369f2938b9c4956..05fa7d93a721f200143e9d3ac45a75ce WebProcess/WebPage/AcceleratedSurface.cpp -@@ -120,8 +126,81 @@ list(APPEND WebKit_PUBLIC_FRAMEWORK_HEADERS +@@ -119,8 +125,81 @@ list(APPEND WebKit_PUBLIC_FRAMEWORK_HEADERS list(APPEND WebKit_PRIVATE_LIBRARIES comctl32 @@ -9418,24 +9422,11 @@ index e0e9b52c43ee0742f705159c1369f2938b9c4956..05fa7d93a721f200143e9d3ac45a75ce list(APPEND WebProcess_SOURCES WebProcess/EntryPoint/win/WebProcessMain.cpp -diff --git a/Source/WebKit/Scripts/generate-unified-sources.sh b/Source/WebKit/Scripts/generate-unified-sources.sh -index 666b9f0669ad6e7d9050ec5b7a7d67ac533be363..d50f0eb91074b6263be5805fd89818a3573cf0ef 100755 ---- a/Source/WebKit/Scripts/generate-unified-sources.sh -+++ b/Source/WebKit/Scripts/generate-unified-sources.sh -@@ -18,7 +18,7 @@ if [ $# -eq 0 ]; then - echo "Using unified source list files: Sources.txt, SourcesCocoa.txt, Platform/Sources.txt, Platform/SourcesCocoa.txt" - fi - --UnifiedSourceCppFileCount=137 -+UnifiedSourceCppFileCount=139 - UnifiedSourceCFileCount=0 - UnifiedSourceMmFileCount=80 - diff --git a/Source/WebKit/Shared/AuxiliaryProcess.h b/Source/WebKit/Shared/AuxiliaryProcess.h -index 4510beb0b7403138abef4c9b5e892271fe8beaab..dae8f31ef187d7b086dd84d7e356839dc2811154 100644 +index c36aaf218982ee54d433b023485ac36e7c45cb2b..1f07f8ebad02fd11a4d23a69ec5092122df73aa0 100644 --- a/Source/WebKit/Shared/AuxiliaryProcess.h +++ b/Source/WebKit/Shared/AuxiliaryProcess.h -@@ -212,6 +212,11 @@ struct AuxiliaryProcessInitializationParameters { +@@ -216,6 +216,11 @@ struct AuxiliaryProcessInitializationParameters { IPC::Connection::Identifier connectionIdentifier; HashMap extraInitializationData; WTF::AuxiliaryProcessType processType; @@ -9500,18 +9491,10 @@ index c72c9733800b6f836c4d3ccb0b50d40c3ee83067..e2955ddebe388d886ca43d733dce0eb5 #if USE(APPKIT) diff --git a/Source/WebKit/Shared/NativeWebMouseEvent.h b/Source/WebKit/Shared/NativeWebMouseEvent.h -index e33858caab024b20217304209d7bf428e3335653..4026f6244889e5a0ee85edb72696d0be20ba531d 100644 +index a39b6dd673e1639f9fe64c23dd054f0ff57f7464..4026f6244889e5a0ee85edb72696d0be20ba531d 100644 --- a/Source/WebKit/Shared/NativeWebMouseEvent.h +++ b/Source/WebKit/Shared/NativeWebMouseEvent.h -@@ -31,6 +31,7 @@ - #if USE(APPKIT) - #include - OBJC_CLASS NSView; -+OBJC_CLASS NSEvent; - #endif - - #if PLATFORM(GTK) -@@ -86,6 +87,11 @@ public: +@@ -87,6 +87,11 @@ public: NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool, float deviceScaleFactor); #endif @@ -9551,10 +9534,10 @@ index ea1eb9f00feaaecf73bdddc37c904e88f43bfa85..8a631e5293a11abd650958baad4e9678 #endif }; diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -index fda0fedd6538fa8d239775da0949d907f235be33..a8218678e5a0ffab6828529395bbd783b955b256 100644 +index c0ba2034b3d6a9fd9d807f1d67a62284c311c3dc..d688da2d022ded01cf9828fd6d56d0570fcc5735 100644 --- a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in +++ b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -@@ -2764,6 +2764,9 @@ class WebCore::AuthenticationChallenge { +@@ -2826,6 +2826,9 @@ class WebCore::AuthenticationChallenge { class WebCore::DragData { #if PLATFORM(COCOA) String pasteboardName(); @@ -9564,7 +9547,7 @@ index fda0fedd6538fa8d239775da0949d907f235be33..a8218678e5a0ffab6828529395bbd783 #endif WebCore::IntPoint clientPosition(); WebCore::IntPoint globalPosition(); -@@ -3562,6 +3565,7 @@ enum class WebCore::WasPrivateRelayed : bool; +@@ -3624,6 +3627,7 @@ enum class WebCore::WasPrivateRelayed : bool; String httpStatusText; String httpVersion; WebCore::HTTPHeaderMap httpHeaderFields; @@ -9678,7 +9661,7 @@ index 8e4e2d6d5ebb08fba210fe0a328d45290348dd11..32a43192ec1e918c33b1b046b71d2ec5 const String& text() const { return m_text; } diff --git a/Source/WebKit/Shared/WebMouseEvent.h b/Source/WebKit/Shared/WebMouseEvent.h -index fd4722dd38df74f259d8add02025549022a0a205..e1c33f6d766707170935b3e77e81098cc8e3786d 100644 +index 20a6e465457151b02daa22e6bc059cf0e117ece5..ef4b1f737aaa683bc13c447aa4ca77e5cf0d64d7 100644 --- a/Source/WebKit/Shared/WebMouseEvent.h +++ b/Source/WebKit/Shared/WebMouseEvent.h @@ -70,6 +70,7 @@ public: @@ -9690,33 +9673,33 @@ index fd4722dd38df74f259d8add02025549022a0a205..e1c33f6d766707170935b3e77e81098c void setPosition(const WebCore::IntPoint& position) { m_position = position; } const WebCore::IntPoint& globalPosition() const { return m_globalPosition; } diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h -index 8b5cedc5b433d8b7c1cdadf8206bd7b446ae7c21..9a8ac919d38ce51ffb1e0aeda9f23ce587736dd8 100644 +index 40b760ec89270bb9a8c586d05cab205c8bd9e7cf..db59f464cc96f9db4800034509e048a1f4d237ac 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.h +++ b/Source/WebKit/Shared/WebPageCreationParameters.h -@@ -306,6 +306,8 @@ struct WebPageCreationParameters { +@@ -301,6 +301,8 @@ struct WebPageCreationParameters { + WebCore::ShouldRelaxThirdPartyCookieBlocking shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No }; bool httpsUpgradeEnabled { true }; - -+ bool shouldPauseInInspectorWhenShown { false }; + - #if PLATFORM(IOS) || PLATFORM(VISION) - bool allowsDeprecatedSynchronousXMLHttpRequestDuringUnload { false }; - #endif ++ bool shouldPauseInInspectorWhenShown { false }; + + #if ENABLE(APP_HIGHLIGHTS) + WebCore::HighlightVisibility appHighlightsVisible { WebCore::HighlightVisibility::Hidden }; diff --git a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -index bf9888a54cfe4fe5f2dee954b82fa9301498175b..85a2c43977be2751a61a9594c53270fb1bb26b4f 100644 +index d137231cfb0f9d9632e788f8e08968ad514f2227..6647f08415b1f0b213e4162ca93697e39280c888 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in +++ b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -@@ -226,6 +226,8 @@ enum class WebCore::UserInterfaceLayoutDirection : bool; +@@ -223,6 +223,8 @@ enum class WebCore::UserInterfaceLayoutDirection : bool; bool httpsUpgradeEnabled; + bool shouldPauseInInspectorWhenShown; + - #if PLATFORM(IOS) || PLATFORM(VISION) - bool allowsDeprecatedSynchronousXMLHttpRequestDuringUnload; + #if ENABLE(APP_HIGHLIGHTS) + WebCore::HighlightVisibility appHighlightsVisible; #endif diff --git a/Source/WebKit/Shared/glib/ProcessExecutablePathGLib.cpp b/Source/WebKit/Shared/glib/ProcessExecutablePathGLib.cpp -index 40d482a1860598391363027e63b010b3ce32b014..e654ae5e7c54b788badd463b1f2b653160d0370e 100644 +index 9899d60864664d1abff2b71c1c01e564e5dfb08c..391e0e42ca6a39f82b5a12c6aede069d61095ee2 100644 --- a/Source/WebKit/Shared/glib/ProcessExecutablePathGLib.cpp +++ b/Source/WebKit/Shared/glib/ProcessExecutablePathGLib.cpp @@ -32,7 +32,7 @@ @@ -9808,7 +9791,7 @@ index 0000000000000000000000000000000000000000..f4f09d171ebf9774b3f8744751d220d3 + bool canSmartReplace() +} diff --git a/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp b/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp -index f931d51a7b1818155729d5622038c442bba53cc0..d7c1ce87abca61fb5b72368376352ce93744a9a1 100644 +index 7fcd22cd2172cd7fa77aee12ad5cfcf7a435abba..bc822b40eea889fb0499dd4e78f89f04d87c64a1 100644 --- a/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp +++ b/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp @@ -40,6 +40,15 @@ @@ -9839,10 +9822,10 @@ index f931d51a7b1818155729d5622038c442bba53cc0..d7c1ce87abca61fb5b72368376352ce9 } diff --git a/Source/WebKit/Shared/win/AuxiliaryProcessMainWin.cpp b/Source/WebKit/Shared/win/AuxiliaryProcessMainWin.cpp -index 9edb5fbcd103cd8d1b224dfd60ac88aabe9626d2..9ed392ae3809f8bda92a2765ffadc643f23fe856 100644 +index 053e9336017d8818b3cbea79ce7c145fd5c46274..5632498d6ef875df80fc68ec206a9d08e5d05a6f 100644 --- a/Source/WebKit/Shared/win/AuxiliaryProcessMainWin.cpp +++ b/Source/WebKit/Shared/win/AuxiliaryProcessMainWin.cpp -@@ -41,6 +41,10 @@ bool AuxiliaryProcessMainCommon::parseCommandLine(int argc, char** argv) +@@ -47,6 +47,10 @@ bool AuxiliaryProcessMainCommon::parseCommandLine(int argc, char** argv) m_parameters.connectionIdentifier = IPC::Connection::Identifier { reinterpret_cast(parseIntegerAllowingTrailingJunk(StringView::fromLatin1(argv[++i])).value_or(0)) }; else if (!strcmp(argv[i], "-processIdentifier") && i + 1 < argc) m_parameters.processIdentifier = ObjectIdentifier(parseIntegerAllowingTrailingJunk(StringView::fromLatin1(argv[++i])).value_or(0)); @@ -9853,24 +9836,11 @@ index 9edb5fbcd103cd8d1b224dfd60ac88aabe9626d2..9ed392ae3809f8bda92a2765ffadc643 else if (!strcmp(argv[i], "-configure-jsc-for-testing")) JSC::Config::configureForTesting(); else if (!strcmp(argv[i], "-disable-jit")) -diff --git a/Source/WebKit/Shared/win/WebEventFactory.cpp b/Source/WebKit/Shared/win/WebEventFactory.cpp -index a1044685ff596361f14f418a1d1f0b133dee385a..2916a6f8e0c370b860ea45106c34d8dd82547f93 100644 ---- a/Source/WebKit/Shared/win/WebEventFactory.cpp -+++ b/Source/WebKit/Shared/win/WebEventFactory.cpp -@@ -484,7 +484,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(HWND hwnd, UINT message - #if ENABLE(TOUCH_EVENTS) - WebTouchEvent WebEventFactory::createWebTouchEvent() - { -- return WebTouchEvent(); -+ return WebTouchEvent({ WebEventType::TouchMove, OptionSet { }, WallTime::now()}, { }, { }, { }); - } - #endif // ENABLE(TOUCH_EVENTS) - diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt -index 63be8e6480621c508443ba589342034a8cd64523..57b13efa8198ffa203510642b2db8aae526f5030 100644 +index 8580135604e6c41c0d2adc22b37ce50366069788..dcbca0904ab9acff6bfcc5cffd6f821af682ecb5 100644 --- a/Source/WebKit/Sources.txt +++ b/Source/WebKit/Sources.txt -@@ -384,6 +384,7 @@ Shared/XR/XRDeviceProxy.cpp +@@ -391,6 +391,7 @@ UIProcess/AboutSchemeHandler.cpp UIProcess/AuxiliaryProcessProxy.cpp UIProcess/BackgroundProcessResponsivenessTimer.cpp UIProcess/BrowsingContextGroup.cpp @@ -9878,7 +9848,7 @@ index 63be8e6480621c508443ba589342034a8cd64523..57b13efa8198ffa203510642b2db8aae UIProcess/DeviceIdHashSaltStorage.cpp UIProcess/DisplayLink.cpp UIProcess/DisplayLinkProcessProxyClient.cpp -@@ -393,16 +394,20 @@ UIProcess/FrameLoadState.cpp +@@ -400,16 +401,20 @@ UIProcess/FrameLoadState.cpp UIProcess/FrameProcess.cpp UIProcess/GeolocationPermissionRequestManagerProxy.cpp UIProcess/GeolocationPermissionRequestProxy.cpp @@ -9897,9 +9867,9 @@ index 63be8e6480621c508443ba589342034a8cd64523..57b13efa8198ffa203510642b2db8aae UIProcess/ProvisionalPageProxy.cpp +UIProcess/RemoteInspectorPipe.cpp UIProcess/RemotePageDrawingAreaProxy.cpp + UIProcess/RemotePageFullscreenManagerProxy.cpp UIProcess/RemotePageProxy.cpp - UIProcess/ResponsivenessTimer.cpp -@@ -444,6 +449,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp +@@ -452,6 +457,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp UIProcess/WebPageDiagnosticLoggingClient.cpp UIProcess/WebPageGroup.cpp UIProcess/WebPageInjectedBundleClient.cpp @@ -9908,7 +9878,7 @@ index 63be8e6480621c508443ba589342034a8cd64523..57b13efa8198ffa203510642b2db8aae UIProcess/WebPageProxy.cpp UIProcess/WebPageProxyMessageReceiverRegistration.cpp UIProcess/WebPageProxyTesting.cpp -@@ -588,7 +595,11 @@ UIProcess/Inspector/WebInspectorUtilities.cpp +@@ -598,7 +605,11 @@ UIProcess/Inspector/WebInspectorUtilities.cpp UIProcess/Inspector/WebPageDebuggable.cpp UIProcess/Inspector/WebPageInspectorController.cpp @@ -9921,10 +9891,10 @@ index 63be8e6480621c508443ba589342034a8cd64523..57b13efa8198ffa203510642b2db8aae UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp UIProcess/Media/MediaUsageManager.cpp diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt -index 703fed777c597c14e0794270747c771627118460..a521863925b7392e1172f62d818bde3e4d66850c 100644 +index 768e618630ca0090790320007cbcadad8e0d6452..536e02dc95c2adff1be74a1c2116ab8e8e98196c 100644 --- a/Source/WebKit/SourcesCocoa.txt +++ b/Source/WebKit/SourcesCocoa.txt -@@ -270,6 +270,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm +@@ -272,6 +272,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm UIProcess/API/Cocoa/_WKAttachment.mm UIProcess/API/Cocoa/_WKAutomationSession.mm UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm @@ -9932,7 +9902,7 @@ index 703fed777c597c14e0794270747c771627118460..a521863925b7392e1172f62d818bde3e UIProcess/API/Cocoa/_WKContentRuleListAction.mm UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @no-unify -@@ -464,6 +465,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm +@@ -468,6 +469,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.mm UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm @@ -9941,7 +9911,7 @@ index 703fed777c597c14e0794270747c771627118460..a521863925b7392e1172f62d818bde3e UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm UIProcess/Inspector/mac/WKInspectorViewController.mm diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt -index 39c4934ff42c3854a5c4acf379812d3f8d55832f..0fcdeea00c863c6b72469b3f4cd8561f0d7113c5 100644 +index 3c8d209cba714f7df7c1e78d951886692ca58b09..2d893bdc430f9e81a3369a9470d21134aa63c9a1 100644 --- a/Source/WebKit/SourcesGTK.txt +++ b/Source/WebKit/SourcesGTK.txt @@ -122,6 +122,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify @@ -9978,7 +9948,7 @@ index 39c4934ff42c3854a5c4acf379812d3f8d55832f..0fcdeea00c863c6b72469b3f4cd8561f UIProcess/gtk/WebPasteboardProxyGtk.cpp UIProcess/gtk/WebPopupMenuProxyGtk.cpp diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt -index 3eaaa65a91fb381bd7366e36c147e0cba64358d4..645f0c98e248de12731c2bdf693eaef614535b3f 100644 +index 42931a643d8ff85469b5e162a42e9a09a8bdca3f..f962949675b8de7b79e6d56bb8bb3f342b39dfe8 100644 --- a/Source/WebKit/SourcesWPE.txt +++ b/Source/WebKit/SourcesWPE.txt @@ -124,6 +124,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify @@ -9997,15 +9967,7 @@ index 3eaaa65a91fb381bd7366e36c147e0cba64358d4..645f0c98e248de12731c2bdf693eaef6 UIProcess/API/glib/WebKitPolicyDecision.cpp @no-unify UIProcess/API/glib/WebKitPrivate.cpp @no-unify UIProcess/API/glib/WebKitProtocolHandler.cpp @no-unify -@@ -193,6 +195,7 @@ UIProcess/API/soup/HTTPCookieStoreSoup.cpp - UIProcess/API/wpe/InputMethodFilterWPE.cpp @no-unify - UIProcess/API/wpe/PageClientImpl.cpp @no-unify - UIProcess/API/wpe/WebKitColor.cpp @no-unify -+UIProcess/API/wpe/WebKitDataListSuggestionsDropdown.cpp @no-unify - UIProcess/API/wpe/WebKitInputMethodContextWPE.cpp @no-unify - UIProcess/API/wpe/WebKitInputMethodContextImplWPE.cpp @no-unify - UIProcess/API/wpe/WebKitPopupMenu.cpp @no-unify -@@ -221,6 +224,7 @@ UIProcess/glib/DisplayVBlankMonitor.cpp +@@ -221,6 +223,7 @@ UIProcess/glib/DisplayVBlankMonitor.cpp UIProcess/glib/DisplayVBlankMonitorDRM.cpp UIProcess/glib/DisplayVBlankMonitorTimer.cpp UIProcess/glib/FenceMonitor.cpp @@ -10013,7 +9975,7 @@ index 3eaaa65a91fb381bd7366e36c147e0cba64358d4..645f0c98e248de12731c2bdf693eaef6 UIProcess/glib/ScreenManager.cpp UIProcess/glib/SystemSettingsManagerProxy.cpp UIProcess/glib/WebPageProxyGLib.cpp -@@ -254,8 +258,13 @@ UIProcess/linux/MemoryPressureMonitor.cpp +@@ -254,8 +257,14 @@ UIProcess/linux/MemoryPressureMonitor.cpp UIProcess/soup/WebProcessPoolSoup.cpp UIProcess/wpe/AcceleratedBackingStoreDMABuf.cpp @@ -10021,6 +9983,7 @@ index 3eaaa65a91fb381bd7366e36c147e0cba64358d4..645f0c98e248de12731c2bdf693eaef6 UIProcess/wpe/ScreenManagerWPE.cpp UIProcess/wpe/SystemSettingsManagerProxyWPE.cpp +UIProcess/wpe/WebColorPickerWPE.cpp ++UIProcess/wpe/WebDataListSuggestionsDropdownWPE.cpp +UIProcess/wpe/WebDateTimePickerWPE.cpp +UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp +UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp @@ -10037,10 +10000,10 @@ index 3eaaa65a91fb381bd7366e36c147e0cba64358d4..645f0c98e248de12731c2bdf693eaef6 WebProcess/WebPage/AcceleratedSurface.cpp diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp -index bbd1b64631ed858686e118c94a5b44ef2bacc3f8..491e888db9e696ac65528ebd05a38224d9140b2f 100644 +index a9d9e1ecd35d4f3b55fa27ff913d054513d423a6..d7f083485598a5b458c09c278a7c0181272d0e93 100644 --- a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp +++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp -@@ -255,6 +255,11 @@ WebPageProxy* PageConfiguration::relatedPage() const +@@ -275,6 +275,11 @@ WebPageProxy* PageConfiguration::relatedPage() const return m_data.relatedPage.get(); } @@ -10053,10 +10016,10 @@ index bbd1b64631ed858686e118c94a5b44ef2bacc3f8..491e888db9e696ac65528ebd05a38224 { return m_data.pageToCloneSessionStorageFrom.get(); diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.h b/Source/WebKit/UIProcess/API/APIPageConfiguration.h -index d4cc6c31b1cb6483cd1ac5d90762c4a2ad7c905a..2322900ab0c068d28f975bef27dac02b4469aef0 100644 +index ceb054aec4899fa74d160c08e1009dba052488e7..e4c817a32510d006b95d0039d9dc763351831978 100644 --- a/Source/WebKit/UIProcess/API/APIPageConfiguration.h +++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.h -@@ -156,6 +156,10 @@ public: +@@ -160,6 +160,10 @@ public: WebKit::WebPageProxy* relatedPage() const; void setRelatedPage(WeakPtr&& relatedPage) { m_data.relatedPage = WTFMove(relatedPage); } @@ -10067,7 +10030,7 @@ index d4cc6c31b1cb6483cd1ac5d90762c4a2ad7c905a..2322900ab0c068d28f975bef27dac02b WebKit::WebPageProxy* pageToCloneSessionStorageFrom() const; void setPageToCloneSessionStorageFrom(WeakPtr&&); -@@ -507,6 +511,7 @@ private: +@@ -518,6 +522,7 @@ private: #endif RefPtr pageGroup; WeakPtr relatedPage; @@ -10091,7 +10054,7 @@ index e256b905bf9727aa7c8a48012237a6a6bc9acdbc..4e855c441af6f235f0fd8dfdd57b9bd6 copy->m_shouldTakeUIBackgroundAssertion = this->m_shouldTakeUIBackgroundAssertion; copy->m_shouldCaptureDisplayInUIProcess = this->m_shouldCaptureDisplayInUIProcess; diff --git a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h -index d2e8261c6db000aa41697b3bb50e2bea149edcdf..500c38b81d6804f64ff891e32b2c72ed98c9a629 100644 +index af4944e5a5d373bc51995b50d1ea7c70f64ef1b3..403cfdeda26db2b648e32aa0e5f3ef6e076634f6 100644 --- a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h +++ b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h @@ -96,6 +96,16 @@ public: @@ -10123,10 +10086,10 @@ index d2e8261c6db000aa41697b3bb50e2bea149edcdf..500c38b81d6804f64ff891e32b2c72ed bool m_shouldTakeUIBackgroundAssertion { true }; bool m_shouldCaptureDisplayInUIProcess { DEFAULT_CAPTURE_DISPLAY_IN_UI_PROCESS }; diff --git a/Source/WebKit/UIProcess/API/APIUIClient.h b/Source/WebKit/UIProcess/API/APIUIClient.h -index 2972dde456001f5443142513711549297eff9b10..a71d47c77a1167863232f2e7d76381b3e87c4af3 100644 +index 4d3564df93fcad126ddd9b3ca851618976cd7571..826aad7a5675b4daf90d83d36a6f352751932f03 100644 --- a/Source/WebKit/UIProcess/API/APIUIClient.h +++ b/Source/WebKit/UIProcess/API/APIUIClient.h -@@ -115,6 +115,7 @@ public: +@@ -114,6 +114,7 @@ public: virtual void runJavaScriptAlert(WebKit::WebPageProxy&, const WTF::String&, WebKit::WebFrameProxy*, WebKit::FrameInfoData&&, Function&& completionHandler) { completionHandler(); } virtual void runJavaScriptConfirm(WebKit::WebPageProxy&, const WTF::String&, WebKit::WebFrameProxy*, WebKit::FrameInfoData&&, Function&& completionHandler) { completionHandler(false); } virtual void runJavaScriptPrompt(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy*, WebKit::FrameInfoData&&, Function&& completionHandler) { completionHandler(WTF::String()); } @@ -10178,11 +10141,11 @@ index 026121d114c5fcad84c1396be8d692625beaa3bd..edd6e5cae033124c589959a42522fde0 } #endif diff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp -index bae7c5eb3879237a34a1abb249bf312822d59569..f905369dec97083ce4d4d60b838a63e56be36d77 100644 +index 55aeb95735a56d285d7faeb21e9cec6e4ce6762e..9ecc7e8b24a3550659e62e01e704ea0064a985aa 100644 --- a/Source/WebKit/UIProcess/API/C/WKPage.cpp +++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp -@@ -1801,6 +1801,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient - completionHandler(String()); +@@ -1935,6 +1935,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient + m_client.addMessageToConsole(toAPI(&page), toAPI(message.impl()), m_client.base.clientInfo); } + void handleJavaScriptDialog(WebPageProxy& page, bool accept, const String& value) final { @@ -10195,7 +10158,7 @@ index bae7c5eb3879237a34a1abb249bf312822d59569..f905369dec97083ce4d4d60b838a63e5 void setStatusText(WebPageProxy* page, const String& text) final { if (!m_client.setStatusText) -@@ -1830,6 +1837,8 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient +@@ -1964,6 +1971,8 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient { if (!m_client.didNotHandleKeyEvent) return; @@ -10205,7 +10168,7 @@ index bae7c5eb3879237a34a1abb249bf312822d59569..f905369dec97083ce4d4d60b838a63e5 } diff --git a/Source/WebKit/UIProcess/API/C/WKPageUIClient.h b/Source/WebKit/UIProcess/API/C/WKPageUIClient.h -index 1484f064ec89ee8c25c35df9f0a4462896699415..0622f4d5fc9144b9059395d9d0730a4ae00b7497 100644 +index fc43c44a85a0fc6bf5f8c643bd120a16ce762914..ee86fd213d25682f9b6553ec7da99bc8a812212b 100644 --- a/Source/WebKit/UIProcess/API/C/WKPageUIClient.h +++ b/Source/WebKit/UIProcess/API/C/WKPageUIClient.h @@ -98,6 +98,7 @@ typedef void (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStri @@ -10216,7 +10179,7 @@ index 1484f064ec89ee8c25c35df9f0a4462896699415..0622f4d5fc9144b9059395d9d0730a4a typedef void (*WKPageRequestStorageAccessConfirmCallback)(WKPageRef page, WKFrameRef frame, WKStringRef requestingDomain, WKStringRef currentDomain, WKPageRequestStorageAccessConfirmResultListenerRef listener, const void *clientInfo); typedef void (*WKPageTakeFocusCallback)(WKPageRef page, WKFocusDirection direction, const void *clientInfo); typedef void (*WKPageFocusCallback)(WKPageRef page, const void *clientInfo); -@@ -1364,6 +1365,7 @@ typedef struct WKPageUIClientV14 { +@@ -1365,6 +1366,7 @@ typedef struct WKPageUIClientV14 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -10224,7 +10187,7 @@ index 1484f064ec89ee8c25c35df9f0a4462896699415..0622f4d5fc9144b9059395d9d0730a4a } WKPageUIClientV14; typedef struct WKPageUIClientV15 { -@@ -1471,6 +1473,7 @@ typedef struct WKPageUIClientV15 { +@@ -1472,6 +1474,7 @@ typedef struct WKPageUIClientV15 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -10232,7 +10195,7 @@ index 1484f064ec89ee8c25c35df9f0a4462896699415..0622f4d5fc9144b9059395d9d0730a4a // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1582,6 +1585,7 @@ typedef struct WKPageUIClientV16 { +@@ -1583,6 +1586,7 @@ typedef struct WKPageUIClientV16 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -10240,7 +10203,7 @@ index 1484f064ec89ee8c25c35df9f0a4462896699415..0622f4d5fc9144b9059395d9d0730a4a // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1696,6 +1700,7 @@ typedef struct WKPageUIClientV17 { +@@ -1697,6 +1701,7 @@ typedef struct WKPageUIClientV17 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -10248,7 +10211,7 @@ index 1484f064ec89ee8c25c35df9f0a4462896699415..0622f4d5fc9144b9059395d9d0730a4a // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1810,6 +1815,7 @@ typedef struct WKPageUIClientV18 { +@@ -1811,6 +1816,7 @@ typedef struct WKPageUIClientV18 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -10256,7 +10219,7 @@ index 1484f064ec89ee8c25c35df9f0a4462896699415..0622f4d5fc9144b9059395d9d0730a4a // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1926,6 +1932,7 @@ typedef struct WKPageUIClientV19 { +@@ -1927,6 +1933,7 @@ typedef struct WKPageUIClientV19 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -10265,7 +10228,7 @@ index 1484f064ec89ee8c25c35df9f0a4462896699415..0622f4d5fc9144b9059395d9d0730a4a // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm b/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm -index 93882c7e4c9873fce79af428ceaa73a4eca851cb..9d6f85a1ee633bdd6589fe9fae74d6f9ebff6e08 100644 +index 3298711f75bd5be68290738a21de99c927e2d925..6943df0b1f4ee684db0b52f336b5d7f8922c2707 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm @@ -712,6 +712,16 @@ - (void)_setMediaCaptureRequiresSecureConnection:(BOOL)requiresSecureConnection @@ -10286,7 +10249,7 @@ index 93882c7e4c9873fce79af428ceaa73a4eca851cb..9d6f85a1ee633bdd6589fe9fae74d6f9 { return _preferences->inactiveMediaCaptureStreamRepromptIntervalInMinutes(); diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h -index 31de8ef3d986a5c391e1fb045268e95d5eefaf11..690cb85ab84d7ad2818ba4c362c8f0f25e25c1e1 100644 +index 41525c8980f698aa4326e7d4d232311cee2c43d5..1f1745431c6cc7af66b47dd5d015c52389626e6f 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h +++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h @@ -119,6 +119,7 @@ typedef NS_ENUM(NSInteger, _WKPitchCorrectionAlgorithm) { @@ -10298,7 +10261,7 @@ index 31de8ef3d986a5c391e1fb045268e95d5eefaf11..690cb85ab84d7ad2818ba4c362c8f0f2 @property (nonatomic, setter=_setICECandidateFilteringEnabled:) BOOL _iceCandidateFilteringEnabled WK_API_AVAILABLE(macos(10.13.4), ios(11.3)); @property (nonatomic, setter=_setInactiveMediaCaptureStreamRepromptIntervalInMinutes:) double _inactiveMediaCaptureStreamRepromptIntervalInMinutes WK_API_AVAILABLE(macos(10.13.4), ios(11.3)); diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h -index ef512c7ba09298b2291d0248988574163ff2e7c8..d42e7f9f7b66840b68e61ce46b4bbd6254518ef7 100644 +index 5f4e98c6ab6bb3cce607b96600cac66c70753224..1c2af77331d0da8d9ba232ba508b96e4f7276fe8 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h +++ b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h @@ -149,6 +149,12 @@ WK_SWIFT_UI_ACTOR @@ -10315,10 +10278,10 @@ index ef512c7ba09298b2291d0248988574163ff2e7c8..d42e7f9f7b66840b68e61ce46b4bbd62 /*! @abstract A delegate to request permission for microphone audio and camera video access. @param webView The web view invoking the delegate method. diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h -index eff4cf557033561ab20762d93a58c2d71f5505f0..9418e2c51e50190dee2b5d7c854eacea8c5a4b76 100644 +index 930357ac3469195e9f33d5ffce92777018bb0b13..f62555ec562f8416976d31692e8fb1751a04d458 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h -@@ -126,6 +126,8 @@ WK_CLASS_AVAILABLE(macos(10.11), ios(9.0)) +@@ -138,6 +138,8 @@ WK_CLASS_AVAILABLE(macos(10.11), ios(9.0)) #endif #endif @@ -10328,7 +10291,7 @@ index eff4cf557033561ab20762d93a58c2d71f5505f0..9418e2c51e50190dee2b5d7c854eacea NS_ASSUME_NONNULL_END diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm -index 29f1855ec5009fecf05e3c3fda2d38845973c085..279b05f40b2d446bb7bedbcab4239e2f72656cd2 100644 +index 5b6b451a4ab86b3c280c107e5f7bec822155ccde..99eeb8633ab25d8f4f174440e328ba5287e3a2b8 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm @@ -55,6 +55,7 @@ @@ -10339,7 +10302,7 @@ index 29f1855ec5009fecf05e3c3fda2d38845973c085..279b05f40b2d446bb7bedbcab4239e2f #import #import #import -@@ -496,6 +497,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple +@@ -523,6 +524,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple }); } @@ -10491,7 +10454,7 @@ index 426c7cbc897e22fd2e962dd3744959975d6ae6a0..f7a52359d7d42f970ef424b6c702b0ec @property (nonatomic) BOOL processSwapsOnNavigationWithinSameNonHTTPFamilyProtocol WK_API_AVAILABLE(macos(12.0), ios(15.0)); @property (nonatomic) BOOL prewarmsProcessesAutomatically WK_API_AVAILABLE(macos(10.14.4), ios(12.2)); diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm -index 38b516d32edc4038508c664e0c4dc804cd477787..891dd8b2451ab771e451ea8ef74906d364e76007 100644 +index 7ccfd9a46cd024c8f6644594b9d0cde8ae7e60db..921ec683dce77583f24d27a0b1b6f478242dfb42 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm @@ -241,6 +241,16 @@ - (BOOL)processSwapsOnNavigation @@ -10523,20 +10486,8 @@ index 4974e14214e2bb3e982325b885bab33e54f83998..cacdf8c71fab248d38d2faf03f7affdc typedef NS_ENUM(NSInteger, _WKUserStyleLevel) { _WKUserStyleUserLevel, -diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKWebPushDaemonConnection.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKWebPushDaemonConnection.mm -index 8cd456770de0cd073370e97155b90eda3e7480a5..8e3975ae1fe673bd39facbfe787f143b80e24fb6 100644 ---- a/Source/WebKit/UIProcess/API/Cocoa/_WKWebPushDaemonConnection.mm -+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKWebPushDaemonConnection.mm -@@ -32,6 +32,7 @@ - #import "WKSecurityOriginInternal.h" - #import "WebPushDaemonConnectionConfiguration.h" - #import "_WKNotificationDataInternal.h" -+#import "_WKWebPushMessageInternal.h" - #import "_WKWebPushSubscriptionDataInternal.h" - #import - #import diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKWebPushSubscriptionData.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKWebPushSubscriptionData.mm -index 0a78daba00961bf10564a0b53067960b71d8b61d..696408b77c82e205a134edf2ee17ff971af226f3 100644 +index d139d35f09a999e2c85f48799a399d791d421ffd..f79c073291c6071c566220a40f7dd4bbc57192a1 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKWebPushSubscriptionData.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKWebPushSubscriptionData.mm @@ -28,6 +28,9 @@ @@ -10752,7 +10703,7 @@ index 0000000000000000000000000000000000000000..e0b1da48465c850f541532ed961d1b77 +WebKit::WebPageProxy* webkitBrowserInspectorCreateNewPageInContext(WebKitWebContext*); +void webkitBrowserInspectorQuitApplication(); diff --git a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp -index 9b6d8db85df969e609de036fac67374226ecd48e..2b293d5f24e562f06859432580f2cdfe40f8b9a6 100644 +index 1080e5d6a44b4d7ec649913c39af89aa702d2ee4..2ef7037a1778982275f4b1a5190a089295c8e59c 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp @@ -101,6 +101,10 @@ private: @@ -10767,10 +10718,10 @@ index 9b6d8db85df969e609de036fac67374226ecd48e..2b293d5f24e562f06859432580f2cdfe bool canRunBeforeUnloadConfirmPanel() const final { return true; } diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp -index b41b2938110b41a024b98215e2af31d960f1b936..502319020e384ee91b5367b10f48c71ff907560b 100644 +index 5479cf466e1ba77ede37ff980e78bee85bbb094c..224c04a4bd9de6ad5661b15071c1267a57430547 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp -@@ -422,10 +422,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa +@@ -423,10 +423,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa } } @@ -10790,7 +10741,7 @@ index b41b2938110b41a024b98215e2af31d960f1b936..502319020e384ee91b5367b10f48c71f GUniquePtr bundleFilename(g_build_filename(injectedBundleDirectory(), INJECTED_BUNDLE_FILENAME, nullptr)); WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(object); -@@ -484,6 +493,8 @@ static void webkitWebContextConstructed(GObject* object) +@@ -485,6 +494,8 @@ static void webkitWebContextConstructed(GObject* object) static void webkitWebContextDispose(GObject* object) { @@ -10799,7 +10750,7 @@ index b41b2938110b41a024b98215e2af31d960f1b936..502319020e384ee91b5367b10f48c71f WebKitWebContextPrivate* priv = WEBKIT_WEB_CONTEXT(object)->priv; if (!priv->clientsDetached) { priv->clientsDetached = true; -@@ -945,6 +956,11 @@ WebKitNetworkSession* webkit_web_context_get_network_session_for_automation(WebK +@@ -946,6 +957,11 @@ WebKitNetworkSession* webkit_web_context_get_network_session_for_automation(WebK return nullptr; #endif } @@ -10836,10 +10787,10 @@ index c1945fbe717a42afc1f51d64a80c7de3fa9009ba..ab63fe19b00ecbd64c9421e6eecad3e2 #endif +int webkitWebContextExistingCount(); diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -index 8f1821a8547e6f28032ba49a5f47344b916cd802..2dc19565002f98528b11b2d7a4fecd9ebb1a2b77 100644 +index df1381b577be94114401e1faaf1979183d82614f..7739fac45b41e07d39a6ac1568641b44f67d5f56 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -@@ -36,6 +36,7 @@ +@@ -39,6 +39,7 @@ #include "WebContextMenuItem.h" #include "WebContextMenuItemData.h" #include "WebFrameProxy.h" @@ -10847,7 +10798,7 @@ index 8f1821a8547e6f28032ba49a5f47344b916cd802..2dc19565002f98528b11b2d7a4fecd9e #include "WebKitAuthenticationRequestPrivate.h" #include "WebKitBackForwardListPrivate.h" #include "WebKitContextMenuClient.h" -@@ -149,6 +150,7 @@ enum { +@@ -152,6 +153,7 @@ enum { CLOSE, SCRIPT_DIALOG, @@ -10855,7 +10806,7 @@ index 8f1821a8547e6f28032ba49a5f47344b916cd802..2dc19565002f98528b11b2d7a4fecd9e DECIDE_POLICY, PERMISSION_REQUEST, -@@ -517,6 +519,16 @@ GRefPtr WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& p +@@ -520,6 +522,16 @@ GRefPtr WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& p void WebKitWebViewClient::frameDisplayed(WKWPE::View&) { @@ -10872,7 +10823,7 @@ index 8f1821a8547e6f28032ba49a5f47344b916cd802..2dc19565002f98528b11b2d7a4fecd9e { SetForScope inFrameDisplayedGuard(m_webView->priv->inFrameDisplayed, true); for (const auto& callback : m_webView->priv->frameDisplayedCallbacks) { -@@ -533,6 +545,18 @@ void WebKitWebViewClient::frameDisplayed(WKWPE::View&) +@@ -536,6 +548,18 @@ void WebKitWebViewClient::frameDisplayed(WKWPE::View&) } } @@ -10891,7 +10842,7 @@ index 8f1821a8547e6f28032ba49a5f47344b916cd802..2dc19565002f98528b11b2d7a4fecd9e void WebKitWebViewClient::willStartLoad(WKWPE::View&) { webkitWebViewWillStartLoad(m_webView); -@@ -619,7 +643,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision* +@@ -622,7 +646,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision* static gboolean webkitWebViewPermissionRequest(WebKitWebView*, WebKitPermissionRequest* request) { @@ -10900,7 +10851,7 @@ index 8f1821a8547e6f28032ba49a5f47344b916cd802..2dc19565002f98528b11b2d7a4fecd9e if (WEBKIT_IS_POINTER_LOCK_PERMISSION_REQUEST(request)) { webkit_permission_request_allow(request); return TRUE; -@@ -942,6 +966,10 @@ static void webkitWebViewConstructed(GObject* object) +@@ -945,6 +969,10 @@ static void webkitWebViewConstructed(GObject* object) priv->websitePolicies = adoptGRef(webkit_website_policies_new()); Ref configuration = priv->relatedView && priv->relatedView->priv->configurationForNextRelatedView ? priv->relatedView->priv->configurationForNextRelatedView.releaseNonNull() : webkitWebViewCreatePageConfiguration(webView); @@ -10911,7 +10862,7 @@ index 8f1821a8547e6f28032ba49a5f47344b916cd802..2dc19565002f98528b11b2d7a4fecd9e webkitWebViewCreatePage(webView, WTFMove(configuration)); webkitWebContextWebViewCreated(priv->context.get(), webView); -@@ -1981,6 +2009,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) +@@ -1984,6 +2012,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_SCRIPT_DIALOG); @@ -10927,7 +10878,7 @@ index 8f1821a8547e6f28032ba49a5f47344b916cd802..2dc19565002f98528b11b2d7a4fecd9e /** * WebKitWebView::decide-policy: * @web_view: the #WebKitWebView on which the signal is emitted -@@ -2766,6 +2803,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const +@@ -2769,6 +2806,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const webkit_script_dialog_unref(webView->priv->currentScriptDialog); } @@ -10976,10 +10927,10 @@ index 763cd55f7abca011ac8bc4fef7f233bf52854cda..bd43917b274bf19ff9f3d96b7e80e207 #include <@API_INCLUDE_PREFIX@/WebKitClipboardPermissionRequest.h> #include <@API_INCLUDE_PREFIX@/WebKitColorChooserRequest.h> diff --git a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp -index ebd7d55886465375c70fb3265f6655fe43c62966..b5d2169c2b76474f12038727a66cf69e5ed23ebd 100644 +index 986edbe2d0b6ff2ed5717a14a71f26c973604f0c..c688cc026456686a54916857ba0396702ebf4a1e 100644 --- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp +++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp -@@ -268,6 +268,8 @@ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool +@@ -270,6 +270,8 @@ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool { if (wasEventHandled || event.type() != WebEventType::KeyDown || !event.nativeEvent()) return; @@ -10988,7 +10939,7 @@ index ebd7d55886465375c70fb3265f6655fe43c62966..b5d2169c2b76474f12038727a66cf69e // Always consider arrow keys as handled, otherwise the GtkWindow key bindings will move the focus. guint keyval; -@@ -366,9 +368,9 @@ void PageClientImpl::selectionDidChange() +@@ -362,9 +364,9 @@ void PageClientImpl::selectionDidChange() webkitWebViewSelectionDidChange(WEBKIT_WEB_VIEW(m_viewWidget)); } @@ -11001,11 +10952,11 @@ index ebd7d55886465375c70fb3265f6655fe43c62966..b5d2169c2b76474f12038727a66cf69e void PageClientImpl::didChangeContentSize(const IntSize& size) diff --git a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h -index 536e66027bdcfec08e28503d3dd715e3c51a2c9f..2cfba18152fd87c10e1bb7630515a677799f1bbc 100644 +index bd11269e156a92ce0e44cab3da4e4adde5142f64..1761d7541f226232b16ba8da3a6d609280037389 100644 --- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h +++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h -@@ -109,7 +109,7 @@ private: - #endif +@@ -104,7 +104,7 @@ private: + RefPtr createDataListSuggestionsDropdown(WebPageProxy&) override; Ref createValidationBubble(const String& message, const WebCore::ValidationBubble::Settings&) final; void selectionDidChange() override; - RefPtr takeViewSnapshot(std::optional&&) override; @@ -11114,10 +11065,10 @@ index 496079da90993ac37689b060b69ecd4a67c2b6a8..af30181ca922f16c0f6e245c70e5ce7d G_BEGIN_DECLS diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp -index 1d118b75a4be169d624ac18b50b13096bf7e1f36..29e48279f82dfaf83016c97349b284d054e1b956 100644 +index 2add5ab84105ad5e79635524b385fb5cb1de1a1b..0585e8474fc8cf42db262be75b514ea68fd5274b 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp -@@ -2884,6 +2884,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase) +@@ -2873,6 +2873,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase) #endif } @@ -11129,7 +11080,7 @@ index 1d118b75a4be169d624ac18b50b13096bf7e1f36..29e48279f82dfaf83016c97349b284d0 void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext) { ASSERT(webkitWebViewBase->priv->acceleratedBackingStore); -@@ -2940,12 +2945,12 @@ void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase) +@@ -2929,12 +2934,12 @@ void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase) webkitWebViewBase->priv->acceleratedBackingStore->update({ }); } @@ -11145,7 +11096,7 @@ index 1d118b75a4be169d624ac18b50b13096bf7e1f36..29e48279f82dfaf83016c97349b284d0 #if !USE(GTK4) diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h -index cfd4310b3c775e662b4d643d4f2edda56e101b58..65dc3319a8031b478b0faca89276f9dfed28c55f 100644 +index 3b8ca9470bab69dc26313111a79f954b10b30bf4..5c056dd6734f42d24bc168b4f5ba436584b3f7a8 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h @@ -27,6 +27,7 @@ @@ -11203,24 +11154,23 @@ index 7636ad733e7be66a74f8fede966b0acb905a5842..cf54287353d1e529c6765e3caf8d283a virtual void didChangePageID(WKWPE::View&) { } virtual void didReceiveUserMessage(WKWPE::View&, WebKit::UserMessage&&, CompletionHandler&& completionHandler) { completionHandler(WebKit::UserMessage()); } diff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp -index 97b321f1d8bb33175f963af0f6ffe741b50e28e6..d03085cbaad14e3ed88817bf5f26facbe9a24538 100644 +index aec5bdaa6d2ceea13ad61e3996fd69f9f6a2dc55..ca51881ce7783979f9d36035093b571db93a9253 100644 --- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp +++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp -@@ -34,9 +34,13 @@ - #include "TouchGestureController.h" +@@ -35,9 +35,12 @@ #include "WPEWebViewLegacy.h" #include "WPEWebViewPlatform.h" + #include "WebColorPicker.h" +#include "WebColorPickerWPE.h" +#include "WebDateTimePickerWPE.h" #include "WebContextMenuProxy.h" #include "WebContextMenuProxyWPE.h" -+#include "WebKitDataListSuggestionsDropdown.h" + #include "WebDataListSuggestionsDropdown.h" ++#include "WebDataListSuggestionsDropdownWPE.h" + #include "WebDateTimePicker.h" #include "WebKitPopupMenu.h" -+#include "WebColorPicker.h" #include - #include - #include -@@ -52,6 +56,12 @@ +@@ -55,6 +58,12 @@ #include #endif @@ -11233,7 +11183,26 @@ index 97b321f1d8bb33175f963af0f6ffe741b50e28e6..d03085cbaad14e3ed88817bf5f26facb namespace WebKit { WTF_MAKE_TZONE_ALLOCATED_IMPL(PageClientImpl); -@@ -487,6 +497,64 @@ void PageClientImpl::selectionDidChange() +@@ -299,14 +308,14 @@ Ref PageClientImpl::createContextMenuProxy(WebPageProxy& pa + } + #endif + +-RefPtr PageClientImpl::createColorPicker(WebPageProxy&, const WebCore::Color& intialColor, const WebCore::IntRect&, ColorControlSupportsAlpha supportsAlpha, Vector&&) ++RefPtr PageClientImpl::createColorPicker(WebPageProxy& page, const WebCore::Color& intialColor, const WebCore::IntRect& rect, ColorControlSupportsAlpha supportsAlpha, Vector&&) + { +- return nullptr; ++ return WebColorPickerWPE::create(page, intialColor, rect); + } + +-RefPtr PageClientImpl::createDataListSuggestionsDropdown(WebPageProxy&) ++RefPtr PageClientImpl::createDataListSuggestionsDropdown(WebKit::WebPageProxy& page) + { +- return nullptr; ++ return WebDataListSuggestionsDropdownWPE::create(page); + } + + RefPtr PageClientImpl::createDateTimePicker(WebPageProxy& page) +@@ -523,6 +532,64 @@ void PageClientImpl::selectionDidChange() m_view.selectionDidChange(); } @@ -11298,22 +11267,10 @@ index 97b321f1d8bb33175f963af0f6ffe741b50e28e6..d03085cbaad14e3ed88817bf5f26facb WebKitWebResourceLoadManager* PageClientImpl::webResourceLoadManager() { return m_view.webResourceLoadManager(); -@@ -497,4 +565,23 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler&& +@@ -533,4 +600,11 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler&& m_view.callAfterNextPresentationUpdate(WTFMove(callback)); } -+#if ENABLE(DATALIST_ELEMENT) -+RefPtr PageClientImpl::createDataListSuggestionsDropdown(WebKit::WebPageProxy& page) -+{ -+ return WebKitDataListSuggestionsDropdown::create(page); -+} -+#endif -+ -+RefPtr PageClientImpl::createColorPicker(WebPageProxy* page, const WebCore::Color& color, const WebCore::IntRect& rect, ColorControlSupportsAlpha, Vector&&) -+{ -+ return WebColorPickerWPE::create(*page, color, rect); -+} -+ +#if ENABLE(DATE_AND_TIME_INPUT_TYPES) +RefPtr PageClientImpl::createDateTimePicker(WebPageProxy& page) +{ @@ -11323,10 +11280,10 @@ index 97b321f1d8bb33175f963af0f6ffe741b50e28e6..d03085cbaad14e3ed88817bf5f26facb + } // namespace WebKit diff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h -index 353515ae3a699d85314a924ba6fc4e9610ade23b..8a541023be8549e2c1fced51af6ed03dcd67fc6f 100644 +index c9b5db9dc3005f78212b295ecbf1eac95b24f2dd..c15b6879d6167ec8b4bbe4b1deeb12eb38fe2e10 100644 --- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h +++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h -@@ -170,9 +170,24 @@ private: +@@ -181,9 +181,17 @@ private: void didChangeWebPageID() const override; void selectionDidChange() override; @@ -11338,20 +11295,13 @@ index 353515ae3a699d85314a924ba6fc4e9610ade23b..8a541023be8549e2c1fced51af6ed03d +#endif WebKitWebResourceLoadManager* webResourceLoadManager() override; -+#if ENABLE(DATALIST_ELEMENT) -+ RefPtr createDataListSuggestionsDropdown(WebKit::WebPageProxy& page) override; -+#endif -+ -+#if ENABLE(INPUT_TYPE_COLOR) -+ RefPtr createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&, ColorControlSupportsAlpha, Vector&&) override; -+#endif +#if ENABLE(DATE_AND_TIME_INPUT_TYPES) + RefPtr createDateTimePicker(WebPageProxy&) override; +#endif + WKWPE::View& m_view; - }; - + #if ENABLE(FULLSCREEN_API) + std::unique_ptr m_fullscreenClientForTesting; diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitBrowserInspector.h b/Source/WebKit/UIProcess/API/wpe/WebKitBrowserInspector.h new file mode 100644 index 0000000000000000000000000000000000000000..273c5105cdf1638955cea01128c9bbab3e64436c @@ -11439,131 +11389,6 @@ index 0000000000000000000000000000000000000000..273c5105cdf1638955cea01128c9bbab +G_END_DECLS + +#endif -diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitDataListSuggestionsDropdown.cpp b/Source/WebKit/UIProcess/API/wpe/WebKitDataListSuggestionsDropdown.cpp -new file mode 100644 -index 0000000000000000000000000000000000000000..afafef2b7fb433e006b1763e653e200bc80edcbd ---- /dev/null -+++ b/Source/WebKit/UIProcess/API/wpe/WebKitDataListSuggestionsDropdown.cpp -@@ -0,0 +1,58 @@ -+/* -+ * Copyright (C) 2019 Igalia S.L. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS'' -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -+ * THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include "config.h" -+#include "WebKitDataListSuggestionsDropdown.h" -+ -+#if ENABLE(DATALIST_ELEMENT) -+ -+#include "WebPageProxy.h" -+ -+namespace WebKit { -+ -+WebKitDataListSuggestionsDropdown::WebKitDataListSuggestionsDropdown(WebPageProxy& page) -+ : WebDataListSuggestionsDropdown(page) -+{ -+} -+ -+WebKitDataListSuggestionsDropdown::~WebKitDataListSuggestionsDropdown() -+{ -+} -+ -+void WebKitDataListSuggestionsDropdown::show(WebCore::DataListSuggestionInformation&& information) -+{ -+} -+ -+void WebKitDataListSuggestionsDropdown::handleKeydownWithIdentifier(const String& key) -+{ -+} -+ -+void WebKitDataListSuggestionsDropdown::close() -+{ -+} -+ -+} // namespace WebKit -+ -+#endif // ENABLE(DATALIST_ELEMENT) -diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitDataListSuggestionsDropdown.h b/Source/WebKit/UIProcess/API/wpe/WebKitDataListSuggestionsDropdown.h -new file mode 100644 -index 0000000000000000000000000000000000000000..0a099832c3dd959f456fcae49a1d62a9477d2758 ---- /dev/null -+++ b/Source/WebKit/UIProcess/API/wpe/WebKitDataListSuggestionsDropdown.h -@@ -0,0 +1,55 @@ -+/* -+ * Copyright (C) 2019 Igalia S.L. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS'' -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -+ * THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#pragma once -+ -+#if ENABLE(DATALIST_ELEMENT) -+ -+#include "WebDataListSuggestionsDropdown.h" -+ -+namespace WebKit { -+ -+class WebPageProxy; -+ -+class WebKitDataListSuggestionsDropdown final : public WebDataListSuggestionsDropdown { -+public: -+ static Ref create(WebPageProxy& page) -+ { -+ return adoptRef(*new WebKitDataListSuggestionsDropdown(page)); -+ } -+ -+ ~WebKitDataListSuggestionsDropdown(); -+ -+private: -+ WebKitDataListSuggestionsDropdown(WebPageProxy&); -+ -+ void show(WebCore::DataListSuggestionInformation&&) final; -+ void handleKeydownWithIdentifier(const String&) final; -+ void close() final; -+}; -+ -+} // namespace WebKit -+ -+#endif // ENABLE(DATALIST_ELEMENT) diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp index 763bda5b29304f7ed7133c0a8158e6c8b94c5ea1..8ed962e8c1af62b9b73a68348d0d88765429861d 100644 --- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp @@ -11658,19 +11483,20 @@ index 2f1182cb91a00353eace0b71612df096391c2450..d71d7fc724b046fab41285bb8f390cb6 void didChangePageID(WKWPE::View&) override; void didReceiveUserMessage(WKWPE::View&, WebKit::UserMessage&&, CompletionHandler&&) override; diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h -index 62250eac7b9d4e38b3d9ccad743daaf1627ff017..218f379aea078cfa27c0af5a963a2d3dcbcbc66a 100644 +index 6ae7054c30026bbaca91936c46ffff0760039d5a..5e97a1247dc43118c901b548f8dafa377e3f98ae 100644 --- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h +++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h -@@ -270,6 +270,8 @@ public: +@@ -285,6 +285,9 @@ public: void didDestroyFrame(WebCore::FrameIdentifier); + static std::optional platformGetBase64EncodedPNGData(const ViewSnapshot&); + - private: ++private: RefPtr webPageProxyForHandle(const String&); String handleForWebPageProxy(const WebPageProxy&); -@@ -320,7 +322,6 @@ private: + +@@ -336,7 +339,6 @@ private: // Get base64-encoded PNG data from a bitmap. static std::optional platformGetBase64EncodedPNGData(WebCore::ShareableBitmap::Handle&&); @@ -11679,10 +11505,10 @@ index 62250eac7b9d4e38b3d9ccad743daaf1627ff017..218f379aea078cfa27c0af5a963a2d3d // Save base64-encoded file contents to a local file path and return the path. // This reuses the basename of the remote file path so that the filename exposed to DOM API remains the same. diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp -index 9d98e6bf5266ed4cafd77f646be8bdaeefc33cd3..c9a3288d9c0f6d3c735f6d79b70eb852f95602e8 100644 +index a4d1f15cd80b95ec8c82ac07cac3b8dfdae5916c..5182ffa031fd7278ea3bce5bb56e0a648f9223e2 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp -@@ -169,7 +169,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau +@@ -172,7 +172,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau launchOptions.processCmdPrefix = String::fromUTF8(processCmdPrefix); #endif // ENABLE(DEVELOPER_MODE) && (PLATFORM(GTK) || PLATFORM(WPE)) @@ -11695,7 +11521,7 @@ index 9d98e6bf5266ed4cafd77f646be8bdaeefc33cd3..c9a3288d9c0f6d3c735f6d79b70eb852 platformGetLaunchOptions(launchOptions); } diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h -index a8ee41c1155989a57a5c0bd09c5144e8103c7c7c..172d567478e36d275a23ae3db82281f4a7af5c26 100644 +index 1bca45f83bccfd8f917fc8a49b39414d9a8b6548..bcf8c5e5acb0652d04201aa8a8a840537e17e66f 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h @@ -296,13 +296,16 @@ protected: @@ -11717,14 +11543,18 @@ index a8ee41c1155989a57a5c0bd09c5144e8103c7c7c..172d567478e36d275a23ae3db82281f4 // Connection::Client diff --git a/Source/WebKit/UIProcess/BackingStore.h b/Source/WebKit/UIProcess/BackingStore.h -index f72e17dc0973d4523c4b29a14754ec6d6036e06f..153f7b8495404513e20db757c0269f9e3c4d0e2d 100644 +index 945c62704e0b25f04e9ee4be88b21f88aeda8bd9..ff9a8ee47e2669260743ae2174801b1cc3c4c413 100644 --- a/Source/WebKit/UIProcess/BackingStore.h +++ b/Source/WebKit/UIProcess/BackingStore.h -@@ -69,6 +69,7 @@ public: +@@ -67,6 +67,11 @@ public: float deviceScaleFactor() const { return m_deviceScaleFactor; } void paint(PlatformPaintContextPtr, const WebCore::IntRect&); ++#if PLATFORM(GTK) || USE(CAIRO) + RefPtr surface() const { return m_surface; } ++#elif USE(SKIA) ++ sk_sp surface() const { return m_surface; } ++#endif void incorporateUpdate(UpdateInfo&&); private: @@ -11840,7 +11670,7 @@ index 0000000000000000000000000000000000000000..cd66887de171cda7d15a8e4dc6dbff63 + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h -index 1eb07a8bfadb2c4477698940b9429eefacc7d059..30e8b82bb1d8ca88ec5af80580c0ca751d10485f 100644 +index 89d125f7742f81ead8c50f218ecb1771b8000636..baa6cf58ad502c6c033ee6293a6cc8d4ce608e7b 100644 --- a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h +++ b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.h @@ -25,6 +25,7 @@ @@ -11852,10 +11682,10 @@ index 1eb07a8bfadb2c4477698940b9429eefacc7d059..30e8b82bb1d8ca88ec5af80580c0ca75 namespace WebKit { diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h -index 47da0ee168267f6a4a27602ea0c3cffdeb0a8a44..70eef746a34ebc037e56b4a81675e1184a37d178 100644 +index 505b934da3a86e218d11e2db1406b0a0a4c7ec36..2e800a8f78fb6209de7f2950fbf84ae062633a4d 100644 --- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h +++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h -@@ -102,6 +102,7 @@ private: +@@ -103,6 +103,7 @@ private: void runJavaScriptAlert(WebPageProxy&, const WTF::String&, WebFrameProxy*, FrameInfoData&&, Function&& completionHandler) final; void runJavaScriptConfirm(WebPageProxy&, const WTF::String&, WebFrameProxy*, FrameInfoData&&, Function&& completionHandler) final; void runJavaScriptPrompt(WebPageProxy&, const WTF::String&, const WTF::String&, WebFrameProxy*, FrameInfoData&&, Function&&) final; @@ -11863,7 +11693,7 @@ index 47da0ee168267f6a4a27602ea0c3cffdeb0a8a44..70eef746a34ebc037e56b4a81675e118 void presentStorageAccessConfirmDialog(const WTF::String& requestingDomain, const WTF::String& currentDomain, CompletionHandler&&); void requestStorageAccessConfirm(WebPageProxy&, WebFrameProxy*, const WebCore::RegistrableDomain& requestingDomain, const WebCore::RegistrableDomain& currentDomain, std::optional&&, CompletionHandler&&) final; void decidePolicyForGeolocationPermissionRequest(WebPageProxy&, WebFrameProxy&, const FrameInfoData&, Function&) final; -@@ -220,6 +221,7 @@ private: +@@ -221,6 +222,7 @@ private: bool webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler : 1; @@ -11872,10 +11702,10 @@ index 47da0ee168267f6a4a27602ea0c3cffdeb0a8a44..70eef746a34ebc037e56b4a81675e118 bool webViewRequestStorageAccessPanelForDomainUnderCurrentDomainForQuirkDomainsCompletionHandler : 1; bool webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm -index de8a55897d3fd5bcb31d15b4eec187ebeaac21e6..fb5855993c24d2d5c766660435bd545dd39a59b0 100644 +index 54b225795a14877140396f612330d5212bbf5fea..9c006877aa2a9d4804c71ad34766750fe74539b9 100644 --- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm +++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm -@@ -134,6 +134,7 @@ void UIDelegate::setDelegate(id delegate) +@@ -134,6 +134,7 @@ void UIDelegate::setDelegate(id delegate) m_delegateMethods.webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:)]; m_delegateMethods.webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:)]; m_delegateMethods.webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:)]; @@ -11883,7 +11713,7 @@ index de8a55897d3fd5bcb31d15b4eec187ebeaac21e6..fb5855993c24d2d5c766660435bd545d m_delegateMethods.webViewRequestStorageAccessPanelUnderFirstPartyCompletionHandler = [delegate respondsToSelector:@selector(_webView:requestStorageAccessPanelForDomain:underCurrentDomain:completionHandler:)]; m_delegateMethods.webViewRequestStorageAccessPanelForDomainUnderCurrentDomainForQuirkDomainsCompletionHandler = [delegate respondsToSelector:@selector(_webView:requestStorageAccessPanelForDomain:underCurrentDomain:forQuirkDomains:completionHandler:)]; m_delegateMethods.webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:)]; -@@ -465,6 +466,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St +@@ -494,6 +495,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St }).get()]; } @@ -11893,14 +11723,14 @@ index de8a55897d3fd5bcb31d15b4eec187ebeaac21e6..fb5855993c24d2d5c766660435bd545d + auto delegate = m_uiDelegate->m_delegate.get(); + if (!delegate) + return; -+ [delegate webView:m_uiDelegate->m_webView.get().get() handleJavaScriptDialog:accept value:value]; ++ [delegate webView:m_uiDelegate->m_webView.get().get() handleJavaScriptDialog:accept value:value.createNSString().get()]; +} + void UIDelegate::UIClient::requestStorageAccessConfirm(WebPageProxy& webPageProxy, WebFrameProxy*, const WebCore::RegistrableDomain& requestingDomain, const WebCore::RegistrableDomain& currentDomain, std::optional&& organizationStorageAccessPromptQuirk, CompletionHandler&& completionHandler) { RefPtr uiDelegate = m_uiDelegate.get(); diff --git a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm -index 064f96db74bdf0df821846540d18e4792f3b2963..e4a0316168f739ef5b667006ceaf00ff30341e6c 100644 +index 1f2f95479d04ad49499db7dae7954c1c54db6d3e..4aee549a4b5a371b35ce012bcdc258147ddeba8c 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm @@ -42,7 +42,9 @@ @@ -11912,13 +11742,13 @@ index 064f96db74bdf0df821846540d18e4792f3b2963..e4a0316168f739ef5b667006ceaf00ff +#import "PasteboardTypes.h" #import "PlatformXRSystem.h" #import "PlaybackSessionManagerProxy.h" - #import "QuickLookThumbnailLoader.h" -@@ -322,11 +324,86 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() + #import "RemoteLayerTreeTransaction.h" +@@ -336,11 +338,86 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() void WebPageProxy::startDrag(const DragItem& dragItem, ShareableBitmap::Handle&& dragImageHandle) { + if (m_interceptDrags) { -+ NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName: m_overrideDragPasteboardName]; ++ NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName: m_overrideDragPasteboardName.createNSString().get()]; + + m_dragSelectionData = String([pasteboard name]); + if (auto replyID = grantAccessToCurrentPasteboardData(String([pasteboard name]), [] () { })) @@ -11931,7 +11761,7 @@ index 064f96db74bdf0df821846540d18e4792f3b2963..e4a0316168f739ef5b667006ceaf00ff + dragCancelled(); + return; + } -+ NSString *utiType = attachment->utiType(); ++ NSString *utiType = attachment->utiType().createNSString().get(); + if (!utiType.length) { + dragCancelled(); + return; @@ -11939,7 +11769,7 @@ index 064f96db74bdf0df821846540d18e4792f3b2963..e4a0316168f739ef5b667006ceaf00ff + + for (size_t index = 0; index < info.additionalTypesAndData.size(); ++index) { + auto nsData = info.additionalTypesAndData[index].second->createNSData(); -+ [pasteboard setData:nsData.get() forType:info.additionalTypesAndData[index].first]; ++ [pasteboard setData:nsData.get() forType:info.additionalTypesAndData[index].first.createNSString().get()]; + } + } else { + [pasteboard setString:@"" forType:PasteboardTypes::WebDummyPboardType]; @@ -12002,19 +11832,19 @@ index 064f96db74bdf0df821846540d18e4792f3b2963..e4a0316168f739ef5b667006ceaf00ff #if ENABLE(ATTACHMENT_ELEMENT) diff --git a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -index c16012314db5eee29263ea19d7627eaf3d9cfe79..7544eecb359d3263e2d3222658687fcfebb07af6 100644 +index c20de41306158d48f4a761e93618acad0f2ae130..0bc1c2e90f4c80c9b506de3cfaf17ae06c173406 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -@@ -437,7 +437,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END +@@ -434,7 +434,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END auto screenProperties = WebCore::collectScreenProperties(); parameters.screenProperties = WTFMove(screenProperties); #if PLATFORM(MAC) - parameters.useOverlayScrollbars = ([NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay); + parameters.useOverlayScrollbars = m_configuration->forceOverlayScrollbars() || ([NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay); #endif - - #if (PLATFORM(IOS) || PLATFORM(VISION)) && HAVE(AGX_COMPILER_SERVICE) -@@ -832,8 +832,8 @@ void WebProcessPool::registerNotificationObservers() + + #if PLATFORM(VISION) +@@ -833,8 +833,8 @@ void WebProcessPool::registerNotificationObservers() }]; m_scrollerStyleNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSPreferredScrollerStyleDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { @@ -12026,7 +11856,7 @@ index c16012314db5eee29263ea19d7627eaf3d9cfe79..7544eecb359d3263e2d3222658687fcf m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidBecomeActiveNotification object:NSApp queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp -index 9aeeff96ce40d58fe51124275b8fb60e8609d254..4840c7bb5c1ca1380205fd0167870b81bf3d873d 100644 +index 183a2dc44f4d2921e68a6ff5fd2fb0fb815753af..a17d0ed7d287694516305ba57a849ad8042e9287 100644 --- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp +++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp @@ -33,6 +33,7 @@ @@ -12048,22 +11878,20 @@ index 9aeeff96ce40d58fe51124275b8fb60e8609d254..4840c7bb5c1ca1380205fd0167870b81 #include #endif -@@ -49,6 +52,13 @@ +@@ -49,6 +52,11 @@ #include #endif +#if PLATFORM(WIN) -+#include +#include +#include -+#include +#endif + namespace WebKit { using namespace WebCore; -@@ -180,6 +190,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange(CompletionH - completionHandler(); +@@ -182,6 +190,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange(CompletionH + sendWithAsyncReply(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor()), WTFMove(completionHandler)); } +void DrawingAreaProxyCoordinatedGraphics::waitForSizeUpdate(Function&& callback) @@ -12074,38 +11902,20 @@ index 9aeeff96ce40d58fe51124275b8fb60e8609d254..4840c7bb5c1ca1380205fd0167870b81 void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable) { #if !PLATFORM(WPE) -@@ -241,6 +256,45 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6 +@@ -243,6 +256,42 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6 updateAcceleratedCompositingMode(layerTreeContext); } -+#if PLATFORM(WIN) -+void DrawingAreaProxyCoordinatedGraphics::didChangeAcceleratedCompositingMode(bool enabled) -+{ -+ m_isInAcceleratedCompositingMode = enabled; -+} -+#endif -+ -+#if !PLATFORM(WPE) ++#if PLATFORM(GTK) +void DrawingAreaProxyCoordinatedGraphics::captureFrame() +{ + RefPtr surface; -+#if PLATFORM(WIN) -+ HWndDC dc; -+ if (m_isInAcceleratedCompositingMode) { -+ dc.setHWnd(reinterpret_cast(protectedWebPageProxy()->viewWidget())); -+ surface = adoptRef(cairo_win32_surface_create(dc)); -+#else + if (isInAcceleratedCompositingMode()) { -+# if PLATFORM(GTK) + AcceleratedBackingStore* backingStore = webkitWebViewBaseGetAcceleratedBackingStore(WEBKIT_WEB_VIEW_BASE(protectedWebPageProxy()->viewWidget())); + if (!backingStore) + return; + + surface = backingStore->surface(); -+# else -+ fprintf(stderr, "captureFrame() is not supported in accelerated compositing mode on this platform.\n"); -+# endif -+#endif + } else if (m_backingStore) { + surface = m_backingStore->surface(); + } @@ -12115,12 +11925,27 @@ index 9aeeff96ce40d58fe51124275b8fb60e8609d254..4840c7bb5c1ca1380205fd0167870b81 + + protectedWebPageProxy()->inspectorController().didPaint(surface.get()); +} -+#endif ++#endif // PLATFORM(GTK) ++ ++#if PLATFORM(WIN) ++void DrawingAreaProxyCoordinatedGraphics::captureFrame() ++{ ++ if (!m_backingStore) ++ return; ++ auto surface = m_backingStore->surface(); ++ if (!surface) ++ return; ++ auto image = surface->makeImageSnapshot(); ++ if (!image) ++ return; ++ protectedWebPageProxy()->inspectorController().didPaint(WTFMove(image)); ++} ++#endif // PLATFORM(WIN) + bool DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing() const { if (!m_webPageProxy) -@@ -308,6 +362,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() +@@ -310,6 +359,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() // we need to resend the new size here. if (m_lastSentSize != m_size) sendUpdateGeometry(); @@ -12134,7 +11959,7 @@ index 9aeeff96ce40d58fe51124275b8fb60e8609d254..4840c7bb5c1ca1380205fd0167870b81 #if !PLATFORM(WPE) diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h -index 9c2bde0db0e4032a32e6ae02dc45af335df92f7a..7ae72e6c791c264ea7e0db4c93a0422b5b699e19 100644 +index 9c2bde0db0e4032a32e6ae02dc45af335df92f7a..3f3a58ee9b0f5c0ddad84f41cf3acd6199d81c37 100644 --- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h +++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h @@ -29,6 +29,7 @@ @@ -12156,17 +11981,7 @@ index 9c2bde0db0e4032a32e6ae02dc45af335df92f7a..7ae72e6c791c264ea7e0db4c93a0422b void dispatchAfterEnsuringDrawing(CompletionHandler&&); -@@ -86,6 +91,9 @@ private: - void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, UpdateInfo&&) override; - void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override; - void dispatchPresentationCallbacksAfterFlushingLayers(IPC::Connection&, Vector&&) override; -+#if PLATFORM(WIN) -+ void didChangeAcceleratedCompositingMode(bool enabled) override; -+#endif - - bool shouldSendWheelEventsToEventDispatcher() const override { return true; } - -@@ -129,6 +137,7 @@ private: +@@ -129,6 +134,7 @@ private: // The last size we sent to the web process. WebCore::IntSize m_lastSentSize; @@ -12174,19 +11989,8 @@ index 9c2bde0db0e4032a32e6ae02dc45af335df92f7a..7ae72e6c791c264ea7e0db4c93a0422b #if !PLATFORM(WPE) bool m_isBackingStoreDiscardable { true }; -@@ -137,6 +146,10 @@ private: - RunLoop::Timer m_discardBackingStoreTimer; - #endif - std::unique_ptr m_drawingMonitor; -+ -+#if PLATFORM(WIN) -+ bool m_isInAcceleratedCompositingMode { false }; -+#endif - }; - - } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp -index 8fe224d8c374d0a7cabb1cbf02b678061e58bacf..89be23d0d8759097c0d6b2c9bf9df614ddc278a5 100644 +index 248a3bc1d03be7bca3c4324b93f13b452d91cc42..1ebb98bea247b882335569560d9fe8678f5d4793 100644 --- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp +++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp @@ -41,8 +41,10 @@ @@ -12207,7 +12011,7 @@ index 8fe224d8c374d0a7cabb1cbf02b678061e58bacf..89be23d0d8759097c0d6b2c9bf9df614 + , m_uuid(createVersion4UUIDString()) { + if (auto* instrumentation = m_dataStore->downloadInstrumentation()) -+ instrumentation->downloadCreated(m_uuid, m_request, frameInfoData, originatingPage, this); ++ instrumentation->downloadCreated(m_uuid, m_request, m_frameInfo->frameInfoData(), originatingPage, this); } DownloadProxy::~DownloadProxy() @@ -12263,7 +12067,7 @@ index 8fe224d8c374d0a7cabb1cbf02b678061e58bacf..89be23d0d8759097c0d6b2c9bf9df614 SandboxExtension::Handle sandboxExtensionHandle; if (!destination.isNull()) { @@ -227,6 +262,8 @@ void DownloadProxy::didFinish() - m_client->didFinish(*this); + protectedClient()->didFinish(*this); if (m_downloadIsCancelled) return; + if (auto* instrumentation = m_dataStore->downloadInstrumentation()) @@ -12274,14 +12078,14 @@ index 8fe224d8c374d0a7cabb1cbf02b678061e58bacf..89be23d0d8759097c0d6b2c9bf9df614 @@ -241,6 +278,8 @@ void DownloadProxy::didFail(const ResourceError& error, std::span m_legacyResumeData = createData(resumeData); - m_client->didFail(*this, error, m_legacyResumeData.get()); + protectedClient()->didFail(*this, error, m_legacyResumeData.get()); + if (auto* instrumentation = m_dataStore->downloadInstrumentation()) + instrumentation->downloadFinished(m_uuid, error.localizedDescription()); // This can cause the DownloadProxy object to be deleted. if (RefPtr downloadProxyMap = m_downloadProxyMap.get()) diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.h b/Source/WebKit/UIProcess/Downloads/DownloadProxy.h -index 5c48a4c5f1747687ef5dace933feae900b02991e..1e85682f2f4351d2c2da955dd36abf95303320a6 100644 +index 9a92a8cde3b5d1da0fbbf5fe7c549cebb8a7f2f7..9ce201ca2d7aa002c7bd389f1fe03edfb306df5d 100644 --- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.h +++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.h @@ -166,6 +166,7 @@ private: @@ -12293,7 +12097,7 @@ index 5c48a4c5f1747687ef5dace933feae900b02991e..1e85682f2f4351d2c2da955dd36abf95 } // namespace WebKit diff --git a/Source/WebKit/UIProcess/DrawingAreaProxy.h b/Source/WebKit/UIProcess/DrawingAreaProxy.h -index e1f55b4a7fbc452ca1f2eb025b0c88ec9f4b845f..4e4238f4f656208c0f11822406172ea13a21e2d4 100644 +index e1f55b4a7fbc452ca1f2eb025b0c88ec9f4b845f..beb3c7a6619b554bb3186a0de917f497ac0f47f8 100644 --- a/Source/WebKit/UIProcess/DrawingAreaProxy.h +++ b/Source/WebKit/UIProcess/DrawingAreaProxy.h @@ -94,6 +94,7 @@ public: @@ -12304,29 +12108,6 @@ index e1f55b4a7fbc452ca1f2eb025b0c88ec9f4b845f..4e4238f4f656208c0f11822406172ea1 virtual void minimumSizeForAutoLayoutDidChange() { } virtual void sizeToContentAutoSizeMaximumSizeDidChange() { } -@@ -181,6 +182,10 @@ private: - virtual void update(uint64_t /* backingStoreStateID */, UpdateInfo&&) { } - virtual void exitAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, UpdateInfo&&) { } - #endif -+ -+#if PLATFORM(WIN) -+ virtual void didChangeAcceleratedCompositingMode(bool) { } -+#endif - }; - - } // namespace WebKit -diff --git a/Source/WebKit/UIProcess/DrawingAreaProxy.messages.in b/Source/WebKit/UIProcess/DrawingAreaProxy.messages.in -index b03ac2dcf12c771da4a2347b81e5ba93fbd5f6a4..b69c5d3244306e1d1c10206d499d9a833a3efeec 100644 ---- a/Source/WebKit/UIProcess/DrawingAreaProxy.messages.in -+++ b/Source/WebKit/UIProcess/DrawingAreaProxy.messages.in -@@ -35,4 +35,7 @@ messages -> DrawingAreaProxy { - Update(uint64_t stateID, struct WebKit::UpdateInfo updateInfo) CanDispatchOutOfOrder - ExitAcceleratedCompositingMode(uint64_t backingStoreStateID, struct WebKit::UpdateInfo updateInfo) - #endif -+#if PLATFORM(WIN) -+ DidChangeAcceleratedCompositingMode(bool enabled) -+#endif - } diff --git a/Source/WebKit/UIProcess/Inspector/Agents/CairoJpegEncoder.cpp b/Source/WebKit/UIProcess/Inspector/Agents/CairoJpegEncoder.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8d20e2aa36ba0f7996c20a6a02792c7f151bbed5 @@ -12617,7 +12398,7 @@ index 0000000000000000000000000000000000000000..4ec8b96bbbddf8a7b042f53a8068754a +cairo_status_t cairo_image_surface_write_to_jpeg_mem(cairo_surface_t *sfc, unsigned char **data, size_t *len, int quality); diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..033bf77bca2de127e55cbf55a9e0b0c358fc81f9 +index 0000000000000000000000000000000000000000..55a0cf8cd5be1cdd33165fe904a8f0ffd815f6d4 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp @@ -0,0 +1,392 @@ @@ -12726,7 +12507,7 @@ index 0000000000000000000000000000000000000000..033bf77bca2de127e55cbf55a9e0b0c3 +void InspectorScreencastAgent::didPaint(sk_sp&& surface) +{ + sk_sp image(surface); -+#if PLATFORM(WPE) ++#if PLATFORM(WPE) || PLATFORM(WIN) + // Get actual image size (in device pixels). + WebCore::IntSize displaySize(image->width(), image->height()); + @@ -12999,7 +12780,7 @@ index 0000000000000000000000000000000000000000..033bf77bca2de127e55cbf55a9e0b0c3 +} +#endif + -+#if (USE(CAIRO) && !PLATFORM(WPE)) || PLATFORM(GTK) ++#if PLATFORM(GTK) || PLATFORM(WIN) +void InspectorScreencastAgent::encodeFrame() +{ + if (!m_encoder && !m_screencast) @@ -13130,7 +12911,7 @@ index 0000000000000000000000000000000000000000..f53bb59c65a4ced0360e473fb9ed9a36 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..760f6ab8714c45f0019e583970767ea40e35d818 +index 0000000000000000000000000000000000000000..bec42378013c93ee6bd37f62a1d6a1c68d167fa3 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp @@ -0,0 +1,443 @@ @@ -13453,7 +13234,7 @@ index 0000000000000000000000000000000000000000..760f6ab8714c45f0019e583970767ea4 + memset(&cfg, 0, sizeof(cfg)); + vpx_codec_err_t error = vpx_codec_enc_config_default(codec_interface, &cfg, 0); + if (error) { -+ errorString = makeString("Failed to get default codec config: "_s, span(vpx_codec_err_to_string(error))); ++ errorString = makeString("Failed to get default codec config: "_s, unsafeSpan(vpx_codec_err_to_string(error))); + return nullptr; + } + @@ -13465,13 +13246,13 @@ index 0000000000000000000000000000000000000000..760f6ab8714c45f0019e583970767ea4 + + ScopedVpxCodec codec(new vpx_codec_ctx_t); + if (vpx_codec_enc_init(codec.get(), codec_interface, &cfg, 0)) { -+ errorString = makeString("Failed to initialize encoder: "_s, span(vpx_codec_error(codec.get()))); ++ errorString = makeString("Failed to initialize encoder: "_s, unsafeSpan(vpx_codec_error(codec.get()))); + return nullptr; + } + + FILE* file = fopen(filePath.utf8().data(), "wb"); + if (!file) { -+ errorString = makeString("Failed to open file '"_s, filePath, "' for writing: "_s, span(strerror(errno))); ++ errorString = makeString("Failed to open file '"_s, filePath, "' for writing: "_s, unsafeSpan(strerror(errno))); + return nullptr; + } + @@ -13800,7 +13581,7 @@ index 0000000000000000000000000000000000000000..e2ce910f3fd7f587add552275b7e7176 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp -index 77bdb25abf77bc0f7f00d3dbd57b0eb751c99488..6d3a93a009cff0f70f2b1a1e674827c24a26a947 100644 +index 76cc869ca4d5fc311040a285d50a44f00273fd63..633f8323697f0c2f30311a35ac3876bf8e03b741 100644 --- a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp +++ b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp @@ -28,7 +28,7 @@ @@ -13828,7 +13609,7 @@ index 77bdb25abf77bc0f7f00d3dbd57b0eb751c99488..6d3a93a009cff0f70f2b1a1e674827c2 target->m_provisionalPage = provisionalPage; return target; } -@@ -105,6 +105,31 @@ void InspectorTargetProxy::didCommitProvisionalTarget() +@@ -108,6 +108,31 @@ void InspectorTargetProxy::didCommitProvisionalTarget() m_provisionalPage = nullptr; } @@ -13894,14 +13675,15 @@ index edd6e7f1799279ed3d0eb81b6c2eef9f5b375134..d4231f84f3c52641f4d9e88559e8e1a4 String m_identifier; Inspector::InspectorTargetType m_type; diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp -index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49bdaee439a 100644 +index 45eb87344ce4249eea90dc0a73a2c717f69f55fa..b79c9ce9e9fd3ceb41fe6f34861536ab0bdf2e54 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp -@@ -26,13 +26,21 @@ +@@ -26,13 +26,22 @@ #include "config.h" #include "WebPageInspectorController.h" +#include "APINavigation.h" ++#include "APIPageConfiguration.h" #include "APIUIClient.h" #include "InspectorBrowserAgent.h" +#include "InspectorDialogAgent.h" @@ -13919,7 +13701,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b #include #include #include -@@ -52,34 +60,121 @@ static String getTargetID(const ProvisionalPageProxy& provisionalPage) +@@ -52,34 +61,115 @@ static String getTargetID(const ProvisionalPageProxy& provisionalPage) WTF_MAKE_TZONE_ALLOCATED_IMPL(WebPageInspectorController); @@ -13955,6 +13737,8 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b void WebPageInspectorController::init() { +- String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); +- createInspectorTarget(pageTargetId, Inspector::InspectorTargetType::Page); + auto targetAgent = makeUnique(m_frontendRouter.get(), m_backendDispatcher.get()); + m_targetAgent = targetAgent.get(); + m_agents.append(WTFMove(targetAgent)); @@ -13970,15 +13754,9 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b + m_agents.append(WTFMove(screencastAgent)); + if (s_observer) + s_observer->didCreateInspectorController(m_inspectedPage); ++} + -+ // window.open will create page with already running process. -+ if (!m_inspectedPage->hasRunningProcess()) -+ return; - String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); - createInspectorTarget(pageTargetId, Inspector::InspectorTargetType::Page); - } - -+void WebPageInspectorController::didFinishAttachingToWebProcess() ++void WebPageInspectorController::didInitializeWebPage() +{ + String pageTargetID = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); + // Create target only after attaching to a Web Process first time. Before that @@ -13986,8 +13764,8 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b + if (m_targets.contains(pageTargetID)) + return; + createInspectorTarget(pageTargetID, Inspector::InspectorTargetType::Page); -+} -+ + } + void WebPageInspectorController::pageClosed() { + String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); @@ -14046,7 +13824,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b } bool WebPageInspectorController::hasLocalFrontend() const -@@ -93,6 +188,17 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro +@@ -93,6 +183,17 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro bool connectingFirstFrontend = !m_frontendRouter->hasFrontends(); @@ -14064,7 +13842,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b m_frontendRouter->connectFrontend(frontendChannel); if (connectingFirstFrontend) -@@ -112,8 +218,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha +@@ -112,8 +213,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha m_frontendRouter->disconnectFrontend(frontendChannel); bool disconnectingLastFrontend = !m_frontendRouter->hasFrontends(); @@ -14076,7 +13854,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b auto inspectedPage = protectedInspectedPage(); inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); -@@ -137,6 +245,8 @@ void WebPageInspectorController::disconnectAllFrontends() +@@ -137,6 +240,8 @@ void WebPageInspectorController::disconnectAllFrontends() // Disconnect any remaining remote frontends. m_frontendRouter->disconnectAllFrontends(); @@ -14085,7 +13863,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b auto inspectedPage = protectedInspectedPage(); inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); -@@ -165,6 +275,75 @@ void WebPageInspectorController::setIndicating(bool indicating) +@@ -165,6 +270,75 @@ void WebPageInspectorController::setIndicating(bool indicating) } #endif @@ -14161,7 +13939,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b void WebPageInspectorController::createInspectorTarget(const String& targetId, Inspector::InspectorTargetType type) { addTarget(InspectorTargetProxy::create(protectedInspectedPage(), targetId, type)); -@@ -184,6 +363,48 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta +@@ -184,6 +358,52 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta m_targetAgent->sendMessageFromTargetToFrontend(targetId, message); } @@ -14191,7 +13969,11 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b + if (!m_frontendRouter->hasFrontends()) + return false; + -+ if (!m_inspectedPage->isPageOpenedByDOMShowingInitialEmptyDocument()) ++ // Only pause if the page was opened by window.open() or new tab navigation. ++ // We cannot use isPageOpenedByDOMShowingInitialEmptyDocument() here because ++ // this method maybe called from WebPageProxy::initializeWebPage and setOpenedByDOM ++ // is called after the page is initialized. ++ if (!m_inspectedPage->configuration().windowFeatures()) + return false; + + // The method is called from WebPageProxy::initializePage and the @@ -14210,7 +13992,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b bool WebPageInspectorController::shouldPauseLoading(const ProvisionalPageProxy& provisionalPage) const { if (!m_frontendRouter->hasFrontends()) -@@ -203,7 +424,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag +@@ -203,7 +423,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag void WebPageInspectorController::didCreateProvisionalPage(ProvisionalPageProxy& provisionalPage) { @@ -14219,7 +14001,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b } void WebPageInspectorController::willDestroyProvisionalPage(const ProvisionalPageProxy& provisionalPage) -@@ -287,4 +508,30 @@ void WebPageInspectorController::browserExtensionsDisabled(HashSet&& ext +@@ -287,4 +507,29 @@ void WebPageInspectorController::browserExtensionsDisabled(HashSet&& ext m_enabledBrowserAgent->extensionsDisabled(WTFMove(extensionIDs)); } @@ -14239,9 +14021,8 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b + m_inspectedPage->preferences().setJavaScriptCanOpenWindowsAutomatically(true); + + // Enable media stream. -+ if (!m_inspectedPage->preferences().mediaStreamEnabled()) { ++ if (!m_inspectedPage->preferences().mediaDevicesEnabled()) { + m_inspectedPage->preferences().setMediaDevicesEnabled(true); -+ m_inspectedPage->preferences().setMediaStreamEnabled(true); + m_inspectedPage->preferences().setPeerConnectionEnabled(true); + } + @@ -14251,7 +14032,7 @@ index e4f2f719746ed69b1226be2d47b16666f2067772..c0e4452b9c8e286e1944b47e46acf49b + } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h -index 29457fc3c76c963bf50b44c011f64398efbae676..b931b09dbf2768bdfa49633fc6329fb49b09205a 100644 +index c219e0a072057a8d40d8a30a1d404851d6c12d43..42e40b5ff6bd1b49d7662a1c7d60bfd4b8d61e29 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h @@ -26,19 +26,43 @@ @@ -14326,7 +14107,7 @@ index 29457fc3c76c963bf50b44c011f64398efbae676..b931b09dbf2768bdfa49633fc6329fb4 ~WebPageInspectorController(); void init(); -+ void didFinishAttachingToWebProcess(); ++ void didInitializeWebPage(); + + static void setObserver(WebPageInspectorControllerObserver*); + static WebPageInspectorControllerObserver* observer(); @@ -14387,8 +14168,8 @@ index 29457fc3c76c963bf50b44c011f64398efbae676..b931b09dbf2768bdfa49633fc6329fb4 void addTarget(std::unique_ptr&&); + void adjustPageSettings(); - Ref m_frontendRouter; - Ref m_backendDispatcher; + const Ref m_frontendRouter; + const Ref m_backendDispatcher; @@ -101,9 +176,16 @@ private: CheckedPtr m_targetAgent; HashMap> m_targets; @@ -14639,10 +14420,10 @@ index 0000000000000000000000000000000000000000..d0e11ed81a6257c011df23d5870da740 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..f7b2ecd583cd1eb5bb9e81becdfe07f5a855f2a9 +index 0000000000000000000000000000000000000000..59827ffa02a8a3c7890ab0b5a8f54244f6a0680b --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp -@@ -0,0 +1,1006 @@ +@@ -0,0 +1,1011 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -15398,6 +15179,16 @@ index 0000000000000000000000000000000000000000..f7b2ecd583cd1eb5bb9e81becdfe07f5 + return { }; +} + ++Inspector::Protocol::ErrorStringOr InspectorPlaywrightAgent::setPageZoomFactor(const String& pageProxyID, double zoomFactor) ++{ ++ auto* pageProxyChannel = m_pageProxyChannels.get(pageProxyID); ++ if (!pageProxyChannel) ++ return makeUnexpected("Unknown pageProxyID"_s); ++ ++ pageProxyChannel->page().setPageZoomFactor(zoomFactor); ++ return { }; ++} ++ +void InspectorPlaywrightAgent::getAllCookies(const String& browserContextID, Ref&& callback) { + String errorString; + BrowserContext* browserContext = lookupBrowserContext(errorString, browserContextID); @@ -15412,12 +15203,7 @@ index 0000000000000000000000000000000000000000..f7b2ecd583cd1eb5bb9e81becdfe07f5 + return; + auto cookies = JSON::ArrayOf::create(); + -+// Soup returns cookies in the reverse order. -+#if USE(SOUP) -+ for (const auto& cookie : makeReversedRange(allCookies)) -+#else + for (const auto& cookie : allCookies) -+#endif + cookies->addItem(buildObjectForCookie(cookie)); + callback->sendSuccess(WTFMove(cookies)); + }); @@ -15571,7 +15357,7 @@ index 0000000000000000000000000000000000000000..f7b2ecd583cd1eb5bb9e81becdfe07f5 +{ + if (!m_isEnabled) + return; -+ String frameID = WebCore::InspectorPageAgent::serializeFrameID(*frameInfoData.frameID); ++ String frameID = WebCore::InspectorPageAgent::serializeFrameID(frameInfoData.frameID); + m_downloads.set(uuid, download); + m_frontendDispatcher->downloadCreated( + toPageProxyIDProtocolString(*page), @@ -15651,10 +15437,10 @@ index 0000000000000000000000000000000000000000..f7b2ecd583cd1eb5bb9e81becdfe07f5 +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..2cd467df987e1679ff8918c2867bf253ce105b8c +index 0000000000000000000000000000000000000000..f9185788a118f57e98bec149909a206dc1aa5d99 --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h -@@ -0,0 +1,140 @@ +@@ -0,0 +1,141 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -15757,6 +15543,7 @@ index 0000000000000000000000000000000000000000..2cd467df987e1679ff8918c2867bf253 + Inspector::Protocol::ErrorStringOr grantFileReadAccess(const String& pageProxyID, Ref&& paths) override; + void takePageScreenshot(const String& pageProxyID, int x, int y, int width, int height, std::optional&& omitDeviceScaleFactor, Ref&&) override; + Inspector::Protocol::ErrorStringOr setIgnoreCertificateErrors(const String& browserContextID, bool ignore) override; ++ Inspector::Protocol::ErrorStringOr setPageZoomFactor(const String& pageProxyID, double zoomFactor) override; + + void getAllCookies(const String& browserContextID, Ref&&) override; + void setCookies(const String& browserContextID, Ref&& in_cookies, Ref&&) override; @@ -15875,7 +15662,7 @@ index 0000000000000000000000000000000000000000..e7a3dcc533294bb6e12f65d79b5b716b + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp -index e0c2996d93c2fe483024e13fb5b50a93a4e38150..6af596bd81076961f4e7e750d18c8b9dfd84f467 100644 +index 272e0a6edea50acd35032a854d625b5af5a1472e..486c807ba879ecf534db1ffb593709d117e0c35a 100644 --- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp +++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp @@ -168,6 +168,13 @@ void ProcessLauncher::launchProcess() @@ -15892,7 +15679,7 @@ index e0c2996d93c2fe483024e13fb5b50a93a4e38150..6af596bd81076961f4e7e750d18c8b9d WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN // GTK/WPE port -@@ -186,6 +193,10 @@ void ProcessLauncher::launchProcess() +@@ -188,6 +195,10 @@ void ProcessLauncher::launchProcess() if (configureJSCForTesting) argv[i++] = const_cast("--configure-jsc-for-testing"); #endif @@ -15904,7 +15691,7 @@ index e0c2996d93c2fe483024e13fb5b50a93a4e38150..6af596bd81076961f4e7e750d18c8b9d WTF_ALLOW_UNSAFE_BUFFER_USAGE_END diff --git a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp -index fac881d7c3d44758591d7a9f392a3992ce9f9a72..35eba5a0b31fc6e2d6e5c05c9f866c03d2e1c7d0 100644 +index a108acd8a4503a07309fe8c54afc80b0f4175eae..1421d9a761042c31a6ecf3cc78ce3f0e96109abe 100644 --- a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp +++ b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp @@ -91,14 +91,21 @@ void ProcessLauncher::launchProcess() @@ -15931,7 +15718,7 @@ index fac881d7c3d44758591d7a9f392a3992ce9f9a72..35eba5a0b31fc6e2d6e5c05c9f866c03 BOOL result = ::CreateProcess(0, commandLine.data(), 0, 0, true, 0, 0, 0, &startupInfo, &processInformation); diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h -index e978cabad88aeb44a8722f0df7eed9cff0320653..c1753b243bf51870aa4a1b3d3a1163bd8310596d 100644 +index 0cffbf89f6b402b9aaa65bf9edd7387f0aff65da..baa97c9400538243f96af3bde2482dbd3542b38d 100644 --- a/Source/WebKit/UIProcess/PageClient.h +++ b/Source/WebKit/UIProcess/PageClient.h @@ -74,6 +74,11 @@ @@ -15959,7 +15746,7 @@ index e978cabad88aeb44a8722f0df7eed9cff0320653..c1753b243bf51870aa4a1b3d3a1163bd namespace API { class Attachment; class HitTestResult; -@@ -373,7 +384,20 @@ public: +@@ -380,7 +391,20 @@ public: virtual void selectionDidChange() = 0; #endif @@ -15983,10 +15770,10 @@ index e978cabad88aeb44a8722f0df7eed9cff0320653..c1753b243bf51870aa4a1b3d3a1163bd diff --git a/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.cpp b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..d365dfd28dcc5d101b4d3859302b1bfe75f01a55 +index 0000000000000000000000000000000000000000..95b682567eba682f927317cd3327a531358dfebc --- /dev/null +++ b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.cpp -@@ -0,0 +1,57 @@ +@@ -0,0 +1,64 @@ +/* + * Copyright (C) 2023 Microsoft Corporation. + * @@ -16028,17 +15815,24 @@ index 0000000000000000000000000000000000000000..d365dfd28dcc5d101b4d3859302b1bfe +{ +} + -+void PlaywrightFullScreenManagerProxyClient::enterFullScreen() ++void PlaywrightFullScreenManagerProxyClient::enterFullScreen(WebCore::FloatSize, CompletionHandler&& completionHandler) ++{ ++ completionHandler(true); ++} ++ ++void PlaywrightFullScreenManagerProxyClient::exitFullScreen(CompletionHandler&& completionHandler) +{ -+ m_pageProxy.fullScreenManager()->willEnterFullScreen(); -+ m_pageProxy.fullScreenManager()->didEnterFullScreen(); ++ completionHandler(); +} + -+void PlaywrightFullScreenManagerProxyClient::exitFullScreen() ++void PlaywrightFullScreenManagerProxyClient::beganEnterFullScreen(const WebCore::IntRect&, const WebCore::IntRect&, CompletionHandler&& completionHandler) +{ -+ m_pageProxy.fullScreenManager()->willExitFullScreen(); -+ m_pageProxy.fullScreenManager()->didExitFullScreen(); ++ completionHandler(true); ++} + ++void PlaywrightFullScreenManagerProxyClient::beganExitFullScreen(const WebCore::IntRect&, const WebCore::IntRect&, CompletionHandler&& completionHandler) ++{ ++ completionHandler(); +} + +} // namespace WebKit @@ -16046,7 +15840,7 @@ index 0000000000000000000000000000000000000000..d365dfd28dcc5d101b4d3859302b1bfe +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h new file mode 100644 -index 0000000000000000000000000000000000000000..3c8fd0549f1847515d35092f0f49b0602be86819 +index 0000000000000000000000000000000000000000..a8a92a6c5f4b03724decc97828291f6f27cfc6aa --- /dev/null +++ b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h @@ -0,0 +1,56 @@ @@ -16094,10 +15888,10 @@ index 0000000000000000000000000000000000000000..3c8fd0549f1847515d35092f0f49b060 +private: + void closeFullScreenManager() override { } + bool isFullScreen() override { return m_isFullScreen; } -+ void enterFullScreen() override; -+ void exitFullScreen() override; -+ void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override { } -+ void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override { } ++ void enterFullScreen(WebCore::FloatSize mediaDimensions, CompletionHandler&&) override; ++ void exitFullScreen(CompletionHandler&&) override; ++ void beganEnterFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame, CompletionHandler&&) override; ++ void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame, CompletionHandler&&) override; + + WebPageProxy& m_pageProxy; + bool m_isFullScreen { false }; @@ -16107,7 +15901,7 @@ index 0000000000000000000000000000000000000000..3c8fd0549f1847515d35092f0f49b060 + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp -index 949c12f22544a17e9047def6f1ddf6a6e6fc1adc..bfd4d442f971e3956ed6d6962f7a570ff0a0755c 100644 +index 6a324ab3945475beed2774ab596645c72a6f658e..9045758645d48123c574a2ba7529a433c1a99f57 100644 --- a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp +++ b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp @@ -25,6 +25,7 @@ @@ -16425,20 +16219,8 @@ index 0000000000000000000000000000000000000000..6d04f9290135069359ce6bf872654648 +} // namespace WebKit + +#endif // ENABLE(REMOTE_INSPECTOR) -diff --git a/Source/WebKit/UIProcess/RemotePageProxy.cpp b/Source/WebKit/UIProcess/RemotePageProxy.cpp -index eae3ae7fdac55067463e1571068ec8cf25408bd9..707e9feec18d94c3a14b49e5826cab1026ff234a 100644 ---- a/Source/WebKit/UIProcess/RemotePageProxy.cpp -+++ b/Source/WebKit/UIProcess/RemotePageProxy.cpp -@@ -44,6 +44,7 @@ - #include "WebProcessActivityState.h" - #include "WebProcessMessages.h" - #include "WebProcessProxy.h" -+#include "WebProcessMessages.h" - #include - #include - diff --git a/Source/WebKit/UIProcess/WebContextMenuProxy.h b/Source/WebKit/UIProcess/WebContextMenuProxy.h -index c951d8577473371d8eb59ad651451737349c4389..b38cd0967ae45733a94594fd25900ddc1d49c3f6 100644 +index 697a350812e1bf73dd44cc3d723a6a291f9d59d1..a8e1edd710d88f48632d51fd05aa964732d727d3 100644 --- a/Source/WebKit/UIProcess/WebContextMenuProxy.h +++ b/Source/WebKit/UIProcess/WebContextMenuProxy.h @@ -49,6 +49,7 @@ public: @@ -16448,7 +16230,7 @@ index c951d8577473371d8eb59ad651451737349c4389..b38cd0967ae45733a94594fd25900ddc + virtual void hide() {} WebPageProxy* page() const { return m_page.get(); } - + RefPtr protectedPage() const; diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0a8d10ae990997684766df46719c65aa8dd77f28 @@ -16698,7 +16480,7 @@ index 0000000000000000000000000000000000000000..d00d00ce8fd800dc1497b36b8a495c5b +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..447af997796cf74a2c6259f16aad4da5581254f9 +index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49fd8e9cda --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp @@ -0,0 +1,394 @@ @@ -16969,7 +16751,7 @@ index 0000000000000000000000000000000000000000..447af997796cf74a2c6259f16aad4da5 + m_mouseCallbacks->append(WTFMove(callback)); + + // Convert css coordinates to view coordinates (dip). -+ double totalScale = m_page.pageScaleFactor() * m_page.viewScaleFactor(); ++ double totalScale = m_page.pageScaleFactor() * m_page.viewScaleFactor() * m_page.pageZoomFactor(); + x = clampToInteger(roundf(x * totalScale)); + y = clampToInteger(roundf(y * totalScale)); + eventDeltaX = clampToInteger(roundf(eventDeltaX * totalScale)); @@ -17082,7 +16864,7 @@ index 0000000000000000000000000000000000000000..447af997796cf74a2c6259f16aad4da5 + m_wheelCallbacks->append(WTFMove(callback)); + + // Convert css coordinates to view coordinates (dip). -+ double totalScale = m_page.pageScaleFactor() * m_page.viewScaleFactor(); ++ double totalScale = m_page.pageScaleFactor() * m_page.viewScaleFactor() * m_page.pageZoomFactor(); + x = clampToInteger(roundf(x * totalScale)); + y = clampToInteger(roundf(y * totalScale)); + @@ -17190,25 +16972,26 @@ index 0000000000000000000000000000000000000000..26a2a3c0791c334f811ec99a630314f8 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp -index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b913064f8ae471 100644 +index 8596e12ab413647f88507c1bbfebcd5ca441a190..11ce2408b8358bc2ebe3abfc79c47662e991d7c0 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit/UIProcess/WebPageProxy.cpp -@@ -199,12 +199,14 @@ +@@ -203,6 +203,7 @@ #include #include #include +#include #include #include - #include - #include - #include - #include + #include +@@ -214,6 +215,7 @@ + #include + #include + #include +#include #include #include #include -@@ -227,6 +229,7 @@ +@@ -238,6 +240,7 @@ #include #include #include @@ -17216,7 +16999,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 #include #include #include -@@ -234,10 +237,13 @@ +@@ -245,10 +248,13 @@ #include #include #include @@ -17230,7 +17013,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 #include #include #include -@@ -324,6 +330,9 @@ +@@ -336,6 +342,9 @@ #if USE(GBM) #include "AcceleratedBackingStoreDMABuf.h" #endif @@ -17240,7 +17023,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 #include #endif -@@ -452,6 +461,8 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; +@@ -461,6 +470,8 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; static constexpr Seconds audibleActivityClearDelay = 10_s; #endif @@ -17249,10 +17032,10 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webPageProxyCounter, ("WebPageProxy")); #if PLATFORM(COCOA) -@@ -939,6 +950,10 @@ WebPageProxy::~WebPageProxy() - if (RefPtr gpuProcess = GPUProcessProxy::singletonIfCreated()) - gpuProcess->setPresentingApplicationAuditToken(m_legacyMainFrameProcess->coreProcessIdentifier(), m_webPageID, std::nullopt); +@@ -983,6 +994,10 @@ WebPageProxy::~WebPageProxy() #endif + + internals().updatePlayingMediaDidChangeTimer.stop(); + +#if PLATFORM(COCOA) + releaseInspectorDragPasteboard(); @@ -17260,15 +17043,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 } Ref WebPageProxy::Internals::protectedPage() const -@@ -1515,6 +1530,7 @@ void WebPageProxy::finishAttachingToWebProcess(const Site& site, ProcessLaunchRe - if (RefPtr pageClient = this->pageClient()) - pageClient->didRelaunchProcess(); - protectedPageLoadState()->didSwapWebProcesses(); -+ m_inspectorController->didFinishAttachingToWebProcess(); - } - - void WebPageProxy::didAttachToRunningProcess() -@@ -1523,7 +1539,7 @@ void WebPageProxy::didAttachToRunningProcess() +@@ -1556,7 +1571,7 @@ void WebPageProxy::didAttachToRunningProcess() #if ENABLE(FULLSCREEN_API) ASSERT(!m_fullScreenManager); @@ -17277,7 +17052,15 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 #endif #if ENABLE(VIDEO_PRESENTATION_MODE) ASSERT(!m_playbackSessionManager); -@@ -1989,6 +2005,21 @@ Ref WebPageProxy::ensureProtectedRunningProcess() +@@ -1722,6 +1737,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags eff + if (preferences->siteIsolationEnabled()) + browsingContextGroup->addPage(*this); + process->send(Messages::WebProcess::CreateWebPage(m_webPageID, creationParameters(process, *m_drawingArea, m_mainFrame->frameID(), std::nullopt)), 0); ++ m_inspectorController->didInitializeWebPage(); + + #if ENABLE(WINDOW_PROXY_PROPERTY_ACCESS_NOTIFICATION) + internals().frameLoadStateObserver = makeUniqueWithoutRefCountedCheck(*this); +@@ -1988,6 +2004,21 @@ Ref WebPageProxy::ensureProtectedRunningProcess() return ensureRunningProcess(); } @@ -17299,7 +17082,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 RefPtr WebPageProxy::loadRequest(WebCore::ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, IsPerformingHTTPFallback isPerformingHTTPFallback, std::unique_ptr&& lastNavigationAction, API::Object* userData) { if (m_isClosed) -@@ -2086,11 +2117,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref&& proces +@@ -2103,11 +2134,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref&& proces navigation->setIsLoadedWithNavigationShared(true); protectedProcess->markProcessAsRecentlyUsed(); @@ -17333,7 +17116,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 }); } -@@ -2634,6 +2683,61 @@ void WebPageProxy::setControlledByAutomation(bool controlled) +@@ -2661,6 +2710,63 @@ void WebPageProxy::setControlledByAutomation(bool controlled) protectedWebsiteDataStore()->protectedNetworkProcess()->send(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation), 0); } @@ -17389,13 +17172,15 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 + +void WebPageProxy::logToStderr(const String& str) +{ ++WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN + fprintf(stderr, "RENDERER: %s\n", str.utf8().data()); ++WTF_ALLOW_UNSAFE_BUFFER_USAGE_END +} + void WebPageProxy::createInspectorTarget(IPC::Connection& connection, const String& targetId, Inspector::InspectorTargetType type) { MESSAGE_CHECK_BASE(!targetId.isEmpty(), connection); -@@ -2886,6 +2990,24 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) +@@ -2920,6 +3026,24 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) bool wasVisible = isViewVisible(); RefPtr pageClient = this->pageClient(); internals().activityState.remove(flagsToUpdate); @@ -17420,7 +17205,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 if (flagsToUpdate & ActivityState::IsFocused && pageClient->isViewFocused()) internals().activityState.add(ActivityState::IsFocused); if (flagsToUpdate & ActivityState::WindowIsActive && pageClient->isViewWindowActive()) -@@ -3654,7 +3776,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt +@@ -3683,7 +3807,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt if (!hasRunningProcess()) return; @@ -17429,7 +17214,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 URL url { dragData.asURL() }; if (url.protocolIsFile()) protectedLegacyMainFrameProcess()->assumeReadAccessToBaseURL(*this, url.string(), [] { }); -@@ -3682,6 +3804,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag +@@ -3711,6 +3835,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag if (!hasRunningProcess()) return; @@ -17438,7 +17223,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 auto completionHandler = [this, protectedThis = Ref { *this }, action, dragData] (std::optional dragOperation, WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const IntRect& insertionRect, const IntRect& editableElementRect, std::optional remoteUserInputEventData) mutable { if (!m_pageClient) return; -@@ -3693,7 +3817,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag +@@ -3722,7 +3848,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag dragData.setClientPosition(remoteUserInputEventData->transformedPoint); performDragControllerAction(action, dragData, remoteUserInputEventData->targetFrameID); }; @@ -17447,7 +17232,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 ASSERT(dragData.platformData()); sendWithAsyncReplyToProcessContainingFrame(frameID, Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags()), WTFMove(completionHandler)); #else -@@ -3728,14 +3852,35 @@ void WebPageProxy::didPerformDragControllerAction(std::optionalpageClient()) pageClient->didPerformDragControllerAction(); @@ -17487,7 +17272,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 } didStartDrag(); } -@@ -3757,6 +3902,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo +@@ -3786,6 +3933,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo setDragCaretRect({ }); } @@ -17512,7 +17297,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 void WebPageProxy::didStartDrag() { if (!hasRunningProcess()) -@@ -3764,6 +3927,26 @@ void WebPageProxy::didStartDrag() +@@ -3793,6 +3958,26 @@ void WebPageProxy::didStartDrag() discardQueuedMouseEvents(); send(Messages::WebPage::DidStartDrag()); @@ -17539,7 +17324,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 } void WebPageProxy::dragCancelled() -@@ -3911,26 +4094,47 @@ void WebPageProxy::processNextQueuedMouseEvent() +@@ -3958,26 +4143,47 @@ void WebPageProxy::processNextQueuedMouseEvent() process->startResponsivenessTimer(); } @@ -17594,21 +17379,21 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 + m_dragSelectionData = std::nullopt; + dragEnded(event.position(), event.globalPosition(), m_dragSourceOperationMask); + } -+ didReceiveEvent(eventType, true, std::nullopt); ++ didReceiveEventIPC(process->connection(), eventType, true, std::nullopt); + } } void WebPageProxy::doAfterProcessingAllPendingMouseEvents(WTF::Function&& action) -@@ -4099,6 +4303,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) +@@ -4174,6 +4380,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) - if (RefPtr automationSession = protectedConfiguration()->processPool().automationSession()) + if (RefPtr automationSession = m_configuration->processPool().automationSession()) automationSession->wheelEventsFlushedForPage(*this); + + m_inspectorController->didProcessAllPendingWheelEvents(); } void WebPageProxy::cacheWheelEventScrollingAccelerationCurve(const NativeWebWheelEvent& nativeWheelEvent) -@@ -4234,7 +4440,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) +@@ -4310,7 +4518,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent) { @@ -17617,7 +17402,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 for (auto& touchPoint : touchStartEvent.touchPoints()) { auto location = touchPoint.locationInRootView(); auto update = [this, location](TrackingType& trackingType, EventTrackingRegions::EventType eventType) { -@@ -4861,6 +5067,7 @@ void WebPageProxy::receivedNavigationActionPolicyDecision(WebProcessProxy& proce +@@ -4972,6 +5180,7 @@ void WebPageProxy::receivedNavigationActionPolicyDecision(WebProcessProxy& proce void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, RefPtr&& websitePolicies, Ref&& navigationAction, WillContinueLoadInNewProcess willContinueLoadInNewProcess, std::optional sandboxExtensionHandle, std::optional&& consoleMessage, CompletionHandler&& completionHandler) { @@ -17625,7 +17410,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 if (!hasRunningProcess()) return completionHandler(PolicyDecision { }); -@@ -5857,6 +6064,7 @@ void WebPageProxy::viewScaleFactorDidChange(IPC::Connection& connection, double +@@ -5969,6 +6178,7 @@ void WebPageProxy::viewScaleFactorDidChange(IPC::Connection& connection, double MESSAGE_CHECK_BASE(scaleFactorIsValid(scaleFactor), connection); if (!legacyMainFrameProcess().hasConnection(connection)) return; @@ -17633,15 +17418,15 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 forEachWebContentProcess([&] (auto& process, auto pageID) { if (&process == &legacyMainFrameProcess()) -@@ -6518,6 +6726,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, We +@@ -6606,6 +6816,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, We RefPtr protectedPageClient { pageClient() }; protectedNavigationState()->didDestroyNavigation(process->coreProcessIdentifier(), navigationID); + m_inspectorController->didDestroyNavigation(navigationID); } - void WebPageProxy::didStartProvisionalLoadForFrame(FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, std::optional navigationID, URL&& url, URL&& unreachableURL, const UserData& userData, WallTime timestamp) -@@ -6852,6 +7061,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p + void WebPageProxy::didStartProvisionalLoadForFrame(IPC::Connection& connection, FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, std::optional navigationID, URL&& url, URL&& unreachableURL, const UserData& userData, WallTime timestamp) +@@ -6947,6 +7158,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p m_failingProvisionalLoadURL = { }; @@ -17650,7 +17435,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 // If the provisional page's load fails then we destroy the provisional page. if (m_provisionalPage && m_provisionalPage->mainFrame() == &frame && willContinueLoading == WillContinueLoading::No) m_provisionalPage = nullptr; -@@ -8271,8 +8482,9 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w +@@ -8405,8 +8618,9 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w if (RefPtr page = originatingFrameInfo->page()) openerAppInitiatedState = page->lastNavigationWasAppInitiated(); @@ -17661,15 +17446,15 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 auto completionHandler = [ this, protectedThis = Ref { *this }, -@@ -8341,6 +8553,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w - configuration->setInitialSandboxFlags(effectiveSandboxFlags); - configuration->setWindowFeatures(WTFMove(windowFeatures)); +@@ -8486,6 +8700,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w configuration->setOpenedMainFrameName(openedMainFrameName); + if (!protectedPreferences()->siteIsolationEnabled()) + configuration->setRelatedPage(*this); + configuration->setOpenerPageForInspector(*this); if (RefPtr openerFrame = WebFrameProxy::webFrame(originatingFrameInfoData.frameID); navigationActionData.hasOpener && openerFrame) { - configuration->setRelatedPage(*this); -@@ -8365,6 +8578,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w + configuration->setOpenerInfo({ { +@@ -8514,6 +8729,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w void WebPageProxy::showPage() { m_uiClient->showPage(this); @@ -17677,7 +17462,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 } bool WebPageProxy::hasOpenedPage() const -@@ -8479,6 +8693,10 @@ void WebPageProxy::closePage() +@@ -8645,6 +8861,10 @@ void WebPageProxy::closePage() if (isClosed()) return; @@ -17688,7 +17473,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 WEBPAGEPROXY_RELEASE_LOG(Process, "closePage:"); if (RefPtr pageClient = this->pageClient()) pageClient->clearAllEditCommands(); -@@ -8517,6 +8735,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi +@@ -8683,6 +8903,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi } runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), message, [reply = WTFMove(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, const String& message, CompletionHandler&& completion) mutable { @@ -17697,7 +17482,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 page.m_uiClient->runJavaScriptAlert(page, message, frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)]() mutable { reply(); completion(); -@@ -8539,6 +8759,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti +@@ -8705,6 +8927,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this); } @@ -17706,7 +17491,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), message, [reply = WTFMove(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, const String& message, CompletionHandler&& completion) mutable { page.m_uiClient->runJavaScriptConfirm(page, message, frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)](bool result) mutable { -@@ -8563,6 +8785,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif +@@ -8729,6 +8953,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this); } @@ -17715,7 +17500,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), message, [reply = WTFMove(reply), defaultValue](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, const String& message, CompletionHandler&& completion) mutable { page.m_uiClient->runJavaScriptPrompt(page, message, defaultValue, frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)](auto& result) mutable { -@@ -8692,6 +8916,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram +@@ -8864,6 +9090,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram return; } } @@ -17723,8 +17508,8 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 + m_inspectorDialogAgent->javascriptDialogOpening("beforeunload"_s, message); // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer and the tryClose timer. - protectedLegacyMainFrameProcess()->stopResponsivenessTimer(); -@@ -9260,6 +9486,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, + WebProcessProxy::fromConnection(connection)->stopResponsivenessTimer(); +@@ -9481,6 +9709,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, } #if ENABLE(FULLSCREEN_API) @@ -17736,7 +17521,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 WebFullScreenManagerProxy* WebPageProxy::fullScreenManager() { return m_fullScreenManager.get(); -@@ -9370,6 +9601,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc +@@ -9608,6 +9841,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc } } @@ -17751,10 +17536,10 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 + return; + } + - m_pageClient->requestDOMPasteAccess(pasteAccessCategory, requiresInteraction, elementRect, originIdentifier, WTFMove(completionHandler)); + protectedPageClient()->requestDOMPasteAccess(pasteAccessCategory, requiresInteraction, elementRect, originIdentifier, WTFMove(completionHandler)); } -@@ -10400,6 +10642,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event +@@ -10634,6 +10878,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->mouseEventsFlushedForPage(*this); didFinishProcessingAllPendingMouseEvents(); @@ -17763,7 +17548,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 } } -@@ -10434,6 +10678,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy +@@ -10669,6 +10915,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy if (!canProcessMoreKeyEvents) { if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->keyboardEventsFlushedForPage(*this); @@ -17771,9 +17556,9 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 } } -@@ -10857,7 +11102,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process - if (m_preferences->siteIsolationEnabled()) - m_browsingContextGroup->processDidTerminate(*this, process); +@@ -11101,7 +11348,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process + if (protectedPreferences()->siteIsolationEnabled()) + protectedBrowsingContextGroup()->processDidTerminate(*this, process); - bool handledByClient = false; + bool handledByClient = m_inspectorController->pageCrashed(reason); @@ -17783,16 +17568,16 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 if (m_loaderClient) handledByClient = reason != ProcessTerminationReason::RequestedByClient && m_loaderClient->processDidCrash(*this); else -@@ -11513,6 +11761,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc - - parameters.httpsUpgradeEnabled = preferences->upgradeKnownHostsToHTTPSEnabled() ? configuration->httpsUpgradeEnabled() : false; +@@ -11752,6 +12002,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc + parameters.canUseCredentialStorage = m_canUseCredentialStorage; -+ parameters.shouldPauseInInspectorWhenShown = m_inspectorController->shouldPauseInInspectorWhenShown(); + parameters.httpsUpgradeEnabled = preferences->upgradeKnownHostsToHTTPSEnabled() ? m_configuration->httpsUpgradeEnabled() : false; + - #if PLATFORM(IOS) || PLATFORM(VISION) - // FIXME: This is also being passed over the to WebProcess via the PreferencesStore. - parameters.allowsDeprecatedSynchronousXMLHttpRequestDuringUnload = allowsDeprecatedSynchronousXMLHttpRequestDuringUnload(); -@@ -11676,8 +11926,42 @@ void WebPageProxy::allowGamepadAccess() ++ parameters.shouldPauseInInspectorWhenShown = m_inspectorController->shouldPauseInInspectorWhenShown(); + + #if ENABLE(APP_HIGHLIGHTS) + parameters.appHighlightsVisible = appHighlightsVisibility() ? HighlightVisibility::Visible : HighlightVisibility::Hidden; +@@ -11917,8 +12169,42 @@ void WebPageProxy::allowGamepadAccess() #endif // ENABLE(GAMEPAD) @@ -17835,7 +17620,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes) { m_navigationClient->shouldAllowLegacyTLS(*this, authenticationChallenge.get(), [this, protectedThis = Ref { *this }, authenticationChallenge] (bool shouldAllowLegacyTLS) { if (shouldAllowLegacyTLS) -@@ -11772,6 +12056,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect +@@ -12014,6 +12300,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect request->deny(); }; @@ -17848,7 +17633,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 // FIXME: Once iOS migrates to the new WKUIDelegate SPI, clean this up // and make it one UIClient call that calls the completionHandler with false // if there is no delegate instead of returning the completionHandler -@@ -11834,6 +12124,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi +@@ -12078,6 +12370,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi shouldChangeDeniedToPrompt = false; if (sessionID().isEphemeral()) { @@ -17861,7 +17646,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); return; } -@@ -11848,6 +12144,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi +@@ -12092,6 +12390,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi return; } @@ -17875,7 +17660,7 @@ index 963ca0b7a50c8ded555090c68aaa6acec526f7f9..0d9e4394824a664a35b10db392b91306 completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); return; diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h -index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c97515422 100644 +index de568bc247847234de4bd8a34d80726a4fa22a53..85881e1a1a695907016c0924e3df38f072455f61 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.h +++ b/Source/WebKit/UIProcess/WebPageProxy.h @@ -26,6 +26,7 @@ @@ -17884,9 +17669,9 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c #include "APIObject.h" +#include "APIWebsitePolicies.h" #include "MessageReceiver.h" + #include #include - #include -@@ -42,6 +43,20 @@ +@@ -44,6 +45,20 @@ #include #include #include @@ -17907,7 +17692,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c #if USE(DICTATION_ALTERNATIVES) #include -@@ -126,6 +141,7 @@ class DragData; +@@ -128,6 +143,7 @@ class DragData; class Exception; class FloatPoint; class FloatQuad; @@ -17915,15 +17700,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c class FloatRect; class FloatSize; class FontAttributeChanges; -@@ -474,6 +490,7 @@ class WebExtensionController; - class WebFramePolicyListenerProxy; - class WebFrameProxy; - class WebFullScreenManagerProxy; -+class WebFullScreenManagerProxyClient; - class WebInspectorUIProxy; - class WebKeyboardEvent; - class WebMouseEvent; -@@ -707,6 +724,8 @@ public: +@@ -734,6 +750,8 @@ public: void setControlledByAutomation(bool); WebPageInspectorController& inspectorController() { return *m_inspectorController; } @@ -17932,15 +17709,15 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c #if PLATFORM(IOS_FAMILY) void showInspectorIndication(); -@@ -741,6 +760,7 @@ public: +@@ -767,6 +785,7 @@ public: bool hasSleepDisabler() const; #if ENABLE(FULLSCREEN_API) + void setFullScreenManagerClientOverride(std::unique_ptr&&); WebFullScreenManagerProxy* fullScreenManager(); - - API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; } -@@ -830,6 +850,12 @@ public: + RefPtr protectedFullScreenManager(); + void setFullScreenClientForTesting(std::unique_ptr&&); +@@ -858,6 +877,12 @@ public: void setPageLoadStateObserver(RefPtr&&); @@ -17953,7 +17730,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c void initializeWebPage(const WebCore::Site&, WebCore::SandboxFlags); void setDrawingArea(RefPtr&&); -@@ -861,6 +887,8 @@ public: +@@ -889,6 +914,8 @@ public: RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::IsPerformingHTTPFallback); RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::IsPerformingHTTPFallback, std::unique_ptr&&, API::Object* userData = nullptr); @@ -17962,7 +17739,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c RefPtr loadFile(const String& fileURL, const String& resourceDirectoryURL, bool isAppInitiated = true, API::Object* userData = nullptr); RefPtr loadData(Ref&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr); RefPtr loadData(Ref&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldOpenExternalURLsPolicy); -@@ -944,6 +972,7 @@ public: +@@ -977,6 +1004,7 @@ public: PageClient* pageClient() const; RefPtr protectedPageClient() const; @@ -17970,7 +17747,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c void setViewNeedsDisplay(const WebCore::Region&); void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated); -@@ -1566,14 +1595,20 @@ public: +@@ -1617,14 +1645,20 @@ public: void didStartDrag(); void dragCancelled(); void setDragCaretRect(const WebCore::IntRect&); @@ -17992,7 +17769,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c #endif void processDidBecomeUnresponsive(); -@@ -1822,6 +1857,7 @@ public: +@@ -1877,6 +1911,7 @@ public: void setViewportSizeForCSSViewportUnits(const WebCore::FloatSize&); WebCore::FloatSize viewportSizeForCSSViewportUnits() const; @@ -18000,7 +17777,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c void didReceiveAuthenticationChallengeProxy(Ref&&, NegotiatedLegacyTLS); void negotiatedLegacyTLS(); void didNegotiateModernTLS(const URL&); -@@ -1855,6 +1891,8 @@ public: +@@ -1910,6 +1945,8 @@ public: #if PLATFORM(COCOA) || PLATFORM(GTK) RefPtr takeViewSnapshot(std::optional&&); RefPtr takeViewSnapshot(std::optional&&, ForceSoftwareCapturingViewportSnapshot); @@ -18008,8 +17785,8 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c + RefPtr takeViewSnapshot(std::optional&&) { return nullptr; } #endif - void wrapCryptoKey(Vector&&, CompletionHandler>&&)>&&); -@@ -2835,6 +2873,7 @@ private: + void serializeAndWrapCryptoKey(IPC::Connection&, WebCore::CryptoKeyData&&, CompletionHandler>&&)>&&); +@@ -2919,6 +2956,7 @@ private: RefPtr launchProcessForReload(); void requestNotificationPermission(const String& originString, CompletionHandler&&); @@ -18017,7 +17794,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c void didChangeContentSize(const WebCore::IntSize&); void didChangeIntrinsicContentSize(const WebCore::IntSize&); -@@ -3362,8 +3401,10 @@ private: +@@ -3436,8 +3474,10 @@ private: String m_openedMainFrameName; RefPtr m_inspector; @@ -18028,7 +17805,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c RefPtr m_fullScreenManager; std::unique_ptr m_fullscreenClient; #endif -@@ -3562,6 +3603,22 @@ private: +@@ -3636,6 +3676,22 @@ private: std::optional m_currentDragOperation; bool m_currentDragIsOverFileInput { false }; unsigned m_currentDragNumberOfFilesToBeAccepted { 0 }; @@ -18051,7 +17828,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c #endif bool m_mainFrameHasHorizontalScrollbar { false }; -@@ -3735,6 +3792,10 @@ private: +@@ -3807,6 +3863,10 @@ private: RefPtr messageBody; }; Vector m_pendingInjectedBundleMessages; @@ -18063,7 +17840,7 @@ index b2c03a83961ca2dca8510461ab73693295f3c50a..94e859353dc61017f13d39227d256d6c #if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION) RefPtr m_webDeviceOrientationUpdateProviderProxy; diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in -index 68e7c4024aa81d9339c4d62feae9f6270af46db8..c312f7c5d9d06893f2dad30c87968fe5dffd880d 100644 +index 0310e26fe8eb09a68db493035b108aa472dc573d..0182474dd3cb70bc87f239718ad52db972cc44ae 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in @@ -35,6 +35,7 @@ messages -> WebPageProxy { @@ -18072,9 +17849,9 @@ index 68e7c4024aa81d9339c4d62feae9f6270af46db8..c312f7c5d9d06893f2dad30c87968fe5 MouseDidMoveOverElement(struct WebKit::WebHitTestResultData hitTestResultData, OptionSet modifiers, WebKit::UserData userData) + LogToStderr(String text) - DidReceiveEvent(enum:uint8_t WebKit::WebEventType eventType, bool handled, struct std::optional remoteUserInputEventData) + DidReceiveEventIPC(enum:uint8_t WebKit::WebEventType eventType, bool handled, struct std::optional remoteUserInputEventData) SetCursor(WebCore::Cursor cursor) -@@ -330,10 +331,14 @@ messages -> WebPageProxy { +@@ -333,10 +334,14 @@ messages -> WebPageProxy { StartDrag(struct WebCore::DragItem dragItem, WebCore::ShareableBitmapHandle dragImage) SetPromisedDataForImage(String pasteboardName, WebCore::SharedMemory::Handle imageHandle, String filename, String extension, String title, String url, String visibleURL, WebCore::SharedMemory::Handle archiveHandle, String originIdentifier) #endif @@ -18091,10 +17868,10 @@ index 68e7c4024aa81d9339c4d62feae9f6270af46db8..c312f7c5d9d06893f2dad30c87968fe5 DidHandleDragStartRequest(bool started) DidHandleAdditionalDragItemsRequest(bool added) diff --git a/Source/WebKit/UIProcess/WebProcessCache.cpp b/Source/WebKit/UIProcess/WebProcessCache.cpp -index 7211efa3028a16e070059251cd35cefa886f5d43..7aeab506c527d5ddcfa7f1e56749dca87ab7738e 100644 +index dc6f440403cccc5cd93f75806cffbf05cc56041c..e880beba2034cc2b87dcfb3e1e8bacf1bed78cf3 100644 --- a/Source/WebKit/UIProcess/WebProcessCache.cpp +++ b/Source/WebKit/UIProcess/WebProcessCache.cpp -@@ -92,6 +92,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const +@@ -100,6 +100,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const return false; } @@ -18106,10 +17883,10 @@ index 7211efa3028a16e070059251cd35cefa886f5d43..7aeab506c527d5ddcfa7f1e56749dca8 } diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp -index ab6e3d2220d2f02cce66a47ab0e2432685d0ce94..d5ec0bdb2b92137222a58ae3afda1e2dc5caca6b 100644 +index 4be8b8ead49ba2ab0ce16af74aa92fab01352358..8e310f0e3bcada1ec9383161b979660e29c50724 100644 --- a/Source/WebKit/UIProcess/WebProcessPool.cpp +++ b/Source/WebKit/UIProcess/WebProcessPool.cpp -@@ -444,10 +444,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& +@@ -445,10 +445,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& void WebProcessPool::setOverrideLanguages(Vector&& languages) { @@ -18122,7 +17899,7 @@ index ab6e3d2220d2f02cce66a47ab0e2432685d0ce94..d5ec0bdb2b92137222a58ae3afda1e2d #if ENABLE(GPU_PROCESS) if (RefPtr gpuProcess = GPUProcessProxy::singletonIfCreated()) -@@ -455,9 +455,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) +@@ -456,9 +456,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) #endif #if USE(SOUP) for (Ref networkProcess : NetworkProcessProxy::allNetworkProcesses()) @@ -18134,7 +17911,7 @@ index ab6e3d2220d2f02cce66a47ab0e2432685d0ce94..d5ec0bdb2b92137222a58ae3afda1e2d void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled) { -@@ -943,7 +944,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa +@@ -939,7 +940,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa #endif parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel(); @@ -18144,10 +17921,10 @@ index ab6e3d2220d2f02cce66a47ab0e2432685d0ce94..d5ec0bdb2b92137222a58ae3afda1e2d parameters.urlSchemesRegisteredAsEmptyDocument = copyToVector(m_schemesToRegisterAsEmptyDocument); diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp -index 31270a744c84c7e818bf42637658cd98db30f2b9..9e26b56dc40aeedc4afbb6cbe7b01f4cbcb32d0b 100644 +index 45a11c271082cd40635c6b21ee01c75bea749a4b..4ba89b3eafebfa67d8518ec99db6f23ae968df29 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.cpp +++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp -@@ -194,6 +194,11 @@ Vector> WebProcessProxy::allProcesses() +@@ -203,6 +203,11 @@ Vector> WebProcessProxy::allProcesses() }); } @@ -18159,7 +17936,7 @@ index 31270a744c84c7e818bf42637658cd98db30f2b9..9e26b56dc40aeedc4afbb6cbe7b01f4c RefPtr WebProcessProxy::processForIdentifier(ProcessIdentifier identifier) { return allProcessMap().get(identifier); -@@ -561,6 +566,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt +@@ -572,6 +577,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt if (WebKit::isInspectorProcessPool(protectedProcessPool())) launchOptions.extraInitializationData.add("inspector-process"_s, "1"_s); @@ -18187,22 +17964,22 @@ index 31270a744c84c7e818bf42637658cd98db30f2b9..9e26b56dc40aeedc4afbb6cbe7b01f4c if (isPrewarmed()) diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h -index ac12422e6b49f1c3b935e0c05ea569522d1a4206..555bd49e0fb59fd6fdc2cfd32dc7614a096b924f 100644 +index 4471fdf4a46180f78cea1cf035671bfe3c83b8e2..0858fe7f56eb3d8648467f5b82c2d77d6c958b77 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.h +++ b/Source/WebKit/UIProcess/WebProcessProxy.h -@@ -180,6 +180,7 @@ public: +@@ -185,6 +185,7 @@ public: - static void forWebPagesWithOrigin(PAL::SessionID, const WebCore::SecurityOriginData&, const Function&); + static void forWebPagesWithOrigin(PAL::SessionID, const WebCore::SecurityOriginData&, NOESCAPE const Function&); static Vector> allowedFirstPartiesForCookies(); + static Vector> allProcessesForInspector(); void initializeWebProcess(WebProcessCreationParameters&&); diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -index 09058b732dd75484320bca2c939f139e5057c845..aa9ea426f635d768cd2c901cccda72e0bbd165c8 100644 +index ef4db4e5e75286a260646226dd48108810b1607e..bf1111ed48e9d3cb74b59d4258faefb814028540 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -@@ -314,7 +314,8 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W +@@ -319,7 +319,8 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W static Ref networkProcessForSession(PAL::SessionID sessionID) { @@ -18212,7 +17989,7 @@ index 09058b732dd75484320bca2c939f139e5057c845..aa9ea426f635d768cd2c901cccda72e0 if (sessionID.isEphemeral()) { // Reuse a previous persistent session network process for ephemeral sessions. for (auto& dataStore : allDataStores().values()) { -@@ -2354,6 +2355,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin, +@@ -2511,6 +2512,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin, protectedNetworkProcess()->websiteDataOriginDirectoryForTesting(m_sessionID, WTFMove(origin), type, WTFMove(completionHandler)); } @@ -18226,10 +18003,10 @@ index 09058b732dd75484320bca2c939f139e5057c845..aa9ea426f635d768cd2c901cccda72e0 void WebsiteDataStore::hasAppBoundSession(CompletionHandler&& completionHandler) const { diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h -index 903223f1276b9e5440ce66ba941255272209203f..c0b9b92f361cdca7bcfd3a8eb554c3bb015aac45 100644 +index f1a113cc08f6543ab22be75a03823f49a3f52017..3d98a33003ae86f2ac5982ba2deb5eb3238b1385 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h -@@ -101,6 +101,7 @@ class DeviceIdHashSaltStorage; +@@ -98,6 +98,7 @@ class DeviceIdHashSaltStorage; class DownloadProxy; class NetworkProcessProxy; class SOAuthorizationCoordinator; @@ -18237,7 +18014,7 @@ index 903223f1276b9e5440ce66ba941255272209203f..c0b9b92f361cdca7bcfd3a8eb554c3bb class VirtualAuthenticatorManager; class WebPageProxy; class WebProcessPool; -@@ -116,12 +117,21 @@ enum class UnifiedOriginStorageLevel : uint8_t; +@@ -113,6 +114,7 @@ enum class UnifiedOriginStorageLevel : uint8_t; enum class WebsiteDataFetchOption : uint8_t; enum class WebsiteDataType : uint32_t; @@ -18245,8 +18022,9 @@ index 903223f1276b9e5440ce66ba941255272209203f..c0b9b92f361cdca7bcfd3a8eb554c3bb struct ITPThirdPartyData; struct NetworkProcessConnectionInfo; struct WebPushMessage; - struct WebsiteDataRecord; - struct WebsiteDataStoreParameters; +@@ -122,6 +124,14 @@ struct WebsiteDataStoreParameters; + enum RemoveDataTaskCounterType { }; + using RemoveDataTaskCounter = RefCounter; +class DownloadInstrumentation { +public: @@ -18259,7 +18037,7 @@ index 903223f1276b9e5440ce66ba941255272209203f..c0b9b92f361cdca7bcfd3a8eb554c3bb class WebsiteDataStore : public API::ObjectImpl, public CanMakeWeakPtr { public: static Ref defaultDataStore(); -@@ -310,11 +320,13 @@ public: +@@ -318,11 +328,13 @@ public: const WebCore::CurlProxySettings& networkProxySettings() const { return m_proxySettings; } #endif @@ -18274,7 +18052,7 @@ index 903223f1276b9e5440ce66ba941255272209203f..c0b9b92f361cdca7bcfd3a8eb554c3bb void setNetworkProxySettings(WebCore::SoupNetworkProxySettings&&); const WebCore::SoupNetworkProxySettings& networkProxySettings() const { return m_networkProxySettings; } void setCookiePersistentStorage(const String&, SoupCookiePersistentStorageType); -@@ -404,6 +416,12 @@ public: +@@ -420,6 +432,12 @@ public: static const String& defaultBaseDataDirectory(); #endif @@ -18287,7 +18065,7 @@ index 903223f1276b9e5440ce66ba941255272209203f..c0b9b92f361cdca7bcfd3a8eb554c3bb void resetQuota(CompletionHandler&&); void resetStoragePersistedState(CompletionHandler&&); #if PLATFORM(IOS_FAMILY) -@@ -589,9 +607,11 @@ private: +@@ -616,9 +634,11 @@ private: WebCore::CurlProxySettings m_proxySettings; #endif @@ -18300,7 +18078,7 @@ index 903223f1276b9e5440ce66ba941255272209203f..c0b9b92f361cdca7bcfd3a8eb554c3bb WebCore::SoupNetworkProxySettings m_networkProxySettings; String m_cookiePersistentStoragePath; SoupCookiePersistentStorageType m_cookiePersistentStorageType { SoupCookiePersistentStorageType::SQLite }; -@@ -618,6 +638,10 @@ private: +@@ -645,6 +665,10 @@ private: RefPtr m_cookieStore; RefPtr m_networkProcess; @@ -18312,7 +18090,7 @@ index 903223f1276b9e5440ce66ba941255272209203f..c0b9b92f361cdca7bcfd3a8eb554c3bb std::unique_ptr m_soAuthorizationCoordinator; #endif diff --git a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp -index ac64c2a3cb5d1e8e46ba1835623a5c12825e3ea1..6ad7a5adc5198ae035c5cb815b6db8f033910f3a 100644 +index 19934de3173ecc0507c5e59956bcf6730a8a88b4..bc0e52f6f28caeca8b9b7aab14b7ff991d7e6b41 100644 --- a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp +++ b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp @@ -114,6 +114,14 @@ void GeoclueGeolocationProvider::stop() @@ -18627,6 +18405,31 @@ index 0000000000000000000000000000000000000000..441442d899e4088f5c24ae9f70c3e4ff +} // namespace API + +#endif // ENABLE(REMOTE_INSPECTOR) +diff --git a/Source/WebKit/UIProcess/glib/SystemSettingsManagerProxy.cpp b/Source/WebKit/UIProcess/glib/SystemSettingsManagerProxy.cpp +index c6e25e57892c2a0e1350b207ce53b6d2c3d6258a..bd91f75db5a05ba0a6f5a982c03980ecc57479ca 100644 +--- a/Source/WebKit/UIProcess/glib/SystemSettingsManagerProxy.cpp ++++ b/Source/WebKit/UIProcess/glib/SystemSettingsManagerProxy.cpp +@@ -27,6 +27,7 @@ + #include "config.h" + #include "SystemSettingsManagerProxy.h" + ++#include "SystemSettingsManager.h" + #include "SystemSettingsManagerMessages.h" + #include "WebProcessPool.h" + #include +diff --git a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp +index 51ba8b585ca37a2eed54bce5218e1c92c2844cc6..dc04a2ca0b0ac2333036b897dd18d5303c5237c6 100644 +--- a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp ++++ b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp +@@ -124,6 +124,8 @@ static OptionSet availableInputDevices() + return toAvailableInputDevices(gdk_seat_get_capabilities(seat)); + } + #endif ++ if (!WebCore::screenHasTouchDeviceOverride() || !WebCore::screenHasTouchDeviceOverride().value()) ++ return AvailableInputDevices::Mouse; + #if ENABLE(TOUCH_EVENTS) + return AvailableInputDevices::Touchscreen; + #else diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h index 5529f52048b24290f424e877cd9dbfb890e02ffb..c2b76b6188dd9596c4a1f31c137daff7d7644c7f 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h @@ -18649,10 +18452,10 @@ index 5529f52048b24290f424e877cd9dbfb890e02ffb..c2b76b6188dd9596c4a1f31c137daff7 virtual void unrealize() { }; virtual int renderHostFileDescriptor() { return -1; } diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -index 92d972eeef867b680ef0266d24f47827fe0d64b5..afb1e4d9dfae59be15692635e5334a5078bfef95 100644 +index 395a409b6302d4146606fc0b45a15cff63c7f327..666d9629e0155e8c03b0672f7a9274de7f04d642 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp +++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -@@ -811,4 +811,30 @@ RefPtr AcceleratedBackingStoreDMABuf::bufferAsNativeImageF +@@ -812,4 +812,30 @@ RefPtr AcceleratedBackingStoreDMABuf::bufferAsNativeImageF return m_committedBuffer->asNativeImageForTesting(); } @@ -18684,7 +18487,7 @@ index 92d972eeef867b680ef0266d24f47827fe0d64b5..afb1e4d9dfae59be15692635e5334a50 + } // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h -index 87275e2c71e934f76c979e30375e78763a476814..5776d81c12e653404c1c637d4d7060e9123f12e5 100644 +index 63dfbed03bd898c822d426a5449141fec2841226..eaf141843da3f02c5ba6fd0322f3175248a7195b 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h +++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h @@ -98,6 +98,7 @@ private: @@ -18697,7 +18500,7 @@ index 87275e2c71e934f76c979e30375e78763a476814..5776d81c12e653404c1c637d4d7060e9 RendererBufferFormat bufferFormat() const override; @@ -253,6 +254,9 @@ private: RefPtr m_committedBuffer; - WebCore::Region m_pendingDamageRegion; + Rects m_pendingDamageRects; HashMap> m_buffers; +// Playwright begin + RefPtr m_flippedSurface; @@ -18760,10 +18563,10 @@ index 0000000000000000000000000000000000000000..bf78de1915940c2d3292514cf0fe4e68 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/SystemSettingsManagerProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/SystemSettingsManagerProxyGtk.cpp -index aa702b018d881739fb464246e7c7d7236adfe97b..f711e1608e6d8b988d2d0bc99893d5b0137a07ae 100644 +index 9ef483a6b0ab1558c059304d727311ea7984184d..f532d2d2dbe2d7cb66323b6ea5fe2daace15d7b8 100644 --- a/Source/WebKit/UIProcess/gtk/SystemSettingsManagerProxyGtk.cpp +++ b/Source/WebKit/UIProcess/gtk/SystemSettingsManagerProxyGtk.cpp -@@ -117,6 +117,8 @@ int SystemSettingsManagerProxy::xftDPI() const +@@ -126,6 +126,8 @@ int SystemSettingsManagerProxy::xftDPI() const bool SystemSettingsManagerProxy::followFontSystemSettings() const { @@ -18978,7 +18781,7 @@ index 0000000000000000000000000000000000000000..36ab6e9aec9f8d79fb13a8a49beadaaf + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp -index 2a17b59c9be6ecc76b0ec0a16d9f4866dffa0bf4..0d5c58a88b0e5197254d0eb5bd6eee045d99d299 100644 +index cedf117035055756084863d1e8db8594e4a8b8d2..bae8c9d90d1f34324bbb98a52815af98d23e5257 100644 --- a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp +++ b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp @@ -78,8 +78,10 @@ void WebPasteboardProxy::setPrimarySelectionOwner(WebFrameProxy* frame) @@ -19055,7 +18858,7 @@ index 0000000000000000000000000000000000000000..2aabc02a4b5432f68a6e85fd96897756 +} // namespace API diff --git a/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mm b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mm new file mode 100644 -index 0000000000000000000000000000000000000000..a5c8b963636b24d4bb8ad090e4a19aedecbf56c3 +index 0000000000000000000000000000000000000000..a4b23bf4cf7c4cb6ef9d25d4121b20a611809479 --- /dev/null +++ b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mm @@ -0,0 +1,96 @@ @@ -19126,7 +18929,7 @@ index 0000000000000000000000000000000000000000..a5c8b963636b24d4bb8ad090e4a19aed + +std::unique_ptr InspectorPlaywrightAgentClientMac::createBrowserContext(WTF::String& error, const WTF::String& proxyServer, const WTF::String& proxyBypassList) +{ -+ _WKBrowserContext* wkBrowserContext = [[delegate_ createBrowserContext:proxyServer WithBypassList:proxyBypassList] autorelease]; ++ _WKBrowserContext* wkBrowserContext = [[delegate_ createBrowserContext:proxyServer.createNSString().get() WithBypassList:proxyBypassList.createNSString().get()] autorelease]; + auto browserContext = std::make_unique(); + browserContext->processPool = &static_cast([[wkBrowserContext processPool] _apiObject]); + browserContext->dataStore = &static_cast([[wkBrowserContext dataStore] _apiObject]); @@ -19204,10 +19007,10 @@ index 0000000000000000000000000000000000000000..8adbd51bfecad2a273117588bf50f8f7 + +#endif diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h -index c8ec967cdc8b32e7b9349460794c35b2c6b45d7f..a8ccc70d9f0defd9ac4e8c8f45064bc3b2b4bfac 100644 +index 8fc87c386fd82cdedc06ad1601d76919c6c27467..b5b2833b603e6996cf18c3416fde156940378f31 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h -@@ -60,6 +60,8 @@ class PageClientImpl final : public PageClientImplCocoa +@@ -61,6 +61,8 @@ class PageClientImpl final : public PageClientImplCocoa WTF_OVERRIDE_DELETE_FOR_CHECKED_PTR(PageClientImpl); #endif public: @@ -19216,7 +19019,7 @@ index c8ec967cdc8b32e7b9349460794c35b2c6b45d7f..a8ccc70d9f0defd9ac4e8c8f45064bc3 PageClientImpl(NSView *, WKWebView *); virtual ~PageClientImpl(); -@@ -175,6 +177,9 @@ private: +@@ -176,6 +178,9 @@ private: void updateAcceleratedCompositingMode(const LayerTreeContext&) override; void didFirstLayerFlush(const LayerTreeContext&) override; @@ -19226,8 +19029,8 @@ index c8ec967cdc8b32e7b9349460794c35b2c6b45d7f..a8ccc70d9f0defd9ac4e8c8f45064bc3 RefPtr takeViewSnapshot(std::optional&&) override; RefPtr takeViewSnapshot(std::optional&&, ForceSoftwareCapturingViewportSnapshot) override; void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override; -@@ -230,6 +235,10 @@ private: - void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override; +@@ -229,6 +234,10 @@ private: + void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame, CompletionHandler&&) override; #endif +#if ENABLE(TOUCH_EVENTS) @@ -19238,7 +19041,7 @@ index c8ec967cdc8b32e7b9349460794c35b2c6b45d7f..a8ccc70d9f0defd9ac4e8c8f45064bc3 void navigationGestureWillEnd(bool willNavigate, WebBackForwardListItem&) override; void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&) override; diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm -index dba9aae7c29f59127a80461aedc8ac10cc1cef66..addadd854c4fa5c999eb1ae865c8e31d2e37b03f 100644 +index 5a5366f3f439d4727ca7dab149e0a523ccc27ce2..e02ab71cdf13af0d9b7b1aa04667c1dce54ed340 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm @@ -110,6 +110,13 @@ namespace WebKit { @@ -19263,8 +19066,8 @@ index dba9aae7c29f59127a80461aedc8ac10cc1cef66..addadd854c4fa5c999eb1ae865c8e31d + return true; + ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); - NSWindow *activeViewWindow = activeWindow(); - return activeViewWindow.isKeyWindow || (activeViewWindow && [NSApp keyWindow] == activeViewWindow); + RetainPtr activeViewWindow = activeWindow(); + return activeViewWindow.get().isKeyWindow || (activeViewWindow && [NSApp keyWindow] == activeViewWindow.get()); @@ -170,6 +180,9 @@ bool PageClientImpl::isViewWindowActive() bool PageClientImpl::isViewFocused() @@ -19282,10 +19085,10 @@ index dba9aae7c29f59127a80461aedc8ac10cc1cef66..addadd854c4fa5c999eb1ae865c8e31d + if (_headless) + return true; + - NSView *activeView = this->activeView(); - NSWindow *activeViewWindow = activeWindow(); + RetainPtr activeView = this->activeView(); + RetainPtr activeViewWindow = activeWindow(); -@@ -276,7 +292,8 @@ void PageClientImpl::didRelaunchProcess() +@@ -267,7 +283,8 @@ void PageClientImpl::didRelaunchProcess() void PageClientImpl::preferencesDidChange() { @@ -19295,7 +19098,7 @@ index dba9aae7c29f59127a80461aedc8ac10cc1cef66..addadd854c4fa5c999eb1ae865c8e31d } void PageClientImpl::toolTipChanged(const String& oldToolTip, const String& newToolTip) -@@ -478,6 +495,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) +@@ -475,6 +492,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) { @@ -19304,16 +19107,16 @@ index dba9aae7c29f59127a80461aedc8ac10cc1cef66..addadd854c4fa5c999eb1ae865c8e31d m_impl->doneWithKeyEvent(event.nativeEvent(), eventWasHandled); } -@@ -497,6 +516,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl +@@ -494,6 +513,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl RefPtr PageClientImpl::createPopupMenuProxy(WebPageProxy& page) { + if (_headless) + return nullptr; - return WebPopupMenuProxyMac::create(m_view, page.popupMenuClient()); + return WebPopupMenuProxyMac::create(m_view.get().get(), page.popupMenuClient()); } -@@ -638,6 +659,12 @@ CALayer *PageClientImpl::footerBannerLayer() const +@@ -634,6 +655,12 @@ CALayer *PageClientImpl::footerBannerLayer() const return m_impl->footerBannerLayer(); } @@ -19326,7 +19129,7 @@ index dba9aae7c29f59127a80461aedc8ac10cc1cef66..addadd854c4fa5c999eb1ae865c8e31d RefPtr PageClientImpl::takeViewSnapshot(std::optional&&) { return m_impl->takeViewSnapshot(); -@@ -833,6 +860,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR +@@ -850,6 +877,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR #endif // ENABLE(FULLSCREEN_API) @@ -19340,7 +19143,7 @@ index dba9aae7c29f59127a80461aedc8ac10cc1cef66..addadd854c4fa5c999eb1ae865c8e31d void PageClientImpl::navigationGestureDidBegin() { m_impl->dismissContentRelativeChildWindowsWithAnimation(true); -@@ -1011,6 +1045,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c +@@ -1030,6 +1064,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c bool PageClientImpl::windowIsFrontWindowUnderMouse(const NativeWebMouseEvent& event) { @@ -19351,15 +19154,19 @@ index dba9aae7c29f59127a80461aedc8ac10cc1cef66..addadd854c4fa5c999eb1ae865c8e31d } diff --git a/Source/WebKit/UIProcess/mac/SecItemShimProxy.messages.in b/Source/WebKit/UIProcess/mac/SecItemShimProxy.messages.in -index e0a61ae15b79e32701b2f4a2a6de6c105fb39446..1792da3491e88ee76a501f271938592de19f7ae4 100644 +index f46895285dbc84c624537a194814c18f771a0c08..29ef9e5afa13b8d2b47b7f2dd4ce37846b61c35f 100644 --- a/Source/WebKit/UIProcess/mac/SecItemShimProxy.messages.in +++ b/Source/WebKit/UIProcess/mac/SecItemShimProxy.messages.in -@@ -20,12 +20,12 @@ +@@ -20,6 +20,7 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#if ENABLE(SEC_ITEM_SHIM) - [ExceptionForEnabledBy] + [ + DispatchedFrom=Networking, + DispatchedTo=UI, +@@ -27,9 +28,8 @@ + ] messages -> SecItemShimProxy { -#if ENABLE(SEC_ITEM_SHIM) @@ -19370,10 +19177,10 @@ index e0a61ae15b79e32701b2f4a2a6de6c105fb39446..1792da3491e88ee76a501f271938592d } +#endif diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h -index b668c229f2e8bd077b19a8a6344416098895f8a0..e9b67c72cfc91fec86887941a760f6899696624f 100644 +index a3c53c0bf913385d4d2d92900360d5f7d75927f8..e5570ef599ff1b59224648c353f8ab16f8fe7f88 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h +++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h -@@ -80,6 +80,7 @@ private: +@@ -81,6 +81,7 @@ private: void show() override; void showContextMenuWithItems(Vector>&&) override; void useContextMenuItems(Vector>&&) override; @@ -19382,10 +19189,10 @@ index b668c229f2e8bd077b19a8a6344416098895f8a0..e9b67c72cfc91fec86887941a760f689 bool showAfterPostProcessingContextData(); diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -index 4abfcf22cbdce49e3e15993b07700866fa8e97f9..2a90b5d222ccdec8725c64f3102bebd870360fa9 100644 +index 4cee7041f9b93d553b452447b33459832a5e4e36..2d5d79246c57be84ebf86f3935cd4583bf0cecdc 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm +++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -@@ -534,6 +534,12 @@ RetainPtr WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT +@@ -540,6 +540,12 @@ RetainPtr WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT } #endif @@ -19590,10 +19397,18 @@ index 0000000000000000000000000000000000000000..dd52991f936aa1c046b404801ee97237 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.h b/Source/WebKit/UIProcess/mac/WebViewImpl.h -index f519288e2a405f48d9224599eb678c919ff77af1..cc151e7b828536e9509bcb5fa23d19b4f2efc10f 100644 +index a0e1fc432a9b4b8938051d39725a1ec36ebd7a1b..f2a331f460879e43e9b069f50a099f10bbf8b8d8 100644 --- a/Source/WebKit/UIProcess/mac/WebViewImpl.h +++ b/Source/WebKit/UIProcess/mac/WebViewImpl.h -@@ -543,6 +543,9 @@ public: +@@ -35,6 +35,7 @@ + #include "WKLayoutMode.h" + #include "WKTextAnimationType.h" + #include ++#include + #include + #include + #include +@@ -569,6 +570,9 @@ public: void provideDataForPasteboard(NSPasteboard *, NSString *type); NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination); @@ -19604,10 +19419,10 @@ index f519288e2a405f48d9224599eb678c919ff77af1..cc151e7b828536e9509bcb5fa23d19b4 RefPtr takeViewSnapshot(ForceSoftwareCapturingViewportSnapshot); void saveBackForwardSnapshotForCurrentItem(); diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.mm b/Source/WebKit/UIProcess/mac/WebViewImpl.mm -index 032961f58ab7990c8b353c0fcc849e8d03c145ac..04866658cbfbcf8dad31e51f94d0419a1466e62a 100644 +index 1b42ae3cb6cdabee9830a1fb2ff55b9ae2325eb4..6998642cf147ec1af6e3feeb66d8688381791214 100644 --- a/Source/WebKit/UIProcess/mac/WebViewImpl.mm +++ b/Source/WebKit/UIProcess/mac/WebViewImpl.mm -@@ -2390,6 +2390,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace() +@@ -2462,6 +2462,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace() if (!m_colorSpace) m_colorSpace = [NSColorSpace sRGBColorSpace]; } @@ -19619,7 +19434,7 @@ index 032961f58ab7990c8b353c0fcc849e8d03c145ac..04866658cbfbcf8dad31e51f94d0419a ASSERT(m_colorSpace); return WebCore::DestinationColorSpace { [m_colorSpace CGColorSpace] }; -@@ -4528,6 +4533,17 @@ static RetainPtr takeWindowSnapshot(CGSWindowID windowID, bool captu +@@ -4707,6 +4712,17 @@ static RetainPtr takeWindowSnapshot(CGSWindowID windowID, bool captu return WebCore::cgWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, windowID, imageOptions); } @@ -19841,10 +19656,10 @@ index 0000000000000000000000000000000000000000..135a60361fa8fbf907382625e7c8dd4e + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp -index 3c95132b41b124e49f52e97ba2306614f46d53b9..115cfc4871aef732d5c57bae3b13818b67193cd5 100644 +index bae35256ed815f7dac0b11ae439531d4ef3cb108..81e063b50a0132f8b36f3461f95d2ce1968198f5 100644 --- a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp +++ b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.cpp -@@ -114,5 +114,11 @@ WebContextMenuProxyWin::~WebContextMenuProxyWin() +@@ -115,5 +115,11 @@ WebContextMenuProxyWin::~WebContextMenuProxyWin() ::DestroyMenu(m_menu); } @@ -19857,17 +19672,17 @@ index 3c95132b41b124e49f52e97ba2306614f46d53b9..115cfc4871aef732d5c57bae3b13818b } // namespace WebKit #endif // ENABLE(CONTEXT_MENUS) diff --git a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h -index 0c80d970c3f9a987faf620081c909f6c7021970d..1467e5481f7417913c0d12a1cb492d02b2a7d1b7 100644 +index e7f71156d7a897ab477d0d7f167b2c2992cdb161..325d8813afff13d86a4892a8e99738f19c2729ac 100644 --- a/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h +++ b/Source/WebKit/UIProcess/win/WebContextMenuProxyWin.h -@@ -47,6 +47,7 @@ public: +@@ -49,6 +49,7 @@ public: private: - WebContextMenuProxyWin(WebPageProxy&, ContextMenuContextData&&, const UserData&); + WebContextMenuProxyWin(WebPageProxy&, FrameInfoData&&, ContextMenuContextData&&, const UserData&); void showContextMenuWithItems(Vector>&&) override; + void hide() override; HMENU m_menu; - }; + FrameInfoData m_frameInfo; diff --git a/Source/WebKit/UIProcess/win/WebPageInspectorEmulationAgentWin.cpp b/Source/WebKit/UIProcess/win/WebPageInspectorEmulationAgentWin.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df55ee613ec085cb85ed12b45deff3a1b046861c @@ -19994,17 +19809,14 @@ index 0000000000000000000000000000000000000000..8b474c730139b44a13c9d5b2d13ee204 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/win/WebView.cpp b/Source/WebKit/UIProcess/win/WebView.cpp -index 8b521de62266d4a7fad3624b548401a4c8056f9f..c6da98e334fbd090a8c63b690afb25697ac344d7 100644 +index 5180da3ec22d56e8a9520e31cad076d86ae5be9f..f01be74573843e7b374c34035c09f114bdc7349c 100644 --- a/Source/WebKit/UIProcess/win/WebView.cpp +++ b/Source/WebKit/UIProcess/win/WebView.cpp -@@ -556,9 +556,8 @@ LRESULT WebView::onSizeEvent(HWND hwnd, UINT, WPARAM, LPARAM lParam, bool& handl - { +@@ -576,7 +576,7 @@ LRESULT WebView::onSizeEvent(HWND hwnd, UINT, WPARAM, LPARAM lParam, bool& handl + float intrinsicDeviceScaleFactor = deviceScaleFactorForWindow(hwnd); if (m_page) - m_page->setIntrinsicDeviceScaleFactor(deviceScaleFactorForWindow(hwnd)); -- // If there are no m_page, use intrinsic device scale factor. -- float deviceScaleFactor = m_page ? m_page->deviceScaleFactor() : deviceScaleFactorForWindow(hwnd); -- m_viewSize = expandedIntSize(FloatSize(LOWORD(lParam), HIWORD(lParam)) / deviceScaleFactor); -+ + m_page->setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor); +- m_viewSize = expandedIntSize(FloatSize(LOWORD(lParam), HIWORD(lParam)) / intrinsicDeviceScaleFactor); + m_viewSize = expandedIntSize(FloatSize(LOWORD(lParam), HIWORD(lParam))); if (m_page && m_page->drawingArea()) { @@ -20057,10 +19869,10 @@ index 0000000000000000000000000000000000000000..24da079059ed4a45131e18d7fbf56a29 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..adec63a0a9d6d67bdbdadb4024005ff97ce79d10 +index 0000000000000000000000000000000000000000..7df77e30c2e7303dc6aaad560434e5b8e35f4f3c --- /dev/null +++ b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp -@@ -0,0 +1,61 @@ +@@ -0,0 +1,57 @@ +/* + * Copyright (C) 2015 Igalia S.L. + * @@ -20089,8 +19901,6 @@ index 0000000000000000000000000000000000000000..adec63a0a9d6d67bdbdadb4024005ff9 +#include "config.h" +#include "WebColorPickerWPE.h" + -+#if ENABLE(INPUT_TYPE_COLOR) -+ +#include "WebPageProxy.h" + +namespace WebKit { @@ -20120,14 +19930,12 @@ index 0000000000000000000000000000000000000000..adec63a0a9d6d67bdbdadb4024005ff9 +} + +} // namespace WebKit -+ -+#endif // ENABLE(INPUT_TYPE_COLOR) diff --git a/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.h b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.h new file mode 100644 -index 0000000000000000000000000000000000000000..7edc93b3873dd42a7f877626551ec994395baae9 +index 0000000000000000000000000000000000000000..da58334235809cfed62e90150784bf2506f7a8f2 --- /dev/null +++ b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.h -@@ -0,0 +1,57 @@ +@@ -0,0 +1,54 @@ +/* + * Copyright (C) 2015 Igalia S.L. + * @@ -20156,8 +19964,6 @@ index 0000000000000000000000000000000000000000..7edc93b3873dd42a7f877626551ec994 +#ifndef WebColorPickerWPE_h +#define WebColorPickerWPE_h + -+#if ENABLE(INPUT_TYPE_COLOR) -+ +#include "WebColorPicker.h" + +typedef struct _GtkColorChooser GtkColorChooser; @@ -20183,8 +19989,125 @@ index 0000000000000000000000000000000000000000..7edc93b3873dd42a7f877626551ec994 + +} // namespace WebKit + -+#endif // ENABLE(INPUT_TYPE_COLOR) +#endif // WebColorPickerWPE_h +diff --git a/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.cpp b/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.cpp +new file mode 100644 +index 0000000000000000000000000000000000000000..694eb24db4a407553da12fb0a25d8963fd0ef6ac +--- /dev/null ++++ b/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.cpp +@@ -0,0 +1,55 @@ ++/* ++ * Copyright (C) 2019 Igalia S.L. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS'' ++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS ++ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ++ * THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "config.h" ++#include "WebDataListSuggestionsDropdownWPE.h" ++ ++#include "WebPageProxy.h" ++#include ++ ++namespace WebKit { ++ ++WebDataListSuggestionsDropdownWPE::WebDataListSuggestionsDropdownWPE(WebPageProxy& page) ++ : WebDataListSuggestionsDropdown(page) ++{ ++} ++ ++WebDataListSuggestionsDropdownWPE::~WebDataListSuggestionsDropdownWPE() ++{ ++} ++ ++void WebDataListSuggestionsDropdownWPE::show(WebCore::DataListSuggestionInformation&& information) ++{ ++} ++ ++void WebDataListSuggestionsDropdownWPE::handleKeydownWithIdentifier(const String& key) ++{ ++} ++ ++void WebDataListSuggestionsDropdownWPE::close() ++{ ++} ++ ++} // namespace WebKit +diff --git a/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.h b/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.h +new file mode 100644 +index 0000000000000000000000000000000000000000..5d4b0d204b7dc564564d2126e9f256fa4f4bd6f6 +--- /dev/null ++++ b/Source/WebKit/UIProcess/wpe/WebDataListSuggestionsDropdownWPE.h +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (C) 2019 Igalia S.L. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS'' ++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS ++ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ++ * THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#pragma once ++ ++#include "WebDataListSuggestionsDropdown.h" ++ ++namespace WebKit { ++ ++class WebPageProxy; ++ ++class WebDataListSuggestionsDropdownWPE final : public WebDataListSuggestionsDropdown { ++public: ++ static Ref create(WebPageProxy& page) ++ { ++ return adoptRef(*new WebDataListSuggestionsDropdownWPE(page)); ++ } ++ ++ ~WebDataListSuggestionsDropdownWPE(); ++ ++private: ++ WebDataListSuggestionsDropdownWPE(WebPageProxy&); ++ ++ void show(WebCore::DataListSuggestionInformation&&) final; ++ void handleKeydownWithIdentifier(const String&) final; ++ void close() final; ++}; ++ ++} // namespace WebKit diff --git a/Source/WebKit/UIProcess/wpe/WebDateTimePickerWPE.cpp b/Source/WebKit/UIProcess/wpe/WebDateTimePickerWPE.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a44463faf011fbab08f87bb7007a5e71c2a73758 @@ -20305,10 +20228,10 @@ index 0000000000000000000000000000000000000000..0c0e3fce33b06ee72c4c29d2a4abe964 +#endif // ENABLE(DATE_AND_TIME_INPUT_TYPES) diff --git a/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..5dc76aa302cb574307059e66a1b73730efe920da +index 0000000000000000000000000000000000000000..182398f24909cbc42cac897d66546991f46c1d5d --- /dev/null +++ b/Source/WebKit/UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp -@@ -0,0 +1,41 @@ +@@ -0,0 +1,53 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -20337,6 +20260,7 @@ index 0000000000000000000000000000000000000000..5dc76aa302cb574307059e66a1b73730 +#include "config.h" +#include "WebPageInspectorEmulationAgent.h" + ++#include "DrawingAreaProxyCoordinatedGraphics.h" +#include "WebPageProxy.h" +#include + @@ -20344,9 +20268,20 @@ index 0000000000000000000000000000000000000000..5dc76aa302cb574307059e66a1b73730 + +void WebPageInspectorEmulationAgent::platformSetSize(int width, int height, Function&& callback) +{ ++ WebCore::IntSize viewSize(width, height); ++ if (m_page.viewSize() == viewSize) { ++ callback(String()); ++ return; ++ } ++ + struct wpe_view_backend* backend = m_page.viewBackend(); -+ wpe_view_backend_dispatch_set_size(backend, width, height); -+ callback(String()); ++ wpe_view_backend_dispatch_set_size(backend, viewSize.width(), viewSize.height()); ++ if (auto* drawingArea = static_cast(m_page.drawingArea())) { ++ drawingArea->waitForSizeUpdate([callback = WTFMove(callback)](const DrawingAreaProxyCoordinatedGraphics&) mutable { ++ callback(String()); ++ }); ++ } else ++ callback(String()); +} + +} // namespace WebKit @@ -20426,24 +20361,11 @@ index 9b688ad328317fea4fd96ce66e9714bad8f0f937..402a36a9c565e13ec298aa7f014f0d92 } } // namespace WebKit -diff --git a/Source/WebKit/UnifiedSources-output.xcfilelist b/Source/WebKit/UnifiedSources-output.xcfilelist -index c103a90e720933a10b736194139973f16c33551a..d0985c9258b3e19701498f7cbf4d0add3c584b8c 100644 ---- a/Source/WebKit/UnifiedSources-output.xcfilelist -+++ b/Source/WebKit/UnifiedSources-output.xcfilelist -@@ -55,6 +55,8 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource134.cpp - $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource135.cpp - $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource136.cpp - $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource137.cpp -+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource138.cpp -+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource139.cpp - $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource14-mm.mm - $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource14.cpp - $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/unified-sources/UnifiedSource15-mm.mm diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj -index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f06450ee9 100644 +index 07fb026a2a1ee93222d022a603b0057efbf848de..bedb13e953248741f32c61f8476e021233ce7e40 100644 --- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj -@@ -1527,6 +1527,7 @@ +@@ -1546,6 +1546,7 @@ 5CABDC8722C40FED001EDE8E /* APIMessageListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CABDC8322C40FA7001EDE8E /* APIMessageListener.h */; }; 5CADDE05215046BD0067D309 /* WKWebProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C74300E21500492004BFA17 /* WKWebProcess.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5CAECB6627465AE400AB78D0 /* UnifiedSource115.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CAECB5E27465AE300AB78D0 /* UnifiedSource115.cpp */; }; @@ -20451,7 +20373,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 5CAF7AA726F93AB00003F19E /* adattributiond.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CAF7AA526F93A950003F19E /* adattributiond.cpp */; }; 5CAFDE452130846300B1F7E1 /* _WKInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CAFDE422130843500B1F7E1 /* _WKInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5CAFDE472130846A00B1F7E1 /* _WKInspectorInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CAFDE442130843600B1F7E1 /* _WKInspectorInternal.h */; }; -@@ -2301,6 +2302,18 @@ +@@ -2328,6 +2329,18 @@ DF0C5F28252ECB8E00D921DB /* WKDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F24252ECB8D00D921DB /* WKDownload.h */; settings = {ATTRIBUTES = (Public, ); }; }; DF0C5F2A252ECB8E00D921DB /* WKDownloadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F26252ECB8E00D921DB /* WKDownloadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; DF0C5F2B252ED44000D921DB /* WKDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DF0C5F25252ECB8E00D921DB /* WKDownloadInternal.h */; }; @@ -20470,7 +20392,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f DF462E0F23F22F5500EFF35F /* WKHTTPCookieStorePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF462E0E23F22F5300EFF35F /* WKHTTPCookieStorePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; DF462E1223F338BE00EFF35F /* WKContentWorldPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF462E1123F338AD00EFF35F /* WKContentWorldPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; DF7A231C291B088D00B98DF3 /* WKSnapshotConfigurationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DF7A231B291B088D00B98DF3 /* WKSnapshotConfigurationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; -@@ -2392,6 +2405,8 @@ +@@ -2427,6 +2440,8 @@ E5BEF6822130C48000F31111 /* WebDataListSuggestionsDropdownIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BEF6802130C47F00F31111 /* WebDataListSuggestionsDropdownIOS.h */; }; E5CB07DC20E1678F0022C183 /* WKFormColorControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E5CB07DA20E1678F0022C183 /* WKFormColorControl.h */; }; E5CBA76427A318E100DF7858 /* UnifiedSource120.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA75F27A3187800DF7858 /* UnifiedSource120.cpp */; }; @@ -20479,26 +20401,17 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f E5CBA76527A318E100DF7858 /* UnifiedSource118.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76127A3187900DF7858 /* UnifiedSource118.cpp */; }; E5CBA76627A318E100DF7858 /* UnifiedSource116.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76327A3187B00DF7858 /* UnifiedSource116.cpp */; }; E5CBA76727A318E100DF7858 /* UnifiedSource119.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5CBA76027A3187900DF7858 /* UnifiedSource119.cpp */; }; -@@ -2415,6 +2430,9 @@ - EBA8D3B727A5E33F00CB7900 /* PushServiceConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = EBA8D3B127A5E33F00CB7900 /* PushServiceConnection.mm */; }; - EBDF51D12C8FBC4700EA1376 /* WebsitePushAndNotificationsEnabledPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = EBDF51CF2C8FBC4700EA1376 /* WebsitePushAndNotificationsEnabledPolicy.h */; }; - ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; }; +@@ -2456,6 +2471,9 @@ + EEA52F492D7055A700D578B5 /* WKStageMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0D3CDC2D3709BE00072978 /* WKStageMode.swift */; }; + EEFE72792D64FE5600DC6214 /* StageModeInteractionState.h in Headers */ = {isa = PBXBuildFile; fileRef = EEFE72782D64FE5600DC6214 /* StageModeInteractionState.h */; }; + F404455C2D5CFB56000E587E /* AppKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = F404455A2D5CFB56000E587E /* AppKitSoftLink.h */; }; + F303B849249A8D640031DE5C /* ScreencastEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F303B848249A8D3A0031DE5C /* ScreencastEncoder.h */; }; + F33C7AC7249AD79C0018BE41 /* libwebrtc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F33C7AC6249AD79C0018BE41 /* libwebrtc.dylib */; }; + F3867F0A24607D4E008F0F31 /* InspectorScreencastAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3867F0424607D2B008F0F31 /* InspectorScreencastAgent.h */; }; F409BA181E6E64BC009DA28E /* WKDragDestinationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */; settings = {ATTRIBUTES = (Private, ); }; }; F40C3B712AB401C5007A3567 /* WKDatePickerPopoverController.h in Headers */ = {isa = PBXBuildFile; fileRef = F40C3B6F2AB40167007A3567 /* WKDatePickerPopoverController.h */; }; F41145682CD939E0004CDBD1 /* _WKTouchEventGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = F41145652CD939E0004CDBD1 /* _WKTouchEventGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; -@@ -2518,6 +2536,8 @@ - FAE61CE82D0A5608000D238D /* UnifiedSource136.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE61CE12D0A5606000D238D /* UnifiedSource136.cpp */; }; - FAE61CE92D0A5608000D238D /* UnifiedSource133.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE61CE22D0A5607000D238D /* UnifiedSource133.cpp */; }; - FAE61CEA2D0A5608000D238D /* UnifiedSource137.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE61CE32D0A5607000D238D /* UnifiedSource137.cpp */; }; -+ FAE61CED2D0A5608000D238D /* UnifiedSource138.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE61CE62D0A5607000D238D /* UnifiedSource138.cpp */; }; -+ FAE61CEE2D0A5608000D238D /* UnifiedSource139.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE61CE72D0A5607000D238D /* UnifiedSource139.cpp */; }; - FAE61CEB2D0A5608000D238D /* UnifiedSource135.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE61CE42D0A5607000D238D /* UnifiedSource135.cpp */; }; - FAE61CEC2D0A5608000D238D /* UnifiedSource131.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE61CE52D0A5607000D238D /* UnifiedSource131.cpp */; }; - FAF27D302D2851EB00F1F0BB /* CoreIPCPKSecureElementPass.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAF27D2F2D2850D400F1F0BB /* CoreIPCPKSecureElementPass.mm */; }; -@@ -6228,6 +6248,7 @@ +@@ -6365,6 +6383,7 @@ 5CABDC8522C40FCC001EDE8E /* WKMessageListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMessageListener.h; sourceTree = ""; }; 5CABE07A28F60E8A00D83FD9 /* WebPushMessage.serialization.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebPushMessage.serialization.in; sourceTree = ""; }; 5CADDE0D2151AA010067D309 /* AuthenticationChallengeDisposition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeDisposition.h; sourceTree = ""; }; @@ -20506,7 +20419,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 5CAECB5E27465AE300AB78D0 /* UnifiedSource115.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource115.cpp; sourceTree = ""; }; 5CAF7AA426F93A750003F19E /* adattributiond */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = adattributiond; sourceTree = BUILT_PRODUCTS_DIR; }; 5CAF7AA526F93A950003F19E /* adattributiond.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = adattributiond.cpp; sourceTree = ""; }; -@@ -7926,6 +7947,19 @@ +@@ -8090,6 +8109,19 @@ DF0C5F24252ECB8D00D921DB /* WKDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownload.h; sourceTree = ""; }; DF0C5F25252ECB8E00D921DB /* WKDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownloadInternal.h; sourceTree = ""; }; DF0C5F26252ECB8E00D921DB /* WKDownloadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownloadDelegate.h; sourceTree = ""; }; @@ -20526,7 +20439,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f DF462E0E23F22F5300EFF35F /* WKHTTPCookieStorePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStorePrivate.h; sourceTree = ""; }; DF462E1123F338AD00EFF35F /* WKContentWorldPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentWorldPrivate.h; sourceTree = ""; }; DF58C6311371AC5800F9A37C /* NativeWebWheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebWheelEvent.h; sourceTree = ""; }; -@@ -8091,6 +8125,8 @@ +@@ -8263,6 +8295,8 @@ E5CBA76127A3187900DF7858 /* UnifiedSource118.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource118.cpp; sourceTree = ""; }; E5CBA76227A3187900DF7858 /* UnifiedSource117.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource117.cpp; sourceTree = ""; }; E5CBA76327A3187B00DF7858 /* UnifiedSource116.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource116.cpp; sourceTree = ""; }; @@ -20535,10 +20448,10 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f E5DEFA6726F8F42600AB68DB /* PhotosUISPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotosUISPI.h; sourceTree = ""; }; EB0D312D275AE13300863D8F /* com.apple.webkit.webpushd.mac.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.webkit.webpushd.mac.plist; sourceTree = ""; }; EB0D312E275AE13300863D8F /* com.apple.webkit.webpushd.ios.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.webkit.webpushd.ios.plist; sourceTree = ""; }; -@@ -8124,6 +8160,14 @@ - ECA680D31E6904B500731D20 /* ExtraPrivateSymbolsForTAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtraPrivateSymbolsForTAPI.h; sourceTree = ""; }; - ECBFC1DB1E6A4D66000300C7 /* ExtraPublicSymbolsForTAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExtraPublicSymbolsForTAPI.h; sourceTree = ""; }; - F036978715F4BF0500C3A80E /* WebColorPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebColorPicker.cpp; sourceTree = ""; }; +@@ -8305,6 +8339,14 @@ + F404455A2D5CFB56000E587E /* AppKitSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitSoftLink.h; sourceTree = ""; }; + F404455B2D5CFB56000E587E /* AppKitSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppKitSoftLink.mm; sourceTree = ""; }; + F4063DDE2D71481E00F3FE6E /* LLVMProfiling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LLVMProfiling.h; sourceTree = ""; }; + F303B847249A8D3A0031DE5C /* ScreencastEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScreencastEncoder.cpp; sourceTree = ""; }; + F303B848249A8D3A0031DE5C /* ScreencastEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScreencastEncoder.h; sourceTree = ""; }; + F31E2DA424C76E4B004B2775 /* WebMFileWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMFileWriter.cpp; sourceTree = ""; }; @@ -20550,16 +20463,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDragDestinationAction.h; sourceTree = ""; }; F40C3B6F2AB40167007A3567 /* WKDatePickerPopoverController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKDatePickerPopoverController.h; path = ios/forms/WKDatePickerPopoverController.h; sourceTree = ""; }; F40C3B702AB40167007A3567 /* WKDatePickerPopoverController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKDatePickerPopoverController.mm; path = ios/forms/WKDatePickerPopoverController.mm; sourceTree = ""; }; -@@ -8351,6 +8395,8 @@ - FAE61CE32D0A5607000D238D /* UnifiedSource137.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource137.cpp; sourceTree = ""; }; - FAE61CE42D0A5607000D238D /* UnifiedSource135.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource135.cpp; sourceTree = ""; }; - FAE61CE52D0A5607000D238D /* UnifiedSource131.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource131.cpp; sourceTree = ""; }; -+ FAE61CE62D0A5607000D238D /* UnifiedSource138.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnifiedSource138.cpp; sourceTree = ""; }; -+ FAE61CE72D0A5607000D238D /* UnifiedSource139.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnifiedSource139.cpp; sourceTree = ""; }; - FAF27D2E2D2850D400F1F0BB /* CoreIPCPKSecureElementPass.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoreIPCPKSecureElementPass.h; sourceTree = ""; }; - FAF27D2F2D2850D400F1F0BB /* CoreIPCPKSecureElementPass.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CoreIPCPKSecureElementPass.mm; sourceTree = ""; }; - FED3C1DA1B447AE800E0EB7F /* APISerializedScriptValueCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = APISerializedScriptValueCocoa.mm; sourceTree = ""; }; -@@ -8467,6 +8513,7 @@ +@@ -8710,6 +8752,7 @@ 3766F9EE189A1241003CF19B /* JavaScriptCore.framework in Frameworks */, 3766F9F1189A1254003CF19B /* libicucore.dylib in Frameworks */, 7B9FC5BB28A5233B007570E7 /* libWebKitPlatform.a in Frameworks */, @@ -20567,16 +20471,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 3766F9EF189A1244003CF19B /* QuartzCore.framework in Frameworks */, 37694525184FC6B600CDE21F /* Security.framework in Frameworks */, 37BEC4DD1948FC6A008B4286 /* WebCore.framework in Frameworks */, -@@ -11055,6 +11102,8 @@ - FAE61CE42D0A5607000D238D /* UnifiedSource135.cpp */, - FAE61CE12D0A5606000D238D /* UnifiedSource136.cpp */, - FAE61CE32D0A5607000D238D /* UnifiedSource137.cpp */, -+ FAE61CE62D0A5607000D238D /* UnifiedSource138.cpp */, -+ FAE61CE72D0A5607000D238D /* UnifiedSource139.cpp */, - ); - path = "unified-sources"; - sourceTree = ""; -@@ -11516,6 +11565,7 @@ +@@ -11841,6 +11884,7 @@ 99788ACA1F421DCA00C08000 /* _WKAutomationSessionConfiguration.mm */, 990D28A81C6404B000986977 /* _WKAutomationSessionDelegate.h */, 990D28AF1C65203900986977 /* _WKAutomationSessionInternal.h */, @@ -20584,7 +20479,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 5C4609E222430E4C009943C2 /* _WKContentRuleListAction.h */, 5C4609E322430E4D009943C2 /* _WKContentRuleListAction.mm */, 5C4609E422430E4D009943C2 /* _WKContentRuleListActionInternal.h */, -@@ -12864,6 +12914,7 @@ +@@ -13218,6 +13262,7 @@ E34B110C27C46BC6006D2F2E /* libWebCoreTestShim.dylib */, E34B110F27C46D09006D2F2E /* libWebCoreTestSupport.dylib */, DDE992F4278D06D900F60D26 /* libWebKitAdditions.a */, @@ -20592,7 +20487,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 57A9FF15252C6AEF006A2040 /* libWTF.a */, 5750F32A2032D4E500389347 /* LocalAuthentication.framework */, 570DAAB0230273D200E8FC04 /* NearField.framework */, -@@ -13437,6 +13488,12 @@ +@@ -13799,6 +13844,12 @@ children = ( 9197940423DBC4BB00257892 /* InspectorBrowserAgent.cpp */, 9197940323DBC4BB00257892 /* InspectorBrowserAgent.h */, @@ -20605,7 +20500,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f ); path = Agents; sourceTree = ""; -@@ -13445,6 +13502,7 @@ +@@ -13807,6 +13858,7 @@ isa = PBXGroup; children = ( A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorUIProxyMac.mm */, @@ -20613,7 +20508,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 1CA8B935127C774E00576C2B /* WebInspectorUIProxyMac.mm */, 99A7ACE326012919006D57FD /* WKInspectorResourceURLSchemeHandler.h */, 99A7ACE42601291A006D57FD /* WKInspectorResourceURLSchemeHandler.mm */, -@@ -14162,6 +14220,7 @@ +@@ -14560,6 +14612,7 @@ E1513C65166EABB200149FCB /* AuxiliaryProcessProxy.h */, 46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */, 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */, @@ -20621,7 +20516,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 5C6D69352AC3935D0099BDAF /* BrowsingContextGroup.cpp */, 5C6D69362AC3935D0099BDAF /* BrowsingContextGroup.h */, 5CA98549210BEB5A0057EB6B /* BrowsingWarning.h */, -@@ -14186,6 +14245,8 @@ +@@ -14584,6 +14637,8 @@ BC06F43912DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp */, BC06F43812DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h */, 2DD5A72A1EBF09A7009BA597 /* HiddenPageThrottlingAutoIncreasesCounter.h */, @@ -20630,15 +20525,15 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 5CEABA2B2333251400797797 /* LegacyGlobalSettings.cpp */, 5CEABA2A2333247700797797 /* LegacyGlobalSettings.h */, 31607F3819627002009B87DA /* LegacySessionStateCoding.h */, -@@ -14219,6 +14280,7 @@ - 1A0C227D2451130A00ED614D /* QuickLookThumbnailingSoftLink.mm */, - 1AEE57232409F142002005D6 /* QuickLookThumbnailLoader.h */, - 1AEE57242409F142002005D6 /* QuickLookThumbnailLoader.mm */, +@@ -14613,6 +14668,7 @@ + 4683569B21E81CC7006E27A3 /* ProvisionalPageProxy.cpp */, + 4683569A21E81CC7006E27A3 /* ProvisionalPageProxy.h */, + 411B89CB27B2B89600F9EBD3 /* QueryPermissionResultCallback.h */, + D71A94392370F060002C4D9E /* RemoteInspectorPipe.h */, 5CCB54DC2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.cpp */, 5CCB54DB2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.h */, - 5C907E9A294D507100B3402D /* RemotePageProxy.cpp */, -@@ -14319,6 +14381,8 @@ + FABBBC802D35AC6800820017 /* RemotePageFullscreenManagerProxy.cpp */, +@@ -14716,6 +14772,8 @@ BC7B6204129A0A6700D174A4 /* WebPageGroup.h */, 2D9EA3101A96D9EB002D2807 /* WebPageInjectedBundleClient.cpp */, 2D9EA30E1A96CBFF002D2807 /* WebPageInjectedBundleClient.h */, @@ -20647,7 +20542,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 9B7F8A502C785725000057F3 /* WebPageLoadTiming.h */, BC111B0B112F5E4F00337BAB /* WebPageProxy.cpp */, BC032DCB10F4389F0058C15A /* WebPageProxy.h */, -@@ -14497,6 +14561,7 @@ +@@ -14894,6 +14952,7 @@ BC646C1911DD399F006455B0 /* WKBackForwardListItemRef.h */, BC646C1611DD399F006455B0 /* WKBackForwardListRef.cpp */, BC646C1711DD399F006455B0 /* WKBackForwardListRef.h */, @@ -20655,7 +20550,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f BCB9E24A1120E15C00A137E0 /* WKContext.cpp */, BCB9E2491120E15C00A137E0 /* WKContext.h */, 1AE52F9319201F6B00A1FA37 /* WKContextConfigurationRef.cpp */, -@@ -15074,6 +15139,9 @@ +@@ -15468,6 +15527,9 @@ 07EF07592745A8160066EA04 /* DisplayCaptureSessionManager.h */, 07EF07582745A8160066EA04 /* DisplayCaptureSessionManager.mm */, 7AFA6F682A9F57C50055322A /* DisplayLinkMac.cpp */, @@ -20665,7 +20560,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 1AFDE65B1954E8D500C48FFA /* LegacySessionStateCoding.cpp */, 0FCB4E5818BBE3D9000FCFC9 /* PageClientImplMac.h */, 0FCB4E5918BBE3D9000FCFC9 /* PageClientImplMac.mm */, -@@ -15097,6 +15165,8 @@ +@@ -15491,6 +15553,8 @@ E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */, E55CD20124D09F1F0042DB9C /* WebDateTimePickerMac.h */, E55CD20224D09F1F0042DB9C /* WebDateTimePickerMac.mm */, @@ -20674,7 +20569,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */, BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */, BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */, -@@ -16161,6 +16231,7 @@ +@@ -16577,6 +16641,7 @@ 99788ACB1F421DDA00C08000 /* _WKAutomationSessionConfiguration.h in Headers */, 990D28AC1C6420CF00986977 /* _WKAutomationSessionDelegate.h in Headers */, 990D28B11C65208D00986977 /* _WKAutomationSessionInternal.h in Headers */, @@ -20682,7 +20577,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 5C4609E7224317B4009943C2 /* _WKContentRuleListAction.h in Headers */, 5C4609E8224317BB009943C2 /* _WKContentRuleListActionInternal.h in Headers */, 9B4CE9512CD99B7C00351173 /* _WKContentWorldConfiguration.h in Headers */, -@@ -16470,6 +16541,7 @@ +@@ -16885,6 +16950,7 @@ E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */, 4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */, 1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */, @@ -20690,7 +20585,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 5CA9854A210BEB640057EB6B /* BrowsingWarning.h in Headers */, A7E69BCC2B2117A100D43D3F /* BufferAndBackendInfo.h in Headers */, BC3065FA1259344E00E71278 /* CacheModel.h in Headers */, -@@ -16654,7 +16726,11 @@ +@@ -17067,7 +17133,11 @@ BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */, CE550E152283752200D28791 /* InsertTextOptions.h in Headers */, 9197940523DBC4BB00257892 /* InspectorBrowserAgent.h in Headers */, @@ -20702,7 +20597,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */, C5BCE5DF1C50766A00CDE3FA /* InteractionInformationAtPosition.h in Headers */, 2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */, -@@ -16915,6 +16991,7 @@ +@@ -17328,6 +17398,7 @@ 0F6E7C532C4C386800F1DB85 /* RemoteDisplayListRecorderMessages.h in Headers */, F451C0FE2703B263002BA03B /* RemoteDisplayListRecorderProxy.h in Headers */, A78A5FE42B0EB39E005036D3 /* RemoteImageBufferSetIdentifier.h in Headers */, @@ -20710,15 +20605,15 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */, 2DDF731518E95060004F5A66 /* RemoteLayerBackingStoreCollection.h in Headers */, 1AB16AEA164B3A8800290D62 /* RemoteLayerTreeContext.h in Headers */, -@@ -16970,6 +17047,7 @@ +@@ -17384,6 +17455,7 @@ E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */, E36FF00327F36FBD004BE21A /* SandboxStateVariables.h in Headers */, 7BAB111025DD02B3008FC479 /* ScopedActiveMessageReceiveQueue.h in Headers */, + F303B849249A8D640031DE5C /* ScreencastEncoder.h in Headers */, + 6D4DF20C2D824242001F964C /* ScreenTimeWebsiteDataSupport.h in Headers */, 463BB93A2B9D08D80098C5C3 /* ScriptMessageHandlerIdentifier.h in Headers */, F4E28A362C923814008120DD /* ScriptTelemetry.h in Headers */, - E4D54D0421F1D72D007E3C36 /* ScrollingTreeFrameScrollingNodeRemoteIOS.h in Headers */, -@@ -17323,6 +17401,8 @@ +@@ -17745,6 +17817,8 @@ 939EF87029D112EE00F23AEE /* WebPageInlines.h in Headers */, 9197940823DBC4CB00257892 /* WebPageInspectorAgentBase.h in Headers */, A513F5402154A5D700662841 /* WebPageInspectorController.h in Headers */, @@ -20727,7 +20622,7 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f A543E30C215C8A8D00279CD9 /* WebPageInspectorTarget.h in Headers */, A543E30D215C8A9000279CD9 /* WebPageInspectorTargetController.h in Headers */, A543E307215AD13700279CD9 /* WebPageInspectorTargetFrontendChannel.h in Headers */, -@@ -19761,7 +19841,43 @@ +@@ -20348,7 +20422,43 @@ 522F792928D50EBB0069B45B /* HidService.mm in Sources */, 2749F6442146561B008380BF /* InjectedBundleNodeHandle.cpp in Sources */, 2749F6452146561E008380BF /* InjectedBundleRangeHandle.cpp in Sources */, @@ -20771,29 +20666,20 @@ index 02610cb75b88760c441c0532a97fb0cb2eb838c6..01b5efc4a8013bef8e6bad79a0bb277f 1C5DC45F2909B05A0061EC62 /* JSWebExtensionWrapperCocoa.mm in Sources */, C14D37FE24ACE086007FF014 /* LaunchServicesDatabaseManager.mm in Sources */, C1710CF724AA643200D7C112 /* LaunchServicesDatabaseObserver.mm in Sources */, -@@ -20010,6 +20126,8 @@ - FAE61CEB2D0A5608000D238D /* UnifiedSource135.cpp in Sources */, - FAE61CE82D0A5608000D238D /* UnifiedSource136.cpp in Sources */, - FAE61CEA2D0A5608000D238D /* UnifiedSource137.cpp in Sources */, -+ FAE61CED2D0A5608000D238D /* UnifiedSource138.cpp in Sources */, -+ FAE61CEE2D0A5608000D238D /* UnifiedSource139.cpp in Sources */, - 078B04442CF1149200B453A6 /* URLSchemeHandler.swift in Sources */, - 078B04B62CF2B4D300B453A6 /* View+WebViewModifiers.swift in Sources */, - 52CDC5C62731DA0D00A3E3EB /* VirtualAuthenticatorManager.cpp in Sources */, -@@ -20117,6 +20235,8 @@ +@@ -20746,6 +20856,8 @@ + 074E87E12CF8EA3D0059E469 /* WebPage+NavigationDeciding.swift in Sources */, 078B04A02CF18EAB00B453A6 /* WebPage+NavigationPreferences.swift in Sources */, - 07A58C882D068CAE00CAB4ED /* WebPage+SwiftUI.swift in Sources */, 07CB79962CE9435700199C49 /* WebPage.swift in Sources */, + D79902B1236E9404005D6F7E /* WebPageInspectorEmulationAgentMac.mm in Sources */, + D79902B3236E9404005D6F7E /* WebPageInspectorInputAgentMac.mm in Sources */, 7CE9CE101FA0767A000177DE /* WebPageUpdatePreferences.cpp in Sources */, + 079A4DA12D72CC0D00CA387F /* WebPageWebView.swift in Sources */, 7CEB00DD1FA69ABE0065473B /* WebPreferencesFeatures.cpp in Sources */, - 7CF1907125338F3800ABE183 /* WebPreferencesGetterSetters.cpp in Sources */, diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp -index 0037482f26f39ef4404dd660091b9be1c92c7b91..ae3523342a8cc44d9add5358171141b2d994a878 100644 +index ae80809efafab3264b06e7bac45771c72d4408b8..849694aea1738dac5e2a0741f31def13c34c8608 100644 --- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp +++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp -@@ -248,6 +248,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou +@@ -269,6 +269,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou } #endif @@ -20805,41 +20691,44 @@ index 0037482f26f39ef4404dd660091b9be1c92c7b91..ae3523342a8cc44d9add5358171141b2 #if ENABLE(PDFJS) if (tryLoadingUsingPDFJSHandler(resourceLoader, trackingParameters)) return; -@@ -257,12 +262,16 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou - return; +@@ -283,12 +288,16 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou + } if (InspectorInstrumentationWebKit::shouldInterceptRequest(resourceLoader)) { -- InspectorInstrumentationWebKit::interceptRequest(resourceLoader, [this, protectedResourceLoader = Ref { resourceLoader }, trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, resource](const ResourceRequest& request) { +- InspectorInstrumentationWebKit::interceptRequest(resourceLoader, [this, protectedThis = Ref { *this }, protectedResourceLoader = Ref { resourceLoader }, trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, resource](const ResourceRequest& request) { - auto& resourceLoader = protectedResourceLoader.get(); - WEBLOADERSTRATEGY_RELEASE_LOG("scheduleLoad: intercepted URL will be scheduled with the NetworkProcess"); -- scheduleLoadFromNetworkProcess(resourceLoader, request, trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, maximumBufferingTime(resource)); +- scheduleLoadFromNetworkProcess(resourceLoader, request, *trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, maximumBufferingTime(resource)); - }); - return; + bool isMainFrameNavigation = resourceLoader.frame() && resourceLoader.frame()->isMainFrame() && resourceLoader.options().mode == FetchOptions::Mode::Navigate; + // Do not intercept navigation request which could already have been intercepted and resumed. + if (!(isMainFrameNavigation && m_existingNetworkResourceLoadIdentifierToResume)) { -+ InspectorInstrumentationWebKit::interceptRequest(resourceLoader, [this, protectedResourceLoader = Ref { resourceLoader }, trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, resource](const ResourceRequest& request) { ++ InspectorInstrumentationWebKit::interceptRequest(resourceLoader, [this, protectedThis = Ref { *this }, protectedResourceLoader = Ref { resourceLoader }, trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, resource](const ResourceRequest& request) { + auto& resourceLoader = protectedResourceLoader.get(); + WEBLOADERSTRATEGY_RELEASE_LOG("scheduleLoad: intercepted URL will be scheduled with the NetworkProcess"); -+ scheduleLoadFromNetworkProcess(resourceLoader, request, trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, maximumBufferingTime(resource)); ++ scheduleLoadFromNetworkProcess(resourceLoader, request, *trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, maximumBufferingTime(resource)); + }); + return; + } } WEBLOADERSTRATEGY_RELEASE_LOG_FORWARDABLE(WEBLOADERSTRATEGY_SCHEDULELOAD); -@@ -382,7 +391,8 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara +@@ -413,7 +422,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara parameters.linkPreconnectEarlyHintsEnabled = mainFrame->settings().linkPreconnectEarlyHintsEnabled(); } -void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceLoader, const ResourceRequest& request, const WebResourceLoader::TrackingParameters& trackingParameters, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Seconds maximumBufferingTime) -+// static +bool WebLoaderStrategy::fillParametersForNetworkProcessLoad(ResourceLoader& resourceLoader, const ResourceRequest& request, const WebResourceLoader::TrackingParameters& trackingParameters, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Seconds maximumBufferingTime, NetworkResourceLoadParameters& loadParameters) { auto identifier = *resourceLoader.identifier(); -@@ -397,7 +407,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL - RunLoop::main().dispatch([resourceLoader = Ref { resourceLoader }, error = blockedError(request)] { +@@ -425,10 +434,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL + && resourceLoader.frameLoader()->notifier().isInitialRequestIdentifier(identifier) + ? MainFrameMainResource::Yes : MainFrameMainResource::No; + if (!page->allowsLoadFromURL(request.url(), mainFrameMainResource)) { +- RunLoop::protectedMain()->dispatch([resourceLoader = Ref { resourceLoader }, error = blockedError(request)] { ++ RunLoop::protectedMain()->dispatch([resourceLoader = Ref { resourceLoader }, error = platformStrategies()->loaderStrategy()->blockedError(request)] { resourceLoader->didFail(error); }); - return; @@ -20847,15 +20736,22 @@ index 0037482f26f39ef4404dd660091b9be1c92c7b91..ae3523342a8cc44d9add5358171141b2 } } -@@ -407,7 +417,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -438,14 +447,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL LOG(NetworkScheduling, "(WebProcess) WebLoaderStrategy::scheduleLoad, url '%s' will be scheduled with the NetworkProcess with priority %d, storedCredentialsPolicy %i", resourceLoader.url().string().latin1().data(), static_cast(resourceLoader.request().priority()), (int)storedCredentialsPolicy); -- NetworkResourceLoadParameters loadParameters; +- NetworkResourceLoadParameters loadParameters { +- trackingParameters.webPageProxyID, +- trackingParameters.pageID, +- trackingParameters.frameID, +- request +- }; +- loadParameters.createSandboxExtensionHandlesIfNecessary(); +- loadParameters.identifier = identifier; - loadParameters.webPageProxyID = trackingParameters.webPageProxyID; - loadParameters.webPageID = trackingParameters.pageID; -@@ -497,14 +506,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL + loadParameters.parentPID = legacyPresentingApplicationPID(); + loadParameters.contentSniffingPolicy = contentSniffingPolicy; +@@ -529,14 +530,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL if (loadParameters.options.mode != FetchOptions::Mode::Navigate) { ASSERT(loadParameters.sourceOrigin); @@ -20869,29 +20765,37 @@ index 0037482f26f39ef4404dd660091b9be1c92c7b91..ae3523342a8cc44d9add5358171141b2 } - loadParameters.shouldRestrictHTTPResponseAccess = shouldPerformSecurityChecks(); -+ loadParameters.shouldRestrictHTTPResponseAccess = DeprecatedGlobalSettings::restrictedHTTPResponseAccess(); ++ loadParameters.shouldRestrictHTTPResponseAccess = true; loadParameters.isMainFrameNavigation = isMainFrameNavigation; if (loadParameters.isMainFrameNavigation && document) -@@ -545,6 +551,17 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL - } +@@ -583,6 +581,25 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL + if (RefPtr frameLoader = resourceLoader.frameLoader()) + loadParameters.requiredCookiesVersion = frameLoader->requiredCookiesVersion(); - ASSERT((loadParameters.webPageID && loadParameters.webFrameID) || loadParameters.clientCredentialPolicy == ClientCredentialPolicy::CannotAskClientForCredentials); + return true; +} + +void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceLoader, const ResourceRequest& request, const WebResourceLoader::TrackingParameters& trackingParameters, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Seconds maximumBufferingTime) +{ -+ NetworkResourceLoadParameters loadParameters; ++ NetworkResourceLoadParameters loadParameters { ++ trackingParameters.webPageProxyID, ++ trackingParameters.pageID, ++ trackingParameters.frameID, ++ request ++ }; ++ loadParameters.createSandboxExtensionHandlesIfNecessary(); ++ + if (!fillParametersForNetworkProcessLoad(resourceLoader, request, trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, maximumBufferingTime, loadParameters)) { + WEBLOADERSTRATEGY_RELEASE_LOG_ERROR("scheduleLoad: no sourceOrigin (priority=%d)", static_cast(resourceLoader.request().priority())); + scheduleInternallyFailedLoad(resourceLoader); + return; + } - ++ std::optional existingNetworkResourceLoadIdentifierToResume; if (loadParameters.isMainFrameNavigation) -@@ -560,7 +577,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL + existingNetworkResourceLoadIdentifierToResume = std::exchange(m_existingNetworkResourceLoadIdentifierToResume, std::nullopt); +@@ -597,7 +614,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL } auto loader = WebResourceLoader::create(resourceLoader, trackingParameters); @@ -20900,7 +20804,7 @@ index 0037482f26f39ef4404dd660091b9be1c92c7b91..ae3523342a8cc44d9add5358171141b2 } void WebLoaderStrategy::scheduleInternallyFailedLoad(WebCore::ResourceLoader& resourceLoader) -@@ -970,7 +987,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier +@@ -1015,7 +1032,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier bool WebLoaderStrategy::isOnLine() const { @@ -20909,7 +20813,7 @@ index 0037482f26f39ef4404dd660091b9be1c92c7b91..ae3523342a8cc44d9add5358171141b2 } void WebLoaderStrategy::addOnlineStateChangeListener(Function&& listener) -@@ -997,6 +1014,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet +@@ -1042,6 +1059,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet void WebLoaderStrategy::setOnLineState(bool isOnLine) { @@ -20921,7 +20825,7 @@ index 0037482f26f39ef4404dd660091b9be1c92c7b91..ae3523342a8cc44d9add5358171141b2 if (m_isOnLine == isOnLine) return; -@@ -1005,6 +1027,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) +@@ -1050,6 +1072,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) listener(isOnLine); } @@ -20935,28 +20839,28 @@ index 0037482f26f39ef4404dd660091b9be1c92c7b91..ae3523342a8cc44d9add5358171141b2 { WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled(enabled), 0); diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h -index a835521fae8043c1c3d6202288b0c3a9f92aa81b..0c8bee6c0a02e6adb1b9e56d77613253111fffd2 100644 +index 6492031de6ed6effab3f28e5321419f3390f7651..678139fc26f26e2224a70b0087ddb849280b8ace 100644 --- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h +++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h -@@ -44,6 +44,7 @@ struct FetchOptions; - namespace WebKit { +@@ -26,6 +26,7 @@ + #pragma once - class NetworkProcessConnection; -+class NetworkResourceLoadParameters; - class WebFrame; - class WebPage; - class WebProcess; + #include "NetworkResourceLoadIdentifier.h" ++#include "NetworkResourceLoadParameters.h" + #include "WebResourceLoader.h" + #include + #include @@ -96,6 +97,9 @@ public: bool isOnLine() const final; void addOnlineStateChangeListener(Function&&) final; void setOnLineState(bool); + void setEmulateOfflineState(bool) final; + -+ static bool fillParametersForNetworkProcessLoad(WebCore::ResourceLoader&, const WebCore::ResourceRequest&, const WebResourceLoader::TrackingParameters&, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Seconds maximumBufferingTime, NetworkResourceLoadParameters&); ++ bool fillParametersForNetworkProcessLoad(WebCore::ResourceLoader&, const WebCore::ResourceRequest&, const WebResourceLoader::TrackingParameters&, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Seconds maximumBufferingTime, NetworkResourceLoadParameters&); void setExistingNetworkResourceLoadIdentifierToResume(std::optional existingNetworkResourceLoadIdentifierToResume) { m_existingNetworkResourceLoadIdentifierToResume = existingNetworkResourceLoadIdentifierToResume; } -@@ -149,6 +153,7 @@ private: +@@ -164,6 +168,7 @@ private: Vector> m_onlineStateChangeListeners; std::optional m_existingNetworkResourceLoadIdentifierToResume; bool m_isOnLine { true }; @@ -20965,20 +20869,20 @@ index a835521fae8043c1c3d6202288b0c3a9f92aa81b..0c8bee6c0a02e6adb1b9e56d77613253 } // namespace WebKit diff --git a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp -index 069e870734e40672966b7ee5853a5469de826c40..ddeca40ad670d397f07d9064cfe90caefcdaaa5a 100644 +index 9add95853b90e6cae9dd4627ab8bf9a9006bc7a8..f3af1c6680d1dc6d8f6db951a26a526d7079cd95 100644 --- a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp +++ b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp -@@ -188,9 +188,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR - } +@@ -202,9 +202,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR - m_coreLoader->didReceiveResponse(inspectorResponse, [this, protectedThis = WTFMove(protectedThis), interceptedRequestIdentifier, policyDecisionCompletionHandler = WTFMove(policyDecisionCompletionHandler), overrideData = WTFMove(overrideData)]() mutable { + coreLoader->didReceiveResponse(inspectorResponse, [this, protectedThis = Ref { *this }, interceptedRequestIdentifier, policyDecisionCompletionHandler = WTFMove(policyDecisionCompletionHandler), overrideData = WTFMove(overrideData)]() mutable { + RefPtr coreLoader = m_coreLoader; - if (policyDecisionCompletionHandler) - policyDecisionCompletionHandler(); - - if (!m_coreLoader || !m_coreLoader->identifier()) { + if (!m_coreLoader || !coreLoader->identifier()) { m_interceptController.continueResponse(interceptedRequestIdentifier); return; -@@ -208,6 +205,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR +@@ -221,6 +218,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR } }); }); @@ -20988,17 +20892,17 @@ index 069e870734e40672966b7ee5853a5469de826c40..ddeca40ad670d397f07d9064cfe90cae } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -index 5806d017fb7aedd8c6540c7868440f18994e6239..779ab16cd8004f47348c7e5acf6b18eeeefd7141 100644 +index e532ffcbe13d86fa0de4fbb2c63214615539ba2d..77cf20de73c57756eea1c10349fa666ce733b304 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -@@ -481,6 +481,8 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev +@@ -491,6 +491,8 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev { // Notify the bundle client. auto page = protectedPage(); + if (level == MessageLevel::Error) + page->send(Messages::WebPageProxy::LogToStderr(message)); + // FIXME: Remove this after rdar://143399667 is fixed. page->injectedBundleUIClient().willAddMessageToConsole(page.ptr(), source, level, message, lineNumber, columnNumber, sourceID); - } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp index dd03326b1ad54e1d363d722cfe86bb779fbeead1..f54d631dc4034c995cbd74ec6b545c3c7dd25990 100644 @@ -21014,7 +20918,7 @@ index dd03326b1ad54e1d363d722cfe86bb779fbeead1..f54d631dc4034c995cbd74ec6b545c3c { } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm -index 2713e431893efd17c95d163f14aec45b27e0d6fc..b96b1d9cba20af611837915412fa4202667e800d 100644 +index 6bd8b7c5de08a061c0a155f4783affe9050b8103..610f2b7870588de14f6b658967a9f9acb1a01baa 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm +++ b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm @@ -128,7 +128,8 @@ static WebCore::CachedImage* cachedImage(Element& element) @@ -21154,7 +21058,7 @@ index 0000000000000000000000000000000000000000..226b3bf6bd83d2606a0aeb627ae9302f + +#endif // ENABLE(DRAG_SUPPORT) diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp -index 85e70183ddc4805c835b4ffc5daf40ca930536de..2483f638a31d96345993f824a3b5967379bab103 100644 +index ac7fa01ba9a3828cf4c48cacc862aab95145093e..89414a407a49d30b937f26cd9cd570c59c51aab3 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp @@ -39,6 +39,7 @@ @@ -21165,35 +21069,11 @@ index 85e70183ddc4805c835b4ffc5daf40ca930536de..2483f638a31d96345993f824a3b59673 #include #include #include -@@ -565,6 +566,11 @@ void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLay - m_scrollOffset = IntSize(); - m_displayTimer.stop(); - m_isWaitingForDidUpdate = false; -+// Playwright begin -+#if PLATFORM(WIN) -+ didChangeAcceleratedCompositingMode(true); -+#endif -+// Playwright end - } - - void DrawingAreaCoordinatedGraphics::sendEnterAcceleratedCompositingModeIfNeeded() -@@ -622,6 +628,11 @@ void DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode() - // UI process, we still need to let it know about the new contents, so send an Update message. - send(Messages::DrawingAreaProxy::Update(0, WTFMove(updateInfo))); - } -+// Playwright begin -+#if PLATFORM(WIN) -+ didChangeAcceleratedCompositingMode(false); -+#endif -+// Playwright end - } - - void DrawingAreaCoordinatedGraphics::scheduleDisplay() diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h -index 815e10e285c0f88d7bc3a70fe71f07106873cb30..75cd3642c43c506afd814014f5d31dff8c260578 100644 +index 2b955369c53a76ca65613a549bff0d490db48a4c..f67651d2cc64a7f164ff91ad5f613a661976bdbb 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h -@@ -135,6 +135,7 @@ public: +@@ -138,6 +138,7 @@ public: #if PLATFORM(WPE) && USE(GBM) && ENABLE(WPE_PLATFORM) void preferredBufferFormatsDidChange(); #endif @@ -21201,26 +21081,8 @@ index 815e10e285c0f88d7bc3a70fe71f07106873cb30..75cd3642c43c506afd814014f5d31dff private: void updateRootLayer(); WebCore::FloatRect visibleContentsRect() const; -diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.cpp -index 99cecc2252ea05a81acf42281225c7000cda0509..91c967238b6b359e1c96663d95550c5ba7728386 100644 ---- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.cpp -+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCompositor.cpp -@@ -296,7 +296,13 @@ void ThreadedCompositor::renderLayerTree() - // and similarly all GL operations are done inside that specific scope. - - if (needsResize) -+#if PLATFORM(WPE) -+ RunLoop::main().dispatch([this, protectedThis = Ref { *this }, viewportSize] { -+ m_surface->clientResize(viewportSize); -+ }); -+#else - m_surface->clientResize(viewportSize); -+#endif - - m_surface->willRenderFrame(); - RunLoop::main().dispatch([this, protectedThis = Ref { *this }] { diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp b/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp -index 428e10e8311dfb3201439688f5ad35a4d609b95c..b03ccee5c7057875092607d01b72265d63a2cfd9 100644 +index c07ca9e847d03c27877cf650b67b96b3c3f7bddb..b966edc8778d4a68c6e5bae0c0883ab3bfd0a387 100644 --- a/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp +++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp @@ -27,6 +27,7 @@ @@ -21231,36 +21093,8 @@ index 428e10e8311dfb3201439688f5ad35a4d609b95c..b03ccee5c7057875092607d01b72265d #include "Logging.h" #include "WebPage.h" #include "WebPageCreationParameters.h" -@@ -115,6 +116,13 @@ void DrawingArea::tryMarkLayersVolatile(CompletionHandler&& completi - completionFunction(true); - } - -+#if PLATFORM(WIN) -+void DrawingArea::didChangeAcceleratedCompositingMode(bool enabled) -+{ -+ send(Messages::DrawingAreaProxy::DidChangeAcceleratedCompositingMode(enabled)); -+} -+#endif -+ - void DrawingArea::removeMessageReceiverIfNeeded() - { - if (m_hasRemovedMessageReceiver) -diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.h b/Source/WebKit/WebProcess/WebPage/DrawingArea.h -index a124c32b48b43f4f6b3d4e95f4a7ca6906412026..5583b767ff16f3af735ee0e657a816c0ccb2e298 100644 ---- a/Source/WebKit/WebProcess/WebPage/DrawingArea.h -+++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.h -@@ -166,6 +166,9 @@ public: - virtual bool enterAcceleratedCompositingModeIfNeeded() = 0; - virtual void backgroundColorDidChange() { }; - #endif -+#if PLATFORM(WIN) -+ void didChangeAcceleratedCompositingMode(bool enabled); -+#endif - - #if PLATFORM(WPE) && USE(GBM) && ENABLE(WPE_PLATFORM) - virtual void preferredBufferFormatsDidChange() { } diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp -index 0fec14223997c3f22758e78bda6640dfa1865c65..31161fdf651dbacd18e9789218d797e0140ca781 100644 +index 70a6c3c9ed0fcf42393df2c0fb66eb50d290030d..06fb88ca78db70de4bd4ed9cdf33172bee1a958e 100644 --- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp @@ -44,6 +44,7 @@ @@ -21271,7 +21105,7 @@ index 0fec14223997c3f22758e78bda6640dfa1865c65..31161fdf651dbacd18e9789218d797e0 #include #include #include -@@ -455,6 +456,12 @@ void WebCookieJar::removeChangeListener(const String& host, const WebCore::Cooki +@@ -445,6 +446,12 @@ void WebCookieJar::setOptInCookiePartitioningEnabled(bool enabled) } #endif @@ -21285,23 +21119,23 @@ index 0fec14223997c3f22758e78bda6640dfa1865c65..31161fdf651dbacd18e9789218d797e0 String WebCookieJar::cookiesInPartitionedCookieStorage(const WebCore::Document&, const URL&, const WebCore::SameSiteInfo&) const diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.h b/Source/WebKit/WebProcess/WebPage/WebCookieJar.h -index 001207c6c6a651707aa91899536b5cf715047e3f..afe3874d9c6b41f19af4144597557e2abd309f71 100644 +index f9c1d07d4e1f4b5421a627a179ed4f86cf1a1b92..9a8089ed85eebbfb8af0804dfbc0698bcb5993d6 100644 --- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.h +++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.h -@@ -76,6 +76,8 @@ public: +@@ -77,6 +77,8 @@ public: void clearCache() final; + void setCookieFromResponse(WebCore::ResourceLoader&, const String& setCookieValue); + - private: - WebCookieJar(); - + #if HAVE(ALLOW_ONLY_PARTITIONED_COOKIES) + void setOptInCookiePartitioningEnabled(bool); + #endif diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c1cb279fe 100644 +index 4f0c774675bcc9adc7fddd608953bde8840e30dd..224289ffe67a7e16f93d8373eb573849dfb38b06 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -@@ -239,6 +239,7 @@ +@@ -243,6 +243,7 @@ #include #include #include @@ -21309,7 +21143,7 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c #include #include #include -@@ -1137,6 +1138,12 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) +@@ -1152,6 +1153,12 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) setLinkDecorationFilteringData(WTFMove(parameters.linkDecorationFilteringData)); setAllowedQueryParametersForAdvancedPrivacyProtections(WTFMove(parameters.allowedQueryParametersForAdvancedPrivacyProtections)); #endif @@ -21320,9 +21154,9 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c + if (parameters.shouldPauseInInspectorWhenShown) + m_page->inspectorController().pauseOnStart(parameters.windowFeatures ? InspectorController::PauseCondition::WHEN_CREATION_FINISHED : InspectorController::PauseCondition::WHEN_SHOWN); if (parameters.windowFeatures) { - m_page->applyWindowFeatures(*parameters.windowFeatures); - m_page->chrome().show(); -@@ -2098,6 +2105,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, st + page->applyWindowFeatures(*parameters.windowFeatures); + page->chrome().show(); +@@ -2094,6 +2101,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, st frame->loadDidCommitInAnotherProcess(layerHostingContextIdentifier); } @@ -21344,8 +21178,8 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c + void WebPage::loadRequest(LoadParameters&& loadParameters) { - WEBPAGE_RELEASE_LOG(Loading, "loadRequest: navigationID=%" PRIu64 ", shouldTreatAsContinuingLoad=%u, lastNavigationWasAppInitiated=%d, existingNetworkResourceLoadIdentifierToResume=%" PRIu64, loadParameters.navigationID ? loadParameters.navigationID->toUInt64() : 0, static_cast(loadParameters.shouldTreatAsContinuingLoad), loadParameters.request.isAppInitiated(), loadParameters.existingNetworkResourceLoadIdentifierToResume ? loadParameters.existingNetworkResourceLoadIdentifierToResume->toUInt64() : 0); -@@ -2293,7 +2316,9 @@ void WebPage::stopLoading() + WEBPAGE_RELEASE_LOG_FORWARDABLE(Loading, WEBPAGE_LOADREQUEST, loadParameters.navigationID ? loadParameters.navigationID->toUInt64() : 0, static_cast(loadParameters.shouldTreatAsContinuingLoad), loadParameters.request.isAppInitiated(), loadParameters.existingNetworkResourceLoadIdentifierToResume ? loadParameters.existingNetworkResourceLoadIdentifierToResume->toUInt64() : 0); +@@ -2290,7 +2313,9 @@ void WebPage::stopLoading() void WebPage::stopLoadingDueToProcessSwap() { SetForScope isStoppingLoadingDueToProcessSwap(m_isStoppingLoadingDueToProcessSwap, true); @@ -21355,7 +21189,7 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c } bool WebPage::defersLoading() const -@@ -2879,7 +2904,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum +@@ -2866,7 +2891,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum #if PLATFORM(IOS_FAMILY) if (m_viewportConfiguration.setViewportArguments(viewportArguments)) viewportConfigurationChanged(); @@ -21364,8 +21198,8 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c // Adjust view dimensions when using fixed layout. RefPtr localMainFrame = this->localMainFrame(); RefPtr view = localMainFrame ? localMainFrame->view() : nullptr; -@@ -3657,6 +3682,13 @@ void WebPage::flushDeferredScrollEvents() - corePage()->flushDeferredScrollEvents(); +@@ -3623,6 +3648,13 @@ void WebPage::flushDeferredScrollEvents() + protectedCorePage()->flushDeferredScrollEvents(); } +#if ENABLE(ORIENTATION_EVENTS) @@ -21378,7 +21212,7 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c void WebPage::flushDeferredDidReceiveMouseEvent() { if (auto info = std::exchange(m_deferredDidReceiveMouseEvent, std::nullopt)) -@@ -3918,6 +3950,97 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandlersendMessageToTargetBackend(targetId, message); } @@ -21492,8 +21326,8 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c + void WebPage::insertNewlineInQuotedContent() { - RefPtr frame = m_page->checkedFocusController()->focusedOrMainFrame(); -@@ -4247,6 +4380,7 @@ void WebPage::didCompletePageTransition() + RefPtr frame = protectedCorePage()->checkedFocusController()->focusedOrMainFrame(); +@@ -4215,6 +4348,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed) void WebPage::show() { send(Messages::WebPageProxy::ShowPage()); @@ -21501,7 +21335,7 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c } void WebPage::setIsTakingSnapshotsForApplicationSuspension(bool isTakingSnapshotsForApplicationSuspension) -@@ -5417,7 +5551,7 @@ NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana +@@ -5426,7 +5560,7 @@ RefPtr WebPage::protectedNotificationPermi #if ENABLE(DRAG_SUPPORT) @@ -21510,8 +21344,8 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c void WebPage::performDragControllerAction(DragControllerAction action, const IntPoint& clientPosition, const IntPoint& globalPosition, OptionSet draggingSourceOperationMask, SelectionData&& selectionData, OptionSet flags, CompletionHandler, DragHandlingMethod, bool, unsigned, IntRect, IntRect, std::optional)>&& completionHandler) { if (!m_page) -@@ -7879,6 +8013,10 @@ void WebPage::didCommitLoad(WebFrame* frame) - #endif +@@ -7913,6 +8047,10 @@ void WebPage::didCommitLoad(WebFrame* frame) + m_needsFixedContainerEdgesUpdate = true; flushDeferredDidReceiveMouseEvent(); +// Playwright begin @@ -21521,9 +21355,9 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c } void WebPage::didFinishDocumentLoad(WebFrame& frame) -@@ -8186,6 +8324,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, const Resou - WebsitePoliciesData::applyToDocumentLoader(WTFMove(*m_internals->pendingWebsitePolicies), documentLoader); - m_internals->pendingWebsitePolicies = std::nullopt; +@@ -8222,6 +8360,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, const Resou + m_allowsContentJavaScriptFromMostRecentNavigation = m_internals->pendingWebsitePolicies->allowsContentJavaScript; + WebsitePoliciesData::applyToDocumentLoader(*std::exchange(m_internals->pendingWebsitePolicies, std::nullopt), documentLoader); } + } else if (m_pendingFrameNavigationID) { + documentLoader->setNavigationID(*m_pendingFrameNavigationID); @@ -21532,10 +21366,10 @@ index ad8d14f45c5b0719836f8d7faae07bfcac3823b8..50c20d09b7465b218ee3154377a0306c return documentLoader; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h -index 931473cc7600a2600b0c002f8bd8ae823399691c..3955fa4feb65a8f622b4ebecb0edd56489a1a465 100644 +index 8bd2bc55df904c4d23bf47d38981581faf89b2af..c0f2d51469875510b65b252b2ba4c15ef252b9c6 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit/WebProcess/WebPage/WebPage.h -@@ -42,6 +42,7 @@ +@@ -45,6 +45,7 @@ #include #include #include @@ -21543,7 +21377,7 @@ index 931473cc7600a2600b0c002f8bd8ae823399691c..3955fa4feb65a8f622b4ebecb0edd564 #include #include #include -@@ -1265,11 +1266,11 @@ public: +@@ -1272,11 +1273,11 @@ public: void clearSelection(); void restoreSelectionInFocusedEditableElement(); @@ -21557,7 +21391,7 @@ index 931473cc7600a2600b0c002f8bd8ae823399691c..3955fa4feb65a8f622b4ebecb0edd564 void performDragControllerAction(std::optional, DragControllerAction, WebCore::DragData&&, CompletionHandler, WebCore::DragHandlingMethod, bool, unsigned, WebCore::IntRect, WebCore::IntRect, std::optional)>&&); void performDragOperation(WebCore::DragData&&, SandboxExtensionHandle&&, Vector&&, CompletionHandler&&); #endif -@@ -1284,6 +1285,9 @@ public: +@@ -1291,6 +1292,9 @@ public: void didStartDrag(); void dragCancelled(); OptionSet allowedDragSourceActions() const { return m_allowedDragSourceActions; } @@ -21566,9 +21400,9 @@ index 931473cc7600a2600b0c002f8bd8ae823399691c..3955fa4feb65a8f622b4ebecb0edd564 +#endif #endif - void beginPrinting(WebCore::FrameIdentifier, const PrintInfo&); -@@ -1359,8 +1363,11 @@ public: - void gestureEvent(WebCore::FrameIdentifier, const WebGestureEvent&); + #if ENABLE(MODEL_PROCESS) +@@ -1377,8 +1381,11 @@ public: + void gestureEvent(WebCore::FrameIdentifier, const WebGestureEvent&, CompletionHandler, bool, std::optional)>&&); #endif -#if PLATFORM(IOS_FAMILY) @@ -21580,7 +21414,7 @@ index 931473cc7600a2600b0c002f8bd8ae823399691c..3955fa4feb65a8f622b4ebecb0edd564 void dynamicViewportSizeUpdate(const DynamicViewportSizeUpdate&); bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; } void willStartUserTriggeredZooming(); -@@ -1510,6 +1517,8 @@ public: +@@ -1531,6 +1538,8 @@ public: void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType); void disconnectInspector(const String& targetId); void sendMessageToTargetBackend(const String& targetId, const String& message); @@ -21589,15 +21423,15 @@ index 931473cc7600a2600b0c002f8bd8ae823399691c..3955fa4feb65a8f622b4ebecb0edd564 void insertNewlineInQuotedContent(); -@@ -1920,6 +1929,7 @@ public: - void showContextMenuFromFrame(const WebCore::FrameIdentifier&, const ContextMenuContextData&, const UserData&); +@@ -1949,6 +1958,7 @@ public: + void showContextMenuFromFrame(const FrameInfoData&, const ContextMenuContextData&, const UserData&); #endif void loadRequest(LoadParameters&&); + void loadRequestInFrameForInspector(LoadParameters&&, WebCore::FrameIdentifier); - void setTopContentInset(float); + void setObscuredContentInsets(const WebCore::FloatBoxExtent&); -@@ -2105,6 +2115,7 @@ private: +@@ -2145,6 +2155,7 @@ private: void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled); #elif ENABLE(TOUCH_EVENTS) void touchEvent(const WebTouchEvent&, CompletionHandler, bool)>&&); @@ -21605,7 +21439,7 @@ index 931473cc7600a2600b0c002f8bd8ae823399691c..3955fa4feb65a8f622b4ebecb0edd564 #endif void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&); -@@ -2863,6 +2874,7 @@ private: +@@ -2913,6 +2924,7 @@ private: UserActivity m_userActivity; Markable m_pendingNavigationID; @@ -21614,10 +21448,10 @@ index 931473cc7600a2600b0c002f8bd8ae823399691c..3955fa4feb65a8f622b4ebecb0edd564 bool m_mainFrameProgressCompleted { false }; bool m_shouldDispatchFakeMouseMoveEvents { true }; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in -index 46c172ccd69d88d6dbc5d9cd946cd0e2045c69dd..26b47e43a543100a5d952120091726aae3661357 100644 +index 16e97e9e8d9158d290c98231e2a2a9c3b3d2f567..49d4d7eaaba21b3460dd84583a48501deb337664 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in -@@ -57,10 +57,13 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -58,10 +58,13 @@ messages -> WebPage WantsAsyncDispatchMessage { MouseEvent(WebCore::FrameIdentifier frameID, WebKit::WebMouseEvent event, std::optional> sandboxExtensions) SetLastKnownMousePosition(WebCore::FrameIdentifier frameID, WebCore::IntPoint eventPoint, WebCore::IntPoint globalPoint); @@ -21629,10 +21463,10 @@ index 46c172ccd69d88d6dbc5d9cd946cd0e2045c69dd..26b47e43a543100a5d952120091726aa SetSceneIdentifier(String sceneIdentifier) SetViewportConfigurationViewLayoutSize(WebCore::FloatSize size, double scaleFactor, double minimumEffectiveDeviceWidth) - SetDeviceOrientation(WebCore::IntDegrees deviceOrientation) - SetOverrideViewportArguments(std::optional arguments) + SetOverrideViewportArguments(struct std::optional arguments) DynamicViewportSizeUpdate(struct WebKit::DynamicViewportSizeUpdate target) -@@ -152,6 +155,7 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -153,6 +156,7 @@ messages -> WebPage WantsAsyncDispatchMessage { ConnectInspector(String targetId, Inspector::FrontendChannel::ConnectionType connectionType) DisconnectInspector(String targetId) SendMessageToTargetBackend(String targetId, String message) @@ -21640,37 +21474,37 @@ index 46c172ccd69d88d6dbc5d9cd946cd0e2045c69dd..26b47e43a543100a5d952120091726aa #if ENABLE(REMOTE_INSPECTOR) SetIndicating(bool indicating); -@@ -162,6 +166,7 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -163,6 +167,7 @@ messages -> WebPage WantsAsyncDispatchMessage { #endif #if !ENABLE(IOS_TOUCH_EVENTS) && ENABLE(TOUCH_EVENTS) - TouchEvent(WebKit::WebTouchEvent event) -> (std::optional eventType, bool handled) + TouchEvent(WebKit::WebTouchEvent event) -> (enum:uint8_t std::optional eventType, bool handled) + FakeTouchTap(WebCore::IntPoint position, uint8_t modifiers) -> () Async #endif CancelPointer(WebCore::PointerID pointerId, WebCore::IntPoint documentPoint) -@@ -195,6 +200,7 @@ messages -> WebPage WantsAsyncDispatchMessage { - CreateProvisionalFrame(struct WebKit::ProvisionalFrameCreationParameters creationParameters, WebCore::FrameIdentifier frameID) +@@ -190,6 +195,7 @@ messages -> WebPage WantsAsyncDispatchMessage { + CreateProvisionalFrame(struct WebKit::ProvisionalFrameCreationParameters creationParameters) DestroyProvisionalFrame(WebCore::FrameIdentifier frameID); LoadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, std::optional layerHostingContextIdentifier) + LoadRequestInFrameForInspector(struct WebKit::LoadParameters loadParameters, WebCore::FrameIdentifier frameID) LoadRequestWaitingForProcessLaunch(struct WebKit::LoadParameters loadParameters, URL resourceDirectoryURL, WebKit::WebPageProxyIdentifier pageID, bool checkAssumedReadAccessToResourceURL) LoadData(struct WebKit::LoadParameters loadParameters) LoadSimulatedRequestAndResponse(struct WebKit::LoadParameters loadParameters, WebCore::ResourceResponse simulatedResponse) -@@ -361,10 +367,10 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -351,10 +357,10 @@ messages -> WebPage WantsAsyncDispatchMessage { RemoveLayerForFindOverlay() -> () # Drag and drop. -#if PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) +#if (PLATFORM(GTK) || PLATFORM(WPE)) && ENABLE(DRAG_SUPPORT) - PerformDragControllerAction(enum:uint8_t WebKit::DragControllerAction action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet draggingSourceOperationMask, WebCore::SelectionData selection, OptionSet flags) -> (std::optional dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional remoteUserInputEventData) + PerformDragControllerAction(enum:uint8_t WebKit::DragControllerAction action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet draggingSourceOperationMask, WebCore::SelectionData selection, OptionSet flags) -> (enum:uint8_t std::optional dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional remoteUserInputEventData) #endif -#if !PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) +#if !PLATFORM(GTK) && !PLATFORM(WPE) && ENABLE(DRAG_SUPPORT) - PerformDragControllerAction(std::optional frameID, enum:uint8_t WebKit::DragControllerAction action, WebCore::DragData dragData) -> (std::optional dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional remoteUserInputEventData) + PerformDragControllerAction(std::optional frameID, enum:uint8_t WebKit::DragControllerAction action, WebCore::DragData dragData) -> (enum:uint8_t std::optional dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional remoteUserInputEventData) PerformDragOperation(WebCore::DragData dragData, WebKit::SandboxExtensionHandle sandboxExtensionHandle, Vector sandboxExtensionsForUpload) -> (bool handled) #endif -@@ -374,6 +380,10 @@ messages -> WebPage WantsAsyncDispatchMessage { - DragCancelled() +@@ -370,6 +376,10 @@ messages -> WebPage WantsAsyncDispatchMessage { + StageModeSessionDidEnd(std::optional elementID) #endif +#if PLATFORM(MAC) && ENABLE(DRAG_SUPPORT) @@ -21680,16 +21514,54 @@ index 46c172ccd69d88d6dbc5d9cd946cd0e2045c69dd..26b47e43a543100a5d952120091726aa #if PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT) RequestDragStart(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet allowedActionsMask) RequestAdditionalItemsForDragSession(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet allowedActionsMask) +diff --git a/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp b/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp +index 40ec42bb4f998774a2ce4a19e82f68512ad2ebb8..080794e14bfbb3a336d8a89791baee0e1aec3c75 100644 +--- a/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp ++++ b/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp +@@ -210,16 +210,23 @@ String WebPage::platformUserAgent(const URL& url) const + + bool WebPage::hoverSupportedByPrimaryPointingDevice() const + { ++ if (screenHasTouchDeviceOverride()) ++ return !screenHasTouchDeviceOverride().value(); + return WebProcess::singleton().primaryPointingDevice() == AvailableInputDevices::Mouse; + } + + bool WebPage::hoverSupportedByAnyAvailablePointingDevice() const + { ++ if (screenHasTouchDeviceOverride()) ++ return !screenHasTouchDeviceOverride().value(); + return WebProcess::singleton().availableInputDevices().contains(AvailableInputDevices::Mouse); + } + + std::optional WebPage::pointerCharacteristicsOfPrimaryPointingDevice() const + { ++ if (screenHasTouchDeviceOverride() && screenHasTouchDeviceOverride().value()) ++ return PointerCharacteristics::Coarse; ++ + const auto& primaryPointingDevice = WebProcess::singleton().primaryPointingDevice(); + if (primaryPointingDevice == AvailableInputDevices::Mouse) + return PointerCharacteristics::Fine; +@@ -230,6 +237,9 @@ std::optional WebPage::pointerCharacteristicsOfPrimaryPo + + OptionSet WebPage::pointerCharacteristicsOfAllAvailablePointingDevices() const + { ++ if (screenHasTouchDeviceOverride() && screenHasTouchDeviceOverride().value()) ++ return PointerCharacteristics::Coarse; ++ + OptionSet pointerCharacteristics; + const auto& availableInputs = WebProcess::singleton().availableInputDevices(); + if (availableInputs.contains(AvailableInputDevices::Mouse)) diff --git a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -index 0b583e682f64d0164def139cbd5c34597ce98db5..306263b5b96515100ecd6639b2566977958b0dea 100644 +index 932e27ac30ca12459321e4bc1386e7489f647831..ae8dafebd63dbc78c4000dad9f86f3f2208b69b9 100644 --- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm +++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -@@ -798,21 +798,37 @@ String WebPage::platformUserAgent(const URL&) const +@@ -703,21 +703,37 @@ String WebPage::platformUserAgent(const URL&) const bool WebPage::hoverSupportedByPrimaryPointingDevice() const { +#if ENABLE(TOUCH_EVENTS) -+ return !screenIsTouchPrimaryInputDevice(); ++ return !screenHasTouchDevice(); +#else return true; +#endif @@ -21707,7 +21579,7 @@ index 0b583e682f64d0164def139cbd5c34597ce98db5..306263b5b96515100ecd6639b2566977 std::optional WebPage::pointerCharacteristicsOfPrimaryPointingDevice() const { +#if ENABLE(TOUCH_EVENTS) -+ if (screenIsTouchPrimaryInputDevice()) ++ if (screenHasTouchDevice()) + return PointerCharacteristics::Coarse; +#endif return PointerCharacteristics::Fine; @@ -21723,7 +21595,7 @@ index 0b583e682f64d0164def139cbd5c34597ce98db5..306263b5b96515100ecd6639b2566977 } diff --git a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp -index f17f5d719d892309ed9c7093384945866b5117b9..1dba47bbf0dbd0362548423a74b380346dbea147 100644 +index f17f5d719d892309ed9c7093384945866b5117b9..adffe0aa4440c626879e3f5701dd5fea4b2d1a0f 100644 --- a/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp +++ b/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp @@ -43,6 +43,7 @@ @@ -21739,7 +21611,7 @@ index f17f5d719d892309ed9c7093384945866b5117b9..1dba47bbf0dbd0362548423a74b38034 bool WebPage::hoverSupportedByPrimaryPointingDevice() const { +#if ENABLE(TOUCH_EVENTS) -+ return !screenIsTouchPrimaryInputDevice(); ++ return !screenHasTouchDevice(); +#else return true; +#endif @@ -21757,7 +21629,7 @@ index f17f5d719d892309ed9c7093384945866b5117b9..1dba47bbf0dbd0362548423a74b38034 std::optional WebPage::pointerCharacteristicsOfPrimaryPointingDevice() const { +#if ENABLE(TOUCH_EVENTS) -+ if (screenIsTouchPrimaryInputDevice()) ++ if (screenHasTouchDevice()) + return PointerCharacteristics::Coarse; +#endif return PointerCharacteristics::Fine; @@ -21773,10 +21645,10 @@ index f17f5d719d892309ed9c7093384945866b5117b9..1dba47bbf0dbd0362548423a74b38034 } diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp -index 2aa5f4a4491d2ba9bae275308b3d669d9d0b3dfa..3e09cd6d639634ee368bfd699f5c597af9367707 100644 +index 757208df2beb144defe64fe4181d972f823ec89a..5c1bc069b031a5787515e787ed9abe441c124971 100644 --- a/Source/WebKit/WebProcess/WebProcess.cpp +++ b/Source/WebKit/WebProcess/WebProcess.cpp -@@ -91,6 +91,7 @@ +@@ -93,6 +93,7 @@ #include "WebsiteData.h" #include "WebsiteDataStoreParameters.h" #include "WebsiteDataType.h" @@ -21784,7 +21656,7 @@ index 2aa5f4a4491d2ba9bae275308b3d669d9d0b3dfa..3e09cd6d639634ee368bfd699f5c597a #include #include #include -@@ -376,6 +377,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter +@@ -388,6 +389,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter { JSC::Options::AllowUnfinalizedAccessScope scope; JSC::Options::allowNonSPTagging() = false; @@ -21799,7 +21671,7 @@ index 2aa5f4a4491d2ba9bae275308b3d669d9d0b3dfa..3e09cd6d639634ee368bfd699f5c597a JSC::Options::notifyOptionsChanged(); } -@@ -383,6 +392,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter +@@ -395,6 +404,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter platformInitializeProcess(parameters); updateCPULimit(); @@ -21808,16 +21680,17 @@ index 2aa5f4a4491d2ba9bae275308b3d669d9d0b3dfa..3e09cd6d639634ee368bfd699f5c597a } void WebProcess::initializeConnection(IPC::Connection* connection) -@@ -937,6 +948,7 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters& +@@ -975,6 +986,8 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters& accessibilityRelayProcessSuspended(false); } ASSERT(result.iterator->value); ++ + result.iterator->value->didAddWebPageToWebProcess(); } void WebProcess::removeWebPage(PageIdentifier pageID) diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm -index 64e9b56bbc644c8ed1583cdbf41878738860292d..fe83a85ccf53ee33f5a6a7461b40078d77928b61 100644 +index c0fa99b99c2d0464f976bed096ee774db8a7e3c9..7b9fb12ef6198e8a052efe0e6d37768ad161d3aa 100644 --- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm @@ -4223,7 +4223,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END @@ -21830,10 +21703,10 @@ index 64e9b56bbc644c8ed1583cdbf41878738860292d..fe83a85ccf53ee33f5a6a7461b40078d - (void)touch:(WebEvent *)event { diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm -index 0a91e3dcd2071893d4a3f0bb42d43f1435c2d04b..be0037d7284f88c2fbd42070da4d6058408db3c4 100644 +index e7d231ff9a7a975d442f9b790a0aad2d666e9972..263d30a59c67e4bd930a1961941a9742760df4d3 100644 --- a/Source/WebKitLegacy/mac/WebView/WebView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebView.mm -@@ -3986,7 +3986,7 @@ + (void)_doNotStartObservingNetworkReachability +@@ -3992,7 +3992,7 @@ + (void)_doNotStartObservingNetworkReachability } #endif // PLATFORM(IOS_FAMILY) @@ -21842,7 +21715,7 @@ index 0a91e3dcd2071893d4a3f0bb42d43f1435c2d04b..be0037d7284f88c2fbd42070da4d6058 - (NSArray *)_touchEventRegions { -@@ -4028,7 +4028,7 @@ - (NSArray *)_touchEventRegions +@@ -4034,7 +4034,7 @@ - (NSArray *)_touchEventRegions }).autorelease(); } @@ -21883,20 +21756,21 @@ index 0000000000000000000000000000000000000000..dd6a53e2d57318489b7e49dd7373706d + LIBVPX_LIBRARIES +) diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake -index 22894830f9eb1be8e2fd3d4fc04711aa49eca6a7..e49dcaf62241f53baf3911e2c40f07c96eb9f0db 100644 +index dc6bd15038f36e65b47974960a414b0d7c170e63..da2dba81c6cb4617cc2b946f24060ec8fcf46c87 100644 --- a/Source/cmake/OptionsGTK.cmake +++ b/Source/cmake/OptionsGTK.cmake -@@ -7,6 +7,9 @@ SET_PROJECT_VERSION(2 47 2) - - set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string") +@@ -9,6 +9,10 @@ set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string") + # Update Source/WTF/wtf/Platform.h to match required GLib versions. + find_package(GLIB 2.70.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule) ++ +set(CMAKE_THREAD_PREFER_PTHREAD TRUE) +set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Cairo 1.16.0 REQUIRED) find_package(LibGcrypt 1.7.0 REQUIRED) find_package(Libtasn1 REQUIRED) -@@ -22,6 +25,10 @@ find_package(ZLIB REQUIRED) +@@ -24,6 +28,10 @@ find_package(ZLIB REQUIRED) find_package(WebP REQUIRED COMPONENTS demux) find_package(ATSPI 2.5.3) @@ -21907,7 +21781,7 @@ index 22894830f9eb1be8e2fd3d4fc04711aa49eca6a7..e49dcaf62241f53baf3911e2c40f07c9 include(GStreamerDefinitions) include(FindGLibCompileResources) -@@ -69,6 +76,10 @@ WEBKIT_OPTION_DEFINE(USE_SYSTEM_UNIFDEF "Whether to use a system-provided unifde +@@ -71,6 +79,10 @@ WEBKIT_OPTION_DEFINE(USE_SYSTEM_UNIFDEF "Whether to use a system-provided unifde WEBKIT_OPTION_DEPEND(USE_SYSTEM_SYSPROF_CAPTURE USE_SYSPROF_CAPTURE) @@ -21918,7 +21792,7 @@ index 22894830f9eb1be8e2fd3d4fc04711aa49eca6a7..e49dcaf62241f53baf3911e2c40f07c9 SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE}) if (DEVELOPER_MODE) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PRIVATE ON) -@@ -155,6 +166,20 @@ endif () +@@ -149,6 +161,20 @@ endif () WEBKIT_OPTION_DEPEND(ENABLE_GPU_PROCESS USE_GBM) @@ -21940,10 +21814,10 @@ index 22894830f9eb1be8e2fd3d4fc04711aa49eca6a7..e49dcaf62241f53baf3911e2c40f07c9 # Finalize the value for all options. Do not attempt to use an option before diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake -index c9b3bcd943d9df19f1b240b8b3704d51c5398411..51c1615a4caedc67675d0c6d49db4ef35f0ad403 100644 +index 8c12c0a16e14d3d537704114afc15f6935e17dcd..0c70ff37d45230597a5210e166d242a78bfb8730 100644 --- a/Source/cmake/OptionsWPE.cmake +++ b/Source/cmake/OptionsWPE.cmake -@@ -21,6 +21,9 @@ find_package(WebP REQUIRED COMPONENTS demux) +@@ -23,6 +23,9 @@ find_package(WebP REQUIRED COMPONENTS demux) find_package(WPE REQUIRED) find_package(ZLIB REQUIRED) @@ -21953,7 +21827,7 @@ index c9b3bcd943d9df19f1b240b8b3704d51c5398411..51c1615a4caedc67675d0c6d49db4ef3 WEBKIT_OPTION_BEGIN() SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE}) -@@ -84,6 +87,29 @@ if (WPE_VERSION VERSION_GREATER_EQUAL 1.13.90) +@@ -85,6 +88,21 @@ if (WPE_VERSION VERSION_GREATER_EQUAL 1.13.90) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GAMEPAD PUBLIC ON) endif () @@ -21966,16 +21840,8 @@ index c9b3bcd943d9df19f1b240b8b3704d51c5398411..51c1615a4caedc67675d0c6d49db4ef3 +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_APPLICATION_MANIFEST PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CURSOR_VISIBILITY PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DARK_MODE_CSS PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DATALIST_ELEMENT PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DEVICE_ORIENTATION PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_COLOR PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_DATE PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_DATETIMELOCAL PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_MONTH PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_TIME PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_WEEK PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DATE_AND_TIME_INPUT_TYPES PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPEECH_SYNTHESIS PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_POINTER_LOCK PRIVATE ON) +# Playwright end. @@ -21983,7 +21849,7 @@ index c9b3bcd943d9df19f1b240b8b3704d51c5398411..51c1615a4caedc67675d0c6d49db4ef3 # Public options specific to the WPE port. Do not add any options here unless # there is a strong reason we should support changing the value of the option, # and the option is not relevant to other WebKit ports. -@@ -119,6 +145,11 @@ WEBKIT_OPTION_DEPEND(USE_QT6 ENABLE_WPE_PLATFORM) +@@ -120,6 +138,11 @@ WEBKIT_OPTION_DEPEND(USE_QT6 ENABLE_WPE_PLATFORM) WEBKIT_OPTION_DEPEND(USE_SKIA_OPENTYPE_SVG USE_SKIA) WEBKIT_OPTION_DEPEND(USE_SYSTEM_SYSPROF_CAPTURE USE_SYSPROF_CAPTURE) @@ -21996,10 +21862,10 @@ index c9b3bcd943d9df19f1b240b8b3704d51c5398411..51c1615a4caedc67675d0c6d49db4ef3 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BUBBLEWRAP_SANDBOX PUBLIC ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON) diff --git a/Source/cmake/OptionsWin.cmake b/Source/cmake/OptionsWin.cmake -index 82a672f6ab17b20b1f2ce373cb627905ada281b2..e72eb75475bc09eeb92bd0b8a207e704674ff5a5 100644 +index ee7c004624e7da8e0a7af18356fc9a378f82020a..9fcabed645095932d997ed5a69a9a5534ac3cb35 100644 --- a/Source/cmake/OptionsWin.cmake +++ b/Source/cmake/OptionsWin.cmake -@@ -76,6 +76,27 @@ find_package(ZLIB 1.2.11 REQUIRED) +@@ -73,6 +73,27 @@ find_package(ZLIB 1.2.11 REQUIRED) find_package(LibPSL 0.20.2 REQUIRED) find_package(WebP REQUIRED COMPONENTS demux) @@ -22027,7 +21893,7 @@ index 82a672f6ab17b20b1f2ce373cb627905ada281b2..e72eb75475bc09eeb92bd0b8a207e704 WEBKIT_OPTION_BEGIN() # FIXME: Most of these options should not be public. -@@ -141,6 +162,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) +@@ -131,6 +152,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS ON) SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS ON) @@ -22043,7 +21909,7 @@ index 82a672f6ab17b20b1f2ce373cb627905ada281b2..e72eb75475bc09eeb92bd0b8a207e704 set(USE_ANGLE_EGL ON) diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake -index 4882f3de3d9cb011a666563f0bc0e142a705518f..d3f674bf78792088a60a631c245a1fa86dca4d53 100644 +index de1cb6c496ccce806010ec1da8f6a4d6d731e0c1..17ea31b9623d939fc2db0249b04caeb8f78fd725 100644 --- a/Source/cmake/WebKitCompilerFlags.cmake +++ b/Source/cmake/WebKitCompilerFlags.cmake @@ -122,7 +122,7 @@ macro(WEBKIT_ADD_TARGET_CXX_FLAGS _target) @@ -22458,10 +22324,10 @@ index 8433f5360dc4a5f43b68b67192fb3d9bf5064cf1..9fa8f53e90fe5a32be1c8e7a9daa6404 g_clear_object(&interfaceSettings); diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp -index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f66566471ad9733f 100644 +index 6a898a5bd79a4e6f2f26be7f63347cef7a5c0ab4..d895941dab0f7a0bdfafcf60f203aa82c46874a6 100644 --- a/Tools/MiniBrowser/wpe/main.cpp +++ b/Tools/MiniBrowser/wpe/main.cpp -@@ -49,6 +49,9 @@ static gboolean headlessMode; +@@ -52,6 +52,9 @@ static gboolean headlessMode; static gboolean privateMode; static gboolean automationMode; static gboolean ignoreTLSErrors; @@ -22471,7 +22337,7 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 static const char* contentFilter; static const char* cookiesFile; static const char* cookiesPolicy; -@@ -127,6 +130,9 @@ static const GOptionEntry commandLineOptions[] = +@@ -130,6 +133,9 @@ static const GOptionEntry commandLineOptions[] = #endif { "size", 's', 0, G_OPTION_ARG_CALLBACK, reinterpret_cast(parseWindowSize), "Specify the window size to use, e.g. --size=\"800x600\"", nullptr }, { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WPE version", nullptr }, @@ -22481,7 +22347,7 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" }, { nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr } }; -@@ -285,15 +291,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul +@@ -288,15 +294,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul g_main_loop_quit(data->mainLoop); } @@ -22522,7 +22388,7 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 { auto backend = createViewBackend(defaultWindowWidthLegacyAPI, defaultWindowHeightLegacyAPI); WebKitWebViewBackend* viewBackend = nullptr; -@@ -308,12 +337,27 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi +@@ -311,12 +340,27 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi }, backend.release()); } @@ -22556,18 +22422,23 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 #if ENABLE_WPE_PLATFORM if (auto* wpeView = webkit_web_view_get_wpe_view(newWebView)) { -@@ -328,6 +372,10 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi - - g_hash_table_add(openViews, newWebView); +@@ -328,9 +372,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi + g_signal_connect(newWebView, "create", G_CALLBACK(createWebView), user_data); + g_signal_connect(newWebView, "close", G_CALLBACK(webViewClose), user_data); +- ++// Playwright begin + g_signal_connect(newWebView, "load-failed", G_CALLBACK(webViewLoadFailed), nullptr); + g_signal_connect(newWebView, "script-dialog", G_CALLBACK(scriptDialog), nullptr); + g_signal_connect(newWebView, "script-dialog-handled", G_CALLBACK(scriptDialogHandled), nullptr); + g_signal_connect(newWebView, "decide-policy", G_CALLBACK(webViewDecidePolicy), nullptr); ++// Playwright end + g_hash_table_add(openViews, newWebView); +- return newWebView; } -@@ -415,13 +463,105 @@ void loadConfigFile(WPESettings* settings) +@@ -418,13 +466,105 @@ void loadConfigFile(WPESettings* settings) } #endif @@ -22674,7 +22545,7 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 webkit_network_session_set_itp_enabled(networkSession, enableITP); if (proxy) { -@@ -448,10 +588,18 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -451,10 +591,18 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* webkit_cookie_manager_set_persistent_storage(cookieManager, cookiesFile, storageType); } } @@ -22695,7 +22566,7 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 webkit_website_data_manager_set_itp_enabled(manager, enableITP); if (proxy) { -@@ -482,6 +630,7 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -485,6 +633,7 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* } #endif @@ -22703,7 +22574,7 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 WebKitUserContentManager* userContentManager = nullptr; if (contentFilter) { GFile* contentFilterFile = g_file_new_for_commandline_arg(contentFilter); -@@ -560,6 +709,15 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -563,6 +712,15 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* "autoplay", WEBKIT_AUTOPLAY_ALLOW, nullptr); @@ -22719,7 +22590,7 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, "backend", viewBackend, "web-context", webContext, -@@ -606,8 +764,6 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -609,12 +767,16 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* } #endif @@ -22728,7 +22599,17 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 g_signal_connect(webContext, "automation-started", G_CALLBACK(automationStartedCallback), webView); g_signal_connect(webView, "permission-request", G_CALLBACK(decidePermissionRequest), nullptr); g_signal_connect(webView, "create", G_CALLBACK(createWebView), application); -@@ -619,16 +775,11 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* + g_signal_connect(webView, "close", G_CALLBACK(webViewClose), application); ++// Playwright begin ++ g_signal_connect(webView, "load-failed", G_CALLBACK(webViewLoadFailed), nullptr); ++ g_signal_connect(webView, "script-dialog", G_CALLBACK(scriptDialog), nullptr); ++ g_signal_connect(webView, "script-dialog-handled", G_CALLBACK(scriptDialogHandled), nullptr); ++ g_signal_connect(webView, "decide-policy", G_CALLBACK(webViewDecidePolicy), nullptr); ++// Playwright end + g_hash_table_add(openViews, webView); + + WebKitColor color; +@@ -622,16 +784,11 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* webkit_web_view_set_background_color(webView, &color); if (uriArguments) { @@ -22750,7 +22631,7 @@ index f5403031c914d7fedeb4649c4891beb7d681007e..eb1fe97ebb4e55eb1d4443e5f6656647 webkit_web_view_load_uri(webView, "https://wpewebkit.org"); g_object_unref(webContext); -@@ -725,8 +876,14 @@ int main(int argc, char *argv[]) +@@ -728,8 +885,14 @@ int main(int argc, char *argv[]) } } @@ -22778,10 +22659,10 @@ index 1067b31bc989748dfcc5502209d36d001b9b239e..7629263fb8bc93dca6dfc01c75eed8d2 + add_subdirectory(Playwright/win) +endif () diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit -index 470dcf1f4440f3db350fc416150a2e792a2777c7..31cbc0d22e63d054cf6edcc220a1c6b407cc1f24 100755 +index df483701f5b9c69718669fff32bb35475c7bf0c9..5cff91cb4618417691586a5771291eec9f89bee3 100755 --- a/Tools/Scripts/build-webkit +++ b/Tools/Scripts/build-webkit -@@ -273,7 +273,7 @@ if (isAppleCocoaWebKit()) { +@@ -274,7 +274,7 @@ if (isAppleCocoaWebKit()) { push @projects, ("Source/WebKit"); if (!isEmbeddedWebKit()) { @@ -22806,19 +22687,27 @@ index 9e53f459e444b9c10fc5248f0e8059df6c1e0041..c17c875a7dd3ca05c4489578ab32378b "${WebKitTestRunner_DIR}/InjectedBundle/Bindings/AccessibilityController.idl" "${WebKitTestRunner_DIR}/InjectedBundle/Bindings/AccessibilityTextMarker.idl" diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp -index a6dc6170c6cb9a6a21fc9abb11b90e3ca1ac3ebc..960d9432d52d5cabe75aca2bc036de248a149681 100644 +index ce8aa4f20d8e0f14a51ae27d8d9440b55e0ea433..cf93f834e135f932ffba7e7101052fcbd9e6b4b2 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp -@@ -984,6 +984,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) - 0, // requestStorageAccessConfirm +@@ -711,6 +711,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* par + nullptr, // requestStorageAccessConfirm + nullptr, // shouldAllowDeviceOrientationAndMotionAccess + nullptr, // runWebAuthenticationPanel ++ 0, // handleJavaScriptDialog + nullptr, // decidePolicyForSpeechRecognitionPermissionRequest + nullptr, // decidePolicyForMediaKeySystemPermissionRequest + nullptr, // queryPermission +@@ -1186,6 +1187,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) + nullptr, // requestStorageAccessConfirm shouldAllowDeviceOrientationAndMotionAccess, runWebAuthenticationPanel, + 0, // handleJavaScriptDialog - 0, + nullptr, // decidePolicyForSpeechRecognitionPermissionRequest decidePolicyForMediaKeySystemPermissionRequest, queryPermission, diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm -index c1381b06b378a5121be926b1dfda3e5509bcd051..773e5882b6f2269201ca49433d0b69866493118d 100644 +index 9419696018c076d0e5b4ef04ea7c58be9504cd96..06c537e3c022517449068a11ea59400413e8f4dc 100644 --- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm +++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm @@ -961,4 +961,51 @@ void EventSenderProxy::waitForPendingMouseEvents() @@ -22874,7 +22763,7 @@ index c1381b06b378a5121be926b1dfda3e5509bcd051..773e5882b6f2269201ca49433d0b6986 + } // namespace WTR diff --git a/Tools/jhbuild/jhbuild-minimal.modules b/Tools/jhbuild/jhbuild-minimal.modules -index 3a0b7425900b14ce2aa0d48aa914cd69bff1f332..22fb1ab2ea76e1e253c79ba1fa3fa448f7584b43 100644 +index 3a0b7425900b14ce2aa0d48aa914cd69bff1f332..0ce07cc1368c6f521b51d6300dca9c4d078beef3 100644 --- a/Tools/jhbuild/jhbuild-minimal.modules +++ b/Tools/jhbuild/jhbuild-minimal.modules @@ -67,8 +67,8 @@ @@ -22907,6 +22796,17 @@ index 3a0b7425900b14ce2aa0d48aa914cd69bff1f332..22fb1ab2ea76e1e253c79ba1fa3fa448 +@@ -194,8 +193,8 @@ + + + + diff --git a/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp b/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp index df22308266c6f69d24a60905f8d05e4e80f21b9b..2d0838070dc10793418cbb648b095a5ffa76f1b8 100644 --- a/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp @@ -22970,7 +22870,7 @@ index df22308266c6f69d24a60905f8d05e4e80f21b9b..2d0838070dc10793418cbb648b095a5f static cairo_user_data_key_t bufferKey; cairo_surface_set_user_data(m_snapshot, &bufferKey, buffer, diff --git a/WebKit.xcworkspace/contents.xcworkspacedata b/WebKit.xcworkspace/contents.xcworkspacedata -index a0f02e61be7e667c6ba164ca578109af36ac28d9..8f5af2e82c167ba6798fb7fde24a9f641f6554a5 100644 +index 3ad442a8691847c6921c5f66a805b7b0523b1e27..95407368a95d2f7d6fb697110912014cabe29afa 100644 --- a/WebKit.xcworkspace/contents.xcworkspacedata +++ b/WebKit.xcworkspace/contents.xcworkspacedata @@ -4,6 +4,9 @@ diff --git a/browser_patches/winldd/EXPECTED_BUILDS b/browser_patches/winldd/EXPECTED_BUILDS index 349b4249b6a6d..cdead62b4c141 100644 --- a/browser_patches/winldd/EXPECTED_BUILDS +++ b/browser_patches/winldd/EXPECTED_BUILDS @@ -1,2 +1 @@ winldd-win64.zip -winldd-win64.tar.br diff --git a/docs/src/api/class-browsertype.md b/docs/src/api/class-browsertype.md index f970d4aef3d39..55014ad9a4ff1 100644 --- a/docs/src/api/class-browsertype.md +++ b/docs/src/api/class-browsertype.md @@ -117,6 +117,7 @@ can see what is going on. Defaults to 0. ### option: BrowserType.connect.logger * since: v1.14 * langs: js +* deprecated: The logs received by the logger are incomplete. Please use tracing instead. - `logger` <[Logger]> Logger sink for Playwright logging. Optional. @@ -201,10 +202,9 @@ A CDP websocket endpoint or http url to connect to. For example `http://localhos ### option: BrowserType.connectOverCDP.endpointURL * since: v1.14 * langs: js +* deprecated: Use the first argument instead. - `endpointURL` <[string]> -Deprecated, use the first argument instead. Optional. - ### option: BrowserType.connectOverCDP.headers * since: v1.11 - `headers` <[Object]<[string], [string]>> @@ -221,6 +221,7 @@ can see what is going on. Defaults to 0. ### option: BrowserType.connectOverCDP.logger * since: v1.14 * langs: js +* deprecated: The logs received by the logger are incomplete. Please use tracing instead. - `logger` <[Logger]> Logger sink for Playwright logging. Optional. diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md index 25462a0ed96e6..0859289a7fe66 100644 --- a/docs/src/api/class-locator.md +++ b/docs/src/api/class-locator.md @@ -206,13 +206,6 @@ Below is the HTML markup and the respective ARIA snapshot: - link "About" ``` -### option: Locator.ariaSnapshot.ref -* since: v1.52 -- `ref` <[boolean]> - -Generate symbolic reference for each element. One can use `aria-ref=` locator immediately after capturing the -snapshot to perform actions on the element. - ### option: Locator.ariaSnapshot.timeout = %%-input-timeout-%% * since: v1.49 @@ -587,6 +580,46 @@ When all steps combined have not finished during the specified [`option: timeout ### option: Locator.dblclick.trial = %%-input-trial-with-modifiers-%% * since: v1.14 +## method: Locator.describe +* since: v1.53 +- returns: <[Locator]> + +Describes the locator, description is used in the trace viewer and reports. +Returns the locator pointing to the same element. + +**Usage** + +```js +const button = page.getByTestId('btn-sub').describe('Subscribe button'); +await button.click(); +``` + +```java +Locator button = page.getByTestId("btn-sub").describe("Subscribe button"); +button.click(); +``` + +```python async +button = page.get_by_test_id("btn-sub").describe("Subscribe button") +await button.click() +``` + +```python sync +button = page.get_by_test_id("btn-sub").describe("Subscribe button") +button.click() +``` + +```csharp +var button = Page.GetByTestId("btn-sub").Describe("Subscribe button"); +await button.ClickAsync(); +``` + +### param: Locator.describe.description +* since: v1.53 +- `description` <[string]> + +Locator description. + ## async method: Locator.dispatchEvent * since: v1.14 @@ -871,6 +904,37 @@ If [`param: expression`] throws or rejects, this method throws. **Usage** +Passing argument to [`param: expression`]: + +```js +const result = await page.getByTestId('myId').evaluate((element, [x, y]) => { + return element.textContent + ' ' + x * y; +}, [7, 8]); +console.log(result); // prints "myId text 56" +``` + +```java +Object result = page.getByTestId("myId").evaluate("(element, [x, y]) => {\n" + + " return element.textContent + ' ' + x * y;\n" + + "}", Arrays.asList(7, 8)); +System.out.println(result); // prints "myId text 56" +``` + +```python async +result = await page.get_by_testid("myId").evaluate("(element, [x, y]) => element.textContent + ' ' + x * y", [7, 8]) +print(result) # prints "myId text 56" +``` + +```python sync +result = page.get_by_testid("myId").evaluate("(element, [x, y]) => element.textContent + ' ' + x * y", [7, 8]) +print(result) # prints "myId text 56" +``` + +```csharp +var result = await page.GetByTestId("myId").EvaluateAsync("(element, [x, y]) => element.textContent + ' ' + x * y)", new[] { 7, 8 }); +Console.WriteLine(result); // prints "myId text 56" +``` + ### param: Locator.evaluate.expression = %%-evaluate-expression-%% * since: v1.14 diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md index 78ed036c0fab3..c2edbf7533c6c 100644 --- a/docs/src/api/class-locatorassertions.md +++ b/docs/src/api/class-locatorassertions.md @@ -1087,7 +1087,7 @@ await Expect(locator).ToContainClassAsync("row middle"); When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class lists. Each element's class attribute is matched against the corresponding class in the array: ```html -
+
@@ -1095,30 +1095,30 @@ When an array is passed, the method asserts that the list of elements located ma ``` ```js -const locator = page.locator('list > .component'); +const locator = page.locator('.list > .component'); await expect(locator).toContainClass(['inactive', 'active', 'inactive']); ``` ```java -assertThat(page.locator("list > .component")).containsClass(new String[] {"inactive", "active", "inactive"}); +assertThat(page.locator(".list > .component")).containsClass(new String[] {"inactive", "active", "inactive"}); ``` ```python async from playwright.async_api import expect -locator = page.locator("list > .component") +locator = page.locator(".list > .component") await expect(locator).to_contain_class(["inactive", "active", "inactive"]) ``` ```python sync from playwright.sync_api import expect -locator = page.locator("list > .component") +locator = page.locator(".list > .component") await expect(locator).to_contain_class(["inactive", "active", "inactive"]) ``` ```csharp -var locator = Page.Locator("list > .component"); +var locator = Page.Locator(".list > .component"); await Expect(locator).ToContainClassAsync(new string[]{"inactive", "active", "inactive"}); ``` @@ -1591,30 +1591,30 @@ await Expect(locator).ToHaveClassAsync(new Regex("(^|\\s)selected(\\s|$)")); When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class values. Each element's class attribute is matched against the corresponding string or regular expression in the array: ```js -const locator = page.locator('list > .component'); +const locator = page.locator('.list > .component'); await expect(locator).toHaveClass(['component', 'component selected', 'component']); ``` ```java -assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"}); +assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"}); ``` ```python async from playwright.async_api import expect -locator = page.locator("list > .component") +locator = page.locator(".list > .component") await expect(locator).to_have_class(["component", "component selected", "component"]) ``` ```python sync from playwright.sync_api import expect -locator = page.locator("list > .component") +locator = page.locator(".list > .component") expect(locator).to_have_class(["component", "component selected", "component"]) ``` ```csharp -var locator = Page.Locator("list > .component"); +var locator = Page.Locator(".list > .component"); await Expect(locator).ToHaveClassAsync(new string[]{"component", "component selected", "component"}); ``` diff --git a/docs/src/api/class-logger.md b/docs/src/api/class-logger.md index 5ab4f3128a168..bd32e7065d94e 100644 --- a/docs/src/api/class-logger.md +++ b/docs/src/api/class-logger.md @@ -1,6 +1,7 @@ # class: Logger * since: v1.8 * langs: js +* deprecated: This class is deprecated. The logs pumped through this class are incomplete. Please use tracing instead. Playwright generates a lot of logs and they are accessible via the pluggable logger sink. diff --git a/docs/src/api/class-tracing.md b/docs/src/api/class-tracing.md index 3b0011c7b1d3d..0528891fdcb96 100644 --- a/docs/src/api/class-tracing.md +++ b/docs/src/api/class-tracing.md @@ -3,6 +3,12 @@ API for collecting and saving Playwright traces. Playwright traces can be opened in [Trace Viewer](../trace-viewer.md) after Playwright script runs. +:::note +You probably want to [enable tracing in your config file](https://playwright.dev/docs/api/class-testoptions#test-options-trace) instead of using `context.tracing`. + +The `context.tracing` API captures browser operations and network activity, but it doesn't record test assertions (like `expect` calls). We recommend [enabling tracing through Playwright Test configuration](https://playwright.dev/docs/api/class-testoptions#test-options-trace), which includes those assertions and provides a more complete trace for debugging test failures. +::: + Start recording a trace before performing actions. At the end, stop tracing and save it to a file. ```js @@ -11,6 +17,7 @@ const context = await browser.newContext(); await context.tracing.start({ screenshots: true, snapshots: true }); const page = await context.newPage(); await page.goto('https://playwright.dev'); +expect(page.url()).toBe('https://playwright.dev'); await context.tracing.stop({ path: 'trace.zip' }); ``` @@ -66,12 +73,19 @@ await context.Tracing.StopAsync(new() Start tracing. +:::note +You probably want to [enable tracing in your config file](https://playwright.dev/docs/api/class-testoptions#test-options-trace) instead of using `Tracing.start`. + +The `context.tracing` API captures browser operations and network activity, but it doesn't record test assertions (like `expect` calls). We recommend [enabling tracing through Playwright Test configuration](https://playwright.dev/docs/api/class-testoptions#test-options-trace), which includes those assertions and provides a more complete trace for debugging test failures. +::: + **Usage** ```js await context.tracing.start({ screenshots: true, snapshots: true }); const page = await context.newPage(); await page.goto('https://playwright.dev'); +expect(page.url()).toBe('https://playwright.dev'); await context.tracing.stop({ path: 'trace.zip' }); ``` diff --git a/docs/src/api/class-websocketroute.md b/docs/src/api/class-websocketroute.md index e23316ebcbd07..fcbe1b21f107a 100644 --- a/docs/src/api/class-websocketroute.md +++ b/docs/src/api/class-websocketroute.md @@ -5,7 +5,7 @@ Whenever a [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSoc **Mocking** -By default, the routed WebSocket will not connect to the server. This way, you can mock entire communcation over the WebSocket. Here is an example that responds to a `"request"` with a `"response"`. +By default, the routed WebSocket will not connect to the server. This way, you can mock entire communication over the WebSocket. Here is an example that responds to a `"request"` with a `"response"`. ```js await page.routeWebSocket('wss://example.com/ws', ws => { @@ -333,7 +333,7 @@ Function that will handle WebSocket closure. Received an optional [close code](h ### param: WebSocketRoute.onClose.handler * since: v1.48 * langs: csharp -- `handler` <[function]\([int?], [string]\)> +- `handler` <[function]\([int?], [string?]\)> Function that will handle WebSocket closure. Received an optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code) and an optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason). diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 4c49370044b2e..d8278abd6a19c 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -687,6 +687,7 @@ Emulates `'prefers-contrast'` media feature, supported values are `'no-preferenc ## context-option-logger * langs: js +* deprecated: The logs received by the logger are incomplete. Please use tracing instead. - `logger` <[Logger]> Logger sink for Playwright logging. @@ -1071,6 +1072,8 @@ Whether to run browser in headless mode. More details for Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox). +You can also provide a path to a custom [`policies.json` file](https://mozilla.github.io/policy-templates/) via `PLAYWRIGHT_FIREFOX_POLICIES_JSON` environment variable. + ## csharp-java-browser-option-firefoxuserprefs * langs: csharp, java - `firefoxUserPrefs` <[Object]<[string], [any]>> @@ -1078,8 +1081,11 @@ Firefox user preferences. Learn more about the Firefox user preferences at Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox). +You can also provide a path to a custom [`policies.json` file](https://mozilla.github.io/policy-templates/) via `PLAYWRIGHT_FIREFOX_POLICIES_JSON` environment variable. + ## browser-option-logger * langs: js +* deprecated: The logs received by the logger are incomplete. Please use tracing instead. - `logger` <[Logger]> Logger sink for Playwright logging. diff --git a/docs/src/aria-snapshots.md b/docs/src/aria-snapshots.md index 4ace92d764e0c..a46c19198634a 100644 --- a/docs/src/aria-snapshots.md +++ b/docs/src/aria-snapshots.md @@ -284,7 +284,7 @@ By default, a template containing the subset of children will be matched: The `/children` property can be used to control how child elements are matched: -- `contain` (default): Matches if all specified children are present in any order +- `contain` (default): Matches if all specified children are present in order - `equal`: Matches if the children exactly match the specified list in order - `deep-equal`: Matches if the children exactly match the specified list in order, including nested children @@ -296,7 +296,7 @@ The `/children` property can be used to control how child elements are matched: ``` -*aria snapshot will fail due Feature C not being in the template* +*aria snapshot will fail due to Feature C not being in the template* ```yaml - list diff --git a/docs/src/browsers.md b/docs/src/browsers.md index f0131b7d24582..738dac7eb6757 100644 --- a/docs/src/browsers.md +++ b/docs/src/browsers.md @@ -1084,6 +1084,26 @@ Playwright keeps track of the clients that use its browsers. When there are no m To opt-out from the unused browser removal, you can set the `PLAYWRIGHT_SKIP_BROWSER_GC=1` environment variable. +### List all installed browsers: + +Prints list of browsers from all playwright installations on the machine. + +```bash js +npx playwright install --list +``` + +```bash java +mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --list" +``` + +```bash python +playwright install --list +``` + +```bash csharp +pwsh bin/Debug/netX/playwright.ps1 install --list +``` + ### Uninstall browsers This will remove the browsers (chromium, firefox, webkit) of the current Playwright installation: diff --git a/docs/src/ci-intro.md b/docs/src/ci-intro.md index ebc16bc9705c9..2376cb6e4b40a 100644 --- a/docs/src/ci-intro.md +++ b/docs/src/ci-intro.md @@ -315,6 +315,19 @@ The contents of the `$web` storage container can be accessed from a browser by u This step will not work for pull requests created from a forked repository because such workflow [doesn't have access to the secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#using-secrets-in-a-workflow). ::: +## Properly handling Secrets +* langs: js + +Artifacts like trace files, HTML reports or even the console logs contain information about your test execution. +They can contain sensitive data like user credentials for a test user, access tokens to a staging backend, testing source code or sometimes even your application source code. Treat these files just as careful as you treat that sensitive data. +If you upload reports and traces as part of your CI workflow, make sure that you only upload them to trusted artifact stores, or that you encrypt the files before upload. The same is true for sharing artifacts with team members: Use a trusted file share or encrypt the files before sharing. + +## Properly handling Secrets +* langs: python, java, csharp + +Artifacts like trace files or console logs contain information about your test execution. +They can contain sensitive data like user credentials for a test user, access tokens to a staging backend, testing source code or sometimes even your application source code. Treat these files just as careful as you treat that sensitive data. +If you upload reports and traces as part of your CI workflow, make sure that you only upload them to trusted artifact stores, or that you encrypt the files before upload. The same is true for sharing artifacts with team members: Use a trusted file share or encrypt the files before sharing. ## What's Next diff --git a/docs/src/intro-js.md b/docs/src/intro-js.md index a01f762286ae4..9cf7614902c22 100644 --- a/docs/src/intro-js.md +++ b/docs/src/intro-js.md @@ -81,7 +81,7 @@ The `tests` folder contains a basic example test to help you get started with te ## Running the Example Test -By default tests will be run on all 3 browsers, Chromium, Firefox and WebKit using 3 workers. This can be configured in the [playwright.config file](./test-configuration.md). Tests are run in headless mode meaning no browser will open up when running the tests. Results of the tests and test logs will be shown in the terminal. +By default tests will be run on all 3 browsers, Chromium, Firefox and WebKit using several workers. This can be configured in the [playwright.config file](./test-configuration.md). Tests are run in headless mode meaning no browser will open up when running the tests. Results of the tests and test logs will be shown in the terminal. { diff --git a/docs/src/release-notes-csharp.md b/docs/src/release-notes-csharp.md index e3759f5c0ee72..2bb499a597bc1 100644 --- a/docs/src/release-notes-csharp.md +++ b/docs/src/release-notes-csharp.md @@ -4,6 +4,75 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.53 + +### Miscellaneous + +- New Steps in Trace Viewer: + ![New Trace Viewer Steps](https://github.com/user-attachments/assets/1963ff7d-4070-41be-a79b-4333176921a2) +- New method [`method: Locator.describe`] to describe a locator. Used for trace viewer. + ```csharp + var button = Page.GetByTestId("btn-sub").Describe("Subscribe button"); + await button.ClickAsync(); + ``` +- `pwsh bin/Debug/netX/playwright.ps1 install --list` will now list all installed browsers, versions and locations. + +### Browser Versions + +- Chromium 138.0.7204.4 +- Mozilla Firefox 139.0 +- WebKit 18.5 + +This version was also tested against the following stable channels: + +- Google Chrome 137 +- Microsoft Edge 137 + +## Version 1.52 + +### Highlights + +- New method [`method: LocatorAssertions.toContainClass`] to ergonomically assert individual class names on the element. + + ```csharp + await Expect(Page.GetByRole(AriaRole.Listitem, new() { Name = "Ship v1.52" })).ToContainClassAsync("done"); + ``` + +- [Aria Snapshots](./aria-snapshots.md) got two new properties: [`/children`](./aria-snapshots.md#strict-matching) for strict matching and `/url` for links. + + ```csharp + await Expect(locator).ToMatchAriaSnapshotAsync(@" + - list + - /children: equal + - listitem: Feature A + - listitem: + - link ""Feature B"": + - /url: ""https://playwright.dev"" + "); + ``` + +### Miscellaneous + +- New option [`option: APIRequest.newContext.maxRedirects`] in [`method: APIRequest.newContext`] to control the maximum number of redirects. +- New option `ref` in [`method: Locator.ariaSnapshot`] to generate reference for each element in the snapshot which can later be used to locate the element. + +### Breaking Changes + +- Glob URL patterns in methods like [`method: Page.route`] do not support `?` and `[]` anymore. We recommend using regular expressions instead. +- Method [`method: Route.continue`] does not allow to override the `Cookie` header anymore. If a `Cookie` header is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [`method: BrowserContext.addCookies`]. +- macOS 13 is now deprecated and will no longer receive WebKit updates. Please upgrade to a more recent macOS version to continue benefiting from the latest WebKit improvements. + +### Browser Versions + +- Chromium 136.0.7103.25 +- Mozilla Firefox 137.0 +- WebKit 18.4 + +This version was also tested against the following stable channels: + +- Google Chrome 135 +- Microsoft Edge 135 + ## Version 1.51 ### Highlights diff --git a/docs/src/release-notes-java.md b/docs/src/release-notes-java.md index 6649a1d1c8d2b..f0ec4db107ef6 100644 --- a/docs/src/release-notes-java.md +++ b/docs/src/release-notes-java.md @@ -4,6 +4,75 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.53 + +### Miscellaneous + +- New Steps in Trace Viewer: + ![New Trace Viewer Steps](https://github.com/user-attachments/assets/1963ff7d-4070-41be-a79b-4333176921a2) +- New method [`method: Locator.describe`] to describe a locator. Used for trace viewer. + ```java + Locator button = page.getByTestId("btn-sub").describe("Subscribe button"); + button.click(); + ``` +- `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --list"` will now list all installed browsers, versions and locations. + +### Browser Versions + +- Chromium 138.0.7204.4 +- Mozilla Firefox 139.0 +- WebKit 18.5 + +This version was also tested against the following stable channels: + +- Google Chrome 137 +- Microsoft Edge 137 + +## Version 1.52 + +### Highlights + +- New method [`method: LocatorAssertions.toContainClass`] to ergonomically assert individual class names on the element. + + ```java + assertThat(page.getByRole(AriaRole.LISTITEM, new Page.GetByRoleOptions().setName("Ship v1.52"))).containsClass("done"); + ``` + +- [Aria Snapshots](./aria-snapshots.md) got two new properties: [`/children`](./aria-snapshots.md#strict-matching) for strict matching and `/url` for links. + + ```java + assertThat(locator).toMatchAriaSnapshot(""" + - list + - /children: equal + - listitem: Feature A + - listitem: + - link "Feature B": + - /url: "https://playwright.dev" + """); + ``` + +### Miscellaneous + +- New option [`option: APIRequest.newContext.maxRedirects`] in [`method: APIRequest.newContext`] to control the maximum number of redirects. +- New option `ref` in [`method: Locator.ariaSnapshot`] to generate reference for each element in the snapshot which can later be used to locate the element. + +### Breaking Changes + +- Glob URL patterns in methods like [`method: Page.route`] do not support `?` and `[]` anymore. We recommend using regular expressions instead. +- Method [`method: Route.continue`] does not allow to override the `Cookie` header anymore. If a `Cookie` header is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [`method: BrowserContext.addCookies`]. +- macOS 13 is now deprecated and will no longer receive WebKit updates. Please upgrade to a more recent macOS version to continue benefiting from the latest WebKit improvements. + +### Browser Versions + +- Chromium 136.0.7103.25 +- Mozilla Firefox 137.0 +- WebKit 18.4 + +This version was also tested against the following stable channels: + +- Google Chrome 135 +- Microsoft Edge 135 + ## Version 1.51 ### Highlights diff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.md index 900c068936bfb..ed2911636cfbf 100644 --- a/docs/src/release-notes-js.md +++ b/docs/src/release-notes-js.md @@ -6,6 +6,94 @@ toc_max_heading_level: 2 import LiteYouTube from '@site/src/components/LiteYouTube'; +## Version 1.53 + +### Trace Viewer and HTML Reporter Updates + +- New Steps in Trace Viewer and HTML reporter: + ![New Trace Viewer Steps](https://github.com/user-attachments/assets/1963ff7d-4070-41be-a79b-4333176921a2) +- New option in `'html'` reporter to set the title of a specific test run: + ```js + import { defineConfig } from '@playwright/test'; + + export default defineConfig({ + reporter: [['html', { title: 'Custom test run #1028' }]] + }); + ``` + +### Miscellaneous + +- New option [`option: TestInfo.snapshotPath.kind`] in [`method: TestInfo.snapshotPath`] controls which snapshot path template is used. +- New method [`method: Locator.describe`] to describe a locator. Used for trace viewer and reports. + ```js + const button = page.getByTestId('btn-sub').describe('Subscribe button'); + await button.click(); + ``` +- `npx playwright install --list` will now list all installed browsers, versions and locations. + +### Browser Versions + +- Chromium 138.0.7204.4 +- Mozilla Firefox 139.0 +- WebKit 18.5 + +This version was also tested against the following stable channels: + +- Google Chrome 137 +- Microsoft Edge 137 + +## Version 1.52 + +### Highlights + +- New method [`method: LocatorAssertions.toContainClass`] to ergonomically assert individual class names on the element. + + ```ts + await expect(page.getByRole('listitem', { name: 'Ship v1.52' })).toContainClass('done'); + ``` + +- [Aria Snapshots](./aria-snapshots.md) got two new properties: [`/children`](./aria-snapshots.md#strict-matching) for strict matching and `/url` for links. + + ```ts + await expect(locator).toMatchAriaSnapshot(` + - list + - /children: equal + - listitem: Feature A + - listitem: + - link "Feature B": + - /url: "https://playwright.dev" + `); + ``` + +### Test Runner + +- New property [`property: TestProject.workers`] allows to specify the number of concurrent worker processes to use for a test project. The global limit of property [`property: TestConfig.workers`] still applies. +- New [`property: TestConfig.failOnFlakyTests`] option to fail the test run if any flaky tests are detected, similarly to `--fail-on-flaky-tests`. This is useful for CI/CD environments where you want to ensure that all tests are stable before deploying. +- New property [`property: TestResult.annotations`] contains annotations for each test retry. + +### Miscellaneous + +- New option [`option: APIRequest.newContext.maxRedirects`] in [`method: APIRequest.newContext`] to control the maximum number of redirects. +- New option `ref` in [`method: Locator.ariaSnapshot`] to generate reference for each element in the snapshot which can later be used to locate the element. +- HTML reporter now supports *NOT filtering* via `!@my-tag` or `!my-file.spec.ts` or `!p:my-project`. + +### Breaking Changes + +- Glob URL patterns in methods like [`method: Page.route`] do not support `?` and `[]` anymore. We recommend using regular expressions instead. +- Method [`method: Route.continue`] does not allow to override the `Cookie` header anymore. If a `Cookie` header is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [`method: BrowserContext.addCookies`]. +- macOS 13 is now deprecated and will no longer receive WebKit updates. Please upgrade to a more recent macOS version to continue benefiting from the latest WebKit improvements. + +### Browser Versions + +- Chromium 136.0.7103.25 +- Mozilla Firefox 137.0 +- WebKit 18.4 + +This version was also tested against the following stable channels: + +- Google Chrome 135 +- Microsoft Edge 135 + ## Version 1.51 ### StorageState for indexedDB @@ -789,7 +877,7 @@ test('test customer login', { npx playwright test --grep @fast ``` -- `--project` command line [flag](./test-cli#reference) now supports '*' wildcard: +- `--project` command line [flag](./test-cli#all-options) now supports '*' wildcard: ```sh npx playwright test --project='*mobile*' ``` diff --git a/docs/src/release-notes-python.md b/docs/src/release-notes-python.md index c0fdc32e25693..ca38750f7671c 100644 --- a/docs/src/release-notes-python.md +++ b/docs/src/release-notes-python.md @@ -4,6 +4,75 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.53 + +### Miscellaneous + +- New Steps in Trace Viewer: + ![New Trace Viewer Steps](https://github.com/user-attachments/assets/1963ff7d-4070-41be-a79b-4333176921a2) +- New method [`method: Locator.describe`] to describe a locator. Used for trace viewer. + ```python + button = page.get_by_test_id("btn-sub").describe("Subscribe button") + button.click() + ``` +- `python -m playwright install --list` will now list all installed browsers, versions and locations. + +### Browser Versions + +- Chromium 138.0.7204.4 +- Mozilla Firefox 139.0 +- WebKit 18.5 + +This version was also tested against the following stable channels: + +- Google Chrome 137 +- Microsoft Edge 137 + +## Version 1.52 + +### Highlights + +- New method [`method: LocatorAssertions.toContainClass`] to ergonomically assert individual class names on the element. + + ```python + expect(page.get_by_role('listitem', name='Ship v1.52')).to_contain_class('done') + ``` + +- [Aria Snapshots](./aria-snapshots.md) got two new properties: [`/children`](./aria-snapshots.md#strict-matching) for strict matching and `/url` for links. + + ```python + expect(locator).to_match_aria_snapshot(""" + - list + - /children: equal + - listitem: Feature A + - listitem: + - link "Feature B": + - /url: "https://playwright.dev" + """) + ``` + +### Miscellaneous + +- New option [`option: APIRequest.newContext.maxRedirects`] in [`method: APIRequest.newContext`] to control the maximum number of redirects. +- New option `ref` in [`method: Locator.ariaSnapshot`] to generate reference for each element in the snapshot which can later be used to locate the element. + +### Breaking Changes + +- Glob URL patterns in methods like [`method: Page.route`] do not support `?` and `[]` anymore. We recommend using regular expressions instead. +- Method [`method: Route.continue`] does not allow to override the `Cookie` header anymore. If a `Cookie` header is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use [`method: BrowserContext.addCookies`]. +- macOS 13 is now deprecated and will no longer receive WebKit updates. Please upgrade to a more recent macOS version to continue benefiting from the latest WebKit improvements. + +### Browser Versions + +- Chromium 136.0.7103.25 +- Mozilla Firefox 137.0 +- WebKit 18.4 + +This version was also tested against the following stable channels: + +- Google Chrome 135 +- Microsoft Edge 135 + ## Version 1.51 ### Highlights diff --git a/docs/src/test-annotations-js.md b/docs/src/test-annotations-js.md index 5fc2f78955b9d..8b7234473327a 100644 --- a/docs/src/test-annotations-js.md +++ b/docs/src/test-annotations-js.md @@ -105,7 +105,7 @@ test.describe('group', { }); ``` -You can now run tests that have a particular tag with [`--grep`](./test-cli.md#reference) command line option. +You can now run tests that have a particular tag with [`--grep`](./test-cli.md#all-options) command line option. ```bash tab=bash-bash npx playwright test --grep @fast diff --git a/docs/src/test-api/class-test.md b/docs/src/test-api/class-test.md index aa200d18e3752..2511f412d2871 100644 --- a/docs/src/test-api/class-test.md +++ b/docs/src/test-api/class-test.md @@ -56,7 +56,7 @@ test('another test @smoke', async ({ page }) => { Test tags are displayed in the test report, and are available to a custom reporter via `TestCase.tags` property. You can also filter tests by their tags during test execution: -* in the [command line](../test-cli.md#reference); +* in the [command line](../test-cli.md#all-options); * in the config with [`property: TestConfig.grep`] and [`property: TestProject.grep`]; Learn more about [tagging](../test-annotations.md#tag-tests). @@ -469,7 +469,7 @@ Learn more about the execution modes [here](../test-parallel.md). test('runs in parallel 2', async ({ page }) => {}); ``` -* Running tests in order, retrying each failed test independetly. +* Running tests in order, retrying each failed test independently. This is the default mode. It can be useful to set it explicitly to override project configuration that uses `fullyParallel`. diff --git a/docs/src/test-api/class-testinfo.md b/docs/src/test-api/class-testinfo.md index e5e6963af3d6e..541a547bc157c 100644 --- a/docs/src/test-api/class-testinfo.md +++ b/docs/src/test-api/class-testinfo.md @@ -19,7 +19,6 @@ test('basic test', async ({ page }, testInfo) => { - type: <[Array]<[Object]>> - `type` <[string]> Annotation type, for example `'skip'` or `'fail'`. - `description` ?<[string]> Optional description. - - `location` ?<[Location]> Optional location in the source where the annotation is added. The list of annotations applicable to the current test. Includes annotations from the test, annotations from all [`method: Test.describe`] groups the test belongs to and file-level annotations for the test file. @@ -388,17 +387,45 @@ Optional description that will be reflected in a test report. * since: v1.10 - returns: <[string]> -Returns a path to a snapshot file with the given `pathSegments`. Learn more about [snapshots](../test-snapshots.md). +Returns a path to a snapshot file with the given `name`. Pass [`option: kind`] to obtain a specific path: +* `kind: 'screenshot'` for [`method: PageAssertions.toHaveScreenshot#1`]; +* `kind: 'aria'` for [`method: LocatorAssertions.toMatchAriaSnapshot`]; +* `kind: 'snapshot'` for [`method: SnapshotAssertions.toMatchSnapshot#1`]. -> Note that `pathSegments` accepts path segments to the snapshot file such as `testInfo.snapshotPath('relative', 'path', 'to', 'snapshot.png')`. -> However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`), otherwise it will throw. +**Usage** -### param: TestInfo.snapshotPath.pathSegments +```js +await expect(page).toHaveScreenshot('header.png'); +// Screenshot assertion above expects screenshot at this path: +const screenshotPath = test.info().snapshotPath('header.png', { kind: 'screenshot' }); + +await expect(page.getByRole('main')).toMatchAriaSnapshot({ name: 'main.aria.yml' }); +// Aria snapshot assertion above expects snapshot at this path: +const ariaSnapshotPath = test.info().snapshotPath('main.aria.yml', { kind: 'aria' }); + +expect('some text').toMatchSnapshot('snapshot.txt'); +// Snapshot assertion above expects snapshot at this path: +const snapshotPath = test.info().snapshotPath('snapshot.txt'); + +expect('some text').toMatchSnapshot(['dir', 'subdir', 'snapshot.txt']); +// Snapshot assertion above expects snapshot at this path: +const nestedPath = test.info().snapshotPath('dir', 'subdir', 'snapshot.txt'); +``` + +### param: TestInfo.snapshotPath.name * since: v1.10 -- `...pathSegments` <[Array]<[string]>> +- `...name` <[Array]<[string]>> The name of the snapshot or the path segments to define the snapshot file path. Snapshots with the same name in the same test file are expected to be the same. +When passing [`option: kind`], multiple name segments are not supported. + +### option: TestInfo.snapshotPath.kind +* since: v1.53 +- `kind` <[SnapshotKind]<"snapshot"|"screenshot"|"aria">> + +The snapshot kind controls which snapshot path template is used. See [`property: TestConfig.snapshotPathTemplate`] for more details. Defaults to `'snapshot'`. + ## property: TestInfo.snapshotSuffix * since: v1.10 - type: <[string]> diff --git a/docs/src/test-assertions-csharp-java-python.md b/docs/src/test-assertions-csharp-java-python.md index a220d9ac3085f..07f66d3192da4 100644 --- a/docs/src/test-assertions-csharp-java-python.md +++ b/docs/src/test-assertions-csharp-java-python.md @@ -17,6 +17,7 @@ title: "Assertions" | [`method: LocatorAssertions.toBeHidden`] | Element is not visible | | [`method: LocatorAssertions.toBeInViewport`] | Element intersects viewport | | [`method: LocatorAssertions.toBeVisible`] | Element is visible | +| [`method: LocatorAssertions.toContainClass`] | Element has specified CSS classes | | [`method: LocatorAssertions.toContainText`] | Element contains text | | [`method: LocatorAssertions.toHaveAccessibleDescription`] | Element has a matching [accessible description](https://w3c.github.io/accname/#dfn-accessible-description) | | [`method: LocatorAssertions.toHaveAccessibleName`] | Element has a matching [accessible name](https://w3c.github.io/accname/#dfn-accessible-name) | @@ -30,6 +31,7 @@ title: "Assertions" | [`method: LocatorAssertions.toHaveText`] | Element matches text | | [`method: LocatorAssertions.toHaveValue`] | Input has a value | | [`method: LocatorAssertions.toHaveValues`] | Select has options selected | +| [`method: LocatorAssertions.toMatchAriaSnapshot`] | Element matches provided Aria snapshot | | [`method: PageAssertions.toHaveTitle`] | Page has a title | | [`method: PageAssertions.toHaveURL`] | Page has a URL | | [`method: APIResponseAssertions.toBeOK`] | Response has an OK status | diff --git a/docs/src/test-assertions-js.md b/docs/src/test-assertions-js.md index d64a70e6f9c80..3efc0db5e5894 100644 --- a/docs/src/test-assertions-js.md +++ b/docs/src/test-assertions-js.md @@ -40,10 +40,11 @@ Note that retrying assertions are async, so you must `await` them. | [await expect(locator).toBeInViewport()](./api/class-locatorassertions.md#locator-assertions-to-be-in-viewport) | Element intersects viewport | | [await expect(locator).toBeVisible()](./api/class-locatorassertions.md#locator-assertions-to-be-visible) | Element is visible | | [await expect(locator).toContainText()](./api/class-locatorassertions.md#locator-assertions-to-contain-text) | Element contains text | +| [await expect(locator).toContainClass()](./api/class-locatorassertions.md#locator-assertions-to-contain-class) | Element has specified CSS classes | | [await expect(locator).toHaveAccessibleDescription()](./api/class-locatorassertions.md#locator-assertions-to-have-accessible-description) | Element has a matching [accessible description](https://w3c.github.io/accname/#dfn-accessible-description) | | [await expect(locator).toHaveAccessibleName()](./api/class-locatorassertions.md#locator-assertions-to-have-accessible-name) | Element has a matching [accessible name](https://w3c.github.io/accname/#dfn-accessible-name) | | [await expect(locator).toHaveAttribute()](./api/class-locatorassertions.md#locator-assertions-to-have-attribute) | Element has a DOM attribute | -| [await expect(locator).toHaveClass()](./api/class-locatorassertions.md#locator-assertions-to-have-class) | Element has a class property | +| [await expect(locator).toHaveClass()](./api/class-locatorassertions.md#locator-assertions-to-have-class) | Element has specified CSS class property | | [await expect(locator).toHaveCount()](./api/class-locatorassertions.md#locator-assertions-to-have-count) | List has exact number of children | | [await expect(locator).toHaveCSS()](./api/class-locatorassertions.md#locator-assertions-to-have-css) | Element has CSS property | | [await expect(locator).toHaveId()](./api/class-locatorassertions.md#locator-assertions-to-have-id) | Element has an ID | @@ -53,6 +54,7 @@ Note that retrying assertions are async, so you must `await` them. | [await expect(locator).toHaveText()](./api/class-locatorassertions.md#locator-assertions-to-have-text) | Element matches text | | [await expect(locator).toHaveValue()](./api/class-locatorassertions.md#locator-assertions-to-have-value) | Input has a value | | [await expect(locator).toHaveValues()](./api/class-locatorassertions.md#locator-assertions-to-have-values) | Select has options selected | +| [await expect(locator).toMatchAriaSnapshot()](./api/class-locatorassertions.md#locator-assertions-to-match-aria-snapshot) | Element matches the Aria snapshot | | [await expect(page).toHaveScreenshot()](./api/class-pageassertions.md#page-assertions-to-have-screenshot-1) | Page has a screenshot | | [await expect(page).toHaveTitle()](./api/class-pageassertions.md#page-assertions-to-have-title) | Page has a title | | [await expect(page).toHaveURL()](./api/class-pageassertions.md#page-assertions-to-have-url) | Page has a URL | @@ -223,6 +225,17 @@ await expect.poll(async () => { }).toBe(200); ``` +You can combine `expect.configure({ soft: true })` with expect.poll to perform soft assertions in polling logic. + +```js +const softExpect = expect.configure({ soft: true }); +await softExpect.poll(async () => { + const response = await page.request.get('https://api.example.com'); + return response.status(); +}, {}).toBe(200); +``` +This allows the test to continue even if the assertion inside poll fails. + ## expect.toPass You can retry blocks of code until they are passing successfully. diff --git a/docs/src/test-cli-js.md b/docs/src/test-cli-js.md index 2bfc655d1e620..73e79c3fca835 100644 --- a/docs/src/test-cli-js.md +++ b/docs/src/test-cli-js.md @@ -3,83 +3,81 @@ id: test-cli title: "Command line" --- -## Introduction +Playwright provides a powerful command line interface for running tests, generating code, debugging, and more. The most up to date list of commands and arguments available on the CLI can always be retrieved via `npx playwright --help`. -Here are the most common options available in the command line. +## Essential Commands -- Run all the tests - ```bash - npx playwright test - ``` +### Run Tests -- Run a single test file - ```bash - npx playwright test tests/todo-page.spec.ts - ``` +Run your Playwright tests. [Read more about running tests](./running-tests.md). -- Run a set of test files - ```bash - npx playwright test tests/todo-page/ tests/landing-page/ - ``` +#### Syntax -- Run files that have `my-spec` or `my-spec-2` in the file name - ```bash - npx playwright test my-spec my-spec-2 - ``` +```bash +npx playwright test [options] [test-filter...] +``` -- Run tests that are in line 42 in my-spec.ts - ```bash - npx playwright test my-spec.ts:42 - ``` +#### Examples -- Run the test with the title - ```bash - npx playwright test -g "add a todo item" - ``` +```bash +# Run all tests +npx playwright test -- Run tests in headed browsers - ```bash - npx playwright test --headed - ``` +# Run a single test file +npx playwright test tests/todo-page.spec.ts -- Run all the tests against a specific project - ```bash - npx playwright test --project=chromium - ``` +# Run a set of test files +npx playwright test tests/todo-page/ tests/landing-page/ -- Disable [parallelization](./test-parallel.md) - ```bash - npx playwright test --workers=1 - ``` +# Run tests at a specific line +npx playwright test my-spec.ts:42 -- Choose a [reporter](./test-reporters.md) - ```bash - npx playwright test --reporter=dot - ``` +# Run tests by title +npx playwright test -g "add a todo item" -- Run in debug mode with [Playwright Inspector](./debug.md) - ```bash - npx playwright test --debug - ``` +# Run tests in headed browsers +npx playwright test --headed -- Run tests in interactive UI mode, with a built-in watch mode (Preview) - ```bash - npx playwright test --ui - ``` +# Run tests for a specific project +npx playwright test --project=chromium -- Ask for help - ```bash - npx playwright test --help - ``` +# Get help +npx playwright test --help +``` -## Reference +**Disable [parallelization](./test-parallel.md)** -Complete set of Playwright Test options is available in the [configuration file](./test-use-options.md). Following options can be passed to a command line and take priority over the configuration file: +```bash +npx playwright test --workers=1 +``` - +**Run in debug mode with [Playwright Inspector](./debug.md)** + +```bash +npx playwright test --debug +``` + +**Run tests in interactive [UI mode](./test-ui-mode.md)** + +```bash +npx playwright test --ui +``` + +#### Common Options + +| Option | Description | +| :--- | :--- | +| `--debug` | Run tests with Playwright Inspector. Shortcut for `PWDEBUG=1` environment variable and `--timeout=0 --max-failures=1 --headed --workers=1` options. | +| `--headed` | Run tests in headed browsers (default: headless). | +| `-g ` or `--grep ` | Only run tests matching this regular expression (default: ".*"). | +| `--project ` | Only run tests from the specified list of projects, supports '*' wildcard (default: run all projects). | +| `--ui` | Run tests in interactive UI mode. | +| `-j ` or `--workers ` | Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%). | + +#### All Options | Option | Description | -| :- | :- | +| :--- | :--- | | Non-option arguments | Each argument is treated as a regular expression matched against the full test file path. Only tests from files matching the pattern will be executed. Special symbols like `$` or `*` should be escaped with `\`. In many shells/terminals you may need to quote the arguments. | | `-c ` or `--config ` | Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}". Defaults to `playwright.config.ts` or `playwright.config.js` in the current directory. | | `--debug` | Run tests with Playwright Inspector. Shortcut for `PWDEBUG=1` environment variable and `--timeout=0 --max-failures=1 --headed --workers=1` options. | @@ -91,6 +89,7 @@ Complete set of Playwright Test options is available in the [configuration file] | `-gv ` or `--grep-invert ` | Only run tests that do not match this regular expression. | | `--headed` | Run tests in headed browsers (default: headless). | | `--ignore-snapshots` | Ignore screenshot and snapshot expectations. | +| `-j ` or `--workers ` | Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%). | | `--last-failed` | Only re-run the failures. | | `--list` | Collect all the tests and report them, but do not run. | | `--max-failures ` or `-x` | Stop after the first `N` failures. Passing `-x` stops after the first failure. | @@ -105,12 +104,183 @@ Complete set of Playwright Test options is available in the [configuration file] | `--retries ` | Maximum retry count for flaky tests, zero for no retries (default: no retries). | | `--shard ` | Shard tests and execute only the selected shard, specified in the form "current/all", 1-based, e.g., "3/5". | | `--timeout ` | Specify test timeout threshold in milliseconds, zero for unlimited (default: 30 seconds). | -| `--trace ` | Force tracing mode, can be "on", "off", "on-first-retry", "on-all-retries", "retain-on-failure", "retain-on-first-failure". | +| `--trace ` | Force tracing mode, can be `on`, `off`, `on-first-retry`, `on-all-retries`, `retain-on-failure`, `retain-on-first-failure`. | | `--tsconfig ` | Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately). | | `--ui` | Run tests in interactive UI mode. | | `--ui-host ` | Host to serve UI on; specifying this option opens UI in a browser tab. | | `--ui-port ` | Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab. | | `-u` or `--update-snapshots [mode]` | Update snapshots with actual results. Possible values are "all", "changed", "missing", and "none". Running tests without the flag defaults to "missing"; running tests with the flag but without a value defaults to "changed". | | `--update-source-method [mode]` | Update snapshots with actual results. Possible values are "patch" (default), "3way" and "overwrite". "Patch" creates a unified diff file that can be used to update the source code later. "3way" generates merge conflict markers in source code. "Overwrite" overwrites the source code with the new snapshot values.| -| `-j ` or `--workers ` | Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%). | | `-x` | Stop after the first failure. | + +### Show Report + +Display HTML report from previous test run. [Read more about the HTML reporter](./test-reporters#html-reporter). + +#### Syntax + +```bash +npx playwright show-report [report] [options] +``` + +#### Examples + +```bash +# Show latest test report +npx playwright show-report + +# Show a specific report +npx playwright show-report playwright-report/ + +# Show report on custom port +npx playwright show-report --port 8080 +``` + +#### Options + +| Option | Description | +| :--- | :--- | +| `--host ` | Host to serve report on (default: localhost) | +| `--port ` | Port to serve report on (default: 9323) | + +### Install Browsers + +Install browsers required by Playwright. [Read more about Playwright's browser support](./browsers.md). + +#### Syntax + +```bash +npx playwright install [options] [browser...] +npx playwright install-deps [options] [browser...] +npx playwright uninstall +``` + +#### Examples + +```bash +# Install all browsers +npx playwright install + +# Install only Chromium +npx playwright install chromium + +# Install specific browsers +npx playwright install chromium webkit + +# Install browsers with dependencies +npx playwright install --with-deps +``` + +#### Install Options + +| Option | Description | +| :--- | :--- | +| `--force` | Force reinstall of stable browser channels | +| `--with-deps` | Install browser system dependencies | +| `--dry-run` | Don't perform installation, just print information | +| `--only-shell` | Only install chromium-headless-shell instead of full Chromium | +| `--no-shell` | Don't install chromium-headless-shell | + +#### Install Deps Options + +| Option | Description | +| :--- | :--- | +| `--dry-run` | Don't perform installation, just print information | + +## Generation & Debugging Tools + +### Code Generation + +Record actions and generate tests for multiple languages. [Read more about Codegen](./codegen-intro.md). + +#### Syntax + +```bash +npx playwright codegen [options] [url] +``` + +#### Examples + +```bash +# Start recording with interactive UI +npx playwright codegen + +# Record on specific site +npx playwright codegen https://playwright.dev + +# Generate Python code +npx playwright codegen --target=python +``` + +#### Options + +| Option | Description | +| :--- | :--- | +| `-b, --browser ` | Browser to use: chromium, firefox, or webkit (default: chromium) | +| `-o, --output ` | Output file for the generated script | +| `--target ` | Language to use: javascript, playwright-test, python, etc. | +| `--test-id-attribute ` | Attribute to use for test IDs | + +### Trace Viewer + +Analyze and view test traces for debugging. [Read more about Trace Viewer](./trace-viewer.md). + +#### Syntax + +```bash +npx playwright show-trace [options] +``` + +#### Examples + +```bash +# View a trace file +npx playwright show-trace trace.zip + +# View trace from directory +npx playwright show-trace trace/ +``` + +#### Options + +| Option | Description | +| :--- | :--- | +| `-b, --browser ` | Browser to use: chromium, firefox, or webkit (default: chromium) | +| `-h, --host ` | Host to serve trace on | +| `-p, --port ` | Port to serve trace on | + +## Specialized Commands + +### Merge Reports + +Read [blob](./test-reporters#blob-reporter) reports and combine them. [Read more about merge-reports](./test-sharding.md). + +#### Syntax + +```bash +npx playwright merge-reports [options] +``` + +#### Examples + +```bash +# Combine test reports +npx playwright merge-reports ./reports +``` + +#### Options + +| Option | Description | +| :--- | :--- | +| `-c, --config ` | Configuration file. Can be used to specify additional configuration for the output report | +| `--reporter ` | Reporter to use, comma-separated, can be "list", "line", "dot", "json", "junit", "null", "github", "html", "blob" (default: "list") | + +### Clear Cache + +Clear all Playwright caches. + +#### Syntax + +```bash +npx playwright clear-cache +``` diff --git a/docs/src/test-fixtures-js.md b/docs/src/test-fixtures-js.md index 5548d3232d5d8..19fbf687c1b30 100644 --- a/docs/src/test-fixtures-js.md +++ b/docs/src/test-fixtures-js.md @@ -21,7 +21,7 @@ test('basic test', async ({ page }) => { }); ``` -The `{ page }` argument tells Playwright Test to setup the `page` fixture and provide it to your test function. +The `{ page }` argument tells Playwright Test to set up the `page` fixture and provide it to your test function. Here is a list of the pre-defined fixtures that you are likely to use most of the time: @@ -29,15 +29,15 @@ Here is a list of the pre-defined fixtures that you are likely to use most of th |:----------|:------------------|:--------------------------------| |page |[Page] |Isolated page for this test run. | |context |[BrowserContext] |Isolated context for this test run. The `page` fixture belongs to this context as well. Learn how to [configure context](./test-configuration.md). | -|browser |[Browser] |Browsers are shared across tests to optimize resources. Learn how to [configure browser](./test-configuration.md). | +|browser |[Browser] |Browsers are shared across tests to optimize resources. Learn how to [configure browsers](./test-configuration.md). | |browserName|[string] |The name of the browser currently running the test. Either `chromium`, `firefox` or `webkit`.| |request |[APIRequestContext]|Isolated [APIRequestContext](./api/class-apirequestcontext.md) instance for this test run.| ### Without fixtures -Here is how typical test environment setup differs between traditional test style and the fixture-based one. +Here is how a typical test environment setup differs between the traditional test style and the fixture-based one. -`TodoPage` is a class that helps interacting with a "todo list" page of the web app, following the [Page Object Model](./pom.md) pattern. It uses Playwright's `page` internally. +`TodoPage` is a class that helps us interact with a "todo list" page of the web app, following the [Page Object Model](./pom.md) pattern. It uses Playwright's `page` internally.
Click to expand the code for the TodoPage @@ -116,11 +116,11 @@ test.describe('todo tests', () => { Fixtures have a number of advantages over before/after hooks: - Fixtures **encapsulate** setup and teardown in the same place so it is easier to write. So if you have an after hook that tears down what was created in a before hook, consider turning them into a fixture. -- Fixtures are **reusable** between test files - you can define them once and use in all your tests. That's how Playwright's built-in `page` fixture works. So if you have a helper function that is used in multiple tests, consider turning it into a fixture. +- Fixtures are **reusable** between test files - you can define them once and use them in all your tests. That's how Playwright's built-in `page` fixture works. So if you have a helper function that is used in multiple tests, consider turning it into a fixture. - Fixtures are **on-demand** - you can define as many fixtures as you'd like, and Playwright Test will setup only the ones needed by your test and nothing else. - Fixtures are **composable** - they can depend on each other to provide complex behaviors. -- Fixtures are **flexible**. Tests can use any combinations of the fixtures to tailor precise environment they need, without affecting other tests. -- Fixtures simplify **grouping**. You no longer need to wrap tests in `describe`s that set up environment, and are free to group your tests by their meaning instead. +- Fixtures are **flexible**. Tests can use any combination of fixtures to precisely tailor the environment to their needs, without affecting other tests. +- Fixtures simplify **grouping**. You no longer need to wrap tests in `describe`s that set up their environment, and are free to group your tests by their meaning instead.
Click to expand the code for the TodoPage @@ -291,14 +291,14 @@ export { expect } from '@playwright/test'; ``` :::note -Custom fixture names should start with a letter or underscore, and can contain only letters, numbers, underscores. +Custom fixture names should start with a letter or underscore, and can contain only letters, numbers, and underscores. ::: ## Using a fixture -Just mention fixture in your test function argument, and test runner will take care of it. Fixtures are also available in hooks and other fixtures. If you use TypeScript, fixtures will have the right type. +Just mention a fixture in your test function argument, and the test runner will take care of it. Fixtures are also available in hooks and other fixtures. If you use TypeScript, fixtures will be type safe. -Below we use the `todoPage` and `settingsPage` fixtures defined above. +Below we use the `todoPage` and `settingsPage` fixtures that we defined above. ```js import { test, expect } from './my-test'; @@ -315,7 +315,7 @@ test('basic test', async ({ todoPage, page }) => { ## Overriding fixtures -In addition to creating your own fixtures, you can also override existing fixtures to fit your needs. Consider the following example which overrides the `page` fixture by automatically navigating to some `baseURL`: +In addition to creating your own fixtures, you can also override existing fixtures to fit your needs. Consider the following example which overrides the `page` fixture by automatically navigating to the `baseURL`: ```js import { test as base } from '@playwright/test'; @@ -335,7 +335,7 @@ Notice that in this example, the `page` fixture is able to depend on other built test.use({ baseURL: 'https://playwright.dev' }); ``` -Fixtures can also be overridden where the base fixture is completely replaced with something different. For example, we could override the [`property: TestOptions.storageState`] fixture to provide our own data. +Fixtures can also be overridden, causing the base fixture to be completely replaced with something different. For example, we could override the [`property: TestOptions.storageState`] fixture to provide our own data. ```js import { test as base } from '@playwright/test'; @@ -350,9 +350,9 @@ export const test = base.extend({ ## Worker-scoped fixtures -Playwright Test uses [worker processes](./test-parallel.md) to run test files. Similarly to how test fixtures are set up for individual test runs, worker fixtures are set up for each worker process. That's where you can set up services, run servers, etc. Playwright Test will reuse the worker process for as many test files as it can, provided their worker fixtures match and hence environments are identical. +Playwright Test uses [worker processes](./test-parallel.md) to run test files. Similar to how test fixtures are set up for individual test runs, worker fixtures are set up for each worker process. That's where you can set up services, run servers, etc. Playwright Test will reuse the worker process for as many test files as it can, provided their worker fixtures match and hence environments are identical. -Below we'll create an `account` fixture that will be shared by all tests in the same worker, and override the `page` fixture to login into this account for each test. To generate unique accounts, we'll use the [`property: WorkerInfo.workerIndex`] that is available to any test or fixture. Note the tuple-like syntax for the worker fixture - we have to pass `{scope: 'worker'}` so that test runner sets up this fixture once per worker. +Below we'll create an `account` fixture that will be shared by all tests in the same worker, and override the `page` fixture to log in to this account for each test. To generate unique accounts, we'll use the [`property: WorkerInfo.workerIndex`] that is available to any test or fixture. Note the tuple-like syntax for the worker fixture - we have to pass `{scope: 'worker'}` so that test runner sets this fixture up once per worker. ```js title="my-test.ts" import { test as base } from '@playwright/test'; @@ -404,7 +404,7 @@ export { expect } from '@playwright/test'; Automatic fixtures are set up for each test/worker, even when the test does not list them directly. To create an automatic fixture, use the tuple syntax and pass `{ auto: true }`. -Here is an example fixture that automatically attaches debug logs when the test fails, so we can later review the logs in the reporter. Note how it uses [TestInfo] object that is available in each test/fixture to retrieve metadata about the test being run. +Here is an example fixture that automatically attaches debug logs when the test fails, so we can later review the logs in the reporter. Note how it uses the [TestInfo] object that is available in each test/fixture to retrieve metadata about the test being run. ```js title="my-test.ts" import debug from 'debug'; @@ -434,7 +434,7 @@ export { expect } from '@playwright/test'; ## Fixture timeout -By default, fixture shares timeout with the test. However, for slow fixtures, especially [worker-scoped](#worker-scoped-fixtures) ones, it is convenient to have a separate timeout. This way you can keep the overall test timeout small, and give the slow fixture more time. +By default, the fixture inherits the timeout value of the test. However, for slow fixtures, especially [worker-scoped](#worker-scoped-fixtures) ones, it is convenient to have a separate timeout. This way you can keep the overall test timeout small, and give the slow fixture more time. ```js import { test as base, expect } from '@playwright/test'; @@ -454,9 +454,9 @@ test('example test', async ({ slowFixture }) => { ## Fixtures-options -Playwright Test supports running multiple test projects that can be separately configured. You can use "option" fixtures to make your configuration options declarative and type-checked. Learn more about [parametrizing tests](./test-parameterize.md). +Playwright Test supports running multiple test projects that can be configured separately. You can use "option" fixtures to make your configuration options declarative and type safe. Learn more about [parameterizing tests](./test-parameterize.md). -Below we'll create a `defaultItem` option in addition to the `todoPage` fixture from other examples. This option will be set in configuration file. Note the tuple syntax and `{ option: true }` argument. +Below we'll create a `defaultItem` option in addition to the `todoPage` fixture from other examples. This option will be set in the configuration file. Note the tuple syntax and `{ option: true }` argument.
Click to expand the code for the TodoPage @@ -531,7 +531,7 @@ export const test = base.extend({ export { expect } from '@playwright/test'; ``` -We can now use `todoPage` fixture as usual, and set the `defaultItem` option in the config file. +We can now use the `todoPage` fixture as usual, and set the `defaultItem` option in the configuration file. ```js title="playwright.config.ts" import { defineConfig } from '@playwright/test'; @@ -575,14 +575,65 @@ test.use({ }); ``` +**Reset an option** + +You can reset an option to the value defined in the config file by setting it to `undefined`. Consider the following config that sets a `baseURL`: + +```js title="playwright.config.ts" +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + use: { + baseURL: 'https://playwright.dev', + }, +}); +``` + +You can now configure `baseURL` for a file, and also opt-out for a single test. + +```js title="intro.spec.ts" +import { test } from '@playwright/test'; + +// Configure baseURL for this file. +test.use({ baseURL: 'https://playwright.dev/docs/intro' }); + +test('check intro contents', async ({ page }) => { + // This test will use "https://playwright.dev/docs/intro" base url as defined above. +}); + +test.describe(() => { + // Reset the value to a config-defined one. + test.use({ baseURL: undefined }); + + test('can navigate to intro from the home page', async ({ page }) => { + // This test will use "https://playwright.dev" base url as defined in the config. + }); +}); +``` + +If you would like to completely reset the value to `undefined`, use a long-form fixture notation. + +```js title="intro.spec.ts" +import { test } from '@playwright/test'; + +// Completely unset baseURL for this file. +test.use({ + baseURL: [async ({}, use) => use(undefined), { scope: 'test' }], +}); + +test('no base url', async ({ page }) => { + // This test will not have a base url. +}); +``` + ## Execution order -Each fixture has a setup and teardown phase separated by the `await use()` call in the fixture. Setup is executed before the fixture is used by the test/hook, and teardown is executed when the fixture will not be used by the test/hook anymore. +Each fixture has a setup and teardown phase before and after the `await use()` call in the fixture. Setup is executed before the test/hook requiring it is run, and teardown is executed when the fixture is no longer being used by the test/hook. Fixtures follow these rules to determine the execution order: * When fixture A depends on fixture B: B is always set up before A and torn down after A. * Non-automatic fixtures are executed lazily, only when the test/hook needs them. -* Test-scoped fixtures are torn down after each test, while worker-scoped fixtures are only torn down when the worker process executing tests is shutdown. +* Test-scoped fixtures are torn down after each test, while worker-scoped fixtures are only torn down when the worker process executing tests is torn down. Consider the following example: @@ -695,7 +746,7 @@ test('passes', async ({ database, page, a11y }) => { ## Box fixtures -Usually, custom fixtures are reported as separate steps in the UI mode, Trace Viewer and various test reports. They also appear in error messages from the test runner. For frequently-used fixtures, this can mean lots of noise. You can stop the fixtures steps from being shown in the UI by "boxing" it. +Usually, custom fixtures are reported as separate steps in the UI mode, Trace Viewer and various test reports. They also appear in error messages from the test runner. For frequently used fixtures, this can mean lots of noise. You can stop the fixtures steps from being shown in the UI by "boxing" it. ```js import { test as base } from '@playwright/test'; diff --git a/docs/src/test-reporter-api/class-testcase.md b/docs/src/test-reporter-api/class-testcase.md index 22a8588fb0934..a3c9c2db995c6 100644 --- a/docs/src/test-reporter-api/class-testcase.md +++ b/docs/src/test-reporter-api/class-testcase.md @@ -9,7 +9,6 @@ - type: <[Array]<[Object]>> - `type` <[string]> Annotation type, for example `'skip'` or `'fail'`. - `description` ?<[string]> Optional description. - - `location` ?<[Location]> Optional location in the source where the annotation is added. [`property: TestResult.annotations`] of the last test run. diff --git a/docs/src/test-reporter-api/class-testresult.md b/docs/src/test-reporter-api/class-testresult.md index ec23775c46374..263b299c49ee1 100644 --- a/docs/src/test-reporter-api/class-testresult.md +++ b/docs/src/test-reporter-api/class-testresult.md @@ -19,7 +19,6 @@ The list of files or buffers attached during the test execution through [`proper - type: <[Array]<[Object]>> - `type` <[string]> Annotation type, for example `'skip'` or `'fail'`. - `description` ?<[string]> Optional description. - - `location` ?<[Location]> Optional location in the source where the annotation is added. The list of annotations applicable to the current test. Includes: * annotations defined on the test or suite via [`method: Test.(call)`] and [`method: Test.describe`]; @@ -53,7 +52,7 @@ Errors thrown during the test execution. * since: v1.10 - type: <[int]> -When test is retries multiple times, each retry attempt is given a sequential number. +When test is retried multiple times, each retry attempt is given a sequential number. Learn more about [test retries](../test-retries.md#retries). diff --git a/docs/src/test-reporter-api/class-teststep.md b/docs/src/test-reporter-api/class-teststep.md index 8cc91b2c4dd8a..a8d1c12110bcc 100644 --- a/docs/src/test-reporter-api/class-teststep.md +++ b/docs/src/test-reporter-api/class-teststep.md @@ -9,10 +9,13 @@ Represents a step in the [TestRun]. - type: <[string]> Step category to differentiate steps with different origin and verbosity. Built-in categories are: -* `hook` for fixtures and hooks initialization and teardown * `expect` for expect calls +* `fixture` for fixtures setup and teardown +* `hook` for hooks initialization and teardown * `pw:api` for Playwright API calls. * `test.step` for test.step API calls. +* `test.attach` for test attachmen calls. + ## property: TestStep.duration * since: v1.10 @@ -55,7 +58,6 @@ List of steps inside this step. - type: <[Array]<[Object]>> - `type` <[string]> Annotation type, for example `'skip'`. - `description` ?<[string]> Optional description. - - `location` ?<[Location]> Optional location in the source where the annotation is added. The list of annotations applicable to the current test step. diff --git a/docs/src/test-reporters-js.md b/docs/src/test-reporters-js.md index ce5698005cba5..294f0466ddb79 100644 --- a/docs/src/test-reporters-js.md +++ b/docs/src/test-reporters-js.md @@ -246,6 +246,7 @@ HTML report supports the following configuration options and environment variabl | Environment Variable Name | Reporter Config Option| Description | Default |---|---|---|---| +| `PLAYWRIGHT_HTML_TITLE` | `title` | A title to display in the generated report. | No title is displayed by default | `PLAYWRIGHT_HTML_OUTPUT_DIR` | `outputFolder` | Directory to save the report to. | `playwright-report` | `PLAYWRIGHT_HTML_OPEN` | `open` | When to open the html report in the browser, one of `'always'`, `'never'` or `'on-failure'` | `'on-failure'` | `PLAYWRIGHT_HTML_HOST` | `host` | When report opens in the browser, it will be served bound to this hostname. | `localhost` diff --git a/docs/src/test-use-options-js.md b/docs/src/test-use-options-js.md index 12f97db46dc2c..0b46393941219 100644 --- a/docs/src/test-use-options-js.md +++ b/docs/src/test-use-options-js.md @@ -192,7 +192,7 @@ export default defineConfig({ ### More browser and context options -Any options accepted by [`method: BrowserType.launch`] or [`method: Browser.newContext`] can be put into `launchOptions` or `contextOptions` respectively in the `use` section. +Any options accepted by [`method: BrowserType.launch`], [`method: Browser.newContext`] or [`method: BrowserType.connect`] can be put into `launchOptions`, `contextOptions` or `connectOptions` respectively in the `use` section. ```js title="playwright.config.ts" import { defineConfig } from '@playwright/test'; @@ -296,3 +296,54 @@ test.describe('french language block', () => { }); }); ``` + +### Reset an option + +You can reset an option to the value defined in the config file. Consider the following config that sets a `baseURL`: + +```js title="playwright.config.ts" +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + use: { + baseURL: 'https://playwright.dev', + }, +}); +``` + +You can now configure `baseURL` for a file, and also opt-out for a single test. + +```js title="intro.spec.ts" +import { test } from '@playwright/test'; + +// Configure baseURL for this file. +test.use({ baseURL: 'https://playwright.dev/docs/intro' }); + +test('check intro contents', async ({ page }) => { + // This test will use "https://playwright.dev/docs/intro" base url as defined above. +}); + +test.describe(() => { + // Reset the value to a config-defined one. + test.use({ baseURL: undefined }); + + test('can navigate to intro from the home page', async ({ page }) => { + // This test will use "https://playwright.dev" base url as defined in the config. + }); +}); +``` + +If you would like to completely reset the value to `undefined`, use a long-form fixture notation. + +```js title="intro.spec.ts" +import { test } from '@playwright/test'; + +// Completely unset baseURL for this file. +test.use({ + baseURL: [async ({}, use) => use(undefined), { scope: 'test' }], +}); + +test('no base url', async ({ page }) => { + // This test will not have a base url. +}); +``` diff --git a/docs/src/touch-events.md b/docs/src/touch-events.md index 5a1d11cc7357c..e65eab1bf35fb 100644 --- a/docs/src/touch-events.md +++ b/docs/src/touch-events.md @@ -7,6 +7,8 @@ title: "Touch events (legacy)" Web applications that handle legacy [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) to respond to gestures like swipe, pinch, and tap can be tested by manually dispatching [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)s to the page. The examples below demonstrate how to use [`method: Locator.dispatchEvent`] and pass [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points as arguments. +Note that [`method: Locator.dispatchEvent`] does not set [`Event.isTrusted`](https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted) property. If your web page relies on it, make sure to disable `isTrusted` check during the test. + ### Emulating pan gesture In the example below, we emulate pan gesture that is expected to move the map. The app under test only uses `clientX/clientY` coordinates of the touch point, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them. diff --git a/eslint.config.mjs b/eslint.config.mjs index 8235961bbfa85..26e7070a1f914 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -45,6 +45,7 @@ const ignores = [ "output/", "**/playwright-report/", "packages/*/lib/", + "packages/playwright-core/bundles/zip/src/third_party/", "packages/playwright-core/src/generated/*", "packages/playwright-core/src/third_party/", "packages/playwright-core/types/*", @@ -217,24 +218,22 @@ const noBooleanCompareRules = { "@typescript-eslint/no-unnecessary-boolean-literal-compare": 2, }; -// This should contain every builtin from builtins.ts. const noWebGlobalsRuleList = [ + // Keep in sync with builtins from utilityScript.ts { name: "window", message: "Use InjectedScript.window instead" }, { name: "document", message: "Use InjectedScript.document instead" }, { name: "globalThis", message: "Use InjectedScript.window instead" }, - { name: "setTimeout", message: "import { setTimeout } from './builtins' instead" }, - { name: "clearTimeout", message: "import { clearTimeout } from './builtins' instead" }, - { name: "setInterval", message: "import { setInterval } from './builtins' instead" }, - { name: "clearInterval", message: "import { clearInterval } from './builtins' instead" }, - { name: "requestAnimationFrame", message: "import { requestAnimationFrame } from './builtins' instead" }, - { name: "cancelAnimationFrame", message: "import { cancelAnimationFrame } from './builtins' instead" }, - { name: "requestIdleCallback", message: "import { requestIdleCallback } from './builtins' instead" }, - { name: "cancelIdleCallback", message: "import { cancelIdleCallback } from './builtins' instead" }, - { name: "performance", message: "import { performance } from './builtins' instead" }, - { name: "eval", message: "Use builtins().eval instead" }, - { name: "Date", message: "import { Date } from './builtins' instead" }, - { name: "Map", message: "import { Map } from './builtins' instead" }, - { name: "Set", message: "import { Set } from './builtins' instead" }, + { name: "setTimeout", message: "Use InjectedScript.utils.builtins.setTimeout instead" }, + { name: "clearTimeout", message: "Use InjectedScript.utils.builtins.clearTimeout instead" }, + { name: "setInterval", message: "Use InjectedScript.utils.builtins.setInterval instead" }, + { name: "clearInterval", message: "Use InjectedScript.utils.builtins.clearInterval instead" }, + { name: "requestAnimationFrame", message: "Use InjectedScript.utils.builtins.requestAnimationFrame instead" }, + { name: "cancelAnimationFrame", message: "Use InjectedScript.utils.builtins.cancelAnimationFrame instead" }, + { name: "requestIdleCallback", message: "Use InjectedScript.utils.builtins.requestIdleCallback instead" }, + { name: "cancelIdleCallback", message: "Use InjectedScript.utils.builtins.cancelIdleCallback instead" }, + { name: "Date", message: "Use InjectedScript.utils.builtins.Date instead" }, + { name: "Intl", message: "Use InjectedScript.utils.builtins.Intl instead" }, + { name: "performance", message: "Use InjectedScript.utils.builtins.performance instead" }, ]; const noNodeGlobalsRuleList = [{ name: "process" }]; @@ -380,8 +379,6 @@ export default [ { files: [ "packages/injected/src/**/*.ts", - "packages/playwright-core/src/server/pageBinding.ts", - "packages/playwright-core/src/server/storageScript.ts", ], languageOptions: languageOptionsWithTsConfig, rules: { diff --git a/package-lock.json b/package-lock.json index 814b40ffe0f8d..209aeca9d4ebc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,24 @@ { "name": "playwright-internal", - "version": "1.52.0-next", + "version": "1.53.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "playwright-internal", - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "workspaces": [ "packages/*" ], "devDependencies": { "@actions/core": "^1.10.0", + "@actions/github": "^6.0.0", "@babel/code-frame": "^7.26.2", "@eslint/compat": "^1.2.6", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.19.0", + "@octokit/graphql-schema": "^15.26.0", "@stylistic/eslint-plugin": "^3.0.1", "@types/codemirror": "^5.60.7", "@types/formidable": "^2.0.4", @@ -34,7 +36,7 @@ "@zip.js/zip.js": "^2.7.29", "ansi-styles": "^4.3.0", "chokidar": "^3.5.3", - "chromium-bidi": "^3.2.1", + "chromium-bidi": "^5.3.1", "colors": "^1.4.0", "concurrently": "^6.2.1", "cross-env": "^7.0.3", @@ -49,14 +51,13 @@ "formidable": "^2.1.1", "immutable": "^4.3.7", "license-checker": "^25.0.1", - "markdown-to-jsx": "^7.7.3", "mime": "^3.0.0", "node-stream-zip": "^1.15.0", "react": "^18.1.0", "react-dom": "^18.1.0", "ssim.js": "^3.5.0", "typescript": "^5.8.2", - "vite": "^6.2.6", + "vite": "^6.3.4", "ws": "^8.17.1", "xml2js": "^0.5.0", "yaml": "2.6.0" @@ -69,6 +70,7 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", + "dev": true, "license": "MIT", "dependencies": { "@actions/exec": "^1.1.1", @@ -79,6 +81,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "dev": true, "license": "MIT", "dependencies": { "@actions/io": "^1.0.1" @@ -88,6 +91,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz", "integrity": "sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==", + "dev": true, "license": "MIT", "dependencies": { "@actions/http-client": "^2.2.0", @@ -100,6 +104,7 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", "integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", + "dev": true, "license": "MIT", "dependencies": { "tunnel": "^0.0.6", @@ -110,6 +115,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==", + "dev": true, "license": "MIT" }, "node_modules/@ampproject/remapping": { @@ -990,6 +996,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, "license": "MIT", "engines": { "node": ">=14" @@ -1151,6 +1158,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "dev": true, "license": "MIT", "engines": { "node": ">= 18" @@ -1160,6 +1168,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.1.tgz", "integrity": "sha512-dKYCMuPO1bmrpuogcjQ8z7ICCH3FP6WmxpwC03yjzGfZhj9fTJg6+bS1+UAplekbN2C+M61UNllGOOoAfGCrdQ==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/auth-token": "^4.0.0", @@ -1178,6 +1187,7 @@ "version": "9.0.6", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz", "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/types": "^13.1.0", @@ -1191,6 +1201,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.1.tgz", "integrity": "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/request": "^8.4.1", @@ -1216,12 +1227,14 @@ "version": "24.2.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", + "dev": true, "license": "MIT" }, "node_modules/@octokit/plugin-paginate-rest": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.2.tgz", "integrity": "sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/types": "^12.6.0" @@ -1237,12 +1250,14 @@ "version": "20.0.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true, "license": "MIT" }, "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { "version": "12.6.0", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/openapi-types": "^20.0.0" @@ -1252,6 +1267,7 @@ "version": "10.4.1", "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz", "integrity": "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/types": "^12.6.0" @@ -1267,12 +1283,14 @@ "version": "20.0.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-20.0.0.tgz", "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dev": true, "license": "MIT" }, "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { "version": "12.6.0", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz", "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/openapi-types": "^20.0.0" @@ -1282,6 +1300,7 @@ "version": "8.4.1", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz", "integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/endpoint": "^9.0.6", @@ -1297,6 +1316,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz", "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/types": "^13.1.0", @@ -1311,6 +1331,7 @@ "version": "13.10.0", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/openapi-types": "^24.2.0" @@ -1332,10 +1353,6 @@ "resolved": "packages/playwright-client", "link": true }, - "node_modules/@playwright/dashboard": { - "resolved": "packages/playwright-dashboard", - "link": true - }, "node_modules/@playwright/experimental-ct-core": { "resolved": "packages/playwright-ct-core", "link": true @@ -1361,9 +1378,9 @@ "link": true }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", - "integrity": "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.1.tgz", + "integrity": "sha512-kxz0YeeCrRUHz3zyqvd7n+TVRlNyTifBsmnmNPtk3hQURUyG9eAB+usz6DAwagMusjx/zb3AjvDUvhFGDAexGw==", "cpu": [ "arm" ], @@ -1374,9 +1391,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.8.tgz", - "integrity": "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.1.tgz", + "integrity": "sha512-PPkxTOisoNC6TpnDKatjKkjRMsdaWIhyuMkA4UsBXT9WEZY4uHezBTjs6Vl4PbqQQeu6oION1w2voYZv9yquCw==", "cpu": [ "arm64" ], @@ -1387,9 +1404,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.8.tgz", - "integrity": "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.1.tgz", + "integrity": "sha512-VWXGISWFY18v/0JyNUy4A46KCFCb9NVsH+1100XP31lud+TzlezBbz24CYzbnA4x6w4hx+NYCXDfnvDVO6lcAA==", "cpu": [ "arm64" ], @@ -1400,9 +1417,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.8.tgz", - "integrity": "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.1.tgz", + "integrity": "sha512-nIwkXafAI1/QCS7pxSpv/ZtFW6TXcNUEHAIA9EIyw5OzxJZQ1YDrX+CL6JAIQgZ33CInl1R6mHet9Y/UZTg2Bw==", "cpu": [ "x64" ], @@ -1413,9 +1430,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.8.tgz", - "integrity": "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.1.tgz", + "integrity": "sha512-BdrLJ2mHTrIYdaS2I99mriyJfGGenSaP+UwGi1kB9BLOCu9SR8ZpbkmmalKIALnRw24kM7qCN0IOm6L0S44iWw==", "cpu": [ "arm64" ], @@ -1426,9 +1443,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.8.tgz", - "integrity": "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.1.tgz", + "integrity": "sha512-VXeo/puqvCG8JBPNZXZf5Dqq7BzElNJzHRRw3vjBE27WujdzuOPecDPc/+1DcdcTptNBep3861jNq0mYkT8Z6Q==", "cpu": [ "x64" ], @@ -1439,9 +1456,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.8.tgz", - "integrity": "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.1.tgz", + "integrity": "sha512-ehSKrewwsESPt1TgSE/na9nIhWCosfGSFqv7vwEtjyAqZcvbGIg4JAcV7ZEh2tfj/IlfBeZjgOXm35iOOjadcg==", "cpu": [ "arm" ], @@ -1452,9 +1469,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.8.tgz", - "integrity": "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.1.tgz", + "integrity": "sha512-m39iO/aaurh5FVIu/F4/Zsl8xppd76S4qoID8E+dSRQvTyZTOI2gVk3T4oqzfq1PtcvOfAVlwLMK3KRQMaR8lg==", "cpu": [ "arm" ], @@ -1465,9 +1482,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.8.tgz", - "integrity": "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.1.tgz", + "integrity": "sha512-Y+GHnGaku4aVLSgrT0uWe2o2Rq8te9hi+MwqGF9r9ORgXhmHK5Q71N757u0F8yU1OIwUIFy6YiJtKjtyktk5hg==", "cpu": [ "arm64" ], @@ -1478,9 +1495,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.8.tgz", - "integrity": "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.1.tgz", + "integrity": "sha512-jEwjn3jCA+tQGswK3aEWcD09/7M5wGwc6+flhva7dsQNRZZTe30vkalgIzV4tjkopsTS9Jd7Y1Bsj6a4lzz8gQ==", "cpu": [ "arm64" ], @@ -1491,9 +1508,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.8.tgz", - "integrity": "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.1.tgz", + "integrity": "sha512-ySyWikVhNzv+BV/IDCsrraOAZ3UaC8SZB67FZlqVwXwnFhPihOso9rPOxzZbjp81suB1O2Topw+6Ug3JNegejQ==", "cpu": [ "loong64" ], @@ -1504,9 +1521,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.8.tgz", - "integrity": "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.1.tgz", + "integrity": "sha512-BvvA64QxZlh7WZWqDPPdt0GH4bznuL6uOO1pmgPnnv86rpUpc8ZxgZwcEgXvo02GRIZX1hQ0j0pAnhwkhwPqWg==", "cpu": [ "ppc64" ], @@ -1517,9 +1534,22 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.8.tgz", - "integrity": "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.1.tgz", + "integrity": "sha512-EQSP+8+1VuSulm9RKSMKitTav89fKbHymTf25n5+Yr6gAPZxYWpj3DzAsQqoaHAk9YX2lwEyAf9S4W8F4l3VBQ==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.1.tgz", + "integrity": "sha512-n/vQ4xRZXKuIpqukkMXZt9RWdl+2zgGNx7Uda8NtmLJ06NL8jiHxUawbwC+hdSq1rrw/9CghCpEONor+l1e2gA==", "cpu": [ "riscv64" ], @@ -1530,9 +1560,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.8.tgz", - "integrity": "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.1.tgz", + "integrity": "sha512-h8d28xzYb98fMQKUz0w2fMc1XuGzLLjdyxVIbhbil4ELfk5/orZlSTpF/xdI9C8K0I8lCkq+1En2RJsawZekkg==", "cpu": [ "s390x" ], @@ -1543,9 +1573,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.8.tgz", - "integrity": "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.1.tgz", + "integrity": "sha512-XiK5z70PEFEFqcNj3/zRSz/qX4bp4QIraTy9QjwJAb/Z8GM7kVUsD0Uk8maIPeTyPCP03ChdI+VVmJriKYbRHQ==", "cpu": [ "x64" ], @@ -1556,9 +1586,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.8.tgz", - "integrity": "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.1.tgz", + "integrity": "sha512-2BRORitq5rQ4Da9blVovzNCMaUlyKrzMSvkVR0D4qPuOy/+pMCrh1d7o01RATwVy+6Fa1WBw+da7QPeLWU/1mQ==", "cpu": [ "x64" ], @@ -1569,9 +1599,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.8.tgz", - "integrity": "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.1.tgz", + "integrity": "sha512-b2bcNm9Kbde03H+q+Jjw9tSfhYkzrDUf2d5MAd1bOJuVplXvFhWz7tRtWvD8/ORZi7qSCy0idW6tf2HgxSXQSg==", "cpu": [ "arm64" ], @@ -1582,9 +1612,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.8.tgz", - "integrity": "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.1.tgz", + "integrity": "sha512-DfcogW8N7Zg7llVEfpqWMZcaErKfsj9VvmfSyRjCyo4BI3wPEfrzTtJkZG6gKP/Z92wFm6rz2aDO7/JfiR/whA==", "cpu": [ "ia32" ], @@ -1595,9 +1625,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.8.tgz", - "integrity": "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.1.tgz", + "integrity": "sha512-ECyOuDeH3C1I8jH2MK1RtBJW+YPMvSfT0a5NN0nHfQYnDSJ6tUiZH3gzwVP5/Kfh/+Tt7tpWVF9LXNTnhTJ3kA==", "cpu": [ "x64" ], @@ -1725,9 +1755,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", "license": "MIT" }, "node_modules/@types/formidable": { @@ -2605,6 +2635,7 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dev": true, "license": "Apache-2.0" }, "node_modules/binary-extensions": { @@ -2860,9 +2891,9 @@ } }, "node_modules/chromium-bidi": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-3.2.1.tgz", - "integrity": "sha512-0/5V5Mk43zhAGqtN86ArmiTK6UEZr3KEcgAf+tv3c+SGkcaV7CLXfWUxGQ1W6XwpN5PMvTUp0so7wVoJm0UnWA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-5.3.1.tgz", + "integrity": "sha512-fbkgn0/m6RIRknVEez+QOYuvukUomBC0XnS8fgdbl9FeunjR3vUvPN6iYrbzXIuaJXYOwGU8FZgOTDzBImGvLw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -3230,6 +3261,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true, "license": "ISC" }, "node_modules/detect-node": { @@ -4054,6 +4086,20 @@ "pend": "~1.2.0" } }, + "node_modules/fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -5460,6 +5506,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -5496,18 +5543,6 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, - "node_modules/markdown-to-jsx": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.7.4.tgz", - "integrity": "sha512-1bSfXyBKi+EYS3YY+e0Csuxf8oZ3decdfhOav/Z7Wrk89tjudyL5FOmwZQUoy0/qVXGUl+6Q3s2SWtpDEWITfQ==", - "license": "MIT", - "engines": { - "node": ">= 10" - }, - "peerDependencies": { - "react": ">= 0.14.0" - } - }, "node_modules/matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", @@ -5892,6 +5927,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -6085,7 +6121,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -6259,6 +6294,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.1.0" @@ -6527,12 +6563,12 @@ } }, "node_modules/rollup": { - "version": "4.34.8", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", - "integrity": "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ==", + "version": "4.40.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.1.tgz", + "integrity": "sha512-C5VvvgCCyfyotVITIAv+4efVytl5F7wt+/I2i9q9GZcEXW9BP52YYOXC58igUi+LFZVHukErIIqQSWwv/M3WRw==", "license": "MIT", "dependencies": { - "@types/estree": "1.0.6" + "@types/estree": "1.0.7" }, "bin": { "rollup": "dist/bin/rollup" @@ -6542,25 +6578,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.34.8", - "@rollup/rollup-android-arm64": "4.34.8", - "@rollup/rollup-darwin-arm64": "4.34.8", - "@rollup/rollup-darwin-x64": "4.34.8", - "@rollup/rollup-freebsd-arm64": "4.34.8", - "@rollup/rollup-freebsd-x64": "4.34.8", - "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", - "@rollup/rollup-linux-arm-musleabihf": "4.34.8", - "@rollup/rollup-linux-arm64-gnu": "4.34.8", - "@rollup/rollup-linux-arm64-musl": "4.34.8", - "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", - "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", - "@rollup/rollup-linux-riscv64-gnu": "4.34.8", - "@rollup/rollup-linux-s390x-gnu": "4.34.8", - "@rollup/rollup-linux-x64-gnu": "4.34.8", - "@rollup/rollup-linux-x64-musl": "4.34.8", - "@rollup/rollup-win32-arm64-msvc": "4.34.8", - "@rollup/rollup-win32-ia32-msvc": "4.34.8", - "@rollup/rollup-win32-x64-msvc": "4.34.8", + "@rollup/rollup-android-arm-eabi": "4.40.1", + "@rollup/rollup-android-arm64": "4.40.1", + "@rollup/rollup-darwin-arm64": "4.40.1", + "@rollup/rollup-darwin-x64": "4.40.1", + "@rollup/rollup-freebsd-arm64": "4.40.1", + "@rollup/rollup-freebsd-x64": "4.40.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.40.1", + "@rollup/rollup-linux-arm-musleabihf": "4.40.1", + "@rollup/rollup-linux-arm64-gnu": "4.40.1", + "@rollup/rollup-linux-arm64-musl": "4.40.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.40.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.40.1", + "@rollup/rollup-linux-riscv64-gnu": "4.40.1", + "@rollup/rollup-linux-riscv64-musl": "4.40.1", + "@rollup/rollup-linux-s390x-gnu": "4.40.1", + "@rollup/rollup-linux-x64-gnu": "4.40.1", + "@rollup/rollup-linux-x64-musl": "4.40.1", + "@rollup/rollup-win32-arm64-msvc": "4.40.1", + "@rollup/rollup-win32-ia32-msvc": "4.40.1", + "@rollup/rollup-win32-x64-msvc": "4.40.1", "fsevents": "~2.3.2" } }, @@ -7190,6 +7227,22 @@ "svelte": "^3.19.0 || ^4.0.0" } }, + "node_modules/tinyglobby": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", + "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7277,6 +7330,7 @@ "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.6.11 <=0.7.0 || >=0.7.3" @@ -7421,9 +7475,10 @@ } }, "node_modules/undici": { - "version": "5.28.5", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", - "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", + "dev": true, "license": "MIT", "dependencies": { "@fastify/busboy": "^2.0.0" @@ -7443,6 +7498,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dev": true, "license": "ISC" }, "node_modules/universalify": { @@ -7514,14 +7570,17 @@ } }, "node_modules/vite": { - "version": "6.2.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.6.tgz", - "integrity": "sha512-9xpjNl3kR4rVDZgPNdTL0/c6ao4km69a/2ihNQbcANz8RuCOK3hQBmLSJf3bRKVQjVMda+YvizNE8AwvogcPbw==", + "version": "6.3.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.4.tgz", + "integrity": "sha512-BiReIiMS2fyFqbqNT/Qqt4CVITDU9M9vE+DKcVAsB+ZV0wvTKd+3hMbkpxz1b+NmEDMegpVbisKiAZOnvO92Sw==", "license": "MIT", "dependencies": { "esbuild": "^0.25.0", + "fdir": "^6.4.4", + "picomatch": "^4.0.2", "postcss": "^8.5.3", - "rollup": "^4.30.1" + "rollup": "^4.34.9", + "tinyglobby": "^0.2.13" }, "bin": { "vite": "bin/vite.js" @@ -7746,6 +7805,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, "license": "ISC" }, "node_modules/ws": { @@ -7906,10 +7966,10 @@ "version": "0.0.0" }, "packages/playwright": { - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-next" + "playwright-core": "1.53.2" }, "bin": { "playwright": "cli.js" @@ -7923,11 +7983,11 @@ }, "packages/playwright-browser-chromium": { "name": "@playwright/browser-chromium", - "version": "1.52.0-next", + "version": "1.53.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-next" + "playwright-core": "1.53.2" }, "engines": { "node": ">=18" @@ -7935,11 +7995,11 @@ }, "packages/playwright-browser-firefox": { "name": "@playwright/browser-firefox", - "version": "1.52.0-next", + "version": "1.53.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-next" + "playwright-core": "1.53.2" }, "engines": { "node": ">=18" @@ -7947,22 +8007,22 @@ }, "packages/playwright-browser-webkit": { "name": "@playwright/browser-webkit", - "version": "1.52.0-next", + "version": "1.53.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-next" + "playwright-core": "1.53.2" }, "engines": { "node": ">=18" } }, "packages/playwright-chromium": { - "version": "1.52.0-next", + "version": "1.53.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-next" + "playwright-core": "1.53.2" }, "bin": { "playwright": "cli.js" @@ -7976,14 +8036,14 @@ "version": "0.0.0", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-next" + "playwright-core": "1.53.2" }, "engines": { "node": ">=18" } }, "packages/playwright-core": { - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" @@ -7994,12 +8054,12 @@ }, "packages/playwright-ct-core": { "name": "@playwright/experimental-ct-core", - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "dependencies": { - "playwright": "1.52.0-next", - "playwright-core": "1.52.0-next", - "vite": "^6.2.6" + "playwright": "1.53.2", + "playwright-core": "1.53.2", + "vite": "^6.3.4" }, "engines": { "node": ">=18" @@ -8007,10 +8067,10 @@ }, "packages/playwright-ct-react": { "name": "@playwright/experimental-ct-react", - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.52.0-next", + "@playwright/experimental-ct-core": "1.53.2", "@vitejs/plugin-react": "^4.2.1" }, "bin": { @@ -8022,10 +8082,10 @@ }, "packages/playwright-ct-react17": { "name": "@playwright/experimental-ct-react17", - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.52.0-next", + "@playwright/experimental-ct-core": "1.53.2", "@vitejs/plugin-react": "^4.2.1" }, "bin": { @@ -8037,10 +8097,10 @@ }, "packages/playwright-ct-svelte": { "name": "@playwright/experimental-ct-svelte", - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.52.0-next", + "@playwright/experimental-ct-core": "1.53.2", "@sveltejs/vite-plugin-svelte": "^3.0.1" }, "bin": { @@ -8598,10 +8658,10 @@ }, "packages/playwright-ct-vue": { "name": "@playwright/experimental-ct-vue", - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.52.0-next", + "@playwright/experimental-ct-core": "1.53.2", "@vitejs/plugin-vue": "^5.2.0" }, "bin": { @@ -8611,28 +8671,12 @@ "node": ">=18" } }, - "packages/playwright-dashboard": { - "name": "@playwright/dashboard", - "version": "0.0.0", - "license": "Apache-2.0", - "dependencies": { - "@actions/core": "^1.10.0", - "@actions/github": "^6.0.0" - }, - "devDependencies": { - "@octokit/graphql-schema": "^15.26.0", - "@playwright/test": "1.52.0-next" - }, - "engines": { - "node": ">=18" - } - }, "packages/playwright-firefox": { - "version": "1.52.0-next", + "version": "1.53.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-next" + "playwright-core": "1.53.2" }, "bin": { "playwright": "cli.js" @@ -8664,10 +8708,10 @@ }, "packages/playwright-test": { "name": "@playwright/test", - "version": "1.52.0-next", + "version": "1.53.2", "license": "Apache-2.0", "dependencies": { - "playwright": "1.52.0-next" + "playwright": "1.53.2" }, "bin": { "playwright": "cli.js" @@ -8694,11 +8738,11 @@ } }, "packages/playwright-webkit": { - "version": "1.52.0-next", + "version": "1.53.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.52.0-next" + "playwright-core": "1.53.2" }, "bin": { "playwright": "cli.js" @@ -8730,7 +8774,6 @@ "packages/trace-viewer": { "version": "0.0.0", "dependencies": { - "markdown-to-jsx": "^7.7.3", "yaml": "^2.6.0" } }, diff --git a/package.json b/package.json index 0d62b913967ce..b7d04d2f3ee08 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "playwright-internal", "private": true, - "version": "1.52.0-next", + "version": "1.53.2", "description": "A high-level API to automate web browsers", "repository": { "type": "git", @@ -51,10 +51,12 @@ ], "devDependencies": { "@actions/core": "^1.10.0", + "@actions/github": "^6.0.0", "@babel/code-frame": "^7.26.2", "@eslint/compat": "^1.2.6", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.19.0", + "@octokit/graphql-schema": "^15.26.0", "@stylistic/eslint-plugin": "^3.0.1", "@types/codemirror": "^5.60.7", "@types/formidable": "^2.0.4", @@ -72,7 +74,7 @@ "@zip.js/zip.js": "^2.7.29", "ansi-styles": "^4.3.0", "chokidar": "^3.5.3", - "chromium-bidi": "^3.2.1", + "chromium-bidi": "^5.3.1", "colors": "^1.4.0", "concurrently": "^6.2.1", "cross-env": "^7.0.3", @@ -87,14 +89,13 @@ "formidable": "^2.1.1", "immutable": "^4.3.7", "license-checker": "^25.0.1", - "markdown-to-jsx": "^7.7.3", "mime": "^3.0.0", "node-stream-zip": "^1.15.0", "react": "^18.1.0", "react-dom": "^18.1.0", "ssim.js": "^3.5.0", "typescript": "^5.8.2", - "vite": "^6.2.6", + "vite": "^6.3.4", "ws": "^8.17.1", "xml2js": "^0.5.0", "yaml": "2.6.0" diff --git a/packages/html-reporter/src/headerView.css b/packages/html-reporter/src/headerView.css index ef29c442ca2bd..b9331ab89f273 100644 --- a/packages/html-reporter/src/headerView.css +++ b/packages/html-reporter/src/headerView.css @@ -18,7 +18,35 @@ float: right; } +.header-view { + padding: 12px 8px 0 8px; +} + +.header-view div { + flex-shrink: 0; +} + +.header-superheader { + color: var(--color-fg-muted); +} + +.header-title { + flex: none; + font-weight: 400; + font-size: 32px; + line-height: 1.25; +} + @media only screen and (max-width: 600px) { + .header-view { + padding: 0; + } + + .header-view div { + /* Allow all header elements to wrap */ + flex-shrink: 1; + } + .header-view-status-container { float: none; margin: 0 0 10px 0 !important; @@ -29,4 +57,8 @@ border-left: none; border-right: none; } + + .header-title, .header-superheader { + margin: 0 8px; + } } diff --git a/packages/html-reporter/src/headerView.spec.tsx b/packages/html-reporter/src/headerView.spec.tsx index 754ecbd1cd500..2276d62cc1c8b 100644 --- a/packages/html-reporter/src/headerView.spec.tsx +++ b/packages/html-reporter/src/headerView.spec.tsx @@ -15,14 +15,14 @@ */ import { test, expect } from '@playwright/experimental-ct-react'; -import { HeaderView } from './headerView'; +import { GlobalFilterView } from './headerView'; import { SearchParamsProvider } from './links'; test.use({ viewport: { width: 720, height: 200 } }); test('should render counters', async ({ mount }) => { const component = await mount( - { test('should toggle filters', async ({ page, mount }) => { const filters: string[] = []; const component = await mount( - = ({ title, leftSuperHeader, rightSuperHeader }) => { + return
+
+ {leftSuperHeader} +
+ {rightSuperHeader} +
+ {title &&
{title}
} +
; +}; + +export const GlobalFilterView: React.FC<{ stats: Stats, filterText: string, setFilterText: (filterText: string) => void, @@ -45,13 +60,16 @@ export const HeaderView: React.FC<{ event => { event.preventDefault(); const url = new URL(window.location.href); - url.hash = filterText ? '?' + new URLSearchParams({ q: filterText }) : ''; + // If
onSubmit happens immediately after onChange, the filterText state is not updated yet. + // Using FormData here is a workaround to get the latest value. + const q = new FormData(event.target as HTMLFormElement).get('q') as string; + url.hash = q ? '?' + new URLSearchParams({ q }) : ''; navigate(url); } }> {icons.search()} {/* Use navigationId to reset defaultValue */} - { + { setFilterText(e.target.value); }}>
diff --git a/packages/html-reporter/src/index.tsx b/packages/html-reporter/src/index.tsx index 4ae3b02591a92..84763267c49f0 100644 --- a/packages/html-reporter/src/index.tsx +++ b/packages/html-reporter/src/index.tsx @@ -61,12 +61,14 @@ class ZipReport implements LoadedReport { if (window.playwrightReportBase64) return resolve(window.playwrightReportBase64); if (window.opener) { - window.addEventListener('message', event => { + const listener = (event: MessageEvent) => { if (event.source === window.opener) { localStorage.setItem(kPlaywrightReportStorageForHMR, event.data); resolve(event.data); + window.removeEventListener('message', listener); } - }, { once: true }); + }; + window.addEventListener('message', listener); window.opener.postMessage('ready', '*'); } else { const oldReport = localStorage.getItem(kPlaywrightReportStorageForHMR); diff --git a/packages/html-reporter/src/metadataView.css b/packages/html-reporter/src/metadataView.css index c383d6776a0e9..d62635909e778 100644 --- a/packages/html-reporter/src/metadataView.css +++ b/packages/html-reporter/src/metadataView.css @@ -17,7 +17,7 @@ .metadata-toggle { cursor: pointer; user-select: none; - margin-left: 5px; + margin-left: 8px; color: var(--color-fg-default); } diff --git a/packages/html-reporter/src/reportView.tsx b/packages/html-reporter/src/reportView.tsx index e48064201c26f..31b3df975f491 100644 --- a/packages/html-reporter/src/reportView.tsx +++ b/packages/html-reporter/src/reportView.tsx @@ -19,7 +19,7 @@ import * as React from 'react'; import './colors.css'; import './common.css'; import { Filter } from './filter'; -import { HeaderView } from './headerView'; +import { HeaderView, GlobalFilterView } from './headerView'; import { Route, SearchParamsContext } from './links'; import type { LoadedReport } from './loadedReport'; import './reportView.css'; @@ -72,9 +72,18 @@ export const ReportView: React.FC<{ return result; }, [report, filter]); + const reportTitle = report?.json()?.title; + + React.useEffect(() => { + if (reportTitle) + document.title = reportTitle; + else + document.title = 'Playwright Test Report'; + }, [reportTitle]); + return
- {report?.json() && } + {report?.json() && } setMetadataVisible(visible => !visible)}/> , }> = ({ report, testIdToFileIdMap, tests }) => { const searchParams = React.useContext(SearchParamsContext); - const [test, setTest] = React.useState(); + const [test, setTest] = React.useState('loading'); const testId = searchParams.get('testId'); const run = +(searchParams.get('run') || '0'); @@ -110,28 +119,38 @@ const TestCaseViewLoader: React.FC<{ React.useEffect(() => { (async () => { - if (!testId || testId === test?.testId) + if (!testId || (typeof test === 'object' && testId === test.testId)) return; const fileId = testIdToFileIdMap.get(testId); - if (!fileId) + if (!fileId) { + setTest('not-found'); return; - const file = await report.entry(`${fileId}.json`) as TestFile; - for (const t of file.tests) { - if (t.testId === testId) { - setTest(t); - break; - } } + const file = await report.entry(`${fileId}.json`) as TestFile; + setTest(file?.tests.find(t => t.testId === testId) || 'not-found'); })(); }, [test, report, testId, testIdToFileIdMap]); - return ; + if (test === 'loading') + return
; + + if (test === 'not-found') { + return
+ +
Test ID: {testId}
+
; + } + + return
+ +
; }; function computeStats(files: TestFileSummary[], filter: Filter): FilteredStats { diff --git a/packages/html-reporter/src/testCaseView.css b/packages/html-reporter/src/testCaseView.css index 9ae47b179d249..b070503668d32 100644 --- a/packages/html-reporter/src/testCaseView.css +++ b/packages/html-reporter/src/testCaseView.css @@ -16,7 +16,7 @@ .test-case-column { border-radius: 6px; - margin: 12px 0 24px 0; + margin-bottom: 24px; } .test-case-column .tab-element.selected { @@ -34,14 +34,6 @@ color: var(--color-fg-default); } -.test-case-title { - flex: none; - padding: 8px; - font-weight: 400; - font-size: 32px !important; - line-height: 1.25 !important; -} - .test-case-location, .test-case-duration { flex: none; @@ -51,14 +43,15 @@ } .test-case-run-duration { - color: var(--color-fg-subtle); + color: var(--color-fg-muted); padding-left: 8px; } -.test-case-path { +.header-view .test-case-path { flex: none; + flex-shrink: 1; align-items: center; - padding: 0 8px; + padding-right: 8px; } .test-case-annotation { diff --git a/packages/html-reporter/src/testCaseView.spec.tsx b/packages/html-reporter/src/testCaseView.spec.tsx index 90722d0dbd9e9..36ceff484a366 100644 --- a/packages/html-reporter/src/testCaseView.spec.tsx +++ b/packages/html-reporter/src/testCaseView.spec.tsx @@ -66,7 +66,7 @@ const testCase: TestCase = { }; test('should render test case', async ({ mount }) => { - const component = await mount(); + const component = await mount(); await expect(component.getByText('Annotation text', { exact: false }).first()).toBeVisible(); await expect(component.getByText('Hidden annotation')).toBeHidden(); await component.getByText('Annotations').click(); @@ -82,7 +82,7 @@ test('should render test case', async ({ mount }) => { test('should render copy buttons for annotations', async ({ mount, page, context }) => { await context.grantPermissions(['clipboard-read', 'clipboard-write']); - const component = await mount(); + const component = await mount(); await expect(component.getByText('Annotation text', { exact: false }).first()).toBeVisible(); await component.getByText('Annotation text', { exact: false }).first().hover(); await expect(component.locator('.test-case-annotation').getByLabel('Copy to clipboard').first()).toBeVisible(); @@ -113,7 +113,7 @@ const annotationLinkRenderingTestCase: TestCase = { }; test('should correctly render links in annotations', async ({ mount }) => { - const component = await mount(); + const component = await mount(); const firstLink = await component.getByText('https://playwright.dev/docs/intro').first(); await expect(firstLink).toBeVisible(); @@ -188,7 +188,7 @@ const testCaseSummary: TestCaseSummary = { test('should correctly render links in attachments', async ({ mount }) => { - const component = await mount(); + const component = await mount(); await component.getByText('first attachment').click(); const body = await component.getByText('The body with https://playwright.dev/docs/intro link'); await expect(body).toBeVisible(); @@ -201,7 +201,7 @@ test('should correctly render links in attachments', async ({ mount }) => { }); test('should correctly render links in attachment name', async ({ mount }) => { - const component = await mount(); + const component = await mount(); const link = component.getByText('attachment with inline link').locator('a'); await expect(link).toHaveAttribute('href', 'https://github.com/microsoft/playwright/issues/31284'); await expect(link).toHaveText('https://github.com/microsoft/playwright/issues/31284'); @@ -211,7 +211,7 @@ test('should correctly render links in attachment name', async ({ mount }) => { }); test('should correctly render prev and next', async ({ mount }) => { - const component = await mount(); + const component = await mount(); await expect(component).toMatchAriaSnapshot(` - text: group - link "« previous" @@ -226,7 +226,7 @@ const testCaseWithTwoAttempts: TestCase = { results: [ { ...result, - errors: ['Error message'], + errors: [{ message: 'Error message' }], status: 'failed', duration: 50, }, @@ -239,7 +239,7 @@ const testCaseWithTwoAttempts: TestCase = { }; test('total duration is selected run duration', async ({ mount, page }) => { - const component = await mount(); + const component = await mount(); await expect(component).toMatchAriaSnapshot(` - text: "My test test.spec.ts:42 200ms" - tablist: diff --git a/packages/html-reporter/src/testCaseView.tsx b/packages/html-reporter/src/testCaseView.tsx index 03b2daabbe429..d80049ca332c3 100644 --- a/packages/html-reporter/src/testCaseView.tsx +++ b/packages/html-reporter/src/testCaseView.tsx @@ -28,52 +28,51 @@ import { linkifyText } from '@web/renderUtils'; import { hashStringToInt, msToString } from './utils'; import { clsx } from '@web/uiUtils'; import { CopyToClipboardContainer } from './copyToClipboard'; +import { HeaderView } from './headerView'; +import type { MetadataWithCommitInfo } from '@playwright/isomorphic/types'; export const TestCaseView: React.FC<{ projectNames: string[], - test: TestCase | undefined, + test: TestCase, + testRunMetadata: MetadataWithCommitInfo | undefined, next: TestCaseSummary | undefined, prev: TestCaseSummary | undefined, run: number, -}> = ({ projectNames, test, run, next, prev }) => { +}> = ({ projectNames, test, testRunMetadata, run, next, prev }) => { const [selectedResultIndex, setSelectedResultIndex] = React.useState(run); const searchParams = React.useContext(SearchParamsContext); - const filterParam = searchParams.has('q') ? '&q=' + searchParams.get('q') : ''; - - const labels = React.useMemo(() => { - if (!test) - return undefined; - return test.tags; - }, [test]); - const visibleTestAnnotations = test?.annotations.filter(a => !a.type.startsWith('_')) ?? []; + const filterParam = searchParams.has('q') ? '&q=' + searchParams.get('q') : ''; + const labels = React.useMemo(() => test.tags, [test]); + const visibleTestAnnotations = test.annotations.filter(a => !a.type.startsWith('_')) ?? []; - return
- {test &&
-
{test.path.join(' › ')}
-
-
« previous
-
-
next »
-
} - {test &&
{test?.title}
} - {test &&
+ return <> + {test.path.join(' › ')}
} + rightSuperHeader={<> +
« previous
+
+
next »
+ } + /> +
- + {test.location.file}:{test.location.line}
{msToString(test.duration)}
-
} - {test && (!!test.projectName || labels) &&
- {test && !!test.projectName && } +
+ {(!!test.projectName || labels) &&
+ {!!test.projectName && } {labels && }
} - {test?.results.length === 0 && visibleTestAnnotations.length !== 0 && + {test.results.length === 0 && visibleTestAnnotations.length !== 0 && {visibleTestAnnotations.map((annotation, index) => )} } - {test && ({ id: String(index), title:
@@ -86,11 +85,11 @@ export const TestCaseView: React.FC<{ {!!visibleAnnotations.length && {visibleAnnotations.map((annotation, index) => )} } - + ; }, - })) || []} selectedTab={String(selectedResultIndex)} setSelectedTab={id => setSelectedResultIndex(+id)} />} -
; + })) || []} selectedTab={String(selectedResultIndex)} setSelectedTab={id => setSelectedResultIndex(+id)} /> + ; }; function TestCaseAnnotationView({ annotation: { type, description } }: { annotation: TestAnnotation }) { diff --git a/packages/html-reporter/src/testErrorView.tsx b/packages/html-reporter/src/testErrorView.tsx index 881c420c22dbd..7639e3577bd82 100644 --- a/packages/html-reporter/src/testErrorView.tsx +++ b/packages/html-reporter/src/testErrorView.tsx @@ -19,23 +19,6 @@ import * as React from 'react'; import './testErrorView.css'; import type { ImageDiff } from '@web/shared/imageDiffView'; import { ImageDiffView } from '@web/shared/imageDiffView'; -import { TestAttachment } from './types'; - -export const TestErrorView: React.FC<{ - error: string; - testId?: string; - prompt?: TestAttachment; -}> = ({ error, testId, prompt }) => { - return ( - - {prompt && ( -
- -
- )} -
- ); -}; export const CodeSnippet = ({ code, children, testId }: React.PropsWithChildren<{ code: string; testId?: string; }>) => { const html = React.useMemo(() => ansiErrorToHtml(code), [code]); @@ -47,14 +30,13 @@ export const CodeSnippet = ({ code, children, testId }: React.PropsWithChildren< ); }; -const PromptButton: React.FC<{ prompt: TestAttachment }> = ({ prompt }) => { +export const PromptButton: React.FC<{ prompt: string }> = ({ prompt }) => { const [copied, setCopied] = React.useState(false); return