diff --git a/.eslintrc.js b/.eslintrc.js index bff9ffeeb4..a116a37036 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,9 +6,14 @@ module.exports = { sourceType: "module", }, extends: [ + "plugin:react/recommended", "plugin:react-hooks/recommended" ], + settings: { + react: { version: "18" } + }, + /** * ESLint rules * @@ -30,6 +35,7 @@ module.exports = { "avoidEscape": true, "allowTemplateLiterals": true }], + "jsx-quotes": [2, "prefer-single"], "no-extra-semi": 2, "@typescript-eslint/semi": [2], "comma-style": [2, "last"], @@ -123,5 +129,8 @@ module.exports = { "mustMatch": "Copyright", "templateFile": require("path").join(__dirname, "utils", "copyright.js"), }], + + // react + "react/react-in-jsx-scope": 0 } }; diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 062d7c7e74..60fea176c8 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -24,6 +24,7 @@ body: ## Make a minimal reproduction To file the report, you will need a GitHub repository with a minimal (but complete) example and simple/clear steps on how to reproduce the bug. The simpler you can make it, the more likely we are to successfully verify and fix the bug. You can create a new project with `npm init playwright@latest new-project` and then add the test code there. + Please make sure you only include the code and the dependencies absolutely necessary for your repro. Due to the security considerations, we can only run the code we trust. Major web frameworks are Ok to use, but smaller convenience libraries are not. - type: markdown attributes: value: | diff --git a/.github/workflows/infra.yml b/.github/workflows/infra.yml index 3580ecc97a..f33c8535f0 100644 --- a/.github/workflows/infra.yml +++ b/.github/workflows/infra.yml @@ -44,10 +44,10 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.11' - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - run: npm ci diff --git a/.github/workflows/publish_canary.yml b/.github/workflows/publish_canary.yml index 50a1564755..64d25dbd6d 100644 --- a/.github/workflows/publish_canary.yml +++ b/.github/workflows/publish_canary.yml @@ -14,7 +14,7 @@ env: jobs: publish-canary: name: "publish canary NPM" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 if: github.repository == 'microsoft/playwright' permissions: id-token: write # This is required for OIDC login (azure/login) to succeed diff --git a/.github/workflows/publish_release_docker.yml b/.github/workflows/publish_release_docker.yml index 6a9e6d85ae..4c96de8f30 100644 --- a/.github/workflows/publish_release_docker.yml +++ b/.github/workflows/publish_release_docker.yml @@ -2,12 +2,6 @@ name: "publish release - Docker" on: workflow_dispatch: - inputs: - is_release: - required: true - type: boolean - description: "Is this a release image?" - release: types: [published] @@ -45,6 +39,3 @@ jobs: - name: Login to ACR via OIDC run: az acr login --name playwright - run: ./utils/docker/publish_docker.sh stable - if: (github.event_name != 'workflow_dispatch' && !github.event.release.prerelease) || (github.event_name == 'workflow_dispatch' && github.event.inputs.is_release == 'true') - - run: ./utils/docker/publish_docker.sh canary - if: (github.event_name != 'workflow_dispatch' && github.event.release.prerelease) || (github.event_name == 'workflow_dispatch' && github.event.inputs.is_release != 'true') diff --git a/.github/workflows/publish_release_driver.yml b/.github/workflows/publish_release_driver.yml index 8ad1a4184a..1eaa4656a7 100644 --- a/.github/workflows/publish_release_driver.yml +++ b/.github/workflows/publish_release_driver.yml @@ -10,7 +10,7 @@ env: jobs: publish-driver-release: name: "publish playwright driver to CDN" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 if: github.repository == 'microsoft/playwright' permissions: id-token: write # This is required for OIDC login (azure/login) to succeed diff --git a/.github/workflows/tests_bidi.yml b/.github/workflows/tests_bidi.yml new file mode 100644 index 0000000000..8224d24883 --- /dev/null +++ b/.github/workflows/tests_bidi.yml @@ -0,0 +1,46 @@ +name: tests BiDi + +on: + workflow_dispatch: + pull_request: + branches: + - main + paths: + - .github/workflows/tests_bidi.yml + schedule: + # Run every day at midnight + - cron: '0 0 * * *' + +env: + FORCE_COLOR: 1 + ELECTRON_SKIP_BINARY_DOWNLOAD: 1 + +jobs: + test_bidi: + name: BiDi + environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }} + runs-on: ubuntu-24.04 + permissions: + id-token: write # This is required for OIDC login (azure/login) to succeed + contents: read # This is required for actions/checkout to succeed + strategy: + fail-fast: false + matrix: + channel: [bidi-chromium, bidi-firefox-beta] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + env: + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' + - run: npm run build + - run: npx playwright install --with-deps chromium + if: matrix.channel == 'bidi-chromium' + - run: npx -y @puppeteer/browsers install firefox@beta + if: matrix.channel == 'bidi-firefox-beta' + - name: Run tests + run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run biditest -- --project=${{ matrix.channel }}* + env: + PWTEST_USE_BIDI_EXPECTATIONS: '1' diff --git a/.github/workflows/tests_others.yml b/.github/workflows/tests_others.yml index 783f3fe2ff..434c5aa9d3 100644 --- a/.github/workflows/tests_others.yml +++ b/.github/workflows/tests_others.yml @@ -66,7 +66,7 @@ jobs: contents: read # This is required for actions/checkout to succeed steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v3 + - uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.x' - run: dotnet build diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml index 0316908da9..02847957c4 100644 --- a/.github/workflows/tests_primary.yml +++ b/.github/workflows/tests_primary.yml @@ -219,7 +219,6 @@ jobs: with: command: npm run itest bot-name: "package-installations-${{ matrix.os }}" - # TODO: figure out why itest fails with 'bash' on Windows. shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }} flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }} flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }} diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.yml index fd5458fb89..8d4bbd1c78 100644 --- a/.github/workflows/tests_secondary.yml +++ b/.github/workflows/tests_secondary.yml @@ -50,7 +50,9 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, macos-13, macos-14] + # Intel: macos-13, macos-14-large + # Arm64: macos-13-xlarge, macos-14 + os: [macos-13, macos-13-xlarge, macos-14-large, macos-14] browser: [chromium, firefox, webkit] runs-on: ${{ matrix.os }} steps: @@ -235,7 +237,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, macos-12, windows-latest] + os: [ubuntu-20.04, macos-13, windows-latest] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/run-test @@ -529,7 +531,7 @@ jobs: build-playwright-driver: name: "build-playwright-driver" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 diff --git a/.github/workflows/tests_service.yml b/.github/workflows/tests_service.yml index 2739680712..2d68740006 100644 --- a/.github/workflows/tests_service.yml +++ b/.github/workflows/tests_service.yml @@ -34,7 +34,7 @@ jobs: PLAYWRIGHT_SERVICE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }} - name: Upload blob report to GitHub if: ${{ !cancelled() }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: all-blob-reports path: blob-report @@ -53,7 +53,7 @@ jobs: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: npm run build - name: Download blob report artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: all-blob-reports path: all-blob-reports diff --git a/.gitignore b/.gitignore index 69d85e4975..aadc481067 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ test-results /tests/installation/output/ /tests/installation/.registry.json .cache/ -.eslintcache \ No newline at end of file +.eslintcache +playwright.env diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 264793fc2b..30e89e6bee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,12 +46,16 @@ npm ci npm run build ``` -4. Run all Playwright tests locally. For more information about tests, read [Running & Writing Tests](#running--writing-tests). +4. Run tests + +This will run a test on line `23` in `page-fill.spec.ts`: ```bash -npm test +npm run ctest -- page-fill:23 ``` +See [here](#running--writing-tests) for more information about running and writing tests. + ### Code reviews All submissions, including submissions by project members, require review. We @@ -95,7 +99,7 @@ footer 1. *label* is one of the following: - `fix` - playwright bug fixes. - `feat` - playwright features. - - `docs` - changes to docs, e.g. `docs(api.md): ..` to change documentation. + - `docs` - changes to docs, e.g. `docs(api): ..` to change documentation. - `test` - changes to playwright tests infrastructure. - `devops` - build-related work, e.g. CI related patches and general changes to the browser build infrastructure - `chore` - everything that doesn't fall under previous categories @@ -159,11 +163,14 @@ npm run test Be sure to run `npm run build` or let `npm run watch` run before you re-run the tests after making your changes to check them. -- To run all tests in Chromium +- To run tests in Chromium ```bash npm run ctest # also `ftest` for firefox and `wtest` for WebKit +npm run ctest -- page-fill:23 # runs line 23 of page-fill.spec.ts ``` +To run tests in WebKit / Firefox, use `wtest` or `ftest`. + - To run the Playwright test runner tests ```bash npm run ttest @@ -206,31 +213,13 @@ npm run ctest -- --headed CRPATH= npm run ctest ``` -- To run tests in slow-mode: - -```bash -SLOW_MO=500 npm run wtest -- --headed -``` - -- When should a test be marked with `skip` or `fail`? +- When should a test be marked with `skip` or `fixme`? - **`skip(condition)`**: This test *should ***never*** work* for `condition` - where `condition` is usually a certain browser like `FFOX` (for Firefox), - `WEBKIT` (for WebKit), and `CHROMIUM` (for Chromium). + where `condition` is usually something like: `test.skip(browserName === 'chromium', 'This does not work because of ...')`. - For example, the [alt-click downloads test](https://github.com/microsoft/playwright/blob/471ccc72d3f0847caa36f629b394a028c7750d93/test/download.spec.js#L86) is marked - with `skip(FFOX)` since an alt-click in Firefox will not produce a download - even if a person was driving the browser. - - - - **`fail(condition)`**: This test *should ***eventually*** work* for `condition` - where `condition` is usually a certain browser like `FFOX` (for Firefox), - `WEBKIT` (for WebKit), and `CHROMIUM` (for Chromium). - - For example, the [alt-click downloads test](https://github.com/microsoft/playwright/blob/471ccc72d3f0847caa36f629b394a028c7750d93/test/download.spec.js#L86) is marked - with `fail(CHROMIUM || WEBKIT)` since Playwright performing these actions - currently diverges from what a user would experience driving a Chromium or - WebKit. + - **`fixme(condition)`**: This test *should ***eventually*** work* for `condition` + where `condition` is usually something like: `test.fixme(browserName === 'chromium', 'We are waiting for version x')`. ## Contributor License Agreement diff --git a/README.md b/README.md index e225e4a9ce..4796c77121 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-127.0.6533.26-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-127.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-17.4-blue.svg?logo=safari)](https://webkit.org/) +[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) [![Chromium version](https://img.shields.io/badge/chromium-130.0.6723.6-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-130.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-18.0-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 127.0.6533.26 | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| WebKit 17.4 | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Firefox 127.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 130.0.6723.6 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| WebKit 18.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 130.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/SECURITY.md b/SECURITY.md index 7ab49eb829..6b906d43bc 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,20 +1,20 @@ - + ## Security -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: @@ -28,7 +28,7 @@ Please include the requested information listed below (as much as you can provid This information will help us triage your report more quickly. -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. ## Preferred Languages @@ -36,6 +36,6 @@ We prefer all communications to be in English. ## Policy -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 0000000000..78cb929fb1 --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,17 @@ +# Support + +## How to file issues and get help + +This project uses GitHub issues to track bugs and feature requests. Please search the [existing issues][gh-issues] before filing new ones to avoid duplicates. For new issues, file your bug or feature request as a new issue using corresponding template. + +For help and questions about using this project, please see the [docs site for Playwright][docs]. + +Join our community [Discord Server][discord-server] to connect with other developers using Playwright and ask questions in our 'help-playwright' forum. + +## Microsoft Support Policy + +Support for Playwright is limited to the resources listed above. + +[gh-issues]: https://github.com/microsoft/playwright/issues/ +[docs]: https://playwright.dev/ +[discord-server]: https://aka.ms/playwright/discord diff --git a/browser_patches/firefox/UPSTREAM_CONFIG.sh b/browser_patches/firefox/UPSTREAM_CONFIG.sh index 10889141a7..ff33363424 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="bd7e0ac24a6fb1cddde3e45ea191b7abcc90cf56" +BASE_REVISION="cf0397e3ba298868fdca53f894da5b0d239dc09e" diff --git a/browser_patches/firefox/juggler/NetworkObserver.js b/browser_patches/firefox/juggler/NetworkObserver.js index 8eb69d8133..aa6f866277 100644 --- a/browser_patches/firefox/juggler/NetworkObserver.js +++ b/browser_patches/firefox/juggler/NetworkObserver.js @@ -602,6 +602,8 @@ class NetworkObserver { proxyFilter.onProxyFilterResult(defaultProxyInfo); return; } + if (this._targetRegistry.shouldBustHTTPAuthCacheForProxy(proxy)) + Services.obs.notifyObservers(null, "net:clear-active-logins"); proxyFilter.onProxyFilterResult(protocolProxyService.newProxyInfo( proxy.type, proxy.host, diff --git a/browser_patches/firefox/juggler/TargetRegistry.js b/browser_patches/firefox/juggler/TargetRegistry.js index ea7b2afa4d..c40c831d01 100644 --- a/browser_patches/firefox/juggler/TargetRegistry.js +++ b/browser_patches/firefox/juggler/TargetRegistry.js @@ -116,6 +116,7 @@ class TargetRegistry { this._browserToTarget = new Map(); this._browserIdToTarget = new Map(); + this._proxiesWithClashingAuthCacheKeys = new Set(); this._browserProxy = null; // Cleanup containers from previous runs (if any) @@ -234,12 +235,50 @@ class TargetRegistry { onOpenWindow(win); } + // Firefox uses nsHttpAuthCache to cache authentication to the proxy. + // If we're provided with a single proxy with a multiple different authentications, then + // we should clear the nsHttpAuthCache on every request. + shouldBustHTTPAuthCacheForProxy(proxy) { + return this._proxiesWithClashingAuthCacheKeys.has(proxy); + } + + _updateProxiesWithSameAuthCacheAndDifferentCredentials() { + const proxyIdToCredentials = new Map(); + const allProxies = [...this._browserContextIdToBrowserContext.values()].map(bc => bc._proxy).filter(Boolean); + if (this._browserProxy) + allProxies.push(this._browserProxy); + const proxyAuthCacheKeyAndProxy = allProxies.map(proxy => [ + JSON.stringify({ + type: proxy.type, + host: proxy.host, + port: proxy.port, + }), + proxy, + ]); + this._proxiesWithClashingAuthCacheKeys.clear(); + + proxyAuthCacheKeyAndProxy.sort(([cacheKey1], [cacheKey2]) => cacheKey1 < cacheKey2 ? -1 : 1); + for (let i = 0; i < proxyAuthCacheKeyAndProxy.length - 1; ++i) { + const [cacheKey1, proxy1] = proxyAuthCacheKeyAndProxy[i]; + const [cacheKey2, proxy2] = proxyAuthCacheKeyAndProxy[i + 1]; + if (cacheKey1 !== cacheKey2) + continue; + if (proxy1.username === proxy2.username && proxy1.password === proxy2.password) + continue; + // `proxy1` and `proxy2` have the same caching key, but serve different credentials. + // We have to bust HTTP Auth Cache everytime there's a request that will use either of the proxies. + this._proxiesWithClashingAuthCacheKeys.add(proxy1); + this._proxiesWithClashingAuthCacheKeys.add(proxy2); + } + } + async cancelDownload(options) { this._downloadInterceptor.cancelDownload(options.uuid); } setBrowserProxy(proxy) { this._browserProxy = proxy; + this._updateProxiesWithSameAuthCacheAndDifferentCredentials(); } getProxyInfo(channel) { @@ -368,7 +407,7 @@ class PageTarget { onLocationChange: (aWebProgress, aRequest, aLocation) => this._onNavigated(aLocation), }; this._eventListeners = [ - helper.addObserver(this._updateModalDialogs.bind(this), 'tabmodal-dialog-loaded'), + helper.addObserver(this._updateModalDialogs.bind(this), 'common-dialog-loaded'), helper.addProgressListener(tab.linkedBrowser, navigationListener, Ci.nsIWebProgress.NOTIFY_LOCATION), helper.addEventListener(this._linkedBrowser, 'DOMModalDialogClosed', event => this._updateModalDialogs()), helper.addEventListener(this._linkedBrowser, 'WillChangeBrowserRemoteness', event => this._willChangeBrowserRemoteness()), @@ -499,7 +538,7 @@ class PageTarget { } _updateModalDialogs() { - const prompts = new Set(this._linkedBrowser.tabModalPromptBox ? this._linkedBrowser.tabModalPromptBox.listPrompts() : []); + const prompts = new Set(this._linkedBrowser.tabDialogBox.getContentDialogManager().dialogs.map(dialog => dialog.frameContentWindow.Dialog)); for (const dialog of this._dialogs.values()) { if (!prompts.has(dialog.prompt())) { this._dialogs.delete(dialog.id()); @@ -906,12 +945,14 @@ class BrowserContext { } this._registry._browserContextIdToBrowserContext.delete(this.browserContextId); this._registry._userContextIdToBrowserContext.delete(this.userContextId); + this._registry._updateProxiesWithSameAuthCacheAndDifferentCredentials(); } setProxy(proxy) { // Clear AuthCache. Services.obs.notifyObservers(null, "net:clear-active-logins"); this._proxy = proxy; + this._registry._updateProxiesWithSameAuthCacheAndDifferentCredentials(); } setIgnoreHTTPSErrors(ignoreHTTPSErrors) { diff --git a/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm b/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm index 529f6d3b58..05d91473d3 100644 --- a/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm +++ b/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm @@ -8,6 +8,8 @@ const helper = new Helper(); let sameProcessInstanceNumber = 0; +const topBrowingContextToAgents = new Map(); + class JugglerFrameChild extends JSWindowActorChild { constructor() { super(); @@ -16,46 +18,66 @@ class JugglerFrameChild extends JSWindowActorChild { } handleEvent(aEvent) { - if (this._agents && aEvent.type === 'DOMWillOpenModalDialog') { - this._agents.channel.pause(); + const agents = this._agents(); + if (!agents) + return; + if (aEvent.type === 'DOMWillOpenModalDialog') { + agents.channel.pause(); return; } - if (this._agents && aEvent.type === 'DOMModalDialogClosed') { - this._agents.channel.resumeSoon(); + if (aEvent.type === 'DOMModalDialogClosed') { + agents.channel.resumeSoon(); return; } - if (this._agents && aEvent.target === this.document) - this._agents.pageAgent.onWindowEvent(aEvent); - if (this._agents && aEvent.target === this.document) - this._agents.frameTree.onWindowEvent(aEvent); + if (aEvent.target === this.document) { + agents.pageAgent.onWindowEvent(aEvent); + agents.frameTree.onWindowEvent(aEvent); + } + } + + _agents() { + return topBrowingContextToAgents.get(this.browsingContext.top); } actorCreated() { this.actorName = `content::${this.browsingContext.browserId}/${this.browsingContext.id}/${++sameProcessInstanceNumber}`; this._eventListeners.push(helper.addEventListener(this.contentWindow, 'load', event => { - this._agents?.pageAgent.onWindowEvent(event); + this._agents()?.pageAgent.onWindowEvent(event); })); if (this.document.documentURI.startsWith('moz-extension://')) return; - this._agents = initialize(this.browsingContext, this.docShell, this); - } - _dispose() { - helper.removeListeners(this._eventListeners); - // We do not cleanup since agents are shared for all frames in the process. + // Child frame events will be forwarded to related top-level agents. + if (this.browsingContext.parent) + return; - // TODO: restore the cleanup. - // Reset transport so that all messages will be pending and will not throw any errors. - // this._channel.resetTransport(); - // this._agents.pageAgent.dispose(); - // this._agents.frameTree.dispose(); - // this._agents = undefined; + let agents = topBrowingContextToAgents.get(this.browsingContext); + if (!agents) { + agents = initialize(this.browsingContext, this.docShell); + topBrowingContextToAgents.set(this.browsingContext, agents); + } + agents.channel.bindToActor(this); + agents.actor = this; } didDestroy() { - this._dispose(); + helper.removeListeners(this._eventListeners); + + if (this.browsingContext.parent) + return; + + const agents = topBrowingContextToAgents.get(this.browsingContext); + // The agents are already re-bound to a new actor. + if (agents?.actor !== this) + return; + + topBrowingContextToAgents.delete(this.browsingContext); + + agents.channel.resetTransport(); + agents.pageAgent.dispose(); + agents.frameTree.dispose(); } receiveMessage() { } diff --git a/browser_patches/firefox/juggler/content/PageAgent.js b/browser_patches/firefox/juggler/content/PageAgent.js index 6aee921e87..70dcf04921 100644 --- a/browser_patches/firefox/juggler/content/PageAgent.js +++ b/browser_patches/firefox/juggler/content/PageAgent.js @@ -370,7 +370,12 @@ class PageAgent { const unsafeObject = frame.unsafeObject(objectId); if (!unsafeObject) throw new Error('Object is not input!'); - const nsFiles = await Promise.all(files.map(filePath => File.createFromFileName(filePath))); + let nsFiles; + if (unsafeObject.webkitdirectory) { + nsFiles = await new Directory(files[0]).getFiles(true); + } else { + nsFiles = await Promise.all(files.map(filePath => File.createFromFileName(filePath))); + } unsafeObject.mozSetFileArray(nsFiles); const events = [ new (frame.domWindow().Event)('input', { bubbles: true, cancelable: true, composed: true }), diff --git a/browser_patches/firefox/juggler/content/main.js b/browser_patches/firefox/juggler/content/main.js index 022b1e3a5e..15986bbed9 100644 --- a/browser_patches/firefox/juggler/content/main.js +++ b/browser_patches/firefox/juggler/content/main.js @@ -7,24 +7,10 @@ const {FrameTree} = ChromeUtils.import('chrome://juggler/content/content/FrameTr const {SimpleChannel} = ChromeUtils.import('chrome://juggler/content/SimpleChannel.js'); const {PageAgent} = ChromeUtils.import('chrome://juggler/content/content/PageAgent.js'); -const browsingContextToAgents = new Map(); const helper = new Helper(); -function initialize(browsingContext, docShell, actor) { - if (browsingContext.parent) { - // For child frames, return agents from the main frame. - return browsingContextToAgents.get(browsingContext.top); - } - - let data = browsingContextToAgents.get(browsingContext); - if (data) { - // Rebind from one main frame actor to another one. - data.channel.bindToActor(actor); - return data; - } - - data = { channel: undefined, pageAgent: undefined, frameTree: undefined, failedToOverrideTimezone: false }; - browsingContextToAgents.set(browsingContext, data); +function initialize(browsingContext, docShell) { + const data = { channel: undefined, pageAgent: undefined, frameTree: undefined, failedToOverrideTimezone: false }; const applySetting = { geolocation: (geolocation) => { @@ -84,7 +70,6 @@ function initialize(browsingContext, docShell, actor) { data.frameTree.addBinding(worldName, name, script); data.frameTree.setInitScripts([...contextCrossProcessCookie.initScripts, ...pageCrossProcessCookie.initScripts]); data.channel = new SimpleChannel('', 'process-' + Services.appinfo.processID); - data.channel.bindToActor(actor); data.pageAgent = new PageAgent(data.channel, data.frameTree); docShell.fileInputInterceptionEnabled = !!pageCrossProcessCookie.interceptFileChooserDialog; diff --git a/browser_patches/firefox/juggler/protocol/PageHandler.js b/browser_patches/firefox/juggler/protocol/PageHandler.js index 8fa9a06361..bab151b392 100644 --- a/browser_patches/firefox/juggler/protocol/PageHandler.js +++ b/browser_patches/firefox/juggler/protocol/PageHandler.js @@ -256,6 +256,13 @@ class PageHandler { return await this._contentPage.send('disposeObject', options); } + async ['Heap.collectGarbage']() { + Services.obs.notifyObservers(null, "child-gc-request"); + Cu.forceGC(); + Services.obs.notifyObservers(null, "child-cc-request"); + Cu.forceCC(); + } + async ['Network.getResponseBody']({requestId}) { return this._pageNetwork.getResponseBody(requestId); } diff --git a/browser_patches/firefox/juggler/protocol/Protocol.js b/browser_patches/firefox/juggler/protocol/Protocol.js index 6c9b700f05..2b7ad56d6a 100644 --- a/browser_patches/firefox/juggler/protocol/Protocol.js +++ b/browser_patches/firefox/juggler/protocol/Protocol.js @@ -487,6 +487,17 @@ const Browser = { }, }; +const Heap = { + targets: ['page'], + types: {}, + events: {}, + methods: { + 'collectGarbage': { + params: {}, + }, + }, +}; + const Network = { targets: ['page'], types: networkTypes, @@ -1002,7 +1013,7 @@ const Accessibility = { } this.protocol = { - domains: {Browser, Page, Runtime, Network, Accessibility}, + domains: {Browser, Heap, Page, Runtime, Network, Accessibility}, }; this.checkScheme = checkScheme; this.EXPORTED_SYMBOLS = ['protocol', 'checkScheme']; diff --git a/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp b/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp index 25f6171801..062a851429 100644 --- a/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp +++ b/browser_patches/firefox/juggler/screencast/nsScreencastService.cpp @@ -129,7 +129,7 @@ class nsScreencastService::Session : public rtc::VideoSinkInterfaceStartCapture(capability); + int error = mCaptureModule->StartCaptureCounted(capability); if (error) { fprintf(stderr, "StartCapture error %d\n", error); return false; @@ -152,7 +152,7 @@ class nsScreencastService::Session : public rtc::VideoSinkInterfaceDeRegisterCaptureDataCallback(this); else mCaptureModule->DeRegisterRawFrameCallback(this); - mCaptureModule->StopCapture(); + mCaptureModule->StopCaptureCounted(); if (mEncoder) { mEncoder->finish([this, protect = RefPtr{this}] { NS_DispatchToMainThread(NS_NewRunnableFunction( diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diff index 6291e775e6..4344455a66 100644 --- a/browser_patches/firefox/patches/bootstrap.diff +++ b/browser_patches/firefox/patches/bootstrap.diff @@ -57,7 +57,7 @@ index 8e9bf2b413585b5a3db9370eee5d57fb6c6716ed..5a3b194b54e3813c89989f13a214c989 * Return XPCOM wrapper for the internal accessible. */ diff --git a/browser/app/winlauncher/LauncherProcessWin.cpp b/browser/app/winlauncher/LauncherProcessWin.cpp -index 81d4ee91e9383693d794dbf68184a80b49b582c6..1a07e3511f73199fe0b248412d01d7b8a3744a66 100644 +index b40e0fceb567c0d217adf284e13f434e49cc8467..2c4e6d5fbf8da40954ad6a5b15e412493e43b14e 100644 --- a/browser/app/winlauncher/LauncherProcessWin.cpp +++ b/browser/app/winlauncher/LauncherProcessWin.cpp @@ -22,6 +22,7 @@ @@ -68,7 +68,7 @@ index 81d4ee91e9383693d794dbf68184a80b49b582c6..1a07e3511f73199fe0b248412d01d7b8 #include #include -@@ -425,8 +426,18 @@ Maybe LauncherMain(int& argc, wchar_t* argv[], +@@ -421,8 +422,18 @@ Maybe LauncherMain(int& argc, wchar_t* argv[], HANDLE stdHandles[] = {::GetStdHandle(STD_INPUT_HANDLE), ::GetStdHandle(STD_OUTPUT_HANDLE), ::GetStdHandle(STD_ERROR_HANDLE)}; @@ -106,10 +106,10 @@ index f6d425f36a965f03ac82dbe3ab6cde06f12751ac..d60999ab2658b1e1e5f07a8aee530451 browser/chrome/browser/search-extensions/amazon/favicon.ico browser/chrome/browser/search-extensions/amazondotcn/favicon.ico diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in -index 1b87a9ab4aec939acac1da54a2b6670cc581fe86..a638dbe8e2f260d8be550fa8eb5bf6f6c2c31080 100644 +index 3bf9d511555510414f39db7f99a6b5a2a743f178..bb0f71dd602193536c23f7b865ec5dce3ee02242 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in -@@ -185,6 +185,9 @@ +@@ -189,6 +189,9 @@ @RESPATH@/chrome/remote.manifest #endif @@ -167,7 +167,7 @@ index d49c6fbf1bf83b832795fa674f6b41f223eef812..7ea3540947ff5f61b15f27fbf4b95564 const transportProvider = { setListener(upgradeListener) { diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp -index 6e1a1b689398fa6c3c73f2f243ae02c67a4476c8..9dcf71ce753cf11f295d83eb7653e940065c8e2c 100644 +index db5b5b990727aefcbaa47f89e0f53f4048e60038..bcd2321f46d9bca719fc530054984a2163c21f86 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp @@ -106,8 +106,15 @@ struct ParamTraits @@ -188,7 +188,7 @@ index 6e1a1b689398fa6c3c73f2f243ae02c67a4476c8..9dcf71ce753cf11f295d83eb7653e940 template <> struct ParamTraits -@@ -2804,6 +2811,40 @@ void BrowsingContext::DidSet(FieldIndex, +@@ -2807,6 +2814,40 @@ void BrowsingContext::DidSet(FieldIndex, PresContextAffectingFieldChanged(); } @@ -230,10 +230,10 @@ index 6e1a1b689398fa6c3c73f2f243ae02c67a4476c8..9dcf71ce753cf11f295d83eb7653e940 nsString&& aOldValue) { MOZ_ASSERT(IsTop()); diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h -index 5ec95a61e4d3af265cbe7dd9d83f6535da1d103e..f8acafe6d58c429af27a38363e06ad546dfbfddd 100644 +index 61135ab0d7894c500c3c5d80d107e283c01b6830..cc8eb043f1f78214843ec7b335dd9932587d9bbd 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h -@@ -199,10 +199,10 @@ struct EmbedderColorSchemes { +@@ -203,10 +203,10 @@ struct EmbedderColorSchemes { FIELD(GVInaudibleAutoplayRequestStatus, GVAutoplayRequestStatus) \ /* ScreenOrientation-related APIs */ \ FIELD(CurrentOrientationAngle, float) \ @@ -246,7 +246,7 @@ index 5ec95a61e4d3af265cbe7dd9d83f6535da1d103e..f8acafe6d58c429af27a38363e06ad54 FIELD(EmbedderElementType, Maybe) \ FIELD(MessageManagerGroup, nsString) \ FIELD(MaxTouchPointsOverride, uint8_t) \ -@@ -240,6 +240,10 @@ struct EmbedderColorSchemes { +@@ -244,6 +244,10 @@ struct EmbedderColorSchemes { * embedder element. */ \ FIELD(EmbedderColorSchemes, EmbedderColorSchemes) \ FIELD(DisplayMode, dom::DisplayMode) \ @@ -257,7 +257,7 @@ index 5ec95a61e4d3af265cbe7dd9d83f6535da1d103e..f8acafe6d58c429af27a38363e06ad54 /* The number of entries added to the session history because of this \ * browsing context. */ \ FIELD(HistoryEntryCount, uint32_t) \ -@@ -926,6 +930,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -937,6 +941,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { return GetPrefersColorSchemeOverride(); } @@ -272,7 +272,7 @@ index 5ec95a61e4d3af265cbe7dd9d83f6535da1d103e..f8acafe6d58c429af27a38363e06ad54 bool IsInBFCache() const; bool AllowJavascript() const { return GetAllowJavascript(); } -@@ -1090,6 +1102,23 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -1101,6 +1113,23 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { void WalkPresContexts(Callback&&); void PresContextAffectingFieldChanged(); @@ -297,10 +297,19 @@ index 5ec95a61e4d3af265cbe7dd9d83f6535da1d103e..f8acafe6d58c429af27a38363e06ad54 bool CanSet(FieldIndex, bool, ContentParent*) { diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp -index 84f2d2960a3fa642754e0c909f92d96865e39984..e91fc85fc7a7966d2d536839fab823ae88d1b4bd 100644 +index b59a70321b6c5801e4a4f916ee303c999747570b..1eded29480eb4b401327da9ed33a63a18e3297b9 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp -@@ -1477,6 +1477,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, +@@ -324,6 +324,8 @@ void CanonicalBrowsingContext::ReplacedBy( + txn.SetHasRestoreData(GetHasRestoreData()); + txn.SetShouldDelayMediaFromStart(GetShouldDelayMediaFromStart()); + txn.SetForceOffline(GetForceOffline()); ++ txn.SetPrefersReducedMotionOverride(GetPrefersReducedMotionOverride()); ++ txn.SetForcedColorsOverride(GetForcedColorsOverride()); + + // Propagate some settings on BrowsingContext replacement so they're not lost + // on bfcached navigations. These are important for GeckoView (see bug +@@ -1594,6 +1596,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, return; } @@ -314,7 +323,7 @@ index 84f2d2960a3fa642754e0c909f92d96865e39984..e91fc85fc7a7966d2d536839fab823ae } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp -index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d878d33643d 100644 +index 354b2c0d66976fd7fd431902bfc7816131602496..7948aa03c8fd865bf7953faaeea2bda84ade04c8 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -15,6 +15,12 @@ @@ -330,15 +339,15 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 #include "mozilla/ArrayUtils.h" #include "mozilla/Attributes.h" #include "mozilla/AutoRestore.h" -@@ -64,6 +70,7 @@ - #include "mozilla/dom/ContentFrameMessageManager.h" +@@ -66,6 +72,7 @@ #include "mozilla/dom/DocGroup.h" #include "mozilla/dom/Element.h" + #include "mozilla/dom/FragmentDirective.h" +#include "mozilla/dom/Geolocation.h" #include "mozilla/dom/HTMLAnchorElement.h" #include "mozilla/dom/HTMLIFrameElement.h" #include "mozilla/dom/PerformanceNavigation.h" -@@ -88,6 +95,7 @@ +@@ -90,6 +97,7 @@ #include "mozilla/dom/JSWindowActorChild.h" #include "mozilla/dom/DocumentBinding.h" #include "mozilla/ipc/ProtocolUtils.h" @@ -346,7 +355,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 #include "mozilla/net/DocumentChannel.h" #include "mozilla/net/DocumentChannelChild.h" #include "mozilla/net/ParentChannelWrapper.h" -@@ -111,6 +119,7 @@ +@@ -113,6 +121,7 @@ #include "nsIDocumentViewer.h" #include "mozilla/dom/Document.h" #include "nsHTMLDocument.h" @@ -354,7 +363,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 #include "nsIDocumentLoaderFactory.h" #include "nsIDOMWindow.h" #include "nsIEditingSession.h" -@@ -206,6 +215,7 @@ +@@ -207,6 +216,7 @@ #include "nsGlobalWindowInner.h" #include "nsGlobalWindowOuter.h" #include "nsJSEnvironment.h" @@ -362,7 +371,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 #include "nsNetCID.h" #include "nsNetUtil.h" #include "nsObjectLoadingContent.h" -@@ -346,6 +356,13 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, +@@ -347,6 +357,13 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, mAllowDNSPrefetch(true), mAllowWindowControl(true), mCSSErrorReportingEnabled(false), @@ -376,7 +385,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 mAllowAuth(mItemType == typeContent), mAllowKeywordFixup(false), mDisableMetaRefreshWhenInactive(false), -@@ -3101,6 +3118,214 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { +@@ -3046,6 +3063,214 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { return NS_OK; } @@ -591,7 +600,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 NS_IMETHODIMP nsDocShell::GetIsNavigating(bool* aOut) { *aOut = mIsNavigating; -@@ -4789,7 +5014,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { +@@ -4734,7 +4959,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { } void nsDocShell::ActivenessMaybeChanged() { @@ -600,7 +609,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 if (RefPtr presShell = GetPresShell()) { presShell->ActivenessMaybeChanged(); } -@@ -6711,6 +6936,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, +@@ -6672,6 +6897,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, return false; // no entry to save into } @@ -611,7 +620,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 MOZ_ASSERT(!mozilla::SessionHistoryInParent(), "mOSHE cannot be non-null with SHIP"); nsCOMPtr viewer = mOSHE->GetDocumentViewer(); -@@ -8443,6 +8672,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { +@@ -8401,6 +8630,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { true, // aForceNoOpener getter_AddRefs(newBC)); MOZ_ASSERT(!newBC); @@ -624,7 +633,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 return rv; } -@@ -9569,6 +9804,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, +@@ -9533,6 +9768,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr); nsCOMPtr req; @@ -641,7 +650,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 rv = DoURILoad(aLoadState, aCacheKey, getter_AddRefs(req)); if (NS_SUCCEEDED(rv)) { -@@ -12732,6 +12977,9 @@ class OnLinkClickEvent : public Runnable { +@@ -12710,6 +12955,9 @@ class OnLinkClickEvent : public Runnable { mHandler->OnLinkClickSync(mContent, mLoadState, mNoOpenerImplied, mTriggeringPrincipal); } @@ -651,7 +660,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 return NS_OK; } -@@ -12816,6 +13064,8 @@ nsresult nsDocShell::OnLinkClick( +@@ -12792,6 +13040,8 @@ nsresult nsDocShell::OnLinkClick( nsCOMPtr ev = new OnLinkClickEvent(this, aContent, loadState, noOpenerImplied, aIsTrusted, aTriggeringPrincipal); @@ -661,7 +670,7 @@ index 3404597343e0d21c42c5adc2f2849888869cf75a..558f03f30672b9f0fdb68ba8d23a0d87 } diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h -index 82ac6c9ab9dbc102a429ab0fe6cb24b8fcdf477f..f6328c25349cf39fcce973adcf908782e8721447 100644 +index 0ea84df4dde885fd8e7f7e6045db56a0fa6b2691..b00bc444a5a25e63f98e583959d5f6812caf1815 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -15,6 +15,7 @@ @@ -705,7 +714,7 @@ index 82ac6c9ab9dbc102a429ab0fe6cb24b8fcdf477f..f6328c25349cf39fcce973adcf908782 // 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 -@@ -1295,6 +1308,16 @@ class nsDocShell final : public nsDocLoader, +@@ -1291,6 +1304,16 @@ class nsDocShell final : public nsDocLoader, bool mAllowDNSPrefetch : 1; bool mAllowWindowControl : 1; bool mCSSErrorReportingEnabled : 1; @@ -723,7 +732,7 @@ index 82ac6c9ab9dbc102a429ab0fe6cb24b8fcdf477f..f6328c25349cf39fcce973adcf908782 bool mAllowKeywordFixup : 1; bool mDisableMetaRefreshWhenInactive : 1; diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl -index 21f09a517e91644f81f5bb823f556c15cd06e51f..a68d30e0a60f03a0942ac1cd8a1f83804fdfd3e0 100644 +index fdc04f16c6f547077ad8c872f9357d85d4513c50..199f8fdb0670265c715f99f5cac1a2b2f22c963d 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -44,6 +44,7 @@ interface nsIURI; @@ -734,7 +743,7 @@ index 21f09a517e91644f81f5bb823f556c15cd06e51f..a68d30e0a60f03a0942ac1cd8a1f8380 interface nsIEditor; interface nsIEditingSession; interface nsIInputStream; -@@ -754,6 +755,36 @@ interface nsIDocShell : nsIDocShellTreeItem +@@ -719,6 +720,36 @@ interface nsIDocShell : nsIDocShellTreeItem */ void synchronizeLayoutHistoryState(); @@ -772,10 +781,10 @@ index 21f09a517e91644f81f5bb823f556c15cd06e51f..a68d30e0a60f03a0942ac1cd8a1f8380 * 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 4e9286a91e3b0f1114aa0a7aa6ff81dde615a73d..941a0c3dac71008ca760024a1e828f75f6af5182 100644 +index c6cb09e1955d371cd19f563b30b486bcc2318304..d836946872b8e32360a925be5084472191e04f05 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp -@@ -3676,6 +3676,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { +@@ -3674,6 +3674,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { } void Document::ApplySettingsFromCSP(bool aSpeculative) { @@ -785,7 +794,7 @@ index 4e9286a91e3b0f1114aa0a7aa6ff81dde615a73d..941a0c3dac71008ca760024a1e828f75 nsresult rv = NS_OK; if (!aSpeculative) { // 1) apply settings from regular CSP -@@ -3733,6 +3736,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { +@@ -3731,6 +3734,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { MOZ_ASSERT(!mScriptGlobalObject, "CSP must be initialized before mScriptGlobalObject is set!"); @@ -797,7 +806,7 @@ index 4e9286a91e3b0f1114aa0a7aa6ff81dde615a73d..941a0c3dac71008ca760024a1e828f75 // If this is a data document - no need to set CSP. if (mLoadedAsData) { return NS_OK; -@@ -4500,6 +4508,10 @@ bool Document::HasFocus(ErrorResult& rv) const { +@@ -4501,6 +4509,10 @@ bool Document::HasFocus(ErrorResult& rv) const { return false; } @@ -808,7 +817,7 @@ index 4e9286a91e3b0f1114aa0a7aa6ff81dde615a73d..941a0c3dac71008ca760024a1e828f75 if (!fm->IsInActiveWindow(bc)) { return false; } -@@ -18849,6 +18861,66 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { +@@ -18878,6 +18890,66 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { return PreferenceSheet::PrefsFor(*this).mColorScheme; } @@ -876,10 +885,10 @@ index 4e9286a91e3b0f1114aa0a7aa6ff81dde615a73d..941a0c3dac71008ca760024a1e828f75 if (!sLoadingForegroundTopLevelContentDocument) { return false; diff --git a/dom/base/Document.h b/dom/base/Document.h -index a52c61addffc4a2344fa06cb0bceebe6a7ca9075..b0f8d65e5341bf277e48bef3b88cb4cc384fbc49 100644 +index 7eea29947d91f6b99363d7bf4c69f4e7b3276636..227314db13631b825b9b0701e8f9e5e630f78a72 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h -@@ -4044,6 +4044,9 @@ class Document : public nsINode, +@@ -4035,6 +4035,9 @@ class Document : public nsINode, // color-scheme meta tag. ColorScheme DefaultColorScheme() const; @@ -890,10 +899,10 @@ index a52c61addffc4a2344fa06cb0bceebe6a7ca9075..b0f8d65e5341bf277e48bef3b88cb4cc static bool AutomaticStorageAccessPermissionCanBeGranted( diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp -index 14a00b8ed85f69312a89990acbb5e0f9755bd832..4b07c28615920a95a2ba59247f8575515cac4235 100644 +index a7229fe412644212747646bee5e111cb427bab52..4fdefb186804ed39d4670cca32e495d95f3546d6 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp -@@ -338,14 +338,18 @@ void Navigator::GetAppName(nsAString& aAppName) const { +@@ -344,14 +344,18 @@ void Navigator::GetAppName(nsAString& aAppName) const { * for more detail. */ /* static */ @@ -914,7 +923,7 @@ index 14a00b8ed85f69312a89990acbb5e0f9755bd832..4b07c28615920a95a2ba59247f857551 // Split values on commas. for (nsDependentSubstring lang : -@@ -397,7 +401,13 @@ void Navigator::GetLanguage(nsAString& aLanguage) { +@@ -403,7 +407,13 @@ void Navigator::GetLanguage(nsAString& aLanguage) { } void Navigator::GetLanguages(nsTArray& aLanguages) { @@ -929,11 +938,21 @@ index 14a00b8ed85f69312a89990acbb5e0f9755bd832..4b07c28615920a95a2ba59247f857551 // The returned value is cached by the binding code. The window listens to the // accept languages change and will clear the cache when needed. It has to +@@ -2308,7 +2318,8 @@ bool Navigator::Webdriver() { + } + #endif + +- return false; ++ // Playwright is automating the browser, so we should pretend to be a webdriver ++ return true; + } + + AutoplayPolicy Navigator::GetAutoplayPolicy(AutoplayPolicyMediaType aType) { diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h -index e559dc4d6aef61b7012a27f3d6c3186a12a15319..9798a50789ce972c4d9e94419e20a5cde4cd552a 100644 +index 4c400554f9b129f4482b513b46b90b780f2b8796..6efdca2363d83327562751757753abd602c80ddd 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h -@@ -215,7 +215,7 @@ class Navigator final : public nsISupports, public nsWrapperCache { +@@ -218,7 +218,7 @@ class Navigator final : public nsISupports, public nsWrapperCache { StorageManager* Storage(); @@ -943,10 +962,10 @@ index e559dc4d6aef61b7012a27f3d6c3186a12a15319..9798a50789ce972c4d9e94419e20a5cd dom::MediaCapabilities* MediaCapabilities(); dom::MediaSession* MediaSession(); diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp -index c6f1687f73df6b1849a191ff8722dc9fc26fc3eb..9fdface27d5c9bd0c61b8af229a31be2356c46b5 100644 +index 1edbffd5353a77fd84bc9abecb0628557512fa67..33376c1d44dbc0561c210e48401d6b173924067d 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp -@@ -8711,7 +8711,8 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8796,7 +8796,8 @@ nsresult nsContentUtils::SendMouseEvent( bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, PreventDefaultResult* aPreventDefault, bool aIsDOMEventSynthesized, @@ -956,7 +975,7 @@ index c6f1687f73df6b1849a191ff8722dc9fc26fc3eb..9fdface27d5c9bd0c61b8af229a31be2 nsPoint offset; nsCOMPtr widget = GetWidget(aPresShell, &offset); if (!widget) return NS_ERROR_FAILURE; -@@ -8719,6 +8720,7 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8804,6 +8805,7 @@ nsresult nsContentUtils::SendMouseEvent( EventMessage msg; Maybe exitFrom; bool contextMenuKey = false; @@ -964,7 +983,7 @@ index c6f1687f73df6b1849a191ff8722dc9fc26fc3eb..9fdface27d5c9bd0c61b8af229a31be2 if (aType.EqualsLiteral("mousedown")) { msg = eMouseDown; } else if (aType.EqualsLiteral("mouseup")) { -@@ -8743,6 +8745,12 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8828,6 +8830,12 @@ nsresult nsContentUtils::SendMouseEvent( msg = eMouseHitTest; } else if (aType.EqualsLiteral("MozMouseExploreByTouch")) { msg = eMouseExploreByTouch; @@ -977,7 +996,7 @@ index c6f1687f73df6b1849a191ff8722dc9fc26fc3eb..9fdface27d5c9bd0c61b8af229a31be2 } else { return NS_ERROR_FAILURE; } -@@ -8751,12 +8759,21 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8836,12 +8844,21 @@ nsresult nsContentUtils::SendMouseEvent( aInputSourceArg = MouseEvent_Binding::MOZ_SOURCE_MOUSE; } @@ -1001,7 +1020,7 @@ index c6f1687f73df6b1849a191ff8722dc9fc26fc3eb..9fdface27d5c9bd0c61b8af229a31be2 event.pointerId = aIdentifier; event.mModifiers = GetWidgetModifiers(aModifiers); event.mButton = aButton; -@@ -8767,8 +8784,10 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8852,8 +8869,10 @@ nsresult nsContentUtils::SendMouseEvent( event.mPressure = aPressure; event.mInputSource = aInputSourceArg; event.mClickCount = aClickCount; @@ -1013,10 +1032,10 @@ index c6f1687f73df6b1849a191ff8722dc9fc26fc3eb..9fdface27d5c9bd0c61b8af229a31be2 nsPresContext* presContext = aPresShell->GetPresContext(); if (!presContext) return NS_ERROR_FAILURE; diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h -index 338fc097dede02a538f240ba4cc66307086c7f56..8345e47237bc40490bd17019a053cce4c3d74a91 100644 +index ef3c1fd7cbb3a6c457ec7d70a50fd412077f4279..bd4e6e5db6273f024684169439fd31e0095b45f4 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h -@@ -3055,7 +3055,8 @@ class nsContentUtils { +@@ -3078,7 +3078,8 @@ class nsContentUtils { int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, mozilla::PreventDefaultResult* aPreventDefault, @@ -1027,10 +1046,10 @@ index 338fc097dede02a538f240ba4cc66307086c7f56..8345e47237bc40490bd17019a053cce4 static void FirePageShowEventForFrameLoaderSwap( nsIDocShellTreeItem* aItem, diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp -index 9bc8340b9009717e0feecd5c14ff02be07a03daf..70ea04c7f11e6ccfadf72a82ec1741fac10ef5fd 100644 +index 6d611b4a8485325435267c89c88b5511bb37d2f2..13640d6bd8fc34797f5f0088bf12ff016b4b3ae7 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp -@@ -685,6 +685,26 @@ nsDOMWindowUtils::GetPresShellId(uint32_t* aPresShellId) { +@@ -684,6 +684,26 @@ nsDOMWindowUtils::GetPresShellId(uint32_t* aPresShellId) { return NS_ERROR_FAILURE; } @@ -1057,7 +1076,7 @@ index 9bc8340b9009717e0feecd5c14ff02be07a03daf..70ea04c7f11e6ccfadf72a82ec1741fa NS_IMETHODIMP nsDOMWindowUtils::SendMouseEvent( const nsAString& aType, float aX, float aY, int32_t aButton, -@@ -699,7 +719,7 @@ nsDOMWindowUtils::SendMouseEvent( +@@ -698,7 +718,7 @@ nsDOMWindowUtils::SendMouseEvent( aOptionalArgCount >= 7 ? aIdentifier : DEFAULT_MOUSE_POINTER_ID, false, aPreventDefault, aOptionalArgCount >= 4 ? aIsDOMEventSynthesized : true, aOptionalArgCount >= 5 ? aIsWidgetEventSynthesized : false, @@ -1066,7 +1085,7 @@ index 9bc8340b9009717e0feecd5c14ff02be07a03daf..70ea04c7f11e6ccfadf72a82ec1741fa } NS_IMETHODIMP -@@ -717,7 +737,7 @@ nsDOMWindowUtils::SendMouseEventToWindow( +@@ -716,7 +736,7 @@ nsDOMWindowUtils::SendMouseEventToWindow( aOptionalArgCount >= 7 ? aIdentifier : DEFAULT_MOUSE_POINTER_ID, true, nullptr, aOptionalArgCount >= 4 ? aIsDOMEventSynthesized : true, aOptionalArgCount >= 5 ? aIsWidgetEventSynthesized : false, @@ -1075,7 +1094,7 @@ index 9bc8340b9009717e0feecd5c14ff02be07a03daf..70ea04c7f11e6ccfadf72a82ec1741fa } NS_IMETHODIMP -@@ -726,13 +746,13 @@ nsDOMWindowUtils::SendMouseEventCommon( +@@ -725,13 +745,13 @@ nsDOMWindowUtils::SendMouseEventCommon( int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aPointerId, bool aToWindow, bool* aPreventDefault, bool aIsDOMEventSynthesized, @@ -1105,10 +1124,10 @@ index 63968c9b7a4e418e4c0de6e7a75fa215a36a9105..decf3ea3833ccdffd49a7aded2d600f9 MOZ_CAN_RUN_SCRIPT nsresult SendTouchEventCommon( diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp -index 5a4cf78d65eee0adcbeca33787706113eca19de7..7c8016e422ccc9e86563eaa83c9acc1dad0e5967 100644 +index 587f03849d72d72020e89f4456dec481c9ede9f6..d0a910d3ae25fd4f6545f6d9130c8be04a06ed0e 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp -@@ -1675,6 +1675,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, +@@ -1684,6 +1684,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, (GetActiveBrowsingContext() == newRootBrowsingContext); } @@ -1119,7 +1138,7 @@ index 5a4cf78d65eee0adcbeca33787706113eca19de7..7c8016e422ccc9e86563eaa83c9acc1d // Exit fullscreen if a website focuses another window if (StaticPrefs::full_screen_api_exit_on_windowRaise() && !isElementInActiveWindow && (aFlags & FLAG_RAISE)) { -@@ -2242,6 +2246,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2269,6 +2273,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, bool aIsLeavingDocument, bool aAdjustWidget, bool aRemainActive, Element* aElementToFocus, uint64_t aActionId) { @@ -1127,7 +1146,7 @@ index 5a4cf78d65eee0adcbeca33787706113eca19de7..7c8016e422ccc9e86563eaa83c9acc1d LOGFOCUS(("<>", aActionId)); // hold a reference to the focused content, which may be null -@@ -2288,6 +2293,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2315,6 +2320,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, return true; } @@ -1139,7 +1158,7 @@ index 5a4cf78d65eee0adcbeca33787706113eca19de7..7c8016e422ccc9e86563eaa83c9acc1d // Keep a ref to presShell since dispatching the DOM event may cause // the document to be destroyed. RefPtr presShell = docShell->GetPresShell(); -@@ -2947,7 +2957,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, +@@ -2992,7 +3002,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, } } @@ -1151,10 +1170,10 @@ index 5a4cf78d65eee0adcbeca33787706113eca19de7..7c8016e422ccc9e86563eaa83c9acc1d // 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 e28dcdb092b23558702377af32eece5d273d4cf3..a37ae9d6ccd978d5e84562450e7039d6a75d517b 100644 +index 460ccc17f2cd34f172215aaf5616badaa44f8ca5..d294373ca9b8987dd8bf056f4dae72c27903dcd7 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp -@@ -2509,10 +2509,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, +@@ -2514,10 +2514,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, }(); if (!isContentAboutBlankInChromeDocshell) { @@ -1175,7 +1194,7 @@ index e28dcdb092b23558702377af32eece5d273d4cf3..a37ae9d6ccd978d5e84562450e7039d6 } } -@@ -2632,6 +2638,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() { +@@ -2637,6 +2643,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() { } } @@ -1196,10 +1215,10 @@ index e28dcdb092b23558702377af32eece5d273d4cf3..a37ae9d6ccd978d5e84562450e7039d6 void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) { diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h -index 8337a7353fb8e97372f0b57bd0fd867506a9129f..e7dedd6d26125e481e1145337a0be6ab864c1e1b 100644 +index 0039d6d91b23953afbd6aec2b4d1f064db3c3b1c..7a6c5da16651d34ea60c69331365d94886da1993 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h -@@ -315,6 +315,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, +@@ -314,6 +314,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, // Outer windows only. void DispatchDOMWindowCreated(); @@ -1208,10 +1227,10 @@ index 8337a7353fb8e97372f0b57bd0fd867506a9129f..e7dedd6d26125e481e1145337a0be6ab // Outer windows only. virtual void EnsureSizeAndPositionUpToDate() override; diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp -index d5455e559639aee9328905b50f02c52e94db950b..3fbd1e0459e5391066fc6b3a4e30a841594b31bf 100644 +index 600fce143a0e1e35a18b980211686436be08533f..ec6f7c60d0a3756dcf8892e4690281e1a65f9b6a 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp -@@ -1365,6 +1365,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, +@@ -1387,6 +1387,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, mozilla::GetBoxQuadsFromWindowOrigin(this, aOptions, aResult, aRv); } @@ -1274,10 +1293,10 @@ index d5455e559639aee9328905b50f02c52e94db950b..3fbd1e0459e5391066fc6b3a4e30a841 DOMQuad& aQuad, const GeometryNode& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h -index 3a47992cc89176fe9500f7b1d5b74e4422cb9625..27e6da8498af5e4a3c37407a3a8ab592e28dc372 100644 +index 2906bbb56c86cd287620b4bd067366f6703299d7..06697f07c7544c816181fa9849ce178bf38303aa 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h -@@ -2248,6 +2248,10 @@ class nsINode : public mozilla::dom::EventTarget { +@@ -2282,6 +2282,10 @@ class nsINode : public mozilla::dom::EventTarget { nsTArray>& aResult, ErrorResult& aRv); @@ -1458,7 +1477,7 @@ index 7e1af00d05fbafa2d828e2c7e4dcc5c82d115f5b..e85af9718d064e4d2865bc944e9d4ba1 ~Geolocation(); diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp -index d5a65a17555b7764611803f7fb298712b2c60fd7..fdee7deaf0b14e01702b902f8b73256c281e76b8 100644 +index 30093e5d408caa054a04adddf63ce2bec384eed6..2852746b6f5b50981dba29a65ce25c1fd55390e3 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -57,6 +57,7 @@ @@ -1484,7 +1503,7 @@ index d5a65a17555b7764611803f7fb298712b2c60fd7..fdee7deaf0b14e01702b902f8b73256c return NS_OK; } diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl -index 6a0df1b435cee9cea3b7d7ca30d0aff0e31f8ac0..c17b24823dd873c025e407fcc635b7c678dfd8ed 100644 +index 9d185e8e7edcde63f0d2e0c05a32dfddaf71609c..9d48d2e33575c7f214152c6f8140f9a3a3313b44 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -373,6 +373,26 @@ interface nsIDOMWindowUtils : nsISupports { @@ -1515,10 +1534,10 @@ index 6a0df1b435cee9cea3b7d7ca30d0aff0e31f8ac0..c17b24823dd873c025e407fcc635b7c6 * touchstart, touchend, touchmove, and touchcancel * diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp -index bdd10fdcb285e43778b55907ac05bfa973207e5e..d98808918ff8eccd6c51b4fbce1cce5e3745206a 100644 +index 27fb1239dbd2a635688d022602d4a49dfff0560a..39f9dd48eef038503a50632c5e1395fecea6cae3 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp -@@ -1652,6 +1652,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, +@@ -1639,6 +1639,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, if (postLayerization) { postLayerization->Register(); } @@ -1555,15 +1574,12 @@ index 5aa445d2e0a6169e57c44569974d557b3baf7064..671f71979b407f0ca17c66f13805e851 } diff --git a/dom/media/systemservices/video_engine/desktop_capture_impl.cc b/dom/media/systemservices/video_engine/desktop_capture_impl.cc -index a966ff06d4a52e2ff70ce71df3a6a607a67e3eda..eb6bb16413df43217ddd85048c02d41d15e8431f 100644 +index d4b40fda96ea759eb92e1351e1046a9e0b85689b..b2123a3be05b2622a5e07d5ee32752d0feaaa57f 100644 --- a/dom/media/systemservices/video_engine/desktop_capture_impl.cc +++ b/dom/media/systemservices/video_engine/desktop_capture_impl.cc -@@ -135,11 +135,12 @@ int32_t ScreenDeviceInfoImpl::GetOrientation(const char* aDeviceUniqueIdUTF8, - return 0; - } +@@ -137,9 +137,10 @@ int32_t ScreenDeviceInfoImpl::GetOrientation(const char* aDeviceUniqueIdUTF8, --VideoCaptureModule* DesktopCaptureImpl::Create(const int32_t aModuleId, -+VideoCaptureModuleEx* DesktopCaptureImpl::Create(const int32_t aModuleId, + DesktopCaptureImpl* DesktopCaptureImpl::Create(const int32_t aModuleId, const char* aUniqueId, - const CaptureDeviceType aType) { + const CaptureDeviceType aType, @@ -1643,7 +1659,7 @@ index a966ff06d4a52e2ff70ce71df3a6a607a67e3eda..eb6bb16413df43217ddd85048c02d41d MOZ_ASSERT(!capturer == !mCaptureThread); if (!capturer) { -@@ -654,6 +672,15 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult, +@@ -663,6 +681,15 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult, frameInfo.height = aFrame->size().height(); frameInfo.videoType = VideoType::kARGB; @@ -1660,18 +1676,18 @@ index a966ff06d4a52e2ff70ce71df3a6a607a67e3eda..eb6bb16413df43217ddd85048c02d41d frameInfo.width * frameInfo.height * DesktopFrame::kBytesPerPixel; diff --git a/dom/media/systemservices/video_engine/desktop_capture_impl.h b/dom/media/systemservices/video_engine/desktop_capture_impl.h -index 7292f6c8a70298d4bf103080804843fa9bba1d15..7a50fee0d2fcaad475302d010892800a6e3c4e75 100644 +index 9aebaa39321839eb3beb503fc4ed33e303bb0deb..1dd75f3cdb8078b01c4d43a0ac3d8a6ea3ec47ab 100644 --- a/dom/media/systemservices/video_engine/desktop_capture_impl.h +++ b/dom/media/systemservices/video_engine/desktop_capture_impl.h -@@ -24,6 +24,7 @@ - #include "api/video/video_sink_interface.h" +@@ -25,6 +25,7 @@ #include "modules/desktop_capture/desktop_capturer.h" #include "modules/video_capture/video_capture.h" + #include "rtc_base/synchronization/mutex.h" +#include "rtc_base/deprecated/recursive_critical_section.h" #include "desktop_device_info.h" - #include "mozilla/DataMutex.h" -@@ -43,6 +44,21 @@ namespace webrtc { + #include "MediaEngineSource.h" +@@ -45,6 +46,33 @@ namespace webrtc { class VideoCaptureEncodeInterface; @@ -1688,12 +1704,24 @@ index 7292f6c8a70298d4bf103080804843fa9bba1d15..7a50fee0d2fcaad475302d010892800a + + virtual void RegisterRawFrameCallback(RawFrameCallback* rawFrameCallback) = 0; + virtual void DeRegisterRawFrameCallback(RawFrameCallback* rawFrameCallback) = 0; ++ int32_t StartCaptureCounted(const VideoCaptureCapability& aCapability) { ++ ++capture_counter_; ++ return capture_counter_ == 1 ? StartCapture(aCapability) : 0; ++ } ++ ++ int32_t StopCaptureCounted() { ++ --capture_counter_; ++ return capture_counter_ == 0 ? StopCapture() : 0; ++ } ++ ++ private: ++ int32_t capture_counter_ = 0; +}; + // simulate deviceInfo interface for video engine, bridge screen/application and // real screen/application device info -@@ -158,13 +174,13 @@ class BrowserDeviceInfoImpl : public VideoCaptureModule::DeviceInfo { +@@ -160,13 +188,13 @@ class BrowserDeviceInfoImpl : public VideoCaptureModule::DeviceInfo { // As with video, DesktopCaptureImpl is a proxy for screen sharing // and follows the video pipeline design class DesktopCaptureImpl : public DesktopCapturer::Callback, @@ -1702,15 +1730,14 @@ index 7292f6c8a70298d4bf103080804843fa9bba1d15..7a50fee0d2fcaad475302d010892800a public: /* Create a screen capture modules object */ -- static VideoCaptureModule* Create( -+ static VideoCaptureModuleEx* Create( + static DesktopCaptureImpl* Create( const int32_t aModuleId, const char* aUniqueId, - const mozilla::camera::CaptureDeviceType aType); + const mozilla::camera::CaptureDeviceType aType, bool aCaptureCursor = true); [[nodiscard]] static std::shared_ptr CreateDeviceInfo(const int32_t aId, -@@ -178,6 +194,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -180,6 +208,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, void DeRegisterCaptureDataCallback( rtc::VideoSinkInterface* aCallback) override; int32_t StopCaptureIfAllClientsClose() override; @@ -1719,7 +1746,7 @@ index 7292f6c8a70298d4bf103080804843fa9bba1d15..7a50fee0d2fcaad475302d010892800a int32_t SetCaptureRotation(VideoRotation aRotation) override; bool SetApplyRotation(bool aEnable) override; -@@ -200,7 +218,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -203,7 +233,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, protected: DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, @@ -1729,7 +1756,7 @@ index 7292f6c8a70298d4bf103080804843fa9bba1d15..7a50fee0d2fcaad475302d010892800a virtual ~DesktopCaptureImpl(); private: -@@ -208,6 +227,9 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -211,6 +242,9 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, static constexpr uint32_t kMaxDesktopCaptureCpuUsage = 50; void InitOnThread(std::unique_ptr aCapturer, int aFramerate); void ShutdownOnThread(); @@ -1739,7 +1766,7 @@ index 7292f6c8a70298d4bf103080804843fa9bba1d15..7a50fee0d2fcaad475302d010892800a // DesktopCapturer::Callback interface. void OnCaptureResult(DesktopCapturer::Result aResult, std::unique_ptr aFrame) override; -@@ -215,6 +237,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, +@@ -218,6 +252,8 @@ class DesktopCaptureImpl : public DesktopCapturer::Callback, // Notifies all mCallbacks of OnFrame(). mCaptureThread only. void NotifyOnFrame(const VideoFrame& aFrame); @@ -1793,7 +1820,7 @@ index 3b39538e51840cd9b1685b2efd2ff2e9ec83608a..c7bf4f2d53b58bbacb22b3ebebf6f3fc return aGlobalOrNull; diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp -index 11d09909f73fee425fd0f50b384c396a52e02a36..b0e668881bcd3b850de709ebf2557ae8391b8fe8 100644 +index f4aecfaf44d40d651f816c56db4b46c605754132..ef017504972454c12de7d6a7ff38a76a8253a62d 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -22,6 +22,7 @@ @@ -1802,9 +1829,9 @@ index 11d09909f73fee425fd0f50b384c396a52e02a36..b0e668881bcd3b850de709ebf2557ae8 #include "nsWhitespaceTokenizer.h" +#include "nsDocShell.h" + #include "mozilla/Assertions.h" #include "mozilla/Components.h" - #include "mozilla/dom/CSPDictionariesBinding.h" -@@ -132,6 +133,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, +@@ -133,6 +134,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, return; } @@ -1840,10 +1867,10 @@ index 2f71b284ee5f7e11f117c447834b48355784448c..2640bd57123c2b03bf4b06a2419cd020 * 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 02efb1205382850b41c38d5f6ee47092adcdc63e..28c8d05d0b5cc415f3d13a4588248f3844faf4f2 100644 +index 4a7ebb25233ce685e73d53085e22337e9ad8bc59..0b7b24a4da5511ff2fa6695eb55f5533b2e574ab 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp -@@ -995,7 +995,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { +@@ -998,7 +998,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { AssertIsOnMainThread(); nsTArray languages; @@ -1852,7 +1879,7 @@ index 02efb1205382850b41c38d5f6ee47092adcdc63e..28c8d05d0b5cc415f3d13a4588248f38 RuntimeService* runtime = RuntimeService::GetService(); if (runtime) { -@@ -1182,8 +1182,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { +@@ -1185,8 +1185,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { } // The navigator overridden properties should have already been read. @@ -1862,7 +1889,7 @@ index 02efb1205382850b41c38d5f6ee47092adcdc63e..28c8d05d0b5cc415f3d13a4588248f38 mNavigatorPropertiesLoaded = true; } -@@ -1789,6 +1788,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( +@@ -1795,6 +1794,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( } } @@ -1876,7 +1903,7 @@ index 02efb1205382850b41c38d5f6ee47092adcdc63e..28c8d05d0b5cc415f3d13a4588248f38 template void RuntimeService::BroadcastAllWorkers(const Func& aFunc) { AssertIsOnMainThread(); -@@ -2304,6 +2310,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( +@@ -2314,6 +2320,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( } } @@ -1918,7 +1945,7 @@ index d10dabb5c5ff8e17851edf2bd2efc08e74584d8e..53c4070c5fde43b27fb8fbfdcf4c23d8 bool IsWorkerGlobal(JSObject* global); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp -index a8643981aa966e9324a5dbdb09b4fe57210dc581..5120df2607584a7cd50ea03aa997ef5ade5c8ee2 100644 +index 7fbfdb0eeed2fc9d9a6ba12192150d5bdeed40b3..c31ae2724d09036ec2ba0b71cd94f648e9b90868 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -682,6 +682,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable { @@ -1928,7 +1955,7 @@ index a8643981aa966e9324a5dbdb09b4fe57210dc581..5120df2607584a7cd50ea03aa997ef5a +class ResetDefaultLocaleRunnable final : public WorkerControlRunnable { + public: + explicit ResetDefaultLocaleRunnable(WorkerPrivate* aWorkerPrivate) -+ : WorkerControlRunnable(aWorkerPrivate, "ResetDefaultLocaleRunnable", WorkerThread) {} ++ : WorkerControlRunnable("ResetDefaultLocaleRunnable") {} + + virtual bool WorkerRun(JSContext* aCx, + WorkerPrivate* aWorkerPrivate) override { @@ -1937,10 +1964,10 @@ index a8643981aa966e9324a5dbdb09b4fe57210dc581..5120df2607584a7cd50ea03aa997ef5a + } +}; + - class UpdateLanguagesRunnable final : public WorkerRunnable { + class UpdateLanguagesRunnable final : public WorkerThreadRunnable { nsTArray mLanguages; -@@ -1993,6 +2005,16 @@ void WorkerPrivate::UpdateContextOptions( +@@ -2091,6 +2103,16 @@ void WorkerPrivate::UpdateContextOptions( } } @@ -1949,7 +1976,7 @@ index a8643981aa966e9324a5dbdb09b4fe57210dc581..5120df2607584a7cd50ea03aa997ef5a + + RefPtr runnable = + new ResetDefaultLocaleRunnable(this); -+ if (!runnable->Dispatch()) { ++ if (!runnable->Dispatch(this)) { + NS_WARNING("Failed to reset default locale in worker!"); + } +} @@ -1957,7 +1984,7 @@ index a8643981aa966e9324a5dbdb09b4fe57210dc581..5120df2607584a7cd50ea03aa997ef5a void WorkerPrivate::UpdateLanguages(const nsTArray& aLanguages) { AssertIsOnParentThread(); -@@ -5489,6 +5511,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( +@@ -5667,6 +5689,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( } } @@ -1974,10 +2001,10 @@ index a8643981aa966e9324a5dbdb09b4fe57210dc581..5120df2607584a7cd50ea03aa997ef5a const nsTArray& aLanguages) { WorkerGlobalScope* globalScope = GlobalScope(); diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h -index a670d009759d101cf9574cde3c2481b8aa2737f6..ac87b7f27dfcc060adb52387b146c45eed996fa7 100644 +index 57212e01fb75da52187195acfbe052b19464286a..bc75882ee661d5c987187cd11b388443227d59bc 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h -@@ -417,6 +417,8 @@ class WorkerPrivate final +@@ -418,6 +418,8 @@ class WorkerPrivate final void UpdateContextOptionsInternal(JSContext* aCx, const JS::ContextOptions& aContextOptions); @@ -1986,7 +2013,7 @@ index a670d009759d101cf9574cde3c2481b8aa2737f6..ac87b7f27dfcc060adb52387b146c45e void UpdateLanguagesInternal(const nsTArray& aLanguages); void UpdateJSWorkerMemoryParameterInternal(JSContext* aCx, JSGCParamKey key, -@@ -1036,6 +1038,8 @@ class WorkerPrivate final +@@ -1045,6 +1047,8 @@ class WorkerPrivate final void UpdateContextOptions(const JS::ContextOptions& aContextOptions); @@ -2022,10 +2049,10 @@ index 7a069ef0c59895cf1f8dc35d612f1494c9c9f1ef..5b09dfdcc5323def65c35b0696141b44 Span aTimeZone) { #if MOZ_INTL_USE_ICU_CPP_TIMEZONE diff --git a/intl/components/src/TimeZone.h b/intl/components/src/TimeZone.h -index 9d0423ef13958d5c443cc3531269603c4801c338..f0c4ba7c528d2be466e0f7669a1e37e876f9091e 100644 +index 89770839ae108b5f3462a7f20684fdb72c4ab2fb..a7e40d6b7c33c234b41e586eac573ba4ce3a7d18 100644 --- a/intl/components/src/TimeZone.h +++ b/intl/components/src/TimeZone.h -@@ -190,6 +190,8 @@ class TimeZone final { +@@ -191,6 +191,8 @@ class TimeZone final { return FillBufferWithICUCall(aBuffer, ucal_getHostTimeZone); } @@ -2048,7 +2075,7 @@ index 523e84c8c93f4221701f90f2e8ee146ec8e1adbd..98d5b1176e5378431b859a2dbd4d4e77 inline ClippedTime TimeClip(double time); diff --git a/js/src/debugger/Object.cpp b/js/src/debugger/Object.cpp -index 17528b0fd99ce8274e702746ff5674de4c3d4f2d..37fa52ae07381bec3504136b9bec0aa1ca110d6b 100644 +index 6ca6c31830066f9677988daca8566e93a8335c26..3f963dbf6127c997810e380802e56b023b5db4c8 100644 --- a/js/src/debugger/Object.cpp +++ b/js/src/debugger/Object.cpp @@ -2468,7 +2468,11 @@ Maybe DebuggerObject::call(JSContext* cx, @@ -2064,7 +2091,7 @@ index 17528b0fd99ce8274e702746ff5674de4c3d4f2d..37fa52ae07381bec3504136b9bec0aa1 } diff --git a/js/src/vm/DateTime.cpp b/js/src/vm/DateTime.cpp -index 21ecc2e9f50a16357ace3320335d31a4929fc146..c4b1444ce53b20a700d2ff9f18521bd67623e7d2 100644 +index 623a6863a54fb0d653ebe55fd83356f1a8c8be15..1c0ef7b0d3ee2f61de728a68dd704a5d09757b38 100644 --- a/js/src/vm/DateTime.cpp +++ b/js/src/vm/DateTime.cpp @@ -186,6 +186,11 @@ void js::DateTimeInfo::internalResetTimeZone(ResetTimeZoneMode mode) { @@ -2079,7 +2106,7 @@ index 21ecc2e9f50a16357ace3320335d31a4929fc146..c4b1444ce53b20a700d2ff9f18521bd6 void js::DateTimeInfo::updateTimeZone() { MOZ_ASSERT(timeZoneStatus_ != TimeZoneStatus::Valid); -@@ -527,10 +532,24 @@ void js::ResetTimeZoneInternal(ResetTimeZoneMode mode) { +@@ -529,10 +534,24 @@ void js::ResetTimeZoneInternal(ResetTimeZoneMode mode) { js::DateTimeInfo::resetTimeZone(mode); } @@ -2104,7 +2131,7 @@ index 21ecc2e9f50a16357ace3320335d31a4929fc146..c4b1444ce53b20a700d2ff9f18521bd6 #if JS_HAS_INTL_API # if defined(XP_WIN) static bool IsOlsonCompatibleWindowsTimeZoneId(std::string_view tz) { -@@ -748,6 +767,15 @@ static bool ReadTimeZoneLink(std::string_view tz, +@@ -750,6 +769,15 @@ static bool ReadTimeZoneLink(std::string_view tz, void js::DateTimeInfo::internalResyncICUDefaultTimeZone() { #if JS_HAS_INTL_API @@ -2120,7 +2147,7 @@ index 21ecc2e9f50a16357ace3320335d31a4929fc146..c4b1444ce53b20a700d2ff9f18521bd6 // In the future we should not be setting a default ICU time zone at all, // instead all accesses should go through the appropriate DateTimeInfo // instance depending on the resist fingerprinting status. For now we return -@@ -759,7 +787,6 @@ void js::DateTimeInfo::internalResyncICUDefaultTimeZone() { +@@ -761,7 +789,6 @@ void js::DateTimeInfo::internalResyncICUDefaultTimeZone() { if (const char* tzenv = std::getenv("TZ")) { std::string_view tz(tzenv); @@ -2168,7 +2195,7 @@ index fd6d7ae078b8f6b3cc46a4a993a1e044a7128c90..4743094e489122dd9ee8ab9a7a175dd7 void internalResyncICUDefaultTimeZone(); diff --git a/layout/base/GeometryUtils.cpp b/layout/base/GeometryUtils.cpp -index dac899f7558b26d6848da8b98ed8a93555c8751a..2a07d67fa1c2840b25085566e84dc3b2d9b789cf 100644 +index 0ec6ee3eb37c6493d8a25352fd0e54e1927bceab..885dba71bc5815e5f6f3ec2700c376aa119b30d0 100644 --- a/layout/base/GeometryUtils.cpp +++ b/layout/base/GeometryUtils.cpp @@ -23,6 +23,7 @@ @@ -2218,10 +2245,10 @@ index dac899f7558b26d6848da8b98ed8a93555c8751a..2a07d67fa1c2840b25085566e84dc3b2 // No boxes to return return; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp -index 31c21c337786b76306029149a925293a44c45c28..7aa4eb0b4980bb8ecdc4e10c91b1cd70e5d0ad08 100644 +index 6e588cff05c8d6fdaec53a980fce1bc8d2141953..a173b1154e171d7fa5454b27baf85f72a09501a6 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp -@@ -11127,7 +11127,9 @@ bool PresShell::ComputeActiveness() const { +@@ -11063,7 +11063,9 @@ bool PresShell::ComputeActiveness() const { if (!browserChild->IsVisible()) { MOZ_LOG(gLog, LogLevel::Debug, (" > BrowserChild %p is not visible", browserChild)); @@ -2232,11 +2259,36 @@ index 31c21c337786b76306029149a925293a44c45c28..7aa4eb0b4980bb8ecdc4e10c91b1cd70 } // 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 2ed62888d70663f3560fcaa9bc29ff98cb44c323..f5540c38df6a064094e013c841d943c63049dd75 100644 +--- a/layout/base/nsLayoutUtils.cpp ++++ b/layout/base/nsLayoutUtils.cpp +@@ -698,6 +698,10 @@ bool nsLayoutUtils::AllowZoomingForDocument( + !aDocument->GetPresShell()->AsyncPanZoomEnabled()) { + return false; + } ++ ++ /* Playwright: disable zooming as we don't support meta viewport tag */ ++ if (1 == 1) return false; ++ + // True if we allow zooming for all documents on this platform, or if we are + // in RDM. + BrowsingContext* bc = aDocument->GetBrowsingContext(); +@@ -9794,6 +9798,9 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont, + + /* static */ + bool nsLayoutUtils::ShouldHandleMetaViewport(const Document* aDocument) { ++ /* Playwright: disable meta viewport handling since we don't require one */ ++ if (1 == 1) return false; ++ + BrowsingContext* bc = aDocument->GetBrowsingContext(); + return StaticPrefs::dom_meta_viewport_enabled() || (bc && bc->InRDMPane()); + } diff --git a/layout/style/GeckoBindings.h b/layout/style/GeckoBindings.h -index 7bb839ae18835d128dc9285b7f9dc5b5e06335af..09e3979d07447522ace740daf2b818a6c551ceba 100644 +index d273793fc8d92b5c19ec0562730eab249cc41eb8..46b4078c6031318265a8338e01f52ab60bd9c0e8 100644 --- a/layout/style/GeckoBindings.h +++ b/layout/style/GeckoBindings.h -@@ -625,6 +625,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*); @@ -2245,7 +2297,7 @@ index 7bb839ae18835d128dc9285b7f9dc5b5e06335af..09e3979d07447522ace740daf2b818a6 const mozilla::dom::Document*); mozilla::StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme( diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp -index f888c127d4423336a8f51e2011fc42eaf6c33f11..51d6e069f4a81c42b4bf270ba44ae4f82b8df592 100644 +index cc86d1abf6ccfe48530607c41cd675612cbe5582..8cce20c719fee8a0480ae6ea1fd53c6639d0bd7b 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -260,11 +260,11 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) { @@ -2266,10 +2318,10 @@ index f888c127d4423336a8f51e2011fc42eaf6c33f11..51d6e069f4a81c42b4bf270ba44ae4f8 bool Gecko_MediaFeatures_PrefersReducedTransparency(const Document* aDocument) { diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp -index eb90324c37ce515e5a0fcf75412605ae57ead9ee..6733dd6c99d77399529945386caa3926960e4176 100644 +index 5ff1c5ad8b265f25ab5a18a639e4e5b420d93443..a788218d4f281daee274d14b7dd15f4c19eeddce 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp -@@ -653,7 +653,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) +@@ -691,7 +691,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) mInterceptionInfo(rhs.mInterceptionInfo), mHasInjectedCookieForCookieBannerHandling( rhs.mHasInjectedCookieForCookieBannerHandling), @@ -2279,7 +2331,7 @@ index eb90324c37ce515e5a0fcf75412605ae57ead9ee..6733dd6c99d77399529945386caa3926 } LoadInfo::LoadInfo( -@@ -2369,4 +2370,16 @@ LoadInfo::SetWasSchemelessInput(bool aWasSchemelessInput) { +@@ -2416,4 +2417,16 @@ LoadInfo::SetWasSchemelessInput(bool aWasSchemelessInput) { return NS_OK; } @@ -2297,10 +2349,10 @@ index eb90324c37ce515e5a0fcf75412605ae57ead9ee..6733dd6c99d77399529945386caa3926 + } // namespace mozilla::net diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h -index a8631b09b26708ca10f683f1a9dd6b8467d3fe8e..a0bd72113e3539d815d32382946581ee62f39b6c 100644 +index e6badeeee816bc74af22fb9ef5f88b58f13ac5b7..994216ee9b26e7cbc85b948165051d5d2bc7efb1 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h -@@ -401,6 +401,8 @@ class LoadInfo final : public nsILoadInfo { +@@ -408,6 +408,8 @@ class LoadInfo final : public nsILoadInfo { bool mHasInjectedCookieForCookieBannerHandling = false; bool mWasSchemelessInput = false; @@ -2310,10 +2362,10 @@ index a8631b09b26708ca10f683f1a9dd6b8467d3fe8e..a0bd72113e3539d815d32382946581ee // 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 920e7623a7f912296fc23361f66ab35a30c35f1e..dfea0d0f7a72da9699615d7ff778e429e7ae40fb 100644 +index 48560a8b3be4ace3aab241373ff1eab0e5bb2187..b2114472b04b4e837b1c7b080ce8718f5f67f43b 100644 --- a/netwerk/base/TRRLoadInfo.cpp +++ b/netwerk/base/TRRLoadInfo.cpp -@@ -861,5 +861,15 @@ TRRLoadInfo::SetWasSchemelessInput(bool aWasSchemelessInput) { +@@ -870,5 +870,15 @@ TRRLoadInfo::SetWasSchemelessInput(bool aWasSchemelessInput) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -2330,10 +2382,10 @@ index 920e7623a7f912296fc23361f66ab35a30c35f1e..dfea0d0f7a72da9699615d7ff778e429 } // namespace net } // namespace mozilla diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl -index ddfcb223e6126c943b58e9d198f0e2fa767c3de1..4280b836c55e5778ad4c94226ea537facb19c436 100644 +index 8ff5e556c98689542297517a7bdf57e0a2ccf400..b1429dbe180cbc84cf467991bb24124f5857d62b 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl -@@ -1532,4 +1532,6 @@ interface nsILoadInfo : nsISupports +@@ -1544,4 +1544,6 @@ interface nsILoadInfo : nsISupports * Whether the load has gone through the URL bar, where the fixup had to add * the protocol scheme. */ [infallible] attribute boolean wasSchemelessInput; @@ -2341,7 +2393,7 @@ index ddfcb223e6126c943b58e9d198f0e2fa767c3de1..4280b836c55e5778ad4c94226ea537fa + [infallible] attribute unsigned long long jugglerLoadIdentifier; }; diff --git a/netwerk/base/nsINetworkInterceptController.idl b/netwerk/base/nsINetworkInterceptController.idl -index 155daa5cd52c4e93e1cc4559875868f4faf2c37e..02e8a2614a27a4cc9e1de760d4c48617eba25d4d 100644 +index 7f91d2df6f8bb4020c75c132dc8f6bf26625fa1e..ba6569f4be8fc54ec96ee44d5de45a0904c077ba 100644 --- a/netwerk/base/nsINetworkInterceptController.idl +++ b/netwerk/base/nsINetworkInterceptController.idl @@ -59,6 +59,7 @@ interface nsIInterceptedChannel : nsISupports @@ -2353,10 +2405,10 @@ index 155daa5cd52c4e93e1cc4559875868f4faf2c37e..02e8a2614a27a4cc9e1de760d4c48617 /** * Set the status and reason for the forthcoming synthesized response. diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp -index d849eab7507f0665a8a79a1b11759afa3481f1ad..3a95d5201a1c1f2161a95e15beae86f2833a875f 100644 +index dfd80e8867ec46464ddcfc30316236c824950cb1..a702bbe63cf56984519000854e9f487dcac3cee4 100644 --- a/netwerk/ipc/DocumentLoadListener.cpp +++ b/netwerk/ipc/DocumentLoadListener.cpp -@@ -167,6 +167,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, +@@ -168,6 +168,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, loadInfo->SetHasValidUserGestureActivation( aLoadState->HasValidUserGestureActivation()); loadInfo->SetIsMetaRefresh(aLoadState->IsMetaRefresh()); @@ -2365,7 +2417,7 @@ index d849eab7507f0665a8a79a1b11759afa3481f1ad..3a95d5201a1c1f2161a95e15beae86f2 return loadInfo.forget(); } diff --git a/netwerk/protocol/http/InterceptedHttpChannel.cpp b/netwerk/protocol/http/InterceptedHttpChannel.cpp -index c58fbc96391f8dcb585bd00b5ae8cba9088abd82..c121c891b61c9d60df770020c4ad09521d2bbfe6 100644 +index 5695d46f924abe6b765f3645d746cc4248051c1c..d28ead55f6a8458f70ca43c693e7396c5dc53858 100644 --- a/netwerk/protocol/http/InterceptedHttpChannel.cpp +++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp @@ -727,6 +727,14 @@ NS_IMPL_ISUPPORTS(ResetInterceptionHeaderVisitor, nsIHttpHeaderVisitor) @@ -2403,10 +2455,10 @@ index c58fbc96391f8dcb585bd00b5ae8cba9088abd82..c121c891b61c9d60df770020c4ad0952 if (mPump && mLoadFlags & LOAD_CALL_CONTENT_SNIFFERS) { mPump->PeekStream(CallTypeSniffers, static_cast(this)); diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp -index f2c47c42a6b6448ede3a6fef1510a3982336d5af..9e35df57102c93238de2e4d548bbe1205d227f3b 100644 +index f25949e6cc907ff18a76d68fc2e8005bd40146ea..9be4cb34517b06b94c6e145aef8a8ea5d2687d97 100644 --- a/parser/html/nsHtml5TreeOpExecutor.cpp +++ b/parser/html/nsHtml5TreeOpExecutor.cpp -@@ -1382,6 +1382,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( +@@ -1389,6 +1389,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( void nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); @@ -2418,10 +2470,10 @@ index f2c47c42a6b6448ede3a6fef1510a3982336d5af..9e35df57102c93238de2e4d548bbe120 nsCOMPtr preloadCsp = mDocument->GetPreloadCsp(); if (!preloadCsp) { diff --git a/security/manager/ssl/nsCertOverrideService.cpp b/security/manager/ssl/nsCertOverrideService.cpp -index b8d0bbc3a12f74c19284b26eadada361abeb7946..a50379c57158748684e2ea5065550af81c1e9b86 100644 +index fcc2a45e6de8eaeb1af2404a69bd3df58cf2aec8..d4c1df007bf5993cf9e0dadbe91aa2c38afc42ec 100644 --- a/security/manager/ssl/nsCertOverrideService.cpp +++ b/security/manager/ssl/nsCertOverrideService.cpp -@@ -438,7 +438,12 @@ nsCertOverrideService::HasMatchingOverride( +@@ -437,7 +437,12 @@ nsCertOverrideService::HasMatchingOverride( bool disableAllSecurityCheck = false; { MutexAutoLock lock(mMutex); @@ -2435,7 +2487,7 @@ index b8d0bbc3a12f74c19284b26eadada361abeb7946..a50379c57158748684e2ea5065550af8 } if (disableAllSecurityCheck) { *aIsTemporary = false; -@@ -650,14 +655,24 @@ static bool IsDebugger() { +@@ -649,14 +654,24 @@ static bool IsDebugger() { NS_IMETHODIMP nsCertOverrideService:: @@ -2514,14 +2566,14 @@ index 73c83e526be1a3a252f995d0718e3975d50bffa7..db5977c54221e19e107a8325a0834302 (lazy.isRunningTests || Cu.isInAutomation) && this.SERVER_URL == "data:,#remote-settings-dummy/v1" diff --git a/servo/components/style/gecko/media_features.rs b/servo/components/style/gecko/media_features.rs -index 8de45d95c2b942f069c898c93702bc7db2219369..be72e9678c3de31b1eaa72cfcb2c8be886f4a80f 100644 +index df1c5e464b845b6a8bfedadb86d0e7aab7fd3ffc..34451e791bb59f635134de702d9e5f641fe8df79 100644 --- a/servo/components/style/gecko/media_features.rs +++ b/servo/components/style/gecko/media_features.rs -@@ -292,10 +292,15 @@ pub enum ForcedColors { +@@ -303,10 +303,16 @@ impl ForcedColors { /// https://drafts.csswg.org/mediaqueries-5/#forced-colors fn eval_forced_colors(context: &Context, query_value: Option) -> bool { -- let forced = !context.device().use_document_colors(); +- let forced = context.device().forced_colors(); + let prefers_forced_colors = + unsafe { bindings::Gecko_MediaFeatures_ForcedColors(context.device().document()) }; + let query_value = match query_value { @@ -2529,15 +2581,16 @@ index 8de45d95c2b942f069c898c93702bc7db2219369..be72e9678c3de31b1eaa72cfcb2c8be8 + None => return prefers_forced_colors, + }; match query_value { -- Some(query_value) => forced == (query_value == ForcedColors::Active), -- None => forced, +- Some(query_value) => query_value == forced, +- None => forced != ForcedColors::None, + ForcedColors::Active => prefers_forced_colors, ++ ForcedColors::Requested => prefers_forced_colors, + ForcedColors::None => !prefers_forced_colors, } } diff --git a/toolkit/components/browser/nsIWebBrowserChrome.idl b/toolkit/components/browser/nsIWebBrowserChrome.idl -index 517c87a285dd93220cb2654d6ba7bb05c66cdeb7..e3010421d8dbe5ed5ed72feedb9f15805b32503e 100644 +index 217beda78edf31bab4c37209964d7a5bf5425195..7ba723410eb93328a8f078c58a96eefc2599feea 100644 --- a/toolkit/components/browser/nsIWebBrowserChrome.idl +++ b/toolkit/components/browser/nsIWebBrowserChrome.idl @@ -74,6 +74,9 @@ interface nsIWebBrowserChrome : nsISupports @@ -2551,7 +2604,7 @@ index 517c87a285dd93220cb2654d6ba7bb05c66cdeb7..e3010421d8dbe5ed5ed72feedb9f1580 // 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 15fa2193c6116b5bd0cf2ee608eb5971f3d24370..aa92eb63b8f907e0df9ef8df60fd076aa3d6a472 100644 +index 00a5381133f8cec0de452c31c7151801a1acc0b9..5d3e3d6f566dc724f257beaeb994cedaa7e71139 100644 --- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs +++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs @@ -108,6 +108,12 @@ EnterprisePoliciesManager.prototype = { @@ -2567,6 +2620,19 @@ index 15fa2193c6116b5bd0cf2ee608eb5971f3d24370..aa92eb63b8f907e0df9ef8df60fd076a let provider = this._chooseProvider(); if (provider.failed) { +diff --git a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp +index 32b1ac481382dd6aa3dda5572f013c2447a1a004..808031fbeb9b99b67c13c99c66b1aa1aff41f48a 100644 +--- a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp ++++ b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp +@@ -525,7 +525,7 @@ void PopulateLanguages() { + // sufficient to only collect this information as the other properties are + // just reformats of Navigator::GetAcceptLanguages. + nsTArray languages; +- dom::Navigator::GetAcceptLanguages(languages); ++ dom::Navigator::GetAcceptLanguages(nullptr, languages); + nsCString output = "["_ns; + + for (const auto& language : languages) { diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 3314cb813f6ceb67096eeda0864ad3b16c0616cb..5aac63649e186d624a9905a5d16513f8353f5515 100644 --- a/toolkit/components/startup/nsAppStartup.cpp @@ -2596,10 +2662,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 209af157a35cf9c4586424421ee19b3f680796b6..1feb61e2f18e9a13631addc935f00da07739291e 100644 +index 0767cb1539f940e5f634b58de44d876606903a09..dc0d72b4ff36d5ba7808528aefecb33f05b6672c 100644 --- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp +++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -@@ -1853,7 +1853,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( +@@ -1861,7 +1861,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( // Open a minimal popup. *aIsPopupRequested = true; @@ -2613,20 +2679,20 @@ index 209af157a35cf9c4586424421ee19b3f680796b6..1feb61e2f18e9a13631addc935f00da0 /** diff --git a/toolkit/mozapps/update/UpdateService.sys.mjs b/toolkit/mozapps/update/UpdateService.sys.mjs -index 34bf1b9e19ae54f78d134b023af96820bc13a905..b85793edcd1996833420a026cb08706d648ece14 100644 +index deaed885c759d8e53ebf0beb53c5b7c4d4bd82f0..8e01e16490ab063361220d363494dfdf00442342 100644 --- a/toolkit/mozapps/update/UpdateService.sys.mjs +++ b/toolkit/mozapps/update/UpdateService.sys.mjs -@@ -3852,6 +3852,8 @@ UpdateService.prototype = { - }, +@@ -3875,6 +3875,8 @@ export class UpdateService { + } get disabledForTesting() { + /* playwright */ + return true; - return ( - (Cu.isInAutomation || - lazy.Marionette.running || + return lazy.UpdateServiceStub.updateDisabledForTesting; + } + diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild -index b697eb1e3b02b0ffcc95a6e492dc23eb888488cc..0f4059341dbb3c2ecb2c46be0850e0d56e2a7453 100644 +index 8c2b2bf996bd889651dc7fac1dc351b4c47b567e..07d237eb17a657ce051fd0aa5e53449c0c3159f6 100644 --- a/toolkit/toolkit.mozbuild +++ b/toolkit/toolkit.mozbuild @@ -155,6 +155,7 @@ if CONFIG["ENABLE_WEBDRIVER"]: @@ -2638,7 +2704,7 @@ index b697eb1e3b02b0ffcc95a6e492dc23eb888488cc..0f4059341dbb3c2ecb2c46be0850e0d5 ] diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp -index 2a91deec5c10f87ed09f99b659baab77b2b638f2..78f4f30a0efe314563c6405f7b0848d2c3ca0551 100644 +index 7eb9e1104682d4eb47060654f43a1efa8b2a6bb2..a8315d6decf654b5302bea5beeea34140c300ded 100644 --- a/toolkit/xre/nsWindowsWMain.cpp +++ b/toolkit/xre/nsWindowsWMain.cpp @@ -14,8 +14,10 @@ @@ -2652,10 +2718,10 @@ index 2a91deec5c10f87ed09f99b659baab77b2b638f2..78f4f30a0efe314563c6405f7b0848d2 #include #ifdef __MINGW32__ -@@ -137,6 +139,19 @@ int wmain(int argc, WCHAR** argv) { +@@ -114,6 +116,19 @@ static void FreeAllocStrings(int argc, char** argv) { + int wmain(int argc, WCHAR** argv) { SanitizeEnvironmentVariables(); SetDllDirectoryW(L""); - RemovePrefetchArguments(argc, argv); + bool hasJugglerPipe = + mozilla::CheckArg(argc, argv, "juggler-pipe", nullptr, + mozilla::CheckArgFlag::None) == mozilla::ARG_FOUND; @@ -2690,7 +2756,7 @@ index fe72a2715da8846146377e719559c16e6ef1f7ff..a5959143bac8f62ee359fa3883a844f3 // 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 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295ea050b878 100644 +index b9120ededd25707c90f33f65d3cead26433efdac..4d5728a73786d804d6b32da4d42934da2864eda1 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -112,6 +112,7 @@ @@ -2714,7 +2780,7 @@ index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295e nsresult nsExternalHelperAppService::GetFileTokenForPath( const char16_t* aPlatformAppPath, nsIFile** aFile) { nsDependentString platformAppPath(aPlatformAppPath); -@@ -1442,7 +1449,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { +@@ -1441,7 +1448,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { // Strip off the ".part" from mTempLeafName mTempLeafName.Truncate(mTempLeafName.Length() - ArrayLength(".part") + 1); @@ -2727,7 +2793,7 @@ index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295e mSaver = do_CreateInstance(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); -@@ -1631,7 +1643,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1630,7 +1642,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { return NS_OK; } @@ -2765,7 +2831,7 @@ index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295e if (NS_FAILED(rv)) { nsresult transferError = rv; -@@ -1683,6 +1724,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1682,6 +1723,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { bool alwaysAsk = true; mMimeInfo->GetAlwaysAskBeforeHandling(&alwaysAsk); @@ -2775,7 +2841,7 @@ index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295e if (alwaysAsk) { // But we *don't* ask if this mimeInfo didn't come from // our user configuration datastore and the user has said -@@ -2199,6 +2243,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, +@@ -2198,6 +2242,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, NotifyTransfer(aStatus); } @@ -2792,7 +2858,7 @@ index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295e return NS_OK; } -@@ -2680,6 +2734,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { +@@ -2679,6 +2733,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { } } @@ -2832,7 +2898,7 @@ index 1f77e095dbfa3acc046779114007d83fc1cfa087..2354abbab7af6f6bdc3bd628722f03ea * When we download a helper app, we are going to retarget all load * notifications into our own docloader and load group instead of diff --git a/uriloader/exthandler/nsIExternalHelperAppService.idl b/uriloader/exthandler/nsIExternalHelperAppService.idl -index 4a399acb72d4fd475c9ae43e9eadbc32f261e290..31e9490a7dfd7d7eff69ad23c9ce277f367d1524 100644 +index 4a399acb72d4fd475c9ae43e9eadbc32f261e290..97ace81c82b16a9a993166dd4b0ddb3a721c9872 100644 --- a/uriloader/exthandler/nsIExternalHelperAppService.idl +++ b/uriloader/exthandler/nsIExternalHelperAppService.idl @@ -6,8 +6,11 @@ @@ -2857,7 +2923,7 @@ index 4a399acb72d4fd475c9ae43e9eadbc32f261e290..31e9490a7dfd7d7eff69ad23c9ce277f +[scriptable, uuid(9a20e9b0-75d0-11ea-bc55-0242ac130003)] +interface nsIDownloadInterceptor : nsISupports +{ -+ bool interceptDownloadRequest(in nsIHelperAppLauncher aHandler, in nsIRequest aRequest, in BrowsingContext aBrowsingContext, out nsIFile file); ++ boolean interceptDownloadRequest(in nsIHelperAppLauncher aHandler, in nsIRequest aRequest, in BrowsingContext aBrowsingContext, out nsIFile file); + + void onDownloadComplete(in nsIHelperAppLauncher aHandler, in ACString aErrorName); +}; @@ -3160,7 +3226,7 @@ index facd2bc65afab8ec1aa322faa20a67464964dfb9..d6dea95472bec6006411753c3dfdab2e } // namespace widget diff --git a/widget/headless/HeadlessWidget.cpp b/widget/headless/HeadlessWidget.cpp -index 083d026d3c019cb76fff2b8f605f3d6ef8dd578f..84c049709ead92c980b86230513a634bf6337085 100644 +index 419b3bf94011e6874588b042fa520e75522ed2c3..07dc3954986d8257dc4fce1aa810623bb5d90bbd 100644 --- a/widget/headless/HeadlessWidget.cpp +++ b/widget/headless/HeadlessWidget.cpp @@ -111,6 +111,8 @@ void HeadlessWidget::Destroy() { @@ -3172,7 +3238,7 @@ index 083d026d3c019cb76fff2b8f605f3d6ef8dd578f..84c049709ead92c980b86230513a634b nsBaseWidget::OnDestroy(); nsBaseWidget::Destroy(); -@@ -621,5 +623,14 @@ nsresult HeadlessWidget::SynthesizeNativeTouchpadPan( +@@ -620,5 +622,14 @@ nsresult HeadlessWidget::SynthesizeNativeTouchpadPan( return NS_OK; } @@ -3222,10 +3288,10 @@ index 8ba46829357fc4acc47bf20842fd869902efa000..a1b5b2c5230d90981bd563d4df2d2bf1 } }; diff --git a/xpcom/reflect/xptinfo/xptinfo.h b/xpcom/reflect/xptinfo/xptinfo.h -index 2456c2c2b58b27cd595880b547ed20fb687a1835..e967c089b2331c7cd36d34e511543fbc84320b7d 100644 +index 787d30d881adedd57d2025ca57bff4bc6c57e803..ae1a0172c960ab16919133485722d2ae0cdbcbd4 100644 --- a/xpcom/reflect/xptinfo/xptinfo.h +++ b/xpcom/reflect/xptinfo/xptinfo.h -@@ -514,7 +514,7 @@ static_assert(sizeof(nsXPTMethodInfo) == 8, "wrong size"); +@@ -505,7 +505,7 @@ static_assert(sizeof(nsXPTMethodInfo) == 8, "wrong size"); #if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) # define PARAM_BUFFER_COUNT 18 #else diff --git a/browser_patches/firefox/preferences/playwright.cfg b/browser_patches/firefox/preferences/playwright.cfg index 99fbf39420..1921f19c38 100644 --- a/browser_patches/firefox/preferences/playwright.cfg +++ b/browser_patches/firefox/preferences/playwright.cfg @@ -47,6 +47,9 @@ pref("permissions.isolateBy.userContext", true); // |Page.setFileInputFiles| protocol method. pref("dom.file.createInChild", true); +// Allow uploading directorys in content process. +pref("dom.filesystem.pathcheck.disabled", true); + // Do not warn when closing all open tabs pref("browser.tabs.warnOnClose", false); diff --git a/browser_patches/webkit/UPSTREAM_CONFIG.sh b/browser_patches/webkit/UPSTREAM_CONFIG.sh index 069f24571c..c90cb30712 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="b2ca06dc3d84b356d01cdf09a82049f80515fbfe" +BASE_REVISION="f371dbc2bb4292037ed394e2162150a16ef977fc" diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff index 5df5d455da..9b8aa596c4 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 dcd4c26b1cd99333e9498a483ff4139a8d42d14b..f041439eff7f2649b1560faf18661165b1fd7771 100644 +index 3a1013bab702f71303ee800f6b3e9a65a08f4de6..9448f06498ea591e51516d5ef7b543f63655b6ae 100644 --- a/Source/JavaScriptCore/CMakeLists.txt +++ b/Source/JavaScriptCore/CMakeLists.txt -@@ -1400,22 +1400,27 @@ set(JavaScriptCore_INSPECTOR_DOMAINS +@@ -1392,22 +1392,27 @@ set(JavaScriptCore_INSPECTOR_DOMAINS ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json @@ -62,7 +62,7 @@ index b26ef7b2b8f732160ddee36697a61ca7776fc2c3..9a442a4cda7efd7f2bd4e225d8bcbfed $(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 15d6e32cd525905b116f25a5bdd50bd1ef390cee..74b1415d21dcddc49e842e077e87e06724af8365 100644 +index 3033ef7fc7e1db0e4b6fb85236997ce92b1946a5..87fc65714ad2caa21ac19aabf0a7d93badb4c848 100644 --- a/Source/JavaScriptCore/DerivedSources.make +++ b/Source/JavaScriptCore/DerivedSources.make @@ -298,22 +298,27 @@ INSPECTOR_DOMAINS := \ @@ -94,7 +94,7 @@ index 15d6e32cd525905b116f25a5bdd50bd1ef390cee..74b1415d21dcddc49e842e077e87e067 $(JavaScriptCore)/inspector/protocol/ServiceWorker.json \ $(JavaScriptCore)/inspector/protocol/Target.json \ diff --git a/Source/JavaScriptCore/inspector/IdentifiersFactory.cpp b/Source/JavaScriptCore/inspector/IdentifiersFactory.cpp -index 528cceee66a1b1c91a0d0e59d5f1a1770a050c17..0f3a341056f429ff282abcab22be4843c60f546c 100644 +index 9bc5d1fd8e2a7e576be046b3c6ae1266696cf552..610f810db1dd6865c500c0796386a8284f4178e9 100644 --- a/Source/JavaScriptCore/inspector/IdentifiersFactory.cpp +++ b/Source/JavaScriptCore/inspector/IdentifiersFactory.cpp @@ -32,14 +32,21 @@ @@ -108,7 +108,7 @@ index 528cceee66a1b1c91a0d0e59d5f1a1770a050c17..0f3a341056f429ff282abcab22be4843 static String addPrefixToIdentifier(unsigned long identifier) { - return makeString("0."_s, identifier); -+ return makeString(s_processID, ".", identifier); ++ return makeString(s_processID, '.', identifier); } +void IdentifiersFactory::initializeWithProcessID(uint64_t processID) { @@ -133,10 +133,10 @@ index eb25aedee4cd9ebe007e06c2515b37ee095b06f4..badf6559595c8377db1089ca3c25008e static String requestId(unsigned long identifier); }; diff --git a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp -index 731a91727561c1507d074ad27f592d274dfeb324..9320b24579466bb1baa8b68430fe9cbb6c152770 100644 +index 143135027999755614d5fae2b897d8dd5e62d611..a357963f3350d29ea0fd90a20ac2393ff6a0efa9 100644 --- a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp +++ b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp -@@ -84,7 +84,10 @@ static RefPtr jsToInspectorValue(JSC::JSGlobalObject* globalObject, +@@ -85,7 +85,10 @@ static RefPtr jsToInspectorValue(JSC::JSGlobalObject* globalObject, JSC::PropertyNameArray propertyNames(vm, JSC::PropertyNameMode::Strings, JSC::PrivateSymbolMode::Exclude); object.methodTable()->getOwnPropertyNames(&object, globalObject, propertyNames, JSC::DontEnumPropertiesMode::Exclude); for (auto& name : propertyNames) { @@ -149,10 +149,10 @@ index 731a91727561c1507d074ad27f592d274dfeb324..9320b24579466bb1baa8b68430fe9cbb return nullptr; inspectorObject->setValue(name.string(), inspectorValue.releaseNonNull()); diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp -index 820a08fc660633e09675d0e647bd0c50d2fa905a..5ca5ee5a6897b7ef332d906018b457122096df98 100644 +index 3b2056bf5a71301383e0895d77cc6f16842235a9..eaf73171ce70ac43abbe404122a263ce708bb41f 100644 --- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp +++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp -@@ -101,7 +101,7 @@ void BackendDispatcher::registerDispatcherForDomain(const String& domain, Supple +@@ -100,7 +100,7 @@ void BackendDispatcher::registerDispatcherForDomain(const String& domain, Supple m_dispatchers.set(domain, dispatcher); } @@ -161,7 +161,7 @@ index 820a08fc660633e09675d0e647bd0c50d2fa905a..5ca5ee5a6897b7ef332d906018b45712 { Ref protect(*this); -@@ -146,6 +146,9 @@ void BackendDispatcher::dispatch(const String& message) +@@ -145,6 +145,9 @@ void BackendDispatcher::dispatch(const String& message) requestId = *requestIdInt; } @@ -172,10 +172,10 @@ index 820a08fc660633e09675d0e647bd0c50d2fa905a..5ca5ee5a6897b7ef332d906018b45712 // 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 31957be19b946aa90d316dc978a301f80956dd9c..d1a01e7546996535eb3884524c251c50a998eb33 100644 +index 0c83a1c3baa3bdbb30e53c11aaafd8bda34309cd..127616bbdb65b0867266e5bd6a63bd5a58212870 100644 --- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h +++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h -@@ -83,7 +83,10 @@ public: +@@ -84,7 +84,10 @@ public: }; void registerDispatcherForDomain(const String& domain, SupplementalBackendDispatcher*); @@ -222,10 +222,10 @@ index 0cc2127c9c12c2d82dea9550bad73f4ffb99ba24..8ca65cc042d435cbc0e05dcc5c5dfc95 } diff --git a/Source/JavaScriptCore/inspector/InspectorTarget.h b/Source/JavaScriptCore/inspector/InspectorTarget.h -index 88b72e94c4e8636de88419733b0a63ad4e0b9a73..153ee84f2c7ef86c548c62a65d6ad99214090230 100644 +index 082dd93cb0505c5bc7a2d5a7cf78fa0306809082..3f50f49ef9e691b3dc57dafd66c1e7d323736f40 100644 --- a/Source/JavaScriptCore/inspector/InspectorTarget.h +++ b/Source/JavaScriptCore/inspector/InspectorTarget.h -@@ -57,8 +57,12 @@ public: +@@ -66,8 +66,12 @@ public: virtual void connect(FrontendChannel::ConnectionType) = 0; virtual void disconnect() = 0; virtual void sendMessageToTargetBackend(const String&) = 0; @@ -239,10 +239,10 @@ index 88b72e94c4e8636de88419733b0a63ad4e0b9a73..153ee84f2c7ef86c548c62a65d6ad992 bool m_isPaused { false }; }; diff --git a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp -index 15d2592d36b402bf2210dc4970ff40957022e84a..99ac14dc75ff5296e1f6c42bdbf8c128f2d82254 100644 +index c33e236f5228e21c6d5e0ea9bd97d07cdcb70640..7f160aec0f13e8c936aa7dea769d4e160d716452 100644 --- a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp +++ b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp -@@ -221,6 +221,14 @@ void JSGlobalObjectConsoleClient::screenshot(JSGlobalObject*, Ref&&); diff --git a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp -index 594584db96a3de67b92910f472f1403bc9b26ce2..8ba453f9ae8726ccfb26c55180371c20bed6962e 100644 +index 0cb6efeef2430faa5dbd812f71d4abfd5f6eb9df..787ec6a5f8413c0a9dc133cb0e51ccdab58d40d0 100644 --- a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp +++ b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp @@ -194,9 +194,8 @@ void InspectorRuntimeAgent::callFunctionOn(const Protocol::Runtime::RemoteObject @@ -392,7 +392,7 @@ index 4edcbf5f4aee2eb8e5675a23b9db67e9d640ef7f..a32b0f3a5de49e58b8a35cec9202b788 // FrontendChannel FrontendChannel::ConnectionType connectionType() const; diff --git a/Source/JavaScriptCore/inspector/protocol/DOM.json b/Source/JavaScriptCore/inspector/protocol/DOM.json -index fc7612613d09e03f481c567a8a4a121884e2cb6c..b0a7b284684bccaa7dfb0892a64d4a803357ccc1 100644 +index 27c65fbda226f1cd5bfd68944fe87fb9b2a688a6..b036f050859ee88004a7bf6daa4bb73835360615 100644 --- a/Source/JavaScriptCore/inspector/protocol/DOM.json +++ b/Source/JavaScriptCore/inspector/protocol/DOM.json @@ -80,6 +80,16 @@ @@ -412,7 +412,7 @@ index fc7612613d09e03f481c567a8a4a121884e2cb6c..b0a7b284684bccaa7dfb0892a64d4a80 { "id": "EventListener", "type": "object", -@@ -267,6 +277,16 @@ +@@ -268,6 +278,16 @@ { "name": "width", "type": "number" }, { "name": "height", "type": "number" } ] @@ -429,7 +429,7 @@ index fc7612613d09e03f481c567a8a4a121884e2cb6c..b0a7b284684bccaa7dfb0892a64d4a80 } ], "commands": [ -@@ -696,7 +716,10 @@ +@@ -697,7 +717,10 @@ "description": "Resolves JavaScript node object for given node id.", "targetTypes": ["page"], "parameters": [ @@ -441,7 +441,7 @@ index fc7612613d09e03f481c567a8a4a121884e2cb6c..b0a7b284684bccaa7dfb0892a64d4a80 { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." } ], "returns": [ -@@ -773,6 +796,46 @@ +@@ -774,6 +797,47 @@ "returns": [ { "name": "mediaStats", "$ref": "MediaStats", "description": "An interleaved array of node attribute names and values." } ] @@ -484,7 +484,8 @@ index fc7612613d09e03f481c567a8a4a121884e2cb6c..b0a7b284684bccaa7dfb0892a64d4a80 + { "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" } -+ ] ++ ], ++ "async": true } ], "events": [ @@ -532,10 +533,10 @@ index 0000000000000000000000000000000000000000..79edea03fed4e9be5da96e1275e182a4 +} diff --git a/Source/JavaScriptCore/inspector/protocol/Emulation.json b/Source/JavaScriptCore/inspector/protocol/Emulation.json new file mode 100644 -index 0000000000000000000000000000000000000000..2a49dd417360da37c83c4d375de468f949dce5db +index 0000000000000000000000000000000000000000..8377901cb3ad75c29532a1f0f547efb53558a327 --- /dev/null +++ b/Source/JavaScriptCore/inspector/protocol/Emulation.json -@@ -0,0 +1,52 @@ +@@ -0,0 +1,59 @@ +{ + "domain": "Emulation", + "availability": ["web"], @@ -585,15 +586,22 @@ index 0000000000000000000000000000000000000000..2a49dd417360da37c83c4d375de468f9 + { + "name": "resetPermissions", + "description": "Clears permission overrides." ++ }, ++ { ++ "name": "setOrientationOverride", ++ "description": "Overrides window.orientation with provided value.", ++ "parameters": [ ++ { "name": "angle", "type": "integer", "optional": true } ++ ] + } + ] +} diff --git a/Source/JavaScriptCore/inspector/protocol/Input.json b/Source/JavaScriptCore/inspector/protocol/Input.json new file mode 100644 -index 0000000000000000000000000000000000000000..b9ab57a2b5739ed997231399b4bd4042a0cb0935 +index 0000000000000000000000000000000000000000..1c43b476603325fa412bcfded9163e7a00aebbfa --- /dev/null +++ b/Source/JavaScriptCore/inspector/protocol/Input.json -@@ -0,0 +1,223 @@ +@@ -0,0 +1,264 @@ +{ + "domain": "Input", + "availability": ["web"], @@ -602,6 +610,16 @@ index 0000000000000000000000000000000000000000..b9ab57a2b5739ed997231399b4bd4042 + "id": "TimeSinceEpoch", + "description": "UTC time in seconds, counted from January 1, 1970.", + "type": "number" ++ }, ++ { ++ "id": "TouchPoint", ++ "type": "object", ++ "description": "Touch point.", ++ "properties": [ ++ { "name": "x", "type": "integer", "description": "X coordinate of the event relative to the main frame's viewport in CSS pixels." }, ++ { "name": "y", "type": "integer", "description": "Y coordinate of the event relative to the main frame's viewport in CSS pixels." }, ++ { "name": "id", "type": "integer", "description": "Identifier used to track touch sources between events, must be unique within an event." } ++ ] + } + ], + "commands": [ @@ -814,6 +832,37 @@ index 0000000000000000000000000000000000000000..b9ab57a2b5739ed997231399b4bd4042 + "type": "integer" + } + ] ++ }, ++ { ++ "name": "dispatchTouchEvent", ++ "description": "Dispatches a touch event to the page.", ++ "async": true, ++ "parameters": [ ++ { ++ "name": "type", ++ "description": "Type of the touch event.", ++ "type": "string", ++ "enum": [ ++ "touchStart", ++ "touchMove", ++ "touchEnd", ++ "touchCancel" ++ ] ++ }, ++ { ++ "name": "modifiers", ++ "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0).", ++ "optional": true, ++ "type": "integer" ++ }, ++ { ++ "name": "touchPoints", ++ "description": "List of touch points", ++ "type": "array", ++ "optional": true, ++ "items": { "$ref": "TouchPoint" } ++ } ++ ] + } + ] +} @@ -836,7 +885,7 @@ index 96af27ece2ac200e11c4311b3ca0d9d3b5a048da..3168f7806fcbdabec07acc5e304bae1e ], "events": [ diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json -index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..7e6c8b8954ed3d5d4ac77dfe51d0e08c56a7a5fc 100644 +index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..829bd459b62568e73fadd806adc14c6462bbff82 100644 --- a/Source/JavaScriptCore/inspector/protocol/Page.json +++ b/Source/JavaScriptCore/inspector/protocol/Page.json @@ -20,7 +20,14 @@ @@ -988,7 +1037,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..7e6c8b8954ed3d5d4ac77dfe51d0e08c ], "returns": [ { "name": "dataURL", "type": "string", "description": "Base64-encoded image data (PNG)." } -@@ -321,12 +417,71 @@ +@@ -321,12 +417,64 @@ { "name": "setScreenSizeOverride", "description": "Overrides screen size exposed to DOM and used in media queries for testing with provided values.", @@ -1049,19 +1098,12 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..7e6c8b8954ed3d5d4ac77dfe51d0e08c + "description": "Crashes the page process" + }, + { -+ "name": "setOrientationOverride", -+ "description": "Overrides window.orientation with provided value.", -+ "parameters": [ -+ { "name": "angle", "type": "integer", "optional": true } -+ ] -+ }, -+ { + "name": "updateScrollingState", + "description": "Ensures that the scroll regions are up to date." } ], "events": [ -@@ -334,14 +489,16 @@ +@@ -334,14 +482,16 @@ "name": "domContentEventFired", "targetTypes": ["page"], "parameters": [ @@ -1080,7 +1122,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..7e6c8b8954ed3d5d4ac77dfe51d0e08c ] }, { -@@ -351,6 +508,14 @@ +@@ -351,6 +501,14 @@ { "name": "frame", "$ref": "Frame", "description": "Frame object." } ] }, @@ -1095,7 +1137,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..7e6c8b8954ed3d5d4ac77dfe51d0e08c { "name": "frameDetached", "description": "Fired when frame has been detached from its parent.", -@@ -379,7 +544,8 @@ +@@ -379,7 +537,8 @@ "targetTypes": ["page"], "parameters": [ { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has scheduled a navigation." }, @@ -1105,7 +1147,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..7e6c8b8954ed3d5d4ac77dfe51d0e08c ] }, { -@@ -390,6 +556,22 @@ +@@ -390,6 +549,22 @@ { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." } ] }, @@ -1128,7 +1170,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..7e6c8b8954ed3d5d4ac77dfe51d0e08c { "name": "defaultUserPreferencesDidChange", "description": "Fired when the default value of a user preference changes at the system level.", -@@ -397,6 +579,42 @@ +@@ -397,6 +572,42 @@ "parameters": [ { "name": "preferences", "type": "array", "items": { "$ref": "UserPreference" }, "description": "List of user preferences that can be overriden and their new system (default) values." } ] @@ -1635,7 +1677,7 @@ index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..bbbabc4e7259088b9404e8cc07eecd6f }, { diff --git a/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp b/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp -index dd1286cec6e77895f519911c89719b6064db6949..b732e0eab0fd29e1a1c9a2179cc86a951768c062 100644 +index 56a8f09aa0f4985f1af99f31f000b03dcb0c3901..f6f577b897d0b37df5d193df07702a190b8ed6a4 100644 --- a/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp +++ b/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp @@ -28,7 +28,6 @@ @@ -1647,10 +1689,10 @@ index dd1286cec6e77895f519911c89719b6064db6949..b732e0eab0fd29e1a1c9a2179cc86a95 namespace JSC { namespace Profiler { diff --git a/Source/JavaScriptCore/runtime/ConsoleClient.h b/Source/JavaScriptCore/runtime/ConsoleClient.h -index 72c81757450ad5ebacd5fd20d2a16095514802ec..b7d8ab1e04d3850180079870468b28eff504626a 100644 +index 24891ad836086fd23024fcb4d08ca63f6974c812..29f4b6b1923383fec7a99d28a4e815dc4536d160 100644 --- a/Source/JavaScriptCore/runtime/ConsoleClient.h +++ b/Source/JavaScriptCore/runtime/ConsoleClient.h -@@ -69,6 +69,7 @@ public: +@@ -78,6 +78,7 @@ public: virtual void record(JSGlobalObject*, Ref&&) = 0; virtual void recordEnd(JSGlobalObject*, Ref&&) = 0; virtual void screenshot(JSGlobalObject*, Ref&&) = 0; @@ -1659,10 +1701,10 @@ index 72c81757450ad5ebacd5fd20d2a16095514802ec..b7d8ab1e04d3850180079870468b28ef private: enum ArgumentRequirement { ArgumentRequired, ArgumentNotRequired }; diff --git a/Source/ThirdParty/libwebrtc/CMakeLists.txt b/Source/ThirdParty/libwebrtc/CMakeLists.txt -index d6b1e73b1268a1224c2d77b936ce46347be62dac..acd1950327608988059a7e972fb4d40f9efc0c68 100644 +index a17275db76e30bf2f42bc8faa6dea14383b2ab27..f630ddaddfa5a5b048e028c233e84e8bec1e0370 100644 --- a/Source/ThirdParty/libwebrtc/CMakeLists.txt +++ b/Source/ThirdParty/libwebrtc/CMakeLists.txt -@@ -452,6 +452,7 @@ set(webrtc_SOURCES +@@ -453,6 +453,7 @@ set(webrtc_SOURCES Source/third_party/boringssl/src/crypto/x509/x_val.c Source/third_party/boringssl/src/crypto/x509/x_x509a.c Source/third_party/boringssl/src/crypto/x509/x_x509.c @@ -1670,7 +1712,7 @@ index d6b1e73b1268a1224c2d77b936ce46347be62dac..acd1950327608988059a7e972fb4d40f Source/third_party/boringssl/src/decrepit/bio/base64_bio.c Source/third_party/boringssl/src/decrepit/blowfish/blowfish.c Source/third_party/boringssl/src/decrepit/cast/cast.c -@@ -530,6 +531,11 @@ set(webrtc_SOURCES +@@ -532,6 +533,11 @@ set(webrtc_SOURCES Source/third_party/crc32c/src/src/crc32c.cc Source/third_party/crc32c/src/src/crc32c_portable.cc Source/third_party/crc32c/src/src/crc32c_sse42.cc @@ -1682,7 +1724,7 @@ index d6b1e73b1268a1224c2d77b936ce46347be62dac..acd1950327608988059a7e972fb4d40f Source/third_party/libyuv/source/compare.cc Source/third_party/libyuv/source/compare_common.cc Source/third_party/libyuv/source/compare_gcc.cc -@@ -2270,6 +2276,10 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE +@@ -2402,6 +2408,10 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE Source/third_party/libsrtp/config Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include @@ -1694,26 +1736,25 @@ index d6b1e73b1268a1224c2d77b936ce46347be62dac..acd1950327608988059a7e972fb4d40f Source/third_party/opus/src/celt Source/third_party/opus/src/include diff --git a/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig b/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig -index 94f6675a8b7ca64e12aaf1c3b01848f0a6b737a8..20660f511914ebb7877e050bb5bc232c3df2daa5 100644 +index 6b20d97d3d46359b2b2f9b4e8454a65c2ddbe9e3..80883fe3659389a3c385fd46ecd905bc0923d3ef 100644 --- a/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig +++ b/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig -@@ -21,7 +21,7 @@ - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +@@ -22,6 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --HEADER_SEARCH_PATHS = Source Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/webrtc/sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/webrtc/modules/audio_device/ios Source/webrtc Source/webrtc/sdk/objc Source/webrtc/sdk/objc/base Source/webrtc/sdk/objc/Framework/Classes Source/third_party/libsrtp/config Source/webrtc/sdk/objc/Framework/Classes/Common Source/webrtc/sdk/objc/Framework/Classes/Video Source/webrtc/sdk/objc/Framework/Classes/PeerConnection Source/third_party/abseil-cpp Source/third_party/libvpx/source/libvpx Source/third_party/libwebm/webm_parser/include Source/third_party/crc32c/config Source/third_party/crc32c/include Source/third_party/crc32c/src/include Source/third_party/libaom/source/libaom; -+HEADER_SEARCH_PATHS = Source Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/webrtc/sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/webrtc/modules/audio_device/ios Source/webrtc Source/webrtc/sdk/objc Source/webrtc/sdk/objc/base Source/webrtc/sdk/objc/Framework/Classes Source/third_party/libsrtp/config Source/webrtc/sdk/objc/Framework/Classes/Common Source/webrtc/sdk/objc/Framework/Classes/Video Source/webrtc/sdk/objc/Framework/Classes/PeerConnection Source/third_party/abseil-cpp Source/third_party/libvpx/source/libvpx Source/third_party/libwebm/webm_parser/include Source/third_party/crc32c/config Source/third_party/crc32c/include Source/third_party/crc32c/src/include Source/third_party/libaom/source/libaom Source/third_party/libwebm/mkvmuxer Source/third_party/libvpx/source/libvpx/third_party/libwebm; + HEADER_SEARCH_PATHS = Source Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/webrtc/sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/webrtc/modules/audio_device/ios Source/webrtc Source/webrtc/sdk/objc Source/webrtc/sdk/objc/base Source/webrtc/sdk/objc/Framework/Classes Source/third_party/libsrtp/config Source/webrtc/sdk/objc/Framework/Classes/Common Source/webrtc/sdk/objc/Framework/Classes/Video Source/webrtc/sdk/objc/Framework/Classes/PeerConnection Source/third_party/abseil-cpp Source/third_party/libvpx/source/libvpx Source/third_party/libwebm/webm_parser/include Source/third_party/crc32c/config Source/third_party/crc32c/include Source/third_party/crc32c/src/include Source/third_party/libaom/source/libaom Source/third_party/protobuf/src; ++HEADER_SEARCH_PATHS = ${HEADER_SEARCH_PATHS} Source/third_party/libwebm/mkvmuxer Source/third_party/libvpx/source/libvpx/third_party/libwebm; USE_HEADERMAP = NO; WARNING_CFLAGS = -Wno-deprecated-declarations $(inherited); diff --git a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp -index a01284369bedab3d44e7a3c2671590b3ca2b18fc..6a75fd2d366386e12dc612bdcfb914613c636478 100644 +index fca61ffe9f0563d87b364e0fa681ceab1d7bb26f..5c0d72f6c0bab0bc0011a123302c5654ec5664ba 100644 --- a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp +++ b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp -@@ -402,3 +402,24 @@ __ZN3rtc7LogSink12OnLogMessageENSt3__117basic_string_viewIcNS1_11char_traitsIcEE - __ZN3rtc7LogSink12OnLogMessageERKNS_10LogLineRefE - __ZN3rtc7LogSink12OnLogMessageERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_15LoggingSeverityEPKc - __ZTVN3rtc7LogSinkE +@@ -403,3 +403,24 @@ __ZN3rtc17AsyncPacketSocket20NotifyPacketReceivedERKNS_14ReceivedPacketE + __ZN3rtc17AsyncPacketSocket30RegisterReceivedPacketCallbackEN4absl12AnyInvocableIFvPS0_RKNS_14ReceivedPacketEEEE + __ZN3rtc17AsyncPacketSocket32DeregisterReceivedPacketCallbackEv + __ZN3rtc18NetworkManagerBaseC2Ev +__ZN8mkvmuxer11SegmentInfo15set_writing_appEPKc +__ZN8mkvmuxer11SegmentInfo4InitEv +__ZN8mkvmuxer7Segment10OutputCuesEb @@ -1760,7 +1801,7 @@ index f95c3b6c6b73a01974f26d88bcc533e5032ddb66..6a9368c60824cd32649c93286522d779 #include "api/array_view.h" diff --git a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj -index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e143329e31ee0 100644 +index 5e185d2c3aae7eb99b72dbbb1a04af638a6dfc63..d2fbb40ee5d8349d617b287368ae1a47a131e4ee 100644 --- a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj +++ b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj @@ -35,6 +35,20 @@ @@ -1784,7 +1825,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 /* 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, ); }; }; -@@ -5118,6 +5132,9 @@ +@@ -5193,6 +5207,9 @@ DDF30D9127C5C725006A526F /* receive_side_congestion_controller.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF30D9027C5C725006A526F /* receive_side_congestion_controller.h */; }; DDF30D9527C5C756006A526F /* bwe_defines.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF30D9327C5C756006A526F /* bwe_defines.h */; }; DDF30D9627C5C756006A526F /* remote_bitrate_estimator.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF30D9427C5C756006A526F /* remote_bitrate_estimator.h */; }; @@ -1794,7 +1835,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 /* End PBXBuildFile section */ /* Begin PBXBuildRule section */ -@@ -5606,6 +5623,13 @@ +@@ -5681,6 +5698,13 @@ remoteGlobalIDString = DDF30D0527C5C003006A526F; remoteInfo = absl; }; @@ -1808,7 +1849,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ -@@ -11165,6 +11189,9 @@ +@@ -11465,6 +11489,9 @@ DDF30D9027C5C725006A526F /* receive_side_congestion_controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = receive_side_congestion_controller.h; sourceTree = ""; }; DDF30D9327C5C756006A526F /* bwe_defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bwe_defines.h; sourceTree = ""; }; DDF30D9427C5C756006A526F /* remote_bitrate_estimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = remote_bitrate_estimator.h; sourceTree = ""; }; @@ -1818,7 +1859,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 FB39D0D11200F0E300088E69 /* libwebrtc.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libwebrtc.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ -@@ -19991,6 +20018,7 @@ +@@ -20596,6 +20623,7 @@ isa = PBXGroup; children = ( CDFD2F9224C4B2F90048DAC3 /* common */, @@ -1826,7 +1867,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 CDEBB19224C0191800ADBD44 /* webm_parser */, ); path = libwebm; -@@ -20418,6 +20446,16 @@ +@@ -21007,6 +21035,16 @@ path = include; sourceTree = ""; }; @@ -1843,7 +1884,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 FB39D06E1200ED9200088E69 = { isa = PBXGroup; children = ( -@@ -23693,6 +23731,7 @@ +@@ -24293,6 +24331,7 @@ ); dependencies = ( 410B3827292B73E90003E515 /* PBXTargetDependency */, @@ -1851,7 +1892,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 DD2E76E827C6B69A00F2A74C /* PBXTargetDependency */, CDEBB4CC24C01AB400ADBD44 /* PBXTargetDependency */, 411ED040212E0811004320BA /* PBXTargetDependency */, -@@ -23775,6 +23814,7 @@ +@@ -24375,6 +24414,7 @@ 4460B8B92B155B6A00392062 /* vp9_qp_parser_fuzzer */, 444A6EF02AEADFC9005FE121 /* vp9_replay_fuzzer */, 44945C512B9BA1C300447FFD /* webm_fuzzer */, @@ -1859,7 +1900,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 ); }; /* End PBXProject section */ -@@ -23858,6 +23898,23 @@ +@@ -24458,6 +24498,23 @@ shellPath = /bin/sh; shellScript = "\"${SRCROOT}/Scripts/create-symlink-to-altroot.sh\"\n"; }; @@ -1883,7 +1924,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ -@@ -25831,6 +25888,9 @@ +@@ -26471,6 +26528,9 @@ 5CDD865E1E43B8B500621E92 /* min_max_operations.c in Sources */, 4189395B242A71F5007FDC41 /* min_video_bitrate_experiment.cc in Sources */, 41B8D8FB28CB85CB00E5FA37 /* missing_mandatory_parameter_cause.cc in Sources */, @@ -1893,7 +1934,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 4131C387234B957D0028A615 /* moving_average.cc in Sources */, 41FCBB1521B1F7AA00A5DF27 /* moving_average.cc in Sources */, 5CD286101E6A64C90094FDC8 /* moving_max.cc in Sources */, -@@ -26708,6 +26768,11 @@ +@@ -27372,6 +27432,11 @@ target = DDF30D0527C5C003006A526F /* absl */; targetProxy = DD2E76E727C6B69A00F2A74C /* PBXContainerItemProxy */; }; @@ -1905,7 +1946,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ -@@ -27283,6 +27348,27 @@ +@@ -27947,6 +28012,27 @@ }; name = Production; }; @@ -1933,7 +1974,7 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 FB39D0711200ED9200088E69 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D7C59C71208C68B001C873E /* DebugRelease.xcconfig */; -@@ -27585,6 +27671,16 @@ +@@ -28249,6 +28335,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; @@ -1951,10 +1992,10 @@ index f5f1d0ef71f7fcf175b016ddaefd99f18d96c1c3..5632dcb4919eb22133a62810b91e1433 isa = XCConfigurationList; buildConfigurations = ( diff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f3709867ab8f 100644 +index 4d6f1829d52f1a0ea19c1a0de58e86304360c177..59a7410430ecc8db82f5b0bfcc11ba045b1f4aec 100644 --- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml +++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -@@ -562,6 +562,7 @@ ApplePayEnabled: +@@ -563,6 +563,7 @@ ApplePayEnabled: default: false # FIXME: This is on by default in WebKit2 PLATFORM(COCOA). Perhaps we should consider turning it on for WebKitLegacy as well. @@ -1962,7 +2003,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 AsyncClipboardAPIEnabled: type: bool status: mature -@@ -572,7 +573,7 @@ AsyncClipboardAPIEnabled: +@@ -573,7 +574,7 @@ AsyncClipboardAPIEnabled: default: false WebKit: "PLATFORM(COCOA) || PLATFORM(GTK)" : true @@ -1971,28 +2012,15 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 WebCore: default: false -@@ -1739,9 +1740,10 @@ CrossOriginEmbedderPolicyEnabled: +@@ -1810,6 +1811,7 @@ CrossOriginEmbedderPolicyEnabled: WebCore: default: false +# Playwright: disable setting. CrossOriginOpenerPolicyEnabled: type: bool -- status: stable -+ status: preview - category: security - humanReadableName: "Cross-Origin-Opener-Policy (COOP) header" - humanReadableDescription: "Support for Cross-Origin-Opener-Policy (COOP) header" -@@ -1749,7 +1751,7 @@ CrossOriginOpenerPolicyEnabled: - WebKitLegacy: - default: false - WebKit: -- default: true -+ default: false - WebCore: - default: false - -@@ -1793,7 +1795,7 @@ CustomPasteboardDataEnabled: + status: stable +@@ -1864,7 +1866,7 @@ CustomPasteboardDataEnabled: WebKitLegacy: default: false WebKit: @@ -2001,7 +2029,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 default: false CustomStateSetEnabled: -@@ -1852,6 +1854,7 @@ DOMAudioSessionFullEnabled: +@@ -1923,6 +1925,7 @@ DOMAudioSessionFullEnabled: WebCore: default: false @@ -2009,7 +2037,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 DOMPasteAccessRequestsEnabled: type: bool status: internal -@@ -1863,7 +1866,7 @@ DOMPasteAccessRequestsEnabled: +@@ -1934,7 +1937,7 @@ DOMPasteAccessRequestsEnabled: default: false WebKit: "PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(VISION)": true @@ -2018,7 +2046,16 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 WebCore: default: false -@@ -3232,6 +3235,7 @@ InspectorAttachmentSide: +@@ -2278,7 +2281,7 @@ DirectoryUploadEnabled: + WebKitLegacy: + default: false + WebKit: +- "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)": true ++ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)": true + default: false + WebCore: + default: false +@@ -3304,6 +3307,7 @@ InspectorAttachmentSide: WebKit: default: 0 @@ -2026,7 +2063,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 InspectorStartsAttached: type: bool status: embedder -@@ -3239,7 +3243,7 @@ InspectorStartsAttached: +@@ -3311,7 +3315,7 @@ InspectorStartsAttached: exposed: [ WebKit ] defaultValue: WebKit: @@ -2035,7 +2072,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 InspectorWindowFrame: type: String -@@ -3593,9 +3597,10 @@ LayoutViewportHeightExpansionFactor: +@@ -3650,9 +3654,10 @@ LayoutViewportHeightExpansionFactor: WebCore: default: 0 @@ -2047,7 +2084,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 category: html humanReadableName: "Lazy iframe loading" humanReadableDescription: "Enable lazy iframe loading support" -@@ -3603,9 +3608,9 @@ LazyIframeLoadingEnabled: +@@ -3660,9 +3665,9 @@ LazyIframeLoadingEnabled: WebKitLegacy: default: true WebKit: @@ -2059,7 +2096,16 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 LazyImageLoadingEnabled: type: bool -@@ -5028,6 +5033,19 @@ PitchCorrectionAlgorithm: +@@ -5084,7 +5089,7 @@ PermissionsAPIEnabled: + WebKitLegacy: + default: false + WebKit: +- "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)" : true ++ "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN)" : true + default: false + WebCore: + default: false +@@ -5143,6 +5148,19 @@ PitchCorrectionAlgorithm: WebCore: default: MediaPlayerEnums::PitchCorrectionAlgorithm::BestAllAround @@ -2079,7 +2125,16 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 PointerLockOptionsEnabled: type: bool status: testable -@@ -6778,6 +6796,7 @@ UseCGDisplayListsForDOMRendering: +@@ -5697,7 +5715,7 @@ ScreenOrientationAPIEnabled: + WebKitLegacy: + default: false + WebKit: +- default: WebKit::defaultShouldEnableScreenOrientationAPI() ++ default: true + WebCore: + default: false + +@@ -6946,6 +6964,7 @@ UseCGDisplayListsForDOMRendering: WebKit: default: true @@ -2087,7 +2142,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 UseGPUProcessForCanvasRenderingEnabled: type: bool status: stable -@@ -6790,7 +6809,7 @@ UseGPUProcessForCanvasRenderingEnabled: +@@ -6958,7 +6977,7 @@ UseGPUProcessForCanvasRenderingEnabled: defaultValue: WebKit: "ENABLE(GPU_PROCESS_BY_DEFAULT)": true @@ -2096,7 +2151,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 default: false UseGPUProcessForDOMRenderingEnabled: -@@ -6800,7 +6819,7 @@ UseGPUProcessForDOMRenderingEnabled: +@@ -6968,7 +6987,7 @@ UseGPUProcessForDOMRenderingEnabled: humanReadableName: "GPU Process: DOM Rendering" humanReadableDescription: "Enable DOM rendering in GPU Process" webcoreBinding: none @@ -2105,7 +2160,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 exposed: [ WebKit ] defaultValue: WebKit: -@@ -6832,6 +6851,7 @@ UseGPUProcessForMediaEnabled: +@@ -7000,6 +7019,7 @@ UseGPUProcessForMediaEnabled: "ENABLE(GPU_PROCESS_BY_DEFAULT)": true default: false @@ -2113,7 +2168,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 UseGPUProcessForWebGLEnabled: type: bool status: internal -@@ -6843,7 +6863,7 @@ UseGPUProcessForWebGLEnabled: +@@ -7011,7 +7031,7 @@ UseGPUProcessForWebGLEnabled: default: false WebKit: "ENABLE(GPU_PROCESS_BY_DEFAULT) && ENABLE(GPU_PROCESS_WEBGL_BY_DEFAULT)": true @@ -2123,7 +2178,7 @@ index 110e762586d9dc98b3a11a5cf5d1501334b2463f..870e1950740d745588cbfdc8abd3f370 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 6f547f01a22d1aba86b813fc77679124a643ef72..34fbae99c2e64f2a34a83d878da76f9c75d0bea5 100644 +index 48c40a6bfa8ae0a275bbd8f3ae62f4701916fa48..a32e26e01d83999c575649a9fc0d96c71b655259 100644 --- a/Source/WTF/wtf/PlatformEnable.h +++ b/Source/WTF/wtf/PlatformEnable.h @@ -401,7 +401,7 @@ @@ -2145,10 +2200,10 @@ index 6f547f01a22d1aba86b813fc77679124a643ef72..34fbae99c2e64f2a34a83d878da76f9c #if !defined(ENABLE_TOUCH_ACTION_REGIONS) diff --git a/Source/WTF/wtf/PlatformEnableCocoa.h b/Source/WTF/wtf/PlatformEnableCocoa.h -index d797c28eccac0578c7c504fa0c7b34d517746b17..32e815241e2513c979d1af01ef88b494851a2409 100644 +index 5fef3978fdfb0dc92609688fdf282ea26a0859ef..70190e180003951e48c4084a1788f504730171ca 100644 --- a/Source/WTF/wtf/PlatformEnableCocoa.h +++ b/Source/WTF/wtf/PlatformEnableCocoa.h -@@ -775,7 +775,7 @@ +@@ -781,7 +781,7 @@ #endif #if !defined(ENABLE_SEC_ITEM_SHIM) @@ -2158,19 +2213,19 @@ index d797c28eccac0578c7c504fa0c7b34d517746b17..32e815241e2513c979d1af01ef88b494 #if !defined(ENABLE_SERVER_PRECONNECT) diff --git a/Source/WTF/wtf/PlatformHave.h b/Source/WTF/wtf/PlatformHave.h -index cb5e806040f4e6e2bf94a4c27b05892af7e4301d..81fd915ce2643522b225139661da9f7dedf32469 100644 +index 33d00e530b23f32e279214a88379041ec2a7c3b7..0d7b3f08bef8f010d96d85df5d1672dac87054ec 100644 --- a/Source/WTF/wtf/PlatformHave.h +++ b/Source/WTF/wtf/PlatformHave.h -@@ -419,7 +419,7 @@ +@@ -425,7 +425,7 @@ #define HAVE_FOUNDATION_WITH_SAME_SITE_COOKIE_SUPPORT 1 #endif --#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST) || PLATFORM(VISION) || PLATFORM(GTK) || PLATFORM(WPE) -+#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST) || PLATFORM(VISION) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN) +-#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) ++#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN) #define HAVE_OS_DARK_MODE_SUPPORT 1 #endif -@@ -1274,7 +1274,8 @@ +@@ -1248,7 +1248,8 @@ #endif #if PLATFORM(MAC) @@ -2181,11 +2236,11 @@ index cb5e806040f4e6e2bf94a4c27b05892af7e4301d..81fd915ce2643522b225139661da9f7d #if !defined(HAVE_LOCKDOWN_MODE_PDF_ADDITIONS) && \ diff --git a/Source/WTF/wtf/unicode/UTF8Conversion.h b/Source/WTF/wtf/unicode/UTF8Conversion.h -index f45ef73d81bd02c0b542e98ff01f59d88f57b8a0..0fb91174b8e6641d20b4ee084ec48910cdf7b836 100644 +index 007b8fe3292f326504013be8198ae020f7aacf35..4439f901b4a9a92d881c7cee24ad9cd28149d276 100644 --- a/Source/WTF/wtf/unicode/UTF8Conversion.h +++ b/Source/WTF/wtf/unicode/UTF8Conversion.h -@@ -28,6 +28,10 @@ - #include +@@ -27,6 +27,10 @@ + #include +#ifdef Success @@ -2196,13 +2251,13 @@ index f45ef73d81bd02c0b542e98ff01f59d88f57b8a0..0fb91174b8e6641d20b4ee084ec48910 namespace Unicode { diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make -index 9dd05dd4e7ad824cae7c47d61117a2bbde10c3e5..015b2ce422f594860a77b0382e9a3857f2db4ff6 100644 +index 3c93bf646040ac804afc9c98b855829e98b87269..366b9c6714aa4f378a156577bd932a31ee5737a6 100644 --- a/Source/WebCore/DerivedSources.make +++ b/Source/WebCore/DerivedSources.make -@@ -1149,6 +1149,10 @@ JS_BINDING_IDLS := \ - $(WebCore)/dom/Slotable.idl \ - $(WebCore)/dom/StaticRange.idl \ - $(WebCore)/dom/StringCallback.idl \ +@@ -1156,6 +1156,10 @@ JS_BINDING_IDLS := \ + $(WebCore)/dom/SubscriberCallback.idl \ + $(WebCore)/dom/SubscriptionObserver.idl \ + $(WebCore)/dom/SubscriptionObserverCallback.idl \ + $(WebCore)/dom/Document+Touch.idl \ + $(WebCore)/dom/Touch.idl \ + $(WebCore)/dom/TouchEvent.idl \ @@ -2210,7 +2265,7 @@ index 9dd05dd4e7ad824cae7c47d61117a2bbde10c3e5..015b2ce422f594860a77b0382e9a3857 $(WebCore)/dom/Text.idl \ $(WebCore)/dom/TextDecoder.idl \ $(WebCore)/dom/TextDecoderStream.idl \ -@@ -1735,9 +1739,6 @@ JS_BINDING_IDLS := \ +@@ -1745,9 +1749,6 @@ JS_BINDING_IDLS := \ ADDITIONAL_BINDING_IDLS = \ DocumentTouch.idl \ GestureEvent.idl \ @@ -2221,17 +2276,17 @@ index 9dd05dd4e7ad824cae7c47d61117a2bbde10c3e5..015b2ce422f594860a77b0382e9a3857 vpath %.in $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp -index 32fde85425cbb82eb30bcc7aef58155026d2b7b7..a35495d97fcf0346e4696e26df80cf4a8fb890d6 100644 +index be20114bdebd713c5224893ac73078b03b22e392..4174bdf02631d421a0f1fdadfde21c308e4c7735 100644 --- a/Source/WebCore/Modules/geolocation/Geolocation.cpp +++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp -@@ -357,8 +357,9 @@ bool Geolocation::shouldBlockGeolocationRequests() - bool isSecure = SecurityOrigin::isSecure(document()->url()) || document()->isSecureContext(); - bool hasMixedContent = !document()->foundMixedContent().isEmpty(); +@@ -360,8 +360,9 @@ bool Geolocation::shouldBlockGeolocationRequests() + bool isSecure = SecurityOrigin::isSecure(document->url()) || document->isSecureContext(); + bool hasMixedContent = !document->foundMixedContent().isEmpty(); bool isLocalOrigin = securityOrigin()->isLocal(); + bool isPotentiallyTrustworthy = securityOrigin()->isPotentiallyTrustworthy(); - if (document()->canAccessResource(ScriptExecutionContext::ResourceType::Geolocation) != ScriptExecutionContext::HasResourceAccess::No) { + if (document->canAccessResource(ScriptExecutionContext::ResourceType::Geolocation) != ScriptExecutionContext::HasResourceAccess::No) { - if (isLocalOrigin || (isSecure && !hasMixedContent)) -+ if (isLocalOrigin || isPotentiallyTrustworthy || (isSecure && !hasMixedContent)) ++ if (isLocalOrigin || (isSecure && !hasMixedContent) || isPotentiallyTrustworthy) return false; } @@ -2284,10 +2339,10 @@ index c6a03b56d8358316c9ce422c1a11438bd216f80f..69fbd319b7cd084ca125a8db1b5d92ef set(CSS_VALUE_PLATFORM_DEFINES "HAVE_OS_DARK_MODE_SUPPORT=1") diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt -index eece14fded1942140af81dede0861fb5f79fb532..cd3c5ebaccd268695d9e7bc0b96f30522c42e43e 100644 +index 8ca60190e2f9110b74e37350ae12de7ff324de0e..0ad2e7621561b0a0eb67dc39555a2b99169df9c2 100644 --- a/Source/WebCore/SourcesCocoa.txt +++ b/Source/WebCore/SourcesCocoa.txt -@@ -713,3 +713,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm +@@ -716,3 +716,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify platform/graphics/cocoa/GraphicsContextGLCocoa.mm @no-unify platform/graphics/cv/GraphicsContextGLCVCocoa.cpp @no-unify @@ -2344,10 +2399,10 @@ index 92f1879df295fc63a9194dc54d3f7499c5fe3041..67c40d056aee6a8149ed1ff16ce4c835 +JSSpeechSynthesisEventInit.cpp +// Playwright: end. diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf284999d5d763 100644 +index 2dd82a349b4c111364b9032a5e5a3d81e238798e..f18701e5aa5a6dd0bd2619a0cfb92316aee41ffd 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -@@ -6216,6 +6216,13 @@ +@@ -6198,6 +6198,13 @@ EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; }; EFCC6C8F20FE914400A2321B /* CanvasActivityRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -2361,7 +2416,7 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 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, ); }; }; -@@ -20126,6 +20133,14 @@ +@@ -20153,6 +20160,14 @@ EDEC98020AED7E170059137F /* WebCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCorePrefix.h; sourceTree = ""; tabWidth = 4; usesTabs = 0; }; 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 = ""; }; @@ -2376,7 +2431,7 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 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 = ""; }; -@@ -27745,6 +27760,11 @@ +@@ -27805,6 +27820,11 @@ BC4A5324256055590028C592 /* TextDirectionSubmenuInclusionBehavior.h */, 2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */, 2D4F96F21A1ECC240098BF88 /* TextIndicator.h */, @@ -2388,7 +2443,7 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 F48570A42644C76D00C05F71 /* TranslationContextMenuInfo.h */, F4E1965F21F26E4E00285078 /* UndoItem.cpp */, 2ECDBAD521D8906300F00ECD /* UndoItem.h */, -@@ -34075,6 +34095,8 @@ +@@ -34147,6 +34167,8 @@ 29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */, 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */, 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */, @@ -2397,7 +2452,7 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 0FD7C21D23CE41E30096D102 /* PlatformWheelEvent.cpp */, 935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */, F491A66A2A9FEFA300F96146 /* PlatformWheelEvent.serialization.in */, -@@ -36745,6 +36767,7 @@ +@@ -36817,6 +36839,7 @@ AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */, 6BDB5DC1227BD3B800919770 /* DocumentStorageAccess.cpp */, 6BDB5DC0227BD3B800919770 /* DocumentStorageAccess.h */, @@ -2405,7 +2460,7 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 7CE7FA5B1EF882300060C9D6 /* DocumentTouch.cpp */, 7CE7FA591EF882300060C9D6 /* DocumentTouch.h */, A8185F3209765765005826D9 /* DocumentType.cpp */, -@@ -41482,6 +41505,8 @@ +@@ -41547,6 +41570,8 @@ F4E90A3C2B52038E002DA469 /* PlatformTextAlternatives.h in Headers */, 0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */, 074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */, @@ -2414,7 +2469,7 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 CDD08ABD277E542600EA3755 /* PlatformTrackConfiguration.h in Headers */, CD1F9B022700323D00617EB6 /* PlatformVideoColorPrimaries.h in Headers */, CD1F9B01270020B700617EB6 /* PlatformVideoColorSpace.h in Headers */, -@@ -42762,6 +42787,7 @@ +@@ -42826,6 +42851,7 @@ 0F54DD081881D5F5003EEDBB /* Touch.h in Headers */, 71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */, 0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */, @@ -2422,7 +2477,7 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */, 070334D71459FFD5008D8D45 /* TrackBase.h in Headers */, BE88E0C21715CE2600658D98 /* TrackListBase.h in Headers */, -@@ -43910,6 +43936,8 @@ +@@ -43980,6 +44006,8 @@ 2D22830323A8470700364B7E /* CursorMac.mm in Sources */, 5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */, 07E4BDBF2A3A5FAB000D5509 /* DictationCaretAnimator.cpp in Sources */, @@ -2431,7 +2486,7 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */, 4667EA3E2968D9DA00BAB1E2 /* GameControllerHapticEffect.mm in Sources */, 46FE73D32968E52000B8064C /* GameControllerHapticEngines.mm in Sources */, -@@ -43997,6 +44025,9 @@ +@@ -44068,6 +44096,9 @@ CE88EE262414467B007F29C2 /* TextAlternativeWithRange.mm in Sources */, BE39137129B267F500FA5D4F /* TextTransformCocoa.cpp in Sources */, 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */, @@ -2442,10 +2497,10 @@ index 8807578bc8e503fce83e9acc30029cef75b7f071..7fffb6499c200dca0c3ee777feaf2849 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 9253fbb9de00b2768dd67c6efa20a2242e2e6621..c758a4e9b6f779458a611b6458ba89de1c17e4c8 100644 +index a934d32a2b01e6273e1d97a7b8fd7e0999495dc5..379eee720dda27b29b32f26ab5a10d83ce78f4b9 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityObject.cpp -@@ -66,6 +66,7 @@ +@@ -67,6 +67,7 @@ #include "HTMLSlotElement.h" #include "HTMLTextAreaElement.h" #include "HitTestResult.h" @@ -2453,7 +2508,7 @@ index 9253fbb9de00b2768dd67c6efa20a2242e2e6621..c758a4e9b6f779458a611b6458ba89de #include "LocalFrame.h" #include "LocalizedStrings.h" #include "MathMLNames.h" -@@ -4075,9 +4076,14 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const +@@ -3968,9 +3969,14 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const if (roleValue() == AccessibilityRole::ApplicationDialog) return AccessibilityObjectInclusion::IncludeObject; @@ -2470,8 +2525,30 @@ index 9253fbb9de00b2768dd67c6efa20a2242e2e6621..c758a4e9b6f779458a611b6458ba89de bool AccessibilityObject::accessibilityIsIgnored() const { AXComputedObjectAttributeCache* attributeCache = nullptr; +diff --git a/Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp b/Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp +index 7641906564fb1e480f56923343a8ee6149f60820..ed530124becb719e66b211f468c24376887c4cc4 100644 +--- a/Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp ++++ b/Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp +@@ -289,7 +289,7 @@ String AccessibilityObjectAtspi::text() const + if (!value.isNull()) + return value; + +- auto text = m_coreObject->textUnderElement(TextUnderElementMode(TextUnderElementMode::Children::IncludeAllChildren)); ++ auto text = m_coreObject->textUnderElement({ TextUnderElementMode::Children::IncludeAllChildren }); + if (auto* renderer = m_coreObject->renderer()) { + if (is(*renderer) && downcast(*renderer).markerRenderer()) { + if (renderer->style().direction() == TextDirection::LTR) { +@@ -315,7 +315,7 @@ unsigned AccessibilityObject::getLengthForTextRange() const + textLength = downcast(*renderer).text().length(); + + if (!textLength && allowsTextRanges()) +- textLength = textUnderElement(TextUnderElementMode(TextUnderElementMode::Children::IncludeAllChildren)).length(); ++ textLength = textUnderElement({ TextUnderElementMode::Children::IncludeAllChildren }).length(); + + return textLength; + } diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h -index f20ac9d4d61a6f396e9ed796c8e6c5b8a7ea0577..3151b5e54ea17c0d979d22a0cc43c5ce0688c183 100644 +index bec74918c24d17a88bb1583504d00e2a11a5e6c6..8c86fc1552c091e6751e87c60af728b4ce37f2a1 100644 --- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h +++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h @@ -183,6 +183,8 @@ namespace WebCore { @@ -2484,10 +2561,10 @@ index f20ac9d4d61a6f396e9ed796c8e6c5b8a7ea0577..3151b5e54ea17c0d979d22a0cc43c5ce macro(DynamicsCompressorNode) \ macro(ElementInternals) \ diff --git a/Source/WebCore/css/query/MediaQueryFeatures.cpp b/Source/WebCore/css/query/MediaQueryFeatures.cpp -index 9892fda4291cae0e0d338fac8b0f98cd0126807d..7ecfd659809ab30e82a9c00ec7710292a1bd5611 100644 +index 450c429a76a97ba079087eaecc0deca236f3a419..726765635432192654ee218874813a1d09a83af4 100644 --- a/Source/WebCore/css/query/MediaQueryFeatures.cpp +++ b/Source/WebCore/css/query/MediaQueryFeatures.cpp -@@ -368,7 +368,11 @@ const FeatureSchema& forcedColors() +@@ -364,7 +364,11 @@ const FeatureSchema& forcedColors() static MainThreadNeverDestroyed schema { "forced-colors"_s, FixedVector { CSSValueNone, CSSValueActive }, @@ -2500,7 +2577,7 @@ index 9892fda4291cae0e0d338fac8b0f98cd0126807d..7ecfd659809ab30e82a9c00ec7710292 return MatchingIdentifiers { CSSValueNone }; } }; -@@ -547,6 +551,9 @@ const FeatureSchema& prefersReducedMotion() +@@ -546,6 +550,9 @@ const FeatureSchema& prefersReducedMotion() [](auto& context) { bool userPrefersReducedMotion = [&] { Ref frame = *context.document->frame(); @@ -2544,7 +2621,7 @@ index 6ca2550bf509381165e5da22cc894ccf6378f45c..535bd1b05e8d90b291235cfc3cb42508 static Ref createForDrop(const Document&, std::unique_ptr&&, OptionSet, bool draggingFiles); static Ref createForUpdatingDropTarget(const Document&, std::unique_ptr&&, OptionSet, bool draggingFiles); diff --git a/Source/WebCore/dom/DeviceMotionEvent.idl b/Source/WebCore/dom/DeviceMotionEvent.idl -index ea39a33a6250b4d10b20802f98aa9a5d57e63a7b..300a763508d311fd7b34cb3df3cc93080bb52930 100644 +index d59cba0b1c3e1876614476cd887fa1b2a9619d0c..565987a3f9ef7dc29edf8315cebe51b00953dc84 100644 --- a/Source/WebCore/dom/DeviceMotionEvent.idl +++ b/Source/WebCore/dom/DeviceMotionEvent.idl @@ -25,6 +25,7 @@ @@ -2604,7 +2681,7 @@ 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 c35c7851f168954a0c5265ea218a2173b7b079a8..500b267351d2e4ac9864129650b6c00627a8ea6f 100644 +index 204b5f08ba950ead5f7d853d3c7fc9274ce46a26..e2f117a2a3e221fc4ca14b02c82cda952f0cd63b 100644 --- a/Source/WebCore/dom/PointerEvent.cpp +++ b/Source/WebCore/dom/PointerEvent.cpp @@ -27,9 +27,11 @@ @@ -2619,9 +2696,9 @@ index c35c7851f168954a0c5265ea218a2173b7b079a8..500b267351d2e4ac9864129650b6c006 #include namespace WebCore { -@@ -122,4 +124,51 @@ PointerEvent::PointerEvent(const AtomString& type, PointerID pointerId, const St - - PointerEvent::~PointerEvent() = default; +@@ -133,4 +135,51 @@ Vector> PointerEvent::getCoalescedEvents() + return m_coalescedEvents; + } +#if ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS_FAMILY) && !PLATFORM(WPE) + @@ -2672,7 +2749,7 @@ index c35c7851f168954a0c5265ea218a2173b7b079a8..500b267351d2e4ac9864129650b6c006 + } // namespace WebCore diff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h -index 261a8c7e8946cac87b9ebc5fc5e3b697f326b7f4..02645d3bdce44f40a648e720e99a6b296f371fb2 100644 +index c54bbf8060253b9000f3da9be8ff327a2625ff86..6b05fc5f61444ea9dc7775491801c585ae44045e 100644 --- a/Source/WebCore/dom/PointerEvent.h +++ b/Source/WebCore/dom/PointerEvent.h @@ -34,6 +34,8 @@ @@ -2684,8 +2761,8 @@ index 261a8c7e8946cac87b9ebc5fc5e3b697f326b7f4..02645d3bdce44f40a648e720e99a6b29 #endif #if ENABLE(TOUCH_EVENTS) && PLATFORM(WPE) -@@ -86,7 +88,7 @@ public: - static Ref create(const AtomString& type, MouseButton, const MouseEvent&, PointerID, const String& pointerType); +@@ -88,7 +90,7 @@ public: + static Ref create(const AtomString& type, MouseButton, const MouseEvent&, PointerID, const String& pointerType, CanBubble, IsCancelable); static Ref create(const AtomString& type, PointerID, const String& pointerType, IsPrimary = IsPrimary::No); -#if ENABLE(TOUCH_EVENTS) && (PLATFORM(IOS_FAMILY) || PLATFORM(WPE)) @@ -2693,9 +2770,9 @@ index 261a8c7e8946cac87b9ebc5fc5e3b697f326b7f4..02645d3bdce44f40a648e720e99a6b29 static Ref create(const PlatformTouchEvent&, unsigned touchIndex, bool isPrimary, Ref&&, const IntPoint& touchDelta = { }); static Ref create(const AtomString& type, const PlatformTouchEvent&, unsigned touchIndex, bool isPrimary, Ref&&, const IntPoint& touchDelta = { }); #endif -@@ -140,7 +142,7 @@ private: +@@ -144,7 +146,7 @@ private: PointerEvent(const AtomString&, Init&&); - PointerEvent(const AtomString& type, MouseButton, const MouseEvent&, PointerID, const String& pointerType); + PointerEvent(const AtomString& type, MouseButton, const MouseEvent&, PointerID, const String& pointerType, CanBubble, IsCancelable); PointerEvent(const AtomString& type, PointerID, const String& pointerType, IsPrimary); -#if ENABLE(TOUCH_EVENTS) && (PLATFORM(IOS_FAMILY) || PLATFORM(WPE)) +#if ENABLE(TOUCH_EVENTS) @@ -2730,7 +2807,7 @@ index 7813532cc52d582c42aebc979a1ecd1137765f08..c01cbd53ad2430a6ffab9a80fc73e74a #endif // USE(LIBWPE) diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp -index dde92a4942d3f6679b6ef2455fa15d023544dfbc..c6ed18b40209195d1cf5c7785091d37fd40dad80 100644 +index 7a26cfbbaf3d9583064a5eb30a049b5ac04847f0..1377da39ae4cc134b87358871fdb39431161244b 100644 --- a/Source/WebCore/html/FileInputType.cpp +++ b/Source/WebCore/html/FileInputType.cpp @@ -37,6 +37,7 @@ @@ -2741,7 +2818,7 @@ index dde92a4942d3f6679b6ef2455fa15d023544dfbc..c6ed18b40209195d1cf5c7785091d37f #include "LocalFrame.h" #include "LocalizedStrings.h" #include "MIMETypeRegistry.h" -@@ -157,6 +158,11 @@ void FileInputType::handleDOMActivateEvent(Event& event) +@@ -158,6 +159,11 @@ void FileInputType::handleDOMActivateEvent(Event& event) if (input.isDisabledFormControl()) return; @@ -2753,7 +2830,7 @@ index dde92a4942d3f6679b6ef2455fa15d023544dfbc..c6ed18b40209195d1cf5c7785091d37f if (!UserGestureIndicator::processingUserGesture()) return; -@@ -345,7 +351,9 @@ void FileInputType::setFiles(RefPtr&& files, RequestIcon shouldRequest +@@ -346,7 +352,9 @@ void FileInputType::setFiles(RefPtr&& files, RequestIcon shouldRequest pathsChanged = true; else { for (unsigned i = 0; i < length; ++i) { @@ -2765,7 +2842,7 @@ index dde92a4942d3f6679b6ef2455fa15d023544dfbc..c6ed18b40209195d1cf5c7785091d37f break; } diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp -index 3844ae7bab48f46b77cfd85530e4ab19392a71dd..8d705215457f89711e78e3bee9c983d131b08245 100644 +index 79af2f2040520b6b1bba55c7fbf656828b95d885..1b41cedfe4fd49c1f5073a513df5a80fb492b973 100644 --- a/Source/WebCore/inspector/InspectorController.cpp +++ b/Source/WebCore/inspector/InspectorController.cpp @@ -287,6 +287,8 @@ void InspectorController::disconnectFrontend(FrontendChannel& frontendChannel) @@ -2846,10 +2923,10 @@ index 3a981b5bf5ca0bbf4d1c9f0b125564742cd8cad9..f8fc2ca6700461627933f149c5837075 } // namespace WebCore diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp -index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3ca973aaea 100644 +index da310c6df500f80d2ae762c890ce9733d892ebd1..50db06b983b2eb4ac89942df94838e009bc82175 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.cpp +++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp -@@ -597,6 +597,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i +@@ -598,6 +598,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i pageAgent->applyUserAgentOverride(userAgent); } @@ -2862,7 +2939,7 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents& instrumentingAgents, AtomString& media) { if (auto* pageAgent = instrumentingAgents.enabledPageAgent()) -@@ -680,6 +686,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen +@@ -681,6 +687,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this. } @@ -2875,7 +2952,7 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c void InspectorInstrumentation::willLoadXHRSynchronouslyImpl(InstrumentingAgents& instrumentingAgents) { if (auto* networkAgent = instrumentingAgents.enabledNetworkAgent()) -@@ -712,20 +724,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& +@@ -713,20 +725,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { @@ -2899,7 +2976,7 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c } void InspectorInstrumentation::frameDetachedFromParentImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) -@@ -808,12 +817,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins +@@ -809,12 +818,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins pageDOMDebuggerAgent->frameDocumentUpdated(frame); } @@ -2912,7 +2989,7 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { if (frame.isMainFrame()) { -@@ -844,10 +847,10 @@ void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& inst +@@ -845,10 +848,10 @@ void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& inst inspectorPageAgent->frameStoppedLoading(frame); } @@ -2925,7 +3002,7 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c } void InspectorInstrumentation::frameClearedScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame) -@@ -862,6 +865,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA +@@ -863,6 +866,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA inspectorPageAgent->accessibilitySettingsDidChange(); } @@ -2938,7 +3015,20 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents) { -@@ -1050,6 +1059,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent +@@ -915,6 +924,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru + networkAgent->interceptResponse(response, identifier, WTFMove(handler)); + } + ++void InspectorInstrumentation::setStoppingLoadingDueToProcessSwapImpl(InstrumentingAgents& instrumentingAgents, bool value) ++{ ++ if (auto* networkAgent = instrumentingAgents.enabledNetworkAgent()) ++ networkAgent->setStoppingLoadingDueToProcessSwap(value); ++} ++ + // JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes. + static bool isConsoleAssertMessage(MessageSource source, MessageType type) + { +@@ -1051,6 +1066,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent canvasAgent->consoleStopRecordingCanvas(context); } @@ -2951,7 +3041,7 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c void InspectorInstrumentation::didOpenDatabaseImpl(InstrumentingAgents& instrumentingAgents, Database& database) { if (auto* databaseAgent = instrumentingAgents.enabledDatabaseAgent()) -@@ -1356,6 +1371,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins +@@ -1357,6 +1378,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins layerTreeAgent->renderLayerDestroyed(renderLayer); } @@ -2988,7 +3078,7 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(WorkerOrWorkletGlobalScope& globalScope) { return globalScope.inspectorController().m_instrumentingAgents; -@@ -1367,6 +1412,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(Page& page) +@@ -1373,6 +1424,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(Page& page) return page.inspectorController().m_instrumentingAgents.get(); } @@ -3003,7 +3093,7 @@ index 8c7b186092793bf301511be969030c92674ce211..bcad9353cd568ed435b42d5b9d505b3c { // Using RefPtr makes us hit the m_inRemovedLastRefFunction assert. diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h -index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114fca4d82a 100644 +index 156e222e4383bee7448347d84cb052b0d9b9ae70..9bce3a168c314fc34043578c248d69cb89b48426 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.h +++ b/Source/WebCore/inspector/InspectorInstrumentation.h @@ -31,6 +31,7 @@ @@ -3030,7 +3120,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 class HTTPHeaderMap; class InspectorTimelineAgent; class InstrumentingAgents; -@@ -192,6 +195,7 @@ public: +@@ -193,6 +196,7 @@ public: static void didRecalculateStyle(Document&); static void didScheduleStyleRecalculation(Document&); static void applyUserAgentOverride(LocalFrame&, String&); @@ -3038,22 +3128,22 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 static void applyEmulatedMedia(LocalFrame&, AtomString&); static void flexibleBoxRendererBeganLayout(const RenderObject&); -@@ -204,6 +208,7 @@ public: +@@ -205,6 +209,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&); + static void didReceiveMainResourceError(LocalFrame&, const ResourceError&); - static void willSendRequest(WorkerOrWorkletGlobalScope&, ResourceLoaderIdentifier, ResourceRequest&); - static void didReceiveResourceResponse(WorkerOrWorkletGlobalScope&, ResourceLoaderIdentifier, const ResourceResponse&); -@@ -230,13 +235,13 @@ public: + static void willSendRequest(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, ResourceRequest&); + static void didReceiveResourceResponse(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, const ResourceResponse&); +@@ -231,13 +236,13 @@ public: static void frameDetachedFromParent(LocalFrame&); static void didCommitLoad(LocalFrame&, DocumentLoader*); static void frameDocumentUpdated(LocalFrame&); - static void loaderDetachedFromFrame(LocalFrame&, DocumentLoader&); static void frameStartedLoading(LocalFrame&); static void frameStoppedLoading(LocalFrame&); - static void didCompleteRenderingFrame(LocalFrame&); + static void didCompleteRenderingFrame(Frame&); - static void frameScheduledNavigation(Frame&, Seconds delay); + static void frameScheduledNavigation(Frame&, Seconds delay, bool targetIsCurrentFrame); static void frameClearedScheduledNavigation(Frame&); @@ -3062,7 +3152,15 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) static void defaultAppearanceDidChange(Page&); #endif -@@ -268,6 +273,7 @@ public: +@@ -248,6 +253,7 @@ public: + static bool shouldInterceptResponse(const LocalFrame&, const ResourceResponse&); + static void interceptRequest(ResourceLoader&, Function&&); + static void interceptResponse(const LocalFrame&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); ++ static void setStoppingLoadingDueToProcessSwap(Page*, bool); + + 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); static void consoleStartRecordingCanvas(CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options); static void consoleStopRecordingCanvas(CanvasRenderingContext&); @@ -3070,7 +3168,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 static void performanceMark(ScriptExecutionContext&, const String&, std::optional, LocalFrame*); -@@ -326,6 +332,12 @@ public: +@@ -327,6 +334,12 @@ public: static void layerTreeDidChange(Page*); static void renderLayerDestroyed(Page*, const RenderLayer&); @@ -3083,7 +3181,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 static void frontendCreated(); static void frontendDeleted(); static bool hasFrontends() { return InspectorInstrumentationPublic::hasFrontends(); } -@@ -342,6 +354,8 @@ public: +@@ -343,6 +356,8 @@ public: static void registerInstrumentingAgents(InstrumentingAgents&); static void unregisterInstrumentingAgents(InstrumentingAgents&); @@ -3092,7 +3190,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 private: static void didClearWindowObjectInWorldImpl(InstrumentingAgents&, LocalFrame&, DOMWrapperWorld&); static bool isDebuggerPausedImpl(InstrumentingAgents&); -@@ -421,6 +435,7 @@ private: +@@ -422,6 +437,7 @@ private: static void didRecalculateStyleImpl(InstrumentingAgents&); static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&); static void applyUserAgentOverrideImpl(InstrumentingAgents&, String&); @@ -3100,7 +3198,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 static void applyEmulatedMediaImpl(InstrumentingAgents&, AtomString&); static void flexibleBoxRendererBeganLayoutImpl(InstrumentingAgents&, const RenderObject&); -@@ -435,6 +450,7 @@ private: +@@ -436,6 +452,7 @@ private: static void didReceiveDataImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const SharedBuffer*, int encodedDataLength); static void didFinishLoadingImpl(InstrumentingAgents&, ResourceLoaderIdentifier, DocumentLoader*, const NetworkLoadMetrics&, ResourceLoader*); static void didFailLoadingImpl(InstrumentingAgents&, ResourceLoaderIdentifier, DocumentLoader*, const ResourceError&); @@ -3108,7 +3206,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&); static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&); static void scriptImportedImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const String& sourceString); -@@ -445,13 +461,13 @@ private: +@@ -446,13 +463,13 @@ private: static void frameDetachedFromParentImpl(InstrumentingAgents&, LocalFrame&); static void didCommitLoadImpl(InstrumentingAgents&, LocalFrame&, DocumentLoader*); static void frameDocumentUpdatedImpl(InstrumentingAgents&, LocalFrame&); @@ -3124,7 +3222,15 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) static void defaultAppearanceDidChangeImpl(InstrumentingAgents&); #endif -@@ -478,6 +494,7 @@ private: +@@ -463,6 +480,7 @@ private: + static bool shouldInterceptResponseImpl(InstrumentingAgents&, const ResourceResponse&); + static void interceptRequestImpl(InstrumentingAgents&, ResourceLoader&, Function&&); + static void interceptResponseImpl(InstrumentingAgents&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); ++ static void setStoppingLoadingDueToProcessSwapImpl(InstrumentingAgents&, bool); + + static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr); + +@@ -479,6 +497,7 @@ private: static void stopProfilingImpl(InstrumentingAgents&, JSC::JSGlobalObject*, const String& title); static void consoleStartRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options); static void consoleStopRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&); @@ -3132,7 +3238,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 static void performanceMarkImpl(InstrumentingAgents&, const String& label, std::optional, LocalFrame*); -@@ -536,6 +553,12 @@ private: +@@ -537,6 +556,12 @@ private: static void layerTreeDidChangeImpl(InstrumentingAgents&); static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&); @@ -3144,8 +3250,8 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 + static InstrumentingAgents& instrumentingAgents(Page&); static InstrumentingAgents& instrumentingAgents(WorkerOrWorkletGlobalScope&); - -@@ -1068,6 +1091,13 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame, + static InstrumentingAgents& instrumentingAgents(ServiceWorkerGlobalScope&); +@@ -1070,6 +1095,13 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame, applyUserAgentOverrideImpl(*agents, userAgent); } @@ -3159,7 +3265,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 inline void InspectorInstrumentation::applyEmulatedMedia(LocalFrame& frame, AtomString& media) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1170,6 +1200,13 @@ inline void InspectorInstrumentation::didFailLoading(WorkerOrWorkletGlobalScope& +@@ -1172,6 +1204,13 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& g didFailLoadingImpl(instrumentingAgents(globalScope), identifier, nullptr, error); } @@ -3173,7 +3279,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(LocalFrame& frame, ResourceLoaderIdentifier identifier, DocumentLoader& loader, const ResourceResponse& response) { // Treat the same as didReceiveResponse. -@@ -1260,13 +1297,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame) +@@ -1262,13 +1301,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame) frameDocumentUpdatedImpl(*agents, frame); } @@ -3187,7 +3293,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 inline void InspectorInstrumentation::frameStartedLoading(LocalFrame& frame) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1288,11 +1318,11 @@ inline void InspectorInstrumentation::frameStoppedLoading(LocalFrame& frame) +@@ -1290,11 +1322,11 @@ inline void InspectorInstrumentation::frameStoppedLoading(LocalFrame& frame) frameStoppedLoadingImpl(*agents, frame); } @@ -3201,7 +3307,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 } inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& frame) -@@ -1308,6 +1338,13 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page) +@@ -1310,6 +1342,13 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page) accessibilitySettingsDidChangeImpl(instrumentingAgents(page)); } @@ -3215,7 +3321,21 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) inline void InspectorInstrumentation::defaultAppearanceDidChange(Page& page) { -@@ -1696,6 +1733,11 @@ inline void InspectorInstrumentation::performanceMark(ScriptExecutionContext& co +@@ -1362,6 +1401,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame, + interceptResponseImpl(*agents, response, identifier, WTFMove(handler)); + } + ++inline void InspectorInstrumentation::setStoppingLoadingDueToProcessSwap(Page* page, bool value) ++{ ++ ASSERT(InspectorInstrumentationPublic::hasFrontends()); ++ if (auto* agents = instrumentingAgents(page)) ++ setStoppingLoadingDueToProcessSwapImpl(*agents, value); ++} ++ + inline void InspectorInstrumentation::didOpenDatabase(Database& database) + { + FAST_RETURN_IF_NO_FRONTENDS(void()); +@@ -1698,6 +1744,11 @@ inline void InspectorInstrumentation::performanceMark(ScriptExecutionContext& co performanceMarkImpl(*agents, label, WTFMove(startTime), frame); } @@ -3227,7 +3347,7 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 inline void InspectorInstrumentation::didRequestAnimationFrame(Document& document, int callbackId) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1752,6 +1794,42 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren +@@ -1754,6 +1805,42 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren renderLayerDestroyedImpl(*agents, renderLayer); } @@ -3270,15 +3390,76 @@ index 7aa2d9e599359d9302cbdde8a7a0b9399e37d313..7b4ec6ee9adb5687e16eb0fe746a3114 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgents(ScriptExecutionContext* context) { return context ? instrumentingAgents(*context) : nullptr; +diff --git a/Source/WebCore/inspector/InspectorInstrumentationWebKit.cpp b/Source/WebCore/inspector/InspectorInstrumentationWebKit.cpp +index a67a1244fa526ad5759068e97e0d220f59565d6e..0048589109fccb9472fe35a410337771b1063d72 100644 +--- a/Source/WebCore/inspector/InspectorInstrumentationWebKit.cpp ++++ b/Source/WebCore/inspector/InspectorInstrumentationWebKit.cpp +@@ -50,4 +50,9 @@ void InspectorInstrumentationWebKit::interceptResponseInternal(const LocalFrame& + InspectorInstrumentation::interceptResponse(frame, response, identifier, WTFMove(handler)); + } + ++void InspectorInstrumentationWebKit::setStoppingLoadingDueToProcessSwapInternal(Page* page, bool value) ++{ ++ InspectorInstrumentation::setStoppingLoadingDueToProcessSwap(page, value); ++} ++ + } // namespace WebCore +diff --git a/Source/WebCore/inspector/InspectorInstrumentationWebKit.h b/Source/WebCore/inspector/InspectorInstrumentationWebKit.h +index c028341e84e59a6b1b16107fd74feb21f70b12ab..d385418ac34e8f315f201801a2c65226c8f6fee2 100644 +--- a/Source/WebCore/inspector/InspectorInstrumentationWebKit.h ++++ b/Source/WebCore/inspector/InspectorInstrumentationWebKit.h +@@ -33,6 +33,7 @@ + namespace WebCore { + + class LocalFrame; ++class Page; + class ResourceLoader; + class ResourceRequest; + class ResourceResponse; +@@ -44,12 +45,14 @@ public: + static bool shouldInterceptResponse(const LocalFrame*, const ResourceResponse&); + static void interceptRequest(ResourceLoader&, Function&&); + static void interceptResponse(const LocalFrame*, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); ++ static void setStoppingLoadingDueToProcessSwap(Page*, bool); + + private: + static bool shouldInterceptRequestInternal(const ResourceLoader&); + static bool shouldInterceptResponseInternal(const LocalFrame&, const ResourceResponse&); + static void interceptRequestInternal(ResourceLoader&, Function&&); + static void interceptResponseInternal(const LocalFrame&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); ++ static void setStoppingLoadingDueToProcessSwapInternal(Page*, bool); + }; + + inline bool InspectorInstrumentationWebKit::shouldInterceptRequest(const ResourceLoader& loader) +@@ -79,4 +82,10 @@ inline void InspectorInstrumentationWebKit::interceptResponse(const LocalFrame* + interceptResponseInternal(*frame, response, identifier, WTFMove(handler)); + } + ++inline void InspectorInstrumentationWebKit::setStoppingLoadingDueToProcessSwap(Page* page, bool value) ++{ ++ FAST_RETURN_IF_NO_FRONTENDS(void()); ++ setStoppingLoadingDueToProcessSwapInternal(page, value); ++} ++ + } diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp -index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140efd1d31b 100644 +index ec5000cb553f244224ac2dc5be229c11c42e5d7f..cf6bc9545f04ad7fdba7c2dfaf46ac45e158f15e 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp -@@ -65,10 +65,14 @@ +@@ -55,6 +55,7 @@ + #include "ContainerNode.h" + #include "Cookie.h" + #include "CookieJar.h" ++#include "DirectoryFileListCreator.h" + #include "DOMEditor.h" + #include "DOMException.h" + #include "DOMPatchSupport.h" +@@ -65,10 +66,15 @@ #include "Event.h" #include "EventListener.h" #include "EventNames.h" +#include "File.h" ++#include +#include "FileList.h" #include "FrameTree.h" #include "FullscreenManager.h" @@ -3289,7 +3470,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 #include "HTMLMediaElement.h" #include "HTMLNames.h" #include "HTMLScriptElement.h" -@@ -102,12 +106,14 @@ +@@ -102,12 +108,14 @@ #include "Pasteboard.h" #include "PseudoElement.h" #include "RenderGrid.h" @@ -3304,7 +3485,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 #include "StaticNodeList.h" #include "StyleProperties.h" #include "StyleResolver.h" -@@ -145,7 +151,8 @@ using namespace HTMLNames; +@@ -146,7 +154,8 @@ using namespace HTMLNames; static const size_t maxTextSize = 10000; static const UChar horizontalEllipsisUChar[] = { horizontalEllipsis, 0 }; @@ -3314,7 +3495,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 { if (!colorObject) return std::nullopt; -@@ -164,7 +171,7 @@ static std::optional parseColor(RefPtr&& colorObject) +@@ -165,7 +174,7 @@ static std::optional parseColor(RefPtr&& colorObject) static std::optional parseRequiredConfigColor(const String& fieldName, JSON::Object& configObject) { @@ -3323,7 +3504,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 } static Color parseOptionalConfigColor(const String& fieldName, JSON::Object& configObject) -@@ -192,6 +199,20 @@ static bool parseQuad(Ref&& quadArray, FloatQuad* quad) +@@ -193,6 +202,20 @@ static bool parseQuad(Ref&& quadArray, FloatQuad* quad) return true; } @@ -3344,7 +3525,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 class RevalidateStyleAttributeTask { WTF_MAKE_FAST_ALLOCATED; public: -@@ -466,6 +487,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin +@@ -467,6 +490,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin return node.get(); } @@ -3365,7 +3546,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 Document* InspectorDOMAgent::assertDocument(Inspector::Protocol::ErrorString& errorString, Inspector::Protocol::DOM::NodeId nodeId) { RefPtr node = assertNode(errorString, nodeId); -@@ -1540,16 +1575,7 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::o +@@ -1541,16 +1578,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; @@ -3383,7 +3564,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 if (!node) return makeUnexpected(errorString); -@@ -1804,15 +1830,155 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setInspectedNode(Ins +@@ -1805,15 +1833,155 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setInspectedNode(Ins return { }; } @@ -3542,7 +3723,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 if (!object) return makeUnexpected("Missing injected script for given nodeId"_s); -@@ -3061,7 +3227,7 @@ Inspector::Protocol::ErrorStringOr InspectorDO +@@ -3079,7 +3247,7 @@ Inspector::Protocol::ErrorStringOr InspectorDO return makeUnexpected("Missing node for given path"_s); } @@ -3551,7 +3732,7 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 { Document* document = &node->document(); if (auto* templateHost = document->templateDocumentHost()) -@@ -3070,12 +3236,18 @@ RefPtr InspectorDOMAgent::resolveNod +@@ -3088,12 +3256,18 @@ RefPtr InspectorDOMAgent::resolveNod if (!frame) return nullptr; @@ -3573,24 +3754,32 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 } Node* InspectorDOMAgent::scriptValueAsNode(JSC::JSValue value) -@@ -3183,4 +3355,57 @@ Inspector::Protocol::ErrorStringOr> In +@@ -3201,4 +3375,89 @@ Inspector::Protocol::ErrorStringOr> In #endif } -+Protocol::ErrorStringOr InspectorDOMAgent::setInputFiles(const String& objectId, RefPtr&& files, RefPtr&& paths) { ++void InspectorDOMAgent::setInputFiles(const String& objectId, RefPtr&& files, RefPtr&& paths, Ref&& callback) { + InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); -+ if (injectedScript.hasNoValue()) -+ return makeUnexpected("Can not find element's context for given id"_s); ++ if (injectedScript.hasNoValue()) { ++ callback->sendFailure("Can not find element's context for given id"_s); ++ return; ++ } + + Node* node = scriptValueAsNode(injectedScript.findObjectById(objectId)); -+ if (!node) -+ return makeUnexpected("Can not find element for given id"_s); ++ if (!node) { ++ callback->sendFailure("Can not find element for given id"_s); ++ return; ++ } + -+ if (node->nodeType() != Node::ELEMENT_NODE || node->nodeName() != "INPUT"_s) -+ return makeUnexpected("Not an input node"_s); ++ if (node->nodeType() != Node::ELEMENT_NODE || node->nodeName() != "INPUT"_s) { ++ callback->sendFailure("Not an input node"_s); ++ return; ++ } + -+ if (!(bool(files) ^ bool(paths))) -+ return makeUnexpected("Exactly one of files and paths should be specified"_s); ++ 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; @@ -3598,41 +3787,65 @@ index a5167242b6b1ee9d6ccfcd81ef86a5729882d3a4..d64c560f86db46786ba47fe55654c140 + for (unsigned i = 0; i < files->length(); ++i) { + RefPtr item = files->get(i); + RefPtr obj = item->asObject(); -+ if (!obj) -+ return makeUnexpected("Invalid file payload format"_s); ++ 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)) -+ return makeUnexpected("Invalid file payload format"_s); ++ 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) -+ return makeUnexpected("Unable to decode given content"_s); ++ if (!buffer) { ++ callback->sendFailure("Unable to decode given content"_s); ++ return; ++ } + + ScriptExecutionContext* context = element->scriptExecutionContext(); + fileObjects.append(File::create(context, Blob::create(context, WTFMove(*buffer), type), name)); + } ++ RefPtr fileList = FileList::create(WTFMove(fileObjects)); ++ element->setFiles(WTFMove(fileList)); ++ callback->sendSuccess(); + } else { -+ for (unsigned i = 0; i < paths->length(); ++i) { -+ RefPtr item = paths->get(i); -+ String path = item->asString(); -+ if (path.isEmpty()) -+ return makeUnexpected("Invalid file path"_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, path)); ++ ScriptExecutionContext* context = element->scriptExecutionContext(); ++ fileObjects.append(File::create(context, path)); ++ } ++ RefPtr fileList = FileList::create(WTFMove(fileObjects)); ++ element->setFiles(WTFMove(fileList)); ++ callback->sendSuccess(); + } + } -+ RefPtr fileList = FileList::create(WTFMove(fileObjects)); -+ element->setFiles(WTFMove(fileList)); -+ return { }; +} + } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.h b/Source/WebCore/inspector/agents/InspectorDOMAgent.h -index 5f1dba2bc4d5c2f113a88dcc9ba479679cb79233..5616c853a99b5fdb38306a804cc0e91799ac12b1 100644 +index 5f1dba2bc4d5c2f113a88dcc9ba479679cb79233..73e49d699919b68cffff41f612e461e25235155b 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.h +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.h @@ -57,6 +57,7 @@ namespace WebCore { @@ -3667,7 +3880,7 @@ index 5f1dba2bc4d5c2f113a88dcc9ba479679cb79233..5616c853a99b5fdb38306a804cc0e917 + Inspector::Protocol::ErrorStringOr> describeNode(const String& objectId); + Inspector::Protocol::ErrorStringOr scrollIntoViewIfNeeded(const String& objectId, RefPtr&& rect); + Inspector::Protocol::ErrorStringOr>> getContentQuads(const String& objectId); -+ Inspector::Protocol::ErrorStringOr setInputFiles(const String& objectId, RefPtr&& files, RefPtr&& paths); ++ void setInputFiles(const String& objectId, RefPtr&& files, RefPtr&& paths, Ref&& callback); // InspectorInstrumentation Inspector::Protocol::DOM::NodeId identifierForNode(Node&); @@ -3705,7 +3918,7 @@ index 5f1dba2bc4d5c2f113a88dcc9ba479679cb79233..5616c853a99b5fdb38306a804cc0e917 void discardBindings(); diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp -index 00dba5735f2f682d00f7e17ef2abddf85a4c7f90..4c2ca023d6ad04a3ccda68d5f707df8065d50419 100644 +index f8a58175bdaa13ae7d2bb722df119e140ec7618f..b601fdd3d16a3fc016ce3af50d416a0880990d7b 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp @@ -59,6 +59,7 @@ @@ -3716,7 +3929,7 @@ index 00dba5735f2f682d00f7e17ef2abddf85a4c7f90..4c2ca023d6ad04a3ccda68d5f707df80 #include "Page.h" #include "PlatformStrategies.h" #include "ProgressTracker.h" -@@ -339,8 +340,8 @@ static Ref buildObjectForResourceRequest( +@@ -340,8 +341,8 @@ static Ref buildObjectForResourceRequest( .release(); if (request.httpBody() && !request.httpBody()->isEmpty()) { @@ -3727,7 +3940,7 @@ index 00dba5735f2f682d00f7e17ef2abddf85a4c7f90..4c2ca023d6ad04a3ccda68d5f707df80 } if (resourceLoader) { -@@ -393,6 +394,8 @@ RefPtr InspectorNetworkAgent::buildObjec +@@ -394,6 +395,8 @@ RefPtr InspectorNetworkAgent::buildObjec .setSource(responseSource(response.source())) .release(); @@ -3736,7 +3949,25 @@ index 00dba5735f2f682d00f7e17ef2abddf85a4c7f90..4c2ca023d6ad04a3ccda68d5f707df80 if (resourceLoader) { auto* metrics = response.deprecatedNetworkLoadMetricsOrNull(); responseObject->setTiming(buildObjectForTiming(metrics ? *metrics : NetworkLoadMetrics::emptyMetrics(), *resourceLoader)); -@@ -960,6 +963,7 @@ void InspectorNetworkAgent::continuePendingResponses() +@@ -680,6 +683,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier, + String requestId = IdentifiersFactory::requestId(identifier.toUInt64()); + + if (loader && m_resourcesData->resourceType(requestId) == InspectorPageAgent::DocumentResource) { ++ if (m_stoppingLoadingDueToProcessSwap) ++ return; ++ + auto* frame = loader->frame(); + if (frame && frame->loader().documentLoader() && frame->document()) { + m_resourcesData->addResourceSharedBuffer(requestId, +@@ -909,6 +915,7 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::disable() + m_instrumentingAgents.setEnabledNetworkAgent(nullptr); + m_resourcesData->clear(); + m_extraRequestHeaders.clear(); ++ m_stoppingLoadingDueToProcessSwap = false; + + continuePendingRequests(); + continuePendingResponses(); +@@ -961,6 +968,7 @@ void InspectorNetworkAgent::continuePendingResponses() Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setExtraHTTPHeaders(Ref&& headers) { @@ -3744,7 +3975,19 @@ index 00dba5735f2f682d00f7e17ef2abddf85a4c7f90..4c2ca023d6ad04a3ccda68d5f707df80 for (auto& entry : headers.get()) { auto stringValue = entry.value->asString(); if (!!stringValue) -@@ -1238,6 +1242,9 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptWithReq +@@ -1210,6 +1218,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response, + m_frontendDispatcher->responseIntercepted(requestId, resourceResponse.releaseNonNull()); + } + ++void InspectorNetworkAgent::setStoppingLoadingDueToProcessSwap(bool stopping) ++{ ++ m_stoppingLoadingDueToProcessSwap = stopping; ++} ++ + Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptContinue(const Inspector::Protocol::Network::RequestId& requestId, Inspector::Protocol::Network::NetworkStage networkStage) + { + switch (networkStage) { +@@ -1239,6 +1252,9 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptWithReq return makeUnexpected("Missing pending intercept request for given requestId"_s); auto& loader = *pendingRequest->m_loader; @@ -3754,7 +3997,7 @@ index 00dba5735f2f682d00f7e17ef2abddf85a4c7f90..4c2ca023d6ad04a3ccda68d5f707df80 ResourceRequest request = loader.request(); if (!!url) request.setURL(URL({ }, url)); -@@ -1333,14 +1340,23 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptRequest +@@ -1334,14 +1350,23 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptRequest response.setHTTPStatusCode(status); response.setHTTPStatusText(String { statusText }); HTTPHeaderMap explicitHeaders; @@ -3780,7 +4023,7 @@ index 00dba5735f2f682d00f7e17ef2abddf85a4c7f90..4c2ca023d6ad04a3ccda68d5f707df80 if (loader->reachedTerminalState()) return; -@@ -1403,6 +1419,12 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setEmulatedCondi +@@ -1404,6 +1429,12 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setEmulatedCondi #endif // ENABLE(INSPECTOR_NETWORK_THROTTLING) @@ -3794,7 +4037,7 @@ index 00dba5735f2f682d00f7e17ef2abddf85a4c7f90..4c2ca023d6ad04a3ccda68d5f707df80 { return startsWithLettersIgnoringASCIICase(mimeType, "text/"_s) diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h -index dc7e574ee6e9256a1f75ea838d20ca7f5e9190de..5dd4464256e0f5d652fa51fd611286ddc1da6f5c 100644 +index dc7e574ee6e9256a1f75ea838d20ca7f5e9190de..03a28b599df29e82392b70cf6b83a700134c53a3 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h @@ -34,6 +34,8 @@ @@ -3814,8 +4057,24 @@ index dc7e574ee6e9256a1f75ea838d20ca7f5e9190de..5dd4464256e0f5d652fa51fd611286dd // InspectorInstrumentation void willRecalculateStyle(); +@@ -132,6 +135,7 @@ public: + bool shouldInterceptResponse(const ResourceResponse&); + void interceptResponse(const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); + void interceptRequest(ResourceLoader&, Function&&); ++ void setStoppingLoadingDueToProcessSwap(bool); + + 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>&); +@@ -258,6 +262,7 @@ private: + bool m_enabled { false }; + bool m_loadingXHRSynchronously { false }; + bool m_interceptionEnabled { false }; ++ bool m_stoppingLoadingDueToProcessSwap { false }; + }; + + } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp -index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8dea87401 100644 +index 97fa6f1ae18db5b4a1fc8f8f99ce0605fb76a793..fd761459048e7e976b7351eb8714acc63f42bf2d 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp @@ -32,19 +32,26 @@ @@ -3860,7 +4119,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 #include "ScriptController.h" #include "ScriptSourceCode.h" #include "SecurityOrigin.h" -@@ -66,11 +76,18 @@ +@@ -66,14 +76,21 @@ #include "StyleScope.h" #include "Theme.h" #include @@ -3878,13 +4137,12 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 +#include #include #include - #include -@@ -83,11 +100,15 @@ - #include "LegacyWebArchive.h" - #endif +-#include ++#include -- - namespace WebCore { + #if ENABLE(APPLICATION_MANIFEST) + #include "CachedApplicationManifest.h" +@@ -92,6 +109,11 @@ namespace WebCore { using namespace Inspector; @@ -3896,7 +4154,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 static bool decodeBuffer(std::span buffer, const String& textEncodingName, String* result) { if (buffer.data()) { -@@ -334,6 +355,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien +@@ -338,6 +360,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien , m_frontendDispatcher(makeUnique(context.frontendRouter)) , m_backendDispatcher(Inspector::PageBackendDispatcher::create(context.backendDispatcher, this)) , m_inspectedPage(context.inspectedPage) @@ -3904,7 +4162,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 , m_client(client) , m_overlay(overlay) { -@@ -363,12 +385,20 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::enable() +@@ -367,12 +390,20 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::enable() defaultUserPreferencesDidChange(); @@ -3925,7 +4183,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 setShowPaintRects(false); #if !PLATFORM(IOS_FAMILY) -@@ -420,6 +450,22 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::reload(std::optiona +@@ -424,6 +455,22 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::reload(std::optiona return { }; } @@ -3948,7 +4206,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 Inspector::Protocol::ErrorStringOr InspectorPageAgent::navigate(const String& url) { auto* localMainFrame = dynamicDowncast(m_inspectedPage.mainFrame()); -@@ -443,6 +489,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(c +@@ -447,6 +494,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(c return { }; } @@ -3962,7 +4220,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Inspector::Protocol::Page::Setting setting, std::optional&& value) { auto& inspectedPageSettings = m_inspectedPage.settings(); -@@ -456,6 +509,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -460,6 +514,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setAuthorAndUserStylesEnabledInspectorOverride(value); return { }; @@ -3975,7 +4233,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 case Inspector::Protocol::Page::Setting::ICECandidateFilteringEnabled: inspectedPageSettings.setICECandidateFilteringEnabledInspectorOverride(value); return { }; -@@ -481,6 +540,38 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -485,6 +545,38 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setNeedsSiteSpecificQuirksInspectorOverride(value); return { }; @@ -4014,7 +4272,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 case Inspector::Protocol::Page::Setting::ScriptEnabled: inspectedPageSettings.setScriptEnabledInspectorOverride(value); return { }; -@@ -493,6 +584,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -497,6 +589,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setShowRepaintCounterInspectorOverride(value); return { }; @@ -4027,7 +4285,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 case Inspector::Protocol::Page::Setting::WebSecurityEnabled: inspectedPageSettings.setWebSecurityEnabledInspectorOverride(value); return { }; -@@ -893,15 +990,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(b +@@ -897,15 +995,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(b return { }; } @@ -4049,13 +4307,13 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 } void InspectorPageAgent::frameNavigated(LocalFrame& frame) -@@ -909,13 +1007,25 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) +@@ -913,13 +1012,25 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame)); } +String InspectorPageAgent::makeFrameID(ProcessIdentifier processID, FrameIdentifier frameID) +{ -+ return makeString(processID.toUInt64(), ".", frameID.object().toUInt64()); ++ return makeString(processID.toUInt64(), '.', frameID.object().toUInt64()); +} + +static String globalIDForFrame(Frame& frame) @@ -4078,7 +4336,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 } Frame* InspectorPageAgent::frameForId(const Inspector::Protocol::Network::FrameId& frameId) -@@ -927,20 +1037,17 @@ String InspectorPageAgent::frameId(Frame* frame) +@@ -931,20 +1042,17 @@ String InspectorPageAgent::frameId(Frame* frame) { if (!frame) return emptyString(); @@ -4104,7 +4362,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 } LocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& errorString, const Inspector::Protocol::Network::FrameId& frameId) -@@ -951,11 +1058,6 @@ LocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& er +@@ -955,11 +1063,6 @@ LocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& er return frame; } @@ -4116,7 +4374,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 void InspectorPageAgent::frameStartedLoading(LocalFrame& frame) { m_frontendDispatcher->frameStartedLoading(frameId(&frame)); -@@ -966,9 +1068,9 @@ void InspectorPageAgent::frameStoppedLoading(LocalFrame& frame) +@@ -970,9 +1073,9 @@ void InspectorPageAgent::frameStoppedLoading(LocalFrame& frame) m_frontendDispatcher->frameStoppedLoading(frameId(&frame)); } @@ -4128,7 +4386,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 } void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame) -@@ -1015,6 +1117,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() +@@ -1019,6 +1122,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() m_frontendDispatcher->defaultUserPreferencesDidChange(WTFMove(defaultUserPreferences)); } @@ -4141,7 +4399,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) void InspectorPageAgent::defaultAppearanceDidChange() { -@@ -1028,6 +1136,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp +@@ -1032,6 +1141,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp return; if (m_bootstrapScript.isEmpty()) @@ -4151,7 +4409,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 return; frame.script().evaluateIgnoringException(ScriptSourceCode(m_bootstrapScript, JSC::SourceTaintedOrigin::Untainted, URL { "web-inspector://bootstrap.js"_str })); -@@ -1075,6 +1186,51 @@ void InspectorPageAgent::didRecalculateStyle() +@@ -1079,6 +1191,51 @@ void InspectorPageAgent::didRecalculateStyle() m_overlay->update(); } @@ -4203,7 +4461,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 Ref InspectorPageAgent::buildObjectForFrame(LocalFrame* frame) { ASSERT_ARG(frame, frame); -@@ -1172,6 +1328,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) +@@ -1176,6 +1333,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) userAgent = m_userAgentOverride; } @@ -4216,14 +4474,14 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 void InspectorPageAgent::applyEmulatedMedia(AtomString& media) { if (!m_emulatedMedia.isEmpty()) -@@ -1199,11 +1361,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp +@@ -1203,11 +1366,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp return snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); } -Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem coordinateSystem) +Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int x, int y, int width, int height, Inspector::Protocol::Page::CoordinateSystem coordinateSystem, std::optional&& omitDeviceScaleFactor) { - SnapshotOptions options { { }, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }; + SnapshotOptions options { { }, ImageBufferPixelFormat::BGRA8, DestinationColorSpace::SRGB() }; if (coordinateSystem == Inspector::Protocol::Page::CoordinateSystem::Viewport) options.flags.add(SnapshotFlags::InViewCoordinates); + if (omitDeviceScaleFactor.has_value() && *omitDeviceScaleFactor) @@ -4231,7 +4489,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 IntRect rectangle(x, y, width, height); auto* localMainFrame = dynamicDowncast(m_inspectedPage.mainFrame()); -@@ -1217,6 +1381,43 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int +@@ -1221,6 +1386,43 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int return snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); } @@ -4259,7 +4517,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 +{ + bool success = WTF::setTimeZoneOverride(timeZone); + if (!success) -+ return makeUnexpected("Invalid time zone " + timeZone); ++ return makeUnexpected(makeString("Invalid time zone "_s, timeZone)); + + return { }; +} @@ -4275,7 +4533,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 #if ENABLE(WEB_ARCHIVE) && USE(CF) Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() { -@@ -1233,7 +1434,6 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() +@@ -1237,7 +1439,6 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() } #endif @@ -4283,10 +4541,11 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverride(std::optional&& width, std::optional&& height) { if (width.has_value() != height.has_value()) -@@ -1251,6 +1451,519 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverri +@@ -1255,6 +1456,508 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverri localMainFrame->setOverrideScreenSize(FloatSize(width.value_or(0), height.value_or(0))); return { }; } +-#endif + +Protocol::ErrorStringOr InspectorPageAgent::insertText(const String& text) +{ @@ -4782,17 +5041,6 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 + return { }; +} + -+Protocol::ErrorStringOr InspectorPageAgent::setOrientationOverride(std::optional&& angle) -+{ -+#if ENABLE(ORIENTATION_EVENTS) -+ m_inspectedPage.setOverrideOrientation(WTFMove(angle)); -+ return { }; -+#else -+ UNUSED_PARAM(angle); -+ return makeUnexpected("Orientation events are disabled in this build"); - #endif -+} -+ +Protocol::ErrorStringOr InspectorPageAgent::updateScrollingState() +{ + auto* scrollingCoordinator = m_inspectedPage.scrollingCoordinator(); @@ -4804,7 +5052,7 @@ index 5329fd0a2c24031a74d05d7c6c342a5f8398eaae..a64e486220e4fc8e37c34856fce8c3d8 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h -index 371bcfcf1d0ae17471f8e69706d2f12356793418..6bc660d683a639f1d6f6a0dca8db5e058d32cd21 100644 +index 371bcfcf1d0ae17471f8e69706d2f12356793418..3e1d5a03edf17f42b566b6d0ec062fdd6d32f1c3 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.h +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h @@ -32,8 +32,10 @@ @@ -4855,7 +5103,7 @@ index 371bcfcf1d0ae17471f8e69706d2f12356793418..6bc660d683a639f1d6f6a0dca8db5e05 Inspector::Protocol::ErrorStringOr overrideSetting(Inspector::Protocol::Page::Setting, std::optional&& value); Inspector::Protocol::ErrorStringOr overrideUserPreference(Inspector::Protocol::Page::UserPreferenceName, std::optional&&); Inspector::Protocol::ErrorStringOr>> getCookies(); -@@ -115,45 +126,66 @@ public: +@@ -115,45 +126,65 @@ public: #endif Inspector::Protocol::ErrorStringOr setShowPaintRects(bool); Inspector::Protocol::ErrorStringOr setEmulatedMedia(const String&); @@ -4879,7 +5127,6 @@ index 371bcfcf1d0ae17471f8e69706d2f12356793418..6bc660d683a639f1d6f6a0dca8db5e05 + Inspector::Protocol::ErrorStringOr createUserWorld(const String&); + Inspector::Protocol::ErrorStringOr setBypassCSP(bool); + Inspector::Protocol::ErrorStringOr crash(); -+ Inspector::Protocol::ErrorStringOr setOrientationOverride(std::optional&& angle); + Inspector::Protocol::ErrorStringOr updateScrollingState(); // InspectorInstrumentation @@ -4929,7 +5176,7 @@ index 371bcfcf1d0ae17471f8e69706d2f12356793418..6bc660d683a639f1d6f6a0dca8db5e05 static bool mainResourceContent(LocalFrame*, bool withBase64Encode, String* result); static bool dataContent(std::span data, const String& textEncodingName, bool withBase64Encode, String* result); -@@ -169,17 +201,21 @@ private: +@@ -169,17 +200,21 @@ private: RefPtr m_backendDispatcher; Page& m_inspectedPage; @@ -5119,7 +5366,7 @@ index 9501fc840e35f3badc701e7622555dba394cae9b..1391c73d9b3ba250ad3a831bfe7c92c9 } // namespace WebCore diff --git a/Source/WebCore/loader/CookieJar.h b/Source/WebCore/loader/CookieJar.h -index edfc601a36f006122f26946de5b3a60573a07968..794a6c389be8af23989a54696d57312340ddcd37 100644 +index 2ca6ee01a341eefead66a92e2af77875263a9df3..131bbd8c268a748b43cac105370d7b73753e47a8 100644 --- a/Source/WebCore/loader/CookieJar.h +++ b/Source/WebCore/loader/CookieJar.h @@ -46,6 +46,7 @@ struct CookieStoreGetOptions; @@ -5141,10 +5388,10 @@ index edfc601a36f006122f26946de5b3a60573a07968..794a6c389be8af23989a54696d573123 protected: static SameSiteInfo sameSiteInfo(const Document&, IsForDOMCookieAccess = IsForDOMCookieAccess::No); diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp -index 90023ca4ebad0d8608b74434ca5d870ffeb00871..7360ea6857f98e60bdfa74ad4a0d595958cfc11f 100644 +index 22b83991d32085991eb502728333dc7648ab883f..6bd27284c1799448f387338738c7a7fbc8cc3690 100644 --- a/Source/WebCore/loader/DocumentLoader.cpp +++ b/Source/WebCore/loader/DocumentLoader.cpp -@@ -763,8 +763,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc +@@ -766,8 +766,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc if (!didReceiveRedirectResponse) return completionHandler(WTFMove(newRequest)); @@ -5155,7 +5402,7 @@ index 90023ca4ebad0d8608b74434ca5d870ffeb00871..7360ea6857f98e60bdfa74ad4a0d5959 switch (navigationPolicyDecision) { case NavigationPolicyDecision::IgnoreLoad: case NavigationPolicyDecision::LoadWillContinueInAnotherProcess: -@@ -1532,11 +1534,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo +@@ -1533,11 +1535,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo if (auto navigationID = std::exchange(m_navigationID, 0)) m_frame->loader().client().documentLoaderDetached(navigationID, loadWillContinueInAnotherProcess); @@ -5176,10 +5423,10 @@ index 90023ca4ebad0d8608b74434ca5d870ffeb00871..7360ea6857f98e60bdfa74ad4a0d5959 { ASSERT(navigationID); diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h -index aa98ba7e3eb896b65a156fe8f75ae3c0bc99f246..00531c35e1d5041d3bcc13c54308eb7eff387baf 100644 +index 3f7d86c6ba98d5d5a6ad716bd3d78885bb9411e0..94dbc77f454b70733d7f15db8fac00ac72fb8657 100644 --- a/Source/WebCore/loader/DocumentLoader.h +++ b/Source/WebCore/loader/DocumentLoader.h -@@ -191,6 +191,8 @@ public: +@@ -207,6 +207,8 @@ public: WEBCORE_EXPORT virtual void detachFromFrame(LoadWillContinueInAnotherProcess); @@ -5189,10 +5436,10 @@ index aa98ba7e3eb896b65a156fe8f75ae3c0bc99f246..00531c35e1d5041d3bcc13c54308eb7e CheckedPtr checkedFrameLoader() const; WEBCORE_EXPORT SubresourceLoader* mainResourceLoader() const; diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp -index 4882d1ded68a2e88595c1ce7e2a6891f066b3457..e630a3cd7022449e6eec9516f7bb5e63f3085b0e 100644 +index 231a764c5b88f9986e324587e62f94abd119fff8..260b5368d67f75616e7aeba7c3170fb52af5f054 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp -@@ -1355,6 +1355,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat +@@ -1322,6 +1322,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat } m_client->dispatchDidNavigateWithinPage(); @@ -5200,40 +5447,35 @@ index 4882d1ded68a2e88595c1ce7e2a6891f066b3457..e630a3cd7022449e6eec9516f7bb5e63 document->statePopped(stateObject ? stateObject.releaseNonNull() : SerializedScriptValue::nullValue()); m_client->dispatchDidPopStateWithinPage(); -@@ -1820,6 +1821,8 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1821,6 +1822,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t const String& httpMethod = loader->request().httpMethod(); if (shouldPerformFragmentNavigation(isFormSubmission, httpMethod, policyChecker().loadType(), newURL)) { + loader->replacedByFragmentNavigation(m_frame); -+ + RefPtr oldDocumentLoader = m_documentLoader; NavigationAction action { frame->protectedDocument().releaseNonNull(), loader->request(), InitiatedByMainFrame::Unknown, loader->isRequestFromClientOrUserInput(), policyChecker().loadType(), isFormSubmission }; - oldDocumentLoader->setTriggeringAction(WTFMove(action)); -@@ -1853,7 +1856,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1857,7 +1859,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t } - RELEASE_ASSERT(!isBackForwardLoadType(policyChecker().loadType()) || history().provisionalItem()); + RELEASE_ASSERT(!isBackForwardLoadType(policyChecker().loadType()) || frame->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 { + InspectorInstrumentation::didCheckNavigationPolicy(m_frame, navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad); continueLoadAfterNavigationPolicy(request, RefPtr { weakFormState.get() }.get(), navigationPolicyDecision, allowNavigationToInvalidURL); completionHandler(); }, PolicyDecisionMode::Asynchronous); -@@ -3115,14 +3120,19 @@ String FrameLoader::userAgent(const URL& url) const +@@ -3126,10 +3130,15 @@ String FrameLoader::userAgent(const URL& url) const String FrameLoader::navigatorPlatform() const { + String platform; + - if (RefPtr localFrame = dynamicDowncast(m_frame->mainFrame())) { - if (RefPtr documentLoader = localFrame->loader().activeDocumentLoader()) { - auto& customNavigatorPlatform = documentLoader->customNavigatorPlatform(); - if (!customNavigatorPlatform.isEmpty()) -- return customNavigatorPlatform; -+ platform = customNavigatorPlatform; - } - } + auto customNavigatorPlatform = m_frame->mainFrame().customNavigatorPlatform(); + if (!customNavigatorPlatform.isEmpty()) +- return customNavigatorPlatform; - return String(); ++ platform = customNavigatorPlatform; + + InspectorInstrumentation::applyPlatformOverride(m_frame, platform); + @@ -5241,16 +5483,16 @@ index 4882d1ded68a2e88595c1ce7e2a6891f066b3457..e630a3cd7022449e6eec9516f7bb5e63 } void FrameLoader::dispatchOnloadEvents() -@@ -3572,6 +3582,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error) +@@ -3594,6 +3603,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill checkCompleted(); if (frame->page()) - checkLoadComplete(); + checkLoadComplete(loadWillContinueInAnotherProcess); + + InspectorInstrumentation::didReceiveMainResourceError(m_frame, error); } - void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, const SecurityOrigin* requesterOrigin, bool shouldContinue) -@@ -4425,9 +4437,6 @@ String FrameLoader::referrer() const + void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, const SecurityOrigin* requesterOrigin, bool shouldContinue, NavigationHistoryBehavior historyHandling) +@@ -4476,9 +4487,6 @@ String FrameLoader::referrer() const void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() { @@ -5260,7 +5502,7 @@ index 4882d1ded68a2e88595c1ce7e2a6891f066b3457..e630a3cd7022449e6eec9516f7bb5e63 Vector> worlds; ScriptController::getAllWorlds(worlds); for (auto& world : worlds) -@@ -4437,13 +4446,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() +@@ -4488,13 +4496,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world) { Ref frame = m_frame.get(); @@ -5293,10 +5535,10 @@ 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 a6270e0e1ceb02fee0a3c91a0cc755351908c5e5..f5e7330fa741eff7917adf227760161c5ba1e5f8 100644 +index 9af8f29088f6ac3841fe68cd8629ef18a6ca5675..f28e41daee51b3d4fd6c185532c6acf941dd30ad 100644 --- a/Source/WebCore/loader/NavigationScheduler.cpp +++ b/Source/WebCore/loader/NavigationScheduler.cpp -@@ -690,7 +690,7 @@ void NavigationScheduler::startTimer() +@@ -703,7 +703,7 @@ void NavigationScheduler::startTimer() Seconds delay = 1_s * m_redirect->delay(); m_timer.startOneShot(delay); @@ -5306,7 +5548,7 @@ index a6270e0e1ceb02fee0a3c91a0cc755351908c5e5..f5e7330fa741eff7917adf227760161c } diff --git a/Source/WebCore/loader/PolicyChecker.cpp b/Source/WebCore/loader/PolicyChecker.cpp -index ca3dc2575f3c9cb87ac902d79610f0738b09fdff..2ddbbfed658961e8231f641a889508aa4869070d 100644 +index 15ce6dd0ee3c412bcaf33063e8610c5936677c9c..344172ad41a7915982aaef12b175a0f9dffdc388 100644 --- a/Source/WebCore/loader/PolicyChecker.cpp +++ b/Source/WebCore/loader/PolicyChecker.cpp @@ -46,6 +46,7 @@ @@ -5340,10 +5582,10 @@ index b74c5258454b0df9f74aa8a5297674b733925685..b6c3999745368c7f7e2e6176bfca6dc0 void ProgressTracker::incrementProgress(ResourceLoaderIdentifier identifier, const ResourceResponse& response) diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -index f0d0aeb93ca42f7178a9dc07beeba911a38c32fe..1f82595cbbbc4f32b5cc4330b4d71e05d51b27a0 100644 +index 0838ffc91ef3b9b3990bb05bb0c52dec1128f92e..6f536869db9c2aa0264d2e800bc9f3e7adb9a379 100644 --- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp +++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -@@ -1054,8 +1054,11 @@ ResourceErrorOr> CachedResourceLoader::requ +@@ -1089,8 +1089,11 @@ ResourceErrorOr> CachedResourceLoader::requ request.updateReferrerPolicy(document() ? document()->referrerPolicy() : ReferrerPolicy::Default); @@ -5357,7 +5599,7 @@ index f0d0aeb93ca42f7178a9dc07beeba911a38c32fe..1f82595cbbbc4f32b5cc4330b4d71e05 Ref page = *frame->page(); -@@ -1663,8 +1666,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const +@@ -1703,8 +1706,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const ResourceErrorOr> CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequest&& request) { @@ -5370,10 +5612,10 @@ index f0d0aeb93ca42f7178a9dc07beeba911a38c32fe..1f82595cbbbc4f32b5cc4330b4d71e05 ASSERT(m_document); if (request.charset().isEmpty() && m_document && (type == CachedResource::Type::Script || type == CachedResource::Type::CSSStyleSheet)) diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h -index 20666cc080e04b0fa12e654ac357531f18c7c1df..3cf1823363aacdc014326957f98f3435cf505beb 100644 +index 1712a19473ab6db4db50a1d746846a091dce7417..ed27724b92ba34e0f2a543f398701f31a6764bc3 100644 --- a/Source/WebCore/page/ChromeClient.h +++ b/Source/WebCore/page/ChromeClient.h -@@ -335,7 +335,7 @@ public: +@@ -339,7 +339,7 @@ public: #endif #if ENABLE(ORIENTATION_EVENTS) @@ -5383,10 +5625,10 @@ index 20666cc080e04b0fa12e654ac357531f18c7c1df..3cf1823363aacdc014326957f98f3435 #if ENABLE(INPUT_TYPE_COLOR) diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp -index 1171407b2f308431ba948ec477a56c90e66911e8..a96feb7fe5a299adaeb950a11512bdf26b1f2836 100644 +index 82f9dab5460c78f49a48adfb8c1fcaf19b0a0b9e..b3c8a054f7c6e0b9db2cdc50fd077c687ccdd62b 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp -@@ -4325,6 +4325,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr +@@ -4346,6 +4346,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr if (!document) return false; @@ -5399,7 +5641,7 @@ index 1171407b2f308431ba948ec477a56c90e66911e8..a96feb7fe5a299adaeb950a11512bdf2 dragState().dataTransfer = DataTransfer::createForDrag(*document); auto hasNonDefaultPasteboardData = HasNonDefaultPasteboardData::No; -@@ -4951,7 +4957,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve +@@ -4972,7 +4978,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; @@ -5408,7 +5650,7 @@ index 1171407b2f308431ba948ec477a56c90e66911e8..a96feb7fe5a299adaeb950a11512bdf2 bool pointerCancelled = false; #endif RefPtr touchTarget; -@@ -4998,7 +5004,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve +@@ -5019,7 +5025,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve // we also remove it from the map. touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey); @@ -5417,7 +5659,7 @@ index 1171407b2f308431ba948ec477a56c90e66911e8..a96feb7fe5a299adaeb950a11512bdf2 HitTestResult result = hitTestResultAtPoint(pagePoint, hitType | HitTestRequest::Type::AllowChildFrameContent); pointerTarget = result.targetElement(); pointerCancelled = (pointerTarget != touchTarget); -@@ -5021,7 +5027,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve +@@ -5042,7 +5048,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve if (!targetFrame) continue; @@ -5427,10 +5669,10 @@ index 1171407b2f308431ba948ec477a56c90e66911e8..a96feb7fe5a299adaeb950a11512bdf2 // on release if the hit test result changed since the previous TouchPressed or TouchMoved if (pointState == PlatformTouchPoint::TouchReleased && pointerCancelled) { diff --git a/Source/WebCore/page/FrameSnapshotting.cpp b/Source/WebCore/page/FrameSnapshotting.cpp -index 36ff7673bffcfea97e705d03f31459c36dc46164..1a65fcc874877b8b54e4e6aebb56b66294ef1ceb 100644 +index 084db825e36bd46126fea95fc7183bf2e931be7e..dac3caef67600f8c7c945fd857a91140a23d0303 100644 --- a/Source/WebCore/page/FrameSnapshotting.cpp +++ b/Source/WebCore/page/FrameSnapshotting.cpp -@@ -113,7 +113,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); @@ -5439,7 +5681,7 @@ index 36ff7673bffcfea97e705d03f31459c36dc46164..1a65fcc874877b8b54e4e6aebb56b662 if (frame.page()->delegatesScaling()) scaleFactor *= frame.page()->pageScaleFactor(); -@@ -128,7 +128,13 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -130,7 +130,13 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& if (!buffer) return nullptr; @@ -5453,7 +5695,7 @@ index 36ff7673bffcfea97e705d03f31459c36dc46164..1a65fcc874877b8b54e4e6aebb56b662 if (!clipRects.isEmpty()) { Path clipPath; -@@ -137,7 +143,10 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -139,7 +145,10 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& buffer->context().clipPath(clipPath); } @@ -5466,19 +5708,19 @@ index 36ff7673bffcfea97e705d03f31459c36dc46164..1a65fcc874877b8b54e4e6aebb56b662 } diff --git a/Source/WebCore/page/FrameSnapshotting.h b/Source/WebCore/page/FrameSnapshotting.h -index e4f52ca1cb3228868bc77a5498c87e1f2af59ce4..9ce6b102570cdcd2775ebf5adcd1650db837f311 100644 +index 5b365008debe6b8d5a95a572a4c2725b0a7a519d..2c6ad49a45a1759f446aced179c0c5a7bfb4b07a 100644 --- a/Source/WebCore/page/FrameSnapshotting.h +++ b/Source/WebCore/page/FrameSnapshotting.h -@@ -54,6 +54,7 @@ enum class SnapshotFlags : uint16_t { - PaintWithIntegralScaleFactor = 1 << 6, +@@ -55,6 +55,7 @@ enum class SnapshotFlags : uint16_t { Shareable = 1 << 7, Accelerated = 1 << 8, -+ OmitDeviceScaleFactor = 1 << 9, + ExcludeReplacedContent = 1 << 9, ++ OmitDeviceScaleFactor = 1 << 10, }; struct SnapshotOptions { diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp -index 28dacedeebc77b2da6428cdbe166581c96348dfa..9c5bfaf9c81c2e5904f69071ee674363ee9decf8 100644 +index 097302d7502b8a28db7c7ab8d778d17365b03533..4ab5ee0e71b2010ea5297e8d1d4ec03b9fd27097 100644 --- a/Source/WebCore/page/History.cpp +++ b/Source/WebCore/page/History.cpp @@ -32,6 +32,7 @@ @@ -5489,16 +5731,17 @@ index 28dacedeebc77b2da6428cdbe166581c96348dfa..9c5bfaf9c81c2e5904f69071ee674363 #include "LocalFrame.h" #include "LocalFrameLoaderClient.h" #include "Logging.h" -@@ -298,6 +299,7 @@ ExceptionOr History::stateObjectAdded(RefPtr&& data +@@ -304,6 +305,8 @@ ExceptionOr History::stateObjectAdded(RefPtr&& data - if (!urlString.isEmpty()) - frame->protectedDocument()->updateURLForPushOrReplaceState(fullURL); + auto historyBehavior = stateObjectType == StateObjectType::Replace ? NavigationHistoryBehavior::Replace : NavigationHistoryBehavior::Push; + frame->loader().updateURLAndHistory(fullURL, WTFMove(data), historyBehavior); + InspectorInstrumentation::didNavigateWithinPage(*frame); ++ + return { }; + } - if (stateObjectType == StateObjectType::Push) { - frame->loader().history().pushState(WTFMove(data), fullURL.string()); diff --git a/Source/WebCore/page/LocalFrame.cpp b/Source/WebCore/page/LocalFrame.cpp -index 9f480cb9a6000333711f0e9630522ddc77534015..f2d62e42e926b0d1d53f3a9feb3ce4ea93507ca3 100644 +index 119ae91c675f4bf1d03b9fc4878c9449416583b8..f0a10738508ca82499b474b8f221fdaf18ec3efc 100644 --- a/Source/WebCore/page/LocalFrame.cpp +++ b/Source/WebCore/page/LocalFrame.cpp @@ -40,6 +40,7 @@ @@ -5525,7 +5768,7 @@ index 9f480cb9a6000333711f0e9630522ddc77534015..f2d62e42e926b0d1d53f3a9feb3ce4ea #include "NodeTraversal.h" #include "Page.h" #include "ProcessWarming.h" -@@ -187,6 +190,7 @@ LocalFrame::LocalFrame(Page& page, UniqueRef&& frameLoad +@@ -188,6 +191,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifie void LocalFrame::init() { @@ -5533,7 +5776,7 @@ index 9f480cb9a6000333711f0e9630522ddc77534015..f2d62e42e926b0d1d53f3a9feb3ce4ea checkedLoader()->init(); } -@@ -411,7 +415,7 @@ void LocalFrame::orientationChanged() +@@ -404,7 +408,7 @@ void LocalFrame::orientationChanged() IntDegrees LocalFrame::orientation() const { if (RefPtr page = this->page()) @@ -5542,7 +5785,7 @@ index 9f480cb9a6000333711f0e9630522ddc77534015..f2d62e42e926b0d1d53f3a9feb3ce4ea return 0; } #endif // ENABLE(ORIENTATION_EVENTS) -@@ -1340,6 +1344,362 @@ String LocalFrame::customUserAgentAsSiteSpecificQuirks() const +@@ -1350,6 +1354,362 @@ OptionSet LocalFrame::advancedPrivacyProtections() c return { }; } @@ -5906,7 +6149,7 @@ index 9f480cb9a6000333711f0e9630522ddc77534015..f2d62e42e926b0d1d53f3a9feb3ce4ea #undef FRAME_RELEASE_LOG_ERROR diff --git a/Source/WebCore/page/LocalFrame.h b/Source/WebCore/page/LocalFrame.h -index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d576941a50a 100644 +index c2fc366ed759fb9e1d83821c4fff4b05a6b8fe35..d3eec8aa3129ae6567b1402968374015f11efaa2 100644 --- a/Source/WebCore/page/LocalFrame.h +++ b/Source/WebCore/page/LocalFrame.h @@ -28,8 +28,10 @@ @@ -5920,7 +6163,7 @@ index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d57 #include "ScrollTypes.h" #include "UserScriptTypes.h" #include -@@ -70,7 +72,6 @@ namespace WebCore { +@@ -71,7 +73,6 @@ namespace WebCore { class Color; class LocalDOMWindow; class DataDetectionResultsStorage; @@ -5928,7 +6171,7 @@ index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d57 class Editor; class Element; class EventHandler; -@@ -111,8 +112,8 @@ enum { +@@ -112,8 +113,8 @@ enum { }; enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll }; @@ -5938,7 +6181,7 @@ index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d57 class LocalFrame final : public Frame { public: -@@ -219,10 +220,6 @@ public: +@@ -222,10 +223,6 @@ public: WEBCORE_EXPORT DataDetectionResultsStorage& dataDetectionResults(); #endif @@ -5949,7 +6192,7 @@ index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d57 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); -@@ -230,6 +227,10 @@ public: +@@ -233,6 +230,10 @@ public: WEBCORE_EXPORT Node* nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation); WEBCORE_EXPORT Node* approximateNodeAtViewportLocationLegacy(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation); @@ -5960,7 +6203,7 @@ index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d57 WEBCORE_EXPORT NSArray *wordsInCurrentParagraph() const; WEBCORE_EXPORT CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const; -@@ -297,6 +298,7 @@ public: +@@ -300,6 +301,7 @@ public: WEBCORE_EXPORT FloatSize screenSize() const; void setOverrideScreenSize(FloatSize&&); @@ -5968,7 +6211,7 @@ index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d57 void selfOnlyRef(); void selfOnlyDeref(); -@@ -352,7 +354,6 @@ private: +@@ -355,7 +357,6 @@ private: #if ENABLE(DATA_DETECTION) std::unique_ptr m_dataDetectionResults; #endif @@ -5976,7 +6219,7 @@ index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d57 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); -@@ -360,6 +361,7 @@ private: +@@ -363,6 +364,7 @@ private: enum class ShouldFindRootEditableElement : bool { No, Yes }; Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, const NodeQualifier&, ShouldApproximate, ShouldFindRootEditableElement = ShouldFindRootEditableElement::Yes); @@ -5985,10 +6228,10 @@ index 976a7e01a1a83902d2eddcdbe044c1ec1cd9a7b8..d548c31e6beffe704b8093669ee07d57 ViewportArguments m_viewportArguments; diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp -index 2da22620311314dc67bec3563c7f1b6525bd7b28..e7c530d193fe0c318dfa89f5ae72e3598bdf44bd 100644 +index 72ffbbfd28edb23a93c8c8fba76ab25a7f7b0f72..8d787339e6b570e210765bb1cddec6c4705c2a25 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp -@@ -569,6 +569,45 @@ void Page::setOverrideViewportArguments(const std::optional& +@@ -592,6 +592,45 @@ void Page::setOverrideViewportArguments(const std::optional& document->updateViewportArguments(); } @@ -6034,7 +6277,7 @@ index 2da22620311314dc67bec3563c7f1b6525bd7b28..e7c530d193fe0c318dfa89f5ae72e359 ScrollingCoordinator* Page::scrollingCoordinator() { if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) { -@@ -3870,6 +3909,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) +@@ -3873,6 +3912,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) #endif } @@ -6062,10 +6305,10 @@ index 2da22620311314dc67bec3563c7f1b6525bd7b28..e7c530d193fe0c318dfa89f5ae72e359 { if (insets == m_fullscreenInsets) diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h -index 551ffa245a63f05cd7d58a86048ed22c1feb6205..cd1ce84ec63f5ed8ae75178f79c35b9fd91b37f7 100644 +index 67a128b27cdd46115158ec20e7ce38dd56fde3d6..8ec6a45348412257db2b027f6f15027a21725466 100644 --- a/Source/WebCore/page/Page.h +++ b/Source/WebCore/page/Page.h -@@ -316,6 +316,9 @@ public: +@@ -341,6 +341,9 @@ public: const std::optional& overrideViewportArguments() const { return m_overrideViewportArguments; } WEBCORE_EXPORT void setOverrideViewportArguments(const std::optional&); @@ -6075,7 +6318,7 @@ index 551ffa245a63f05cd7d58a86048ed22c1feb6205..cd1ce84ec63f5ed8ae75178f79c35b9f static void refreshPlugins(bool reload); WEBCORE_EXPORT PluginData& pluginData(); void clearPluginData(); -@@ -380,6 +383,10 @@ public: +@@ -405,6 +408,10 @@ public: #if ENABLE(DRAG_SUPPORT) DragController& dragController() { return m_dragController.get(); } const DragController& dragController() const { return m_dragController.get(); } @@ -6086,7 +6329,7 @@ index 551ffa245a63f05cd7d58a86048ed22c1feb6205..cd1ce84ec63f5ed8ae75178f79c35b9f #endif FocusController& focusController() const { return *m_focusController; } WEBCORE_EXPORT CheckedRef checkedFocusController() const; -@@ -563,6 +570,10 @@ public: +@@ -588,6 +595,10 @@ public: WEBCORE_EXPORT void effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel); bool defaultUseDarkAppearance() const { return m_useDarkAppearance; } void setUseDarkAppearanceOverride(std::optional); @@ -6097,19 +6340,19 @@ index 551ffa245a63f05cd7d58a86048ed22c1feb6205..cd1ce84ec63f5ed8ae75178f79c35b9f #if ENABLE(TEXT_AUTOSIZING) float textAutosizingWidth() const { return m_textAutosizingWidth; } -@@ -1011,6 +1022,11 @@ public: +@@ -1035,6 +1046,11 @@ public: WEBCORE_EXPORT void setInteractionRegionsEnabled(bool); #endif +#if ENABLE(ORIENTATION_EVENTS) + int orientation() const; -+ void setOverrideOrientation(std::optional); ++ WEBCORE_EXPORT void setOverrideOrientation(std::optional); +#endif + #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY) DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); } #endif -@@ -1181,6 +1197,9 @@ private: +@@ -1248,6 +1264,9 @@ private: #if ENABLE(DRAG_SUPPORT) UniqueRef m_dragController; @@ -6119,7 +6362,7 @@ index 551ffa245a63f05cd7d58a86048ed22c1feb6205..cd1ce84ec63f5ed8ae75178f79c35b9f #endif std::unique_ptr m_focusController; #if ENABLE(CONTEXT_MENUS) -@@ -1259,6 +1278,8 @@ private: +@@ -1327,6 +1346,8 @@ private: bool m_useElevatedUserInterfaceLevel { false }; bool m_useDarkAppearance { false }; std::optional m_useDarkAppearanceOverride; @@ -6128,7 +6371,7 @@ index 551ffa245a63f05cd7d58a86048ed22c1feb6205..cd1ce84ec63f5ed8ae75178f79c35b9f #if ENABLE(TEXT_AUTOSIZING) float m_textAutosizingWidth { 0 }; -@@ -1437,6 +1458,11 @@ private: +@@ -1506,6 +1527,11 @@ private: #endif std::optional m_overrideViewportArguments; @@ -6141,10 +6384,10 @@ index 551ffa245a63f05cd7d58a86048ed22c1feb6205..cd1ce84ec63f5ed8ae75178f79c35b9f #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 18e3cde7b9ae368de4b87c88c2f8324b77cbd7c8..1ebc51b6d81fc6ae17124e7be7da039609df03d0 100644 +index 8fcc6f546882998be87d52c296c4637c6fd5af0f..73e3adc185923ba249f39f070a0b9fbb20418b0b 100644 --- a/Source/WebCore/page/PageConsoleClient.cpp +++ b/Source/WebCore/page/PageConsoleClient.cpp -@@ -439,4 +439,9 @@ Ref PageConsoleClient::protectedPage() const +@@ -434,4 +434,9 @@ Ref PageConsoleClient::protectedPage() const return m_page.get(); } @@ -6217,10 +6460,10 @@ index 91a9847a4083393e225f42e71c2dd590a88c0289..b0838c84e4ba24378db42f40a68856af #endif ; diff --git a/Source/WebCore/page/Screen.cpp b/Source/WebCore/page/Screen.cpp -index 4e4dfdebe954bf3f047d3a86a758dfd0913f732e..da2bcd0256cdfc2ba28fb07094abd0b6f9c5f754 100644 +index 706f67ca9d5b98f519080fad94d424a130b18a0e..c98147603680bd21c83a0b2b1593fa84a733f22f 100644 --- a/Source/WebCore/page/Screen.cpp +++ b/Source/WebCore/page/Screen.cpp -@@ -111,6 +111,9 @@ int Screen::availLeft() const +@@ -102,6 +102,9 @@ int Screen::availLeft() const if (fingerprintingProtectionsEnabled(*frame)) return 0; @@ -6230,7 +6473,7 @@ index 4e4dfdebe954bf3f047d3a86a758dfd0913f732e..da2bcd0256cdfc2ba28fb07094abd0b6 return static_cast(screenAvailableRect(frame->protectedView().get()).x()); } -@@ -126,6 +129,9 @@ int Screen::availTop() const +@@ -117,6 +120,9 @@ int Screen::availTop() const if (fingerprintingProtectionsEnabled(*frame)) return 0; @@ -6240,7 +6483,7 @@ index 4e4dfdebe954bf3f047d3a86a758dfd0913f732e..da2bcd0256cdfc2ba28fb07094abd0b6 return static_cast(screenAvailableRect(frame->protectedView().get()).y()); } -@@ -141,6 +147,9 @@ int Screen::availHeight() const +@@ -132,6 +138,9 @@ int Screen::availHeight() const if (fingerprintingProtectionsEnabled(*frame)) return static_cast(frame->screenSize().height()); @@ -6250,7 +6493,7 @@ index 4e4dfdebe954bf3f047d3a86a758dfd0913f732e..da2bcd0256cdfc2ba28fb07094abd0b6 return static_cast(screenAvailableRect(frame->protectedView().get()).height()); } -@@ -156,6 +165,9 @@ int Screen::availWidth() const +@@ -147,6 +156,9 @@ int Screen::availWidth() const if (fingerprintingProtectionsEnabled(*frame)) return static_cast(frame->screenSize().width()); @@ -6261,10 +6504,10 @@ index 4e4dfdebe954bf3f047d3a86a758dfd0913f732e..da2bcd0256cdfc2ba28fb07094abd0b6 } diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -index a35951b3150fe859450c5f781e44032078ca5f74..7fd0c71777a3fb451f3bd97b16911c01e5aa2203 100644 +index 50cf04e63a7de97d508448f181429f5b7fa438a3..6c2a5c085436eac669bce5f1d9094764ba0c6250 100644 --- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp +++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -@@ -336,6 +336,8 @@ bool ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtoc +@@ -344,6 +344,8 @@ bool ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtoc template typename std::enable_if::value, bool>::type ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, Predicate&& predicate, Args&&... args) const { @@ -6273,7 +6516,7 @@ index a35951b3150fe859450c5f781e44032078ca5f74..7fd0c71777a3fb451f3bd97b16911c01 bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; for (auto& policy : m_policies) { if (policy->isReportOnly() != isReportOnly) -@@ -349,6 +351,8 @@ typename std::enable_if bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, ViolatedDirectiveCallback&& callback, Predicate&& predicate, Args&&... args) const { @@ -6282,7 +6525,7 @@ index a35951b3150fe859450c5f781e44032078ca5f74..7fd0c71777a3fb451f3bd97b16911c01 bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; bool isAllowed = true; for (auto& policy : m_policies) { -@@ -365,6 +369,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit +@@ -373,6 +377,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit template bool ContentSecurityPolicy::allPoliciesAllow(ViolatedDirectiveCallback&& callback, Predicate&& predicate, Args&&... args) const { @@ -6390,7 +6633,7 @@ index 29492dd39b08db28aad2bf2439eb3e2bbcf25ad7..2b603cb8440b1b5057c87fcbd6909c61 ) diff --git a/Source/WebCore/platform/DragData.h b/Source/WebCore/platform/DragData.h -index 35cce31f0f77478754a7859c16f42b6a7ec6edda..03660bd492fad8863aeb21d73a54e7b914147f09 100644 +index 34f49853b1d5ac8d8409bbd36d203bf7dfbb08e8..6d2808d510413e89ae9851733437d15b7660cd4a 100644 --- a/Source/WebCore/platform/DragData.h +++ b/Source/WebCore/platform/DragData.h @@ -47,7 +47,7 @@ typedef void* DragDataRef; @@ -6413,7 +6656,7 @@ index 35cce31f0f77478754a7859c16f42b6a7ec6edda..03660bd492fad8863aeb21d73a54e7b9 void getDragFileDescriptorData(int& size, String& pathname); void getDragFileContentData(int size, void* dataBlob); #endif -@@ -141,7 +141,7 @@ private: +@@ -143,7 +143,7 @@ private: String m_pasteboardName; #endif #if PLATFORM(WIN) @@ -6423,7 +6666,7 @@ index 35cce31f0f77478754a7859c16f42b6a7ec6edda..03660bd492fad8863aeb21d73a54e7b9 bool m_disallowFileAccess { false }; }; diff --git a/Source/WebCore/platform/DragImage.cpp b/Source/WebCore/platform/DragImage.cpp -index dc894343a5d9ce0e45a370a83bebf97fdcbeccc5..00003bd9bada8f134b6cc49f47c8c5cb459d1ebd 100644 +index c359242a7967dab94b8dc3c276a6df5473527145..64b0c6a0bfdf27a0305c25e8b8e0cda637450aa4 100644 --- a/Source/WebCore/platform/DragImage.cpp +++ b/Source/WebCore/platform/DragImage.cpp @@ -280,7 +280,7 @@ DragImage::~DragImage() @@ -6435,8 +6678,22 @@ index dc894343a5d9ce0e45a370a83bebf97fdcbeccc5..00003bd9bada8f134b6cc49f47c8c5cb IntSize dragImageSize(DragImageRef) { +diff --git a/Source/WebCore/platform/MIMETypeRegistry.cpp b/Source/WebCore/platform/MIMETypeRegistry.cpp +index 092649a26549e8fc7c5683ad47585b4d7b1a0eab..7944352d9218b6237cfb4baceb686fcfa056c0ef 100644 +--- a/Source/WebCore/platform/MIMETypeRegistry.cpp ++++ b/Source/WebCore/platform/MIMETypeRegistry.cpp +@@ -663,6 +663,9 @@ bool MIMETypeRegistry::canShowMIMEType(const String& mimeType) + if (startsWithLettersIgnoringASCIICase(mimeType, "text/"_s)) + return !isUnsupportedTextMIMEType(mimeType); + ++ if (equalLettersIgnoringASCIICase(mimeType, "application/x-zerosize"_s)) ++ return true; ++ + return false; + } + diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h -index 2203effb3a0a745170680a23d0ff07f3a1a1cd1b..11c0fe944d603349087c942caff9081d819c40da 100644 +index 86205341336734eebfb9f1c98bb4b8ac4e81c3aa..1fd303a89a0431806f91ac072037806e7d6a2fe7 100644 --- a/Source/WebCore/platform/Pasteboard.h +++ b/Source/WebCore/platform/Pasteboard.h @@ -45,7 +45,7 @@ OBJC_CLASS NSString; @@ -6448,7 +6705,7 @@ index 2203effb3a0a745170680a23d0ff07f3a1a1cd1b..11c0fe944d603349087c942caff9081d #include "SelectionData.h" #endif -@@ -108,7 +108,7 @@ struct PasteboardURL { +@@ -107,7 +107,7 @@ struct PasteboardURL { #if PLATFORM(MAC) String userVisibleForm; #endif @@ -6457,7 +6714,7 @@ index 2203effb3a0a745170680a23d0ff07f3a1a1cd1b..11c0fe944d603349087c942caff9081d String markup; #endif }; -@@ -197,6 +197,11 @@ public: +@@ -195,6 +195,11 @@ public: #endif #endif @@ -6469,7 +6726,7 @@ index 2203effb3a0a745170680a23d0ff07f3a1a1cd1b..11c0fe944d603349087c942caff9081d #if PLATFORM(WIN) explicit Pasteboard(std::unique_ptr&&, IDataObject*); explicit Pasteboard(std::unique_ptr&&, WCDataObject*); -@@ -264,6 +269,12 @@ public: +@@ -262,6 +267,12 @@ public: int64_t changeCount() const; #endif @@ -6482,7 +6739,7 @@ index 2203effb3a0a745170680a23d0ff07f3a1a1cd1b..11c0fe944d603349087c942caff9081d #if PLATFORM(IOS_FAMILY) explicit Pasteboard(std::unique_ptr&&, int64_t changeCount); explicit Pasteboard(std::unique_ptr&&, const String& pasteboardName); -@@ -306,6 +317,7 @@ public: +@@ -304,6 +315,7 @@ public: COMPtr dataObject() const { return m_dataObject; } WEBCORE_EXPORT void setExternalDataObject(IDataObject*); const DragDataMap& dragDataMap() const { return m_dragDataMap; } @@ -6490,7 +6747,7 @@ index 2203effb3a0a745170680a23d0ff07f3a1a1cd1b..11c0fe944d603349087c942caff9081d void writeURLToWritableDataObject(const URL&, const String&); COMPtr writableDataObject() const { return m_writableDataObject; } void writeImageToDataObject(Element&, const URL&); // FIXME: Layering violation. -@@ -358,6 +370,10 @@ private: +@@ -356,6 +368,10 @@ private: int64_t m_changeCount { 0 }; #endif @@ -6501,7 +6758,7 @@ index 2203effb3a0a745170680a23d0ff07f3a1a1cd1b..11c0fe944d603349087c942caff9081d #if PLATFORM(COCOA) String m_pasteboardName; int64_t m_changeCount; -@@ -373,6 +389,7 @@ private: +@@ -371,6 +387,7 @@ private: COMPtr m_dataObject; COMPtr m_writableDataObject; DragDataMap m_dragDataMap; @@ -6619,6 +6876,18 @@ index 34715d27b529750fc866db87cd330b5184286771..3eefa218af075f76d98012cdeae7e4b3 // FIXME: since WPE currently does not send touch stationary events, we need to be able to // 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 c14a1b2e20cfc1dd15e483bd662ef40484da8c26..74b06820837d68b23e7a0eb5540b18688534ef09 100644 +--- a/Source/WebCore/platform/Skia.cmake ++++ b/Source/WebCore/platform/Skia.cmake +@@ -13,6 +13,7 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS + + platform/graphics/skia/GraphicsContextSkia.h + platform/graphics/skia/ImageBufferSkiaBackend.h ++ platform/graphics/skia/ImageBufferUtilitiesSkia.h + platform/graphics/skia/SkiaAcceleratedBufferPool.h + platform/graphics/skia/SkiaHarfBuzzFont.h + platform/graphics/skia/SkiaHarfBuzzFontCache.h diff --git a/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp b/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp index e280025043b3c03c3974289e62ef7cc88ebfa2c7..077a4ab4aa5b688937ed4d5018745aa6f6af7442 100644 --- a/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp @@ -6728,10 +6997,10 @@ index d137ffd1a8ed0b788bd28197c6d7e9f7d14e852f..dcf8bf3f7ee6b037a370712e2ac36b6e if (!image || !encodeImage(image, mimeType, &encodedImage)) return { }; diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.h b/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.h -index a82b748682f984fcdd4f5413d0254e0f5573f043..2c3d4bba92c63235c124a400d89455499aa3a189 100644 +index 5b659c763b9754b025a63f89522954cc39915b9a..448b50a2b131361a75d3f816cdcbb6a102551280 100644 --- a/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.h +++ b/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.h -@@ -38,7 +38,7 @@ WEBCORE_EXPORT uint8_t verifyImageBufferIsBigEnough(const void* buffer, size_t b +@@ -38,7 +38,7 @@ WEBCORE_EXPORT uint8_t verifyImageBufferIsBigEnough(std::span buf RetainPtr utiFromImageBufferMIMEType(const String& mimeType); CFStringRef jpegUTI(); @@ -6741,7 +7010,7 @@ index a82b748682f984fcdd4f5413d0254e0f5573f043..2c3d4bba92c63235c124a400d8945549 Vector encodeData(std::span, const String& mimeType, std::optional quality); diff --git a/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h -index b60f9a64bacc8282860da6de299b75aeb295b9b5..55bd017c03c6478ca334bd5ef164160fef5d5302 100644 +index 6f43c048cd8354c97097c8365b772b92a429b670..7bccf4f7921fb3b0848781252cd69b4bd6959287 100644 --- a/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h +++ b/Source/WebCore/platform/graphics/filters/software/FEComponentTransferSoftwareApplier.h @@ -23,6 +23,7 @@ @@ -6752,15 +7021,28 @@ index b60f9a64bacc8282860da6de299b75aeb295b9b5..55bd017c03c6478ca334bd5ef164160f namespace WebCore { +diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp +index 6f4b01b50a2278bfd0d0a072f5d1b6b367128706..f258f5f3e769c8c3a78a7801ebde09234c0298f7 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp +@@ -860,7 +860,7 @@ MediaPlayerEnums::SupportsType GStreamerRegistryScanner::isContentTypeSupported( + return SupportsType::IsNotSupported; + } + #else +- if (!factories.hasElementForMediaType(ElementFactories::Type::Decryptor, "application/x-webm-enc")) ++ if (!factories.hasElementForMediaType(ElementFactories::Type::Decryptor, "application/x-webm-enc"_s)) + return SupportsType::IsNotSupported; + #endif // GST_CHECK_VERSION(1, 22, 0) + } diff --git a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp -index 3f96ccee98a29188e4af376484ab6514b319ddf8..20d9ba661aa10adada5ef5688854b4bc3c0f0702 100644 +index eb9710f7d61121f2414c8aa6734dc27653e292bb..9c0c7b350a6140681242ce36a180d6866e3e0fc2 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, return stringIndices; } -+static int compactScriptItemsIfNeeded(const UChar* cp, unsigned stringLength, Vector& items, int numItems, const Font* font) ++static int compactScriptItemsIfNeeded(std::span cp, Vector& items, int numItems, const Font* font) +{ + // https://bugs.webkit.org/show_bug.cgi?id=201214 + // Uniscribe is overly aggressive in separating the runs. It'll split "3d_rotation" into "3", "d", "_" and "rotation" and we @@ -6771,11 +7053,11 @@ index 3f96ccee98a29188e4af376484ab6514b319ddf8..20d9ba661aa10adada5ef5688854b4bc + if (!numItems) + return numItems; + -+ if (font->platformData().isSystemFont() || font->platformData().hasVariations()) ++ if (font->platformData().hasVariations()) + return numItems; + + bool allGoodCharacters = true; -+ for (unsigned i = 0; allGoodCharacters && i < stringLength; ++i) { ++ for (unsigned i = 0; allGoodCharacters && i < cp.size(); ++i) { + const UChar c = cp[i]; + allGoodCharacters = (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_'; + } @@ -6787,33 +7069,34 @@ index 3f96ccee98a29188e4af376484ab6514b319ddf8..20d9ba661aa10adada5ef5688854b4bc + return 1; +} + - void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp, unsigned stringLength, unsigned stringLocation, const Font* font) + void ComplexTextController::collectComplexTextRunsForCharacters(std::span cp, unsigned stringLocation, const Font* font) { if (!font) { -@@ -198,6 +225,8 @@ void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp, +@@ -198,6 +225,8 @@ void ComplexTextController::collectComplexTextRunsForCharacters(std::span #include #include +#include #include + #include +#include namespace WebCore { -@@ -1301,6 +1303,246 @@ int PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode(unsigned keycode) +@@ -1302,6 +1304,246 @@ int PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode(unsigned keycode) } @@ -7061,10 +7344,10 @@ index 58f2ac6c28396289c55493c7a78b2b4709e5f129..cf9687900fdeeebe9d829907d121da24 { switch (val) { diff --git a/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp b/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp -index ae1da37330aa06a8f660876ba415ff2821f59813..c358a925347187181fbe1b381428c7bd0018455c 100644 +index a8fdb7d39e145778b27fdde0d407b7c01b61e12a..da36507b9d77bafd68a342affb4dc20512c6d7a2 100644 --- a/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp +++ b/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp -@@ -124,7 +124,7 @@ bool screenSupportsExtendedColor(Widget*) +@@ -134,7 +134,7 @@ bool screenSupportsExtendedColor(Widget*) } #if ENABLE(TOUCH_EVENTS) @@ -7073,7 +7356,7 @@ index ae1da37330aa06a8f660876ba415ff2821f59813..c358a925347187181fbe1b381428c7bd { auto* display = gdk_display_get_default(); if (!display) -@@ -134,7 +134,7 @@ bool screenHasTouchDevice() +@@ -144,7 +144,7 @@ bool screenHasTouchDevice() return seat ? gdk_seat_get_capabilities(seat) & GDK_SEAT_CAPABILITY_TOUCH : true; } @@ -7083,7 +7366,7 @@ index ae1da37330aa06a8f660876ba415ff2821f59813..c358a925347187181fbe1b381428c7bd auto* display = gdk_display_get_default(); if (!display) diff --git a/Source/WebCore/platform/libwpe/PasteboardLibWPE.cpp b/Source/WebCore/platform/libwpe/PasteboardLibWPE.cpp -index ae439e30f1fb239d18e1164e8896dfb272c75673..eddcb9bda783fcdcbf9f924d4eaa6cc78dd54395 100644 +index ae439e30f1fb239d18e1164e8896dfb272c75673..4cf29eda13d1f2dc2f03750c0ef8985b17de7f50 100644 --- a/Source/WebCore/platform/libwpe/PasteboardLibWPE.cpp +++ b/Source/WebCore/platform/libwpe/PasteboardLibWPE.cpp @@ -32,6 +32,10 @@ @@ -7107,7 +7390,7 @@ index ae439e30f1fb239d18e1164e8896dfb272c75673..eddcb9bda783fcdcbf9f924d4eaa6cc7 - notImplemented(); + if (m_selectionData) { + ListHashSet types; -+ if (auto* buffer = m_selectionData->customData()) { ++ if (auto& buffer = m_selectionData->customData()) { + auto customData = PasteboardCustomData::fromSharedBuffer(*buffer); + if (customData.origin() == origin) { + for (auto& type : customData.orderedTypes()) @@ -7134,7 +7417,7 @@ index ae439e30f1fb239d18e1164e8896dfb272c75673..eddcb9bda783fcdcbf9f924d4eaa6cc7 { - notImplemented(); // webkit.org/b/177633: [GTK] Move to new Pasteboard API + if (m_selectionData) { -+ if (auto* buffer = m_selectionData->customData()) ++ if (auto& buffer = m_selectionData->customData()) + return PasteboardCustomData::fromSharedBuffer(*buffer).origin(); + + return { }; @@ -7162,7 +7445,7 @@ index ae439e30f1fb239d18e1164e8896dfb272c75673..eddcb9bda783fcdcbf9f924d4eaa6cc7 +String Pasteboard::readStringInCustomData(const String& type) { + if (m_selectionData) { -+ if (auto* buffer = m_selectionData->customData()) ++ if (auto& buffer = m_selectionData->customData()) + return PasteboardCustomData::fromSharedBuffer(*buffer).readStringInCustomData(type); + + return { }; @@ -7290,21 +7573,22 @@ index ae439e30f1fb239d18e1164e8896dfb272c75673..eddcb9bda783fcdcbf9f924d4eaa6cc7 #endif // USE(LIBWPE) diff --git a/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp b/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp -index e187936cbef017c080d1dfa14de439b3f5bc2cf8..270c237c8db2f6809719ecfd54a95306728676bc 100644 +index a8674916429908cabb86bd95dc5b3da217e1556b..75cbb518708ebd459b1ed8e3206cdb02e502067d 100644 --- a/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp +++ b/Source/WebCore/platform/libwpe/PlatformKeyboardEventLibWPE.cpp -@@ -30,8 +30,10 @@ +@@ -30,9 +30,11 @@ #include "WindowsKeyboardCodes.h" #include +#include #include + #include #include +#include namespace WebCore { -@@ -1302,6 +1304,246 @@ int PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode(unsigned keycode) +@@ -1303,6 +1305,246 @@ int PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode(unsigned keycode) return 0; } @@ -7669,27 +7953,27 @@ index 0552842dbe3f3a2c12a504178f5a8ca977e1c4db..2ef3b1b459d8a9b4e86b4556feeb4f07 class WEBCORE_EXPORT LibWebRTCProviderGStreamer : public LibWebRTCProvider { diff --git a/Source/WebCore/platform/network/HTTPHeaderMap.cpp b/Source/WebCore/platform/network/HTTPHeaderMap.cpp -index 34caadc74c1ad6b411e9043289fece53b9757f17..1e8ec2fe9f16ddd0a33e261172689a9d35ec5194 100644 +index 65679251a5c66afcf60ed4d4267169eefed745f5..2cb9dc1f0e777fd172e52f5a6c8f4d6910c08c47 100644 --- a/Source/WebCore/platform/network/HTTPHeaderMap.cpp +++ b/Source/WebCore/platform/network/HTTPHeaderMap.cpp -@@ -235,8 +235,11 @@ void HTTPHeaderMap::add(HTTPHeaderName name, const String& value) +@@ -236,8 +236,11 @@ void HTTPHeaderMap::add(HTTPHeaderName name, const String& value) auto index = m_commonHeaders.findIf([&](auto& header) { return header.key == name; }); + // Align with Chromium and Firefox, but just for SetCookies where it is critical: + // https://bit.ly/2HCa0iq -+ String separator = name == HTTPHeaderName::SetCookie ? "\n "_s : ", "_s; ++ String separator = name == HTTPHeaderName::SetCookie ? "playwright-set-cookie-separator"_s : ", "_s; if (index != notFound) -- m_commonHeaders[index].value = makeString(m_commonHeaders[index].value, ", ", value); +- m_commonHeaders[index].value = makeString(m_commonHeaders[index].value, ", "_s, value); + m_commonHeaders[index].value = makeString(m_commonHeaders[index].value, separator, value); else m_commonHeaders.append(CommonHeader { name, value }); } diff --git a/Source/WebCore/platform/network/NetworkStorageSession.h b/Source/WebCore/platform/network/NetworkStorageSession.h -index e745131ddc12d23cd5e2429f565f910ad3520e82..dd23b06a3ceab1675e7e59d8642abc589c360d2a 100644 +index cf43da22a5f7674a1b24c4d39b492e0b8c318f3a..524e671cf6959fc48aefe4ec5a0611cb0cadf02b 100644 --- a/Source/WebCore/platform/network/NetworkStorageSession.h +++ b/Source/WebCore/platform/network/NetworkStorageSession.h -@@ -167,6 +167,8 @@ public: +@@ -184,6 +184,8 @@ public: NetworkingContext* context() const; #endif @@ -7699,10 +7983,10 @@ index e745131ddc12d23cd5e2429f565f910ad3520e82..dd23b06a3ceab1675e7e59d8642abc58 WEBCORE_EXPORT void setCookie(const Cookie&); WEBCORE_EXPORT void setCookies(const Vector&, const URL&, const URL& mainDocumentURL); diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp -index d47b089014717dc98928aa597ff881f3909559e1..3ab3262fd35c1ae740b6b8c01b6ce950fee0c224 100644 +index 97e5f6f38b9c036e8fc2fe6f4d4108f458113816..1391de13e58d82fd0ab9bf66bbc922d5bffa0627 100644 --- a/Source/WebCore/platform/network/ResourceResponseBase.cpp +++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp -@@ -74,6 +74,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional d +@@ -75,6 +75,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional d , m_httpStatusText(data ? data->httpStatusText : String { }) , m_httpVersion(data ? data->httpVersion : String { }) , m_httpHeaderFields(data ? data->httpHeaderFields : HTTPHeaderMap { }) @@ -7710,7 +7994,7 @@ index d47b089014717dc98928aa597ff881f3909559e1..3ab3262fd35c1ae740b6b8c01b6ce950 , m_networkLoadMetrics(data && data->networkLoadMetrics ? Box::create(*data->networkLoadMetrics) : Box { }) , m_certificateInfo(data ? data->certificateInfo : std::nullopt) , m_httpStatusCode(data ? data->httpStatusCode : 0) -@@ -892,6 +893,7 @@ std::optional ResourceResponseBase::getResponseData() cons +@@ -893,6 +894,7 @@ std::optional ResourceResponseBase::getResponseData() cons String { m_httpStatusText }, String { m_httpVersion }, HTTPHeaderMap { m_httpHeaderFields }, @@ -7718,7 +8002,7 @@ index d47b089014717dc98928aa597ff881f3909559e1..3ab3262fd35c1ae740b6b8c01b6ce950 m_networkLoadMetrics ? std::optional(*m_networkLoadMetrics) : std::nullopt, m_source, m_type, -@@ -965,6 +967,11 @@ std::optional Coder Coder httpStatusCode; decoder >> httpStatusCode; if (!httpStatusCode) -@@ -1019,6 +1026,7 @@ std::optional Coder Coder&&, size_t); diff --git a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp -index f46f26a553e0634fd6a4d383c0821aadd504a399..738327163771952be91bc024e92070c015de2dd3 100644 +index 7567442a6bdccbe755b2cf5e3fa42265a065a9e1..4886cf0b5a6bc0b8a270d763ad481f5bc6f0d1c2 100644 --- a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp +++ b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp -@@ -136,6 +136,12 @@ void NetworkStorageSession::setCookieAcceptPolicy(CookieAcceptPolicy policy) con +@@ -135,6 +135,12 @@ void NetworkStorageSession::setCookieAcceptPolicy(CookieAcceptPolicy policy) con cookieDatabase().setAcceptPolicy(policy); } @@ -7917,10 +8201,10 @@ index f46f26a553e0634fd6a4d383c0821aadd504a399..738327163771952be91bc024e92070c0 { switch (cookieDatabase().acceptPolicy()) { diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp -index 09ab1320beacc41ae92399f3320aaf805d9d81d1..4c63cb2a3f6fbf277227a88b92f206402bc12cd7 100644 +index 09ab1320beacc41ae92399f3320aaf805d9d81d1..e1caf6e7ebd61151439a9c86350e57122784af0b 100644 --- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp +++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp -@@ -424,6 +424,30 @@ void NetworkStorageSession::replaceCookies(const Vector& cookies) +@@ -424,6 +424,26 @@ void NetworkStorageSession::replaceCookies(const Vector& cookies) g_signal_emit(jar, signalId, 0); } @@ -7940,11 +8224,7 @@ index 09ab1320beacc41ae92399f3320aaf805d9d81d1..4c63cb2a3f6fbf277227a88b92f20640 + if (!cookie) + continue; + -+#if SOUP_CHECK_VERSION(2, 67, 1) + soup_cookie_jar_add_cookie_full(cookieStorage(), cookie.release(), origin.get(), firstPartyURI.get()); -+#else -+ soup_cookie_jar_add_cookie_with_first_party(cookieStorage(), firstPartyURI.get(), cookie.release()); -+#endif + } +} + @@ -7952,10 +8232,10 @@ index 09ab1320beacc41ae92399f3320aaf805d9d81d1..4c63cb2a3f6fbf277227a88b92f20640 { GUniquePtr targetCookie(cookie.toSoupCookie()); diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp -index 15f47d0d2a99bcb1a7b9dd9764a9766a20e97692..f623d165826485f58cef60c4b3551055f4352de6 100644 +index 71c773f4532b6670c4f29496cc8c4bd3093304b1..5876dfa98bb9cdb78d0de807d4408ae661c3f288 100644 --- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp +++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp -@@ -39,6 +39,7 @@ +@@ -40,6 +40,7 @@ #include #include #include @@ -7963,7 +8243,7 @@ index 15f47d0d2a99bcb1a7b9dd9764a9766a20e97692..f623d165826485f58cef60c4b3551055 namespace WebCore { -@@ -689,7 +690,10 @@ template void getStringData(IDataObject* data, FORMATETC* format, Ve +@@ -690,7 +691,10 @@ template void getStringData(IDataObject* data, FORMATETC* format, Ve STGMEDIUM store; if (FAILED(data->GetData(format, &store))) return; @@ -7988,7 +8268,7 @@ index c3ffc7392c0b7fa099a7dd4e4be977cdee1c803c..9570dbb0f2c42ca38598a8898183c9b3 HGLOBAL createGlobalData(const String&); HGLOBAL createGlobalData(const Vector&); diff --git a/Source/WebCore/platform/win/DragDataWin.cpp b/Source/WebCore/platform/win/DragDataWin.cpp -index 7bdb180c89bf3fe9d48098318d3b7503b8fd6279..296a3b2b82733b27272acb51ab4f883decfbaf14 100644 +index 0379437d84807e4a8d3846afac5ec8a70e743e70..1ae19e2b755e99c9f4c3e6d5dc0e4f8b6ebe8ab3 100644 --- a/Source/WebCore/platform/win/DragDataWin.cpp +++ b/Source/WebCore/platform/win/DragDataWin.cpp @@ -40,7 +40,7 @@ @@ -8018,10 +8298,10 @@ index 7bdb180c89bf3fe9d48098318d3b7503b8fd6279..296a3b2b82733b27272acb51ab4f883d if (!m_dragDataMap.isEmpty() || !m_platformDragData) return m_dragDataMap; diff --git a/Source/WebCore/platform/win/KeyEventWin.cpp b/Source/WebCore/platform/win/KeyEventWin.cpp -index b9f728911d34163c1ca14d359741d44cc05ab755..1609197044eaa8e9036e6dae23d1c5270b53e08b 100644 +index d450bf9d0fd1f0bf8f28db483ac9d3d60fa9d114..72a59403a0b5493aea4a8e28eb15eac24b652b09 100644 --- a/Source/WebCore/platform/win/KeyEventWin.cpp +++ b/Source/WebCore/platform/win/KeyEventWin.cpp -@@ -242,10 +242,16 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(HWND, WPARAM code, LPARAM keyData, +@@ -243,10 +243,16 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(HWND, WPARAM code, LPARAM keyData, { } @@ -8042,10 +8322,10 @@ index b9f728911d34163c1ca14d359741d44cc05ab755..1609197044eaa8e9036e6dae23d1c527 OptionSet PlatformKeyboardEvent::currentStateOfModifierKeys() diff --git a/Source/WebCore/platform/win/PasteboardWin.cpp b/Source/WebCore/platform/win/PasteboardWin.cpp -index 5728033e25919cef5b81d08516964aa5445c5d6e..0e588ebd34299d56ace86806bdec6e9ce337b053 100644 +index 03e5dc0b6ff099c281c61f05b29cf155b96922af..9b4694bc816e0e62a37c57e64729f183baca9080 100644 --- a/Source/WebCore/platform/win/PasteboardWin.cpp +++ b/Source/WebCore/platform/win/PasteboardWin.cpp -@@ -1130,7 +1130,21 @@ void Pasteboard::writeCustomData(const Vector& data) +@@ -1137,7 +1137,21 @@ void Pasteboard::writeCustomData(const Vector& data) } clear(); @@ -8067,7 +8347,7 @@ index 5728033e25919cef5b81d08516964aa5445c5d6e..0e588ebd34299d56ace86806bdec6e9c if (::OpenClipboard(m_owner)) { const auto& customData = data.first(); customData.forEachPlatformStringOrBuffer([](auto& type, auto& stringOrBuffer) { -@@ -1169,4 +1183,25 @@ void Pasteboard::write(const Color&) +@@ -1176,4 +1190,25 @@ void Pasteboard::write(const Color&) { } @@ -8095,10 +8375,10 @@ index 5728033e25919cef5b81d08516964aa5445c5d6e..0e588ebd34299d56ace86806bdec6e9c } // namespace WebCore diff --git a/Source/WebCore/platform/wpe/DragDataWPE.cpp b/Source/WebCore/platform/wpe/DragDataWPE.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..f8fc3fa43bfe62a1c066689f48ddabaaa357a437 +index 0000000000000000000000000000000000000000..fbd32d390129129fd5b213f7f9c3e96bdca9355b --- /dev/null +++ b/Source/WebCore/platform/wpe/DragDataWPE.cpp -@@ -0,0 +1,87 @@ +@@ -0,0 +1,92 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public @@ -8185,6 +8465,11 @@ index 0000000000000000000000000000000000000000..f8fc3fa43bfe62a1c066689f48ddabaa + return m_platformDragData->url().string(); +} + ++bool DragData::shouldMatchStyleOnDrop() const ++{ ++ return false; ++} ++ +} diff --git a/Source/WebCore/platform/wpe/DragImageWPE.cpp b/Source/WebCore/platform/wpe/DragImageWPE.cpp new file mode 100644 @@ -8286,10 +8571,10 @@ index 77bdff686770e56f5445fa12216c6bff93bb5cfb..e16583ea6298864df9c8b82cb0686b2a } diff --git a/Source/WebCore/platform/wpe/SelectionData.cpp b/Source/WebCore/platform/wpe/SelectionData.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..39756417d475f3aae77c2f3d7772a71a6e1bec57 +index 0000000000000000000000000000000000000000..947bfe6576780038ecb87ea9bda116adb19dfd71 --- /dev/null +++ b/Source/WebCore/platform/wpe/SelectionData.cpp -@@ -0,0 +1,134 @@ +@@ -0,0 +1,151 @@ +/* + * Copyright (C) 2009, Martin Robinson + * @@ -8317,6 +8602,23 @@ index 0000000000000000000000000000000000000000..39756417d475f3aae77c2f3d7772a71a + +namespace WebCore { + ++SelectionData::SelectionData(const String& text, const String& markup, const URL& url, const String& uriList, RefPtr&& image, RefPtr&& buffer, bool canSmartReplace) ++{ ++ if (!text.isEmpty()) ++ setText(text); ++ if (!markup.isEmpty()) ++ setMarkup(markup); ++ if (!url.isEmpty()) ++ setURL(url, String()); ++ if (!uriList.isEmpty()) ++ setURIList(uriList); ++ if (image) ++ setImage(WTFMove(image)); ++ if (buffer) ++ setCustomData(buffer.releaseNonNull()); ++ setCanSmartReplace(canSmartReplace); ++} ++ +static void replaceNonBreakingSpaceWithSpace(String& str) +{ + static const UChar NonBreakingSpaceCharacter = 0xA0; @@ -8385,12 +8687,12 @@ index 0000000000000000000000000000000000000000..39756417d475f3aae77c2f3d7772a71a + actualLabel = url.string(); + + StringBuilder markup; -+ markup.append(""); ++ markup.append("\">"_s); + GUniquePtr escaped(g_markup_escape_text(actualLabel.utf8().data(), -1)); + markup.append(String::fromUTF8(escaped.get())); -+ markup.append(""); ++ markup.append(""_s); + setMarkup(markup.toString()); +} + @@ -8426,10 +8728,10 @@ index 0000000000000000000000000000000000000000..39756417d475f3aae77c2f3d7772a71a +} // namespace WebCore diff --git a/Source/WebCore/platform/wpe/SelectionData.h b/Source/WebCore/platform/wpe/SelectionData.h new file mode 100644 -index 0000000000000000000000000000000000000000..cf2b51f6f02837a1106f4d999f2f130e2580986a +index 0000000000000000000000000000000000000000..a76b583a1e65cd6999fab4784c22dd9cb48d6aeb --- /dev/null +++ b/Source/WebCore/platform/wpe/SelectionData.h -@@ -0,0 +1,82 @@ +@@ -0,0 +1,85 @@ +/* + * Copyright (C) 2009, Martin Robinson + * @@ -8484,8 +8786,8 @@ index 0000000000000000000000000000000000000000..cf2b51f6f02837a1106f4d999f2f130e + bool hasFilenames() const { return !m_filenames.isEmpty(); } + void clearURIList() { m_uriList = emptyString(); } + -+ void setImage(Image* newImage) { m_image = newImage; } -+ Image* image() const { return m_image.get(); } ++ void setImage(RefPtr&& newImage) { m_image = WTFMove(newImage); } ++ const RefPtr& image() const { return m_image; } + bool hasImage() const { return m_image; } + void clearImage() { m_image = nullptr; } + @@ -8493,13 +8795,16 @@ index 0000000000000000000000000000000000000000..cf2b51f6f02837a1106f4d999f2f130e + bool canSmartReplace() const { return m_canSmartReplace; } + + void setCustomData(Ref&& buffer) { m_customData = WTFMove(buffer); } -+ SharedBuffer* customData() const { return m_customData.get(); } ++ const RefPtr& customData() const { return m_customData; } + bool hasCustomData() const { return !!m_customData; } + void clearCustomData() { m_customData = nullptr; } + + void clearAll(); + void clearAllExceptFilenames(); + ++ SelectionData(const String& text, const String& markup, const URL&, const String& uriList, RefPtr&&, RefPtr&&, bool); ++ SelectionData() = default; ++ +private: + String m_text; + String m_markup; @@ -8512,11 +8817,24 @@ index 0000000000000000000000000000000000000000..cf2b51f6f02837a1106f4d999f2f130e +}; + +} // namespace WebCore +diff --git a/Source/WebCore/rendering/AncestorSubgridIterator.cpp b/Source/WebCore/rendering/AncestorSubgridIterator.cpp +index 9e7a774c2e0e591e491e0cda3657ae02f4543453..3161944e8f455d4dd33f6bbfd81ae2bb54d0787a 100644 +--- a/Source/WebCore/rendering/AncestorSubgridIterator.cpp ++++ b/Source/WebCore/rendering/AncestorSubgridIterator.cpp +@@ -30,7 +30,7 @@ + + namespace WebCore { + +-AncestorSubgridIterator::AncestorSubgridIterator() = default; ++AncestorSubgridIterator::AncestorSubgridIterator() { }; + + AncestorSubgridIterator::AncestorSubgridIterator(SingleThreadWeakPtr firstAncestorSubgrid, GridTrackSizingDirection direction) + : m_firstAncestorSubgrid(firstAncestorSubgrid) diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp -index 58574b4d9fb503918e2cac0993ffe778f256a953..23de6aecb4ea7f7a1a36af6a93611559f19cfc11 100644 +index 5d81c5942027e02222430036013e2a066a6bae06..0246502c570719cc9c9362726b9bc03ded002a0b 100644 --- a/Source/WebCore/rendering/RenderTextControl.cpp +++ b/Source/WebCore/rendering/RenderTextControl.cpp -@@ -222,13 +222,13 @@ void RenderTextControl::layoutExcludedChildren(bool relayoutChildren) +@@ -225,13 +225,13 @@ void RenderTextControl::layoutExcludedChildren(bool relayoutChildren) } } @@ -8570,7 +8888,7 @@ index 1d8488e0d36288e09cd5662bd7f770ade95dfee3..dee07f87b47d62d4ef8ede45824bdb2f WorkerOrWorkletGlobalScope& m_globalScope; }; diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp -index caf9b8fe4c94e56154fa70b4b09391dc1db5b4b6..e9c038a464ac0e30bce7c1e162911d12086c1082 100644 +index 5f283341f89b3bc3be0c7508a0d995144764bb45..dc618d18fcfe7ef819f3724847f3d4e4c6771fc2 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp @@ -96,6 +96,8 @@ @@ -8582,7 +8900,7 @@ index caf9b8fe4c94e56154fa70b4b09391dc1db5b4b6..e9c038a464ac0e30bce7c1e162911d12 #endif #if ENABLE(APPLE_PAY_REMOTE_UI) -@@ -1093,6 +1095,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) +@@ -1090,6 +1092,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) storageSession->clearPageSpecificDataForResourceLoadStatistics(pageID); } @@ -8598,7 +8916,7 @@ index caf9b8fe4c94e56154fa70b4b09391dc1db5b4b6..e9c038a464ac0e30bce7c1e162911d12 { if (auto* storageSession = networkProcess().storageSession(m_sessionID)) diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h -index a9fd7f7625ca67043c8ed0dcd7979df49cd65266..8e7903e0c5acefb8c5381f8297b52d610b8e4a29 100644 +index 0b2641927c4f8b17381b8e8c5bfa5e666506e229..22073e29d1104d928e5ca2fa56ffe830ede1f8a8 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h @@ -343,6 +343,8 @@ private: @@ -8611,7 +8929,7 @@ index a9fd7f7625ca67043c8ed0dcd7979df49cd65266..8e7903e0c5acefb8c5381f8297b52d61 void logUserInteraction(RegistrableDomain&&); diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in -index b90021dcc3e4d70cb7b42b538050c5a37653b3cd..acc42255c8d3fb08971f62e6771f022f544199b7 100644 +index 1edf0f0137dcf67dd425ce92180cdd5a1811475b..0af045974298fee7227b0cfa8b2b9e6c54779ec0 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in @@ -74,6 +74,8 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver { @@ -8624,10 +8942,10 @@ index b90021dcc3e4d70cb7b42b538050c5a37653b3cd..acc42255c8d3fb08971f62e6771f022f LogUserInteraction(WebCore::RegistrableDomain domain) ResourceLoadStatisticsUpdated(Vector statistics) -> () diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp -index cd174626a10faea7348b568bcfc384d9aaa86f5a..72e66509f540301cedc64ac9ea69f50fb1044245 100644 +index 5d7274e691dbe4a9c4763b349abca7d94e878554..d58697dd16691e1caa53a5548eb68cff1309f163 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp +++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp -@@ -658,6 +658,12 @@ void NetworkProcess::registrableDomainsExemptFromWebsiteDataDeletion(PAL::Sessio +@@ -659,6 +659,12 @@ void NetworkProcess::registrableDomainsExemptFromWebsiteDataDeletion(PAL::Sessio completionHandler({ }); } @@ -8641,7 +8959,7 @@ index cd174626a10faea7348b568bcfc384d9aaa86f5a..72e66509f540301cedc64ac9ea69f50f { if (auto* session = networkSession(sessionID)) { diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h -index 6d41842684f3e0e8b1190359f87105b747cf9da9..279d5c033397afb120a082953c0112f34bf2878a 100644 +index 95572ae0054657f1f8f2840291d49f8d23340990..38f6df007d51c53792d270f3d50fa2f1b77b4ca1 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.h +++ b/Source/WebKit/NetworkProcess/NetworkProcess.h @@ -33,6 +33,7 @@ @@ -8671,10 +8989,10 @@ index 6d41842684f3e0e8b1190359f87105b747cf9da9..279d5c033397afb120a082953c0112f3 void clearUserInteraction(PAL::SessionID, RegistrableDomain&&, CompletionHandler&&); void deleteAndRestrictWebsiteDataForRegistrableDomains(PAL::SessionID, OptionSet, RegistrableDomainsToDeleteOrRestrictWebsiteDataFor&&, bool shouldNotifyPage, CompletionHandler&&)>&&); diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in -index 5e590b5a09f8bd5d040e2e68d54c545c52d4b179..c58bb6270ab75026187fdda6c94822f6aa47a35a 100644 +index 9679dc2ceea7b085638c19c00ba9fd04e71507da..130f12138c427a90dfffb96d7e219a258e819d10 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in +++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in -@@ -79,6 +79,8 @@ messages -> NetworkProcess LegacyReceiver { +@@ -82,6 +82,8 @@ messages -> NetworkProcess LegacyReceiver { SetInspectionForServiceWorkersAllowed(PAL::SessionID sessionID, bool inspectable) @@ -8684,7 +9002,7 @@ index 5e590b5a09f8bd5d040e2e68d54c545c52d4b179..c58bb6270ab75026187fdda6c94822f6 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 b22ff912dba5b116a979119af6721bcfcc72ec5d..deb9a0b67adb51b190833354e7ea5d8e46aea56c 100644 +index f5a62296667657a7f094627e0792cb4284c04ec4..93c34c61f1cb29f3ed4c1c787da6f3efe994cfb2 100644 --- a/Source/WebKit/NetworkProcess/NetworkSession.h +++ b/Source/WebKit/NetworkProcess/NetworkSession.h @@ -200,6 +200,9 @@ public: @@ -8706,10 +9024,10 @@ index b22ff912dba5b116a979119af6721bcfcc72ec5d..deb9a0b67adb51b190833354e7ea5d8e HashSet> m_keptAliveLoads; diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -index 95d84783fe56cc381e67113924780bf1e2d9320e..129e7ada7fa90665a80ccf79641d7fcaf9f085a0 100644 +index 6c4c0e37a75426d90667c9ec595f8fa1b19ca502..45d1e5916c8cc5ec0136cf3b3596e9efb5e4a1ec 100644 --- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm +++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -@@ -761,6 +761,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didRece +@@ -769,6 +769,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didRece if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { sessionCocoa->setClientAuditToken(challenge); @@ -8718,7 +9036,7 @@ index 95d84783fe56cc381e67113924780bf1e2d9320e..129e7ada7fa90665a80ccf79641d7fca NSURLSessionTaskTransactionMetrics *metrics = task._incompleteTaskMetrics.transactionMetrics.lastObject; auto tlsVersion = (tls_protocol_version_t)metrics.negotiatedTLSProtocolVersion.unsignedShortValue; -@@ -1100,6 +1102,13 @@ ALLOW_DEPRECATED_DECLARATIONS_END +@@ -1113,6 +1115,13 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data resourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics, networkDataTask->networkLoadMetrics())); @@ -8733,7 +9051,7 @@ index 95d84783fe56cc381e67113924780bf1e2d9320e..129e7ada7fa90665a80ccf79641d7fca #if !LOG_DISABLED LOG(NetworkSession, "%llu didReceiveResponse completionHandler (%d)", taskIdentifier, policyAction); diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp -index 383b0c08feda5c59455407093f656311c0a0c3fc..4522f3a562e67f41f29ee699ab9ed9dad999d90e 100644 +index 7fea007b41d750e14b6807f894b3167d0e0963e1..fbcf34cc6d8291eab7768f5f33117e3dc5e9289e 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp +++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp @@ -80,10 +80,18 @@ NetworkDataTaskCurl::NetworkDataTaskCurl(NetworkSession& session, NetworkDataTas @@ -8789,7 +9107,7 @@ index 383b0c08feda5c59455407093f656311c0a0c3fc..4522f3a562e67f41f29ee699ab9ed9da + return; + } + -+ if (-1 == FileSystem::writeToFile(m_downloadDestinationFile, static_cast(m_dataURLResult.value().data.data()), m_dataURLResult.value().data.size())) { ++ if (-1 == FileSystem::writeToFile(m_downloadDestinationFile, 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; @@ -8803,7 +9121,7 @@ index 383b0c08feda5c59455407093f656311c0a0c3fc..4522f3a562e67f41f29ee699ab9ed9da + void NetworkDataTaskCurl::invokeDidReceiveResponse() { - didReceiveResponse(ResourceResponse(m_response), NegotiatedLegacyTLS::No, PrivateRelayed::No, [this, protectedThis = Ref { *this }](PolicyAction policyAction) { + didReceiveResponse(ResourceResponse(m_response), NegotiatedLegacyTLS::No, PrivateRelayed::No, std::nullopt, [this, protectedThis = Ref { *this }](PolicyAction policyAction) { @@ -320,6 +359,8 @@ void NetworkDataTaskCurl::invokeDidReceiveResponse() downloadPtr->didCreateDestination(m_pendingDownloadLocation); if (m_curlRequest) @@ -8823,7 +9141,7 @@ index 383b0c08feda5c59455407093f656311c0a0c3fc..4522f3a562e67f41f29ee699ab9ed9da 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 bfff08efb10d4d6cd1a27755403ed53ed58ce919..1a59755f684229bd47fd70369e4a9d4282950ef7 100644 +index ce5e9ea8c6cf1966f0705732b6b37d1639847a3c..7a7a38947a8f3f20b0439bb84d00dcef6391f4a5 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h +++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h @@ -28,6 +28,7 @@ @@ -8843,7 +9161,7 @@ index bfff08efb10d4d6cd1a27755403ed53ed58ce919..1a59755f684229bd47fd70369e4a9d42 class NetworkDataTaskCurl final : public NetworkDataTask, public WebCore::CurlRequestClient { public: static Ref create(NetworkSession& session, NetworkDataTaskClient& client, const NetworkLoadParameters& parameters) -@@ -75,6 +78,9 @@ private: +@@ -76,6 +79,9 @@ private: void curlDidComplete(WebCore::CurlRequest&, WebCore::NetworkLoadMetrics&&) override; void curlDidFailWithError(WebCore::CurlRequest&, WebCore::ResourceError&&, WebCore::CertificateInfo&&) override; @@ -8853,7 +9171,7 @@ index bfff08efb10d4d6cd1a27755403ed53ed58ce919..1a59755f684229bd47fd70369e4a9d42 void invokeDidReceiveResponse(); bool shouldStartHTTPRedirection(); -@@ -113,6 +119,9 @@ private: +@@ -114,6 +120,9 @@ private: unsigned m_authFailureCount { 0 }; bool m_allowOverwriteDownload { false }; @@ -8877,10 +9195,10 @@ index 486849ef6f550a0f3caab311abf5743c6d38e5af..afeaac63a18d9e71d3afead23b7da4fe void NetworkSessionCurl::didReceiveChallenge(WebSocketTask& webSocketTask, WebCore::AuthenticationChallenge&& challenge, CompletionHandler&& challengeCompletionHandler) diff --git a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp -index 60106d6125f85d0cf848e828fd4ed7a50005f105..021d7b6d12baf4671a2968753969ca4675044313 100644 +index a5198bfa752746dd83dc2617606a27194afcd86f..3ca6b32e93bdaff2baae22170c84efe9bfe875d3 100644 --- a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp +++ b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp -@@ -36,11 +36,12 @@ +@@ -37,11 +37,12 @@ namespace WebKit { @@ -8894,7 +9212,7 @@ index 60106d6125f85d0cf848e828fd4ed7a50005f105..021d7b6d12baf4671a2968753969ca46 , m_scheduler(WebCore::CurlContext::singleton().streamScheduler()) { // We use topOrigin in case of service worker websocket connections, for which pageID does not link to a real page. -@@ -52,7 +53,7 @@ WebSocketTask::WebSocketTask(NetworkSocketChannel& channel, WebPageProxyIdentifi +@@ -53,7 +54,7 @@ WebSocketTask::WebSocketTask(NetworkSocketChannel& channel, WebPageProxyIdentifi if (networkSession() && networkSession()->networkProcess().localhostAliasesForTesting().contains(m_request.url().host())) localhostAlias = WebCore::CurlStream::LocalhostAlias::Enable; @@ -8903,7 +9221,7 @@ index 60106d6125f85d0cf848e828fd4ed7a50005f105..021d7b6d12baf4671a2968753969ca46 m_channel.didSendHandshakeRequest(WebCore::ResourceRequest(m_request)); } -@@ -257,7 +258,7 @@ void WebSocketTask::tryServerTrustEvaluation(WebCore::AuthenticationChallenge&& +@@ -258,7 +259,7 @@ void WebSocketTask::tryServerTrustEvaluation(WebCore::AuthenticationChallenge&& if (networkSession() && networkSession()->networkProcess().localhostAliasesForTesting().contains(m_request.url().host())) localhostAlias = WebCore::CurlStream::LocalhostAlias::Enable; @@ -8913,10 +9231,10 @@ index 60106d6125f85d0cf848e828fd4ed7a50005f105..021d7b6d12baf4671a2968753969ca46 didFail(WTFMove(errorReason)); }); diff --git a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h -index 5023a9be6554abc9ffe8fb37968978cb28c5b9a1..9cfdedd0411bf32843c2c9a7d7d722c5ee4f6e46 100644 +index 41c99c4796ab2b624dffe35d34f9ea1bcf54f966..d83977c09adf271ddf7243a51300882e4f2bd0d9 100644 --- a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h +++ b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h -@@ -49,7 +49,7 @@ struct SessionSet; +@@ -58,7 +58,7 @@ struct SessionSet; class WebSocketTask : public CanMakeWeakPtr, public WebCore::CurlStream::Client { WTF_MAKE_FAST_ALLOCATED; public: @@ -8925,7 +9243,7 @@ index 5023a9be6554abc9ffe8fb37968978cb28c5b9a1..9cfdedd0411bf32843c2c9a7d7d722c5 virtual ~WebSocketTask(); void sendString(std::span, CompletionHandler&&); -@@ -102,6 +102,7 @@ private: +@@ -111,6 +111,7 @@ private: WebPageProxyIdentifier m_webProxyPageID; WebCore::ResourceRequest m_request; String m_protocol; @@ -8953,12 +9271,12 @@ index 51f3fb7ae9a4e208bc11ac583b72e772eac5e4dc..386ec972eba86763b83407c322a971a3 ;; 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 4295b59484942084404ff7b03669aba249667e97..73dea05ac933938a19bbd6ec5bbcbd6139f98c25 100644 +index 61d9c1d41fdc490faf800fb30d66eb4603950cbf..3dffffe74cd04b22e40ce0d94326760404fbbc6c 100644 --- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp +++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp -@@ -466,6 +466,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr&& inputStream) - m_networkLoadMetrics.failsTAOCheck = !passesTimingAllowOriginCheck(m_response, *origin); - } +@@ -461,6 +461,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr&& inputStream) + m_networkLoadMetrics.responseStart = MonotonicTime::now(); + #endif + auto& additionalMetrics = additionalNetworkLoadMetricsForWebInspector(); + m_response.m_httpRequestHeaderFields = additionalMetrics.requestHeaders; @@ -8975,7 +9293,7 @@ index 4295b59484942084404ff7b03669aba249667e97..73dea05ac933938a19bbd6ec5bbcbd61 if (!error) return true; diff --git a/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp -index 60e79ff683e280591d686468c42decf1ac109ed2..ef74cb09e75c3e6f57d180487fa266b7a0f09af5 100644 +index 60e79ff683e280591d686468c42decf1ac109ed2..99707bc16644b88ff24a192029f3866e0a80e827 100644 --- a/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp +++ b/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp @@ -97,6 +97,11 @@ void NetworkSessionSoup::clearCredentials(WallTime) @@ -8990,31 +9308,9 @@ index 60e79ff683e280591d686468c42decf1ac109ed2..ef74cb09e75c3e6f57d180487fa266b7 #if USE(SOUP2) static gboolean webSocketAcceptCertificateCallback(GTlsConnection* connection, GTlsCertificate* certificate, GTlsCertificateFlags errors, NetworkSessionSoup* session) { -@@ -117,6 +122,15 @@ static void webSocketMessageNetworkEventCallback(SoupMessage* soupMessage, GSock - } - #endif - -+static void webSocketMessageNetworkEventCallbackIgnoreTLSErrors(SoupMessage* soupMessage, GSocketClientEvent event, GIOStream* connection) -+{ -+ if (event != G_SOCKET_CLIENT_TLS_HANDSHAKING) -+ return; -+ -+ g_object_set_data(G_OBJECT(connection), "wk-soup-message", soupMessage); -+ g_signal_connect(connection, "accept-certificate", G_CALLBACK(webSocketAcceptCertificateCallbackIgnoreTLSErrors), soupMessage); -+} -+ - std::unique_ptr NetworkSessionSoup::createWebSocketTask(WebPageProxyIdentifier, std::optional frameID, std::optional pageID, NetworkSocketChannel& channel, const ResourceRequest& request, const String& protocol, const ClientOrigin&, bool, bool, OptionSet, ShouldRelaxThirdPartyCookieBlocking shouldRelaxThirdPartyCookieBlocking, StoredCredentialsPolicy) - { - GRefPtr soupMessage = request.createSoupMessage(blobRegistry()); -@@ -125,14 +139,21 @@ std::unique_ptr NetworkSessionSoup::createWebSocketTask(WebPagePr - - if (request.url().protocolIs("wss"_s)) { +@@ -127,12 +132,16 @@ std::unique_ptr NetworkSessionSoup::createWebSocketTask(WebPagePr #if USE(SOUP2) -- g_signal_connect(soupMessage.get(), "network-event", G_CALLBACK(webSocketMessageNetworkEventCallback), this); -+ if (ignoreCertificateErrors()) -+ g_signal_connect(soupMessage.get(), "network-event", G_CALLBACK(webSocketMessageNetworkEventCallbackIgnoreTLSErrors), this); -+ else -+ g_signal_connect(soupMessage.get(), "network-event", G_CALLBACK(webSocketMessageNetworkEventCallback), this); + g_signal_connect(soupMessage.get(), "network-event", G_CALLBACK(webSocketMessageNetworkEventCallback), this); #else - g_signal_connect(soupMessage.get(), "accept-certificate", G_CALLBACK(+[](SoupMessage* message, GTlsCertificate* certificate, GTlsCertificateFlags errors, NetworkSessionSoup* session) -> gboolean { - if (DeprecatedGlobalSettings::allowsAnySSLCertificate()) @@ -9036,10 +9332,10 @@ index 60e79ff683e280591d686468c42decf1ac109ed2..ef74cb09e75c3e6f57d180487fa266b7 } diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake -index bd8dab990c4c034059d21588921784f047bb6d6a..46a61dcef89e94a9a1a25e6ae352ec88f0aec5e7 100644 +index a509f56343f94f1bc30658ec9928ec1796a5a9b8..e2fcf6d35053f6982975d238f17b76f49e1bacdc 100644 --- a/Source/WebKit/PlatformGTK.cmake +++ b/Source/WebKit/PlatformGTK.cmake -@@ -321,6 +321,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES +@@ -324,6 +324,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES ${GSTREAMER_PBUTILS_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${LIBSOUP_INCLUDE_DIRS} @@ -9049,7 +9345,7 @@ index bd8dab990c4c034059d21588921784f047bb6d6a..46a61dcef89e94a9a1a25e6ae352ec88 ) list(APPEND WebKit_INTERFACE_INCLUDE_DIRECTORIES -@@ -351,6 +354,9 @@ if (USE_LIBWEBRTC) +@@ -354,6 +357,9 @@ if (USE_LIBWEBRTC) list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/libwebrtc/Source/" "${THIRDPARTY_DIR}/libwebrtc/Source/webrtc" @@ -9059,7 +9355,7 @@ index bd8dab990c4c034059d21588921784f047bb6d6a..46a61dcef89e94a9a1a25e6ae352ec88 ) endif () -@@ -402,6 +408,12 @@ else () +@@ -405,6 +411,12 @@ else () set(WebKitGTK_ENUM_HEADER_TEMPLATE ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitEnumTypesGtk3.h.in) endif () @@ -9073,10 +9369,19 @@ index bd8dab990c4c034059d21588921784f047bb6d6a..46a61dcef89e94a9a1a25e6ae352ec88 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 8f27536b690e863fcaf086c04d1b0fb21356a622..a0207624821b4179d7adc646adf06aae65f0ca33 100644 +index aa5c183a4c0946270713840071cf0167533158f6..637365fbb7d91f99ba1478188291bedff9b1cc2b 100644 --- a/Source/WebKit/PlatformWPE.cmake +++ b/Source/WebKit/PlatformWPE.cmake -@@ -212,6 +212,7 @@ set(WPE_API_HEADER_TEMPLATES +@@ -111,6 +111,8 @@ list(APPEND WebKit_SERIALIZATION_IN_FILES + Shared/glib/UserMessage.serialization.in + + Shared/soup/WebCoreArgumentCodersSoup.serialization.in ++ ++ Shared/libwpe/ArgumentCodersWPE.serialization.in + ) + + list(APPEND WebKit_DERIVED_SOURCES +@@ -215,6 +217,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 @@ -9084,26 +9389,25 @@ index 8f27536b690e863fcaf086c04d1b0fb21356a622..a0207624821b4179d7adc646adf06aae ) if (ENABLE_2022_GLIB_API) -@@ -423,8 +424,17 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES +@@ -426,7 +429,16 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES ${GIO_UNIX_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS} ${LIBSOUP_INCLUDE_DIRS} +# Playwright begin + "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libyuv/include" +# Playwright end - ) - ++) ++ +# Playwright begin +list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES + "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libwebm" -+) + ) +# Playwright end -+ + list(APPEND WebKit_LIBRARIES WPE::libwpe - ${GLIB_LIBRARIES} diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake -index 06a86d0cfd1ca90f383af2b079f60ce220f8eb02..9e21935463bf964ecb090be48e68b50ef29c049b 100644 +index 7da9a409b65a577566f143a26a9717d4ba687a3c..711b5e1c4c82dfdf9ac6139a6de0785d29c1cc20 100644 --- a/Source/WebKit/PlatformWin.cmake +++ b/Source/WebKit/PlatformWin.cmake @@ -56,8 +56,13 @@ list(APPEND WebKit_SOURCES @@ -9209,7 +9513,7 @@ index 06a86d0cfd1ca90f383af2b079f60ce220f8eb02..9e21935463bf964ecb090be48e68b50e + list(APPEND WebProcess_SOURCES WebProcess/EntryPoint/win/WebProcessMain.cpp - ) + diff --git a/Source/WebKit/Shared/API/c/wpe/WebKit.h b/Source/WebKit/Shared/API/c/wpe/WebKit.h index a9aa21f5589dec453db1713c8846e0d2e687f552..9b94469d078d92e4b9e0c8149122b19a4d3b5307 100644 --- a/Source/WebKit/Shared/API/c/wpe/WebKit.h @@ -9222,6 +9526,22 @@ index a9aa21f5589dec453db1713c8846e0d2e687f552..9b94469d078d92e4b9e0c8149122b19a #include #include #include +diff --git a/Source/WebKit/Shared/AuxiliaryProcess.h b/Source/WebKit/Shared/AuxiliaryProcess.h +index bc4f258d0970d21655a311ba72932296440111f8..21bf2a8dc680ead511ddb17a9a7ae891c835ee30 100644 +--- a/Source/WebKit/Shared/AuxiliaryProcess.h ++++ b/Source/WebKit/Shared/AuxiliaryProcess.h +@@ -210,6 +210,11 @@ struct AuxiliaryProcessInitializationParameters { + #if PLATFORM(COCOA) + SDKAlignedBehaviors clientSDKAlignedBehaviors; + #endif ++// Playwright begin ++#if !PLATFORM(COCOA) ++ bool shouldEnableSharedArrayBuffer { false }; ++#endif ++// Playwright end + }; + + } // namespace WebKit diff --git a/Source/WebKit/Shared/Cocoa/CompletionHandlerCallChecker.h b/Source/WebKit/Shared/Cocoa/CompletionHandlerCallChecker.h index b09b17a5bff38e3ba8d6bb53da9ef09d229bdb61..46aa1caa93402711a08f5980387a957f783038e5 100644 --- a/Source/WebKit/Shared/Cocoa/CompletionHandlerCallChecker.h @@ -9286,7 +9606,7 @@ index 17cb42104f3fe7e78388cdb1acd78efb34022f8d..c824a8c7ab5c4717773bff23c03156e7 #if USE(APPKIT) diff --git a/Source/WebKit/Shared/NativeWebMouseEvent.h b/Source/WebKit/Shared/NativeWebMouseEvent.h -index d51a12fba25ccd4b8bdd2e4a37bf9f1268034617..e36921913825f18522551c7847efae89d0679cc6 100644 +index e33858caab024b20217304209d7bf428e3335653..4026f6244889e5a0ee85edb72696d0be20ba531d 100644 --- a/Source/WebKit/Shared/NativeWebMouseEvent.h +++ b/Source/WebKit/Shared/NativeWebMouseEvent.h @@ -31,6 +31,7 @@ @@ -9298,7 +9618,7 @@ index d51a12fba25ccd4b8bdd2e4a37bf9f1268034617..e36921913825f18522551c7847efae89 #if PLATFORM(GTK) @@ -86,6 +87,11 @@ public: - NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool); + NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool, float deviceScaleFactor); #endif +#if PLATFORM(GTK) || USE(LIBWPE) || PLATFORM(WIN) @@ -9310,12 +9630,12 @@ index d51a12fba25ccd4b8bdd2e4a37bf9f1268034617..e36921913825f18522551c7847efae89 NSEvent* nativeEvent() const { return m_nativeEvent.get(); } #elif PLATFORM(GTK) diff --git a/Source/WebKit/Shared/NativeWebWheelEvent.h b/Source/WebKit/Shared/NativeWebWheelEvent.h -index bd941fd1cc5ddbae5d9fbe59976defd8fac3550b..b707e8e1739d95573270848d4e7f7719f4663c41 100644 +index f8e96218fd2671d1c0aca5e549efe0d8b94ef0f9..6cebd61bceb39c08e916fe991e4c3fc6f34b4704 100644 --- a/Source/WebKit/Shared/NativeWebWheelEvent.h +++ b/Source/WebKit/Shared/NativeWebWheelEvent.h -@@ -73,7 +73,8 @@ public: +@@ -74,7 +74,8 @@ public: #elif PLATFORM(WIN) - NativeWebWheelEvent(HWND, UINT message, WPARAM, LPARAM); + NativeWebWheelEvent(HWND, UINT message, WPARAM, LPARAM, float deviceScaleFactor); #endif - + NativeWebWheelEvent(const WebWheelEvent & webWheelEvent) @@ -9324,10 +9644,10 @@ index bd941fd1cc5ddbae5d9fbe59976defd8fac3550b..b707e8e1739d95573270848d4e7f7719 NSEvent* nativeEvent() const { return m_nativeEvent.get(); } #elif PLATFORM(GTK) diff --git a/Source/WebKit/Shared/Pasteboard.serialization.in b/Source/WebKit/Shared/Pasteboard.serialization.in -index 72ad2880160a374e8fa663e561d59becf9d2f36d..372ae6953199245fe4fc55a49813c7cae868f8b3 100644 +index ea1eb9f00feaaecf73bdddc37c904e88f43bfa85..8a631e5293a11abd650958baad4e967840a9a526 100644 --- a/Source/WebKit/Shared/Pasteboard.serialization.in +++ b/Source/WebKit/Shared/Pasteboard.serialization.in -@@ -75,7 +75,7 @@ header: +@@ -73,7 +73,7 @@ header: #if PLATFORM(MAC) String userVisibleForm #endif @@ -9337,10 +9657,10 @@ index 72ad2880160a374e8fa663e561d59becf9d2f36d..372ae6953199245fe4fc55a49813c7ca #endif }; diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -index 2a11967151ca0bebd14b6a64482a793e2a536333..f4fc1b8eab49eba96badf4151358325a0bb7072c 100644 +index 54bfa4555c6dd11f8ee8e3a75df6ba97c1032e84..c795925b062886a3eee42ef3b37e2f084ae55f7d 100644 --- a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in +++ b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -@@ -2658,6 +2658,9 @@ class WebCore::AuthenticationChallenge { +@@ -2691,6 +2691,9 @@ class WebCore::AuthenticationChallenge { class WebCore::DragData { #if PLATFORM(COCOA) String pasteboardName(); @@ -9350,7 +9670,7 @@ index 2a11967151ca0bebd14b6a64482a793e2a536333..f4fc1b8eab49eba96badf4151358325a #endif WebCore::IntPoint clientPosition(); WebCore::IntPoint globalPosition(); -@@ -3221,6 +3224,7 @@ enum class WebCore::WasPrivateRelayed : bool; +@@ -3254,6 +3257,7 @@ enum class WebCore::WasPrivateRelayed : bool; String httpStatusText; String httpVersion; WebCore::HTTPHeaderMap httpHeaderFields; @@ -9476,10 +9796,10 @@ index 5da1ed78e5a55bf63e9e52e33dfa9e704922589a..6630725885bbfe6123537ea799bf5b68 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 e0f2fcf54bf77b41619a9b76a3f42cc17303029f..4f79a4a9e081bfbb6a05c2c8afcbdaae060f2229 100644 +index 61fc6649bc99de246c5f0cb6171b717e89d69425..c2c998d337c0f399d8f35daa804c995fae66d50c 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.h +++ b/Source/WebKit/Shared/WebPageCreationParameters.h -@@ -300,6 +300,8 @@ struct WebPageCreationParameters { +@@ -299,6 +299,8 @@ struct WebPageCreationParameters { bool httpsUpgradeEnabled { true }; @@ -9489,10 +9809,10 @@ index e0f2fcf54bf77b41619a9b76a3f42cc17303029f..4f79a4a9e081bfbb6a05c2c8afcbdaae bool allowsDeprecatedSynchronousXMLHttpRequestDuringUnload { false }; #endif diff --git a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -index c7c3aac107d2b528d63a31645d84573ba4115a89..4e6932d22e24e2df15e045c0cbb177e8e0a8e880 100644 +index 96619aedf71cb8527e6c3da65b055f2c9a242c8e..34e23875c78420e3ef93beb67f14eac609d8d9d3 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in +++ b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -@@ -228,6 +228,8 @@ enum class WebCore::UserInterfaceLayoutDirection : bool; +@@ -227,6 +227,8 @@ enum class WebCore::UserInterfaceLayoutDirection : bool; bool httpsUpgradeEnabled; @@ -9533,234 +9853,95 @@ index 9a1c3f09c756ea368ac2d68e183a13e2eb47ead7..01c738376230f83376d80d6d225543a3 , m_nativeEvent(event.nativeEvent() ? constructNativeEvent(const_cast(event.nativeEvent())) : nullptr) { } -diff --git a/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.cpp b/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.cpp +diff --git a/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.serialization.in b/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.serialization.in new file mode 100644 -index 0000000000000000000000000000000000000000..c837e53b425d8f647a96398962f23a37fb2cfde5 +index 0000000000000000000000000000000000000000..f4f09d171ebf9774b3f8744751d220d35941fcb5 --- /dev/null -+++ b/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.cpp -@@ -0,0 +1,170 @@ -+/* -+ * Copyright (C) 2011 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. -+ */ ++++ b/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.serialization.in +@@ -0,0 +1,32 @@ ++# Copyright (C) 2024 Igalia, S.L. All rights reserved. ++# ++# 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 "ArgumentCodersWPE.h" -+ -+#include "WebCoreArgumentCoders.h" -+#include -+#include -+#include -+#include -+ -+namespace IPC { -+using namespace WebCore; -+using namespace WebKit; -+ -+static void encodeImage(Encoder& encoder, Image& image) ++header: ++class WebCore::SelectionData { ++ String text() ++ String markup() ++ URL url() ++ String uriList() ++ RefPtr image() ++ RefPtr customData() ++ bool canSmartReplace() ++} +diff --git a/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp b/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp +index 5bae771f7b19ebeaea42edca80198a598f1b49e4..82fa8826f7bd505f596fd7f0d378d62ba1ac3f2f 100644 +--- a/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp ++++ b/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp +@@ -38,6 +38,15 @@ + + namespace WebKit { + ++static bool hasArgument(const char* argument, int argc, char** argv) +{ -+ RefPtr bitmap = ShareableBitmap::create({ IntSize(image.size()) }); -+ bitmap->createGraphicsContext()->drawImage(image, IntPoint()); -+ -+ encoder << bitmap->createHandle(); ++ for (int i = 0; i < argc; ++i) { ++ if (!strcmp(argument, argv[i])) ++ return true; ++ } ++ return false; +} + -+static WARN_UNUSED_RETURN bool decodeImage(Decoder& decoder, RefPtr& image) -+{ -+ std::optional> handle; -+ decoder >> handle; -+ if (!handle || !*handle) -+ return false; -+ -+ RefPtr bitmap = ShareableBitmap::create(WTFMove(**handle)); -+ if (!bitmap) -+ return false; -+ image = bitmap->createImage(); -+ if (!image) -+ return false; -+ return true; -+} -+ -+void ArgumentCoder::encode(Encoder& encoder, const SelectionData& selection) -+{ -+ bool hasText = selection.hasText(); -+ encoder << hasText; -+ if (hasText) -+ encoder << selection.text(); -+ bool hasMarkup = selection.hasMarkup(); -+ encoder << hasMarkup; -+ if (hasMarkup) -+ encoder << selection.markup(); -+ -+ bool hasURL = selection.hasURL(); -+ encoder << hasURL; -+ if (hasURL) -+ encoder << selection.url().string(); -+ -+ bool hasURIList = selection.hasURIList(); -+ encoder << hasURIList; -+ if (hasURIList) -+ encoder << selection.uriList(); -+ -+ bool hasImage = selection.hasImage(); -+ encoder << hasImage; -+ if (hasImage) -+ encodeImage(encoder, *selection.image()); -+ -+ bool hasCustomData = selection.hasCustomData(); -+ encoder << hasCustomData; -+ if (hasCustomData) -+ encoder << RefPtr(selection.customData()); -+ -+ bool canSmartReplace = selection.canSmartReplace(); -+ encoder << canSmartReplace; -+} -+ -+std::optional ArgumentCoder::decode(Decoder& decoder) -+{ -+ SelectionData selection; -+ -+ bool hasText; -+ if (!decoder.decode(hasText)) -+ return std::nullopt; -+ if (hasText) { -+ String text; -+ if (!decoder.decode(text)) -+ return std::nullopt; -+ selection.setText(text); -+ } -+ -+ bool hasMarkup; -+ if (!decoder.decode(hasMarkup)) -+ return std::nullopt; -+ if (hasMarkup) { -+ String markup; -+ if (!decoder.decode(markup)) -+ return std::nullopt; -+ selection.setMarkup(markup); -+ } -+ -+ bool hasURL; -+ if (!decoder.decode(hasURL)) -+ return std::nullopt; -+ if (hasURL) { -+ String url; -+ if (!decoder.decode(url)) -+ return std::nullopt; -+ selection.setURL(URL(URL(), url), String()); -+ } -+ -+ bool hasURIList; -+ if (!decoder.decode(hasURIList)) -+ return std::nullopt; -+ if (hasURIList) { -+ String uriList; -+ if (!decoder.decode(uriList)) -+ return std::nullopt; -+ selection.setURIList(uriList); -+ } -+ -+ bool hasImage; -+ if (!decoder.decode(hasImage)) -+ return std::nullopt; -+ if (hasImage) { -+ RefPtr image; -+ if (!decodeImage(decoder, image)) -+ return std::nullopt; -+ selection.setImage(image.get()); -+ } -+ -+ bool hasCustomData; -+ if (!decoder.decode(hasCustomData)) -+ return std::nullopt; -+ if (hasCustomData) { -+ RefPtr buffer; -+ if (!decoder.decode(buffer)) -+ return std::nullopt; -+ selection.setCustomData(Ref(*buffer)); -+ } -+ -+ bool canSmartReplace; -+ if (!decoder.decode(canSmartReplace)) -+ return std::nullopt; -+ selection.setCanSmartReplace(canSmartReplace); -+ -+ return selection; -+} -+ -+} -diff --git a/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.h b/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.h -new file mode 100644 -index 0000000000000000000000000000000000000000..789a0d7cf69704c8f665a9ed79348fbcbc1301c4 ---- /dev/null -+++ b/Source/WebKit/Shared/libwpe/ArgumentCodersWPE.h -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (C) 2011 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 "ArgumentCoders.h" -+ -+namespace WebCore { -+class SelectionData; -+} -+ -+namespace IPC { -+ -+template<> struct ArgumentCoder { -+ static void encode(Encoder&, const WebCore::SelectionData&); -+ static std::optional decode(Decoder&); -+}; -+ -+} // namespace IPC + AuxiliaryProcessMainCommon::AuxiliaryProcessMainCommon() + { + #if ENABLE(BREAKPAD) +@@ -57,6 +66,10 @@ bool AuxiliaryProcessMainCommon::parseCommandLine(int argc, char** argv) + if (argc > 3 && argv[3] && !strcmp(argv[3], "--configure-jsc-for-testing")) + JSC::Config::configureForTesting(); + #endif ++// Playwright begin ++ if (hasArgument("--enable-shared-array-buffer", argc, argv)) ++ m_parameters.shouldEnableSharedArrayBuffer = true; ++// Playwright end + return true; + } + +diff --git a/Source/WebKit/Shared/win/AuxiliaryProcessMainWin.cpp b/Source/WebKit/Shared/win/AuxiliaryProcessMainWin.cpp +index 9edb5fbcd103cd8d1b224dfd60ac88aabe9626d2..9ed392ae3809f8bda92a2765ffadc643f23fe856 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) + 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)); ++// Playwright begin ++ else if (!strcmp(argv[i], "-enable-shared-array-buffer")) ++ m_parameters.shouldEnableSharedArrayBuffer = true; ++// Playwright end + 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 eae9e21a437c04cec91d1a4848038e11f4ee3e07..4fe63a9042d875555d9d1b934a9f53ea352e47aa 100644 +index 4d418e2bd7f970bc5bfebceb88adb172e5eb8540..e988f9011fa194224f7376e134d50fc553725289 100644 --- a/Source/WebKit/Shared/win/WebEventFactory.cpp +++ b/Source/WebKit/Shared/win/WebEventFactory.cpp -@@ -476,7 +476,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(HWND hwnd, UINT message +@@ -484,7 +484,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(HWND hwnd, UINT message #if ENABLE(TOUCH_EVENTS) WebTouchEvent WebEventFactory::createWebTouchEvent() { @@ -9770,10 +9951,10 @@ index eae9e21a437c04cec91d1a4848038e11f4ee3e07..4fe63a9042d875555d9d1b934a9f53ea #endif // ENABLE(TOUCH_EVENTS) diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt -index d3b9afee939c3ec362f48851865da60251a5700f..fe0c3cc89c0823ed145eb1c374edd13239f48ee7 100644 +index 3844b4e93816ad5e4a1ac4156516bc29c0203eb2..922a99ed0e62d66e39eb20b05f757870da8be85e 100644 --- a/Source/WebKit/Sources.txt +++ b/Source/WebKit/Sources.txt -@@ -379,6 +379,7 @@ Shared/XR/XRDeviceProxy.cpp +@@ -377,6 +377,7 @@ Shared/XR/XRDeviceProxy.cpp UIProcess/AuxiliaryProcessProxy.cpp UIProcess/BackgroundProcessResponsivenessTimer.cpp UIProcess/BrowsingContextGroup.cpp @@ -9781,7 +9962,7 @@ index d3b9afee939c3ec362f48851865da60251a5700f..fe0c3cc89c0823ed145eb1c374edd132 UIProcess/DeviceIdHashSaltStorage.cpp UIProcess/DisplayLink.cpp UIProcess/DisplayLinkProcessProxyClient.cpp -@@ -388,16 +389,20 @@ UIProcess/FrameLoadState.cpp +@@ -386,16 +387,20 @@ UIProcess/FrameLoadState.cpp UIProcess/FrameProcess.cpp UIProcess/GeolocationPermissionRequestManagerProxy.cpp UIProcess/GeolocationPermissionRequestProxy.cpp @@ -9802,7 +9983,7 @@ index d3b9afee939c3ec362f48851865da60251a5700f..fe0c3cc89c0823ed145eb1c374edd132 UIProcess/RemotePageDrawingAreaProxy.cpp UIProcess/RemotePageProxy.cpp UIProcess/ResponsivenessTimer.cpp -@@ -441,6 +446,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp +@@ -437,6 +442,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp UIProcess/WebPageDiagnosticLoggingClient.cpp UIProcess/WebPageGroup.cpp UIProcess/WebPageInjectedBundleClient.cpp @@ -9810,8 +9991,8 @@ index d3b9afee939c3ec362f48851865da60251a5700f..fe0c3cc89c0823ed145eb1c374edd132 +UIProcess/WebPageInspectorInputAgent.cpp UIProcess/WebPageProxy.cpp UIProcess/WebPageProxyMessageReceiverRegistration.cpp - UIProcess/WebPasteboardProxy.cpp -@@ -576,7 +583,11 @@ UIProcess/Inspector/WebInspectorUtilities.cpp + UIProcess/WebPageProxyTesting.cpp +@@ -574,7 +581,11 @@ UIProcess/Inspector/WebInspectorUtilities.cpp UIProcess/Inspector/WebPageDebuggable.cpp UIProcess/Inspector/WebPageInspectorController.cpp @@ -9824,10 +10005,10 @@ index d3b9afee939c3ec362f48851865da60251a5700f..fe0c3cc89c0823ed145eb1c374edd132 UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp UIProcess/Media/MediaUsageManager.cpp diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt -index 8dc390feda97fbe8e80e0bdfd62b682be36c81e5..9dee9867202c5e63e81dec992fa348fd16a557d8 100644 +index fe64c9af8d7f79b86941404d5aed66424a675bf7..0f1e5aa7a24ddc03c7462226312b4ffb354de632 100644 --- a/Source/WebKit/SourcesCocoa.txt +++ b/Source/WebKit/SourcesCocoa.txt -@@ -271,6 +271,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm +@@ -270,6 +270,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm UIProcess/API/Cocoa/_WKAttachment.mm UIProcess/API/Cocoa/_WKAutomationSession.mm UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm @@ -9835,7 +10016,7 @@ index 8dc390feda97fbe8e80e0bdfd62b682be36c81e5..9dee9867202c5e63e81dec992fa348fd UIProcess/API/Cocoa/_WKContentRuleListAction.mm UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @no-unify -@@ -455,6 +456,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm +@@ -454,6 +455,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.mm UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm @@ -9844,10 +10025,10 @@ index 8dc390feda97fbe8e80e0bdfd62b682be36c81e5..9dee9867202c5e63e81dec992fa348fd UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm UIProcess/Inspector/mac/WKInspectorViewController.mm diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt -index bec1e568f9ad00bfff883318692d9c404e012e2c..de45461d0851248f44973780b07d0ba7692fd578 100644 +index 94d0f078de20208836e4a1a63f6dd0ce4e7ab556..fce80ee80cb3f2079b7405d49b5646af060c10be 100644 --- a/Source/WebKit/SourcesGTK.txt +++ b/Source/WebKit/SourcesGTK.txt -@@ -134,6 +134,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify +@@ -130,6 +130,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify UIProcess/API/glib/WebKitBackForwardList.cpp @no-unify UIProcess/API/glib/WebKitBackForwardListItem.cpp @no-unify UIProcess/API/glib/WebKitClipboardPermissionRequest.cpp @no-unify @@ -9855,7 +10036,7 @@ index bec1e568f9ad00bfff883318692d9c404e012e2c..de45461d0851248f44973780b07d0ba7 UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify UIProcess/API/glib/WebKitCookieManager.cpp @no-unify UIProcess/API/glib/WebKitCredential.cpp @no-unify -@@ -262,6 +263,7 @@ UIProcess/glib/DisplayLinkGLib.cpp +@@ -257,6 +258,7 @@ UIProcess/glib/DisplayLinkGLib.cpp UIProcess/glib/DisplayVBlankMonitor.cpp UIProcess/glib/DisplayVBlankMonitorDRM.cpp UIProcess/glib/DisplayVBlankMonitorTimer.cpp @@ -9863,7 +10044,7 @@ index bec1e568f9ad00bfff883318692d9c404e012e2c..de45461d0851248f44973780b07d0ba7 UIProcess/glib/ScreenManager.cpp UIProcess/glib/WebPageProxyGLib.cpp UIProcess/glib/WebProcessPoolGLib.cpp -@@ -277,6 +279,7 @@ UIProcess/gtk/ClipboardGtk4.cpp @no-unify +@@ -272,6 +274,7 @@ UIProcess/gtk/ClipboardGtk4.cpp @no-unify UIProcess/gtk/WebDateTimePickerGtk.cpp UIProcess/gtk/GtkSettingsManager.cpp UIProcess/gtk/HardwareAccelerationManager.cpp @@ -9871,7 +10052,7 @@ index bec1e568f9ad00bfff883318692d9c404e012e2c..de45461d0851248f44973780b07d0ba7 UIProcess/gtk/KeyBindingTranslator.cpp UIProcess/gtk/PointerLockManager.cpp @no-unify UIProcess/gtk/PointerLockManagerWayland.cpp @no-unify -@@ -289,6 +292,8 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp +@@ -284,6 +287,8 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp UIProcess/gtk/WebColorPickerGtk.cpp UIProcess/gtk/WebContextMenuProxyGtk.cpp UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp @@ -9881,18 +10062,10 @@ index bec1e568f9ad00bfff883318692d9c404e012e2c..de45461d0851248f44973780b07d0ba7 UIProcess/gtk/WebPasteboardProxyGtk.cpp UIProcess/gtk/WebPopupMenuProxyGtk.cpp diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt -index 3eefd6cc3eb22329583901518442756d728378a1..45f2092be52d2d347660972a6723741176ff4b42 100644 +index e6c9ee4c1e8ee1ad95ae6595e061378b377a3501..71882922bff1ad74a96b0bca2ea5522f81ef70ed 100644 --- a/Source/WebKit/SourcesWPE.txt +++ b/Source/WebKit/SourcesWPE.txt -@@ -86,6 +86,7 @@ Shared/glib/ProcessExecutablePathGLib.cpp - Shared/glib/UserMessage.cpp - Shared/glib/WebContextMenuItemGlib.cpp - -+Shared/libwpe/ArgumentCodersWPE.cpp - Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp - Shared/libwpe/NativeWebMouseEventLibWPE.cpp - Shared/libwpe/NativeWebTouchEventLibWPE.cpp -@@ -136,6 +137,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify +@@ -132,6 +132,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify UIProcess/API/glib/WebKitBackForwardList.cpp @no-unify UIProcess/API/glib/WebKitBackForwardListItem.cpp @no-unify @@ -9900,7 +10073,7 @@ index 3eefd6cc3eb22329583901518442756d728378a1..45f2092be52d2d347660972a67237411 UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify UIProcess/API/glib/WebKitCookieManager.cpp @no-unify UIProcess/API/glib/WebKitCredential.cpp @no-unify -@@ -169,6 +171,7 @@ UIProcess/API/glib/WebKitOptionMenu.cpp @no-unify +@@ -165,6 +166,7 @@ UIProcess/API/glib/WebKitOptionMenu.cpp @no-unify UIProcess/API/glib/WebKitOptionMenuItem.cpp @no-unify UIProcess/API/glib/WebKitPermissionRequest.cpp @no-unify UIProcess/API/glib/WebKitPermissionStateQuery.cpp @no-unify @@ -9908,15 +10081,15 @@ index 3eefd6cc3eb22329583901518442756d728378a1..45f2092be52d2d347660972a67237411 UIProcess/API/glib/WebKitPolicyDecision.cpp @no-unify UIProcess/API/glib/WebKitPrivate.cpp @no-unify UIProcess/API/glib/WebKitProtocolHandler.cpp @no-unify -@@ -205,6 +208,7 @@ UIProcess/API/soup/HTTPCookieStoreSoup.cpp +@@ -201,6 +203,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 - UIProcess/API/wpe/WebKitRectangle.cpp @no-unify -@@ -228,6 +232,7 @@ UIProcess/glib/DisplayLinkGLib.cpp +@@ -227,6 +230,7 @@ UIProcess/glib/DisplayLinkGLib.cpp UIProcess/glib/DisplayVBlankMonitor.cpp UIProcess/glib/DisplayVBlankMonitorDRM.cpp UIProcess/glib/DisplayVBlankMonitorTimer.cpp @@ -9924,7 +10097,7 @@ index 3eefd6cc3eb22329583901518442756d728378a1..45f2092be52d2d347660972a67237411 UIProcess/glib/ScreenManager.cpp UIProcess/glib/WebPageProxyGLib.cpp UIProcess/glib/WebProcessPoolGLib.cpp -@@ -258,7 +263,12 @@ UIProcess/linux/MemoryPressureMonitor.cpp +@@ -259,7 +263,12 @@ UIProcess/linux/MemoryPressureMonitor.cpp UIProcess/soup/WebProcessPoolSoup.cpp UIProcess/wpe/AcceleratedBackingStoreDMABuf.cpp @@ -9937,7 +10110,7 @@ index 3eefd6cc3eb22329583901518442756d728378a1..45f2092be52d2d347660972a67237411 UIProcess/wpe/WebPageProxyWPE.cpp UIProcess/wpe/WebPreferencesWPE.cpp -@@ -282,6 +292,8 @@ WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp +@@ -286,6 +295,8 @@ WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp @@ -9993,11 +10166,24 @@ index 32ef9bd308e520f5ac7173639c8b23ea91cde037..7a80553c2d91b9236f563fa1b76aa8a5 bool m_alwaysRunsAtBackgroundPriority { false }; bool m_shouldTakeUIBackgroundAssertion { true }; bool m_shouldCaptureDisplayInUIProcess { DEFAULT_CAPTURE_DISPLAY_IN_UI_PROCESS }; +diff --git a/Source/WebKit/UIProcess/API/APITargetedElementRequest.h b/Source/WebKit/UIProcess/API/APITargetedElementRequest.h +index 6dc23b36695692f1052de941d4d89dcd72e9f337..804cbc2666d410d7465036621f1c7a16056f9e79 100644 +--- a/Source/WebKit/UIProcess/API/APITargetedElementRequest.h ++++ b/Source/WebKit/UIProcess/API/APITargetedElementRequest.h +@@ -34,7 +34,7 @@ class WebPageProxy; + + namespace API { + +-class TargetedElementRequest final : public ObjectImpl { ++class TargetedElementRequest final : public ObjectImpl { + public: + + bool shouldIgnorePointerEventsNone() const { return m_request.shouldIgnorePointerEventsNone; } diff --git a/Source/WebKit/UIProcess/API/APIUIClient.h b/Source/WebKit/UIProcess/API/APIUIClient.h -index f8baf3b5cbd1613da54c001cbff573125742358d..be628650e5562978187f8cc1d0afed8849a083b2 100644 +index 9ecfb4e61a015c97e3adaeccfcf52ce24735eeed..decae9b739c9692921305b87449f6557a07959c2 100644 --- a/Source/WebKit/UIProcess/API/APIUIClient.h +++ b/Source/WebKit/UIProcess/API/APIUIClient.h -@@ -114,6 +114,7 @@ public: +@@ -115,6 +115,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()); } @@ -10006,7 +10192,7 @@ index f8baf3b5cbd1613da54c001cbff573125742358d..be628650e5562978187f8cc1d0afed88 virtual void setStatusText(WebKit::WebPageProxy*, const WTF::String&) { } virtual void mouseDidMoveOverElement(WebKit::WebPageProxy&, const WebKit::WebHitTestResultData&, OptionSet, Object*) { } diff --git a/Source/WebKit/UIProcess/API/C/WKInspector.cpp b/Source/WebKit/UIProcess/API/C/WKInspector.cpp -index 990b0e5ebad19fdaf1b0036585be2ed88bc125d2..9f1931dbdd8c70d3637a2d71406b5968896037f2 100644 +index 16229e649d69b812be84b487ec87941cb0986250..88a5fa4bd77136a2370175696d078c20e1d58edd 100644 --- a/Source/WebKit/UIProcess/API/C/WKInspector.cpp +++ b/Source/WebKit/UIProcess/API/C/WKInspector.cpp @@ -28,6 +28,11 @@ @@ -10049,10 +10235,10 @@ index 026121d114c5fcad84c1396be8d692625beaa3bd..edd6e5cae033124c589959a42522fde0 } #endif diff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp -index 81d4f44bd1f4201cb0ddd9d4b8ef210862551cdb..6e750c6e1f4624b5cf54a642b831ab10d4448649 100644 +index 4abc7ac9b65c92e1f8ac122b97abf32c69631eb7..93e67e9e60ffa2536be7da1b70a7704d6eb3313f 100644 --- a/Source/WebKit/UIProcess/API/C/WKPage.cpp +++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp -@@ -1780,6 +1780,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient +@@ -1781,6 +1781,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient completionHandler(String()); } @@ -10066,7 +10252,7 @@ index 81d4f44bd1f4201cb0ddd9d4b8ef210862551cdb..6e750c6e1f4624b5cf54a642b831ab10 void setStatusText(WebPageProxy* page, const String& text) final { if (!m_client.setStatusText) -@@ -1809,6 +1816,8 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient +@@ -1810,6 +1817,8 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient { if (!m_client.didNotHandleKeyEvent) return; @@ -10157,7 +10343,7 @@ index 857afb1b892c2ee7327808f3dab0cff441c92c52..332bb2e687d6b97fd11f1366ade5b178 { return _preferences->inactiveMediaCaptureSteamRepromptIntervalInMinutes(); diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h -index 48e4b28374b93173df1be63444aa5ca3abd626d6..194b2099be032c800a463891976364ab7cd74890 100644 +index 950a5587c9ed75292e6ad8b4f898b73de3dabc25..f315b1023c6910e23e88d18022a18b6710308a55 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) { @@ -10169,12 +10355,12 @@ index 48e4b28374b93173df1be63444aa5ca3abd626d6..194b2099be032c800a463891976364ab @property (nonatomic, setter=_setICECandidateFilteringEnabled:) BOOL _iceCandidateFilteringEnabled WK_API_AVAILABLE(macos(10.13.4), ios(11.3)); @property (nonatomic, setter=_setInactiveMediaCaptureSteamRepromptIntervalInMinutes:) double _inactiveMediaCaptureSteamRepromptIntervalInMinutes 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 24b33cf16d46efce11a30032925600b97e64c65d..422355368191b9189b6283338bea2244b2fddd9e 100644 +index ca205ac38f92e95c24830d30657d093afd22f02b..aeaf6335ab9fc0590cd723e0c585677a014c4549 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h +++ b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h -@@ -148,6 +148,12 @@ typedef NS_ENUM(NSInteger, WKDialogResult) { +@@ -149,6 +149,12 @@ WK_SWIFT_UI_ACTOR */ - - (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * _Nullable result))completionHandler; + - (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(WK_SWIFT_UI_ACTOR void (^)(NSString * _Nullable result))completionHandler; +/*! @abstract Handle a JavaScript dialog. + @param webView The web view invoking the delegate method. @@ -10186,7 +10372,7 @@ index 24b33cf16d46efce11a30032925600b97e64c65d..422355368191b9189b6283338bea2244 /*! @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 4f5956098f0e83c2e9c421c97056b6718b124a3c..1eb51dd70dc6ef1b7e95a09118aa816b4f77e2d7 100644 +index eff4cf557033561ab20762d93a58c2d71f5505f0..2fd5a2515c54d9edcab48fa3d993298fa3969648 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h @@ -24,7 +24,6 @@ @@ -10197,7 +10383,7 @@ index 4f5956098f0e83c2e9c421c97056b6718b124a3c..1eb51dd70dc6ef1b7e95a09118aa816b #import #if __has_include() -@@ -124,6 +123,8 @@ WK_CLASS_AVAILABLE(macos(10.11), ios(9.0)) +@@ -126,6 +125,8 @@ WK_CLASS_AVAILABLE(macos(10.11), ios(9.0)) #endif #endif @@ -10207,7 +10393,7 @@ index 4f5956098f0e83c2e9c421c97056b6718b124a3c..1eb51dd70dc6ef1b7e95a09118aa816b NS_ASSUME_NONNULL_END diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm -index 350914dd5352683024925bb820148ba2582cd0c7..ac9767ff4920e066b11da4556b2df77debd18a1f 100644 +index 2432da7fa381ba09f73f2126b978e4b454e42e4b..d3f1ce3d339b6ebd6d61100eb8d4c71d86258f00 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm @@ -51,6 +51,7 @@ @@ -10218,7 +10404,7 @@ index 350914dd5352683024925bb820148ba2582cd0c7..ac9767ff4920e066b11da4556b2df77d #import #import #import -@@ -446,6 +447,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple +@@ -450,6 +451,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple }); } @@ -10358,7 +10544,7 @@ index 0000000000000000000000000000000000000000..69eb9c6aa30beb8ea21a0ef647e46304 +} +@end diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h -index da0374cf56919b7324a90586d0a7009bfe895be1..1a6f5ff024592a6c3a5c7018045e0a5015aac2c0 100644 +index 9eadc5f1a8c9b002ab96727a1fb472403a21cf24..f3ceaaa8a23690b77e01aed1ed532e3afccd866c 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h @@ -67,6 +67,7 @@ WK_CLASS_AVAILABLE(macos(10.10), ios(8.0)) @@ -10415,7 +10601,7 @@ index 4974e14214e2bb3e982325b885bab33e54f83998..cacdf8c71fab248d38d2faf03f7affdc typedef NS_ENUM(NSInteger, _WKUserStyleLevel) { _WKUserStyleUserLevel, diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm -index 383bd33cc0b53ea049d2e6fb1bf338d584caeb18..e29ba10dceced9d115b09e014cc086c5453e33fe 100644 +index 8f7d300c449fd3323f3a47630a5b87835e7b2350..8b2b098f0bc8d9ad27654c33f616c0b73330573c 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm @@ -35,6 +35,7 @@ @@ -10629,10 +10815,10 @@ 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 d6b7f61b141870b4af00fdd0a104dc6cf382fc36..bacc29f875ec5dccb65f7653a772bb99ceee2129 100644 +index 13452bf008a5a5b8cce2367296c20df5b05ced59..2055a9f371e8b60d7702988bfd7ffd1ad0bd55c2 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp -@@ -95,6 +95,10 @@ private: +@@ -94,6 +94,10 @@ private: page.makeViewBlankIfUnpaintedSinceLastLoadCommit(); webkitWebViewRunJavaScriptPrompt(m_webView, message.utf8(), defaultValue.utf8(), WTFMove(completionHandler)); } @@ -10644,10 +10830,10 @@ index d6b7f61b141870b4af00fdd0a104dc6cf382fc36..bacc29f875ec5dccb65f7653a772bb99 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 14c655bdd47bfb87d548e8c4ddd826e6bbb5d7c5..05440a65021ff70887fc88dc5fbfff71f4990957 100644 +index 47eca6bcf0048acad8e4d213cae94edc03efbffc..b5b1e526b988be8c6ab5830d933c7becb52344f3 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp -@@ -415,10 +415,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa +@@ -421,10 +421,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa } } @@ -10667,7 +10853,7 @@ index 14c655bdd47bfb87d548e8c4ddd826e6bbb5d7c5..05440a65021ff70887fc88dc5fbfff71 GUniquePtr bundleFilename(g_build_filename(injectedBundleDirectory(), INJECTED_BUNDLE_FILENAME, nullptr)); WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(object); -@@ -475,6 +484,8 @@ static void webkitWebContextConstructed(GObject* object) +@@ -481,6 +490,8 @@ static void webkitWebContextConstructed(GObject* object) static void webkitWebContextDispose(GObject* object) { @@ -10676,7 +10862,7 @@ index 14c655bdd47bfb87d548e8c4ddd826e6bbb5d7c5..05440a65021ff70887fc88dc5fbfff71 WebKitWebContextPrivate* priv = WEBKIT_WEB_CONTEXT(object)->priv; if (!priv->clientsDetached) { priv->clientsDetached = true; -@@ -934,6 +945,11 @@ WebKitNetworkSession* webkit_web_context_get_network_session_for_automation(WebK +@@ -942,6 +953,11 @@ WebKitNetworkSession* webkit_web_context_get_network_session_for_automation(WebK return nullptr; #endif } @@ -10689,7 +10875,7 @@ index 14c655bdd47bfb87d548e8c4ddd826e6bbb5d7c5..05440a65021ff70887fc88dc5fbfff71 /** * webkit_web_context_set_cache_model: diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.h.in b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.h.in -index fa559936ba819425cfca7ad0f26e9d373690180a..112eb9f64b9c08385eb9a7ac4d6815f574efed0e 100644 +index b8c2337af32ac3ce5be2b494f02c259392af994e..b1e4b2660fa30acad76888e2fe9bd50673a76549 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.h.in +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.h.in @@ -161,6 +161,10 @@ webkit_web_context_set_automation_allowed (WebKitWebContext @@ -10704,7 +10890,7 @@ index fa559936ba819425cfca7ad0f26e9d373690180a..112eb9f64b9c08385eb9a7ac4d6815f5 WEBKIT_API void diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContextPrivate.h b/Source/WebKit/UIProcess/API/glib/WebKitWebContextPrivate.h -index e994309b097c1b140abfa4373fd2fafee46c05ec..6e0cc677a3bf33683ae8c89d12a4819144b3df89 100644 +index c1945fbe717a42afc1f51d64a80c7de3fa9009ba..ab63fe19b00ecbd64c9421e6eecad3e25cbb2361 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebContextPrivate.h +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContextPrivate.h @@ -43,3 +43,4 @@ void webkitWebContextInitializeNotificationPermissions(WebKitWebContext*); @@ -10713,10 +10899,10 @@ index e994309b097c1b140abfa4373fd2fafee46c05ec..6e0cc677a3bf33683ae8c89d12a48191 #endif +int webkitWebContextExistingCount(); diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -index 1e389f70c7b4722458cffbf4ac34b1d67efa4ba8..b9f5f22c8e866de1909240b72d23c06d7525d863 100644 +index 061a05bdd19eea75552cad40e78794dfd26f6668..d96b4efdb43131cfccff3ace107b3959eb6a4a1c 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -@@ -33,6 +33,7 @@ +@@ -34,6 +34,7 @@ #include "WebContextMenuItem.h" #include "WebContextMenuItemData.h" #include "WebFrameProxy.h" @@ -10724,7 +10910,7 @@ index 1e389f70c7b4722458cffbf4ac34b1d67efa4ba8..b9f5f22c8e866de1909240b72d23c06d #include "WebKitAuthenticationRequestPrivate.h" #include "WebKitBackForwardListPrivate.h" #include "WebKitContextMenuClient.h" -@@ -50,6 +51,7 @@ +@@ -51,6 +52,7 @@ #include "WebKitNavigationClient.h" #include "WebKitNotificationPrivate.h" #include "WebKitPermissionStateQueryPrivate.h" @@ -10732,15 +10918,15 @@ index 1e389f70c7b4722458cffbf4ac34b1d67efa4ba8..b9f5f22c8e866de1909240b72d23c06d #include "WebKitPrivate.h" #include "WebKitResponsePolicyDecision.h" #include "WebKitScriptDialogPrivate.h" -@@ -89,7 +91,6 @@ - #include "GtkSettingsManager.h" +@@ -90,7 +92,6 @@ + #if PLATFORM(GTK) #include "WebKitFaviconDatabasePrivate.h" #include "WebKitInputMethodContextImplGtk.h" -#include "WebKitPointerLockPermissionRequest.h" #include "WebKitPrintOperationPrivate.h" #include "WebKitWebInspectorPrivate.h" #include "WebKitWebViewBasePrivate.h" -@@ -141,6 +142,7 @@ enum { +@@ -146,6 +147,7 @@ enum { CLOSE, SCRIPT_DIALOG, @@ -10748,29 +10934,43 @@ index 1e389f70c7b4722458cffbf4ac34b1d67efa4ba8..b9f5f22c8e866de1909240b72d23c06d DECIDE_POLICY, PERMISSION_REQUEST, -@@ -494,6 +496,9 @@ GRefPtr WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& p +@@ -506,6 +508,16 @@ GRefPtr WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& p void WebKitWebViewClient::frameDisplayed(WKWPE::View&) { ++ ++#if USE(SKIA) ++ sk_sp surface(webkitWebViewBackendTakeScreenshot(m_webView->priv->backend.get())); ++ if (surface) ++ getPage(m_webView).inspectorController().didPaint(WTFMove(surface)); ++#elif USE(CAIRO) + if (RefPtr surface = adoptRef(webkitWebViewBackendTakeScreenshot(m_webView->priv->backend.get()))) + getPage(m_webView).inspectorController().didPaint(surface.get()); ++#endif + { SetForScope inFrameDisplayedGuard(m_webView->priv->inFrameDisplayed, true); for (const auto& callback : m_webView->priv->frameDisplayedCallbacks) { -@@ -510,6 +515,11 @@ void WebKitWebViewClient::frameDisplayed(WKWPE::View&) +@@ -522,6 +534,18 @@ void WebKitWebViewClient::frameDisplayed(WKWPE::View&) } } ++#if USE(SKIA) ++sk_sp WebKitWebViewClient::takeViewScreenshot() ++{ ++ return sk_sp(webkitWebViewBackendTakeScreenshot(m_webView->priv->backend.get())); ++} ++#elif USE(CAIRO) +cairo_surface_t* WebKitWebViewClient::takeViewScreenshot() +{ + return webkitWebViewBackendTakeScreenshot(m_webView->priv->backend.get()); +} ++#endif + void WebKitWebViewClient::willStartLoad(WKWPE::View&) { webkitWebViewWillStartLoad(m_webView); -@@ -596,7 +606,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision* +@@ -608,7 +632,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision* static gboolean webkitWebViewPermissionRequest(WebKitWebView*, WebKitPermissionRequest* request) { @@ -10779,7 +10979,18 @@ index 1e389f70c7b4722458cffbf4ac34b1d67efa4ba8..b9f5f22c8e866de1909240b72d23c06d if (WEBKIT_IS_POINTER_LOCK_PERMISSION_REQUEST(request)) { webkit_permission_request_allow(request); return TRUE; -@@ -1903,6 +1913,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) +@@ -927,6 +951,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); ++ ++ // Playwright: REGRESSION(278896@main): Need to preserve configuration's preferences. ++ configuration->setPreferences(webkitSettingsGetPreferences(priv->settings.get())); ++ + webkitWebViewCreatePage(webView, WTFMove(configuration)); + webkitWebContextWebViewCreated(priv->context.get(), webView); + +@@ -1956,6 +1984,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_SCRIPT_DIALOG); @@ -10795,7 +11006,7 @@ index 1e389f70c7b4722458cffbf4ac34b1d67efa4ba8..b9f5f22c8e866de1909240b72d23c06d /** * WebKitWebView::decide-policy: * @web_view: the #WebKitWebView on which the signal is emitted -@@ -2702,6 +2721,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const +@@ -2748,6 +2785,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const webkit_script_dialog_unref(webView->priv->currentScriptDialog); } @@ -10820,10 +11031,10 @@ index 1e389f70c7b4722458cffbf4ac34b1d67efa4ba8..b9f5f22c8e866de1909240b72d23c06d { if (!webView->priv->currentScriptDialog) diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h -index 1a04ee05c3ddec0628ef5b8b8c181cbcc2b7d622..2a24f8f3fdc3f0eed13f8a79050258a4e4a489f0 100644 +index 76f5b743cfe0a713897666545feb6fe07d6b16e8..4f13cca3cea9b20fbdb16cd5de0833832298d29a 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h -@@ -66,6 +66,7 @@ void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message, Fun +@@ -64,6 +64,7 @@ void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message, Fun void webkitWebViewRunJavaScriptConfirm(WebKitWebView*, const CString& message, Function&& completionHandler); void webkitWebViewRunJavaScriptPrompt(WebKitWebView*, const CString& message, const CString& defaultText, Function&& completionHandler); void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView*, const CString& message, Function&& completionHandler); @@ -10844,7 +11055,7 @@ index 805f9f638c1630b5e9310494ae2970262de001cc..add3e80896c2e82bdd12cee15c8014bf #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 cea5882f6c455898e1b5a231e1213e6b71ff21b6..d82b93d3c759b1184869b3504e1c3c07f53cc8ce 100644 +index 36a0e39f8b13dcaa57ac1221d24e06a35eabe9b0..6a51f9653ccfb26c52405e44390f4aa3dd5f23f6 100644 --- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp +++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp @@ -269,6 +269,8 @@ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool @@ -10869,7 +11080,7 @@ index cea5882f6c455898e1b5a231e1213e6b71ff21b6..d82b93d3c759b1184869b3504e1c3c07 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 0445554dc296421d56237b07ea8d09b6e5e533b5..d7d91b30309e7106ae801aaad8162277ed636d1b 100644 +index 8b747ca183ddd04160b29cd9b89e5e40ad8161ab..6c99ff9824ea2db3719b84ee3f5766011213d998 100644 --- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h +++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h @@ -105,7 +105,7 @@ private: @@ -10982,10 +11193,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 9ce95b0e5ec142f4067c99d4aeb388fa08ae3f89..0718c8d9764d100fc8f41348a9273020645f0825 100644 +index f6690c7780dff32a043c51f7afaba00119a92c44..f48f5b67505176bac3406212e266a6addd6e226a 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp -@@ -2908,6 +2908,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase) +@@ -2930,6 +2930,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase) #endif } @@ -10997,7 +11208,7 @@ index 9ce95b0e5ec142f4067c99d4aeb388fa08ae3f89..0718c8d9764d100fc8f41348a9273020 void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext) { ASSERT(webkitWebViewBase->priv->acceleratedBackingStore); -@@ -2964,12 +2969,12 @@ void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase) +@@ -2986,12 +2991,12 @@ void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase) webkitWebViewBase->priv->acceleratedBackingStore->update({ }); } @@ -11013,7 +11224,7 @@ index 9ce95b0e5ec142f4067c99d4aeb388fa08ae3f89..0718c8d9764d100fc8f41348a9273020 #if !USE(GTK4) diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h -index a227380c1171e1e5824370b21c66440bb744c7f7..9b7bc68d01ef5d7c5d34720a6ab7c27f9e8c2156 100644 +index a99b65ba10a47d9806d1d61240e0e3e883bf91e5..61991ab00a922356e1ec74771a992751c6d219cc 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h @@ -27,6 +27,7 @@ @@ -11024,7 +11235,7 @@ index a227380c1171e1e5824370b21c66440bb744c7f7..9b7bc68d01ef5d7c5d34720a6ab7c27f #include "APIPageConfiguration.h" #include "InputMethodState.h" #include "RendererBufferFormat.h" -@@ -107,7 +108,7 @@ void webkitWebViewBaseStartDrag(WebKitWebViewBase*, WebCore::SelectionData&&, Op +@@ -108,7 +109,7 @@ void webkitWebViewBaseStartDrag(WebKitWebViewBase*, WebCore::SelectionData&&, Op void webkitWebViewBaseDidPerformDragControllerAction(WebKitWebViewBase*); #endif @@ -11033,42 +11244,51 @@ index a227380c1171e1e5824370b21c66440bb744c7f7..9b7bc68d01ef5d7c5d34720a6ab7c27f void webkitWebViewBaseSetEnableBackForwardNavigationGesture(WebKitWebViewBase*, bool enabled); WebKit::ViewGestureController* webkitWebViewBaseViewGestureController(WebKitWebViewBase*); -@@ -148,3 +149,5 @@ void webkitWebViewBaseSetPlugID(WebKitWebViewBase*, const String&); +@@ -149,3 +150,5 @@ void webkitWebViewBaseSetPlugID(WebKitWebViewBase*, const String&); #endif WebKit::RendererBufferFormat webkitWebViewBaseGetRendererBufferFormat(WebKitWebViewBase*); + +WebKit::AcceleratedBackingStore* webkitWebViewBaseGetAcceleratedBackingStore(WebKitWebViewBase*); diff --git a/Source/WebKit/UIProcess/API/wpe/APIViewClient.h b/Source/WebKit/UIProcess/API/wpe/APIViewClient.h -index 26d1790017e528f26ae04dac635678d5494bfd04..48dbe50eb05628307264a350350ac19f0acb3ae3 100644 +index 26d1790017e528f26ae04dac635678d5494bfd04..b9832e9221edaa14af485d34ac6216ffebac4e0d 100644 --- a/Source/WebKit/UIProcess/API/wpe/APIViewClient.h +++ b/Source/WebKit/UIProcess/API/wpe/APIViewClient.h -@@ -26,6 +26,7 @@ +@@ -26,6 +26,12 @@ #pragma once #include "UserMessage.h" ++#if USE(CAIRO) +#include ++#endif ++#if USE(SKIA) ++#include ++#endif #include typedef struct OpaqueJSContext* JSGlobalContextRef; -@@ -49,6 +50,9 @@ public: +@@ -49,6 +55,13 @@ public: virtual bool isGLibBasedAPI() { return false; } virtual void frameDisplayed(WKWPE::View&) { } +// Playwright begin ++#if USE(CAIRO) + virtual cairo_surface_t* takeViewScreenshot() { return nullptr; } ++#elif USE(SKIA) ++ virtual sk_sp takeViewScreenshot() { return nullptr; } ++#endif +// Playwright end virtual void willStartLoad(WKWPE::View&) { } 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 f498562d70a4652f6831ac6bc12ef86e537d3930..503a8875fed34fd7925646b61a1eed11d7c866b7 100644 +index b9b6b379136653e9dc13313715e0d281a2c8cb01..7cb887f31dc381739b079be0ab2548075fbc0690 100644 --- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp +++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp -@@ -33,9 +33,13 @@ - #include "NativeWebWheelEvent.h" +@@ -34,9 +34,13 @@ #include "TouchGestureController.h" - #include "WPEWebView.h" + #include "WPEWebViewLegacy.h" + #include "WPEWebViewPlatform.h" +#include "WebColorPickerWPE.h" +#include "WebDateTimePickerWPE.h" #include "WebContextMenuProxy.h" @@ -11079,7 +11299,20 @@ index f498562d70a4652f6831ac6bc12ef86e537d3930..503a8875fed34fd7925646b61a1eed11 #include #include #include -@@ -203,7 +207,7 @@ WebCore::IntPoint PageClientImpl::accessibilityScreenToRootView(const WebCore::I +@@ -50,6 +54,12 @@ + #include + #endif + ++#if USE(SKIA) ++#include ++#include ++#include ++#endif ++ + namespace WebKit { + + PageClientImpl::PageClientImpl(WKWPE::View& view) +@@ -208,7 +218,7 @@ WebCore::IntPoint PageClientImpl::accessibilityScreenToRootView(const WebCore::I WebCore::IntRect PageClientImpl::rootViewToAccessibilityScreen(const WebCore::IntRect& rect) { @@ -11088,10 +11321,39 @@ index f498562d70a4652f6831ac6bc12ef86e537d3930..503a8875fed34fd7925646b61a1eed11 } void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent&, bool) -@@ -465,6 +469,33 @@ void PageClientImpl::selectionDidChange() +@@ -487,6 +497,64 @@ void PageClientImpl::selectionDidChange() m_view.selectionDidChange(); } ++#if USE(SKIA) ++sk_sp PageClientImpl::takeViewSnapshot(std::optional&& clipRect, bool nominalResolution) ++{ ++ sk_sp fullScreenshot = m_view.client().takeViewScreenshot(); ++ float deviceScale = m_view.page().deviceScaleFactor(); ++ if (!clipRect && (!nominalResolution || deviceScale == 1)) ++ return fullScreenshot; ++ ++ WebCore::IntSize size = clipRect ? clipRect->size() : m_view.page().viewSize(); ++ if (!nominalResolution) { ++ size.scale(deviceScale); ++ if (clipRect) ++ clipRect->scale(deviceScale); ++ } ++ ++ SkBitmap bitmap; ++ bitmap.allocPixels(SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul_SkAlphaType)); ++ SkCanvas canvas(bitmap); ++ if (clipRect) { ++ canvas.translate(-clipRect->x(), -clipRect->y()); ++ SkRect rect = SkRect::MakeXYWH(clipRect->x(), clipRect->y(), clipRect->width(), clipRect->height()); ++ canvas.clipRect(rect); ++ } ++ if (nominalResolution) ++ canvas.scale(1/deviceScale, 1/deviceScale); ++ canvas.drawImage(fullScreenshot, 0, 0); ++ return bitmap.asImage(); ++} ++#elif USE(CAIRO) +RefPtr PageClientImpl::takeViewSnapshot(std::optional&& clipRect, bool nominalResolution) +{ + RefPtr fullScreenshot = adoptRef(m_view.client().takeViewScreenshot()); @@ -11118,11 +11380,13 @@ index f498562d70a4652f6831ac6bc12ef86e537d3930..503a8875fed34fd7925646b61a1eed11 + cairo_paint(cr.get()); + return surface; +} ++#endif ++ + WebKitWebResourceLoadManager* PageClientImpl::webResourceLoadManager() { return m_view.webResourceLoadManager(); -@@ -475,4 +506,23 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler&& +@@ -497,4 +565,23 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler&& m_view.callAfterNextPresentationUpdate(WTFMove(callback)); } @@ -11147,15 +11411,19 @@ index f498562d70a4652f6831ac6bc12ef86e537d3930..503a8875fed34fd7925646b61a1eed11 + } // namespace WebKit diff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h -index a7ece2c8dc3fd30bfb850de04c4fc10004444d5a..b5ee1a1877b3e748dea3ce195cd75cb0701a7034 100644 +index dc56a4f5af6ddf3ff3d557493482b5b25efcd24d..f1f69fb9341fa8bfff6e1ae045db5465a1b85eed 100644 --- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h +++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h -@@ -166,9 +166,21 @@ private: +@@ -166,9 +166,24 @@ private: void didChangeWebPageID() const override; void selectionDidChange() override; +- ++#if USE(SKIA) ++ sk_sp takeViewSnapshot(std::optional&&, bool nominalResolution) override; ++#elif USE(CAIRO) + RefPtr takeViewSnapshot(std::optional&&, bool nominalResolution) override; - ++#endif WebKitWebResourceLoadManager* webResourceLoadManager() override; +#if ENABLE(DATALIST_ELEMENT) @@ -11172,21 +11440,6 @@ index a7ece2c8dc3fd30bfb850de04c4fc10004444d5a..b5ee1a1877b3e748dea3ce195cd75cb0 WKWPE::View& m_view; }; -diff --git a/Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp b/Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp -index 8a9b8a7a853f2bdb6ae0b8bb389d3db1e1a53ac4..c22553b96c3e9afc126ce93c4e45e3af0fbd38f0 100644 ---- a/Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp -+++ b/Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp -@@ -98,7 +98,9 @@ View::View(struct wpe_view_backend* backend, WPEDisplay* display, const API::Pag - auto& preferences = configuration->preferences(); - preferences.setAcceleratedCompositingEnabled(true); - preferences.setForceCompositingMode(true); -- preferences.setThreadedScrollingEnabled(true); -+ // Playwright override begin -+ preferences.setThreadedScrollingEnabled(false); -+ // Playwright override end - - auto& pool = configuration->processPool(); - m_pageProxy = pool.createWebPage(*m_pageClient, WTFMove(configuration)); 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 @@ -11400,7 +11653,7 @@ index 0000000000000000000000000000000000000000..0a099832c3dd959f456fcae49a1d62a9 + +#endif // ENABLE(DATALIST_ELEMENT) diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp -index 763bda5b29304f7ed7133c0a8158e6c8b94c5ea1..ff5d01438e44ce6785a2aa70fc5423ba74e7101c 100644 +index 763bda5b29304f7ed7133c0a8158e6c8b94c5ea1..8ed962e8c1af62b9b73a68348d0d88765429861d 100644 --- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp +++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp @@ -54,6 +54,7 @@ struct _WebKitWebViewBackend { @@ -11420,7 +11673,7 @@ index 763bda5b29304f7ed7133c0a8158e6c8b94c5ea1..ff5d01438e44ce6785a2aa70fc5423ba + view_backend->screenshotCallback = callback; +} + -+cairo_surface_t* webkitWebViewBackendTakeScreenshot(WebKitWebViewBackend* view_backend) ++PlatformImage webkitWebViewBackendTakeScreenshot(WebKitWebViewBackend* view_backend) +{ + if (!view_backend->screenshotCallback) + return nullptr; @@ -11432,22 +11685,30 @@ index 763bda5b29304f7ed7133c0a8158e6c8b94c5ea1..ff5d01438e44ce6785a2aa70fc5423ba template <> WebKitWebViewBackend* refGPtr(WebKitWebViewBackend* ptr) diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h -index 16dcc1f69c38cd8ad630bc49d6d69feaa3aa811e..ddbd14645944fdb02925c381f06721d368a434f8 100644 +index 16dcc1f69c38cd8ad630bc49d6d69feaa3aa811e..efa3814a8e896e02b955dea0be70bdc5828e3d82 100644 --- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h +++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h -@@ -27,6 +27,7 @@ - #include +@@ -28,6 +28,15 @@ #include #include -+#include ++#if defined(USE_CAIRO) && USE_CAIRO ++#include ++using PlatformImage = cairo_surface_t*; ++#endif ++#if defined(USE_SKIA) && USE_SKIA ++#include ++using PlatformImage = SkImage*; ++#endif ++ G_BEGIN_DECLS -@@ -44,6 +45,12 @@ webkit_web_view_backend_new (struct wpe_view_backend *backend, + #define WEBKIT_TYPE_WEB_VIEW_BACKEND (webkit_web_view_backend_get_type()) +@@ -44,6 +53,12 @@ webkit_web_view_backend_new (struct wpe_view_backend *backend, WEBKIT_API struct wpe_view_backend * webkit_web_view_backend_get_wpe_backend (WebKitWebViewBackend *view_backend); -+typedef cairo_surface_t* (*take_screenshot_callback)(gpointer user_data); ++typedef PlatformImage (*take_screenshot_callback)(gpointer user_data); + +WEBKIT_API void +webkit_web_view_backend_set_screenshot_callback (WebKitWebViewBackend *view_backend, @@ -11457,7 +11718,7 @@ index 16dcc1f69c38cd8ad630bc49d6d69feaa3aa811e..ddbd14645944fdb02925c381f06721d3 #endif /* WebKitWebViewBackend_h */ diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h -index e4b92ace1531090ae38a7aec3d3d4febf19aee84..43690f9ef4969a39084501613bfc00a77fd5df49 100644 +index e4b92ace1531090ae38a7aec3d3d4febf19aee84..b66b573f9148c39c5ce2738add6cd01a9a352be8 100644 --- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h +++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h @@ -31,3 +31,5 @@ template <> void derefGPtr(WebKitWebViewBackend* ptr); @@ -11465,26 +11726,51 @@ index e4b92ace1531090ae38a7aec3d3d4febf19aee84..43690f9ef4969a39084501613bfc00a7 void webkitWebViewBackendUnref(WebKitWebViewBackend*); + -+cairo_surface_t* webkitWebViewBackendTakeScreenshot(WebKitWebViewBackend*); ++PlatformImage webkitWebViewBackendTakeScreenshot(WebKitWebViewBackend*); diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewClient.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewClient.h -index 720c88818bdb4cde3cb58e95785454754f6c1396..7f702c0b922e13128522d2bb1ace6a233812a7d4 100644 +index 720c88818bdb4cde3cb58e95785454754f6c1396..2658e6709a13e5d6258abca956ec52bc6b68324d 100644 --- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewClient.h +++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewClient.h -@@ -50,6 +50,9 @@ private: +@@ -50,6 +50,13 @@ private: bool isGLibBasedAPI() override { return true; } void frameDisplayed(WKWPE::View&) override; +// Playwright begin ++#if USE(CAIRO) + cairo_surface_t* takeViewScreenshot() override; ++#elif USE(SKIA) ++ sk_sp takeViewScreenshot() override; ++#endif +// Playwright end void willStartLoad(WKWPE::View&) override; 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 65bf3b71e451aad11039130d2d23a68f5fce499f..99a1402270bcd210107bcc4f029837891886cbdd 100644 +--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h ++++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h +@@ -233,6 +233,8 @@ public: + + void didDestroyFrame(WebCore::FrameIdentifier); + ++ static std::optional platformGetBase64EncodedPNGData(const ViewSnapshot&); ++ + private: + RefPtr webPageProxyForHandle(const String&); + String handleForWebPageProxy(const WebPageProxy&); +@@ -284,7 +286,6 @@ private: + + // Get base64-encoded PNG data from a bitmap. + static std::optional platformGetBase64EncodedPNGData(WebCore::ShareableBitmap::Handle&&); +- static std::optional platformGetBase64EncodedPNGData(const ViewSnapshot&); + + // 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 6f69cd9d4db8544a2c0c8b11fb557697f9b6a183..750a565d8a0c1208cd6950740b2beffa8c1d69d9 100644 +index a889806fbc7d1329a6bd7a6d179d31318cc2f010..197f2fdc887eef0a25f82a5d4702e6d34a3a126e 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp -@@ -158,7 +158,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau +@@ -165,7 +165,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau launchOptions.processCmdPrefix = String::fromUTF8(processCmdPrefix); #endif // ENABLE(DEVELOPER_MODE) && (PLATFORM(GTK) || PLATFORM(WPE)) @@ -11497,10 +11783,10 @@ index 6f69cd9d4db8544a2c0c8b11fb557697f9b6a183..750a565d8a0c1208cd6950740b2beffa platformGetLaunchOptions(launchOptions); } diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h -index e2d1e9dfbc77e3d520ce8d31c812a8482facae10..28238da43a4fc45466b43753bc5ad8aa07963f94 100644 +index e792deb624dc217fd9502461c0f7cabf789d812c..43b2912a05eaea0911662934305e94a6cc1477d1 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h -@@ -264,13 +264,16 @@ protected: +@@ -277,13 +277,16 @@ protected: static RefPtr fetchAudioComponentServerRegistrations(); #endif @@ -11517,12 +11803,12 @@ index e2d1e9dfbc77e3d520ce8d31c812a8482facae10..28238da43a4fc45466b43753bc5ad8aa - Vector platformOverrideLanguages() const; void platformStartConnectionTerminationWatchdog(); - ResponsivenessTimer m_responsivenessTimer; + // Connection::Client diff --git a/Source/WebKit/UIProcess/BackingStore.h b/Source/WebKit/UIProcess/BackingStore.h -index f9b557ae57a25f53f6d17aab23a256e3cc7d1e66..cced83f477cb1344dd079b9c3523b109ee5cfd89 100644 +index e1d579d6d428c3575ddf83b9d78dae045beb218d..9a2830e50ec8ab965e4a5a2b5faa9285c99bcc99 100644 --- a/Source/WebKit/UIProcess/BackingStore.h +++ b/Source/WebKit/UIProcess/BackingStore.h -@@ -61,6 +61,7 @@ public: +@@ -66,6 +66,7 @@ public: float deviceScaleFactor() const { return m_deviceScaleFactor; } void paint(PlatformPaintContextPtr, const WebCore::IntRect&); @@ -11663,10 +11949,10 @@ index 957f7f088087169668a9b4f1ba65d9f206a2a836..15e44c8d5b6a3eafb7f1148707366b0c class PopUpSOAuthorizationSession final : public SOAuthorizationSession { public: diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h -index 20af8a02d6dee5af7328accca7cd88a06995c4bb..16e8fc676e4bd70f3f35414434963ccb9f277311 100644 +index f6b1c41cd18d751f0622b4ecf00b5355b6212a17..5b116ff1a8c94906f94802af233c7f1e97d47d00 100644 --- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h +++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h -@@ -96,6 +96,7 @@ private: +@@ -105,6 +105,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; @@ -11674,7 +11960,7 @@ index 20af8a02d6dee5af7328accca7cd88a06995c4bb..16e8fc676e4bd70f3f35414434963ccb 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; -@@ -207,6 +208,7 @@ private: +@@ -221,6 +222,7 @@ private: bool webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler : 1; @@ -11683,7 +11969,7 @@ index 20af8a02d6dee5af7328accca7cd88a06995c4bb..16e8fc676e4bd70f3f35414434963ccb bool webViewRequestStorageAccessPanelForDomainUnderCurrentDomainForQuirkDomainsCompletionHandler : 1; bool webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm -index db0e7523899917cc9055ced3127a1e4eb493313d..c5a8a5a7da934deda55313465c26a38b1b33d2ac 100644 +index 3ac9df925437afb3b4d37107fc6c02dc9ee41fa6..eb0dc8703860ef5006d6df26a6ca6115a871ed0f 100644 --- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm +++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm @@ -118,6 +118,7 @@ void UIDelegate::setDelegate(id delegate) @@ -11694,7 +11980,7 @@ index db0e7523899917cc9055ced3127a1e4eb493313d..c5a8a5a7da934deda55313465c26a38b 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:)]; -@@ -442,6 +443,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St +@@ -447,6 +448,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St }).get()]; } @@ -11711,7 +11997,7 @@ index db0e7523899917cc9055ced3127a1e4eb493313d..c5a8a5a7da934deda55313465c26a38b { if (!m_uiDelegate) diff --git a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm -index b77d46b64193c5cf2017da8d81623e54d5f6f7a8..61a08b78ff3829995b54ce14c1752d4e073d5796 100644 +index 4e64905585de45ffa75c2d5b2ff2c3748fa15d15..342549d7c38432d9304ebd0bc1b55e4154f54948 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm @@ -38,6 +38,7 @@ @@ -11722,7 +12008,7 @@ index b77d46b64193c5cf2017da8d81623e54d5f6f7a8..61a08b78ff3829995b54ce14c1752d4e #import "PlaybackSessionManagerProxy.h" #import "QuickLookThumbnailLoader.h" #import "RemoteLayerTreeTransaction.h" -@@ -283,10 +284,87 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() +@@ -298,10 +299,84 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() void WebPageProxy::startDrag(const DragItem& dragItem, ShareableBitmap::Handle&& dragImageHandle) { @@ -11745,12 +12031,9 @@ index b77d46b64193c5cf2017da8d81623e54d5f6f7a8..61a08b78ff3829995b54ce14c1752d4e + return; + } + -+ ASSERT(info.additionalTypes.size() == info.additionalData.size()); -+ if (info.additionalTypes.size() == info.additionalData.size()) { -+ for (size_t index = 0; index < info.additionalTypes.size(); ++index) { -+ auto nsData = info.additionalData[index]->createNSData(); -+ [pasteboard setData:nsData.get() forType:info.additionalTypes[index]]; -+ } ++ 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]; + } + } else { + [pasteboard setString:@"" forType:PasteboardTypes::WebDummyPboardType]; @@ -11781,9 +12064,9 @@ index b77d46b64193c5cf2017da8d81623e54d5f6f7a8..61a08b78ff3829995b54ce14c1752d4e + NSPasteboard *pasteboard = [NSPasteboard pasteboardWithUniqueName]; + m_overrideDragPasteboardName = String([pasteboard name]); + } -+ send(Messages::WebPage::SetDragPasteboardName(m_overrideDragPasteboardName)); ++ legacyMainFrameProcess().send(Messages::WebPage::SetDragPasteboardName(m_overrideDragPasteboardName), webPageIDInMainFrameProcess()); + } else { -+ send(Messages::WebPage::SetDragPasteboardName(""_s)); ++ legacyMainFrameProcess().send(Messages::WebPage::SetDragPasteboardName(""_s), webPageIDInMainFrameProcess()); + } +} + @@ -11809,10 +12092,10 @@ index b77d46b64193c5cf2017da8d81623e54d5f6f7a8..61a08b78ff3829995b54ce14c1752d4e + +#endif // ENABLE(DRAG_SUPPORT) - #if ENABLE(UNIFIED_TEXT_REPLACEMENT) + #if ENABLE(ATTACHMENT_ELEMENT) diff --git a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -index ba0c5fe1678dc1055c7f495f5ff421438db7e082..bdf2dd23de87c114db52603b919f29188a2c4bed 100644 +index 36b1489cbe2de1698e6baebef5dc8f8e6d1f3acd..bdffd070443436f026b987aa86d1c22e61463dbf 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm @@ -434,7 +434,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END @@ -11824,7 +12107,7 @@ index ba0c5fe1678dc1055c7f495f5ff421438db7e082..bdf2dd23de87c114db52603b919f2918 #endif #if (PLATFORM(IOS) || PLATFORM(VISION)) && HAVE(AGX_COMPILER_SERVICE) -@@ -803,8 +803,8 @@ void WebProcessPool::registerNotificationObservers() +@@ -790,8 +790,8 @@ void WebProcessPool::registerNotificationObservers() }]; m_scrollerStyleNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSPreferredScrollerStyleDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { @@ -11836,7 +12119,7 @@ index ba0c5fe1678dc1055c7f495f5ff421438db7e082..bdf2dd23de87c114db52603b919f2918 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 3796110b3f6ffb29bc1eae80505017dee9e779d1..1a181f4ac8ce8d15d5e65a9df6afc8fe5695e85c 100644 +index 39eb5f67b50e99eddac8e12b4ecee66fe1d81360..91f5b350d7ae87af8754b56662e8dbc286084d5b 100644 --- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp +++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp @@ -33,14 +33,17 @@ @@ -11875,7 +12158,7 @@ index 3796110b3f6ffb29bc1eae80505017dee9e779d1..1a181f4ac8ce8d15d5e65a9df6afc8fe send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor())); } -+void DrawingAreaProxyCoordinatedGraphics::waitForSizeUpdate(Function&& callback) ++void DrawingAreaProxyCoordinatedGraphics::waitForSizeUpdate(Function&& callback) +{ + m_callbacks.append(WTFMove(callback)); +} @@ -11929,20 +12212,21 @@ index 3796110b3f6ffb29bc1eae80505017dee9e779d1..1a181f4ac8ce8d15d5e65a9df6afc8fe bool DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing() const { return m_webPageProxy->preferences().acceleratedCompositingEnabled() && m_webPageProxy->preferences().forceCompositingMode(); -@@ -275,6 +329,11 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() +@@ -275,6 +329,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() // we need to resend the new size here. if (m_lastSentSize != m_size) sendUpdateGeometry(); + else { -+ for (auto& value : m_callbacks) -+ value(); -+ m_callbacks.clear(); ++ Vector> callbacks; ++ callbacks.swap(m_callbacks); ++ for (auto& cb : callbacks) ++ cb(*this); + } } #if !PLATFORM(WPE) diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h -index d2ceeda76e90ab2041f238c240f81bf9e37f6072..faa338a2b4af13663bb63efc940b7efe5544e409 100644 +index 555814f9771f8f16d3572cd7007817ba4296d6d3..8850e4adb182e7f0b23e5cde45f14ad8c66bcc15 100644 --- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h +++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h @@ -29,6 +29,7 @@ @@ -11953,18 +12237,18 @@ index d2ceeda76e90ab2041f238c240f81bf9e37f6072..faa338a2b4af13663bb63efc940b7efe #include #if !PLATFORM(WPE) -@@ -52,6 +53,10 @@ public: +@@ -61,6 +62,10 @@ public: bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); } const LayerTreeContext& layerTreeContext() const { return m_layerTreeContext; } -+ void waitForSizeUpdate(Function&&); ++ void waitForSizeUpdate(Function&&); +#if !PLATFORM(WPE) + void captureFrame(); +#endif void dispatchAfterEnsuringDrawing(CompletionHandler&&); -@@ -75,6 +80,9 @@ private: +@@ -84,6 +89,9 @@ private: void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override; void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, UpdateInfo&&) override; void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override; @@ -11974,15 +12258,15 @@ index d2ceeda76e90ab2041f238c240f81bf9e37f6072..faa338a2b4af13663bb63efc940b7efe bool shouldSendWheelEventsToEventDispatcher() const override { return true; } -@@ -117,6 +125,7 @@ private: +@@ -126,6 +134,7 @@ private: // The last size we sent to the web process. WebCore::IntSize m_lastSentSize; -+ Vector> m_callbacks; ++ Vector> m_callbacks; #if !PLATFORM(WPE) bool m_isBackingStoreDiscardable { true }; -@@ -125,6 +134,10 @@ private: +@@ -134,6 +143,10 @@ private: RunLoop::Timer m_discardBackingStoreTimer; #endif std::unique_ptr m_drawingMonitor; @@ -11994,7 +12278,7 @@ index d2ceeda76e90ab2041f238c240f81bf9e37f6072..faa338a2b4af13663bb63efc940b7efe } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp -index 0295a560194b82bf172bfe978c711bb8f280f8e4..e8584dc0133a6a57734c63f6020f3d27dbcd04d7 100644 +index cc5e0d803a2069c6a5539fe1bccb67c5c9b1b3aa..7841be001cb5bc6db99b3d71f881c6e9b298e5fd 100644 --- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp +++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp @@ -40,8 +40,10 @@ @@ -12008,7 +12292,7 @@ index 0295a560194b82bf172bfe978c711bb8f280f8e4..e8584dc0133a6a57734c63f6020f3d27 #if PLATFORM(MAC) #include -@@ -58,7 +60,10 @@ DownloadProxy::DownloadProxy(DownloadProxyMap& downloadProxyMap, WebsiteDataStor +@@ -62,7 +64,10 @@ DownloadProxy::DownloadProxy(DownloadProxyMap& downloadProxyMap, WebsiteDataStor , m_request(resourceRequest) , m_originatingPage(originatingPage) , m_frameInfo(API::FrameInfo::create(FrameInfoData { frameInfoData }, originatingPage)) @@ -12019,7 +12303,7 @@ index 0295a560194b82bf172bfe978c711bb8f280f8e4..e8584dc0133a6a57734c63f6020f3d27 } DownloadProxy::~DownloadProxy() -@@ -77,9 +82,12 @@ static RefPtr createData(std::span data) +@@ -81,9 +86,12 @@ static RefPtr createData(std::span data) void DownloadProxy::cancel(CompletionHandler&& completionHandler) { if (m_dataStore) { @@ -12033,7 +12317,7 @@ index 0295a560194b82bf172bfe978c711bb8f280f8e4..e8584dc0133a6a57734c63f6020f3d27 m_downloadProxyMap.downloadFinished(*this); }); } else -@@ -164,6 +172,21 @@ void DownloadProxy::decideDestinationWithSuggestedFilename(const WebCore::Resour +@@ -153,6 +161,21 @@ void DownloadProxy::decideDestinationWithSuggestedFilename(const WebCore::Resour suggestedFilename = m_suggestedFilename; suggestedFilename = MIMETypeRegistry::appendFileExtensionIfNecessary(suggestedFilename, response.mimeType()); @@ -12055,7 +12339,7 @@ index 0295a560194b82bf172bfe978c711bb8f280f8e4..e8584dc0133a6a57734c63f6020f3d27 m_client->decideDestinationWithSuggestedFilename(*this, response, ResourceResponseBase::sanitizeSuggestedFilename(suggestedFilename), [this, protectedThis = Ref { *this }, completionHandler = WTFMove(completionHandler)] (AllowOverwrite allowOverwrite, String destination) mutable { SandboxExtension::Handle sandboxExtensionHandle; if (!destination.isNull()) { -@@ -212,6 +235,8 @@ void DownloadProxy::didFinish() +@@ -201,6 +224,8 @@ void DownloadProxy::didFinish() updateQuarantinePropertiesIfPossible(); #endif m_client->didFinish(*this); @@ -12064,7 +12348,7 @@ index 0295a560194b82bf172bfe978c711bb8f280f8e4..e8584dc0133a6a57734c63f6020f3d27 // This can cause the DownloadProxy object to be deleted. m_downloadProxyMap.downloadFinished(*this); -@@ -222,6 +247,8 @@ void DownloadProxy::didFail(const ResourceError& error, std::span +@@ -211,6 +236,8 @@ void DownloadProxy::didFail(const ResourceError& error, std::span m_legacyResumeData = createData(resumeData); m_client->didFail(*this, error, m_legacyResumeData.get()); @@ -12086,10 +12370,10 @@ index 6f0d076b1b1cb0ec3e1c7fdc5f3a6dfffe9ee63d..656d4259dbf9ab97a8b0408c061c0fd2 } // namespace WebKit diff --git a/Source/WebKit/UIProcess/DrawingAreaProxy.h b/Source/WebKit/UIProcess/DrawingAreaProxy.h -index 8cfe9bf3d49afd3345209c22c59663f72791fea4..9c13c012e21b33a889eb04a3733712a66470a88e 100644 +index 77d47a91327391c2b8bc3a3fc12f512c25160649..3173e2545ae0a79b90342234b008fd26a0ad72a7 100644 --- a/Source/WebKit/UIProcess/DrawingAreaProxy.h +++ b/Source/WebKit/UIProcess/DrawingAreaProxy.h -@@ -89,6 +89,7 @@ public: +@@ -98,6 +98,7 @@ public: const WebCore::IntSize& size() const { return m_size; } bool setSize(const WebCore::IntSize&, const WebCore::IntSize& scrollOffset = { }); @@ -12097,7 +12381,7 @@ index 8cfe9bf3d49afd3345209c22c59663f72791fea4..9c13c012e21b33a889eb04a3733712a6 virtual void minimumSizeForAutoLayoutDidChange() { } virtual void sizeToContentAutoSizeMaximumSizeDidChange() { } -@@ -172,6 +173,10 @@ private: +@@ -184,6 +185,10 @@ private: virtual void update(uint64_t /* backingStoreStateID */, UpdateInfo&&) { } virtual void exitAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, UpdateInfo&&) { } #endif @@ -12122,7 +12406,7 @@ index fc5c53f18ad2dee2c2f40cdbb86ca7f24b262d8d..d93d804d3a8ebaa30856710df544f3db } diff --git a/Source/WebKit/UIProcess/Inspector/Agents/CairoJpegEncoder.cpp b/Source/WebKit/UIProcess/Inspector/Agents/CairoJpegEncoder.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..f9af359a8b81babaf855132ec168feb22ef5799b +index 0000000000000000000000000000000000000000..8d20e2aa36ba0f7996c20a6a02792c7f151bbed5 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/CairoJpegEncoder.cpp @@ -0,0 +1,246 @@ @@ -12169,7 +12453,7 @@ index 0000000000000000000000000000000000000000..f9af359a8b81babaf855132ec168feb2 + +#include "config.h" + -+#if USE(CAIRO) ++#if USE(CAIRO) || PLATFORM(GTK) + +#include "CairoJpegEncoder.h" + @@ -12410,10 +12694,10 @@ 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..91cf94cd292350afb3e3ed071ca44760acda1c14 +index 0000000000000000000000000000000000000000..b0527d43bf28c7b6f25a5dc3f2b9ff42e0a96190 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp -@@ -0,0 +1,305 @@ +@@ -0,0 +1,387 @@ +/* + * Copyright (C) 2020 Microsoft Corporation. + * @@ -12454,7 +12738,19 @@ index 0000000000000000000000000000000000000000..91cf94cd292350afb3e3ed071ca44760 +#include +#include + -+#if USE(CAIRO) ++#if USE(SKIA) ++#include "DrawingAreaProxyCoordinatedGraphics.h" ++#include "DrawingAreaProxy.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#endif ++ ++#if USE(CAIRO) || PLATFORM(GTK) +#include "CairoJpegEncoder.h" +#include "DrawingAreaProxyCoordinatedGraphics.h" +#include "DrawingAreaProxy.h" @@ -12500,7 +12796,77 @@ index 0000000000000000000000000000000000000000..91cf94cd292350afb3e3ed071ca44760 + m_encoder = nullptr; +} + -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++void InspectorScreencastAgent::didPaint(sk_sp&& surface) ++{ ++ sk_sp image(surface); ++#if PLATFORM(WPE) ++ // Get actual image size (in device pixels). ++ WebCore::IntSize displaySize(image->width(), image->height()); ++ ++ WebCore::IntSize drawingAreaSize = m_page.drawingArea()->size(); ++ drawingAreaSize.scale(m_page.deviceScaleFactor()); ++ if (drawingAreaSize != displaySize) { ++ return; ++ } ++#else ++ WebCore::IntSize displaySize = m_page.drawingArea()->size(); ++#endif ++ // Do not WTFMove image here as it is used below ++ if (m_encoder) ++ m_encoder->encodeFrame(sk_sp(image), displaySize); ++ if (m_screencast) { ++ { ++ SkPixmap pixmap; ++ if (!image->peekPixels(&pixmap)) { ++ fprintf(stderr, "Failed to peek pixels from SkImage to compute hash\n"); ++ return; ++ } ++ // Do not send the same frame over and over. ++ size_t len = pixmap.computeByteSize(); ++ auto cryptoDigest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_1); ++ cryptoDigest->addBytes(std::span(reinterpret_cast(pixmap.addr()), len)); ++ auto digest = cryptoDigest->computeHash(); ++ if (m_lastFrameDigest == digest) ++ return; ++ m_lastFrameDigest = digest; ++ } ++ ++ if (m_screencastFramesInFlight > kMaxFramesInFlight) ++ return; ++ // Scale image to fit width / height ++ double scale = std::min(m_screencastWidth / displaySize.width(), m_screencastHeight / displaySize.height()); ++ if (scale < 1) { ++ SkBitmap dstBitmap; ++ dstBitmap.allocPixels(SkImageInfo::MakeN32Premul(displaySize.width() * scale, displaySize.height() * scale)); ++ SkCanvas canvas(dstBitmap); ++ canvas.scale(scale, scale); ++ canvas.drawImage(image, 0, 0); ++ image = dstBitmap.asImage(); ++ } ++ ++ SkPixmap pixmap; ++ if (!image->peekPixels(&pixmap)) { ++ fprintf(stderr, "Failed to peek pixels from SkImage for JPEG encoding\n"); ++ return; ++ } ++ ++ SkJpegEncoder::Options options; ++ options.fQuality = 90; ++ SkDynamicMemoryWStream stream; ++ if (!SkJpegEncoder::Encode(&stream, pixmap, options)) { ++ fprintf(stderr, "Failed to encode image to JPEG\n"); ++ return; ++ } ++ sk_sp jpegData = stream.detachAsData(); ++ String result = base64EncodeToString(std::span(reinterpret_cast(jpegData->data()), jpegData->size())); ++ ++m_screencastFramesInFlight; ++ m_frontendDispatcher->screencastFrame(result, displaySize.width(), displaySize.height()); ++ } ++} ++#endif ++ ++#if USE(CAIRO) || PLATFORM(GTK) +void InspectorScreencastAgent::didPaint(cairo_surface_t* surface) +{ +#if PLATFORM(WPE) @@ -12553,7 +12919,7 @@ index 0000000000000000000000000000000000000000..91cf94cd292350afb3e3ed071ca44760 + unsigned char *data = nullptr; + size_t len = 0; + cairo_image_surface_write_to_jpeg_mem(surface, &data, &len, m_screencastQuality); -+ String result = base64EncodeToString(data, len); ++ String result = base64EncodeToString(std::span(data, len)); + ++m_screencastFramesInFlight; + m_frontendDispatcher->screencastFrame(result, displaySize.width(), displaySize.height()); + } @@ -12642,7 +13008,7 @@ index 0000000000000000000000000000000000000000..91cf94cd292350afb3e3ed071ca44760 + scheduleFrameEncoding(); +#endif + } -+ m_page.forceRepaint([] { }); ++ m_page.updateRenderingWithForcedRepaint([] { }); +} + +#if !PLATFORM(WPE) @@ -12707,7 +13073,7 @@ index 0000000000000000000000000000000000000000..91cf94cd292350afb3e3ed071ca44760 +} +#endif + -+#if USE(CAIRO) && !PLATFORM(WPE) ++#if (USE(CAIRO) && !PLATFORM(WPE)) || PLATFORM(GTK) +void InspectorScreencastAgent::encodeFrame() +{ + if (!m_encoder && !m_screencast) @@ -12721,10 +13087,10 @@ index 0000000000000000000000000000000000000000..91cf94cd292350afb3e3ed071ca44760 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..d28dde452275f18739e3b1c8d709185c9bf0f40e +index 0000000000000000000000000000000000000000..f1322caa318ca408731697b2eb6349e0dc9c8537 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h -@@ -0,0 +1,97 @@ +@@ -0,0 +1,109 @@ +/* + * Copyright (C) 2020 Microsoft Corporation. + * @@ -12772,6 +13138,15 @@ index 0000000000000000000000000000000000000000..d28dde452275f18739e3b1c8d709185c +} + +namespace WebKit { ++class InspectorScreencastAgent; ++} ++ ++namespace WTF { ++template struct IsDeprecatedWeakRefSmartPointerException; ++template<> struct IsDeprecatedWeakRefSmartPointerException : std::true_type { }; ++} ++ ++namespace WebKit { + +class ScreencastEncoder; +class WebPageProxy; @@ -12786,7 +13161,10 @@ index 0000000000000000000000000000000000000000..d28dde452275f18739e3b1c8d709185c + void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override; + void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override; + -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++ void didPaint(sk_sp&& surface); ++#endif ++#if USE(CAIRO) || PLATFORM(GTK) + void didPaint(cairo_surface_t*); +#endif + @@ -12824,10 +13202,10 @@ index 0000000000000000000000000000000000000000..d28dde452275f18739e3b1c8d709185c +} // 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..90080e92c8278e73355c1fd4c571ea12f0bca9c5 +index 0000000000000000000000000000000000000000..8690b1a245d463cd29c0196ab609ab69c80cc0a9 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp -@@ -0,0 +1,391 @@ +@@ -0,0 +1,437 @@ +/* + * Copyright (c) 2010, The WebM Project authors. All rights reserved. + * Copyright (c) 2013 The Chromium Authors. All rights reserved. @@ -12869,7 +13247,14 @@ index 0000000000000000000000000000000000000000..90080e92c8278e73355c1fd4c571ea12 +#include +#include + -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++#include ++#include ++#include ++#include ++#endif ++ ++#if USE(CAIRO) || PLATFORM(GTK) +#include +#endif + @@ -12957,7 +13342,11 @@ index 0000000000000000000000000000000000000000..90080e92c8278e73355c1fd4c571ea12 + WTF_MAKE_NONCOPYABLE(VPXFrame); + WTF_MAKE_FAST_ALLOCATED; +public: -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++ explicit VPXFrame(sk_sp&& surface) ++ : m_surface(WTFMove(surface)) ++ { } ++#elif USE(CAIRO) || PLATFORM(GTK) + explicit VPXFrame(RefPtr&& surface) + : m_surface(WTFMove(surface)) + { } @@ -12973,7 +13362,16 @@ index 0000000000000000000000000000000000000000..90080e92c8278e73355c1fd4c571ea12 + + void convertToVpxImage(vpx_image_t* image) + { -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++ // Convert the updated region to YUV ready for encoding. ++ SkImageInfo info = SkImageInfo::Make(m_surface->width(), m_surface->height(), kN32_SkColorType, kPremul_SkAlphaType); ++ int argb_stride = info.minRowBytes(); ++ size_t bufferSize = info.computeByteSize(argb_stride); ++ UniqueArray buffer = makeUniqueArray(bufferSize); ++ uint8_t* argb_data = buffer.get(); ++ if (!m_surface->readPixels(info, argb_data, argb_stride, 0, 0)) ++ fprintf(stderr, "Read SkImage to ARGB buffer\n"); ++#elif USE(CAIRO) || PLATFORM(GTK) + // Convert the updated region to YUV ready for encoding. + const uint8_t* argb_data = cairo_image_surface_get_data(m_surface.get()); + int argb_stride = cairo_image_surface_get_stride(m_surface.get()); @@ -12999,7 +13397,9 @@ index 0000000000000000000000000000000000000000..90080e92c8278e73355c1fd4c571ea12 + } + +private: -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++ sk_sp m_surface; ++#elif USE(CAIRO) || PLATFORM(GTK) + RefPtr m_surface; +#elif PLATFORM(MAC) + RetainPtr m_windowImage; @@ -13121,7 +13521,7 @@ index 0000000000000000000000000000000000000000..90080e92c8278e73355c1fd4c571ea12 + 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, vpx_codec_err_to_string(error)); ++ errorString = makeString("Failed to get default codec config: "_s, span(vpx_codec_err_to_string(error))); + return nullptr; + } + @@ -13133,13 +13533,13 @@ index 0000000000000000000000000000000000000000..90080e92c8278e73355c1fd4c571ea12 + + 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, vpx_codec_error(codec.get())); ++ errorString = makeString("Failed to initialize encoder: "_s, span(vpx_codec_error(codec.get()))); + return nullptr; + } + + FILE* file = fopen(filePath.utf8().data(), "wb"); + if (!file) { -+ errorString = makeString("Failed to open file '", filePath, "' for writing: ", strerror(errno)); ++ errorString = makeString("Failed to open file '"_s, filePath, "' for writing: "_s, span(strerror(errno))); + return nullptr; + } + @@ -13162,7 +13562,31 @@ index 0000000000000000000000000000000000000000..90080e92c8278e73355c1fd4c571ea12 + m_lastFrameTimestamp = now; +} + -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++void ScreencastEncoder::encodeFrame(sk_sp&& image, IntSize size) ++{ ++ flushLastFrame(); ++ // Note that in WPE drawing area size is updated asynchronously and may differ from acutal ++ // size of the surface. ++ if (size.isZero()) { ++ return; ++ } ++ SkBitmap surface; ++ surface.allocPixels(SkImageInfo::Make(m_size.width(), m_size.height(), kBGRA_8888_SkColorType, kPremul_SkAlphaType)); ++ SkCanvas canvas(surface); ++ SkMatrix transform; ++ if (size.width() > m_size.width() || size.height() > m_size.height()) { ++ // If no scale is specified shrink to fit the frame. ++ double scale = std::min(static_cast(m_size.width()) / size.width(), ++ static_cast(m_size.height()) / size.height()); ++ transform.setScale(scale, scale); ++ canvas.setMatrix(transform); ++ } ++ // Record top left part of the drawing area that fits into the frame. ++ canvas.drawImage(image, 0, 0); ++ m_lastFrame = makeUnique(surface.asImage()); ++} ++#elif USE(CAIRO) || PLATFORM(GTK) +void ScreencastEncoder::encodeFrame(cairo_surface_t* drawingAreaSurface, IntSize size) +{ + flushLastFrame(); @@ -13221,10 +13645,10 @@ index 0000000000000000000000000000000000000000..90080e92c8278e73355c1fd4c571ea12 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h new file mode 100644 -index 0000000000000000000000000000000000000000..36df6131950ca95f74dc191628376fc589dbcb33 +index 0000000000000000000000000000000000000000..f8701329f574bfad15f0e5456360a3ee3bd21b48 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h -@@ -0,0 +1,80 @@ +@@ -0,0 +1,82 @@ +/* + * Copyright (C) 2020 Microsoft Corporation. + * @@ -13279,7 +13703,9 @@ index 0000000000000000000000000000000000000000..36df6131950ca95f74dc191628376fc5 + ScreencastEncoder(std::unique_ptr&&, WebCore::IntSize); + ~ScreencastEncoder(); + -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++ void encodeFrame(sk_sp&&, WebCore::IntSize); ++#elif USE(CAIRO) || PLATFORM(GTK) + void encodeFrame(cairo_surface_t*, WebCore::IntSize); +#elif PLATFORM(MAC) + void encodeFrame(RetainPtr&&); @@ -13440,10 +13866,10 @@ index 0000000000000000000000000000000000000000..e2ce910f3fd7f587add552275b7e7176 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp -index fedef553cec70feb6c6475a5f752fbc6833dbb38..16e73d6a724dd80487b7b140aaaccfec253eb7aa 100644 +index 5cd89b25d3d87ec952d9a1a55351c9a7d76b9125..f43f2b64bcb6fffc672406f9eea9f7bda96918d6 100644 --- a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp +++ b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp -@@ -28,11 +28,10 @@ +@@ -28,7 +28,7 @@ #include "MessageSenderInlines.h" #include "ProvisionalPageProxy.h" @@ -13452,11 +13878,7 @@ index fedef553cec70feb6c6475a5f752fbc6833dbb38..16e73d6a724dd80487b7b140aaaccfec #include "WebPageInspectorTarget.h" #include "WebPageMessages.h" #include "WebPageProxy.h" --#include "WebProcessProxy.h" - - namespace WebKit { - -@@ -40,19 +39,17 @@ using namespace Inspector; +@@ -40,19 +40,17 @@ using namespace Inspector; std::unique_ptr InspectorTargetProxy::create(WebPageProxy& page, const String& targetId, Inspector::InspectorTargetType type) { @@ -13481,14 +13903,14 @@ index fedef553cec70feb6c6475a5f752fbc6833dbb38..16e73d6a724dd80487b7b140aaaccfec , m_identifier(targetId) , m_type(type) { -@@ -99,6 +96,31 @@ void InspectorTargetProxy::didCommitProvisionalTarget() +@@ -99,6 +97,31 @@ void InspectorTargetProxy::didCommitProvisionalTarget() m_provisionalPage = nullptr; } +void InspectorTargetProxy::willResume() +{ + if (m_page.hasRunningProcess()) -+ m_page.send(Messages::WebPage::ResumeInspectorIfPausedInNewWindow()); ++ m_page.legacyMainFrameProcess().send(Messages::WebPage::ResumeInspectorIfPausedInNewWindow(), m_page.webPageIDInMainFrameProcess()); +} + +void InspectorTargetProxy::activate(String& error) @@ -13554,7 +13976,7 @@ index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..79f3ff84327dc075ec96983e04db4b10 } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp -index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf140b6a8a 100644 +index 96cfb0cbc8749708d263a79270746a0185bff348..c6a71685084ca322925c848a404e5d80db0b727e 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp @@ -26,13 +26,21 @@ @@ -13632,13 +14054,13 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf + // window.open will create page with already running process. + if (!m_inspectedPage->hasRunningProcess()) + return; - String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID()); + String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); createInspectorTarget(pageTargetId, Inspector::InspectorTargetType::Page); } +void WebPageInspectorController::didFinishAttachingToWebProcess() +{ -+ String pageTargetID = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID()); ++ String pageTargetID = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); + // Create target only after attaching to a Web Process first time. Before that + // we cannot event establish frontend connection. + if (m_targets.contains(pageTargetID)) @@ -13648,7 +14070,7 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf + void WebPageInspectorController::pageClosed() { -+ String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID()); ++ String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); + destroyInspectorTarget(pageTargetId); + disconnectAllFrontends(); @@ -13663,7 +14085,7 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf +{ + if (reason != ProcessTerminationReason::Crash) + return false; -+ String targetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID()); ++ String targetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); + auto it = m_targets.find(targetId); + if (it == m_targets.end()) + return false; @@ -13743,11 +14165,20 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf auto inspectedPage = protectedInspectedPage(); inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); -@@ -160,6 +270,66 @@ void WebPageInspectorController::setIndicating(bool indicating) +@@ -160,6 +270,75 @@ void WebPageInspectorController::setIndicating(bool indicating) } #endif -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++void WebPageInspectorController::didPaint(sk_sp&& surface) ++{ ++ if (!m_frontendRouter->hasFrontends()) ++ return; ++ ++ m_screecastAgent->didPaint(WTFMove(surface)); ++} ++#endif ++#if USE(CAIRO) || PLATFORM(GTK) +void WebPageInspectorController::didPaint(cairo_surface_t* surface) +{ + if (!m_frontendRouter->hasFrontends()) @@ -13810,7 +14241,7 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf void WebPageInspectorController::createInspectorTarget(const String& targetId, Inspector::InspectorTargetType type) { addTarget(InspectorTargetProxy::create(protectedInspectedPage(), targetId, type)); -@@ -179,6 +349,32 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta +@@ -179,6 +358,32 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta m_targetAgent->sendMessageFromTargetToFrontend(targetId, message); } @@ -13828,14 +14259,14 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf + if (!m_inspectedPage->isPageOpenedByDOMShowingInitialEmptyDocument()) + return false; + -+ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID())); ++ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess())); + ASSERT(target); + return target->isPaused(); +} + +void WebPageInspectorController::setContinueLoadingCallback(WTF::Function&& callback) +{ -+ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID())); ++ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess())); + ASSERT(target); + target->setResumeCallback(WTFMove(callback)); +} @@ -13843,7 +14274,7 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf bool WebPageInspectorController::shouldPauseLoading(const ProvisionalPageProxy& provisionalPage) const { if (!m_frontendRouter->hasFrontends()) -@@ -198,7 +394,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag +@@ -198,7 +403,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag void WebPageInspectorController::didCreateProvisionalPage(ProvisionalPageProxy& provisionalPage) { @@ -13852,7 +14283,7 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf } void WebPageInspectorController::willDestroyProvisionalPage(const ProvisionalPageProxy& provisionalPage) -@@ -277,4 +473,27 @@ void WebPageInspectorController::browserExtensionsDisabled(HashSet&& ext +@@ -277,4 +482,27 @@ void WebPageInspectorController::browserExtensionsDisabled(HashSet&& ext m_enabledBrowserAgent->extensionsDisabled(WTFMove(extensionIDs)); } @@ -13881,7 +14312,7 @@ index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..7294731b4ff75a0cec1dd010cc7facaf + } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h -index c6aafe0e9339c8ac02dc133754ddc23e1cb522ff..91473e6a0b4a37a15959f966fc75134c15e1112d 100644 +index c6aafe0e9339c8ac02dc133754ddc23e1cb522ff..00b4ae5f9a7ac36f1fceab1c3ab39b20086302ae 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h @@ -26,6 +26,7 @@ @@ -13892,12 +14323,17 @@ index c6aafe0e9339c8ac02dc133754ddc23e1cb522ff..91473e6a0b4a37a15959f966fc75134c #include #include #include -@@ -33,11 +34,28 @@ +@@ -33,11 +34,33 @@ #include #include #include +#include + ++#if USE(SKIA) ++#include ++#include ++#endif ++ +#if USE(CAIRO) +#include +#endif @@ -13921,7 +14357,7 @@ index c6aafe0e9339c8ac02dc133754ddc23e1cb522ff..91473e6a0b4a37a15959f966fc75134c } namespace WebKit { -@@ -45,6 +63,23 @@ namespace WebKit { +@@ -45,6 +68,23 @@ namespace WebKit { class InspectorBrowserAgent; struct WebPageAgentContext; @@ -13945,7 +14381,7 @@ index c6aafe0e9339c8ac02dc133754ddc23e1cb522ff..91473e6a0b4a37a15959f966fc75134c class WebPageInspectorController { WTF_MAKE_NONCOPYABLE(WebPageInspectorController); WTF_MAKE_FAST_ALLOCATED; -@@ -52,7 +87,21 @@ public: +@@ -52,7 +92,21 @@ public: WebPageInspectorController(WebPageProxy&); void init(); @@ -13967,11 +14403,14 @@ index c6aafe0e9339c8ac02dc133754ddc23e1cb522ff..91473e6a0b4a37a15959f966fc75134c bool hasLocalFrontend() const; -@@ -65,11 +114,25 @@ public: +@@ -65,11 +119,28 @@ public: #if ENABLE(REMOTE_INSPECTOR) void setIndicating(bool); #endif -+#if USE(CAIRO) ++#if USE(SKIA) && !PLATFORM(GTK) ++ void didPaint(sk_sp&&); ++#endif ++#if USE(CAIRO) || PLATFORM(GTK) + void didPaint(cairo_surface_t*); +#endif + using NavigationHandler = Function; @@ -13993,7 +14432,7 @@ index c6aafe0e9339c8ac02dc133754ddc23e1cb522ff..91473e6a0b4a37a15959f966fc75134c bool shouldPauseLoading(const ProvisionalPageProxy&) const; void setContinueLoadingCallback(const ProvisionalPageProxy&, WTF::Function&&); -@@ -84,11 +147,12 @@ public: +@@ -84,11 +155,12 @@ public: void browserExtensionsDisabled(HashSet&&); private: @@ -14007,7 +14446,7 @@ index c6aafe0e9339c8ac02dc133754ddc23e1cb522ff..91473e6a0b4a37a15959f966fc75134c Ref m_frontendRouter; Ref m_backendDispatcher; -@@ -97,11 +161,17 @@ private: +@@ -97,11 +169,17 @@ private: WeakRef m_inspectedPage; Inspector::InspectorTargetAgent* m_targetAgent { nullptr }; @@ -14258,10 +14697,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..a494ee1006f70d398149753f8953515d434cbcd4 +index 0000000000000000000000000000000000000000..f0675fcaf55625bce9b23a378d556030c27997f8 --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp -@@ -0,0 +1,1019 @@ +@@ -0,0 +1,1026 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -14333,6 +14772,7 @@ index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d +#include +#include +#include ++#include + +using namespace Inspector; + @@ -14444,13 +14884,13 @@ index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d +static Ref> getEnabledWindowFeatures(const WebCore::WindowFeatures& features) { + auto result = JSON::ArrayOf::create(); + if (features.x) -+ result->addItem("left=" + String::number(*features.x)); ++ result->addItem(makeString("left="_s, String::number(*features.x))); + if (features.y) -+ result->addItem("top=" + String::number(*features.y)); ++ result->addItem(makeString("top="_s, String::number(*features.y))); + if (features.width) -+ result->addItem("width=" + String::number(*features.width)); ++ result->addItem(makeString("width="_s, String::number(*features.width))); + if (features.height) -+ result->addItem("height=" + String::number(*features.height)); ++ result->addItem(makeString("height="_s, String::number(*features.height))); + if (features.menuBarVisible) + result->addItem("menubar"_s); + if (features.toolBarVisible) @@ -14634,7 +15074,7 @@ index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d + if (!m_isEnabled) + return; + -+ if (isInspectorProcessPool(page.process().processPool())) ++ if (isInspectorProcessPool(page.legacyMainFrameProcess().processPool())) + return; + + ASSERT(m_frontendChannel); @@ -14664,7 +15104,7 @@ index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d + if (!m_isEnabled) + return; + -+ if (isInspectorProcessPool(page.process().processPool())) ++ if (isInspectorProcessPool(page.legacyMainFrameProcess().processPool())) + return; + + String browserContextID = toBrowserContextIDProtocolString(page.sessionID()); @@ -14995,7 +15435,7 @@ index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d + } + + auto sandboxExtensionHandles = SandboxExtension::createReadOnlyHandlesForFiles("InspectorPlaywrightAgent::grantFileReadAccess"_s, files); -+ pageProxyChannel->page().send(Messages::WebPage::ExtendSandboxForFilesFromOpenPanel(WTFMove(sandboxExtensionHandles))); ++ pageProxyChannel->page().legacyMainFrameProcess().send(Messages::WebPage::ExtendSandboxForFilesFromOpenPanel(WTFMove(sandboxExtensionHandles)), pageProxyChannel->page().webPageIDInMainFrameProcess()); +#endif + return { }; +} @@ -15105,6 +15545,12 @@ index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d + cookie.sameSite = WebCore::Cookie::SameSitePolicy::Lax; + if (sameSite == "Strict"_s) + cookie.sameSite = WebCore::Cookie::SameSitePolicy::Strict; ++#if USE(SOUP) ++ } else { ++ // Cookies are Lax by default in libsoup and will reject cookies with ++ // sameSite: None and secure: false (defaults in WebCore::Cookie). ++ cookie.sameSite = WebCore::Cookie::SameSitePolicy::Lax; ++#endif + } + cookies.append(WTFMove(cookie)); + } @@ -15203,7 +15649,7 @@ index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d +{ + if (!m_isEnabled) + return; -+ String frameID = WebCore::InspectorPageAgent::makeFrameID(page->process().coreProcessIdentifier(), frameInfoData.frameID); ++ String frameID = WebCore::InspectorPageAgent::makeFrameID(page->legacyMainFrameProcess().coreProcessIdentifier(), frameInfoData.frameID); + m_downloads.set(uuid, download); + m_frontendDispatcher->downloadCreated( + toPageProxyIDProtocolString(*page), @@ -15283,10 +15729,10 @@ index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..36b7f12b5d9fce000715b42ee2980c20e0e91ef7 +index 0000000000000000000000000000000000000000..1a63e17a88f13f7e315cdcbd5644919c3217be4a --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h -@@ -0,0 +1,130 @@ +@@ -0,0 +1,139 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -15337,6 +15783,15 @@ index 0000000000000000000000000000000000000000..36b7f12b5d9fce000715b42ee2980c20 +} + +namespace WebKit { ++class OverridenGeolocationProvider; ++} ++ ++namespace WTF { ++template struct IsDeprecatedWeakRefSmartPointerException; ++template<> struct IsDeprecatedWeakRefSmartPointerException : std::true_type { }; ++} ++ ++namespace WebKit { + +class WebFrameProxy; + @@ -15496,11 +15951,50 @@ index 0000000000000000000000000000000000000000..e7a3dcc533294bb6e12f65d79b5b716b +} // namespace WebKit + +#endif // ENABLE(REMOTE_INSPECTOR) +diff --git a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp +index c5df687a8093a3ee9bdddbecb69629584c197012..f09af9804e7a587a3c1a444317ba1a16ca52fb7f 100644 +--- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp ++++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp +@@ -188,6 +188,13 @@ void ProcessLauncher::launchProcess() + nargs++; + } + #endif ++// Playwright begin ++ bool enableSharedArrayBuffer = false; ++ if (m_launchOptions.processType == ProcessLauncher::ProcessType::Web && m_client && m_client->shouldEnableSharedArrayBuffer()) { ++ enableSharedArrayBuffer = true; ++ nargs++; ++ } ++// Playwright end + + char** argv = g_newa(char*, nargs); + unsigned i = 0; +@@ -203,6 +210,10 @@ void ProcessLauncher::launchProcess() + if (configureJSCForTesting) + argv[i++] = const_cast("--configure-jsc-for-testing"); + #endif ++// Playwright begin ++ if (enableSharedArrayBuffer) ++ argv[i++] = const_cast("--enable-shared-array-buffer"); ++// Playwright end + argv[i++] = nullptr; + + // Warning: we want GIO to be able to spawn with posix_spawn() rather than fork()/exec(), in diff --git a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp -index 1a26781907e71c9cc3e99aff38d8060c4387abd7..b4e6e7edec5a716da63c74a6be5d08b6e1981f52 100644 +index fac881d7c3d44758591d7a9f392a3992ce9f9a72..35eba5a0b31fc6e2d6e5c05c9f866c03d2e1c7d0 100644 --- a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp +++ b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp -@@ -97,8 +97,11 @@ void ProcessLauncher::launchProcess() +@@ -91,14 +91,21 @@ void ProcessLauncher::launchProcess() + commandLineBuilder.append(" -configure-jsc-for-testing"_s); + if (!m_client->isJITEnabled()) + commandLineBuilder.append(" -disable-jit"_s); ++// Playwright begin ++ if (m_launchOptions.processType == ProcessLauncher::ProcessType::Web && m_client->shouldEnableSharedArrayBuffer()) ++ commandLineBuilder.append(" -enable-shared-array-buffer"_s); ++// Playwright end + commandLineBuilder.append('\0'); + + auto commandLine = commandLineBuilder.toString().wideCharacters(); STARTUPINFO startupInfo { }; startupInfo.cb = sizeof(startupInfo); @@ -15514,7 +16008,7 @@ index 1a26781907e71c9cc3e99aff38d8060c4387abd7..b4e6e7edec5a716da63c74a6be5d08b6 BOOL result = ::CreateProcess(0, commandLine.data(), 0, 0, true, 0, 0, 0, &startupInfo, &processInformation); diff --git a/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp b/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp -index 3fe0abcfe36bef7ca45bed5661a737ed2bfe56d0..510656948af01ec65d4543c805e9667a307018fd 100644 +index 919dede3e9653f6e16d6772a90a023223c0845a9..8e0a214d02468c900dedc803204d4704b4aa6d12 100644 --- a/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp +++ b/Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp @@ -30,6 +30,7 @@ @@ -15526,21 +16020,35 @@ index 3fe0abcfe36bef7ca45bed5661a737ed2bfe56d0..510656948af01ec65d4543c805e9667a #include "RemoteMediaSessionCoordinatorProxyMessages.h" #include "WebPageProxy.h" diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h -index 46f725b53f67ed41ff3312d106a23174d6a16363..369ee3539762a6286977d94a7958b25291f11ed6 100644 +index cc9598fc619fb1bf3f4070d52a7587e209d4a147..58d92b530a60ce327cad1b47566bbb57450e955e 100644 --- a/Source/WebKit/UIProcess/PageClient.h +++ b/Source/WebKit/UIProcess/PageClient.h -@@ -92,6 +92,10 @@ OBJC_CLASS WKView; +@@ -72,6 +72,11 @@ + #include + #endif + ++#if USE(SKIA) ++#include ++#include ++#endif ++ + OBJC_CLASS AVPlayerViewController; + OBJC_CLASS CALayer; + OBJC_CLASS NSFileWrapper; +@@ -93,6 +98,12 @@ OBJC_CLASS WKView; #endif #endif +#if PLATFORM(GTK) || PLATFORM(WPE) ++#if USE(CAIRO) +#include +#endif ++#endif + - namespace API { - class Attachment; - class HitTestResult; -@@ -347,7 +351,16 @@ public: + namespace WebKit { + class PageClient; + } +@@ -373,7 +384,20 @@ public: virtual void selectionDidChange() = 0; #endif @@ -15549,7 +16057,11 @@ index 46f725b53f67ed41ff3312d106a23174d6a16363..369ee3539762a6286977d94a7958b252 +#if PLATFORM(COCOA) + virtual RetainPtr takeSnapshotForAutomation() = 0; +#elif PLATFORM(WPE) ++#if USE(SKIA) ++ virtual sk_sp takeViewSnapshot(std::optional&&, bool nominalResolution = false) = 0; ++#elif USE(CAIRO) + virtual RefPtr takeViewSnapshot(std::optional&&, bool nominalResolution = false) = 0; ++#endif +#elif PLATFORM(GTK) + virtual RefPtr takeViewSnapshot(std::optional&&, bool nominalResolution = false) = 0; +#endif @@ -15684,7 +16196,7 @@ index 0000000000000000000000000000000000000000..3c8fd0549f1847515d35092f0f49b060 + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp -index b2dc99d6ca28e7f1140122a259d9fbcf3b4eeabf..4f182cd32458d19b775f79deb1f6da22a4077ba6 100644 +index 5fcfd69c72a7bf369d1c043e3cfd26cbfed7f023..92c638d01d397fc39f654caed5b6f87a8b6ead99 100644 --- a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp +++ b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp @@ -25,6 +25,7 @@ @@ -15694,7 +16206,7 @@ index b2dc99d6ca28e7f1140122a259d9fbcf3b4eeabf..4f182cd32458d19b775f79deb1f6da22 +#include "WebFrameProxy.h" #include "FrameProcess.h" - #include "VisitedLinkStore.h" + #include "ProvisionalFrameCreationParameters.h" diff --git a/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp b/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1a824be7d9fcb225d018b4a821fa895e844d7805 @@ -16022,7 +16534,7 @@ index d499ee31f32b9dcdb456ba0b476d211fba115673..43b349887d18e21162b59fa8174df32c namespace WebCore { class PlatformWheelEvent; diff --git a/Source/WebKit/UIProcess/RemotePageProxy.cpp b/Source/WebKit/UIProcess/RemotePageProxy.cpp -index 1db0914af03203844ccbda63b50f8486dc823586..3bf331ae9866aaea83e3bea6ca5bb196d4039110 100644 +index f08f1ae907d39f75ec5043921c44dfeb1c581511..a892f5050b0f7a37c1231c9ca41dfb6030249aba 100644 --- a/Source/WebKit/UIProcess/RemotePageProxy.cpp +++ b/Source/WebKit/UIProcess/RemotePageProxy.cpp @@ -43,6 +43,7 @@ @@ -16034,10 +16546,10 @@ index 1db0914af03203844ccbda63b50f8486dc823586..3bf331ae9866aaea83e3bea6ca5bb196 namespace WebKit { diff --git a/Source/WebKit/UIProcess/RemotePageProxy.h b/Source/WebKit/UIProcess/RemotePageProxy.h -index 5ecfa03204724d8e5696149dd45e4d35877993f0..fc8262fb617aef3eb68cf13117747dc48a7d843e 100644 +index b2019b6e792c58c9aa258d571f24dbe35c5eb926..bac988e367c158292f6e5dab957bdafcd23d91de 100644 --- a/Source/WebKit/UIProcess/RemotePageProxy.h +++ b/Source/WebKit/UIProcess/RemotePageProxy.h -@@ -64,7 +64,6 @@ class WebProcessProxy; +@@ -73,7 +73,6 @@ class WebProcessProxy; struct FrameInfoData; struct FrameTreeCreationParameters; @@ -16046,19 +16558,19 @@ index 5ecfa03204724d8e5696149dd45e4d35877993f0..fc8262fb617aef3eb68cf13117747dc4 class RemotePageProxy : public IPC::MessageReceiver { WTF_MAKE_FAST_ALLOCATED; diff --git a/Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp b/Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp -index 4d8a16e02d2d3c1d11df5df2c84197da76539324..5de382d79c2dd8f7884eb27ef454ba0b99f3fab8 100644 +index 40531b866fda1c35dbddb90f2ac1027688b2a09c..82003f78d7d2c9fbf2d393187636cf8b0bcf228f 100644 --- a/Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp +++ b/Source/WebKit/UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp @@ -37,6 +37,7 @@ #include #include - #include + #include +#include #define U2F_RELEASE_LOG(fmt, ...) RELEASE_LOG(WebAuthn, "%p [transport=%s] - U2fAuthenticator::" fmt, this, transportForDebugging().utf8().data(), ##__VA_ARGS__) diff --git a/Source/WebKit/UIProcess/WebContextMenuProxy.cpp b/Source/WebKit/UIProcess/WebContextMenuProxy.cpp -index d74ec9892f9a57bd7622ff5a4e16b67262165661..e884998f2a0823c32f33fe7a8499c7b4904a2fc0 100644 +index 71fdc0b69e820af7f955482b42562e941eeac349..2a2d55e5a67aa7120193fd55913d3dbbbac62919 100644 --- a/Source/WebKit/UIProcess/WebContextMenuProxy.cpp +++ b/Source/WebKit/UIProcess/WebContextMenuProxy.cpp @@ -33,6 +33,7 @@ @@ -16070,7 +16582,7 @@ index d74ec9892f9a57bd7622ff5a4e16b67262165661..e884998f2a0823c32f33fe7a8499c7b4 namespace WebKit { diff --git a/Source/WebKit/UIProcess/WebContextMenuProxy.h b/Source/WebKit/UIProcess/WebContextMenuProxy.h -index e7d6621532fcc73212cc9130a7cafbb13f458d1d..ec931c8f19d2a61c0fa7d78b52df7f3f94bdd2c5 100644 +index e2ded3c65b9680346be2534a3e970e2f425a83a8..b0c006c1dcbfae4b33530f8eae04f9868cd4d8b9 100644 --- a/Source/WebKit/UIProcess/WebContextMenuProxy.h +++ b/Source/WebKit/UIProcess/WebContextMenuProxy.h @@ -46,6 +46,7 @@ public: @@ -16082,7 +16594,7 @@ index e7d6621532fcc73212cc9130a7cafbb13f458d1d..ec931c8f19d2a61c0fa7d78b52df7f3f WebPageProxy* page() const { return m_page.get(); } diff --git a/Source/WebKit/UIProcess/WebFrameProxy.cpp b/Source/WebKit/UIProcess/WebFrameProxy.cpp -index 6e6560e17721ed182ab27277759488c410ae130e..207bda7e3c53118344536568ef18ccc043104ba1 100644 +index 21a9f2d213db48f58881d0873cfd17ce962080b8..7932e3de12dc1af7f3aad4a9cdbb8bf0004a67ba 100644 --- a/Source/WebKit/UIProcess/WebFrameProxy.cpp +++ b/Source/WebKit/UIProcess/WebFrameProxy.cpp @@ -31,6 +31,7 @@ @@ -16093,7 +16605,7 @@ index 6e6560e17721ed182ab27277759488c410ae130e..207bda7e3c53118344536568ef18ccc0 #include "FrameProcess.h" #include "FrameTreeCreationParameters.h" #include "FrameTreeNodeData.h" -@@ -43,6 +44,7 @@ +@@ -42,6 +43,7 @@ #include "RemotePageProxy.h" #include "WebFramePolicyListenerProxy.h" #include "WebNavigationState.h" @@ -16102,7 +16614,7 @@ index 6e6560e17721ed182ab27277759488c410ae130e..207bda7e3c53118344536568ef18ccc0 #include "WebPageProxy.h" #include "WebPageProxyMessages.h" diff --git a/Source/WebKit/UIProcess/WebNavigationState.h b/Source/WebKit/UIProcess/WebNavigationState.h -index f68592e910d61293346fbc251afd9bcbd28cd3a5..2f92c407fa357031a1d054aa39a65a20cbe30751 100644 +index 0968d688b613c7112dd243083b839242b95cb308..b05d1f71a641bfacc27965b2c78725575840b583 100644 --- a/Source/WebKit/UIProcess/WebNavigationState.h +++ b/Source/WebKit/UIProcess/WebNavigationState.h @@ -29,6 +29,7 @@ @@ -16111,9 +16623,9 @@ index f68592e910d61293346fbc251afd9bcbd28cd3a5..2f92c407fa357031a1d054aa39a65a20 #include +#include "WebPageProxy.h" - namespace API { - class Navigation; -@@ -43,7 +44,6 @@ enum class FrameLoadType : uint8_t; + namespace WebKit { + class WebNavigationState; +@@ -52,7 +53,6 @@ enum class FrameLoadType : uint8_t; namespace WebKit { @@ -16123,10 +16635,10 @@ index f68592e910d61293346fbc251afd9bcbd28cd3a5..2f92c407fa357031a1d054aa39a65a20 class WebNavigationState : public CanMakeWeakPtr { diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..fef34b5cf77742521c679a46f38111c1e198b9bf +index 0000000000000000000000000000000000000000..0eec34c12082631d2d07a7a2b96ed189bd52a518 --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp -@@ -0,0 +1,147 @@ +@@ -0,0 +1,159 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -16266,6 +16778,18 @@ index 0000000000000000000000000000000000000000..fef34b5cf77742521c679a46f38111c1 + return { }; +} + ++Inspector::Protocol::ErrorStringOr WebPageInspectorEmulationAgent::setOrientationOverride(std::optional&& angle) ++{ ++#if ENABLE(ORIENTATION_EVENTS) ++ m_page.setOrientationOverride(WTFMove(angle)); ++ return { }; ++#else ++ UNUSED_PARAM(angle); ++ return makeUnexpected("Orientation events are disabled in this build"_s); ++#endif ++} ++ ++ +void WebPageInspectorEmulationAgent::didShowPage() +{ + for (auto& command : m_commandsToRunWhenShown) @@ -16276,10 +16800,10 @@ index 0000000000000000000000000000000000000000..fef34b5cf77742521c679a46f38111c1 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..12657f8e7c4b2596707680d299dc8084d48f03c2 +index 0000000000000000000000000000000000000000..b70bfe0411571f4d181a7fae3186aaae7cd7b831 --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h -@@ -0,0 +1,75 @@ +@@ -0,0 +1,76 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -16341,6 +16865,7 @@ index 0000000000000000000000000000000000000000..12657f8e7c4b2596707680d299dc8084 + Inspector::Protocol::ErrorStringOr setActiveAndFocused(std::optional&&) override; + Inspector::Protocol::ErrorStringOr grantPermissions(const String& origin, Ref&& permissions) override; + Inspector::Protocol::ErrorStringOr resetPermissions() override; ++ Inspector::Protocol::ErrorStringOr setOrientationOverride(std::optional&& angle) override; + + void didShowPage(); + @@ -16357,10 +16882,10 @@ index 0000000000000000000000000000000000000000..12657f8e7c4b2596707680d299dc8084 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..f4519d0655e1e92e6d47a9e59cf01b0fd07ababf +index 0000000000000000000000000000000000000000..247c1817e85e5935eacef5e5ecdc07737dbf4a85 --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp -@@ -0,0 +1,334 @@ +@@ -0,0 +1,394 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -16393,8 +16918,9 @@ index 0000000000000000000000000000000000000000..f4519d0655e1e92e6d47a9e59cf01b0f +#include "NativeWebKeyboardEvent.h" +#include "NativeWebMouseEvent.h" +#include "NativeWebWheelEvent.h" -+#include "WebWheelEvent.h" +#include "WebPageProxy.h" ++#include "WebTouchEvent.h" ++#include "WebWheelEvent.h" +#include +#include +#include @@ -16486,7 +17012,7 @@ index 0000000000000000000000000000000000000000..f4519d0655e1e92e6d47a9e59cf01b0f +static String keyIdentifierForKey(const String& key) +{ + if (key.length() == 1) -+ return makeString("U+", hex(toASCIIUpper(key.characterAt(0)), 4)); ++ return makeString("U+"_s, hex(toASCIIUpper(key.characterAt(0)), 4)); + if (key == "Delete"_s) + return "U+007F"_s; + if (key == "Backspace"_s) @@ -16660,10 +17186,69 @@ index 0000000000000000000000000000000000000000..f4519d0655e1e92e6d47a9e59cf01b0f +#endif +} + -+void WebPageInspectorInputAgent::dispatchTapEvent(int x, int y, std::optional&& modifiers, Ref&& callback) { -+ m_page.sendWithAsyncReply(Messages::WebPage::FakeTouchTap(WebCore::IntPoint(x, y), modifiers ? *modifiers : 0), [callback]() { ++void WebPageInspectorInputAgent::dispatchTapEvent(int x, int y, std::optional&& modifiers, Ref&& callback) ++{ ++ m_page.legacyMainFrameProcess().sendWithAsyncReply(Messages::WebPage::FakeTouchTap(WebCore::IntPoint(x, y), modifiers ? *modifiers : 0), [callback]() { + callback->sendSuccess(); -+ }); ++ }, m_page.webPageIDInMainFrameProcess()); ++} ++ ++void WebPageInspectorInputAgent::dispatchTouchEvent(const String& type, std::optional&& modifiers, RefPtr&& in_touchPoints, Ref&& callback) ++{ ++ float rotationAngle = 0.0; ++ float force = 1.0; ++ const WebCore::IntSize radius(1, 1); ++ ++ uint8_t unsignedModifiers = modifiers ? static_cast(*modifiers) : 0; ++ OptionSet eventModifiers; ++ eventModifiers = eventModifiers.fromRaw(unsignedModifiers); ++ ++ WebPlatformTouchPoint::State state; ++ if (type == "touchStart"_s) ++ state = WebPlatformTouchPoint::State::Pressed; ++ else if (type == "touchMove"_s) ++ state = WebPlatformTouchPoint::State::Moved; ++ else if (type == "touchEnd"_s) ++ state = WebPlatformTouchPoint::State::Released; ++ else if (type == "touchCancel"_s) ++ state = WebPlatformTouchPoint::State::Cancelled; ++ else { ++ callback->sendFailure("Unsupported event type"_s); ++ return; ++ } ++ ++ Vector touchPoints; ++ for (unsigned i = 0; i < in_touchPoints->length(); ++i) { ++ RefPtr item = in_touchPoints->get(i); ++ RefPtr obj = item->asObject(); ++ if (!obj) { ++ callback->sendFailure("Invalid TouchPoint format"_s); ++ return; ++ } ++ std::optional x = obj->getInteger("x"_s); ++ if (!x) { ++ callback->sendFailure("TouchPoint does not have x"_s); ++ return; ++ } ++ std::optional y = obj->getInteger("y"_s); ++ if (!y) { ++ callback->sendFailure("TouchPoint does not have y"_s); ++ return; ++ } ++ std::optional optionalId = obj->getInteger("id"_s); ++ int id = optionalId ? *optionalId : 0; ++ const WebCore::IntPoint position(*x, *y); ++ touchPoints.append(WebPlatformTouchPoint(id, state, position, position, radius, rotationAngle, force)); ++ } ++ ++ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, WallTime::now()}, WTFMove(touchPoints)); ++ m_page.legacyMainFrameProcess().sendWithAsyncReply(Messages::WebPage::TouchEvent(touchEvent), [callback] (std::optional eventType, bool) { ++ if (!eventType) { ++ callback->sendFailure("Failed to dispatch touch event."_s); ++ return; ++ } ++ callback->sendSuccess(); ++ }, m_page.webPageIDInMainFrameProcess()); +} + +void WebPageInspectorInputAgent::dispatchWheelEvent(int x, int y, std::optional&& modifiers, std::optional&& deltaX, std::optional&& deltaY, Ref&& callback) @@ -16697,10 +17282,10 @@ index 0000000000000000000000000000000000000000..f4519d0655e1e92e6d47a9e59cf01b0f +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..3e87bf40ced2301f4fb145c6cb31f2cf7fa15dd6 +index 0000000000000000000000000000000000000000..26a2a3c0791c334f811ec99a630314f8e8521d02 --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h -@@ -0,0 +1,86 @@ +@@ -0,0 +1,87 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -16765,6 +17350,7 @@ index 0000000000000000000000000000000000000000..3e87bf40ced2301f4fb145c6cb31f2cf + void dispatchKeyEvent(const String& type, std::optional&& modifiers, const String& text, const String& unmodifiedText, const String& code, const String& key, std::optional&& windowsVirtualKeyCode, std::optional&& nativeVirtualKeyCode, std::optional&& autoRepeat, std::optional&& isKeypad, std::optional&& isSystemKey, RefPtr&&, Ref&& callback) override; + void dispatchMouseEvent(const String& type, int x, int y, std::optional&& modifiers, const String& button, std::optional&& buttons, std::optional&& clickCount, std::optional&& deltaX, std::optional&& deltaY, Ref&& callback) override; + void dispatchTapEvent(int x, int y, std::optional&& modifiers, Ref&& callback) override; ++ void dispatchTouchEvent(const String& type, std::optional&& modifiers, RefPtr&& touchPoints, Ref&& callback) override; + void dispatchWheelEvent(int x, int y, std::optional&& modifiers, std::optional&& deltaX, std::optional&& deltaY, Ref&& callback) override; + +private: @@ -16788,10 +17374,10 @@ index 0000000000000000000000000000000000000000..3e87bf40ced2301f4fb145c6cb31f2cf + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp -index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453d4592996 100644 +index f96981fa78e5d08faeaa261cf4ccb64e1c9241f8..a112a30315ed7708ea140c876d10ce14e4716584 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit/UIProcess/WebPageProxy.cpp -@@ -185,12 +185,14 @@ +@@ -190,12 +190,14 @@ #include #include #include @@ -16806,7 +17392,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 #include #include #include -@@ -211,6 +213,7 @@ +@@ -216,6 +218,7 @@ #include #include #include @@ -16814,7 +17400,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 #include #include #include -@@ -218,11 +221,13 @@ +@@ -223,12 +226,15 @@ #include #include #include @@ -16826,9 +17412,11 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 #include +#include #include ++#include #include #include -@@ -298,6 +303,9 @@ + #include +@@ -310,6 +316,9 @@ #include "AcceleratedBackingStoreDMABuf.h" #endif #include "GtkSettingsManager.h" @@ -16838,7 +17426,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 #include #endif -@@ -419,6 +427,8 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; +@@ -432,6 +441,8 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; static constexpr Seconds audibleActivityClearDelay = 10_s; #endif @@ -16847,7 +17435,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webPageProxyCounter, ("WebPageProxy")); #if PLATFORM(COCOA) -@@ -823,6 +833,10 @@ WebPageProxy::~WebPageProxy() +@@ -846,6 +857,10 @@ WebPageProxy::~WebPageProxy() if (preferences->mediaSessionCoordinatorEnabled()) GroupActivitiesSessionNotifier::sharedNotifier().removeWebPage(*this); #endif @@ -16858,7 +17446,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 } void WebPageProxy::addAllMessageReceivers() -@@ -1361,6 +1375,7 @@ void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason) +@@ -1414,6 +1429,7 @@ void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason) protectedPageClient()->didRelaunchProcess(); internals().pageLoadState.didSwapWebProcesses(); @@ -16866,7 +17454,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 } void WebPageProxy::didAttachToRunningProcess() -@@ -1369,7 +1384,7 @@ void WebPageProxy::didAttachToRunningProcess() +@@ -1422,7 +1438,7 @@ void WebPageProxy::didAttachToRunningProcess() #if ENABLE(FULLSCREEN_API) ASSERT(!m_fullScreenManager); @@ -16875,8 +17463,8 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 #endif #if ENABLE(VIDEO_PRESENTATION_MODE) ASSERT(!m_playbackSessionManager); -@@ -1764,6 +1779,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess() - return m_process; +@@ -1823,6 +1839,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess() + return m_legacyMainFrameProcess; } +RefPtr WebPageProxy::loadRequestForInspector(WebCore::ResourceRequest&& request, WebFrameProxy* frame) @@ -16884,20 +17472,20 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 + if (!frame || frame == mainFrame()) + return loadRequest(WTFMove(request), WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow); + -+ auto navigation = m_navigationState->createLoadRequestNavigation(process().coreProcessIdentifier(), ResourceRequest(request), m_backForwardList->currentItem()); ++ auto navigation = m_navigationState->createLoadRequestNavigation(legacyMainFrameProcess().coreProcessIdentifier(), ResourceRequest(request), m_backForwardList->currentItem()); + LoadParameters loadParameters; + loadParameters.navigationID = navigation->navigationID(); + loadParameters.request = WTFMove(request); + loadParameters.shouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow; + loadParameters.shouldTreatAsContinuingLoad = ShouldTreatAsContinuingLoad::No; -+ m_process->send(Messages::WebPage::LoadRequestInFrameForInspector(WTFMove(loadParameters), frame->frameID()), internals().webPageID); ++ m_legacyMainFrameProcess->send(Messages::WebPage::LoadRequestInFrameForInspector(WTFMove(loadParameters), frame->frameID()), internals().webPageID); + return navigation; +} + RefPtr WebPageProxy::loadRequest(ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData) { if (m_isClosed) -@@ -2336,6 +2366,42 @@ void WebPageProxy::setControlledByAutomation(bool controlled) +@@ -2422,6 +2453,61 @@ void WebPageProxy::setControlledByAutomation(bool controlled) websiteDataStore().protectedNetworkProcess()->send(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation), 0); } @@ -16912,6 +17500,25 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 + m_permissionsForAutomation = permissions; +} + ++static inline WebCore::ScreenOrientationType toScreenOrientationType(int angle) ++{ ++ if (angle == -90) ++ return WebCore::ScreenOrientationType::LandscapeSecondary; ++ if (angle == 180) ++ return WebCore::ScreenOrientationType::PortraitSecondary; ++ if (angle == 90) ++ return WebCore::ScreenOrientationType::LandscapePrimary; ++ return WebCore::ScreenOrientationType::PortraitPrimary; ++} ++ ++void WebPageProxy::setOrientationOverride(std::optional&& angle) ++{ ++ auto deviceOrientation = toScreenOrientationType(angle.value_or(0)); ++ if (m_screenOrientationManager) ++ m_screenOrientationManager->setCurrentOrientation(deviceOrientation); ++ m_legacyMainFrameProcess->send(Messages::WebPage::SetDeviceOrientation(angle.value_or(0)), webPageIDInMainFrameProcess()); ++} ++ +std::optional WebPageProxy::permissionForAutomation(const String& origin, const String& permission) const +{ + auto permissions = m_permissionsForAutomation.find(origin); @@ -16937,10 +17544,10 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 + fprintf(stderr, "RENDERER: %s\n", str.utf8().data()); +} + - void WebPageProxy::createInspectorTarget(const String& targetId, Inspector::InspectorTargetType type) + void WebPageProxy::createInspectorTarget(IPC::Connection& connection, const String& targetId, Inspector::InspectorTargetType type) { - MESSAGE_CHECK(m_process, !targetId.isEmpty()); -@@ -2577,6 +2643,24 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) + MESSAGE_CHECK_BASE(!targetId.isEmpty(), &connection); +@@ -2663,6 +2749,24 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) bool wasVisible = isViewVisible(); Ref pageClient = this->pageClient(); internals().activityState.remove(flagsToUpdate); @@ -16965,7 +17572,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 if (flagsToUpdate & ActivityState::IsFocused && pageClient->isViewFocused()) internals().activityState.add(ActivityState::IsFocused); if (flagsToUpdate & ActivityState::WindowIsActive && pageClient->isViewWindowActive()) -@@ -3302,7 +3386,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt +@@ -3401,7 +3505,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt grantAccessToCurrentPasteboardData(dragStorageName); #endif @@ -16974,7 +17581,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 performDragControllerAction(DragControllerAction::PerformDragOperation, dragData); #else if (!hasRunningProcess()) -@@ -3319,6 +3403,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag +@@ -3418,6 +3522,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag if (!hasRunningProcess()) return; @@ -16983,16 +17590,16 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 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 (!remoteUserInputEventData) { didPerformDragControllerAction(dragOperation, dragHandlingMethod, mouseIsOverFileInput, numberOfItemsToBeAccepted, insertionRect, editableElementRect); -@@ -3335,6 +3421,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag - protectedProcess()->assumeReadAccessToBaseURL(*this, url); +@@ -3427,7 +3533,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag + performDragControllerAction(action, dragData, remoteUserInputEventData->targetFrameID); + }; - ASSERT(dragData.platformData()); -+#endif +-#if PLATFORM(GTK) +#if PLATFORM(GTK) || PLATFORM(WPE) - sendWithAsyncReply(Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags()), WTFMove(completionHandler)); - #else - sendToProcessContainingFrame(frameID, Messages::WebPage::PerformDragControllerAction(frameID, action, dragData), WTFMove(completionHandler)); -@@ -3350,14 +3438,34 @@ void WebPageProxy::didPerformDragControllerAction(std::optionaldidPerformDragControllerAction(); @@ -17030,7 +17637,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 didStartDrag(); } #endif -@@ -3378,6 +3486,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo +@@ -3477,6 +3603,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo setDragCaretRect({ }); } @@ -17055,7 +17662,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 void WebPageProxy::didStartDrag() { if (!hasRunningProcess()) -@@ -3385,6 +3511,16 @@ void WebPageProxy::didStartDrag() +@@ -3484,6 +3628,16 @@ void WebPageProxy::didStartDrag() discardQueuedMouseEvents(); send(Messages::WebPage::DidStartDrag()); @@ -17072,7 +17679,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 } void WebPageProxy::dragCancelled() -@@ -3540,16 +3676,37 @@ void WebPageProxy::processNextQueuedMouseEvent() +@@ -3622,16 +3776,37 @@ void WebPageProxy::processNextQueuedMouseEvent() process->startResponsivenessTimer(); } @@ -17111,21 +17718,21 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 + m_dragSelectionData = std::nullopt; + dragEnded(event.position(), event.globalPosition(), m_dragSourceOperationMask); + } -+ didReceiveEvent(eventType, true); ++ didReceiveEvent(eventType, true, std::nullopt); + } } void WebPageProxy::doAfterProcessingAllPendingMouseEvents(WTF::Function&& action) -@@ -3715,6 +3872,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) +@@ -3802,6 +3977,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) - if (RefPtr automationSession = process().processPool().automationSession()) + if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->wheelEventsFlushedForPage(*this); + + m_inspectorController->didProcessAllPendingWheelEvents(); } void WebPageProxy::cacheWheelEventScrollingAccelerationCurve(const NativeWebWheelEvent& nativeWheelEvent) -@@ -3863,7 +4022,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) +@@ -3940,7 +4117,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent) { @@ -17134,7 +17741,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 for (auto& touchPoint : touchStartEvent.touchPoints()) { auto location = touchPoint.location(); auto update = [this, location](TrackingType& trackingType, EventTrackingRegions::EventType eventType) { -@@ -4460,6 +4619,7 @@ void WebPageProxy::receivedNavigationActionPolicyDecision(WebProcessProxy& proce +@@ -4547,6 +4724,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) { @@ -17142,19 +17749,20 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 if (!hasRunningProcess()) return completionHandler(PolicyDecision { }); -@@ -5382,6 +5542,11 @@ void WebPageProxy::pageScaleFactorDidChange(double scaleFactor) +@@ -5478,6 +5656,12 @@ void WebPageProxy::pageScaleFactorDidChange(IPC::Connection& connection, double m_pageScaleFactor = scaleFactor; } -+void WebPageProxy::viewScaleFactorDidChange(double scaleFactor) ++void WebPageProxy::viewScaleFactorDidChange(IPC::Connection& connection, double scaleFactor) +{ ++ MESSAGE_CHECK_BASE(scaleFactorIsValid(scaleFactor), &connection); + m_viewScaleFactor = scaleFactor; +} + - void WebPageProxy::pluginScaleFactorDidChange(double pluginScaleFactor) + void WebPageProxy::pluginScaleFactorDidChange(IPC::Connection& connection, double pluginScaleFactor) { - MESSAGE_CHECK(m_process, scaleFactorIsValid(pluginScaleFactor)); -@@ -5935,6 +6100,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, ui + MESSAGE_CHECK_BASE(scaleFactorIsValid(pluginScaleFactor), &connection); +@@ -6033,6 +6217,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, ui Ref protectedPageClient { pageClient() }; m_navigationState->didDestroyNavigation(process->coreProcessIdentifier(), navigationID); @@ -17162,7 +17770,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 } void WebPageProxy::didStartProvisionalLoadForFrame(FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, uint64_t navigationID, URL&& url, URL&& unreachableURL, const UserData& userData) -@@ -6189,6 +6355,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p +@@ -6300,6 +6485,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p m_failingProvisionalLoadURL = { }; @@ -17171,23 +17779,23 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 // 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; -@@ -6834,7 +7002,14 @@ void WebPageProxy::beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListen +@@ -6967,7 +7154,14 @@ void WebPageProxy::beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListen void WebPageProxy::decidePolicyForNavigationActionAsync(NavigationActionData&& data, CompletionHandler&& completionHandler) { -- decidePolicyForNavigationActionAsyncShared(protectedProcess(), WTFMove(data), WTFMove(completionHandler)); +- decidePolicyForNavigationActionAsyncShared(protectedLegacyMainFrameProcess(), WTFMove(data), WTFMove(completionHandler)); + if (m_inspectorController->shouldPauseLoading()) { -+ decidePolicyForNavigationActionAsyncShared(protectedProcess(), WTFMove(data), WTFMove(completionHandler)); ++ decidePolicyForNavigationActionAsyncShared(protectedLegacyMainFrameProcess(), WTFMove(data), WTFMove(completionHandler)); + m_inspectorController->setContinueLoadingCallback([this, protectedThis = Ref { *this }, data = WTFMove(data), completionHandler = WTFMove(completionHandler)] () mutable { -+ decidePolicyForNavigationActionAsyncShared(protectedProcess(), WTFMove(data), WTFMove(completionHandler)); ++ decidePolicyForNavigationActionAsyncShared(protectedLegacyMainFrameProcess(), WTFMove(data), WTFMove(completionHandler)); + }); + } else { -+ decidePolicyForNavigationActionAsyncShared(protectedProcess(), WTFMove(data), WTFMove(completionHandler)); ++ decidePolicyForNavigationActionAsyncShared(protectedLegacyMainFrameProcess(), WTFMove(data), WTFMove(completionHandler)); + } } void WebPageProxy::decidePolicyForNavigationActionAsyncShared(Ref&& process, NavigationActionData&& data, CompletionHandler&& completionHandler) -@@ -7474,6 +7649,7 @@ void WebPageProxy::createNewPage(WindowFeatures&& windowFeatures, NavigationActi +@@ -7631,6 +7825,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w if (RefPtr page = originatingFrameInfo->page()) openerAppInitiatedState = page->lastNavigationWasAppInitiated(); @@ -17195,7 +17803,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 auto completionHandler = [ this, protectedThis = Ref { *this }, -@@ -7540,6 +7716,7 @@ void WebPageProxy::createNewPage(WindowFeatures&& windowFeatures, NavigationActi +@@ -7703,6 +7898,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w void WebPageProxy::showPage() { m_uiClient->showPage(this); @@ -17203,7 +17811,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 } bool WebPageProxy::hasOpenedPage() const -@@ -7621,6 +7798,10 @@ void WebPageProxy::closePage() +@@ -7813,6 +8009,10 @@ void WebPageProxy::closePage() if (isClosed()) return; @@ -17214,7 +17822,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 WEBPAGEPROXY_RELEASE_LOG(Process, "closePage:"); protectedPageClient()->clearAllEditCommands(); m_uiClient->close(this); -@@ -7657,6 +7838,8 @@ void WebPageProxy::runJavaScriptAlert(FrameIdentifier frameID, FrameInfoData&& f +@@ -7849,6 +8049,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 { @@ -17223,8 +17831,8 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 page.m_uiClient->runJavaScriptAlert(page, message, frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)]() mutable { reply(); completion(); -@@ -7678,6 +7861,8 @@ void WebPageProxy::runJavaScriptConfirm(FrameIdentifier frameID, FrameInfoData&& - if (RefPtr automationSession = process().processPool().automationSession()) +@@ -7870,6 +8072,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti + if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this); } + if (m_inspectorDialogAgent) @@ -17232,8 +17840,8 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 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 { -@@ -7701,6 +7886,8 @@ void WebPageProxy::runJavaScriptPrompt(FrameIdentifier frameID, FrameInfoData&& - if (RefPtr automationSession = process().processPool().automationSession()) +@@ -7893,6 +8097,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif + if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this); } + if (m_inspectorDialogAgent) @@ -17241,7 +17849,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 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 { -@@ -7817,6 +8004,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(FrameIdentifier frameID, FrameInf +@@ -8009,6 +8215,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram return; } } @@ -17249,8 +17857,8 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 + 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. - protectedProcess()->stopResponsivenessTimer(); -@@ -8307,6 +8496,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, + protectedLegacyMainFrameProcess()->stopResponsivenessTimer(); +@@ -8501,6 +8709,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, } #if ENABLE(FULLSCREEN_API) @@ -17262,9 +17870,9 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 WebFullScreenManagerProxy* WebPageProxy::fullScreenManager() { return m_fullScreenManager.get(); -@@ -8383,6 +8577,17 @@ void WebPageProxy::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAc - { - MESSAGE_CHECK_COMPLETION(m_process, !originIdentifier.isEmpty(), completionHandler(DOMPasteAccessResponse::DeniedForGesture)); +@@ -8606,6 +8819,17 @@ void WebPageProxy::requestDOMPasteAccess(DOMPasteAccessCategory pasteAccessCateg + } + } + if (isControlledByAutomation()) { + DOMPasteAccessResponse response = DOMPasteAccessResponse::DeniedForGesture; @@ -17277,11 +17885,11 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 + return; + } + - m_pageClient->requestDOMPasteAccess(pasteAccessCategory, elementRect, originIdentifier, WTFMove(completionHandler)); + m_pageClient->requestDOMPasteAccess(pasteAccessCategory, requiresInteraction, elementRect, originIdentifier, WTFMove(completionHandler)); } -@@ -9232,6 +9437,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event - if (RefPtr automationSession = process().processPool().automationSession()) +@@ -9461,6 +9685,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event + if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->mouseEventsFlushedForPage(*this); didFinishProcessingAllPendingMouseEvents(); + if (m_dragEventsQueued == 0) @@ -17289,15 +17897,15 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 } } -@@ -9266,6 +9473,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy +@@ -9495,6 +9721,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy if (!canProcessMoreKeyEvents) { - if (RefPtr automationSession = process().processPool().automationSession()) + if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->keyboardEventsFlushedForPage(*this); + m_inspectorController->didProcessAllPendingKeyboardEvents(); } } -@@ -9671,7 +9879,10 @@ void WebPageProxy::dispatchProcessDidTerminate(ProcessTerminationReason reason) +@@ -9906,7 +10133,10 @@ void WebPageProxy::dispatchProcessDidTerminate(ProcessTerminationReason reason) { WEBPAGEPROXY_RELEASE_LOG_ERROR(Loading, "dispatchProcessDidTerminate: reason=%" PUBLIC_LOG_STRING, processTerminationReasonToString(reason).characters()); @@ -17309,15 +17917,15 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 if (m_loaderClient) handledByClient = reason != ProcessTerminationReason::RequestedByClient && m_loaderClient->processDidCrash(*this); else -@@ -10041,6 +10252,7 @@ bool WebPageProxy::useGPUProcessForDOMRenderingEnabled() const +@@ -10292,6 +10522,7 @@ bool WebPageProxy::useGPUProcessForDOMRenderingEnabled() const - WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& process, DrawingAreaProxy& drawingArea, std::optional&& subframeProcessPageParameters, bool isProcessSwap, RefPtr&& websitePolicies, std::optional&& mainFrameIdentifier, std::optional topContentInset) + WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& process, DrawingAreaProxy& drawingArea, std::optional&& remotePageParameters, bool isProcessSwap, RefPtr&& websitePolicies, std::optional&& mainFrameIdentifier) { + WebPageCreationParameters parameters; parameters.processDisplayName = configuration().processDisplayName(); -@@ -10267,6 +10479,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc +@@ -10516,6 +10747,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc parameters.httpsUpgradeEnabled = preferences().upgradeKnownHostsToHTTPSEnabled() ? m_configuration->httpsUpgradeEnabled() : false; @@ -17326,9 +17934,9 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 #if PLATFORM(IOS) || PLATFORM(VISION) // FIXME: This is also being passed over the to WebProcess via the PreferencesStore. parameters.allowsDeprecatedSynchronousXMLHttpRequestDuringUnload = allowsDeprecatedSynchronousXMLHttpRequestDuringUnload(); -@@ -10373,8 +10587,42 @@ void WebPageProxy::gamepadActivity(const Vector>& gam +@@ -10648,8 +10881,42 @@ void WebPageProxy::gamepadsRecentlyAccessed() - #endif + #endif // ENABLE(GAMEPAD) +bool WebPageProxy::shouldSendAutomationCredentialsForProtectionSpace(const WebProtectionSpace& protectionSpace) +{ @@ -17369,7 +17977,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes) { m_navigationClient->shouldAllowLegacyTLS(*this, authenticationChallenge.get(), [this, protectedThis = Ref { *this }, authenticationChallenge] (bool shouldAllowLegacyTLS) { if (shouldAllowLegacyTLS) -@@ -10469,6 +10717,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(GeolocationIdentifier ge +@@ -10744,6 +11011,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect request->deny(); }; @@ -17382,7 +17990,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 // 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 -@@ -10531,6 +10785,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi +@@ -10806,6 +11079,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi shouldChangeDeniedToPrompt = false; if (sessionID().isEphemeral()) { @@ -17395,7 +18003,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); return; } -@@ -10545,6 +10805,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi +@@ -10820,6 +11099,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi return; } @@ -17409,7 +18017,7 @@ index 365c5e2c7925347531f2e488d720973612f25d39..585c51dd017a628f08d443c863fd1453 completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); return; diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h -index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8f0aa3a6c 100644 +index 1c4d43a5025741a37708e99c398f03836de80182..df2e31590e9936525cb5037ea4456237a938de91 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.h +++ b/Source/WebKit/UIProcess/WebPageProxy.h @@ -26,6 +26,7 @@ @@ -17418,9 +18026,9 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 #include "APIObject.h" +#include "APIWebsitePolicies.h" #include "MessageReceiver.h" - #include "MessageSender.h" #include -@@ -36,6 +37,24 @@ + #include +@@ -37,6 +38,20 @@ #include #include #include @@ -17435,17 +18043,13 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 + +OBJC_CLASS NSPasteboard; + -+#if PLATFORM(WPE) -+#include "ArgumentCodersWPE.h" -+#endif -+ +#if PLATFORM(GTK) || PLATFORM(WPE) +#include +#endif #if USE(DICTATION_ALTERNATIVES) #include -@@ -106,6 +125,7 @@ class DestinationColorSpace; +@@ -112,6 +127,7 @@ class DestinationColorSpace; class DragData; class FloatPoint; class FloatQuad; @@ -17453,7 +18057,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 class FloatRect; class FloatSize; class FontAttributeChanges; -@@ -421,6 +441,7 @@ class WebExtensionController; +@@ -446,6 +462,7 @@ class WebExtensionController; class WebFramePolicyListenerProxy; class WebFrameProxy; class WebFullScreenManagerProxy; @@ -17461,7 +18065,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 class WebInspectorUIProxy; class WebKeyboardEvent; class WebMouseEvent; -@@ -649,6 +670,8 @@ public: +@@ -674,6 +691,8 @@ public: void setControlledByAutomation(bool); WebPageInspectorController& inspectorController() { return *m_inspectorController; } @@ -17470,7 +18074,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 #if PLATFORM(IOS_FAMILY) void showInspectorIndication(); -@@ -682,6 +705,7 @@ public: +@@ -707,6 +726,7 @@ public: bool hasSleepDisabler() const; #if ENABLE(FULLSCREEN_API) @@ -17478,19 +18082,20 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 WebFullScreenManagerProxy* fullScreenManager(); API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; } -@@ -770,6 +794,11 @@ public: +@@ -795,6 +815,12 @@ public: void setPageLoadStateObserver(std::unique_ptr&&); + void setAuthCredentialsForAutomation(std::optional&&, std::optional&&); + void setPermissionsForAutomation(const HashMap>&); ++ void setOrientationOverride(std::optional&& angle); + void setActiveForAutomation(std::optional active); + void logToStderr(const String& str); + void initializeWebPage(); void setDrawingArea(std::unique_ptr&&); -@@ -796,6 +825,7 @@ public: +@@ -821,6 +847,7 @@ public: void addPlatformLoadParameters(WebProcessProxy&, LoadParameters&); RefPtr loadRequest(WebCore::ResourceRequest&&); RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData = nullptr); @@ -17498,23 +18103,23 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 RefPtr loadFile(const String& fileURL, const String& resourceDirectoryURL, bool isAppInitiated = true, API::Object* userData = nullptr); RefPtr loadData(std::span, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr); RefPtr loadData(std::span, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldOpenExternalURLsPolicy); -@@ -862,6 +892,7 @@ public: - +@@ -888,6 +915,7 @@ public: PageClient& pageClient() const; Ref protectedPageClient() const; + RefPtr optionalProtectedPageClient() const; + bool hasPageClient() const { return !!m_pageClient; } void setViewNeedsDisplay(const WebCore::Region&); void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated); -@@ -1389,6 +1420,7 @@ public: +@@ -1414,6 +1442,7 @@ public: #endif - void pageScaleFactorDidChange(double); -+ void viewScaleFactorDidChange(double); - void pluginScaleFactorDidChange(double); - void pluginZoomFactorDidChange(double); + void pageScaleFactorDidChange(IPC::Connection&, double); ++ void viewScaleFactorDidChange(IPC::Connection&, double); + void pluginScaleFactorDidChange(IPC::Connection&, double); + void pluginZoomFactorDidChange(IPC::Connection&, double); -@@ -1473,14 +1505,20 @@ public: +@@ -1498,14 +1527,20 @@ public: void didStartDrag(); void dragCancelled(); void setDragCaretRect(const WebCore::IntRect&); @@ -17522,7 +18127,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 + bool cancelDragIfNeeded(); #if PLATFORM(COCOA) void startDrag(const WebCore::DragItem&, WebCore::ShareableBitmapHandle&& dragImageHandle); - void setPromisedDataForImage(const String& pasteboardName, WebCore::SharedMemoryHandle&& imageHandle, const String& filename, const String& extension, + void setPromisedDataForImage(IPC::Connection&, const String& pasteboardName, WebCore::SharedMemoryHandle&& imageHandle, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL, WebCore::SharedMemoryHandle&& archiveHandle, const String& originIdentifier); + void releaseInspectorDragPasteboard(); #endif @@ -17536,7 +18141,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 #endif void processDidBecomeUnresponsive(); -@@ -1713,6 +1751,7 @@ public: +@@ -1739,6 +1774,7 @@ public: void setViewportSizeForCSSViewportUnits(const WebCore::FloatSize&); WebCore::FloatSize viewportSizeForCSSViewportUnits() const; @@ -17544,7 +18149,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 void didReceiveAuthenticationChallengeProxy(Ref&&, NegotiatedLegacyTLS); void negotiatedLegacyTLS(); void didNegotiateModernTLS(const URL&); -@@ -1747,6 +1786,8 @@ public: +@@ -1771,6 +1807,8 @@ public: #if PLATFORM(COCOA) || PLATFORM(GTK) RefPtr takeViewSnapshot(std::optional&&); @@ -17552,8 +18157,8 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 + RefPtr takeViewSnapshot(std::optional&&) { return nullptr; } #endif - void wrapCryptoKey(const Vector&, CompletionHandler>&&)>&&); -@@ -2639,6 +2680,7 @@ private: + void wrapCryptoKey(Vector&&, CompletionHandler>&&)>&&); +@@ -2672,6 +2710,7 @@ private: RefPtr launchProcessForReload(); void requestNotificationPermission(const String& originString, CompletionHandler&&); @@ -17561,7 +18166,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 void didChangeContentSize(const WebCore::IntSize&); void didChangeIntrinsicContentSize(const WebCore::IntSize&); -@@ -3145,8 +3187,10 @@ private: +@@ -3191,8 +3230,10 @@ private: String m_overrideContentSecurityPolicy; RefPtr m_inspector; @@ -17572,7 +18177,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 std::unique_ptr m_fullScreenManager; std::unique_ptr m_fullscreenClient; #endif -@@ -3336,6 +3380,22 @@ private: +@@ -3384,6 +3425,22 @@ private: std::optional m_currentDragOperation; bool m_currentDragIsOverFileInput { false }; unsigned m_currentDragNumberOfFilesToBeAccepted { 0 }; @@ -17595,7 +18200,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 #endif bool m_mainFrameHasHorizontalScrollbar { false }; -@@ -3507,6 +3567,10 @@ private: +@@ -3555,6 +3612,10 @@ private: RefPtr messageBody; }; Vector m_pendingInjectedBundleMessages; @@ -17607,7 +18212,7 @@ index 2e40bbb43a05c10eee30296c5a7febdcdb74c157..4deb131a7c531d9035833f22062cf9e8 #if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION) std::unique_ptr m_webDeviceOrientationUpdateProviderProxy; diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in -index 3907e52e0136c24b8cdc24cb6e178b201e3e482a..03ef59a3032b12f91dcdd4a1160c7c8ef12cc0e3 100644 +index 488af1f4066de0b8adaa595cb2f4028fbce4b177..529a1b8d2f2b0dd9face3ce38cf68758ce381d2f 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in @@ -29,6 +29,7 @@ messages -> WebPageProxy { @@ -17617,7 +18222,7 @@ index 3907e52e0136c24b8cdc24cb6e178b201e3e482a..03ef59a3032b12f91dcdd4a1160c7c8e + LogToStderr(String text) DidChangeViewportProperties(struct WebCore::ViewportAttributes attributes) - DidReceiveEvent(enum:uint8_t WebKit::WebEventType eventType, bool handled) + DidReceiveEvent(enum:uint8_t WebKit::WebEventType eventType, bool handled, struct std::optional remoteUserInputEventData) @@ -182,6 +183,7 @@ messages -> WebPageProxy { #endif @@ -17626,7 +18231,7 @@ index 3907e52e0136c24b8cdc24cb6e178b201e3e482a..03ef59a3032b12f91dcdd4a1160c7c8e PluginScaleFactorDidChange(double zoomFactor) PluginZoomFactorDidChange(double zoomFactor) -@@ -309,10 +311,14 @@ messages -> WebPageProxy { +@@ -305,10 +307,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 @@ -17658,10 +18263,10 @@ index c909cd634d6acd72695de8372866691269ad6a04..ff5b37e3b4a17eab4bd3f8e9a2a6ef84 } diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp -index f997e69f867ecaa6ec60a94a21ac89d51de413a4..78008ea36f1d08948c671fdfeeef08b30c7fc7fa 100644 +index c3ff67230baf4dec44f5d7232a8351ec1f77b79c..3fed70aa8f568cd9a3a4fa460ed565658405f63f 100644 --- a/Source/WebKit/UIProcess/WebProcessPool.cpp +++ b/Source/WebKit/UIProcess/WebProcessPool.cpp -@@ -430,10 +430,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& +@@ -426,10 +426,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& void WebProcessPool::setOverrideLanguages(Vector&& languages) { @@ -17674,7 +18279,7 @@ index f997e69f867ecaa6ec60a94a21ac89d51de413a4..78008ea36f1d08948c671fdfeeef08b3 #if ENABLE(GPU_PROCESS) if (RefPtr gpuProcess = GPUProcessProxy::singletonIfCreated()) -@@ -441,9 +441,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) +@@ -437,9 +437,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) #endif #if USE(SOUP) for (Ref networkProcess : NetworkProcessProxy::allNetworkProcesses()) @@ -17686,7 +18291,7 @@ index f997e69f867ecaa6ec60a94a21ac89d51de413a4..78008ea36f1d08948c671fdfeeef08b3 void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled) { -@@ -936,7 +937,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa +@@ -925,7 +926,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa #endif parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel(); @@ -17696,10 +18301,10 @@ index f997e69f867ecaa6ec60a94a21ac89d51de413a4..78008ea36f1d08948c671fdfeeef08b3 parameters.urlSchemesRegisteredAsEmptyDocument = copyToVector(m_schemesToRegisterAsEmptyDocument); diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp -index b8305771145ecb6b92e28de1bcb370dc8ccbba0d..d3b591bc81ccd07367223270c545056fbdb51f49 100644 +index 9411228a77d83f24384a0b9cf57f44351b48d75e..3510caa0b246b9794977f4fc99efddc9de1aceee 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.cpp +++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp -@@ -188,6 +188,11 @@ Vector> WebProcessProxy::allProcesses() +@@ -189,6 +189,11 @@ Vector> WebProcessProxy::allProcesses() }); } @@ -17711,7 +18316,7 @@ index b8305771145ecb6b92e28de1bcb370dc8ccbba0d..d3b591bc81ccd07367223270c545056f RefPtr WebProcessProxy::processForIdentifier(ProcessIdentifier identifier) { return allProcessMap().get(identifier); -@@ -555,6 +560,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt +@@ -562,6 +567,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt if (WebKit::isInspectorProcessPool(processPool())) launchOptions.extraInitializationData.add("inspector-process"_s, "1"_s); @@ -17739,22 +18344,22 @@ index b8305771145ecb6b92e28de1bcb370dc8ccbba0d..d3b591bc81ccd07367223270c545056f if (isPrewarmed()) diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h -index 92ebcbaf5abecd997e8bfd3cb5cb41b02191b7c5..bec4da91324e832f1dd027ad9e064a3336b3e047 100644 +index 7ac34410441b471cfe9bc3d9a96a7f082283813d..7a39d5f45d7b422330b8cd444ebe78cfa145c692 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.h +++ b/Source/WebKit/UIProcess/WebProcessProxy.h -@@ -166,6 +166,7 @@ public: +@@ -178,6 +178,7 @@ public: static void forWebPagesWithOrigin(PAL::SessionID, const WebCore::SecurityOriginData&, const Function&); static Vector> allowedFirstPartiesForCookies(); + static Vector> allProcessesForInspector(); - WebConnection* webConnection() const { return m_webConnection.get(); } - RefPtr protectedWebConnection() const { return m_webConnection; } + void initializeWebProcess(WebProcessCreationParameters&&); + diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -index 9729698017cabce150921532f0dd40e10634f0ce..9bb75eda6f3e5e0633d6ef55b3980f8ce35b2f2f 100644 +index 3311783c3e193b7b3e6f4b1aeddc40560308859a..ceb002bdce785ac39ed86c4f809813c32148bfc8 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -@@ -305,7 +305,8 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W +@@ -306,7 +306,8 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W static Ref networkProcessForSession(PAL::SessionID sessionID) { @@ -17764,7 +18369,7 @@ index 9729698017cabce150921532f0dd40e10634f0ce..9bb75eda6f3e5e0633d6ef55b3980f8c if (sessionID.isEphemeral()) { // Reuse a previous persistent session network process for ephemeral sessions. for (auto& dataStore : allDataStores().values()) { -@@ -2278,6 +2279,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin, +@@ -2279,6 +2280,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin, protectedNetworkProcess()->websiteDataOriginDirectoryForTesting(m_sessionID, WTFMove(origin), type, WTFMove(completionHandler)); } @@ -17864,10 +18469,10 @@ index 165885137ca032390c6b55baacc30a8c4c423eb5..930ceeca56587636993f9a0c0e0a21d0 std::unique_ptr m_soAuthorizationCoordinator; #endif diff --git a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp -index d02a8ad4cd66f7f277eee16d21e9ffb0e1a961db..ef35d46977b9b6a866b665e3a01eac94a648cc97 100644 +index 7c6139c6b0d8c7c3cddd08164317794a519a7b53..027d05bdd0e4bf94d70797ab195e656f81541300 100644 --- a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp +++ b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp -@@ -101,6 +101,14 @@ void GeoclueGeolocationProvider::stop() +@@ -102,6 +102,14 @@ void GeoclueGeolocationProvider::stop() } m_sourceType = LocationProviderSource::Unknown; @@ -17882,7 +18487,7 @@ index d02a8ad4cd66f7f277eee16d21e9ffb0e1a961db..ef35d46977b9b6a866b665e3a01eac94 } void GeoclueGeolocationProvider::setEnableHighAccuracy(bool enabled) -@@ -373,6 +381,8 @@ void GeoclueGeolocationProvider::createGeoclueClient(const char* clientPath) +@@ -374,6 +382,8 @@ void GeoclueGeolocationProvider::createGeoclueClient(const char* clientPath) return; } @@ -17907,10 +18512,10 @@ index 69610f8f7b81d914d74444d9c86b3b039251edb6..c234848afb5e523165bf827bac800848 RunLoop::Timer m_destroyLaterTimer; diff --git a/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..93de9be341045a616b0219a965af2447ecbfc926 +index 0000000000000000000000000000000000000000..379d57818019b28afa25c9ca3de32fde8e6b5e67 --- /dev/null +++ b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp -@@ -0,0 +1,184 @@ +@@ -0,0 +1,201 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -17944,12 +18549,18 @@ index 0000000000000000000000000000000000000000..93de9be341045a616b0219a965af2447 +#include "InspectorPlaywrightAgent.h" +#include "PageClient.h" +#include "ViewSnapshotStore.h" ++#include "WebAutomationSession.h" +#include "WebKitBrowserInspectorPrivate.h" +#include "WebKitWebContextPrivate.h" +#include "WebKitWebsiteDataManagerPrivate.h" +#include "WebKitWebViewPrivate.h" +#include "WebPageProxy.h" ++#if USE(CAIRO) +#include ++#endif ++#if USE(SKIA) ++#include ++#endif +#include +#include +#include @@ -18036,8 +18647,10 @@ index 0000000000000000000000000000000000000000..93de9be341045a616b0219a965af2447 +#endif + // WPE has PSON enabled by default and doesn't have such parameter. +#if PLATFORM(GTK) ++#if !ENABLE(2022_GLIB_API) + "process-swap-on-cross-site-navigation-enabled", true, +#endif ++#endif + nullptr))); + if (!context) { + error = "Failed to create GLib ephemeral context"_s; @@ -18073,12 +18686,21 @@ index 0000000000000000000000000000000000000000..93de9be341045a616b0219a965af2447 +void InspectorPlaywrightAgentClientGlib::takePageScreenshot(WebPageProxy& page, WebCore::IntRect&& clip, bool nominalResolution, CompletionHandler&& completionHandler) +{ + page.callAfterNextPresentationUpdate([protectedPage = Ref{ page }, clip = WTFMove(clip), nominalResolution, completionHandler = WTFMove(completionHandler)]() mutable { -+ cairo_surface_t* surface = nullptr; +#if PLATFORM(GTK) + RefPtr viewSnapshot = protectedPage->pageClient().takeViewSnapshot(WTFMove(clip), nominalResolution); -+ if (viewSnapshot) -+ surface = viewSnapshot->surface(); ++ if (viewSnapshot) { ++ std::optional data = WebAutomationSession::platformGetBase64EncodedPNGData(*viewSnapshot); ++ if (data) { ++ completionHandler(emptyString(), makeString("data:image/png;base64,"_s, *data)); ++ return; ++ } ++ } +#elif PLATFORM(WPE) ++#if USE(SKIA) ++ sk_sp protectPtr = protectedPage->pageClient().takeViewSnapshot(WTFMove(clip), nominalResolution); ++ SkImage* surface = protectPtr.get(); ++#elif USE(CAIRO) ++ cairo_surface_t* surface = nullptr; + RefPtr protectPtr = protectedPage->pageClient().takeViewSnapshot(WTFMove(clip), nominalResolution); + surface = protectPtr.get(); +#endif @@ -18087,7 +18709,7 @@ index 0000000000000000000000000000000000000000..93de9be341045a616b0219a965af2447 + completionHandler(emptyString(), makeString("data:image/png;base64,"_s, base64Encoded(encodeData))); + return; + } -+ ++#endif + completionHandler("Failed to take screenshot"_s, emptyString()); + }); +} @@ -18184,10 +18806,10 @@ index b02c70d85fe1a93899640a8b909b0cf734d28b18..b1dc8e89eb265be81e083bf337109561 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 bef1f57ad45eaef04640991d4afd34138b8d7b76..a37024640fbf6eb79838c039001ee1cf4907042e 100644 +index 66329bbc7f97ca577842dd93e28d4143b16e69dc..cd10bd6a29e64a1356e5a14a3a6339c4ca43327e 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp +++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -@@ -659,4 +659,30 @@ RendererBufferFormat AcceleratedBackingStoreDMABuf::bufferFormat() const +@@ -675,4 +675,30 @@ RendererBufferFormat AcceleratedBackingStoreDMABuf::bufferFormat() const return buffer ? buffer->format() : RendererBufferFormat { }; } @@ -18219,10 +18841,10 @@ index bef1f57ad45eaef04640991d4afd34138b8d7b76..a37024640fbf6eb79838c039001ee1cf + } // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h -index cd95ceb063fc776b5d68ff45262c4d84e572c509..041c562551cd467c320b8f566264885d00d1434b 100644 +index 68d4bb329c2e116fe720c98d3e38b6672c88e389..a4a36dd35ee9330f8b9edfb09f607a12dbac7c0b 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h +++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h -@@ -88,6 +88,7 @@ private: +@@ -90,6 +90,7 @@ private: #else bool paint(cairo_t*, const WebCore::IntRect&) override; #endif @@ -18230,9 +18852,9 @@ index cd95ceb063fc776b5d68ff45262c4d84e572c509..041c562551cd467c320b8f566264885d void unrealize() override; void update(const LayerTreeContext&) override; RendererBufferFormat bufferFormat() const override; -@@ -243,6 +244,9 @@ private: - RefPtr m_pendingBuffer; +@@ -246,6 +247,9 @@ private: RefPtr m_committedBuffer; + std::optional m_pendingDamageRegion; HashMap> m_buffers; +// Playwright begin + RefPtr m_flippedSurface; @@ -18242,10 +18864,10 @@ index cd95ceb063fc776b5d68ff45262c4d84e572c509..041c562551cd467c320b8f566264885d } // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/InspectorTargetProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/InspectorTargetProxyGtk.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..f5f811ced4eafef530d101c4e397fe2780ac3071 +index 0000000000000000000000000000000000000000..5a255b0389470c4fd1baaff5e8e4882ea0218e27 --- /dev/null +++ b/Source/WebKit/UIProcess/gtk/InspectorTargetProxyGtk.cpp -@@ -0,0 +1,44 @@ +@@ -0,0 +1,48 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -18282,7 +18904,11 @@ index 0000000000000000000000000000000000000000..f5f811ced4eafef530d101c4e397fe27 + +void InspectorTargetProxy::platformActivate(String& error) const +{ ++#if USE(GTK4) ++ GtkWidget* parent = GTK_WIDGET(gtk_widget_get_root(m_page.viewWidget())); ++#else + GtkWidget* parent = gtk_widget_get_toplevel(m_page.viewWidget()); ++#endif + if (WebCore::widgetIsOnscreenToplevelWindow(parent)) + gtk_window_present(GTK_WINDOW(parent)); + else @@ -18291,12 +18917,12 @@ index 0000000000000000000000000000000000000000..f5f811ced4eafef530d101c4e397fe27 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/WebDateTimePickerGtk.cpp b/Source/WebKit/UIProcess/gtk/WebDateTimePickerGtk.cpp -index 6029857cfcd6c4fea14de28243f1955138a62844..8a1bda8f2637670cf88baca998cbff09157d2a6f 100644 +index 97191083e1c5b5283599e394e56553fc5e5cd6a1..e8c7cbb6cd9431b1720aafb8dfd0abdc97f17a39 100644 --- a/Source/WebKit/UIProcess/gtk/WebDateTimePickerGtk.cpp +++ b/Source/WebKit/UIProcess/gtk/WebDateTimePickerGtk.cpp -@@ -34,6 +34,8 @@ - #include +@@ -35,6 +35,8 @@ #include + #include +using namespace WebCore; + @@ -18305,10 +18931,10 @@ index 6029857cfcd6c4fea14de28243f1955138a62844..8a1bda8f2637670cf88baca998cbff09 Ref WebDateTimePickerGtk::create(WebPageProxy& page) diff --git a/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..e5e25acebabb76a05a77db02a99f1267bd99a3af +index 0000000000000000000000000000000000000000..7d9672b0f831b5b7f6acf14ede26e1e8e9a65389 --- /dev/null +++ b/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp -@@ -0,0 +1,69 @@ +@@ -0,0 +1,117 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -18342,8 +18968,22 @@ index 0000000000000000000000000000000000000000..e5e25acebabb76a05a77db02a99f1267 +#include + +namespace WebKit { ++ ++#if USE(GTK4) ++bool windowHasManyTabs(GtkWidget* widget) { ++ for (GtkWidget* parent = gtk_widget_get_parent(widget); parent; parent = gtk_widget_get_parent(parent)) { ++ if (GTK_IS_NOTEBOOK(parent)) { ++ int pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(parent)); ++ return pages > 1; ++ } ++ } ++ return false; ++} ++#endif ++ +void WebPageInspectorEmulationAgent::platformSetSize(int width, int height, Function&& callback) +{ ++ WebCore::IntSize viewSize(width, height); + GtkWidget* viewWidget = m_page.viewWidget(); + GtkWidget* window = gtk_widget_get_toplevel(viewWidget); + if (!window) { @@ -18356,6 +18996,14 @@ index 0000000000000000000000000000000000000000..e5e25acebabb76a05a77db02a99f1267 + } + GtkAllocation viewAllocation; + gtk_widget_get_allocation(viewWidget, &viewAllocation); ++#if USE(GTK4) ++ // In GTK4 newly added tabs will have allocation size of 0x0, before the tab is shown. ++ // This is a Ctrl+click scenario. We invoke callback righ await to not stall. ++ if (!viewAllocation.width && !viewAllocation.height && windowHasManyTabs(viewWidget)) { ++ callback(String()); ++ return; ++ } ++#endif + if (viewAllocation.width == width && viewAllocation.height == height) { + callback(String()); + return; @@ -18368,22 +19016,48 @@ index 0000000000000000000000000000000000000000..e5e25acebabb76a05a77db02a99f1267 + height += windowAllocation.height - viewAllocation.height; + + if (auto* drawingArea = static_cast(m_page.drawingArea())) { -+ drawingArea->waitForSizeUpdate([callback = WTFMove(callback)]() { ++ bool didNotHaveInitialAllocation = !windowAllocation.width && !windowAllocation.height; ++ // The callback can only be called if the page is still alive, so we can safely capture `this`. ++ drawingArea->waitForSizeUpdate([this, callback = WTFMove(callback), didNotHaveInitialAllocation, viewSize](const DrawingAreaProxyCoordinatedGraphics& drawingArea) mutable { ++#if USE(GTK4) ++ if (viewSize == drawingArea.size()) { ++ callback(String()); ++ return; ++ } ++ if (didNotHaveInitialAllocation) { ++ // In gtk4 resize request may be lost (overridden by default one) if the window is not yet ++ // allocated when we are changing the size, so we try again. ++ platformSetSize(viewSize.width(), viewSize.height(), WTFMove(callback)); ++ return; ++ } ++ callback("Failed to resize window"_s); ++#else ++ UNUSED_PARAM(this); ++ UNUSED_PARAM(didNotHaveInitialAllocation); ++ UNUSED_PARAM(drawingArea); + callback(String()); ++#endif + }); + } else { + callback("No backing store for window"_s); + } ++#if USE(GTK4) ++ // Depending on whether default size has been applied or not, we need to ++ // do one of the calls, so we just do both. ++ gtk_window_set_default_size(GTK_WINDOW(window), width, height); ++ gtk_widget_set_size_request(window, width, height); ++#else + gtk_window_resize(GTK_WINDOW(window), width, height); ++#endif +} + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..6a204c5bba8fb95ddb2d1c14cae7a3a79610abc6 +index 0000000000000000000000000000000000000000..36ab6e9aec9f8d79fb13a8a49beadaafb3da58f5 --- /dev/null +++ b/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp -@@ -0,0 +1,105 @@ +@@ -0,0 +1,76 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -18419,22 +19093,6 @@ index 0000000000000000000000000000000000000000..6a204c5bba8fb95ddb2d1c14cae7a3a7 + +namespace WebKit { + -+static Vector commandsForKeyEvent(GdkEventType type, unsigned keyVal, unsigned state) -+{ -+ ASSERT(type == GDK_KEY_PRESS || type == GDK_KEY_RELEASE); -+ -+ GUniquePtr event(gdk_event_new(type)); -+ event->key.keyval = keyVal; -+ event->key.time = GDK_CURRENT_TIME; -+ event->key.state = state; -+ // When synthesizing an event, an invalid hardware_keycode value can cause it to be badly processed by GTK+. -+ GUniqueOutPtr keys; -+ int keysCount; -+ if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), keyVal, &keys.outPtr(), &keysCount) && keysCount) -+ event->key.hardware_keycode = keys.get()[0].keycode; -+ return KeyBindingTranslator().commandsForKeyEvent(&event->key); -+} -+ +static unsigned modifiersToEventState(OptionSet modifiers) +{ + unsigned state = 0; @@ -18454,21 +19112,8 @@ index 0000000000000000000000000000000000000000..6a204c5bba8fb95ddb2d1c14cae7a3a7 + Vector commands; + const guint keyVal = WebCore::PlatformKeyboardEvent::gdkKeyCodeForWindowsKeyCode(windowsVirtualKeyCode); + if (keyVal) { -+ GdkEventType event = GDK_NOTHING; -+ switch (type) -+ { -+ case WebEventType::KeyDown: -+ event = GDK_KEY_PRESS; -+ break; -+ case WebEventType::KeyUp: -+ event = GDK_KEY_RELEASE; -+ break; -+ default: -+ fprintf(stderr, "Unsupported event type = %d\n", type); -+ break; -+ } + unsigned state = modifiersToEventState(modifiers); -+ commands = commandsForKeyEvent(event, keyVal, state); ++ commands = KeyBindingTranslator().commandsForKeyval(keyVal, state); + } + NativeWebKeyboardEvent event( + type, @@ -18490,10 +19135,10 @@ index 0000000000000000000000000000000000000000..6a204c5bba8fb95ddb2d1c14cae7a3a7 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp -index d18b3e777203ef5d0f33884f909bc598d3526831..aef80b47359d7a2e4805a006dc59cd60d499a60e 100644 +index 2a17b59c9be6ecc76b0ec0a16d9f4866dffa0bf4..0d5c58a88b0e5197254d0eb5bd6eee045d99d299 100644 --- a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp +++ b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp -@@ -77,8 +77,10 @@ void WebPasteboardProxy::setPrimarySelectionOwner(WebFrameProxy* frame) +@@ -78,8 +78,10 @@ void WebPasteboardProxy::setPrimarySelectionOwner(WebFrameProxy* frame) if (m_primarySelectionOwner == frame) return; @@ -18507,10 +19152,10 @@ index d18b3e777203ef5d0f33884f909bc598d3526831..aef80b47359d7a2e4805a006dc59cd60 m_primarySelectionOwner = frame; } diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm -index 286877d14b4eb6ac45092fa1cce5ce530558f8af..85240554255d69a30269e764214a139743de521b 100644 +index f5290e15ec912a36766509dd2414444a8c97e06d..2563926ff72e0b8bcb35e250141549a69578a52f 100644 --- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm +++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm -@@ -504,6 +504,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) +@@ -503,6 +503,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) { @@ -18729,7 +19374,7 @@ index 0000000000000000000000000000000000000000..721826c8c98fc85b68a4f45deaee69c1 + +#endif diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h -index 1647891b55a718f66ee2f4a084439edd655c623a..2099b9166e2cac062d4161d704050a0795a26c93 100644 +index 4c99b44dbdd37e73c349ea8d5a3422075d2eff65..7c6dc33bf047706f13332c726a7e2364d834f7ae 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h @@ -54,6 +54,8 @@ class PageClientImpl final : public PageClientImplCocoa @@ -18751,7 +19396,7 @@ index 1647891b55a718f66ee2f4a084439edd655c623a..2099b9166e2cac062d4161d704050a07 RefPtr takeViewSnapshot(std::optional&&) override; void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override; #if ENABLE(MAC_GESTURE_EVENTS) -@@ -222,6 +227,10 @@ private: +@@ -224,6 +229,10 @@ private: void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame) override; #endif @@ -18763,18 +19408,10 @@ index 1647891b55a718f66ee2f4a084439edd655c623a..2099b9166e2cac062d4161d704050a07 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 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd830855c0 100644 +index 0116071f4359eac661cc6de71eee2d43ce2d56e0..c93c40e2064e15ccecf08a147f4189e98810a6d3 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm -@@ -80,6 +80,7 @@ - #import - #import - #import -+#import - #import - #import - #import -@@ -106,6 +107,13 @@ namespace WebKit { +@@ -110,6 +110,13 @@ namespace WebKit { using namespace WebCore; @@ -18788,7 +19425,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd PageClientImpl::PageClientImpl(NSView *view, WKWebView *webView) : PageClientImplCocoa(webView) , m_view(view) -@@ -159,6 +167,9 @@ NSWindow *PageClientImpl::activeWindow() const +@@ -163,6 +170,9 @@ NSWindow *PageClientImpl::activeWindow() const bool PageClientImpl::isViewWindowActive() { @@ -18798,7 +19435,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); NSWindow *activeViewWindow = activeWindow(); return activeViewWindow.isKeyWindow || (activeViewWindow && [NSApp keyWindow] == activeViewWindow); -@@ -166,6 +177,9 @@ bool PageClientImpl::isViewWindowActive() +@@ -170,6 +180,9 @@ bool PageClientImpl::isViewWindowActive() bool PageClientImpl::isViewFocused() { @@ -18808,7 +19445,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd // FIXME: This is called from the WebPageProxy constructor before we have a WebViewImpl. // Once WebViewImpl and PageClient merge, this won't be a problem. if (!m_impl) -@@ -189,6 +203,9 @@ void PageClientImpl::makeFirstResponder() +@@ -193,6 +206,9 @@ void PageClientImpl::makeFirstResponder() bool PageClientImpl::isViewVisible() { @@ -18818,7 +19455,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd NSView *activeView = this->activeView(); NSWindow *activeViewWindow = activeWindow(); -@@ -272,7 +289,8 @@ void PageClientImpl::didRelaunchProcess() +@@ -276,7 +292,8 @@ void PageClientImpl::didRelaunchProcess() void PageClientImpl::preferencesDidChange() { @@ -18828,7 +19465,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd } void PageClientImpl::toolTipChanged(const String& oldToolTip, const String& newToolTip) -@@ -475,6 +493,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) +@@ -479,6 +496,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) { @@ -18837,7 +19474,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd m_impl->doneWithKeyEvent(event.nativeEvent(), eventWasHandled); } -@@ -494,6 +514,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl +@@ -498,6 +517,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl RefPtr PageClientImpl::createPopupMenuProxy(WebPageProxy& page) { @@ -18846,7 +19483,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd return WebPopupMenuProxyMac::create(m_view, page.popupMenuClient()); } -@@ -635,6 +657,12 @@ CALayer *PageClientImpl::footerBannerLayer() const +@@ -639,6 +660,12 @@ CALayer *PageClientImpl::footerBannerLayer() const return m_impl->footerBannerLayer(); } @@ -18859,7 +19496,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd RefPtr PageClientImpl::takeViewSnapshot(std::optional&&) { return m_impl->takeViewSnapshot(); -@@ -810,6 +838,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR +@@ -829,6 +856,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR #endif // ENABLE(FULLSCREEN_API) @@ -18873,7 +19510,7 @@ index 3fe2a9487a96b31f476bb17e45374f880e80da9a..b72433e5981f298d4d1ca93274df51cd void PageClientImpl::navigationGestureDidBegin() { m_impl->dismissContentRelativeChildWindowsWithAnimation(true); -@@ -997,6 +1032,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c +@@ -1017,6 +1051,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c bool PageClientImpl::windowIsFrontWindowUnderMouse(const NativeWebMouseEvent& event) { @@ -18901,11 +19538,23 @@ index 21c925bafb662dbe961baaad7f25bf4296236d76..5496a33c558a00a5ba96d10223e600aa } +#endif +diff --git a/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm b/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm +index 63c423a74cf983ab7a0be49f0376d227c49724e1..5818c786d5fb0fb4a60c549b68ec989656223e5c 100644 +--- a/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm ++++ b/Source/WebKit/UIProcess/mac/WKImmediateActionController.mm +@@ -31,6 +31,7 @@ + #import "APIHitTestResult.h" + #import "MessageSenderInlines.h" + #import "WKNSURLExtras.h" ++#import "WebFrameProxy.h" + #import "WebPageMessages.h" + #import "WebPageProxy.h" + #import "WebPageProxyMessages.h" diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h -index 6ab7aacaebfda818e3010bb06db72c8552ac598a..3e19cba50d73084392f62f176ad4c3153803e579 100644 +index e34faa8ae2933154efdbf0492a2f17af7a46f83b..54b509837bb767ac3ab28d1d7059462ca7a1170b 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h +++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h -@@ -68,6 +68,7 @@ private: +@@ -78,6 +78,7 @@ private: void show() override; void showContextMenuWithItems(Vector>&&) override; void useContextMenuItems(Vector>&&) override; @@ -18914,10 +19563,10 @@ index 6ab7aacaebfda818e3010bb06db72c8552ac598a..3e19cba50d73084392f62f176ad4c315 bool showAfterPostProcessingContextData(); diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -index 6da27ca16f9f4d359118053049caa5033b6789d7..254e582066fbc774fc02c69dddbc1ae589efdc7a 100644 +index bb4822a1ca6c0b209baed338f267f366424f61c6..aaffc9579deda3a1f5c8fe71747833a5d0e2e8bf 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm +++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -@@ -481,6 +481,12 @@ void WebContextMenuProxyMac::getShareMenuItem(CompletionHandlersetIntrinsicDeviceScaleFactor(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_viewSize = expandedIntSize(FloatSize(LOWORD(lParam), HIWORD(lParam))); + + if (m_page && m_page->drawingArea()) { + // FIXME specify correctly layerPosition. diff --git a/Source/WebKit/UIProcess/wpe/InspectorTargetProxyWPE.cpp b/Source/WebKit/UIProcess/wpe/InspectorTargetProxyWPE.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7453194ca6f032ba86a4c67f5bf12688ab6ec1be @@ -19925,22 +20590,37 @@ index 0000000000000000000000000000000000000000..a7d88f8c745f95af21db71dcfce368ba + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp -index b6536b74452c26a4d661bcf6039af54824f258d0..ade7c4ad1cef7bc69c452bef404eb38437c93088 100644 +index ff2377628995b6095d7cd75f447d904847da0dc0..345aebe075a5b710303eeb8d46f94cf9dc901706 100644 --- a/Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp +++ b/Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp -@@ -29,6 +29,7 @@ - #include "EditorState.h" +@@ -30,6 +30,7 @@ #include "InputMethodState.h" #include "PageClientImpl.h" + #include "WebProcessProxy.h" +#include #include #if USE(ATK) +diff --git a/Source/WebKit/UIProcess/wpe/WebPreferencesWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPreferencesWPE.cpp +index 41307f5fe61b92785a493f68aeca475521708d55..f02e9d93c96ac6c0abedba9ced97b02f9250ac82 100644 +--- a/Source/WebKit/UIProcess/wpe/WebPreferencesWPE.cpp ++++ b/Source/WebKit/UIProcess/wpe/WebPreferencesWPE.cpp +@@ -34,6 +34,10 @@ void WebPreferences::platformInitializeStore() + setForceCompositingMode(true); + setThreadedScrollingEnabled(true); + ++ // Playwright override begin ++ setThreadedScrollingEnabled(false); ++ // Playwright override end ++ + #if USE(SKIA) + // FIXME: Expose this as a setting when we switch to Skia. + static const char* disableAccelerated2DCanvas = getenv("WEBKIT_DISABLE_ACCELERATED_2D_CANVAS"); diff --git a/Source/WebKit/WPEPlatform/CMakeLists.txt b/Source/WebKit/WPEPlatform/CMakeLists.txt -index 9319cacf6dff2c3ffdd469927c91a880978a80aa..17a829b23ae6941b184d32e8701f0fd774639449 100644 +index 2b64d1b5b013d53b18b7757fe3b3f3d9a0501571..e8f28808f5ef0532319a4462fd285c0770d7ce52 100644 --- a/Source/WebKit/WPEPlatform/CMakeLists.txt +++ b/Source/WebKit/WPEPlatform/CMakeLists.txt -@@ -82,6 +82,7 @@ set(WPEPlatform_SYSTEM_INCLUDE_DIRECTORIES +@@ -96,6 +96,7 @@ set(WPEPlatform_SYSTEM_INCLUDE_DIRECTORIES set(WPEPlatform_LIBRARIES Epoxy::Epoxy @@ -19949,10 +20629,10 @@ index 9319cacf6dff2c3ffdd469927c91a880978a80aa..17a829b23ae6941b184d32e8701f0fd7 ${GLIB_GIO_LIBRARIES} ${GLIB_GOBJECT_LIBRARIES} diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj -index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3ffb292f7 100644 +index 3cf46d518a1920a5c6c8e9537f71b1b0b25b00a0..3c7e8c09640d82630864f41569f3229076088a93 100644 --- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj -@@ -1542,6 +1542,7 @@ +@@ -1547,6 +1547,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 */; }; @@ -19960,7 +20640,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 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 */; }; -@@ -2381,6 +2382,18 @@ +@@ -2379,6 +2380,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 */; }; @@ -19979,7 +20659,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 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, ); }; }; -@@ -2468,6 +2481,8 @@ +@@ -2467,6 +2480,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 */; }; @@ -19988,7 +20668,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 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 */; }; -@@ -2488,6 +2503,9 @@ +@@ -2487,6 +2502,9 @@ EBA8D3B627A5E33F00CB7900 /* MockPushServiceConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = EBA8D3B027A5E33F00CB7900 /* MockPushServiceConnection.mm */; }; EBA8D3B727A5E33F00CB7900 /* PushServiceConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = EBA8D3B127A5E33F00CB7900 /* PushServiceConnection.mm */; }; ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -19998,7 +20678,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 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 */; }; F41795A62AC61B78007F5F12 /* CompactContextMenuPresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = F41795A42AC619A2007F5F12 /* CompactContextMenuPresenter.h */; }; -@@ -6218,6 +6236,7 @@ +@@ -6230,6 +6248,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 = ""; }; @@ -20035,7 +20715,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 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 = ""; }; -@@ -8106,6 +8140,14 @@ +@@ -8111,6 +8145,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 = ""; }; @@ -20050,7 +20730,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 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 = ""; }; -@@ -8404,6 +8446,7 @@ +@@ -8415,6 +8457,7 @@ 3766F9EE189A1241003CF19B /* JavaScriptCore.framework in Frameworks */, 3766F9F1189A1254003CF19B /* libicucore.dylib in Frameworks */, 7B9FC5BB28A5233B007570E7 /* libWebKitPlatform.a in Frameworks */, @@ -20058,7 +20738,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 3766F9EF189A1244003CF19B /* QuartzCore.framework in Frameworks */, 37694525184FC6B600CDE21F /* Security.framework in Frameworks */, 37BEC4DD1948FC6A008B4286 /* WebCore.framework in Frameworks */, -@@ -11278,6 +11321,7 @@ +@@ -11296,6 +11339,7 @@ 99788ACA1F421DCA00C08000 /* _WKAutomationSessionConfiguration.mm */, 990D28A81C6404B000986977 /* _WKAutomationSessionDelegate.h */, 990D28AF1C65203900986977 /* _WKAutomationSessionInternal.h */, @@ -20066,7 +20746,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 5C4609E222430E4C009943C2 /* _WKContentRuleListAction.h */, 5C4609E322430E4D009943C2 /* _WKContentRuleListAction.mm */, 5C4609E422430E4D009943C2 /* _WKContentRuleListActionInternal.h */, -@@ -12589,6 +12633,7 @@ +@@ -12603,6 +12647,7 @@ E34B110C27C46BC6006D2F2E /* libWebCoreTestShim.dylib */, E34B110F27C46D09006D2F2E /* libWebCoreTestSupport.dylib */, DDE992F4278D06D900F60D26 /* libWebKitAdditions.a */, @@ -20074,7 +20754,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 57A9FF15252C6AEF006A2040 /* libWTF.a */, 5750F32A2032D4E500389347 /* LocalAuthentication.framework */, 570DAAB0230273D200E8FC04 /* NearField.framework */, -@@ -13159,6 +13204,12 @@ +@@ -13173,6 +13218,12 @@ children = ( 9197940423DBC4BB00257892 /* InspectorBrowserAgent.cpp */, 9197940323DBC4BB00257892 /* InspectorBrowserAgent.h */, @@ -20087,7 +20767,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 ); path = Agents; sourceTree = ""; -@@ -13167,6 +13218,7 @@ +@@ -13181,6 +13232,7 @@ isa = PBXGroup; children = ( A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorUIProxyMac.mm */, @@ -20095,7 +20775,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 1CA8B935127C774E00576C2B /* WebInspectorUIProxyMac.mm */, 99A7ACE326012919006D57FD /* WKInspectorResourceURLSchemeHandler.h */, 99A7ACE42601291A006D57FD /* WKInspectorResourceURLSchemeHandler.mm */, -@@ -13884,6 +13936,7 @@ +@@ -13898,6 +13950,7 @@ E1513C65166EABB200149FCB /* AuxiliaryProcessProxy.h */, 46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */, 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */, @@ -20103,7 +20783,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 5C6D69352AC3935D0099BDAF /* BrowsingContextGroup.cpp */, 5C6D69362AC3935D0099BDAF /* BrowsingContextGroup.h */, 07297F9C1C1711EA003F0735 /* DeviceIdHashSaltStorage.cpp */, -@@ -13907,6 +13960,8 @@ +@@ -13921,6 +13974,8 @@ BC06F43912DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp */, BC06F43812DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h */, 2DD5A72A1EBF09A7009BA597 /* HiddenPageThrottlingAutoIncreasesCounter.h */, @@ -20112,7 +20792,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 5CEABA2B2333251400797797 /* LegacyGlobalSettings.cpp */, 5CEABA2A2333247700797797 /* LegacyGlobalSettings.h */, 31607F3819627002009B87DA /* LegacySessionStateCoding.h */, -@@ -13940,6 +13995,7 @@ +@@ -13954,6 +14009,7 @@ 1A0C227D2451130A00ED614D /* QuickLookThumbnailingSoftLink.mm */, 1AEE57232409F142002005D6 /* QuickLookThumbnailLoader.h */, 1AEE57242409F142002005D6 /* QuickLookThumbnailLoader.mm */, @@ -20120,7 +20800,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 5CCB54DC2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.cpp */, 5CCB54DB2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.h */, 5C907E9A294D507100B3402D /* RemotePageProxy.cpp */, -@@ -14045,6 +14101,8 @@ +@@ -14056,6 +14112,8 @@ BC7B6204129A0A6700D174A4 /* WebPageGroup.h */, 2D9EA3101A96D9EB002D2807 /* WebPageInjectedBundleClient.cpp */, 2D9EA30E1A96CBFF002D2807 /* WebPageInjectedBundleClient.h */, @@ -20129,7 +20809,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 BC111B0B112F5E4F00337BAB /* WebPageProxy.cpp */, BC032DCB10F4389F0058C15A /* WebPageProxy.h */, BCBD38FA125BAB9A00D2C29F /* WebPageProxy.messages.in */, -@@ -14209,6 +14267,7 @@ +@@ -14224,6 +14282,7 @@ BC646C1911DD399F006455B0 /* WKBackForwardListItemRef.h */, BC646C1611DD399F006455B0 /* WKBackForwardListRef.cpp */, BC646C1711DD399F006455B0 /* WKBackForwardListRef.h */, @@ -20137,7 +20817,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 BCB9E24A1120E15C00A137E0 /* WKContext.cpp */, BCB9E2491120E15C00A137E0 /* WKContext.h */, 1AE52F9319201F6B00A1FA37 /* WKContextConfigurationRef.cpp */, -@@ -14792,6 +14851,9 @@ +@@ -14805,6 +14864,9 @@ 7AFA6F682A9F57C50055322A /* DisplayLinkMac.cpp */, 31ABA79C215AF9E000C90E31 /* HighPerformanceGPUManager.h */, 31ABA79D215AF9E000C90E31 /* HighPerformanceGPUManager.mm */, @@ -20147,7 +20827,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 1AFDE65B1954E8D500C48FFA /* LegacySessionStateCoding.cpp */, 0FCB4E5818BBE3D9000FCFC9 /* PageClientImplMac.h */, 0FCB4E5918BBE3D9000FCFC9 /* PageClientImplMac.mm */, -@@ -14815,6 +14877,8 @@ +@@ -14828,6 +14890,8 @@ E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */, E55CD20124D09F1F0042DB9C /* WebDateTimePickerMac.h */, E55CD20224D09F1F0042DB9C /* WebDateTimePickerMac.mm */, @@ -20156,7 +20836,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */, BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */, BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */, -@@ -15820,6 +15884,7 @@ +@@ -15857,6 +15921,7 @@ 99788ACB1F421DDA00C08000 /* _WKAutomationSessionConfiguration.h in Headers */, 990D28AC1C6420CF00986977 /* _WKAutomationSessionDelegate.h in Headers */, 990D28B11C65208D00986977 /* _WKAutomationSessionInternal.h in Headers */, @@ -20164,7 +20844,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 5C4609E7224317B4009943C2 /* _WKContentRuleListAction.h in Headers */, 5C4609E8224317BB009943C2 /* _WKContentRuleListActionInternal.h in Headers */, 1A5704F81BE01FF400874AF1 /* _WKContextMenuElementInfo.h in Headers */, -@@ -16129,6 +16194,7 @@ +@@ -16168,6 +16233,7 @@ E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */, 4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */, 1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */, @@ -20172,7 +20852,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 A7E69BCC2B2117A100D43D3F /* BufferAndBackendInfo.h in Headers */, BC3065FA1259344E00E71278 /* CacheModel.h in Headers */, 935BF7FC2936BF1A00B41326 /* CacheStorageCache.h in Headers */, -@@ -16309,7 +16375,11 @@ +@@ -16348,7 +16414,11 @@ BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */, CE550E152283752200D28791 /* InsertTextOptions.h in Headers */, 9197940523DBC4BB00257892 /* InspectorBrowserAgent.h in Headers */, @@ -20184,7 +20864,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */, C5BCE5DF1C50766A00CDE3FA /* InteractionInformationAtPosition.h in Headers */, 2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */, -@@ -16567,6 +16637,7 @@ +@@ -16610,6 +16680,7 @@ CDAC20C923FC2F750021DEE3 /* RemoteCDMInstanceSessionIdentifier.h in Headers */, F451C0FE2703B263002BA03B /* RemoteDisplayListRecorderProxy.h in Headers */, A78A5FE42B0EB39E005036D3 /* RemoteImageBufferSetIdentifier.h in Headers */, @@ -20192,7 +20872,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */, 2DDF731518E95060004F5A66 /* RemoteLayerBackingStoreCollection.h in Headers */, 1AB16AEA164B3A8800290D62 /* RemoteLayerTreeContext.h in Headers */, -@@ -16622,6 +16693,7 @@ +@@ -16664,6 +16735,7 @@ E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */, E36FF00327F36FBD004BE21A /* SandboxStateVariables.h in Headers */, 7BAB111025DD02B3008FC479 /* ScopedActiveMessageReceiveQueue.h in Headers */, @@ -20200,7 +20880,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 463BB93A2B9D08D80098C5C3 /* ScriptMessageHandlerIdentifier.h in Headers */, E4D54D0421F1D72D007E3C36 /* ScrollingTreeFrameScrollingNodeRemoteIOS.h in Headers */, 0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */, -@@ -16972,6 +17044,8 @@ +@@ -17011,6 +17083,8 @@ 939EF87029D112EE00F23AEE /* WebPageInlines.h in Headers */, 9197940823DBC4CB00257892 /* WebPageInspectorAgentBase.h in Headers */, A513F5402154A5D700662841 /* WebPageInspectorController.h in Headers */, @@ -20209,7 +20889,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 A543E30C215C8A8D00279CD9 /* WebPageInspectorTarget.h in Headers */, A543E30D215C8A9000279CD9 /* WebPageInspectorTargetController.h in Headers */, A543E307215AD13700279CD9 /* WebPageInspectorTargetFrontendChannel.h in Headers */, -@@ -19367,6 +19441,8 @@ +@@ -19422,6 +19496,8 @@ 522F792928D50EBB0069B45B /* HidService.mm in Sources */, 2749F6442146561B008380BF /* InjectedBundleNodeHandle.cpp in Sources */, 2749F6452146561E008380BF /* InjectedBundleRangeHandle.cpp in Sources */, @@ -20218,7 +20898,7 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 1CC94E532AC92F190045F269 /* JSWebExtensionAPIAction.mm in Sources */, 1C2B4D4B2A819D0D00C528A1 /* JSWebExtensionAPIAlarms.mm in Sources */, 1C8ECFEA2AFC7DCB007BAA62 /* JSWebExtensionAPICommands.mm in Sources */, -@@ -19807,6 +19883,8 @@ +@@ -19864,6 +19940,8 @@ E3816B3D27E2463A005EAFC0 /* WebMockContentFilterManager.cpp in Sources */, 31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */, 2DF6FE52212E110900469030 /* WebPage.cpp in Sources */, @@ -20226,12 +20906,12 @@ index 5638e7e7ca660b2bb7c9b3f21dde5f5dfb68dad0..d4c7e4081d7b4c80423e2a406f8471c3 + D79902B3236E9404005D6F7E /* WebPageInspectorInputAgentMac.mm in Sources */, C0CE72A01247E71D00BC0EC4 /* WebPageMessageReceiver.cpp in Sources */, BCBD3914125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp in Sources */, - 7CE9CE101FA0767A000177DE /* WebPageUpdatePreferences.cpp in Sources */, + C0CE72A01B47E71D00BC0EC4 /* WebPageTestingMessageReceiver.cpp in Sources */, diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp -index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450257bd2fb 100644 +index a3444c240790680684a09a929f5ba07d6e68e793..6167b8d1fb42bef261aed6bb3e9581447decb1a9 100644 --- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp +++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp -@@ -229,6 +229,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou +@@ -233,6 +233,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou } #endif @@ -20243,7 +20923,30 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 #if ENABLE(PDFJS) if (tryLoadingUsingPDFJSHandler(resourceLoader, trackingParameters)) return; -@@ -360,7 +365,8 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara +@@ -242,12 +247,16 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou + return; + + if (InspectorInstrumentationWebKit::shouldInterceptRequest(resourceLoader)) { +- InspectorInstrumentationWebKit::interceptRequest(resourceLoader, [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)); +- }); +- 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) { ++ auto& resourceLoader = protectedResourceLoader.get(); ++ WEBLOADERSTRATEGY_RELEASE_LOG("scheduleLoad: intercepted URL will be scheduled with the NetworkProcess"); ++ scheduleLoadFromNetworkProcess(resourceLoader, request, trackingParameters, shouldClearReferrerOnHTTPSToHTTPRedirect, maximumBufferingTime(resource)); ++ }); ++ return; ++ } + } + + WEBLOADERSTRATEGY_RELEASE_LOG("scheduleLoad: URL will be scheduled with the NetworkProcess"); +@@ -366,7 +375,8 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara parameters.linkPreconnectEarlyHintsEnabled = mainFrame->settings().linkPreconnectEarlyHintsEnabled(); } @@ -20253,7 +20956,7 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 { auto identifier = resourceLoader.identifier(); ASSERT(identifier); -@@ -376,7 +382,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -382,7 +392,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL RunLoop::main().dispatch([resourceLoader = Ref { resourceLoader }, error = blockedError(request)] { resourceLoader->didFail(error); }); @@ -20262,7 +20965,7 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 } } -@@ -386,7 +392,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -392,7 +402,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); @@ -20270,7 +20973,7 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 loadParameters.identifier = identifier; loadParameters.webPageProxyID = trackingParameters.webPageProxyID; loadParameters.webPageID = trackingParameters.pageID; -@@ -476,14 +481,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -482,14 +491,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL if (loadParameters.options.mode != FetchOptions::Mode::Navigate) { ASSERT(loadParameters.sourceOrigin); @@ -20288,7 +20991,7 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 loadParameters.isMainFrameNavigation = isMainFrameNavigation; if (loadParameters.isMainFrameNavigation && document) -@@ -525,6 +527,17 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -529,6 +535,17 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL } ASSERT((loadParameters.webPageID && loadParameters.webFrameID) || loadParameters.clientCredentialPolicy == ClientCredentialPolicy::CannotAskClientForCredentials); @@ -20306,7 +21009,7 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 std::optional existingNetworkResourceLoadIdentifierToResume; if (loadParameters.isMainFrameNavigation) -@@ -540,7 +553,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -544,7 +561,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL } auto loader = WebResourceLoader::create(resourceLoader, trackingParameters); @@ -20315,7 +21018,7 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 } void WebLoaderStrategy::scheduleInternallyFailedLoad(WebCore::ResourceLoader& resourceLoader) -@@ -950,7 +963,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier +@@ -954,7 +971,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier bool WebLoaderStrategy::isOnLine() const { @@ -20324,7 +21027,7 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 } void WebLoaderStrategy::addOnlineStateChangeListener(Function&& listener) -@@ -977,6 +990,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet +@@ -981,6 +998,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet void WebLoaderStrategy::setOnLineState(bool isOnLine) { @@ -20336,7 +21039,7 @@ index 0ab7a191b4d1b35579666f381f87d8a3995e3501..bfd50e5c4f82ad02d9a96afb9a297450 if (m_isOnLine == isOnLine) return; -@@ -985,6 +1003,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) +@@ -989,6 +1011,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) listener(isOnLine); } @@ -20380,10 +21083,10 @@ index 3ef86cc236b8acee2fbe5d0b9c3fd755fcc9f06f..75951fc0fc5e4ef566582c0a49482793 } // namespace WebKit diff --git a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp -index ee6ed68f57ac7205087c7f0abe59fb56ee0fa012..9d81ae6dff0ab154a0665d6430be58affae6d820 100644 +index 17a0fe5d7a30883febe90e9984d36d8ea222872a..c3804fd499bdd3663e32318012f507af6b434aa7 100644 --- a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp +++ b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp -@@ -189,9 +189,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR +@@ -190,9 +190,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR } m_coreLoader->didReceiveResponse(inspectorResponse, [this, protectedThis = WTFMove(protectedThis), interceptedRequestIdentifier, policyDecisionCompletionHandler = WTFMove(policyDecisionCompletionHandler), overrideData = WTFMove(overrideData)]() mutable { @@ -20393,7 +21096,7 @@ index ee6ed68f57ac7205087c7f0abe59fb56ee0fa012..9d81ae6dff0ab154a0665d6430be58af if (!m_coreLoader || !m_coreLoader->identifier()) { m_interceptController.continueResponse(interceptedRequestIdentifier); return; -@@ -209,6 +206,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR +@@ -210,6 +207,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR } }); }); @@ -20403,7 +21106,7 @@ index ee6ed68f57ac7205087c7f0abe59fb56ee0fa012..9d81ae6dff0ab154a0665d6430be58af } diff --git a/Source/WebKit/WebProcess/Notifications/NotificationPermissionRequestManager.cpp b/Source/WebKit/WebProcess/Notifications/NotificationPermissionRequestManager.cpp -index ee9c3c4f48c328daaa015e2122235e51349bd999..5b3a4d3e742147195e0ff9e88176759df1b799db 100644 +index e314c2987e348a0abee8b655caff3a1c3b3c4564..882746d581bd8db6f2fad5944f09ee9fe9e0e55b 100644 --- a/Source/WebKit/WebProcess/Notifications/NotificationPermissionRequestManager.cpp +++ b/Source/WebKit/WebProcess/Notifications/NotificationPermissionRequestManager.cpp @@ -85,7 +85,7 @@ void NotificationPermissionRequestManager::startRequest(const SecurityOriginData @@ -20416,10 +21119,10 @@ index ee9c3c4f48c328daaa015e2122235e51349bd999..5b3a4d3e742147195e0ff9e88176759d auto permissionHandlers = m_requestsPerOrigin.take(securityOrigin); diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -index 3fa53c3e4977dcc0b83d48091490c2261ed785e0..bef114c5988a88eaca305287471c55515fc22ff6 100644 +index e22824697734a6fc65de8bdcf37afee5d5b1d508..1385b96bef6ab891d359e022974c77fc734ff18d 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -@@ -468,6 +468,8 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev +@@ -472,6 +472,8 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev { // Notify the bundle client. auto page = protectedPage(); @@ -20429,24 +21132,20 @@ index 3fa53c3e4977dcc0b83d48091490c2261ed785e0..bef114c5988a88eaca305287471c5551 } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp -index 2eb0886f13ed035a53b8eaa60605de4dfe53fbe3..0f6a539f00a42149c0f2b2237a9cbdd8334459d6 100644 +index 2eb0886f13ed035a53b8eaa60605de4dfe53fbe3..c3a216415ab588cde1f1e524e0a232efa425717e 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp -@@ -29,6 +29,13 @@ +@@ -29,6 +29,9 @@ #if ENABLE(DRAG_SUPPORT) #include "WebPage.h" +#include +#include +#include -+ -+#if PLATFORM(WPE) -+#include "ArgumentCodersWPE.h" -+#endif namespace WebKit { using namespace WebCore; -@@ -50,7 +57,7 @@ OptionSet WebDragClient::dragSourceActionMaskForPoint(const In +@@ -50,7 +53,7 @@ OptionSet WebDragClient::dragSourceActionMaskForPoint(const In return m_page->allowedDragSourceActions(); } @@ -20456,10 +21155,10 @@ index 2eb0886f13ed035a53b8eaa60605de4dfe53fbe3..0f6a539f00a42149c0f2b2237a9cbdd8 { } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp -index 7b9b0348c1a3b606ad31b3fe2df3eedcb64cf233..97a6a56cc8427bd3eadfacc8fd5c4f15d5bfcdf7 100644 +index 1fbb60e23b8d338f05ff0daa284724afafe29282..a15410b5b492254634e1aa300af405ba12ae8e80 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp -@@ -1592,14 +1592,6 @@ void WebLocalFrameLoaderClient::transitionToCommittedForNewPage(InitializingIfra +@@ -1588,14 +1588,6 @@ void WebLocalFrameLoaderClient::transitionToCommittedForNewPage(InitializingIfra if (initializingIframe == InitializingIframe::No) webPage->scheduleFullEditorStateUpdate(); @@ -20554,10 +21253,10 @@ index 0000000000000000000000000000000000000000..66972b66094050b2429a927861ff7d0d +#endif // ENABLE(DRAG_SUPPORT) diff --git a/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebDragClientWPE.cpp b/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebDragClientWPE.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..4fa6b70b978998849950d1fe4d9f902ede155956 +index 0000000000000000000000000000000000000000..226b3bf6bd83d2606a0aeb627ae9302fd3bcf874 --- /dev/null +++ b/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebDragClientWPE.cpp -@@ -0,0 +1,57 @@ +@@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 Igalia S.L. + * @@ -20588,7 +21287,6 @@ index 0000000000000000000000000000000000000000..4fa6b70b978998849950d1fe4d9f902e + +#if ENABLE(DRAG_SUPPORT) + -+#include "ArgumentCodersWPE.h" +#include "WebPage.h" +#include "WebPageProxyMessages.h" +#include @@ -20616,7 +21314,7 @@ index 0000000000000000000000000000000000000000..4fa6b70b978998849950d1fe4d9f902e + +#endif // ENABLE(DRAG_SUPPORT) diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp -index 6780fb04b94241977df3396ffb77585f10faf035..db015c88e2b3413c9fde348779b62c90896ba09c 100644 +index c0dd11d1a720907b1e2d863302a483eea1d39765..a4ad1b5acc545d98aea99c58fc5a5ca3b3cc0bd9 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp @@ -39,6 +39,7 @@ @@ -20669,12 +21367,12 @@ index 6780fb04b94241977df3396ffb77585f10faf035..db015c88e2b3413c9fde348779b62c90 void DrawingAreaCoordinatedGraphics::scheduleDisplay() diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp -index d453fc33b2a366e4944b48c47bbe056d508124e7..4b58d67c55ebcde8598a1045cbc99202bf6f8feb 100644 +index d81997b98996b258f43ce13496ec06c6dc06d467..16e191b5ed4cf0e3b223fb9547699a05ede2f6d6 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp -@@ -193,8 +193,16 @@ void LayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer) - void LayerTreeHost::scrollNonCompositedContents(const IntRect& rect) - { +@@ -204,8 +204,16 @@ void LayerTreeHost::scrollNonCompositedContents(const IntRect& rect) + m_scrolledSinceLastFrame = true; + auto* frameView = m_webPage.localMainFrameView(); + +// Playwright begin @@ -20689,15 +21387,7 @@ index d453fc33b2a366e4944b48c47bbe056d508124e7..4b58d67c55ebcde8598a1045cbc99202 m_viewportController.didScroll(rect.location()); didChangeViewport(); -@@ -273,6 +281,7 @@ GraphicsLayerFactory* LayerTreeHost::graphicsLayerFactory() - void LayerTreeHost::contentsSizeChanged(const IntSize& newSize) - { - m_viewportController.didChangeContentsSize(newSize); -+ didChangeViewport(); - } - - void LayerTreeHost::didChangeViewportAttributes(ViewportAttributes&& attr) -@@ -312,6 +321,10 @@ void LayerTreeHost::didChangeViewport() +@@ -325,6 +333,10 @@ void LayerTreeHost::didChangeViewport() if (!view->useFixedLayout()) view->notifyScrollPositionChanged(m_lastScrollPosition); @@ -20709,10 +21399,10 @@ index d453fc33b2a366e4944b48c47bbe056d508124e7..4b58d67c55ebcde8598a1045cbc99202 if (m_lastPageScaleFactor != pageScale) { diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h -index 40926ecda30b9f7cdb4d1908436b1af4353999a4..2fa2c6363cfedd3dac46692cc6c8642752ec728f 100644 +index 468d6f8c574ea3298e502ce5776b624e295d863d..7039d3b26db1586e8c2a693b8cf5daa36088dd33 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h -@@ -115,6 +115,13 @@ public: +@@ -116,6 +116,13 @@ public: #if PLATFORM(WPE) && USE(GBM) && ENABLE(WPE_PLATFORM) void preferredBufferFormatsDidChange(); #endif @@ -20753,7 +21443,7 @@ index 94bbead87936ab599f79c3c08b260cad939aea62..5099d3d7bdf220aa5c8f3729a04397ec { if (m_hasRemovedMessageReceiver) diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.h b/Source/WebKit/WebProcess/WebPage/DrawingArea.h -index e61851e273de92fc97b7707c4427b4d03cd2df70..d1e0850461624188febc8a477e6d3d6bc44fee50 100644 +index 20749934a7fb69de11b85858e8e53f33b059d056..1818cb1fa27e7f3b66e4d17132f9c1ad062a2b9a 100644 --- a/Source/WebKit/WebProcess/WebPage/DrawingArea.h +++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.h @@ -164,6 +164,9 @@ public: @@ -20805,10 +21495,18 @@ index b6e5283f51db82b60091320df44ef0bbf20c33c6..0d82fbb98b93e760cecf5fa7a41327d0 WebCookieJar(); diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c8d54faad 100644 +index 8ed6c5c3f4bb342435f1ac6bb40020ba0fdd9364..2bbf3db029ab95cfda418fa39f2654db966dc2af 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -@@ -1034,6 +1034,9 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) +@@ -233,6 +233,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1053,6 +1054,9 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) #endif #endif // HAVE(SANDBOX_STATE_FLAGS) @@ -20818,8 +21516,8 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c updateThrottleState(); #if ENABLE(ACCESSIBILITY_ANIMATION_CONTROL) updateImageAnimationEnabled(); -@@ -2007,6 +2010,22 @@ void WebPage::transitionFrameToLocal(LocalFrameCreationParameters&& creationPara - frame->transitionToLocal(creationParameters.layerHostingContextIdentifier); +@@ -2018,6 +2022,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, st + frame->loadDidCommitInAnotherProcess(layerHostingContextIdentifier); } +void WebPage::loadRequestInFrameForInspector(LoadParameters&& loadParameters, WebCore::FrameIdentifier frameID) @@ -20841,7 +21539,17 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c void WebPage::loadRequest(LoadParameters&& loadParameters) { WEBPAGE_RELEASE_LOG(Loading, "loadRequest: navigationID=%" PRIu64 ", shouldTreatAsContinuingLoad=%u, lastNavigationWasAppInitiated=%d, existingNetworkResourceLoadIdentifierToResume=%" PRIu64, loadParameters.navigationID, static_cast(loadParameters.shouldTreatAsContinuingLoad), loadParameters.request.isAppInitiated(), valueOrDefault(loadParameters.existingNetworkResourceLoadIdentifierToResume).toUInt64()); -@@ -2283,17 +2302,14 @@ void WebPage::setSize(const WebCore::IntSize& viewSize) +@@ -2200,7 +2220,9 @@ void WebPage::stopLoading() + void WebPage::stopLoadingDueToProcessSwap() + { + SetForScope isStoppingLoadingDueToProcessSwap(m_isStoppingLoadingDueToProcessSwap, true); ++ InspectorInstrumentationWebKit::setStoppingLoadingDueToProcessSwap(m_page.get(), true); + stopLoading(); ++ InspectorInstrumentationWebKit::setStoppingLoadingDueToProcessSwap(m_page.get(), false); + } + + bool WebPage::defersLoading() const +@@ -2301,17 +2323,14 @@ void WebPage::setSize(const WebCore::IntSize& viewSize) view->resize(viewSize); m_drawingArea->setNeedsDisplay(); @@ -20859,7 +21567,7 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArguments) { RefPtr localMainFrame = dynamicDowncast(m_page->mainFrame()); -@@ -2318,20 +2334,18 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg +@@ -2336,20 +2355,18 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg ViewportAttributes attr = computeViewportAttributes(viewportArguments, minimumLayoutFallbackWidth, deviceWidth, deviceHeight, 1, m_viewSize); @@ -20887,7 +21595,7 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c #if USE(COORDINATED_GRAPHICS) m_drawingArea->didChangeViewportAttributes(WTFMove(attr)); -@@ -2339,7 +2353,6 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg +@@ -2357,7 +2374,6 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg send(Messages::WebPageProxy::DidChangeViewportProperties(attr)); #endif } @@ -20895,7 +21603,7 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c void WebPage::scrollMainFrameIfNotAtMaxScrollPosition(const IntSize& scrollOffset) { -@@ -2640,6 +2653,7 @@ void WebPage::scaleView(double scale) +@@ -2659,6 +2675,7 @@ void WebPage::scaleView(double scale) } m_page->setViewScaleFactor(scale); @@ -20903,7 +21611,7 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c scalePage(pageScale, scrollPositionAtNewScale); } -@@ -2819,18 +2833,14 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum +@@ -2838,18 +2855,14 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum viewportConfigurationChanged(); #endif @@ -20923,7 +21631,21 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c } #if !PLATFORM(IOS_FAMILY) -@@ -3830,6 +3840,97 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandlercoreLocalFrame()->eventHandler().setLastKnownMousePosition(eventPoint, globalPoint); + } + ++#if ENABLE(ORIENTATION_EVENTS) ++void WebPage::setDeviceOrientation(WebCore::IntDegrees deviceOrientation) ++{ ++ m_page->setOverrideOrientation(deviceOrientation); ++} ++#endif ++ + void WebPage::flushDeferredDidReceiveMouseEvent() + { + if (auto info = std::exchange(m_deferredDidReceiveMouseEvent, std::nullopt)) +@@ -3855,6 +3875,97 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandlersendMessageToTargetBackend(targetId, message); } @@ -21033,7 +21755,7 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c void WebPage::insertNewlineInQuotedContent() { RefPtr frame = m_page->checkedFocusController()->focusedOrMainFrame(); -@@ -4150,6 +4256,7 @@ void WebPage::didCompletePageTransition() +@@ -4178,6 +4294,7 @@ void WebPage::didCompletePageTransition() void WebPage::show() { send(Messages::WebPageProxy::ShowPage()); @@ -21041,7 +21763,7 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c } void WebPage::setIsTakingSnapshotsForApplicationSuspension(bool isTakingSnapshotsForApplicationSuspension) -@@ -5249,7 +5356,7 @@ NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana +@@ -5378,7 +5495,7 @@ NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana #if ENABLE(DRAG_SUPPORT) @@ -21050,7 +21772,7 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c 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) -@@ -7586,6 +7693,10 @@ void WebPage::didCommitLoad(WebFrame* frame) +@@ -7748,6 +7865,10 @@ void WebPage::didCommitLoad(WebFrame* frame) #endif flushDeferredDidReceiveMouseEvent(); @@ -21061,7 +21783,7 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c } void WebPage::didFinishDocumentLoad(WebFrame& frame) -@@ -7850,6 +7961,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, const Resou +@@ -8028,6 +8149,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, const Resou WebsitePoliciesData::applyToDocumentLoader(WTFMove(*m_pendingWebsitePolicies), documentLoader); m_pendingWebsitePolicies = std::nullopt; } @@ -21072,29 +21794,18 @@ index 36ca16c66c74db2f7d4b2a4938e7714b5ef49ca1..821029c298841fc1408f80579d43ec7c return documentLoader; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h -index a8d232fda1bf1dc7a9b3e866b3cbfb2952b26eef..b048960902cdd660209be177b4ecbe7719c74f8d 100644 +index dade474046440584b2579c3c0e72d7daf9aafc68..35be816bd0ba41b6f6c31e4dec1906fbfe0533ee 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit/WebProcess/WebPage/WebPage.h -@@ -70,6 +70,7 @@ - #include +@@ -71,6 +71,7 @@ #include #include + #include +#include #include #include #include -@@ -112,6 +113,10 @@ - #include "WebPrintOperationGtk.h" - #endif - -+#if PLATFORM(WPE) -+#include "ArgumentCodersWPE.h" -+#endif -+ - #if PLATFORM(GTK) || PLATFORM(WPE) - #include "InputMethodState.h" - #endif -@@ -1145,11 +1150,11 @@ public: +@@ -1173,11 +1174,11 @@ public: void clearSelection(); void restoreSelectionInFocusedEditableElement(); @@ -21108,7 +21819,7 @@ index a8d232fda1bf1dc7a9b3e866b3cbfb2952b26eef..b048960902cdd660209be177b4ecbe77 void performDragControllerAction(std::optional, DragControllerAction, WebCore::DragData&&, CompletionHandler, WebCore::DragHandlingMethod, bool, unsigned, WebCore::IntRect, WebCore::IntRect, std::optional)>&&); void performDragOperation(WebCore::DragData&&, SandboxExtension::Handle&&, Vector&&, CompletionHandler&&); #endif -@@ -1164,6 +1169,9 @@ public: +@@ -1192,6 +1193,9 @@ public: void didStartDrag(); void dragCancelled(); OptionSet allowedDragSourceActions() const { return m_allowedDragSourceActions; } @@ -21118,7 +21829,20 @@ index a8d232fda1bf1dc7a9b3e866b3cbfb2952b26eef..b048960902cdd660209be177b4ecbe77 #endif void beginPrinting(WebCore::FrameIdentifier, const PrintInfo&); -@@ -1387,6 +1395,7 @@ public: +@@ -1267,8 +1271,11 @@ public: + void gestureEvent(WebCore::FrameIdentifier, const WebGestureEvent&, CompletionHandler, bool, std::optional)>&&); + #endif + +-#if PLATFORM(IOS_FAMILY) ++#if ENABLE(ORIENTATION_EVENTS) + void setDeviceOrientation(WebCore::IntDegrees); ++#endif ++ ++#if PLATFORM(IOS_FAMILY) + void dynamicViewportSizeUpdate(const DynamicViewportSizeUpdate&); + bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; } + void willStartUserTriggeredZooming(); +@@ -1415,6 +1422,7 @@ public: void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType); void disconnectInspector(const String& targetId); void sendMessageToTargetBackend(const String& targetId, const String& message); @@ -21126,15 +21850,15 @@ index a8d232fda1bf1dc7a9b3e866b3cbfb2952b26eef..b048960902cdd660209be177b4ecbe77 void insertNewlineInQuotedContent(); -@@ -1863,6 +1872,7 @@ private: - void tryClose(CompletionHandler&&); - void platformDidReceiveLoadParameters(const LoadParameters&); - void transitionFrameToLocal(LocalFrameCreationParameters&&, WebCore::FrameIdentifier); +@@ -1921,6 +1929,7 @@ private: + void createProvisionalFrame(ProvisionalFrameCreationParameters&&, WebCore::FrameIdentifier); + void destroyProvisionalFrame(WebCore::FrameIdentifier); + void loadDidCommitInAnotherProcess(WebCore::FrameIdentifier, std::optional); + void loadRequestInFrameForInspector(LoadParameters&&, WebCore::FrameIdentifier); void loadRequest(LoadParameters&&); [[noreturn]] void loadRequestWaitingForProcessLaunch(LoadParameters&&, URL&&, WebPageProxyIdentifier, bool); void loadData(LoadParameters&&); -@@ -1902,6 +1912,7 @@ private: +@@ -1962,6 +1971,7 @@ private: void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled); #elif ENABLE(TOUCH_EVENTS) void touchEvent(const WebTouchEvent&, CompletionHandler, bool)>&&); @@ -21142,7 +21866,7 @@ index a8d232fda1bf1dc7a9b3e866b3cbfb2952b26eef..b048960902cdd660209be177b4ecbe77 #endif void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&); -@@ -2046,9 +2057,7 @@ private: +@@ -2108,9 +2118,7 @@ private: void addLayerForFindOverlay(CompletionHandler&&); void removeLayerForFindOverlay(CompletionHandler&&); @@ -21152,7 +21876,7 @@ index a8d232fda1bf1dc7a9b3e866b3cbfb2952b26eef..b048960902cdd660209be177b4ecbe77 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex); void setTextForActivePopupMenu(int32_t index); -@@ -2649,6 +2658,7 @@ private: +@@ -2713,6 +2721,7 @@ private: UserActivity m_userActivity; uint64_t m_pendingNavigationID { 0 }; @@ -21161,10 +21885,25 @@ index a8d232fda1bf1dc7a9b3e866b3cbfb2952b26eef..b048960902cdd660209be177b4ecbe77 bool m_mainFrameProgressCompleted { false }; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in -index b67b771976b46970925529207e0153bc5637c533..7fc087a6d9769664347d62776d744287ec39c3a3 100644 +index 148cbc222395ba878b51a233331e45e0e2d1604f..0bb93d61e68587cbd27e24fbef0eb875783ff8ff 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in -@@ -147,6 +147,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType +@@ -51,10 +51,13 @@ messages -> WebPage LegacyReceiver { + MouseEvent(WebCore::FrameIdentifier frameID, WebKit::WebMouseEvent event, std::optional> sandboxExtensions) + SetLastKnownMousePosition(WebCore::FrameIdentifier frameID, WebCore::IntPoint eventPoint, WebCore::IntPoint globalPoint); + ++#if ENABLE(ORIENTATION_EVENTS) ++ SetDeviceOrientation(WebCore::IntDegrees deviceOrientation) ++#endif ++ + #if PLATFORM(IOS_FAMILY) + SetSceneIdentifier(String sceneIdentifier) + SetViewportConfigurationViewLayoutSize(WebCore::FloatSize size, double scaleFactor, double minimumEffectiveDeviceWidth) +- SetDeviceOrientation(WebCore::IntDegrees deviceOrientation) + SetOverrideViewportArguments(std::optional arguments) + DynamicViewportSizeUpdate(struct WebKit::DynamicViewportSizeUpdate target) + +@@ -144,6 +147,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType ConnectInspector(String targetId, Inspector::FrontendChannel::ConnectionType connectionType) DisconnectInspector(String targetId) SendMessageToTargetBackend(String targetId, String message) @@ -21172,7 +21911,7 @@ index b67b771976b46970925529207e0153bc5637c533..7fc087a6d9769664347d62776d744287 #if ENABLE(REMOTE_INSPECTOR) SetIndicating(bool indicating); -@@ -157,6 +158,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType +@@ -154,6 +158,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType #endif #if !ENABLE(IOS_TOUCH_EVENTS) && ENABLE(TOUCH_EVENTS) TouchEvent(WebKit::WebTouchEvent event) -> (std::optional eventType, bool handled) @@ -21180,15 +21919,15 @@ index b67b771976b46970925529207e0153bc5637c533..7fc087a6d9769664347d62776d744287 #endif CancelPointer(WebCore::PointerID pointerId, WebCore::IntPoint documentPoint) -@@ -188,6 +190,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType - LoadDataInFrame(std::span data, String MIMEType, String encodingName, URL baseURL, WebCore::FrameIdentifier frameID) - LoadRequest(struct WebKit::LoadParameters loadParameters) - TransitionFrameToLocal(struct WebKit::LocalFrameCreationParameters creationParameters, WebCore::FrameIdentifier frameID) +@@ -187,6 +192,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType + CreateProvisionalFrame(struct WebKit::ProvisionalFrameCreationParameters creationParameters, WebCore::FrameIdentifier frameID) + 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) -@@ -353,10 +356,10 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType +@@ -351,10 +357,10 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType RemoveLayerForFindOverlay() -> () # Drag and drop. @@ -21201,7 +21940,7 @@ index b67b771976b46970925529207e0153bc5637c533..7fc087a6d9769664347d62776d744287 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) PerformDragOperation(WebCore::DragData dragData, WebKit::SandboxExtensionHandle sandboxExtensionHandle, Vector sandboxExtensionsForUpload) -> (bool handled) #endif -@@ -366,6 +369,10 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType +@@ -364,6 +370,10 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType DragCancelled() #endif @@ -21213,10 +21952,10 @@ index b67b771976b46970925529207e0153bc5637c533..7fc087a6d9769664347d62776d744287 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/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -index 46b5327ff8777f3dce83ecf37219ad08321e8462..364d1010f0356a37d3f3b07d7fde187973028857 100644 +index 678294ec1a7b6a05ed91730a723210a66af2f918..aafa6cfaff690bcbf6a69870576844f8894b8613 100644 --- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm +++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -@@ -800,21 +800,37 @@ String WebPage::platformUserAgent(const URL&) const +@@ -802,21 +802,37 @@ String WebPage::platformUserAgent(const URL&) const bool WebPage::hoverSupportedByPrimaryPointingDevice() const { @@ -21305,7 +22044,7 @@ index f17f5d719d892309ed9c7093384945866b5117b9..1dba47bbf0dbd0362548423a74b38034 } diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp -index 4b52cd3a81eceb55531d48d4e4a54dc7d62b4d32..e3427d76d44a9bf148f4f9dca7ed7d7b58319b53 100644 +index df3c9d0ebbc3665c3ec4fcac259bee402ef19f45..9ff1d77c609c6b483eb3b9c620ef5742f5477069 100644 --- a/Source/WebKit/WebProcess/WebProcess.cpp +++ b/Source/WebKit/WebProcess/WebProcess.cpp @@ -88,6 +88,7 @@ @@ -21316,7 +22055,22 @@ index 4b52cd3a81eceb55531d48d4e4a54dc7d62b4d32..e3427d76d44a9bf148f4f9dca7ed7d7b #include #include #include -@@ -365,6 +366,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter +@@ -364,6 +365,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter + { + JSC::Options::AllowUnfinalizedAccessScope scope; + JSC::Options::allowNonSPTagging() = false; ++ // Playwright begin ++ // SharedBufferArray is enabled only on Mac via XPC sercvice "enable-shared-array-buffer" option. ++ // For other platforms, enable it here. ++#if !PLATFORM(COCOA) ++ if (parameters.shouldEnableSharedArrayBuffer) ++ JSC::Options::useSharedArrayBuffer() = true; ++#endif ++ // Playwright end + JSC::Options::notifyOptionsChanged(); + } + +@@ -371,6 +380,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter platformInitializeProcess(parameters); updateCPULimit(); @@ -21341,10 +22095,10 @@ index 8987c3964a9308f2454759de7f8972215a3ae416..bcac0afeb94ed8123d1f9fb0b932c849 SetProcessDPIAware(); return true; diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm -index 1ef662de86f8b92a7a5c6414df2dac6dbb3882f0..793785e12f96fe52193e8c27ec8b015521e06390 100644 +index d694170887445e2eed73340666bc4847aef4f9a6..6ced22d0953a39582285201e0946d68f954644ad 100644 --- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm -@@ -4214,7 +4214,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END +@@ -4223,7 +4223,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END _private->handlingMouseDownEvent = NO; } @@ -21354,10 +22108,10 @@ index 1ef662de86f8b92a7a5c6414df2dac6dbb3882f0..793785e12f96fe52193e8c27ec8b0155 - (void)touch:(WebEvent *)event { diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm -index c892fdcdb2834ab3d93a4a0575b712c848b662c0..0e817f6ac6cf4e0bc04e1acd178ef976105d9b16 100644 +index e36b84e6c861fcef5102d881a037c2b414de0469..1a216224bf7b8fadba7033d785520d30050865c8 100644 --- a/Source/WebKitLegacy/mac/WebView/WebView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebView.mm -@@ -3979,7 +3979,7 @@ + (void)_doNotStartObservingNetworkReachability +@@ -3981,7 +3981,7 @@ + (void)_doNotStartObservingNetworkReachability } #endif // PLATFORM(IOS_FAMILY) @@ -21366,7 +22120,7 @@ index c892fdcdb2834ab3d93a4a0575b712c848b662c0..0e817f6ac6cf4e0bc04e1acd178ef976 - (NSArray *)_touchEventRegions { -@@ -4021,7 +4021,7 @@ - (NSArray *)_touchEventRegions +@@ -4023,7 +4023,7 @@ - (NSArray *)_touchEventRegions }).autorelease(); } @@ -21407,7 +22161,7 @@ index 0000000000000000000000000000000000000000..dd6a53e2d57318489b7e49dd7373706d + LIBVPX_LIBRARIES +) diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake -index 31085c5a7f8d4e1680887ff9f20de2d421256a62..d1374f5f68f26d166d9a6e4f1ae9a23dd9151e13 100644 +index 7528273e7832716ef8cb900f89728d4003130d92..32826feac62d3d4132df79febd01b8a8b9ce16ff 100644 --- a/Source/cmake/OptionsGTK.cmake +++ b/Source/cmake/OptionsGTK.cmake @@ -11,8 +11,13 @@ if (${CMAKE_VERSION} VERSION_LESS "3.20" AND NOT ${CMAKE_GENERATOR} STREQUAL "Ni @@ -21464,16 +22218,16 @@ index 31085c5a7f8d4e1680887ff9f20de2d421256a62..d1374f5f68f26d166d9a6e4f1ae9a23d WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_STREAM PRIVATE ON) @@ -131,7 +140,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION P WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE PRIVATE ON) - WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_OFFSCREEN_CANVAS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) - WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_OFFSCREEN_CANVAS_IN_WORKERS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_OFFSCREEN_CANVAS PRIVATE ON) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_OFFSCREEN_CANVAS_IN_WORKERS PRIVATE ON) -WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_THUNDER PRIVATE ${ENABLE_DEVELOPER_MODE}) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_THUNDER PRIVATE OFF) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PERIODIC_MEMORY_MONITOR PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_POINTER_LOCK PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHAREABLE_RESOURCE PRIVATE ON) -@@ -141,6 +150,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_API_STATISTICS PRIVATE ON) - WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CODECS PRIVATE ON) - WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) +@@ -149,6 +158,14 @@ else () + WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SKIA PRIVATE OFF) + endif () +# Playwright +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_APPLICATION_MANIFEST PRIVATE ON) @@ -21487,7 +22241,7 @@ index 31085c5a7f8d4e1680887ff9f20de2d421256a62..d1374f5f68f26d166d9a6e4f1ae9a23d # 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 e0c8dc92717c31173b6848b9f04856276125fb9d..24bbbae0654cded5197e6a4ce13246f71f5d5590 100644 +index a70706b67e0313e084eed2d1682ef85b296c80a6..21a610a7c0ddd838ed152bc1de4440ae4e6ff7ea 100644 --- a/Source/cmake/OptionsWPE.cmake +++ b/Source/cmake/OptionsWPE.cmake @@ -9,6 +9,8 @@ if (${CMAKE_VERSION} VERSION_LESS "3.20" AND NOT ${CMAKE_GENERATOR} STREQUAL "Ni @@ -21532,7 +22286,7 @@ index e0c8dc92717c31173b6848b9f04856276125fb9d..24bbbae0654cded5197e6a4ce13246f7 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_SESSION PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_SESSION_PLAYLIST PRIVATE OFF) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_STREAM PRIVATE ON) -@@ -72,7 +77,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_OFFSCREEN_CANVAS_IN_WORKERS PRIVATE ${EN +@@ -72,7 +77,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_OFFSCREEN_CANVAS_IN_WORKERS PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PERIODIC_MEMORY_MONITOR PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHAREABLE_RESOURCE PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPEECH_SYNTHESIS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) @@ -21541,7 +22295,7 @@ index e0c8dc92717c31173b6848b9f04856276125fb9d..24bbbae0654cded5197e6a4ce13246f7 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CODECS PRIVATE ON) -@@ -83,6 +88,23 @@ if (WPE_VERSION VERSION_GREATER_EQUAL 1.13.90) +@@ -91,6 +96,23 @@ if (WPE_VERSION VERSION_GREATER_EQUAL 1.13.90) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GAMEPAD PUBLIC ON) endif () @@ -21565,20 +22319,20 @@ index e0c8dc92717c31173b6848b9f04856276125fb9d..24bbbae0654cded5197e6a4ce13246f7 # 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. -@@ -92,7 +114,7 @@ WEBKIT_OPTION_DEFINE(ENABLE_JOURNALD_LOG "Whether to enable journald logging" PU +@@ -100,7 +122,7 @@ WEBKIT_OPTION_DEFINE(ENABLE_JOURNALD_LOG "Whether to enable journald logging" PU WEBKIT_OPTION_DEFINE(ENABLE_WPE_PLATFORM_DRM "Whether to enable support for DRM platform" PUBLIC ON) WEBKIT_OPTION_DEFINE(ENABLE_WPE_PLATFORM_HEADLESS "Whether to enable support for headless platform" PUBLIC ON) WEBKIT_OPTION_DEFINE(ENABLE_WPE_PLATFORM_WAYLAND "Whether to enable support for Wayland platform" PUBLIC ON) --WEBKIT_OPTION_DEFINE(ENABLE_WPE_QT_API "Whether to enable support for the Qt5/QML plugin" PUBLIC ${ENABLE_DEVELOPER_MODE}) -+WEBKIT_OPTION_DEFINE(ENABLE_WPE_QT_API "Whether to enable support for the Qt5/QML plugin" PUBLIC OFF) +-WEBKIT_OPTION_DEFINE(ENABLE_WPE_QT_API "Whether to enable support for the Qt/QML plugin" PUBLIC ${ENABLE_DEVELOPER_MODE}) ++WEBKIT_OPTION_DEFINE(ENABLE_WPE_QT_API "Whether to enable support for the Qt/QML plugin" PUBLIC OFF) WEBKIT_OPTION_DEFINE(ENABLE_WPE_1_1_API "Whether to build WPE 1.1 instead of WPE 2.0" PUBLIC OFF) WEBKIT_OPTION_DEFINE(USE_ATK "Whether to enable usage of ATK." PUBLIC ON) WEBKIT_OPTION_DEFINE(USE_GBM "Whether to enable usage of GBM." PUBLIC ON) diff --git a/Source/cmake/OptionsWin.cmake b/Source/cmake/OptionsWin.cmake -index 2ed9985c35980ba0fca09c2fc9ea5ab300b19b00..a5f773d071cb67025b16614a998bd09355061572 100644 +index 75b07257a0f116511fafc947e64f3f98f9086a82..5e65d3e455c9fb1f03551c4561e74247952a68e4 100644 --- a/Source/cmake/OptionsWin.cmake +++ b/Source/cmake/OptionsWin.cmake -@@ -86,6 +86,29 @@ find_package(ZLIB 1.2.11 REQUIRED) +@@ -67,6 +67,29 @@ find_package(ZLIB 1.2.11 REQUIRED) find_package(LibPSL 0.20.2 REQUIRED) find_package(WebP REQUIRED COMPONENTS demux) @@ -21608,7 +22362,7 @@ index 2ed9985c35980ba0fca09c2fc9ea5ab300b19b00..a5f773d071cb67025b16614a998bd093 WEBKIT_OPTION_BEGIN() # FIXME: Most of these options should not be public. -@@ -159,6 +182,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) +@@ -133,6 +156,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) @@ -21624,7 +22378,7 @@ index 2ed9985c35980ba0fca09c2fc9ea5ab300b19b00..a5f773d071cb67025b16614a998bd093 set(USE_ANGLE_EGL ON) diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake -index 26f8c4421bf45bb2f7e5f67ebd31ecfd9c0ddd3d..52ad063be9977fbbfa17ed0ae09676fd9455aef9 100644 +index edac4df57e4da23a7cdf234eefc3879c35c607c2..df575fa5d0c8574a8b248362167e160704bab41c 100644 --- a/Source/cmake/WebKitCompilerFlags.cmake +++ b/Source/cmake/WebKitCompilerFlags.cmake @@ -122,7 +122,7 @@ macro(WEBKIT_ADD_TARGET_CXX_FLAGS _target) @@ -21637,7 +22391,7 @@ index 26f8c4421bf45bb2f7e5f67ebd31ecfd9c0ddd3d..52ad063be9977fbbfa17ed0ae09676fd if (MSVC) set(FATAL_WARNINGS_FLAG /WX) diff --git a/Tools/DumpRenderTree/DerivedSources.make b/Tools/DumpRenderTree/DerivedSources.make -index 57aae19f1a16d08ba1579562eeff264c8768af4d..6ce36f40cc954bd02b86f84bd9a0bd2928459938 100644 +index 576835410df6deac60f0158f1d2d1ef1e5f4c78d..9b492cfe5fef8de340a80f2af70a7d68672ef2e4 100644 --- a/Tools/DumpRenderTree/DerivedSources.make +++ b/Tools/DumpRenderTree/DerivedSources.make @@ -73,8 +73,8 @@ $(IDL_FILE_NAMES_LIST) : $(UICONTEXT_INTERFACES:%=%.idl) @@ -21706,7 +22460,7 @@ index 61616b96e2f4e21aa6d098445e0f1a933e512a9c..33732da18013679a869ff8eb2b445434 } diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.c b/Tools/MiniBrowser/gtk/BrowserWindow.c -index bd00606c26b6fedb75978ed26a9b07f4b70828d8..8460a4ae5ff7461e3435fe2e704bb04e0a8bd0f8 100644 +index d39b809a879babcdbbf4b5f7687204df5ccc43f3..2862876cb515da09db653e71659d64215a636758 100644 --- a/Tools/MiniBrowser/gtk/BrowserWindow.c +++ b/Tools/MiniBrowser/gtk/BrowserWindow.c @@ -73,7 +73,7 @@ struct _BrowserWindowClass { @@ -21739,7 +22493,7 @@ index bd00606c26b6fedb75978ed26a9b07f4b70828d8..8460a4ae5ff7461e3435fe2e704bb04e gtk_window_set_title(GTK_WINDOW(window), privateTitle ? privateTitle : title); g_free(privateTitle); } -@@ -520,8 +514,12 @@ static gboolean webViewDecidePolicy(WebKitWebView *webView, WebKitPolicyDecision +@@ -524,8 +518,12 @@ static gboolean webViewDecidePolicy(WebKitWebView *webView, WebKitPolicyDecision return FALSE; WebKitNavigationAction *navigationAction = webkit_navigation_policy_decision_get_navigation_action(WEBKIT_NAVIGATION_POLICY_DECISION(decision)); @@ -21754,30 +22508,51 @@ index bd00606c26b6fedb75978ed26a9b07f4b70828d8..8460a4ae5ff7461e3435fe2e704bb04e return FALSE; /* Multiple tabs are not allowed in editor mode. */ -@@ -1498,6 +1496,12 @@ static gboolean browserWindowDeleteEvent(GtkWidget *widget, GdkEventAny* event) +@@ -1502,6 +1500,28 @@ static gboolean browserWindowDeleteEvent(GtkWidget *widget, GdkEventAny* event) } #endif ++#if GTK_CHECK_VERSION(3, 98, 0) ++static void zero_widget_measure (GtkWidget *widget, ++ GtkOrientation orientation, ++ int for_size, ++ int *minimum_size, ++ int *natural_size, ++ int *minimum_baseline, ++ int *natural_baseline) ++{ ++ *minimum_size = 10; ++ *natural_size = 10; ++ // *minimum_baseline = 10; ++ // *natural_baseline = 10; ++} ++#else +static void zeroPreferredSize(GtkWidget* widget, gint* minimumSize, gint* naturalSize) +{ + *minimumSize = 10; + *naturalSize = 10; +} ++#endif + static void browser_window_class_init(BrowserWindowClass *klass) { GObjectClass *gobjectClass = G_OBJECT_CLASS(klass); -@@ -1511,6 +1515,14 @@ static void browser_window_class_init(BrowserWindowClass *klass) +@@ -1515,6 +1535,19 @@ static void browser_window_class_init(BrowserWindowClass *klass) GtkWidgetClass *widgetClass = GTK_WIDGET_CLASS(klass); widgetClass->delete_event = browserWindowDeleteEvent; #endif + +// Playwrigth begin -+ // Override preferred (which is minimum :-) size to 0 so that we can -+ // emulate arbitrary resolution. ++// Override preferred (which is minimum :-) size to 0 so that we can ++// emulate arbitrary resolution. ++#if GTK_CHECK_VERSION(3, 98, 0) ++ GtkWidgetClass* browserWidgetClass = GTK_WIDGET_CLASS(klass); ++ browserWidgetClass->measure = zero_widget_measure; ++#else + GtkWidgetClass* browserWidgetClass = GTK_WIDGET_CLASS(klass); + browserWidgetClass->get_preferred_width = zeroPreferredSize; + browserWidgetClass->get_preferred_height = zeroPreferredSize; ++#endif +// Playwrigth end } @@ -21796,10 +22571,10 @@ index 1fd07efb828b85b6d8def6c6cd92a0c11debfe1b..da9fac7975d477857ead2adb1d67108d typedef struct _BrowserWindow BrowserWindow; diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c -index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee6c664754 100644 +index 0dd4a639e69f52e674c6bbe257e35daabd25d077..1c0af52edd19d19d30136158f25ede2618bb386a 100644 --- a/Tools/MiniBrowser/gtk/main.c +++ b/Tools/MiniBrowser/gtk/main.c -@@ -75,7 +75,12 @@ static char* timeZone; +@@ -75,9 +75,14 @@ static char* timeZone; static gboolean enableITP; static gboolean exitAfterLoad; static gboolean webProcessCrashed; @@ -21808,14 +22583,16 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee +static gboolean noStartupWindow; +static const char *userDataDir; static gboolean printVersion; + static char *configFile; + static GSettings *interfaceSettings; +static GtkApplication *browserApplication = NULL; #if !GTK_CHECK_VERSION(3, 98, 0) static gboolean enableSandbox; -@@ -179,6 +184,10 @@ static const GOptionEntry commandLineOptions[] = - { "exit-after-load", 0, 0, G_OPTION_ARG_NONE, &exitAfterLoad, "Quit the browser after the load finishes", NULL }, +@@ -182,6 +187,10 @@ static const GOptionEntry commandLineOptions[] = { "time-zone", 't', 0, G_OPTION_ARG_STRING, &timeZone, "Set time zone", "TIMEZONE" }, { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WebKitGTK version", NULL }, + { "config", 'C', 0, G_OPTION_ARG_FILENAME, &configFile, "Path to a configuration file", "PATH" }, + { "inspector-pipe", 0, 0, G_OPTION_ARG_NONE, &inspectorPipe, "Open pipe connection to the remote inspector", NULL }, + { "user-data-dir", 0, 0, G_OPTION_ARG_STRING, &userDataDir, "Default profile persistence folder location", NULL }, + { "headless", 0, 0, G_OPTION_ARG_NONE, &headless, "Noop headless operation", NULL }, @@ -21823,15 +22600,20 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" }, { 0, 0, 0, 0, 0, 0, 0 } }; -@@ -736,6 +745,57 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul +@@ -739,6 +748,70 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul g_main_loop_quit(data->mainLoop); } +static WebKitSettings* createPlaywrightSettings() { + WebKitSettings* webkitSettings = webkit_settings_new(); ++#if GTK_CHECK_VERSION(3, 98, 0) ++ // FIXME(Playwright): in GTK4, WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS is the default, but the page content is just black in that case. ++ webkit_settings_set_hardware_acceleration_policy(webkitSettings, WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER); ++#else + // Playwright: revert to the default state before https://github.com/WebKit/WebKit/commit/a73a25b9ea9229987c8fa7b2e092e6324cb17913 + webkit_settings_set_hardware_acceleration_policy(webkitSettings, WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER); + webkit_settings_set_hardware_acceleration_policy(webkitSettings, WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND); ++#endif + return webkitSettings; +} + @@ -21845,10 +22627,18 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee + WebKitWebView *newWebView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, + "web-context", context, + "settings", createPlaywrightSettings(), ++#if GTK_CHECK_VERSION(3, 98, 0) ++ "network-session", webkit_web_context_get_network_session_for_automation(context), ++#else + "is-ephemeral", webkit_web_context_is_ephemeral(context), ++#endif + "is-controlled-by-automation", TRUE, + NULL)); ++#if GTK_CHECK_VERSION(3, 98, 0) ++ GtkWidget *newWindow = browser_window_new(NULL, context, webkit_web_context_get_network_session_for_automation(context)); ++#else + GtkWidget *newWindow = browser_window_new(NULL, context); ++#endif + gtk_window_set_application(GTK_WINDOW(newWindow), browserApplication); + browser_window_append_view(BROWSER_WINDOW(newWindow), newWebView); + gtk_widget_grab_focus(GTK_WIDGET(newWebView)); @@ -21881,7 +22671,7 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee static void startup(GApplication *application) { const char *actionAccels[] = { -@@ -766,6 +826,14 @@ static void startup(GApplication *application) +@@ -797,17 +870,30 @@ static void setupDarkMode(GtkSettings *settings) static void activate(GApplication *application, WebKitSettings *webkitSettings) { @@ -21896,7 +22686,36 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee #if GTK_CHECK_VERSION(3, 98, 0) WebKitWebContext *webContext = g_object_new(WEBKIT_TYPE_WEB_CONTEXT, "time-zone-override", timeZone, NULL); webkit_web_context_set_automation_allowed(webContext, automationMode); -@@ -818,9 +886,12 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) + g_signal_connect(webContext, "automation-started", G_CALLBACK(automationStartedCallback), application); + + WebKitNetworkSession *networkSession; +- if (automationMode) +- networkSession = g_object_ref(webkit_web_context_get_network_session_for_automation(webContext)); +- else if (privateMode) ++ if (userDataDir) { ++ char *dataDirectory = g_build_filename(userDataDir, "data", NULL); ++ char *cacheDirectory = g_build_filename(userDataDir, "cache", NULL); ++ networkSession = webkit_network_session_new(dataDirectory, cacheDirectory); ++ g_free(dataDirectory); ++ g_free(cacheDirectory); ++ cookiesFile = g_build_filename(userDataDir, "cookies.txt", NULL); ++ } else if (inspectorPipe || privateMode || automationMode) { + networkSession = webkit_network_session_new_ephemeral(); +- else { ++ } else { + char *dataDirectory = g_build_filename(g_get_user_data_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL); + char *cacheDirectory = g_build_filename(g_get_user_cache_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL); + networkSession = webkit_network_session_new(dataDirectory, cacheDirectory); +@@ -815,6 +901,8 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) + g_free(cacheDirectory); + } + ++ webkit_web_context_set_network_session_for_automation(webContext, networkSession); ++ + webkit_network_session_set_itp_enabled(networkSession, enableITP); + + if (!automationMode) { +@@ -849,9 +937,12 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) } #else WebKitWebsiteDataManager *manager; @@ -21911,7 +22730,7 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee char *dataDirectory = g_build_filename(g_get_user_data_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL); char *cacheDirectory = g_build_filename(g_get_user_cache_dir(), "webkitgtk-" WEBKITGTK_API_VERSION, "MiniBrowser", NULL); manager = webkit_website_data_manager_new("base-data-directory", dataDirectory, "base-cache-directory", cacheDirectory, NULL); -@@ -871,6 +942,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) +@@ -901,6 +992,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) // Enable the favicon database. webkit_web_context_set_favicon_database_directory(webContext, NULL); #endif @@ -21919,7 +22738,7 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee webkit_web_context_register_uri_scheme(webContext, BROWSER_ABOUT_SCHEME, (WebKitURISchemeRequestCallback)aboutURISchemeRequestCallback, NULL, NULL); -@@ -941,9 +1013,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) +@@ -970,9 +1062,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings) if (exitAfterLoad) exitAfterWebViewLoadFinishes(webView, application); } @@ -21930,7 +22749,7 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee } } else { WebKitWebView *webView = createBrowserTab(mainWindow, webkitSettings, userContentManager, defaultWebsitePolicies); -@@ -993,7 +1063,7 @@ int main(int argc, char *argv[]) +@@ -1022,7 +1112,7 @@ int main(int argc, char *argv[]) g_option_context_add_group(context, gst_init_get_option_group()); #endif @@ -21939,7 +22758,7 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee webkit_settings_set_enable_developer_extras(webkitSettings, TRUE); webkit_settings_set_enable_webgl(webkitSettings, TRUE); webkit_settings_set_enable_media_stream(webkitSettings, TRUE); -@@ -1025,9 +1095,11 @@ int main(int argc, char *argv[]) +@@ -1074,9 +1164,11 @@ int main(int argc, char *argv[]) } GtkApplication *application = gtk_application_new("org.webkitgtk.MiniBrowser", G_APPLICATION_NON_UNIQUE); @@ -21950,12 +22769,12 @@ index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee + browserApplication = NULL; g_object_unref(application); - return exitAfterLoad && webProcessCrashed ? 1 : 0; + g_clear_object(&interfaceSettings); diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp -index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780bbc2afa3 100644 +index d340d90d8d6650b8499cf5593df481e06a3178a3..8534bc30f863e4eafdb1cc7b205034d35bd3c0ff 100644 --- a/Tools/MiniBrowser/wpe/main.cpp +++ b/Tools/MiniBrowser/wpe/main.cpp -@@ -45,6 +45,9 @@ static gboolean headlessMode; +@@ -49,6 +49,9 @@ static gboolean headlessMode; static gboolean privateMode; static gboolean automationMode; static gboolean ignoreTLSErrors; @@ -21965,9 +22784,9 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 static const char* contentFilter; static const char* cookiesFile; static const char* cookiesPolicy; -@@ -78,6 +81,9 @@ static const GOptionEntry commandLineOptions[] = - { "use-wpe-platform-api", 0, 0, G_OPTION_ARG_NONE, &useWPEPlatformAPI, "Use the WPE platform API", nullptr }, +@@ -125,6 +128,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 }, + { "inspector-pipe", 'v', 0, G_OPTION_ARG_NONE, &inspectorPipe, "Expose remote debugging protocol over pipe", nullptr }, + { "user-data-dir", 0, 0, G_OPTION_ARG_STRING, &userDataDir, "Default profile persistence folder location", "FILE" }, @@ -21975,7 +22794,7 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" }, { nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr } }; -@@ -220,15 +226,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul +@@ -276,15 +282,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul g_main_loop_quit(data->mainLoop); } @@ -22014,9 +22833,9 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 + +static WebKitWebView* createWebViewImpl(WebKitWebView* webView, WebKitWebContext *webContext, gpointer user_data) { - - auto backend = createViewBackend(1280, 720); -@@ -244,18 +273,37 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi + auto backend = createViewBackend(defaultWindowWidthLegacyAPI, defaultWindowHeightLegacyAPI); + WebKitWebViewBackend* viewBackend = nullptr; +@@ -299,12 +328,27 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi }, backend.release()); } @@ -22048,8 +22867,9 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 + nullptr)); + } - g_signal_connect(newWebView, "create", G_CALLBACK(createWebView), user_data); - g_signal_connect(newWebView, "close", G_CALLBACK(webViewClose), user_data); + #if ENABLE_WPE_PLATFORM + if (auto* wpeView = webkit_web_view_get_wpe_view(newWebView)) { +@@ -319,6 +363,10 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi g_hash_table_add(openViews, newWebView); @@ -22060,7 +22880,7 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 return newWebView; } -@@ -269,13 +317,89 @@ static WebKitFeature* findFeature(WebKitFeatureList* featureList, const char* id +@@ -376,13 +424,89 @@ static WebKitFeature* findFeature(WebKitFeatureList* featureList, const char* id return nullptr; } @@ -22117,7 +22937,7 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 + return webView; +} + -+static void quitBroserApplication(WebKitBrowserInspector* browser_inspector, gpointer data) ++static void quitBroserApplication(WebKitBrowserInspector*, gpointer data) +{ + GApplication* application = static_cast(data); + g_application_quit(application); @@ -22151,7 +22971,7 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 webkit_network_session_set_itp_enabled(networkSession, enableITP); if (proxy) { -@@ -302,10 +426,18 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -409,10 +533,18 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* webkit_cookie_manager_set_persistent_storage(cookieManager, cookiesFile, storageType); } } @@ -22172,7 +22992,7 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 webkit_website_data_manager_set_itp_enabled(manager, enableITP); if (proxy) { -@@ -336,6 +468,7 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -443,6 +575,7 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* } #endif @@ -22180,7 +23000,7 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 WebKitUserContentManager* userContentManager = nullptr; if (contentFilter) { GFile* contentFilterFile = g_file_new_for_commandline_arg(contentFilter); -@@ -408,6 +541,15 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -521,6 +654,15 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* "autoplay", WEBKIT_AUTOPLAY_ALLOW, nullptr); @@ -22196,16 +23016,16 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, "backend", viewBackend, "web-context", webContext, -@@ -436,8 +578,6 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* - g_signal_connect(wpeView, "event", G_CALLBACK(wpeViewEventCallback), webView); +@@ -565,8 +707,6 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* + } #endif - openViews = g_hash_table_new_full(nullptr, nullptr, g_object_unref, nullptr); - - webkit_web_context_set_automation_allowed(webContext, automationMode); g_signal_connect(webContext, "automation-started", G_CALLBACK(automationStartedCallback), webView); g_signal_connect(webView, "permission-request", G_CALLBACK(decidePermissionRequest), nullptr); -@@ -450,16 +590,9 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* + g_signal_connect(webView, "create", G_CALLBACK(createWebView), application); +@@ -578,16 +718,11 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* webkit_web_view_set_background_color(webView, &color); if (uriArguments) { @@ -22218,14 +23038,16 @@ index 3c2476471ef67299da6312d0f995fc0738aa96c9..b13ab78bfe62c8c2cdd052e24255a780 - g_object_unref(file); - webkit_web_view_load_uri(webView, url); - g_free(url); -- } else if (automationMode) +- } else if (!automationMode) + // Playwright: avoid weird url transformation like http://trac.webkit.org/r240840 + webkit_web_view_load_uri(webView, uriArguments[0]); + } else if (automationMode || inspectorPipe) - webkit_web_view_load_uri(webView, "about:blank"); - else ++ webkit_web_view_load_uri(webView, "about:blank"); ++ else webkit_web_view_load_uri(webView, "https://wpewebkit.org"); -@@ -533,8 +666,14 @@ int main(int argc, char *argv[]) + + g_object_unref(webContext); +@@ -683,8 +818,14 @@ int main(int argc, char *argv[]) } } @@ -22253,7 +23075,7 @@ index 1067b31bc989748dfcc5502209d36d001b9b239e..7629263fb8bc93dca6dfc01c75eed8d2 + add_subdirectory(Playwright/win) +endif () diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit -index 39c351abbdd7b1b7f7016c5fd071ec2ae59b4a42..dc804e1d5284b15da6fa0679932d6cca8ece499a 100755 +index 39f91de9501cf38331ce567d30c9cefa25b28510..af2eeec87bb43f9ddfc6d583c35a8e7a87d5127c 100755 --- a/Tools/Scripts/build-webkit +++ b/Tools/Scripts/build-webkit @@ -273,7 +273,7 @@ if (isAppleCocoaWebKit()) { @@ -22281,7 +23103,7 @@ 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 244cfc247fa50bf073ba523913543cab0c6f1b3b..d1cd4657f513d1be167f8d1176dc1217f57acbbd 100644 +index 076ad1f7005f732f8529955cfe3b6a8dd5212949..dee6f57eb5fff12de9cdaad230e894b0b9b15b88 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp @@ -964,6 +964,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) @@ -22349,7 +23171,7 @@ index c7c925b66ea04d8f7a44fb7410ad45acb74f022f..b4738697e5ecb5c947d2bc1864a0f390 + } // namespace WTR diff --git a/Tools/glib/dependencies/apt b/Tools/glib/dependencies/apt -index 7ae5cb94f966df2b730fc54489abf1d8174ed390..c1baaeb0a411ad80d9f6771bd8a3811c4d71d337 100644 +index 75ba644cfef7cc80b1520802e149dbc1246d9061..f8ed0d79ec83a2ad4362bf3d6b08a7584c8bc763 100644 --- a/Tools/glib/dependencies/apt +++ b/Tools/glib/dependencies/apt @@ -1,11 +1,11 @@ @@ -22394,7 +23216,7 @@ index 1e2a9202f88c63afa6525d97d0f945438f5f2032..e6cdee08aff723eb5c6b16491051ca39 # These are dependencies necessary for running tests. cups-daemon diff --git a/Tools/gtk/jhbuild.modules b/Tools/gtk/jhbuild.modules -index 5453eb855928744d58e459f8a986535825dc29a0..b7d9568aef262d8e2825569b021ea0f5d0923ba0 100644 +index 5453eb855928744d58e459f8a986535825dc29a0..71cf6b873863e06d908c924e545eb9d94be52ab6 100644 --- a/Tools/gtk/jhbuild.modules +++ b/Tools/gtk/jhbuild.modules @@ -252,10 +252,10 @@ @@ -22403,16 +23225,29 @@ index 5453eb855928744d58e459f8a986535825dc29a0..b7d9568aef262d8e2825569b021ea0f5 - -+ hash="sha256:83673c685b910fb7d39f1f28eee5afbefb71c05798fc350ac3bf1b885e1efaa1"> ++ hash="sha256:291c67725f36ed90ea43efff25064b69c5a2d1981488477c05c481a3b4b0c5aa"> +@@ -378,9 +378,9 @@ + + libdrm.pc + + + diff --git a/Tools/jhbuild/jhbuild-minimal.modules b/Tools/jhbuild/jhbuild-minimal.modules -index fe58a444522de94d8f2a57c538a8e7bca93e5c74..78fd69a2a98cb0a826cba13f95c3f419b4376045 100644 +index 056c4052b8ee34b35262f7f24b11dae4168d3a02..4455a928333323afeff87f56a4ab983ecac7f2b6 100644 --- a/Tools/jhbuild/jhbuild-minimal.modules +++ b/Tools/jhbuild/jhbuild-minimal.modules @@ -32,7 +32,6 @@ @@ -22423,21 +23258,37 @@ index fe58a444522de94d8f2a57c538a8e7bca93e5c74..78fd69a2a98cb0a826cba13f95c3f419 -@@ -132,10 +131,10 @@ +@@ -121,23 +120,22 @@ + + libdrm.pc + + + + +- libsoup-3.0.pc + + - -+ hash="sha256:83673c685b910fb7d39f1f28eee5afbefb71c05798fc350ac3bf1b885e1efaa1"> ++ hash="sha256:291c67725f36ed90ea43efff25064b69c5a2d1981488477c05c481a3b4b0c5aa"> -@@ -231,6 +230,16 @@ +@@ -233,6 +231,16 @@ @@ -22445,9 +23296,9 @@ index fe58a444522de94d8f2a57c538a8e7bca93e5c74..78fd69a2a98cb0a826cba13f95c3f419 + + libdrm.pc + + + @@ -22517,32 +23368,37 @@ index 05b0196555fbc993ebff3088c1f5926c4cfe391a..dd82d6c324f158045372fb48552fa919 static cairo_user_data_key_t bufferKey; cairo_surface_set_user_data(m_snapshot, &bufferKey, buffer, diff --git a/Tools/wpe/jhbuild.modules b/Tools/wpe/jhbuild.modules -index 33286bb2ee2941d430d8e49dba667f700f73edc4..77cea8a9d0e1762da2545852698fdd16dd9bab37 100644 +index 33286bb2ee2941d430d8e49dba667f700f73edc4..98e87967086e5d606de4695389608a68629423da 100644 --- a/Tools/wpe/jhbuild.modules +++ b/Tools/wpe/jhbuild.modules -@@ -20,6 +20,7 @@ - - - -+ - - - -@@ -102,10 +103,10 @@ +@@ -102,10 +102,10 @@ - -+ hash="sha256:83673c685b910fb7d39f1f28eee5afbefb71c05798fc350ac3bf1b885e1efaa1"> ++ hash="sha256:291c67725f36ed90ea43efff25064b69c5a2d1981488477c05c481a3b4b0c5aa"> -@@ -334,6 +335,16 @@ +@@ -161,9 +161,9 @@ + + libdrm.pc + + + +@@ -334,6 +334,16 @@ hash="sha256:c625a83b4838befc8cafcd54e3619946515d9e44d63d61c4adf7f5513ddfbebf"/> @@ -22550,9 +23406,9 @@ index 33286bb2ee2941d430d8e49dba667f700f73edc4..77cea8a9d0e1762da2545852698fdd16 + + libdrm.pc + + + diff --git a/browser_patches/winldd/archive.sh b/browser_patches/winldd/archive.sh index 02fd1ab8bb..898dcb8258 100755 --- a/browser_patches/winldd/archive.sh +++ b/browser_patches/winldd/archive.sh @@ -39,5 +39,4 @@ fi # create a TMP directory to copy all necessary files cd ./x64/Release -zip $ZIP_PATH ./PrintDeps.exe - +7z a "$ZIP_PATH" ./PrintDeps.exe diff --git a/docs/src/accessibility-testing-java.md b/docs/src/accessibility-testing-java.md index 15bb998481..d62bac64fa 100644 --- a/docs/src/accessibility-testing-java.md +++ b/docs/src/accessibility-testing-java.md @@ -14,8 +14,6 @@ A few examples of problems this can catch include: The following examples rely on the [`com.deque.html.axe-core/playwright`](https://mvnrepository.com/artifact/com.deque.html.axe-core/playwright) Maven package which adds support for running the [axe accessibility testing engine](https://www.deque.com/axe/) as part of your Playwright tests. - - ## Disclaimer Automated accessibility tests can detect some common accessibility problems such as missing or invalid properties. But many accessibility problems can only be discovered through manual testing. We recommend using a combination of automated testing, manual accessibility assessments, and inclusive user testing. @@ -135,7 +133,7 @@ If the element in question is used repeatedly in many pages, consider [using a t ### Disabling individual scan rules -If your application contains many different pre-existing violations of a specific rule, you can use [`AxeBuilder.disableRules()`](https://github.com/dequelabs/axe-core-maven-html/blob/develop/playwright/README.md#axebuilderdisablerulesliststring-rules) to temporarily disable individual rules until you're able to fix the issues. +If your application contains many different preexisting violations of a specific rule, you can use [`AxeBuilder.disableRules()`](https://github.com/dequelabs/axe-core-maven-html/blob/develop/playwright/README.md#axebuilderdisablerulesliststring-rules) to temporarily disable individual rules until you're able to fix the issues. You can find the rule IDs to pass to `disableRules()` in the `id` property of the violations you want to suppress. A [complete list of axe's rules](https://github.com/dequelabs/axe-core/blob/master/doc/rule-descriptions.md) can be found in `axe-core`'s documentation. diff --git a/docs/src/accessibility-testing-js.md b/docs/src/accessibility-testing-js.md index 96fe1f1865..65db5ae55c 100644 --- a/docs/src/accessibility-testing-js.md +++ b/docs/src/accessibility-testing-js.md @@ -147,7 +147,7 @@ If the element in question is used repeatedly in many pages, consider [using a t ### Disabling individual scan rules -If your application contains many different pre-existing violations of a specific rule, you can use [`AxeBuilder.disableRules()`](https://github.com/dequelabs/axe-core-npm/blob/develop/packages/playwright/README.md#axebuilderdisablerulesrules-stringarray) to temporarily disable individual rules until you're able to fix the issues. +If your application contains many different preexisting violations of a specific rule, you can use [`AxeBuilder.disableRules()`](https://github.com/dequelabs/axe-core-npm/blob/develop/packages/playwright/README.md#axebuilderdisablerulesrules-stringarray) to temporarily disable individual rules until you're able to fix the issues. You can find the rule IDs to pass to `disableRules()` in the `id` property of the violations you want to suppress. A [complete list of axe's rules](https://github.com/dequelabs/axe-core/blob/master/doc/rule-descriptions.md) can be found in `axe-core`'s documentation. @@ -167,7 +167,7 @@ test('should not have any accessibility violations outside of rules with known i ### Using snapshots to allow specific known issues -If you would like to allow for a more granular set of known issues, you can use [Snapshots](./test-snapshots.md) to verify that a set of pre-existing violations has not changed. This approach avoids the downsides of using `AxeBuilder.exclude()` at the cost of slightly more complexity and fragility. +If you would like to allow for a more granular set of known issues, you can use [Snapshots](./test-snapshots.md) to verify that a set of preexisting violations has not changed. This approach avoids the downsides of using `AxeBuilder.exclude()` at the cost of slightly more complexity and fragility. Do not use a snapshot of the entire `accessibilityScanResults.violations` array. It contains implementation details of the elements in question, such as a snippet of their rendered HTML; if you include these in your snapshots, it will make your tests prone to breaking every time one of the components in question changes for an unrelated reason: diff --git a/docs/src/api-testing-csharp.md b/docs/src/api-testing-csharp.md index f68ff8a8f7..6a8482e244 100644 --- a/docs/src/api-testing-csharp.md +++ b/docs/src/api-testing-csharp.md @@ -18,8 +18,6 @@ All of that could be achieved via [APIRequestContext] methods. The following examples rely on the [`Microsoft.Playwright.MSTest`](./test-runners.md) package which creates a Playwright and Page instance for each test. - - ## Writing API Test [APIRequestContext] can send all kinds of HTTP(S) requests over network. diff --git a/docs/src/api-testing-java.md b/docs/src/api-testing-java.md index 41265776a5..987aad5de8 100644 --- a/docs/src/api-testing-java.md +++ b/docs/src/api-testing-java.md @@ -16,8 +16,6 @@ A few examples where it may come in handy: All of that could be achieved via [APIRequestContext] methods. - - ## Writing API Test [APIRequestContext] can send all kinds of HTTP(S) requests over network. diff --git a/docs/src/api-testing-js.md b/docs/src/api-testing-js.md index 680b085a3c..325d9984b4 100644 --- a/docs/src/api-testing-js.md +++ b/docs/src/api-testing-js.md @@ -16,8 +16,6 @@ A few examples where it may come in handy: All of that could be achieved via [APIRequestContext] methods. - - ## Writing API Test [APIRequestContext] can send all kinds of HTTP(S) requests over network. diff --git a/docs/src/api-testing-python.md b/docs/src/api-testing-python.md index 9930605a52..68f2626111 100644 --- a/docs/src/api-testing-python.md +++ b/docs/src/api-testing-python.md @@ -18,8 +18,6 @@ All of that could be achieved via [APIRequestContext] methods. The following examples rely on the [`pytest-playwright`](./test-runners.md) package which add Playwright fixtures to the Pytest test-runner. - - ## Writing API Test [APIRequestContext] can send all kinds of HTTP(S) requests over network. diff --git a/docs/src/api/class-apirequest.md b/docs/src/api/class-apirequest.md index 164de27b2e..2f832e1dd8 100644 --- a/docs/src/api/class-apirequest.md +++ b/docs/src/api/class-apirequest.md @@ -12,6 +12,9 @@ see [APIRequestContext]. Creates new instances of [APIRequestContext]. +### option: APIRequest.newContext.clientCertificates = %%-context-option-clientCertificates-%% +* since: 1.46 + ### option: APIRequest.newContext.useragent = %%-context-option-useragent-%% * since: v1.16 diff --git a/docs/src/api/class-apirequestcontext.md b/docs/src/api/class-apirequestcontext.md index dab99bec2b..f56087d1bd 100644 --- a/docs/src/api/class-apirequestcontext.md +++ b/docs/src/api/class-apirequestcontext.md @@ -138,22 +138,31 @@ context cookies from the response. The method will automatically follow redirect ### param: APIRequestContext.delete.url = %%-fetch-param-url-%% * since: v1.16 -### param: APIRequestContext.delete.params = %%-java-csharp-fetch-params-%% +### option: APIRequestContext.delete.params = %%-js-fetch-option-params-%% +* since: v1.16 + +### param: APIRequestContext.delete.params = %%-java-fetch-params-%% * since: v1.18 -### option: APIRequestContext.delete.params = %%-js-python-fetch-option-params-%% +### option: APIRequestContext.delete.params = %%-python-fetch-option-params-%% * since: v1.16 ### option: APIRequestContext.delete.params = %%-csharp-fetch-option-params-%% * since: v1.16 +### option: APIRequestContext.delete.paramsString = %%-csharp-fetch-option-paramsString-%% +* since: v1.47 + ### option: APIRequestContext.delete.headers = %%-js-python-csharp-fetch-option-headers-%% * since: v1.16 ### option: APIRequestContext.delete.data = %%-js-python-csharp-fetch-option-data-%% * since: v1.17 -### option: APIRequestContext.delete.form = %%-js-python-fetch-option-form-%% +### option: APIRequestContext.delete.form = %%-js-fetch-option-form-%% +* since: v1.17 + +### option: APIRequestContext.delete.form = %%-python-fetch-option-form-%% * since: v1.17 ### option: APIRequestContext.delete.form = %%-csharp-fetch-option-form-%% @@ -180,6 +189,9 @@ context cookies from the response. The method will automatically follow redirect ### option: APIRequestContext.delete.maxRedirects = %%-js-python-csharp-fetch-option-maxredirects-%% * since: v1.26 +### option: APIRequestContext.delete.maxRetries = %%-js-python-csharp-fetch-option-maxretries-%% +* since: v1.46 + ## async method: APIRequestContext.dispose * since: v1.16 @@ -294,15 +306,21 @@ await Request.FetchAsync("https://example.com/api/uploadScript", new() { Method Target URL or Request to get all parameters from. -### param: APIRequestContext.fetch.params = %%-java-csharp-fetch-params-%% +### option: APIRequestContext.fetch.params = %%-js-fetch-option-params-%% +* since: v1.16 + +### param: APIRequestContext.fetch.params = %%-java-fetch-params-%% * since: v1.18 -### option: APIRequestContext.fetch.params = %%-js-python-fetch-option-params-%% +### option: APIRequestContext.fetch.params = %%-python-fetch-option-params-%% * since: v1.16 ### option: APIRequestContext.fetch.params = %%-csharp-fetch-option-params-%% * since: v1.16 +### option: APIRequestContext.fetch.paramsString = %%-csharp-fetch-option-paramsString-%% +* since: v1.47 + ### option: APIRequestContext.fetch.method * since: v1.16 * langs: js, python, csharp @@ -317,7 +335,10 @@ If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/ ### option: APIRequestContext.fetch.data = %%-js-python-csharp-fetch-option-data-%% * since: v1.16 -### option: APIRequestContext.fetch.form = %%-js-python-fetch-option-form-%% +### option: APIRequestContext.fetch.form = %%-js-fetch-option-form-%% +* since: v1.16 + +### option: APIRequestContext.fetch.form = %%-python-fetch-option-form-%% * since: v1.16 ### option: APIRequestContext.fetch.form = %%-csharp-fetch-option-form-%% @@ -360,12 +381,24 @@ context cookies from the response. The method will automatically follow redirect Request parameters can be configured with `params` option, they will be serialized into the URL search parameters: ```js +// Passing params as object await request.get('https://example.com/api/getText', { params: { 'isbn': '1234', 'page': 23, } }); + +// Passing params as URLSearchParams +const searchParams = new URLSearchParams(); +searchParams.set('isbn', '1234'); +searchParams.append('page', 23); +searchParams.append('page', 24); +await request.get('https://example.com/api/getText', { params: searchParams }); + +// Passing params as string +const queryString = 'isbn=1234&page=23&page=24'; +await request.get('https://example.com/api/getText', { params: queryString }); ``` ```java @@ -394,22 +427,31 @@ await request.GetAsync("https://example.com/api/getText", new() { Params = query ### param: APIRequestContext.get.url = %%-fetch-param-url-%% * since: v1.16 -### param: APIRequestContext.get.params = %%-java-csharp-fetch-params-%% +### option: APIRequestContext.get.params = %%-js-fetch-option-params-%% +* since: v1.16 + +### param: APIRequestContext.get.params = %%-java-fetch-params-%% * since: v1.18 -### option: APIRequestContext.get.params = %%-js-python-fetch-option-params-%% +### option: APIRequestContext.get.params = %%-python-fetch-option-params-%% * since: v1.16 ### option: APIRequestContext.get.params = %%-csharp-fetch-option-params-%% * since: v1.16 +### option: APIRequestContext.get.paramsString = %%-csharp-fetch-option-paramsString-%% +* since: v1.47 + ### option: APIRequestContext.get.headers = %%-js-python-csharp-fetch-option-headers-%% * since: v1.16 ### option: APIRequestContext.get.data = %%-js-python-csharp-fetch-option-data-%% * since: v1.26 -### option: APIRequestContext.get.form = %%-js-python-fetch-option-form-%% +### option: APIRequestContext.get.form = %%-js-fetch-option-form-%% +* since: v1.26 + +### option: APIRequestContext.get.form = %%-python-fetch-option-form-%% * since: v1.26 ### option: APIRequestContext.get.form = %%-csharp-fetch-option-form-%% @@ -450,22 +492,31 @@ context cookies from the response. The method will automatically follow redirect ### param: APIRequestContext.head.url = %%-fetch-param-url-%% * since: v1.16 -### param: APIRequestContext.head.params = %%-java-csharp-fetch-params-%% +### option: APIRequestContext.head.params = %%-js-fetch-option-params-%% +* since: v1.16 + +### param: APIRequestContext.head.params = %%-java-fetch-params-%% * since: v1.18 -### option: APIRequestContext.head.params = %%-js-python-fetch-option-params-%% +### option: APIRequestContext.head.params = %%-python-fetch-option-params-%% * since: v1.16 ### option: APIRequestContext.head.params = %%-csharp-fetch-option-params-%% * since: v1.16 +### option: APIRequestContext.head.paramsString = %%-csharp-fetch-option-paramsString-%% +* since: v1.47 + ### option: APIRequestContext.head.headers = %%-js-python-csharp-fetch-option-headers-%% * since: v1.16 ### option: APIRequestContext.head.data = %%-js-python-csharp-fetch-option-data-%% * since: v1.26 -### option: APIRequestContext.head.form = %%-js-python-fetch-option-form-%% +### option: APIRequestContext.head.form = %%-python-fetch-option-form-%% +* since: v1.26 + +### option: APIRequestContext.head.form = %%-js-fetch-option-form-%% * since: v1.26 ### option: APIRequestContext.head.form = %%-csharp-fetch-option-form-%% @@ -506,22 +557,31 @@ context cookies from the response. The method will automatically follow redirect ### param: APIRequestContext.patch.url = %%-fetch-param-url-%% * since: v1.16 -### param: APIRequestContext.patch.params = %%-java-csharp-fetch-params-%% +### option: APIRequestContext.patch.params = %%-js-fetch-option-params-%% +* since: v1.16 + +### param: APIRequestContext.patch.params = %%-java-fetch-params-%% * since: v1.18 -### option: APIRequestContext.patch.params = %%-js-python-fetch-option-params-%% +### option: APIRequestContext.patch.params = %%-python-fetch-option-params-%% * since: v1.16 ### option: APIRequestContext.patch.params = %%-csharp-fetch-option-params-%% * since: v1.16 +### option: APIRequestContext.patch.paramsString = %%-csharp-fetch-option-paramsString-%% +* since: v1.47 + ### option: APIRequestContext.patch.headers = %%-js-python-csharp-fetch-option-headers-%% * since: v1.16 ### option: APIRequestContext.patch.data = %%-js-python-csharp-fetch-option-data-%% * since: v1.16 -### option: APIRequestContext.patch.form = %%-js-python-fetch-option-form-%% +### option: APIRequestContext.patch.form = %%-js-fetch-option-form-%% +* since: v1.16 + +### option: APIRequestContext.patch.form = %%-python-fetch-option-form-%% * since: v1.16 ### option: APIRequestContext.patch.form = %%-csharp-fetch-option-form-%% @@ -683,22 +743,31 @@ await request.PostAsync("https://example.com/api/uploadScript", new() { Multipar ### param: APIRequestContext.post.url = %%-fetch-param-url-%% * since: v1.16 -### param: APIRequestContext.post.params = %%-java-csharp-fetch-params-%% +### option: APIRequestContext.post.params = %%-js-fetch-option-params-%% +* since: v1.16 + +### param: APIRequestContext.post.params = %%-java-fetch-params-%% * since: v1.18 -### option: APIRequestContext.post.params = %%-js-python-fetch-option-params-%% +### option: APIRequestContext.post.params = %%-python-fetch-option-params-%% * since: v1.16 ### option: APIRequestContext.post.params = %%-csharp-fetch-option-params-%% * since: v1.16 +### option: APIRequestContext.post.paramsString = %%-csharp-fetch-option-paramsString-%% +* since: v1.47 + ### option: APIRequestContext.post.headers = %%-js-python-csharp-fetch-option-headers-%% * since: v1.16 ### option: APIRequestContext.post.data = %%-js-python-csharp-fetch-option-data-%% * since: v1.16 -### option: APIRequestContext.post.form = %%-js-python-fetch-option-form-%% +### option: APIRequestContext.post.form = %%-js-fetch-option-form-%% +* since: v1.16 + +### option: APIRequestContext.post.form = %%-python-fetch-option-form-%% * since: v1.16 ### option: APIRequestContext.post.form = %%-csharp-fetch-option-form-%% @@ -739,22 +808,31 @@ context cookies from the response. The method will automatically follow redirect ### param: APIRequestContext.put.url = %%-fetch-param-url-%% * since: v1.16 -### param: APIRequestContext.put.params = %%-java-csharp-fetch-params-%% +### option: APIRequestContext.put.params = %%-js-fetch-option-params-%% +* since: v1.16 + +### param: APIRequestContext.put.params = %%-java-fetch-params-%% * since: v1.18 -### option: APIRequestContext.put.params = %%-js-python-fetch-option-params-%% +### option: APIRequestContext.put.params = %%-python-fetch-option-params-%% * since: v1.16 ### option: APIRequestContext.put.params = %%-csharp-fetch-option-params-%% * since: v1.16 +### option: APIRequestContext.put.paramsString = %%-csharp-fetch-option-paramsString-%% +* since: v1.47 + ### option: APIRequestContext.put.headers = %%-js-python-csharp-fetch-option-headers-%% * since: v1.16 ### option: APIRequestContext.put.data = %%-js-python-csharp-fetch-option-data-%% * since: v1.16 -### option: APIRequestContext.put.form = %%-js-python-fetch-option-form-%% +### option: APIRequestContext.put.form = %%-python-fetch-option-form-%% +* since: v1.16 + +### option: APIRequestContext.put.form = %%-js-fetch-option-form-%% * since: v1.16 ### option: APIRequestContext.put.form = %%-csharp-fetch-option-form-%% diff --git a/docs/src/api/class-apiresponse.md b/docs/src/api/class-apiresponse.md index 1297d2d4fa..5a901b76ba 100644 --- a/docs/src/api/class-apiresponse.md +++ b/docs/src/api/class-apiresponse.md @@ -60,7 +60,7 @@ An object with all the response HTTP headers associated with this response. - `name` <[string]> Name of the header. - `value` <[string]> Value of the header. -An array with all the request HTTP headers associated with this response. Header names are not lower-cased. +An array with all the response HTTP headers associated with this response. Header names are not lower-cased. Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times. ## async method: APIResponse.json diff --git a/docs/src/api/class-browser.md b/docs/src/api/class-browser.md index abbf4fd96b..59cf4c99c0 100644 --- a/docs/src/api/class-browser.md +++ b/docs/src/api/class-browser.md @@ -1,6 +1,5 @@ # class: Browser * since: v1.8 -* extends: [EventEmitter] A Browser is created via [`method: BrowserType.launch`]. An example of using a [Browser] to create a [Page]: @@ -256,6 +255,9 @@ await browser.CloseAsync(); ### option: Browser.newContext.proxy = %%-context-option-proxy-%% * since: v1.8 +### option: Browser.newContext.clientCertificates = %%-context-option-clientCertificates-%% +* since: 1.46 + ### option: Browser.newContext.storageState = %%-js-python-context-option-storage-state-%% * since: v1.8 @@ -281,6 +283,9 @@ testing frameworks should explicitly create [`method: Browser.newContext`] follo ### option: Browser.newPage.proxy = %%-context-option-proxy-%% * since: v1.8 +### option: Browser.newPage.clientCertificates = %%-context-option-clientCertificates-%% +* since: 1.46 + ### option: Browser.newPage.storageState = %%-js-python-context-option-storage-state-%% * since: v1.8 @@ -290,6 +295,20 @@ testing frameworks should explicitly create [`method: Browser.newContext`] follo ### option: Browser.newPage.storageStatePath = %%-csharp-java-context-option-storage-state-path-%% * since: v1.9 +## async method: Browser.removeAllListeners +* since: v1.47 +* langs: js + +Removes all the listeners of the given type (or all registered listeners if no type given). +Allows to wait for async listeners to complete or to ignore subsequent errors from these listeners. + +### param: Browser.removeAllListeners.type +* since: v1.47 +- `type` ?<[string]> + +### option: Browser.removeAllListeners.behavior = %%-remove-all-listeners-options-behavior-%% +* since: v1.47 + ## async method: Browser.startTracing * since: v1.11 * langs: java, js, python diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index 48542a2603..90ee0337d3 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -1,13 +1,12 @@ # class: BrowserContext * since: v1.8 -* extends: [EventEmitter] BrowserContexts provide a way to operate multiple independent browser sessions. If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser context. -Playwright allows creating "incognito" browser contexts with [`method: Browser.newContext`] method. "Incognito" browser +Playwright allows creating isolated non-persistent browser contexts with [`method: Browser.newContext`] method. Non-persistent browser contexts don't write any browsing data to disk. ```js @@ -1016,6 +1015,20 @@ Creates a new page in the browser context. Returns all open pages in the context. +## async method: BrowserContext.removeAllListeners +* since: v1.47 +* langs: js + +Removes all the listeners of the given type (or all registered listeners if no type given). +Allows to wait for async listeners to complete or to ignore subsequent errors from these listeners. + +### param: BrowserContext.removeAllListeners.type +* since: v1.47 +- `type` ?<[string]> + +### option: BrowserContext.removeAllListeners.behavior = %%-remove-all-listeners-options-behavior-%% +* since: v1.47 + ## property: BrowserContext.request * since: v1.16 * langs: @@ -1253,6 +1266,99 @@ When set to `minimal`, only record information necessary for routing from HAR. T Optional setting to control resource content management. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file. + +## async method: BrowserContext.routeWebSocket +* since: v1.48 + +This method allows to modify websocket connections that are made by any page in the browser context. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before creating any pages. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. +See [WebSocketRoute] for more details and examples. + +```js +await context.routeWebSocket('/ws', async ws => { + ws.routeSend(message => { + if (message === 'to-be-blocked') + return; + ws.send(message); + }); + await ws.connect(); +}); +``` + +```java +context.routeWebSocket("/ws", ws -> { + ws.routeSend(message -> { + if ("to-be-blocked".equals(message)) + return; + ws.send(message); + }); + ws.connect(); +}); +``` + +```python async +def message_handler(ws: WebSocketRoute, message: Union[str, bytes]): + if message == "to-be-blocked": + return + ws.send(message) + +async def handler(ws: WebSocketRoute): + ws.route_send(lambda message: message_handler(ws, message)) + await ws.connect() + +await context.route_web_socket("/ws", handler) +``` + +```python sync +def message_handler(ws: WebSocketRoute, message: Union[str, bytes]): + if message == "to-be-blocked": + return + ws.send(message) + +def handler(ws: WebSocketRoute): + ws.route_send(lambda message: message_handler(ws, message)) + ws.connect() + +context.route_web_socket("/ws", handler) +``` + +```csharp +await context.RouteWebSocketAsync("/ws", async ws => { + ws.RouteSend(message => { + if (message == "to-be-blocked") + return; + ws.Send(message); + }); + await ws.ConnectAsync(); +}); +``` + +### param: BrowserContext.routeWebSocket.url +* since: v1.48 +- `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]> + +Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the [`option: baseURL`] from the context options. + +### param: BrowserContext.routeWebSocket.handler +* since: v1.48 +* langs: js, python +- `handler` <[function]\([WebSocketRoute]\): [Promise|any]> + +Handler function to route the WebSocket. + +### param: BrowserContext.routeWebSocket.handler +* since: v1.48 +* langs: csharp, java +- `handler` <[function]\([WebSocketRoute]\)> + +Handler function to route the WebSocket. + + ## method: BrowserContext.serviceWorkers * since: v1.11 * langs: js, python diff --git a/docs/src/api/class-browsertype.md b/docs/src/api/class-browsertype.md index 176f696e1d..0d41bb1aa7 100644 --- a/docs/src/api/class-browsertype.md +++ b/docs/src/api/class-browsertype.md @@ -343,6 +343,9 @@ use a temporary directory instead. ### option: BrowserType.launchPersistentContext.firefoxUserPrefs2 = %%-csharp-java-browser-option-firefoxuserprefs-%% * since: v1.40 +### option: BrowserType.launchPersistentContext.clientCertificates = %%-context-option-clientCertificates-%% +* since: 1.46 + ## async method: BrowserType.launchServer * since: v1.8 * langs: js diff --git a/docs/src/api/class-cdpsession.md b/docs/src/api/class-cdpsession.md index 8ae780363d..a14dd58fb4 100644 --- a/docs/src/api/class-cdpsession.md +++ b/docs/src/api/class-cdpsession.md @@ -1,6 +1,5 @@ # class: CDPSession * since: v1.8 -* extends: [EventEmitter] The `CDPSession` instances are used to talk raw Chrome Devtools Protocol: * protocol methods can be called with `session.send` method. diff --git a/docs/src/api/class-clock.md b/docs/src/api/class-clock.md index 6f70e72a02..f2ee2433b4 100644 --- a/docs/src/api/class-clock.md +++ b/docs/src/api/class-clock.md @@ -64,11 +64,26 @@ Install fake implementations for the following time-related functions: Fake timers are used to manually control the flow of time in tests. They allow you to advance time, fire timers, and control the behavior of time-dependent functions. See [`method: Clock.runFor`] and [`method: Clock.fastForward`] for more information. ### option: Clock.install.time +* langs: js, java * since: v1.45 - `time` <[long]|[string]|[Date]> Time to initialize with, current system time by default. +### option: Clock.install.time +* langs: python +* since: v1.45 +- `time` <[float]|[string]|[Date]> + +Time to initialize with, current system time by default. + +### option: Clock.install.time +* langs: csharp +* since: v1.45 +- `time` <[string]|[Date]> + +Time to initialize with, current system time by default. + ## async method: Clock.runFor * since: v1.45 @@ -147,9 +162,25 @@ await page.Clock.PauseAtAsync("2020-02-02"); ``` ### param: Clock.pauseAt.time +* langs: js, java * since: v1.45 - `time` <[long]|[string]|[Date]> +Time to pause at. + +### param: Clock.pauseAt.time +* langs: python +* since: v1.45 +- `time` <[float]|[string]|[Date]> + +Time to pause at. + +### param: Clock.pauseAt.time +* langs: csharp +* since: v1.45 +- `time` <[Date]|[string]> + +Time to pause at. ## async method: Clock.resume * since: v1.45 @@ -195,9 +226,24 @@ await page.Clock.SetFixedTimeAsync("2020-02-02"); ``` ### param: Clock.setFixedTime.time +* langs: js, java * since: v1.45 - `time` <[long]|[string]|[Date]> +Time to be set in milliseconds. + +### param: Clock.setFixedTime.time +* langs: python +* since: v1.45 +- `time` <[float]|[string]|[Date]> + +Time to be set. + +### param: Clock.setFixedTime.time +* langs: csharp +* since: v1.45 +- `time` <[string]|[Date]> + Time to be set. ## async method: Clock.setSystemTime @@ -238,5 +284,22 @@ await page.Clock.SetSystemTimeAsync("2020-02-02"); ``` ### param: Clock.setSystemTime.time +* langs: js, java * since: v1.45 - `time` <[long]|[string]|[Date]> + +Time to be set in milliseconds. + +### param: Clock.setSystemTime.time +* langs: python +* since: v1.45 +- `time` <[float]|[string]|[Date]> + +Time to be set. + +### param: Clock.setSystemTime.time +* langs: csharp +* since: v1.45 +- `time` <[string]|[Date]> + +Time to be set. diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md index 24b8bb2b6f..c8f54c7380 100644 --- a/docs/src/api/class-elementhandle.md +++ b/docs/src/api/class-elementhandle.md @@ -164,7 +164,6 @@ This method checks the element by performing the following steps: 1. Wait for [actionability](../actionability.md) checks on the element, unless [`option: force`] option is set. 1. Scroll the element into view if needed. 1. Use [`property: Page.mouse`] to click in the center of the element. -1. Wait for initiated navigations to either succeed or fail, unless [`option: noWaitAfter`] option is set. 1. Ensure that the element is now checked. If not, this method throws. If the element is detached from the DOM at any moment during the action, this method throws. @@ -178,7 +177,7 @@ When all steps combined have not finished during the specified [`option: timeout ### option: ElementHandle.check.force = %%-input-force-%% * since: v1.8 -### option: ElementHandle.check.noWaitAfter = %%-input-no-wait-after-%% +### option: ElementHandle.check.noWaitAfter = %%-input-no-wait-after-removed-%% * since: v1.8 ### option: ElementHandle.check.timeout = %%-input-timeout-%% @@ -251,8 +250,6 @@ This method double clicks the element by performing the following steps: 1. Wait for [actionability](../actionability.md) checks on the element, unless [`option: force`] option is set. 1. Scroll the element into view if needed. 1. Use [`property: Page.mouse`] to double click in the center of the element, or the specified [`option: position`]. -1. Wait for initiated navigations to either succeed or fail, unless [`option: noWaitAfter`] option is set. Note that - if the first click of the `dblclick()` triggers a navigation event, this method will throw. If the element is detached from the DOM at any moment during the action, this method throws. @@ -278,7 +275,7 @@ When all steps combined have not finished during the specified [`option: timeout ### option: ElementHandle.dblclick.force = %%-input-force-%% * since: v1.8 -### option: ElementHandle.dblclick.noWaitAfter = %%-input-no-wait-after-%% +### option: ElementHandle.dblclick.noWaitAfter = %%-input-no-wait-after-removed-%% * since: v1.8 ### option: ElementHandle.dblclick.timeout = %%-input-timeout-%% @@ -537,7 +534,7 @@ Value to set for the ``, ``); const locator = await recorder.focusElement('textarea'); @@ -306,9 +346,9 @@ await page.Locator("#input").FillAsync(\"てすと\");`); expect(message.text()).toBe('John'); }); - test('should fill textarea with new lines at the end', async ({ page, openRecorder }) => { + test('should fill textarea with new lines at the end', async ({ openRecorder }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/23774' }); - const recorder = await openRecorder(); + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(``); const textarea = page.locator('textarea'); await textarea.evaluate(e => e.addEventListener('input', () => (window as any).lastInputValue = e.value)); @@ -321,8 +361,8 @@ await page.Locator("#input").FillAsync(\"てすと\");`); expect(sources.get('JavaScript')!.text).not.toContain(`Enter`); }); - test('should fill [contentEditable]', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should fill [contentEditable]', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(`
`); const locator = await recorder.focusElement('div'); @@ -338,8 +378,8 @@ await page.Locator("#input").FillAsync(\"てすと\");`); expect(message.text()).toBe('John Doe'); }); - test('should press', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should press', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(``); @@ -372,8 +412,8 @@ await page.GetByRole(AriaRole.Textbox).PressAsync("Shift+Enter");`); expect(messages[0].text()).toBe('press'); }); - test('should update selected element after pressing Tab', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should update selected element after pressing Tab', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(` @@ -401,8 +441,8 @@ await page.GetByRole(AriaRole.Textbox).PressAsync("Shift+Enter");`); await page.locator('input[name="two"]').fill('barfoo321');`); }); - test('should record ArrowDown', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should record ArrowDown', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(``); @@ -423,8 +463,8 @@ await page.GetByRole(AriaRole.Textbox).PressAsync("Shift+Enter");`); expect(messages[0].text()).toBe('press:ArrowDown'); }); - test('should emit single keyup on ArrowDown', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should emit single keyup on ArrowDown', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(``); @@ -448,8 +488,8 @@ await page.GetByRole(AriaRole.Textbox).PressAsync("Shift+Enter");`); expect(messages[1].text()).toBe('up:ArrowDown'); }); - test('should check', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should check', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(``); @@ -480,8 +520,8 @@ await page.Locator("#checkbox").CheckAsync();`); expect(message.text()).toBe('true'); }); - test('should check a radio button', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should check a radio button', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(``); @@ -499,8 +539,8 @@ await page.Locator("#checkbox").CheckAsync();`); expect(message.text()).toBe('true'); }); - test('should check with keyboard', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should check with keyboard', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(``); @@ -518,8 +558,8 @@ await page.Locator("#checkbox").CheckAsync();`); expect(message.text()).toBe('true'); }); - test('should uncheck', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should uncheck', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(``); @@ -550,8 +590,8 @@ await page.Locator("#checkbox").UncheckAsync();`); expect(message.text()).toBe('false'); }); - test('should select', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should select', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(''); @@ -583,8 +623,8 @@ await page.Locator("#age").SelectOptionAsync(new[] { "2" });`); expect(message.text()).toBe('2'); }); - test('should select with size attribute', async ({ page, openRecorder }) => { - const recorder = await openRecorder(); + test('should select with size attribute', async ({ openRecorder }) => { + const { page, recorder } = await openRecorder(); await recorder.setContentAndWait(` + hello + +
+ + `); + expect.soft(await getNameAndRole(page, 'input')).toEqual({ role: 'textbox', name: 'hello' }); +}); + +test('should not include hidden pseudo into accessible name', async ({ page }) => { + await page.setContent(` + + + hello +
hello
+
+ `); + expect.soft(await getNameAndRole(page, 'a')).toEqual({ role: 'link', name: 'hello hello' }); +}); + function toArray(x: any): any[] { return Array.isArray(x) ? x : [x]; } diff --git a/tests/library/route-web-socket.spec.ts b/tests/library/route-web-socket.spec.ts new file mode 100644 index 0000000000..207d581919 --- /dev/null +++ b/tests/library/route-web-socket.spec.ts @@ -0,0 +1,484 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { attachFrame, detachFrame } from '../config/utils'; +import { contextTest as test, expect } from '../config/browserTest'; +import type { Frame, Page, WebSocketRoute } from '@playwright/test'; + +declare global { + interface Window { + ws: WebSocket; + wsOpened: Promise; + log: string[]; + } +} + +// Polyfill for Promise.withResolvers, not available in older Node. +function withResolvers() { + let resolve: (value: T) => void; + const promise = new Promise(f => resolve = f); + return { promise, resolve }; +} + +async function setupWS(target: Page | Frame, port: number, binaryType: 'blob' | 'arraybuffer') { + await target.goto('about:blank'); + await target.evaluate(({ port, binaryType }) => { + window.log = []; + window.ws = new WebSocket('ws://localhost:' + port + '/ws'); + window.ws.binaryType = binaryType; + window.ws.addEventListener('open', () => window.log.push('open')); + window.ws.addEventListener('close', event => window.log.push(`close code=${event.code} reason=${event.reason} wasClean=${event.wasClean}`)); + window.ws.addEventListener('error', event => window.log.push(`error`)); + window.ws.addEventListener('message', async event => { + let data; + if (typeof event.data === 'string') + data = event.data; + else if (event.data instanceof Blob) + data = 'blob:' + await event.data.text(); + else + data = 'arraybuffer:' + await (new Blob([event.data])).text(); + window.log.push(`message: data=${data} origin=${event.origin} lastEventId=${event.lastEventId}`); + }); + window.wsOpened = new Promise(f => window.ws.addEventListener('open', () => f())); + }, { port, binaryType }); +} + +for (const mock of ['no-mock', 'no-match', 'pass-through']) { + test.describe(mock, async () => { + test.beforeEach(async ({ page }) => { + if (mock === 'no-match') { + await page.routeWebSocket(/zzz/, () => {}); + } else if (mock === 'pass-through') { + await page.routeWebSocket(/.*/, async ws => { + ws.routeSend(message => ws.send(message)); + ws.routeReceive(message => ws.receive(message)); + await ws.connect(); + }); + } + }); + + test('should work with text message', async ({ page, server }) => { + const wsPromise = server.waitForWebSocket(); + const upgradePromise = server.waitForUpgrade(); + await setupWS(page, server.PORT, 'blob'); + expect(await page.evaluate(() => window.ws.readyState)).toBe(0); + const { doUpgrade } = await upgradePromise; + expect(await page.evaluate(() => window.ws.readyState)).toBe(0); + expect(await page.evaluate(() => window.log)).toEqual([]); + doUpgrade(); + await expect.poll(() => page.evaluate(() => window.ws.readyState)).toBe(1); + expect(await page.evaluate(() => window.log)).toEqual(['open']); + const ws = await wsPromise; + ws.send('hello'); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=hello origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + expect(await page.evaluate(() => window.ws.readyState)).toBe(1); + const messagePromise = new Promise(f => ws.once('message', data => f(data.toString()))); + await page.evaluate(() => window.ws.send('hi')); + expect(await messagePromise).toBe('hi'); + ws.close(1008, 'oops'); + await expect.poll(() => page.evaluate(() => window.ws.readyState)).toBe(3); + expect(await page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=hello origin=ws://localhost:${server.PORT} lastEventId=`, + 'close code=1008 reason=oops wasClean=true', + ]); + }); + + test('should work with binaryType=blob', async ({ page, server }) => { + const wsPromise = server.waitForWebSocket(); + await setupWS(page, server.PORT, 'blob'); + const ws = await wsPromise; + ws.send(Buffer.from('hi')); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=blob:hi origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + const messagePromise = new Promise(f => ws.once('message', data => f(data.toString()))); + await page.evaluate(() => window.ws.send(new Blob([new Uint8Array(['h'.charCodeAt(0), 'i'.charCodeAt(0)])]))); + expect(await messagePromise).toBe('hi'); + }); + + test('should work with binaryType=arraybuffer', async ({ page, server }) => { + const wsPromise = server.waitForWebSocket(); + await setupWS(page, server.PORT, 'arraybuffer'); + const ws = await wsPromise; + ws.send(Buffer.from('hi')); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=arraybuffer:hi origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + const messagePromise = new Promise(f => ws.once('message', data => f(data.toString()))); + await page.evaluate(() => window.ws.send(new Uint8Array(['h'.charCodeAt(0), 'i'.charCodeAt(0)]).buffer)); + expect(await messagePromise).toBe('hi'); + }); + + test('should work when connection errors out', async ({ page, server, browserName }) => { + test.skip(browserName === 'webkit', 'WebKit ignores the connection error and fires no events!'); + + const upgradePromise = server.waitForUpgrade(); + await setupWS(page, server.PORT, 'blob'); + const { socket } = await upgradePromise; + expect(await page.evaluate(() => window.ws.readyState)).toBe(0); + expect(await page.evaluate(() => window.log)).toEqual([]); + socket.destroy(); + await expect.poll(() => page.evaluate(() => window.ws.readyState)).toBe(3); + expect(await page.evaluate(() => window.log)).toEqual([ + 'error', + expect.stringMatching(/close code=\d+ reason= wasClean=false/), + ]); + }); + + test('should work with error after successful open', async ({ page, server, browserName, isLinux }) => { + test.skip(browserName === 'firefox', 'Firefox does not close the websocket upon a bad frame'); + test.skip(browserName === 'webkit' && isLinux, 'WebKit linux does not close the websocket upon a bad frame'); + + const upgradePromise = server.waitForUpgrade(); + await setupWS(page, server.PORT, 'blob'); + const { socket, doUpgrade } = await upgradePromise; + doUpgrade(); + await expect.poll(() => page.evaluate(() => window.ws.readyState)).toBe(1); + expect(await page.evaluate(() => window.log)).toEqual(['open']); + socket.write('garbage'); + await expect.poll(() => page.evaluate(() => window.ws.readyState)).toBe(3); + expect(await page.evaluate(() => window.log)).toEqual([ + 'open', + 'error', + expect.stringMatching(/close code=\d+ reason= wasClean=false/), + ]); + }); + + test('should work with client-side close', async ({ page, server }) => { + const wsPromise = server.waitForWebSocket(); + const upgradePromise = server.waitForUpgrade(); + await setupWS(page, server.PORT, 'blob'); + expect(await page.evaluate(() => window.ws.readyState)).toBe(0); + const { doUpgrade } = await upgradePromise; + expect(await page.evaluate(() => window.ws.readyState)).toBe(0); + expect(await page.evaluate(() => window.log)).toEqual([]); + doUpgrade(); + await expect.poll(() => page.evaluate(() => window.ws.readyState)).toBe(1); + expect(await page.evaluate(() => window.log)).toEqual(['open']); + const ws = await wsPromise; + const closedPromise = new Promise<{ code: number, reason: Buffer }>(f => ws.once('close', (code, reason) => f({ code, reason }))); + const readyState = await page.evaluate(() => { + window.ws.close(3002, 'oops'); + return window.ws.readyState; + }); + expect(readyState).toBe(2); + await expect.poll(() => page.evaluate(() => window.ws.readyState)).toBe(3); + expect(await page.evaluate(() => window.log)).toEqual([ + 'open', + 'close code=3002 reason=oops wasClean=true', + ]); + const closed = await closedPromise; + expect(closed.code).toBe(3002); + expect(closed.reason.toString()).toBe('oops'); + }); + }); +} + +test('should work with ws.close', async ({ page, server }) => { + const { promise, resolve } = withResolvers(); + await page.routeWebSocket(/.*/, async route => { + await route.connect(); + resolve(route); + }); + + const wsPromise = server.waitForWebSocket(); + await setupWS(page, server.PORT, 'blob'); + const ws = await wsPromise; + + const route = await promise; + route.receive('hello'); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=hello origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + + const closedPromise = new Promise(f => ws.once('close', (code, reason) => f({ code, reason: reason.toString() }))); + await route.close({ code: 3009, reason: 'oops' }); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=hello origin=ws://localhost:${server.PORT} lastEventId=`, + 'close code=3009 reason=oops wasClean=true', + ]); + expect(await closedPromise).toEqual({ code: 3009, reason: 'oops' }); +}); + +test('should pattern match', async ({ page, server }) => { + await page.routeWebSocket(/.*\/ws$/, async ws => { + await ws.connect(); + }); + + await page.routeWebSocket('**/mock-ws', ws => { + ws.routeSend(message => { + ws.receive('mock-response'); + }); + }); + + const wsPromise = server.waitForWebSocket(); + + await page.goto('about:blank'); + await page.evaluate(async ({ port }) => { + window.log = []; + (window as any).ws1 = new WebSocket('ws://localhost:' + port + '/ws'); + (window as any).ws1.addEventListener('message', event => window.log.push(`ws1:${event.data}`)); + (window as any).ws2 = new WebSocket('ws://localhost:' + port + '/something/something/mock-ws'); + (window as any).ws2.addEventListener('message', event => window.log.push(`ws2:${event.data}`)); + await Promise.all([ + new Promise(f => (window as any).ws1.addEventListener('open', f)), + new Promise(f => (window as any).ws2.addEventListener('open', f)), + ]); + }, { port: server.PORT }); + + const ws = await wsPromise; + ws.on('message', () => ws.send('response')); + + await page.evaluate(() => (window as any).ws1.send('request')); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([`ws1:response`]); + + await page.evaluate(() => (window as any).ws2.send('request')); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([`ws1:response`, `ws2:mock-response`]); +}); + +test('should work with server', async ({ page, server }) => { + const { promise, resolve } = withResolvers(); + await page.routeWebSocket(/.*/, async route => { + route.routeSend(message => { + switch (message) { + case 'to-respond': + route.receive('response'); + return; + case 'to-block': + return; + case 'to-modify': + route.send('modified'); + return; + } + route.send(message); + }); + route.routeReceive(message => { + switch (message) { + case 'to-block': + return; + case 'to-modify': + route.receive('modified'); + return; + } + route.receive(message); + }); + await route.connect(); + route.send('fake'); + resolve(route); + }); + + const wsPromise = server.waitForWebSocket(); + const log: string[] = []; + server.onceWebSocketConnection(ws => { + ws.on('message', data => log.push(`message: ${data.toString()}`)); + ws.on('close', (code, reason) => log.push(`close: code=${code} reason=${reason.toString()}`)); + }); + + await setupWS(page, server.PORT, 'blob'); + const ws = await wsPromise; + await expect.poll(() => log).toEqual(['message: fake']); + + ws.send('to-modify'); + ws.send('to-block'); + ws.send('pass-server'); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=modified origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=pass-server origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + + await page.evaluate(() => { + window.ws.send('to-respond'); + window.ws.send('to-modify'); + window.ws.send('to-block'); + window.ws.send('pass-client'); + }); + await expect.poll(() => log).toEqual(['message: fake', 'message: modified', 'message: pass-client']); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=modified origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=pass-server origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=response origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + + const route = await promise; + route.receive('another'); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=modified origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=pass-server origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=response origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=another origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + + await page.evaluate(() => { + window.ws.send('pass-client-2'); + }); + await expect.poll(() => log).toEqual(['message: fake', 'message: modified', 'message: pass-client', 'message: pass-client-2']); + + await page.evaluate(() => { + window.ws.close(3009, 'problem'); + }); + await expect.poll(() => log).toEqual(['message: fake', 'message: modified', 'message: pass-client', 'message: pass-client-2', 'close: code=3009 reason=problem']); +}); + +test('should work without server', async ({ page, server }) => { + const { promise, resolve } = withResolvers(); + await page.routeWebSocket(/.*/, route => { + route.routeSend(message => { + switch (message) { + case 'to-respond': + route.receive('response'); + return; + } + }); + resolve(route); + }); + + await setupWS(page, server.PORT, 'blob'); + + await page.evaluate(async () => { + await window.wsOpened; + window.ws.send('to-respond'); + window.ws.send('to-block'); + window.ws.send('to-respond'); + }); + + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=response origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=response origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + + const route = await promise; + route.receive('another'); + await route.close({ code: 3008, reason: 'oops' }); + + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=response origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=response origin=ws://localhost:${server.PORT} lastEventId=`, + `message: data=another origin=ws://localhost:${server.PORT} lastEventId=`, + 'close code=3008 reason=oops wasClean=true', + ]); +}); + +test('should emit close upon frame navigation', async ({ page, server }) => { + const { promise, resolve } = withResolvers(); + await page.routeWebSocket(/.*/, async route => { + await route.connect(); + resolve(route); + }); + + await setupWS(page, server.PORT, 'blob'); + + const route = await promise; + route.receive('hello'); + + await expect.poll(() => page.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=hello origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + + const closedPromise = new Promise(f => route.addListener('close', f)); + await page.goto(server.EMPTY_PAGE); + await closedPromise; +}); + +test('should emit close upon frame detach', async ({ page, server }) => { + const { promise, resolve } = withResolvers(); + await page.routeWebSocket(/.*/, async route => { + await route.connect(); + resolve(route); + }); + + const frame = await attachFrame(page, 'frame1', server.EMPTY_PAGE); + await setupWS(frame, server.PORT, 'blob'); + + const route = await promise; + route.receive('hello'); + + await expect.poll(() => frame.evaluate(() => window.log)).toEqual([ + 'open', + `message: data=hello origin=ws://localhost:${server.PORT} lastEventId=`, + ]); + + const closedPromise = new Promise(f => route.addListener('close', f)); + await detachFrame(page, 'frame1'); + await closedPromise; +}); + +test('should route on context', async ({ page, server }) => { + await page.routeWebSocket(/ws1/, ws => { + ws.routeSend(message => { + ws.receive('page-mock-1'); + }); + }); + + await page.routeWebSocket(/ws1/, ws => { + ws.routeSend(message => { + ws.receive('page-mock-2'); + }); + }); + + await page.context().routeWebSocket(/.*/, ws => { + ws.routeSend(message => { + ws.receive('context-mock-1'); + }); + ws.routeSend(message => { + ws.receive('context-mock-2'); + }); + }); + + await page.goto('about:blank'); + await page.evaluate(({ port }) => { + window.log = []; + (window as any).ws1 = new WebSocket('ws://localhost:' + port + '/ws1'); + (window as any).ws1.addEventListener('message', event => window.log.push(`ws1:${event.data}`)); + (window as any).ws2 = new WebSocket('ws://localhost:' + port + '/ws2'); + (window as any).ws2.addEventListener('message', event => window.log.push(`ws2:${event.data}`)); + }, { port: server.PORT }); + + await page.evaluate(() => (window as any).ws1.send('request')); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([`ws1:page-mock-2`]); + + await page.evaluate(() => (window as any).ws2.send('request')); + await expect.poll(() => page.evaluate(() => window.log)).toEqual([`ws1:page-mock-2`, `ws2:context-mock-2`]); +}); + +test('should not throw after page closure', async ({ page, server }) => { + const { promise, resolve } = withResolvers(); + await page.routeWebSocket(/.*/, async route => { + await route.connect(); + resolve(route); + }); + + await setupWS(page, server.PORT, 'blob'); + + const route = await promise; + await Promise.all([ + page.close(), + route.receive('hello'), + ]); +}); diff --git a/tests/library/selector-generator.spec.ts b/tests/library/selector-generator.spec.ts index 3d7370dd0d..e9df1afc6e 100644 --- a/tests/library/selector-generator.spec.ts +++ b/tests/library/selector-generator.spec.ts @@ -33,13 +33,22 @@ it.describe('selector generator', () => { }); it('should prefer button over inner span', async ({ page }) => { - await page.setContent(``); - expect(await generate(page, 'button')).toBe('#clickme'); + await page.setContent(``); + expect(await generate(page, 'span')).toBe('internal:role=button[name="text"i]'); }); it('should prefer role=button over inner span', async ({ page }) => { - await page.setContent(`
`); - expect(await generate(page, 'div')).toBe('internal:role=button'); + await page.setContent(`
text
`); + expect(await generate(page, 'span')).toBe('internal:role=button[name="text"i]'); + }); + + it('should not prefer zero-sized button over inner span', async ({ page }) => { + await page.setContent(` + + `); + expect(await generate(page, 'span')).toBe('internal:text="text"i'); }); it('should generate text and normalize whitespace', async ({ page }) => { diff --git a/tests/library/snapshotter.spec.ts b/tests/library/snapshotter.spec.ts index b0866a5d3f..b6c45b9252 100644 --- a/tests/library/snapshotter.spec.ts +++ b/tests/library/snapshotter.spec.ts @@ -249,12 +249,10 @@ it.describe('snapshots', () => { }); it('empty adopted style sheets should not prevent node refs', async ({ page, toImpl, snapshotter, browserName }) => { - it.skip(browserName !== 'chromium', 'Constructed stylesheets are only in Chromium.'); - await page.setContent(''); await page.evaluate(() => { const sheet = new CSSStyleSheet(); - (document as any).adoptedStyleSheets = [sheet]; + document.adoptedStyleSheets = [sheet]; const sheet2 = new CSSStyleSheet(); for (const element of [document.createElement('div'), document.createElement('span')]) { @@ -262,7 +260,7 @@ it.describe('snapshots', () => { mode: 'open' }); root.append('foo'); - (root as any).adoptedStyleSheets = [sheet2]; + root.adoptedStyleSheets = [sheet2]; document.body.appendChild(element); } }); diff --git a/tests/library/tap.spec.ts b/tests/library/tap.spec.ts index 56adabfe41..c523be9e86 100644 --- a/tests/library/tap.spec.ts +++ b/tests/library/tap.spec.ts @@ -16,7 +16,6 @@ import { contextTest as it, expect } from '../config/browserTest'; import type { ElementHandle } from 'playwright-core'; -import type { ServerResponse } from 'http'; it.use({ hasTouch: true }); @@ -83,27 +82,13 @@ it('should not send mouse events when touchend is canceled', async ({ page }) => ]); }); -it('should wait for a navigation caused by a tap', async ({ page, server }) => { +it('should not wait for a navigation caused by a tap', async ({ page, server }) => { await page.goto(server.EMPTY_PAGE); - await page.setContent(` - link; -`); - const responsePromise = new Promise(resolve => { - server.setRoute('/intercept-this.html', (handler, response) => { - resolve(response); - }); - }); - let resolved = false; - const tapPromise = page.tap('a').then(() => resolved = true); - const response = await responsePromise; - // make sure the tap doesn't resolve too early - await new Promise(x => setTimeout(x, 100)); - expect(resolved).toBe(false); - - response.end('foo'); - - await tapPromise; - expect(resolved).toBe(true); + await page.setContent(`link;`); + await Promise.all([ + new Promise(resolve => server.setRoute('/intercept-this.html', resolve)), + page.tap('a'), + ]); }); it('should work with modifiers', async ({ page }) => { diff --git a/tests/library/touch.spec.ts b/tests/library/touch.spec.ts deleted file mode 100644 index f842beb207..0000000000 --- a/tests/library/touch.spec.ts +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { contextTest as it, expect } from '../config/browserTest'; -import type { Locator } from 'playwright-core'; - -it.use({ hasTouch: true }); - -it.fixme(({ browserName }) => browserName === 'firefox'); - -it('slow swipe events @smoke', async ({ page }) => { - it.fixme(); - await page.setContent(`
a
`); - const eventsHandle = await trackEvents(await page.locator('#a')); - const center = await centerPoint(page.locator('#a')); - await page.touchscreen.touch('touchstart', [{ ...center, id: 1 }]); - expect.soft(await eventsHandle.jsonValue()).toEqual([ - 'pointerover', - 'pointerenter', - 'pointerdown', - 'touchstart', - ]); - - await eventsHandle.evaluate(events => events.length = 0); - await page.touchscreen.touch('touchmove', [{ x: center.x + 10, y: center.y + 10, id: 1 }]); - await page.touchscreen.touch('touchmove', [{ x: center.x + 20, y: center.y + 20, id: 1 }]); - expect.soft(await eventsHandle.jsonValue()).toEqual([ - 'pointermove', - 'touchmove', - 'pointermove', - 'touchmove', - ]); - - await eventsHandle.evaluate(events => events.length = 0); - await page.touchscreen.touch('touchend', [{ x: center.x + 20, y: center.y + 20, id: 1 }]); - expect.soft(await eventsHandle.jsonValue()).toEqual([ - 'pointerup', - 'pointerout', - 'pointerleave', - 'touchend', - ]); -}); - - -async function trackEvents(target: Locator) { - const eventsHandle = await target.evaluateHandle(target => { - const events: string[] = []; - for (const event of [ - 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'click', - 'pointercancel', 'pointerdown', 'pointerenter', 'pointerleave', 'pointermove', 'pointerout', 'pointerover', 'pointerup', - 'touchstart', 'touchend', 'touchmove', 'touchcancel',]) - target.addEventListener(event, () => events.push(event), { passive: false }); - return events; - }); - return eventsHandle; -} - -async function centerPoint(e: Locator) { - const box = await e.boundingBox(); - if (!box) - throw new Error('Element is not visible'); - return { x: box.x + box.width / 2, y: box.y + box.height / 2 }; -} \ No newline at end of file diff --git a/tests/library/trace-viewer.spec.ts b/tests/library/trace-viewer.spec.ts index 69864380d8..780e9473fe 100644 --- a/tests/library/trace-viewer.spec.ts +++ b/tests/library/trace-viewer.spec.ts @@ -31,7 +31,9 @@ test.slow(); let traceFile: string; test.beforeAll(async function recordTrace({ browser, browserName, browserType, server }, workerInfo) { - const context = await browser.newContext(); + const context = await browser.newContext({ + baseURL: 'https://example.com', + }); await context.tracing.start({ name: 'test', screenshots: true, snapshots: true, sources: true }); const page = await context.newPage(); await page.goto(`data:text/html,Hello world`); @@ -120,6 +122,17 @@ test('should open simple trace viewer', async ({ showTraceViewer }) => { ]); }); +test('should complain about newer version of trace in old viewer', async ({ showTraceViewer, asset }, testInfo) => { + const traceViewer = await showTraceViewer([asset('trace-from-the-future.zip')]); + await expect(traceViewer.page.getByText('The trace was created by a newer version of Playwright and is not supported by this version of the viewer.')).toBeVisible(); +}); + +test('should properly synchronize local and remote time', async ({ showTraceViewer, asset }, testInfo) => { + const traceViewer = await showTraceViewer([asset('trace-remote-time-diff.zip')]); + // The total duration should be sub 10s, rather than 16h. + await expect(traceViewer.page.locator('.timeline-time').last()).toHaveText('8.5s'); +}); + test('should contain action info', async ({ showTraceViewer }) => { const traceViewer = await showTraceViewer([traceFile]); await traceViewer.selectAction('locator.click'); @@ -249,6 +262,81 @@ test('should have network requests', async ({ showTraceViewer }) => { await expect(traceViewer.networkRequests.filter({ hasText: '404' })).toHaveCSS('background-color', 'rgb(242, 222, 222)'); }); +test('should filter network requests by resource type', async ({ page, runAndTrace, server }) => { + const traceViewer = await runAndTrace(async () => { + server.setRoute('/api/endpoint', (_, res) => res.setHeader('Content-Type', 'application/json').end()); + await page.goto(`${server.PREFIX}/network-tab/network.html`); + }); + await traceViewer.selectAction('http://localhost'); + await traceViewer.showNetworkTab(); + + await traceViewer.page.getByText('JS', { exact: true }).click(); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('script.js')).toBeVisible(); + + await traceViewer.page.getByText('CSS', { exact: true }).click(); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('style.css')).toBeVisible(); + + await traceViewer.page.getByText('Image', { exact: true }).click(); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('image.png')).toBeVisible(); + + await traceViewer.page.getByText('Fetch', { exact: true }).click(); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('endpoint')).toBeVisible(); + + await traceViewer.page.getByText('HTML', { exact: true }).click(); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('network.html')).toBeVisible(); + + await traceViewer.page.getByText('Font', { exact: true }).click(); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('font.woff2')).toBeVisible(); +}); + +test('should show font preview', async ({ page, runAndTrace, server }) => { + const traceViewer = await runAndTrace(async () => { + await page.goto(`${server.PREFIX}/network-tab/network.html`); + }); + await traceViewer.selectAction('http://localhost'); + await traceViewer.showNetworkTab(); + + await traceViewer.page.getByText('Font', { exact: true }).click(); + await expect(traceViewer.networkRequests).toHaveCount(1); + await traceViewer.networkRequests.getByText('font.woff2').click(); + await traceViewer.page.getByTestId('network-request-details').getByTitle('Body').click(); + await expect(traceViewer.page.locator('.network-request-details-tab')).toContainText('ABCDEF'); +}); + +test('should filter network requests by url', async ({ page, runAndTrace, server }) => { + const traceViewer = await runAndTrace(async () => { + await page.goto(`${server.PREFIX}/network-tab/network.html`); + }); + await traceViewer.selectAction('http://localhost'); + await traceViewer.showNetworkTab(); + + await traceViewer.page.getByPlaceholder('Filter network').fill('script.'); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('script.js')).toBeVisible(); + + await traceViewer.page.getByPlaceholder('Filter network').fill('png'); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('image.png')).toBeVisible(); + + await traceViewer.page.getByPlaceholder('Filter network').fill('api/'); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('endpoint')).toBeVisible(); + + await traceViewer.page.getByPlaceholder('Filter network').fill('End'); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('endpoint')).toBeVisible(); + + await traceViewer.page.getByPlaceholder('Filter network').fill('FON'); + await expect(traceViewer.networkRequests).toHaveCount(1); + await expect(traceViewer.networkRequests.getByText('font.woff2')).toBeVisible(); +}); + test('should have network request overrides', async ({ page, server, runAndTrace }) => { const traceViewer = await runAndTrace(async () => { await page.route('**/style.css', route => route.abort()); @@ -284,13 +372,13 @@ test('should show snapshot URL', async ({ page, runAndTrace, server }) => { test('should popup snapshot', async ({ page, runAndTrace, server }) => { const traceViewer = await runAndTrace(async () => { await page.goto(server.EMPTY_PAGE); - await page.setContent('hello'); + await page.setContent('hello äöü 🙂'); }); await traceViewer.snapshotFrame('page.setContent'); const popupPromise = traceViewer.page.context().waitForEvent('page'); await traceViewer.page.getByTitle('Open snapshot in a new tab').click(); const popup = await popupPromise; - await expect(popup.getByText('hello')).toBeVisible(); + await expect(popup.getByText('hello äöü 🙂')).toBeVisible(); }); test('should capture iframe with sandbox attribute', async ({ page, server, runAndTrace }) => { @@ -347,14 +435,12 @@ test('should capture data-url svg iframe', async ({ page, server, runAndTrace }) }); test('should contain adopted style sheets', async ({ page, runAndTrace, browserName }) => { - test.skip(browserName !== 'chromium', 'Constructed stylesheets are only in Chromium.'); - const traceViewer = await runAndTrace(async () => { await page.setContent(''); await page.evaluate(() => { const sheet = new CSSStyleSheet(); sheet.addRule('button', 'color: red'); - (document as any).adoptedStyleSheets = [sheet]; + document.adoptedStyleSheets = [sheet]; const sheet2 = new CSSStyleSheet(); sheet2.addRule(':host', 'color: blue'); @@ -364,7 +450,7 @@ test('should contain adopted style sheets', async ({ page, runAndTrace, browserN mode: 'open' }); root.append('foo'); - (root as any).adoptedStyleSheets = [sheet2]; + root.adoptedStyleSheets = [sheet2]; document.body.appendChild(element); } }); @@ -377,22 +463,20 @@ test('should contain adopted style sheets', async ({ page, runAndTrace, browserN }); test('should work with adopted style sheets and replace/replaceSync', async ({ page, runAndTrace, browserName }) => { - test.skip(browserName !== 'chromium', 'Constructed stylesheets are only in Chromium.'); - const traceViewer = await runAndTrace(async () => { await page.setContent(''); await page.evaluate(() => { const sheet = new CSSStyleSheet(); sheet.addRule('button', 'color: red'); - (document as any).adoptedStyleSheets = [sheet]; + document.adoptedStyleSheets = [sheet]; }); await page.evaluate(() => { - const [sheet] = (document as any).adoptedStyleSheets; + const [sheet] = document.adoptedStyleSheets; sheet.replaceSync(`button { color: blue }`); }); - await page.evaluate(() => { - const [sheet] = (document as any).adoptedStyleSheets; - sheet.replace(`button { color: #0F0 }`); + await page.evaluate(async () => { + const [sheet] = document.adoptedStyleSheets; + await sheet.replace(`button { color: #0F0 }`); }); }); @@ -410,7 +494,56 @@ test('should work with adopted style sheets and replace/replaceSync', async ({ p } }); -test('should restore scroll positions', async ({ page, runAndTrace, browserName }) => { +test('should work with adopted style sheets and all: unset', async ({ page, runAndTrace, browserName }) => { + test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31500' }); + test.fixme(browserName === 'chromium', 'https://issues.chromium.org/u/1/issues/41416124'); + + const traceViewer = await runAndTrace(async () => { + await page.setContent(''); + await page.evaluate(() => { + const stylesheet = new CSSStyleSheet(); + // 'all: unset' is the problem here. + stylesheet.replaceSync('button { all: unset; border-radius: 24px; background-color: deepskyblue; color: black; padding: 5px }'); + document.adoptedStyleSheets = [stylesheet]; + }); + await page.getByRole('button').click(); + }); + { + const frame = await traceViewer.snapshotFrame('page.evaluate', 0); + await expect(frame.locator('button')).toHaveCSS('border-radius', '24px'); + await expect(frame.locator('button')).toHaveCSS('background-color', 'rgb(0, 191, 255)'); + await expect(frame.locator('button')).toHaveCSS('color', 'rgb(0, 0, 0)'); + await expect(frame.locator('button')).toHaveCSS('padding', '5px'); + } +}); + +test('should work with nesting CSS selectors', async ({ page, runAndTrace }) => { + test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31607' }); + + const traceViewer = await runAndTrace(async () => { + await page.setContent(` + Hi + Hello + + `); + await page.evaluate(() => { }); + }); + { + const frame = await traceViewer.snapshotFrame('page.evaluate', 0); + await expect(frame.getByTestId('green-element')).toHaveCSS('color', /* green */'rgb(0, 128, 0)'); + await expect(frame.getByTestId('red-element')).toHaveCSS('color', /* red */'rgb(255, 0, 0)'); + } +}); + +test('should restore scroll positions', async ({ page, runAndTrace }) => { const traceViewer = await runAndTrace(async () => { await page.setContent(`