diff --git a/.github/workflows/cf_prerelease.yml b/.github/workflows/cf_prerelease.yml index 6996e54465..4e29d76583 100644 --- a/.github/workflows/cf_prerelease.yml +++ b/.github/workflows/cf_prerelease.yml @@ -19,6 +19,7 @@ jobs: - name: Generate Pre-Release run: | npm ci + git submodule update --init cd packages/playwright-cloudflare npm run build npx pkg-pr-new publish diff --git a/.github/workflows/cf_publish_release_npm.yml b/.github/workflows/cf_publish_release_npm.yml index 700e5ab837..46c295b346 100644 --- a/.github/workflows/cf_publish_release_npm.yml +++ b/.github/workflows/cf_publish_release_npm.yml @@ -28,8 +28,10 @@ jobs: # Set the output for later steps echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" - - name: Run npm ci - run: npm ci + - name: Run npm ci and submodule update + run: | + npm ci + git submodule update --init - name: Run playwright-cloudflare build run: | diff --git a/.github/workflows/cf_test_full.yml b/.github/workflows/cf_test_full.yml index a1ee30683f..77b2881b79 100644 --- a/.github/workflows/cf_test_full.yml +++ b/.github/workflows/cf_test_full.yml @@ -2,16 +2,6 @@ name: "Playwright for Cloudflare - Full Test Suite" on: workflow_dispatch: - inputs: - project: - description: 'Project to test' - required: true - default: 'BISO' - type: choice - options: - - BISO - - BRAPI Staging - - BRAPI Production grep: description: 'Test filter grep' required: false @@ -23,7 +13,6 @@ jobs: env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - BROWSER_BINDINGS: ${{ secrets.BROWSER_BINDINGS }} TESTS_SERVER_URL: https://playwright-test-workers.rendering.cfdata.org CF_ACCESS_CLIENT_SECRET: ${{ secrets.CF_ACCESS_CLIENT_SECRET }} CF_ACCESS_CLIENT_ID: ${{ secrets.CF_ACCESS_CLIENT_ID }} @@ -35,6 +24,7 @@ jobs: registry-url: 'https://registry.npmjs.org' - run: | npm ci + git submodule update --init cd packages/playwright-cloudflare npm run build npm run test:deploy @@ -42,7 +32,7 @@ jobs: - name: Run tests run: | cd packages/playwright-cloudflare - npm run test:full -- --reporter=html --project="${{ github.event.inputs.project || 'BISO' }}" ${{ github.event.inputs.grep && format('--grep="{0}"', github.event.inputs.grep) }} + npm run test:full -- --reporter=html ${{ github.event.inputs.grep && format('--grep="{0}"', github.event.inputs.grep) }} - name: Upload HTML report uses: actions/upload-artifact@v4 diff --git a/.github/workflows/cf_test_smoke.yml b/.github/workflows/cf_test_smoke.yml index 366dec6a44..95850c2b51 100644 --- a/.github/workflows/cf_test_smoke.yml +++ b/.github/workflows/cf_test_smoke.yml @@ -9,7 +9,6 @@ jobs: env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - BROWSER_BINDINGS: ${{ secrets.BROWSER_BINDINGS }} TESTS_SERVER_URL: https://playwright-test-workers.rendering.cfdata.org CF_ACCESS_CLIENT_SECRET: ${{ secrets.CF_ACCESS_CLIENT_SECRET }} CF_ACCESS_CLIENT_ID: ${{ secrets.CF_ACCESS_CLIENT_ID }} @@ -22,6 +21,7 @@ jobs: - run: | npm ci + git submodule update --init cd packages/playwright-cloudflare npm run build npm run test:deploy diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 06a85aed69..94999fb0a5 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: "22" - run: npm ci diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml index 5afe85e0c7..778c8219bd 100644 --- a/.github/workflows/create_test_report.yml +++ b/.github/workflows/create_test_report.yml @@ -1,7 +1,7 @@ name: Publish Test Results on: workflow_run: - workflows: ["tests 1", "tests 2", "tests others"] + workflows: ["tests 1", "tests 2", "tests others", "MCP"] types: - completed jobs: @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - run: npm ci diff --git a/.github/workflows/infra.yml b/.github/workflows/infra.yml index fa6f958a57..8ea6b18c18 100644 --- a/.github/workflows/infra.yml +++ b/.github/workflows/infra.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - run: npm ci @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - uses: actions/setup-python@v6 diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index b2f9cb2e7d..8b91b1de4e 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -24,7 +24,7 @@ jobs: environment: allow-publish-driver-to-cdn # This is required for OIDC login (azure/login) steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 registry-url: 'https://registry.npmjs.org' @@ -72,7 +72,7 @@ jobs: if: github.repository == 'microsoft/playwright' steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - uses: actions/create-github-app-token@v2 @@ -82,17 +82,22 @@ jobs: private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }} repositories: trace.playwright.dev - name: Deploy Canary + if: contains(github.ref, 'main') && github.event.schedule run: bash utils/build/deploy-trace-viewer.sh --canary - if: contains(github.ref, 'main') env: GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }} - name: Deploy Beta - run: bash utils/build/deploy-trace-viewer.sh --beta if: contains(github.ref, 'release') && github.event_name == 'push' + run: bash utils/build/deploy-trace-viewer.sh --beta env: GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }} - name: Deploy Stable + if: github.event_name == 'release' && github.event.action == 'published' + run: bash utils/build/deploy-trace-viewer.sh --stable + env: + GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }} + - name: Deploy Stable (manually) + if: contains(github.ref, 'release') && github.event_name == 'workflow_dispatch' run: bash utils/build/deploy-trace-viewer.sh --stable - if: contains(github.ref, 'release') && github.event_name == 'release' env: GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }} diff --git a/.github/workflows/publish_release_docker.yml b/.github/workflows/publish_release_docker.yml index f038bd5aad..40b20afb50 100644 --- a/.github/workflows/publish_release_docker.yml +++ b/.github/workflows/publish_release_docker.yml @@ -19,7 +19,7 @@ jobs: environment: allow-publishing-docker-to-acr steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/roll_browser_into_playwright.yml b/.github/workflows/roll_browser_into_playwright.yml index 154f52feaf..f2d02477a9 100644 --- a/.github/workflows/roll_browser_into_playwright.yml +++ b/.github/workflows/roll_browser_into_playwright.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - run: npm ci diff --git a/.github/workflows/roll_driver_nodejs.yml b/.github/workflows/roll_nodejs.yml similarity index 82% rename from .github/workflows/roll_driver_nodejs.yml rename to .github/workflows/roll_nodejs.yml index baafef164a..2bf362bfa5 100644 --- a/.github/workflows/roll_driver_nodejs.yml +++ b/.github/workflows/roll_nodejs.yml @@ -1,4 +1,4 @@ -name: "PR: bump driver Node.js" +name: "PR: bump driver/Docker Node.js" on: workflow_dispatch: schedule: @@ -13,10 +13,10 @@ jobs: contents: write steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - - run: node utils/build/update-playwright-driver-version.mjs + - run: node utils/build/update-playwright-node.mjs - name: Prepare branch id: prepare-branch run: | @@ -25,13 +25,13 @@ jobs: exit 0; fi echo "HAS_CHANGES=1" >> $GITHUB_OUTPUT - BRANCH_NAME="roll-driver-nodejs/$(date +%Y-%b-%d)" + BRANCH_NAME="roll-platform-nodejs/$(date +%Y-%b-%d)" echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT git config --global user.name microsoft-playwright-automation[bot] git config --global user.email 203992400+microsoft-playwright-automation[bot]@users.noreply.github.com git checkout -b "$BRANCH_NAME" git add . - git commit -m "chore(driver): roll driver to recent Node.js LTS version" + git commit -m "chore: roll driver/Dockerfile to recent Node.js LTS version" git push origin $BRANCH_NAME - uses: actions/create-github-app-token@v2 id: app-token @@ -49,5 +49,5 @@ jobs: repo: 'playwright', head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}', base: 'main', - title: 'chore(driver): roll driver to recent Node.js LTS version', + title: 'chore: roll driver/Dockerfile to recent Node.js LTS version', }); diff --git a/.github/workflows/roll_stable_test_runner.yml b/.github/workflows/roll_stable_test_runner.yml index 08c126cb0b..5928a2eab7 100644 --- a/.github/workflows/roll_stable_test_runner.yml +++ b/.github/workflows/roll_stable_test_runner.yml @@ -13,7 +13,7 @@ jobs: contents: write steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 22 - run: | diff --git a/.github/workflows/tests_bidi.yml b/.github/workflows/tests_bidi.yml index 60235d95e3..489b94d29c 100644 --- a/.github/workflows/tests_bidi.yml +++ b/.github/workflows/tests_bidi.yml @@ -40,7 +40,7 @@ jobs: if: github.event_name == 'workflow_dispatch' with: ref: ${{ github.event.inputs.ref }} - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - run: npm ci @@ -58,7 +58,7 @@ jobs: PWTEST_USE_BIDI_EXPECTATIONS: '1' - name: Upload csv report to GitHub if: ${{ !cancelled() }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: csv-report-${{ matrix.channel }} path: test-results/report.csv @@ -66,7 +66,7 @@ jobs: - name: Upload json report to GitHub if: ${{ !cancelled() }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: json-report-${{ matrix.channel }} path: test-results/report.json diff --git a/.github/workflows/tests_components.yml b/.github/workflows/tests_components.yml index f403ad8d0c..569f4551ed 100644 --- a/.github/workflows/tests_components.yml +++ b/.github/workflows/tests_components.yml @@ -35,7 +35,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - run: npm ci diff --git a/.github/workflows/tests_mcp.yml b/.github/workflows/tests_mcp.yml index 1beebe5249..753bb7412e 100644 --- a/.github/workflows/tests_mcp.yml +++ b/.github/workflows/tests_mcp.yml @@ -23,7 +23,6 @@ env: # Force terminal colors. @see https://www.npmjs.com/package/colors FORCE_COLOR: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - DEBUG_GIT_COMMIT_INFO: 1 jobs: test_mcp: diff --git a/.github/workflows/tests_others.yml b/.github/workflows/tests_others.yml index f2fc2b0b83..6e736427ce 100644 --- a/.github/workflows/tests_others.yml +++ b/.github/workflows/tests_others.yml @@ -28,7 +28,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - run: npm ci diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml index 2cb96d9ad6..f55bc25572 100644 --- a/.github/workflows/tests_primary.yml +++ b/.github/workflows/tests_primary.yml @@ -25,7 +25,6 @@ env: # Force terminal colors. @see https://www.npmjs.com/package/colors FORCE_COLOR: 1 ELECTRON_SKIP_BINARY_DOWNLOAD: 1 - DEBUG_GIT_COMMIT_INFO: 1 jobs: test_linux: @@ -139,48 +138,14 @@ jobs: env: PWTEST_CHANNEL: firefox-beta - test_web_components: - name: Web Components - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 - with: - node-version: 20 - - run: npm ci - - run: npm run build - - - run: npx playwright install --with-deps - - run: npm run test-html-reporter - env: - PWTEST_BOT_NAME: "web-components-html-reporter" - - name: Upload blob report - if: ${{ !cancelled() }} - uses: ./.github/actions/upload-blob-report - with: - report_dir: packages/html-reporter/blob-report - job_name: "web-components-html-reporter" - - - run: npm run test-web - if: ${{ !cancelled() }} - env: - PWTEST_BOT_NAME: "web-components-web" - - name: Upload blob report - if: ${{ !cancelled() }} - uses: ./.github/actions/upload-blob-report - with: - report_dir: packages/web/blob-report - job_name: "web-components-web" - test_vscode_extension: name: VSCode Extension runs-on: ubuntu-latest env: PWTEST_BOT_NAME: "vscode-extension" - DEBUG_GIT_COMMIT_INFO: "" steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - run: npm ci diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.yml index 136eb4a462..801e8a9aa2 100644 --- a/.github/workflows/tests_secondary.yml +++ b/.github/workflows/tests_secondary.yml @@ -295,7 +295,7 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20 - run: npm ci diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..c11b3014d5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "packages/playwright-cloudflare/submodules/jest"] + path = packages/playwright-cloudflare/submodules/jest + url = https://github.com/jestjs/jest.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a945d57263..67468d397d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,16 +31,6 @@ npm run watch npx playwright install ``` -**Experimental dev mode with Hot Module Replacement for recorder/trace-viewer/UI Mode** - -``` -PW_HMR=1 npm run watch -PW_HMR=1 npx playwright show-trace -PW_HMR=1 npm run ctest -- --ui -PW_HMR=1 npx playwright codegen -PW_HMR=1 npx playwright show-report -``` - Playwright is a multi-package repository that uses npm workspaces. For browser APIs, look at [`packages/playwright-core`](https://github.com/microsoft/playwright/blob/main/packages/playwright-core). For test runner, see [`packages/playwright`](https://github.com/microsoft/playwright/blob/main/packages/playwright). Note that some files are generated by the build, so the watch process might override your changes if done in the wrong file. For example, TypeScript types for the API are generated from the [`docs/src`](https://github.com/microsoft/playwright/blob/main/docs/src). diff --git a/README.md b/README.md index 9bf9a59459..87263b2e1b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Fork of [Playwright](https://github.com/microsoft/playwright/) that was modified to be compatible with [Cloudflare Workers](https://developers.cloudflare.com/workers/) and [Browser Rendering](https://developers.cloudflare.com/browser-rendering/). -🏷️ Upstream Playwright version: [1.56.0](https://github.com/microsoft/playwright/releases/tag/v1.56.0) +🏷️ Upstream Playwright version: [1.57.0](https://github.com/microsoft/playwright/releases/tag/v1.57.0) ## Getting Started @@ -146,6 +146,7 @@ To build Playwright for Cloudflare: ```sh npm ci +git submodule update --init cd packages/playwright-cloudflare npm run build ``` diff --git a/browser_patches/firefox/UPSTREAM_CONFIG.sh b/browser_patches/firefox/UPSTREAM_CONFIG.sh index 9d6ff4f566..59bf574a1c 100644 --- a/browser_patches/firefox/UPSTREAM_CONFIG.sh +++ b/browser_patches/firefox/UPSTREAM_CONFIG.sh @@ -1,3 +1,3 @@ REMOTE_URL="https://github.com/mozilla-firefox/firefox" BASE_BRANCH="release" -BASE_REVISION="361373160356d92cb5cd4d67783a3806c776ee78" +BASE_REVISION="e0df3d598dba47de812bb5144cbc187557377095" diff --git a/browser_patches/firefox/juggler/ChannelEventSink.sys.mjs b/browser_patches/firefox/juggler/ChannelEventSink.sys.mjs new file mode 100644 index 0000000000..ab03e9f0a2 --- /dev/null +++ b/browser_patches/firefox/juggler/ChannelEventSink.sys.mjs @@ -0,0 +1,99 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { ComponentUtils } from "resource://gre/modules/ComponentUtils.sys.mjs"; + +const Cm = Components.manager; + +/** + * This is a nsIChannelEventSink implementation that monitors channel redirects. + * This has been forked from: + * https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/channel-event-sink.js + * The rest of this module is also more or less forking: + * https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/network-observer.js + * TODO(try to re-unify /remote/ with /devtools code) + */ +const SINK_CLASS_DESCRIPTION = "NetworkMonitor Channel Event Sink"; +const SINK_CLASS_ID = Components.ID("{c2b4c83e-607a-405a-beab-0ef5dbfb7617}"); +const SINK_CONTRACT_ID = "@mozilla.org/network/monitor/channeleventsink;1"; +const SINK_CATEGORY_NAME = "net-channel-event-sinks"; + +function ChannelEventSink() { + this.wrappedJSObject = this; + this.collectors = new Set(); +} + +ChannelEventSink.prototype = { + QueryInterface: ChromeUtils.generateQI(["nsIChannelEventSink"]), + + registerCollector(collector) { + this.collectors.add(collector); + }, + + unregisterCollector(collector) { + this.collectors.delete(collector); + + if (this.collectors.size == 0) { + ChannelEventSinkFactory.unregister(); + } + }, + + asyncOnChannelRedirect(oldChannel, newChannel, flags, callback) { + for (const collector of this.collectors) { + try { + collector._onChannelRedirect(oldChannel, newChannel, flags); + } catch (ex) { + console.error( + "StackTraceCollector.onChannelRedirect threw an exception", + ex + ); + } + } + callback.onRedirectVerifyCallback(Cr.NS_OK); + }, +}; + +export const ChannelEventSinkFactory = + ComponentUtils.generateSingletonFactory(ChannelEventSink); + +ChannelEventSinkFactory.register = function () { + const registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar); + if (registrar.isCIDRegistered(SINK_CLASS_ID)) { + return; + } + + registrar.registerFactory( + SINK_CLASS_ID, + SINK_CLASS_DESCRIPTION, + SINK_CONTRACT_ID, + ChannelEventSinkFactory + ); + + Services.catMan.addCategoryEntry( + SINK_CATEGORY_NAME, + SINK_CONTRACT_ID, + SINK_CONTRACT_ID, + false, + true + ); +}; + +ChannelEventSinkFactory.unregister = function () { + const registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar); + registrar.unregisterFactory(SINK_CLASS_ID, ChannelEventSinkFactory); + + Services.catMan.deleteCategoryEntry( + SINK_CATEGORY_NAME, + SINK_CONTRACT_ID, + false + ); +}; + +ChannelEventSinkFactory.getService = function () { + // Make sure the ChannelEventSink service is registered before accessing it + ChannelEventSinkFactory.register(); + + return Cc[SINK_CONTRACT_ID].getService(Ci.nsIChannelEventSink) + .wrappedJSObject; +}; diff --git a/browser_patches/firefox/juggler/NetworkObserver.js b/browser_patches/firefox/juggler/NetworkObserver.js index c063e0484d..2719cc1023 100644 --- a/browser_patches/firefox/juggler/NetworkObserver.js +++ b/browser_patches/firefox/juggler/NetworkObserver.js @@ -6,7 +6,7 @@ const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js'); const {NetUtil} = ChromeUtils.importESModule('resource://gre/modules/NetUtil.sys.mjs'); -const { ChannelEventSinkFactory } = ChromeUtils.importESModule("chrome://remote/content/cdp/observers/ChannelEventSink.sys.mjs"); +const { ChannelEventSinkFactory } = ChromeUtils.importESModule("chrome://juggler/content/ChannelEventSink.sys.mjs"); const Cc = Components.classes; diff --git a/browser_patches/firefox/juggler/TargetRegistry.js b/browser_patches/firefox/juggler/TargetRegistry.js index 5cddac6f64..55afdad864 100644 --- a/browser_patches/firefox/juggler/TargetRegistry.js +++ b/browser_patches/firefox/juggler/TargetRegistry.js @@ -1124,7 +1124,8 @@ class BrowserContext { setCookies(cookies) { const protocolToSameSite = { - [undefined]: Ci.nsICookie.SAMESITE_NONE, + [undefined]: Ci.nsICookie.SAMESITE_UNSET, + 'None': Ci.nsICookie.SAMESITE_UNSET, 'Lax': Ci.nsICookie.SAMESITE_LAX, 'Strict': Ci.nsICookie.SAMESITE_STRICT, }; @@ -1152,7 +1153,7 @@ class BrowserContext { secure, cookie.httpOnly || false, cookie.expires === undefined || cookie.expires === -1 /* isSession */, - cookie.expires === undefined ? Date.now() + HUNDRED_YEARS : cookie.expires, + cookie.expires === undefined ? Date.now() + HUNDRED_YEARS : cookie.expires * 1000, { userContextId: this.userContextId || undefined } /* originAttributes */, protocolToSameSite[cookie.sameSite], Ci.nsICookie.SCHEME_UNSET @@ -1182,7 +1183,7 @@ class BrowserContext { value: cookie.value, domain: cookie.host, path: cookie.path, - expires: cookie.isSession ? -1 : cookie.expiry, + expires: cookie.isSession ? -1 : cookie.expiry / 1000, size: cookie.name.length + cookie.value.length, httpOnly: cookie.isHttpOnly, secure: cookie.isSecure, diff --git a/browser_patches/firefox/juggler/content/main.js b/browser_patches/firefox/juggler/content/main.js index 462566e626..61e410630c 100644 --- a/browser_patches/firefox/juggler/content/main.js +++ b/browser_patches/firefox/juggler/content/main.js @@ -31,7 +31,7 @@ export function initialize(browsingContext, docShell) { heading: NaN, speed: NaN, }, - timestamp: Date.now() + timestamp: Date.now() + 24 * 60 * 60 * 1000, // Make sure it does not expire for a day. }); } else { browsingContext.setGeolocationServiceOverride(); diff --git a/browser_patches/firefox/juggler/jar.mn b/browser_patches/firefox/juggler/jar.mn index 7f3ecf5cdf..b21b33bc45 100644 --- a/browser_patches/firefox/juggler/jar.mn +++ b/browser_patches/firefox/juggler/jar.mn @@ -9,6 +9,7 @@ juggler.jar: content/Helper.js (Helper.js) content/NetworkObserver.js (NetworkObserver.js) + content/ChannelEventSink.sys.mjs (ChannelEventSink.sys.mjs) content/TargetRegistry.js (TargetRegistry.js) content/SimpleChannel.js (SimpleChannel.js) content/JugglerFrameParent.jsm (JugglerFrameParent.jsm) diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diff index 523cda6f45..25c06cbe42 100644 --- a/browser_patches/firefox/patches/bootstrap.diff +++ b/browser_patches/firefox/patches/bootstrap.diff @@ -1,16 +1,3 @@ -diff --git a/accessible/base/NotificationController.h b/accessible/base/NotificationController.h -index 1bcd464d3bd6b8465f78c62b074b0d57dbc6a082..f878ac9db2d800542dabcc2f48e8ae4727ec4b9a 100644 ---- a/accessible/base/NotificationController.h -+++ b/accessible/base/NotificationController.h -@@ -244,6 +244,8 @@ class NotificationController final : public EventQueue, - } - #endif - -+ bool IsUpdatePendingForJugglerAccessibility() { return IsUpdatePending(); } -+ - protected: - virtual ~NotificationController(); - diff --git a/accessible/interfaces/nsIAccessibleDocument.idl b/accessible/interfaces/nsIAccessibleDocument.idl index 6c932c14a03e9cbf70723171dc9a1006bd2c017d..6312131c94c6d7e994a4a49dd64b2b4c5777251f 100644 --- a/accessible/interfaces/nsIAccessibleDocument.idl @@ -26,7 +13,7 @@ index 6c932c14a03e9cbf70723171dc9a1006bd2c017d..6312131c94c6d7e994a4a49dd64b2b4c + readonly attribute boolean isUpdatePendingForJugglerAccessibility; }; diff --git a/accessible/xpcom/xpcAccessibleDocument.cpp b/accessible/xpcom/xpcAccessibleDocument.cpp -index 3229ee415b93b9a47d7d40605ed7b509744c94ad..24a0837c508f7bc2709538fc28fdafe83ed524f8 100644 +index 3229ee415b93b9a47d7d40605ed7b509744c94ad..c2cc38ded257a02de8922312057892bf9d0cad7b 100644 --- a/accessible/xpcom/xpcAccessibleDocument.cpp +++ b/accessible/xpcom/xpcAccessibleDocument.cpp @@ -151,6 +151,13 @@ xpcAccessibleDocument::GetBrowsingContext( @@ -36,7 +23,7 @@ index 3229ee415b93b9a47d7d40605ed7b509744c94ad..24a0837c508f7bc2709538fc28fdafe8 +NS_IMETHODIMP +xpcAccessibleDocument::GetIsUpdatePendingForJugglerAccessibility(bool* updating) { + NS_ENSURE_ARG_POINTER(updating); -+ *updating = Intl()->Controller()->IsUpdatePendingForJugglerAccessibility(); ++ *updating = Intl()->Controller()->IsUpdatePending(); + return NS_OK; +} + @@ -89,7 +76,7 @@ index 8167d2b81c918e02ce757f7f448f22e07c29d140..3ae798880acfd8aa965ae08051f2f818 DWORD creationFlags = CREATE_SUSPENDED | CREATE_UNICODE_ENVIRONMENT; diff --git a/browser/installer/allowed-dupes.mn b/browser/installer/allowed-dupes.mn -index a315ebcb8b60875b4eddbb5d654764603e0e7bec..fa67db1ff5a331dda4eaff4457418c306869d011 100644 +index 6bbc4016cd6d56e8625e808b5070515a23de7600..2fb56fb1afa5b108a426737cb5e62dc42a199354 100644 --- a/browser/installer/allowed-dupes.mn +++ b/browser/installer/allowed-dupes.mn @@ -59,6 +59,12 @@ browser/chrome/browser/builtin-addons/webcompat/shims/empty-shim.txt @@ -106,19 +93,19 @@ index a315ebcb8b60875b4eddbb5d654764603e0e7bec..fa67db1ff5a331dda4eaff4457418c30 browser/chrome/browser/content/activity-stream/data/content/tippytop/favicons/allegro-pl.ico browser/defaults/settings/main/search-config-icons/96327a73-c433-5eb4-a16d-b090cadfb80b diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in -index 6ebf2f62c47757f16841d04c164d2d86447fcbd0..cae3f3ac6f6ced0b59fe850643bbb90d619750d0 100644 +index 2b4d35e060dc592bb70a1f2b7ceee68616c8202b..323abfaee37445942f7678037dd5b53792dd5ed4 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in -@@ -192,6 +192,9 @@ +@@ -183,6 +183,9 @@ @RESPATH@/chrome/remote.manifest #endif +@RESPATH@/chrome/juggler@JAREXT@ +@RESPATH@/chrome/juggler.manifest + - ; [Extensions] - @RESPATH@/components/extensions-toolkit.manifest - + ; Modules + @RESPATH@/browser/modules/* + @RESPATH@/modules/* diff --git a/devtools/server/socket/websocket-server.js b/devtools/server/socket/websocket-server.js index d49c6fbf1bf83b832795fa674f6b41f223eef812..7ea3540947ff5f61b15f27fbf4b955649f8e9ff9 100644 --- a/devtools/server/socket/websocket-server.js @@ -167,10 +154,10 @@ index d49c6fbf1bf83b832795fa674f6b41f223eef812..7ea3540947ff5f61b15f27fbf4b95564 const transportProvider = { setListener(upgradeListener) { diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp -index 1a33afa481826b1a53c507d5ea596bcb629d8ac4..8f4f13ff1325b104af80e319cf092be9fd2baab0 100644 +index 97334bee3a111a538779789d3495805cec8b1e9a..67d030f2adecd9acc62665e2a627123148aa927d 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp -@@ -109,8 +109,15 @@ struct ParamTraits +@@ -110,8 +110,15 @@ struct ParamTraits template <> struct ParamTraits @@ -188,8 +175,8 @@ index 1a33afa481826b1a53c507d5ea596bcb629d8ac4..8f4f13ff1325b104af80e319cf092be9 template <> struct ParamTraits -@@ -2915,6 +2922,32 @@ void BrowsingContext::DidSet(FieldIndex, - PresContextAffectingFieldChanged(); +@@ -2950,6 +2957,32 @@ void BrowsingContext::DidSet(FieldIndex, + }); } +void BrowsingContext::DidSet(FieldIndex, @@ -221,8 +208,41 @@ index 1a33afa481826b1a53c507d5ea596bcb629d8ac4..8f4f13ff1325b104af80e319cf092be9 void BrowsingContext::DidSet(FieldIndex, nsString&& aOldValue) { MOZ_ASSERT(IsTop()); +@@ -3290,7 +3323,7 @@ void BrowsingContext::SetGeolocationServiceOverride( + if (aGeolocationOverride.WasPassed()) { + if (!mGeolocationServiceOverride) { + mGeolocationServiceOverride = new nsGeolocationService(); +- mGeolocationServiceOverride->Init(); ++ mGeolocationServiceOverride->Init(true /* isOverride */); + } + mGeolocationServiceOverride->Update(aGeolocationOverride.Value()); + } else if (RefPtr serviceOverride = +@@ -3793,6 +3826,23 @@ void BrowsingContext::DidSet(FieldIndex, + } + } + ++void BrowsingContext::DidSet(FieldIndex, bool aOldValue) { ++ const bool newValue = ForceOffline(); ++ if (newValue == aOldValue) { ++ return; ++ } ++ PreOrderWalk([&](BrowsingContext* aContext) { ++ if (Document* doc = aContext->GetDocument()) { ++ if (nsPIDOMWindowOuter* win = aContext->GetDOMWindow()) { ++ nsContentUtils::DispatchTrustedEvent( ++ doc, nsGlobalWindowOuter::Cast(win), ++ newValue ? u"offline"_ns : u"online"_ns, ++ CanBubble::eYes, Cancelable::eYes, nullptr); ++ } ++ } ++ }); ++} ++ + bool BrowsingContext::IsPopupAllowed() { + for (auto* context = GetCurrentWindowContext(); context; + context = context->GetParentWindowContext()) { diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h -index 0bd3efa16dcae42ff02f42bddce378a7f0c7b621..c8cc1bce7d9901aced6032d0e2e2285cf9eb394b 100644 +index b42c32133c6490755ae4e1c599255418e6443011..afa502833ba55c94dbd30726d37450c460a69e2b 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h @@ -205,10 +205,10 @@ struct EmbedderColorSchemes { @@ -238,7 +258,7 @@ index 0bd3efa16dcae42ff02f42bddce378a7f0c7b621..c8cc1bce7d9901aced6032d0e2e2285c FIELD(EmbedderElementType, Maybe) \ FIELD(MessageManagerGroup, nsString) \ FIELD(MaxTouchPointsOverride, uint8_t) \ -@@ -245,6 +245,9 @@ struct EmbedderColorSchemes { +@@ -246,6 +246,9 @@ struct EmbedderColorSchemes { * embedder element. */ \ FIELD(EmbedderColorSchemes, EmbedderColorSchemes) \ FIELD(DisplayMode, dom::DisplayMode) \ @@ -248,7 +268,7 @@ index 0bd3efa16dcae42ff02f42bddce378a7f0c7b621..c8cc1bce7d9901aced6032d0e2e2285c /* The number of entries added to the session history because of this \ * browsing context. */ \ FIELD(HistoryEntryCount, uint32_t) \ -@@ -967,6 +970,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -975,6 +978,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { return GetForcedColorsOverride(); } @@ -263,7 +283,7 @@ index 0bd3efa16dcae42ff02f42bddce378a7f0c7b621..c8cc1bce7d9901aced6032d0e2e2285c bool IsInBFCache() const; bool AllowJavascript() const { return GetAllowJavascript(); } -@@ -1131,6 +1142,11 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -1146,6 +1157,11 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { return IsTop(); } @@ -275,7 +295,7 @@ index 0bd3efa16dcae42ff02f42bddce378a7f0c7b621..c8cc1bce7d9901aced6032d0e2e2285c bool CanSet(FieldIndex, dom::ForcedColorsOverride, ContentParent*) { return IsTop(); -@@ -1149,10 +1165,22 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -1164,12 +1180,24 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { void DidSet(FieldIndex, dom::ForcedColorsOverride aOldValue); @@ -286,6 +306,8 @@ index 0bd3efa16dcae42ff02f42bddce378a7f0c7b621..c8cc1bce7d9901aced6032d0e2e2285c void WalkPresContexts(Callback&&); void PresContextAffectingFieldChanged(); + void DidSet(FieldIndex, nsString&& aOldValue); + + bool CanSet(FieldIndex, + dom::PrefersReducedMotionOverride, ContentParent*) { + return IsTop(); @@ -298,11 +320,20 @@ index 0bd3efa16dcae42ff02f42bddce378a7f0c7b621..c8cc1bce7d9901aced6032d0e2e2285c void DidSet(FieldIndex, nsString&& aOldValue); bool CanSet(FieldIndex, bool, ContentParent*) { +@@ -1360,6 +1388,8 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { + + void DidSet(FieldIndex, bool aOldValue); + ++ void DidSet(FieldIndex, bool aOldValue); ++ + // Allow if the process attemping to set field is the same as the owning + // process. Deprecated. New code that might use this should generally be moved + // to WindowContext or be settable only by the parent process. diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp -index 1c5c421d6ec153ab61d3aae29200f8abb02b1a33..68751ec0190f308c20aae6b6c58687dcf0fa225d 100644 +index 4953744c3f627bb68b78606d8ae4bf6ab649398a..17c7cc94dafc76cd72aacddfd633b7df58eeae78 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp -@@ -325,6 +325,8 @@ void CanonicalBrowsingContext::ReplacedBy( +@@ -267,6 +267,8 @@ void CanonicalBrowsingContext::ReplacedBy( txn.SetForceOffline(GetForceOffline()); txn.SetTopInnerSizeForRFP(GetTopInnerSizeForRFP()); txn.SetIPAddressSpace(GetIPAddressSpace()); @@ -311,7 +342,7 @@ index 1c5c421d6ec153ab61d3aae29200f8abb02b1a33..68751ec0190f308c20aae6b6c58687dc // Propagate some settings on BrowsingContext replacement so they're not lost // on bfcached navigations. These are important for GeckoView (see bug -@@ -1635,6 +1637,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, +@@ -1705,6 +1707,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, return; } @@ -325,7 +356,7 @@ index 1c5c421d6ec153ab61d3aae29200f8abb02b1a33..68751ec0190f308c20aae6b6c58687dc } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp -index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4472cce2d 100644 +index bf702818cf4116ec1cd911b6e7b5f7ddafa3e508..d846e5f6f900d2d69228331b80031bd1c18b08ed 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -16,6 +16,12 @@ @@ -349,7 +380,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 #include "mozilla/dom/HTMLAnchorElement.h" #include "mozilla/dom/HTMLIFrameElement.h" #include "mozilla/dom/Navigation.h" -@@ -95,6 +102,7 @@ +@@ -98,6 +105,7 @@ #include "mozilla/dom/DocumentBinding.h" #include "mozilla/glean/DocshellMetrics.h" #include "mozilla/ipc/ProtocolUtils.h" @@ -357,7 +388,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 #include "mozilla/net/DocumentChannel.h" #include "mozilla/net/DocumentChannelChild.h" #include "mozilla/net/ParentChannelWrapper.h" -@@ -118,6 +126,7 @@ +@@ -122,6 +130,7 @@ #include "nsIDocumentViewer.h" #include "mozilla/dom/Document.h" #include "nsHTMLDocument.h" @@ -365,7 +396,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 #include "nsIDocumentLoaderFactory.h" #include "nsIDOMWindow.h" #include "nsIEditingSession.h" -@@ -212,6 +221,7 @@ +@@ -217,6 +226,7 @@ #include "nsGlobalWindowInner.h" #include "nsGlobalWindowOuter.h" #include "nsJSEnvironment.h" @@ -373,7 +404,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 #include "nsNetCID.h" #include "nsNetUtil.h" #include "nsObjectLoadingContent.h" -@@ -353,6 +363,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, +@@ -358,6 +368,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, mAllowDNSPrefetch(true), mAllowWindowControl(true), mCSSErrorReportingEnabled(false), @@ -388,7 +419,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 mAllowAuth(mItemType == typeContent), mAllowKeywordFixup(false), mDisableMetaRefreshWhenInactive(false), -@@ -3025,6 +3043,232 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { +@@ -3037,6 +3055,232 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { return NS_OK; } @@ -621,7 +652,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 NS_IMETHODIMP nsDocShell::GetIsNavigating(bool* aOut) { *aOut = mIsNavigating; -@@ -4790,7 +5034,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { +@@ -4819,7 +5063,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { } void nsDocShell::ActivenessMaybeChanged() { @@ -630,7 +661,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 if (RefPtr presShell = GetPresShell()) { presShell->ActivenessMaybeChanged(); } -@@ -6723,6 +6967,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, +@@ -6881,6 +7125,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, return false; // no entry to save into } @@ -641,7 +672,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 MOZ_ASSERT(!mozilla::SessionHistoryInParent(), "mOSHE cannot be non-null with SHIP"); nsCOMPtr viewer = mOSHE->GetDocumentViewer(); -@@ -8464,6 +8712,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { +@@ -8637,6 +8885,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { true, // aForceNoOpener getter_AddRefs(newBC)); MOZ_ASSERT(!newBC); @@ -654,7 +685,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 return rv; } -@@ -9754,6 +10008,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, +@@ -9934,6 +10188,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr); nsCOMPtr req; @@ -671,7 +702,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 rv = DoURILoad(aLoadState, aCacheKey, getter_AddRefs(req)); if (NS_SUCCEEDED(rv)) { -@@ -12970,6 +13234,9 @@ class OnLinkClickEvent : public Runnable { +@@ -13323,6 +13587,9 @@ class OnLinkClickEvent : public Runnable { mHandler->OnLinkClickSync(mContent, mLoadState, mNoOpenerImplied, mTriggeringPrincipal); } @@ -681,7 +712,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 return NS_OK; } -@@ -13083,6 +13350,8 @@ nsresult nsDocShell::OnLinkClick( +@@ -13439,6 +13706,8 @@ nsresult nsDocShell::OnLinkClick( nsCOMPtr ev = new OnLinkClickEvent( this, aContent, loadState, noOpenerImplied, aTriggeringPrincipal); @@ -691,7 +722,7 @@ index 5bcbbfbcb522adb9988ba421a4f590ee2105e1d3..cb9bc09a7901334b6ba73834971498f4 } diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h -index 32d1673ea09a2c9f6bb14f6dcd8a9c1c8f9831c4..a301ecd30fcad4d79d370ab316fa0d8e5e509795 100644 +index 3050f0a5a10c7f49f56cf325cd8bfe5e6508b5be..a4f4895f69a2eaa55f3eeae77bd6a3fb29931ad4 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -16,6 +16,7 @@ @@ -702,7 +733,7 @@ index 32d1673ea09a2c9f6bb14f6dcd8a9c1c8f9831c4..a301ecd30fcad4d79d370ab316fa0d8e #include "mozilla/dom/WindowProxyHolder.h" #include "nsCOMPtr.h" #include "nsCharsetSource.h" -@@ -78,6 +79,7 @@ class nsCommandManager; +@@ -80,6 +81,7 @@ class nsCommandManager; class nsDocShellEditorData; class nsDOMNavigationTiming; class nsDSURIContentListener; @@ -710,7 +741,7 @@ index 32d1673ea09a2c9f6bb14f6dcd8a9c1c8f9831c4..a301ecd30fcad4d79d370ab316fa0d8e class nsGlobalWindowOuter; class FramingChecker; -@@ -408,6 +410,15 @@ class nsDocShell final : public nsDocLoader, +@@ -410,6 +412,15 @@ class nsDocShell final : public nsDocLoader, void SetWillChangeProcess() { mWillChangeProcess = true; } bool WillChangeProcess() { return mWillChangeProcess; } @@ -726,7 +757,7 @@ index 32d1673ea09a2c9f6bb14f6dcd8a9c1c8f9831c4..a301ecd30fcad4d79d370ab316fa0d8e // Create a content viewer within this nsDocShell for the given // `WindowGlobalChild` actor. nsresult CreateDocumentViewerForActor( -@@ -1013,6 +1024,8 @@ class nsDocShell final : public nsDocLoader, +@@ -1036,6 +1047,8 @@ class nsDocShell final : public nsDocLoader, bool CSSErrorReportingEnabled() const { return mCSSErrorReportingEnabled; } @@ -735,7 +766,7 @@ index 32d1673ea09a2c9f6bb14f6dcd8a9c1c8f9831c4..a301ecd30fcad4d79d370ab316fa0d8e // 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 -@@ -1301,6 +1314,17 @@ class nsDocShell final : public nsDocLoader, +@@ -1355,6 +1368,17 @@ class nsDocShell final : public nsDocLoader, bool mAllowDNSPrefetch : 1; bool mAllowWindowControl : 1; bool mCSSErrorReportingEnabled : 1; @@ -754,12 +785,12 @@ index 32d1673ea09a2c9f6bb14f6dcd8a9c1c8f9831c4..a301ecd30fcad4d79d370ab316fa0d8e bool mAllowKeywordFixup : 1; bool mDisableMetaRefreshWhenInactive : 1; diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl -index 159daa1dd936e84f1bf3ce413643382e4d37f592..607224a5270995abccf439992ec577f11178e522 100644 +index 763c7adb5ab9e3e56d6f1608899f6622997f272a..4f77795b5ce1f8fff79581987e017165dbdcbc1e 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -44,6 +44,7 @@ interface nsIURI; interface nsIChannel; - interface nsIContentSecurityPolicy; + interface nsIPolicyContainer; interface nsIDocumentViewer; +interface nsIDOMGeoPosition; interface nsIEditor; @@ -812,10 +843,10 @@ index 159daa1dd936e84f1bf3ce413643382e4d37f592..607224a5270995abccf439992ec577f1 * 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 a16bef739fcde0f14ba7e53e0acfa3aa2ee1dd3a..c4747478156c973307b7866f84c65520e4bff9d1 100644 +index 40da41ae4ac7d8d61c664e25bec8a74091d8b3e0..50ee1170e6d5b261334c7baccc63ed492b86ec38 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp -@@ -3818,6 +3818,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { +@@ -3799,6 +3799,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { } void Document::ApplySettingsFromCSP(bool aSpeculative) { @@ -824,10 +855,10 @@ index a16bef739fcde0f14ba7e53e0acfa3aa2ee1dd3a..c4747478156c973307b7866f84c65520 + nsresult rv = NS_OK; if (!aSpeculative) { - // 1) apply settings from regular CSP -@@ -3875,6 +3878,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { - MOZ_ASSERT(!mScriptGlobalObject, - "CSP must be initialized before mScriptGlobalObject is set!"); + nsIContentSecurityPolicy* csp = PolicyContainer::GetCSP(mPolicyContainer); +@@ -3887,6 +3890,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { + MOZ_ASSERT(mPolicyContainer, + "Policy container must be initialized before CSP!"); + nsCOMPtr shell(mDocumentContainer); + if (shell && nsDocShell::Cast(shell)->IsBypassCSPEnabled()) { @@ -837,7 +868,7 @@ index a16bef739fcde0f14ba7e53e0acfa3aa2ee1dd3a..c4747478156c973307b7866f84c65520 // If this is a data document - no need to set CSP. if (mLoadedAsData) { return NS_OK; -@@ -4699,6 +4707,10 @@ bool Document::HasFocus(ErrorResult& rv) const { +@@ -4753,6 +4761,10 @@ bool Document::HasFocus(ErrorResult& rv) const { return false; } @@ -848,7 +879,7 @@ index a16bef739fcde0f14ba7e53e0acfa3aa2ee1dd3a..c4747478156c973307b7866f84c65520 if (!fm->IsInActiveWindow(bc)) { return false; } -@@ -20107,6 +20119,35 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { +@@ -20326,6 +20338,35 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { return PreferenceSheet::PrefsFor(*this).mColorScheme; } @@ -885,10 +916,10 @@ index a16bef739fcde0f14ba7e53e0acfa3aa2ee1dd3a..c4747478156c973307b7866f84c65520 if (!sLoadingForegroundTopLevelContentDocument) { return false; diff --git a/dom/base/Document.h b/dom/base/Document.h -index f9f8089ad484330a9d863fac7559b94aa34d80fd..75b6f3b03a6fe11511cc1e9ebdc6aa16936bbbcb 100644 +index 20f726a52f9f3591502597e20eeb8c07fe35feb2..c46f58ac88d536850169e6c51b9cfcb871d36e70 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h -@@ -4224,6 +4224,8 @@ class Document : public nsINode, +@@ -4252,6 +4252,8 @@ class Document : public nsINode, // color-scheme meta tag. ColorScheme DefaultColorScheme() const; @@ -898,7 +929,7 @@ index f9f8089ad484330a9d863fac7559b94aa34d80fd..75b6f3b03a6fe11511cc1e9ebdc6aa16 static bool AutomaticStorageAccessPermissionCanBeGranted( diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp -index fac275953573368e91e99bc8a72a885fb1c75521..7c1bcfdba325f8310239fc69921aaa0f14255f33 100644 +index 11a57adbb57b0adccf7ae491e7d7757f838bd9dc..e478244cedc2089fb99b3153d7493b7d36d72ea9 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -347,14 +347,18 @@ void Navigator::GetAppName(nsAString& aAppName) const { @@ -937,7 +968,7 @@ index fac275953573368e91e99bc8a72a885fb1c75521..7c1bcfdba325f8310239fc69921aaa0f // 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 -@@ -2309,7 +2319,8 @@ bool Navigator::Webdriver() { +@@ -2315,7 +2325,8 @@ bool Navigator::Webdriver() { } #endif @@ -961,10 +992,10 @@ index 893947475fbb8688becb1c1495385e4048d4927d..dfb50acf689223fdab7ef6f42afbbd53 dom::MediaCapabilities* MediaCapabilities(); dom::MediaSession* MediaSession(); diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp -index 787d4c4e22715a72197e5d06831bd6d284129c2c..75fc73ce2863f994ce703b0f822acb924bee4f3d 100644 +index 7703ab18c104848eab9377769641d3b60e9bcf8e..3028fc5a7e6c54a7f4455f135e889d038eed378d 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp -@@ -9432,11 +9432,13 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9528,11 +9528,13 @@ nsresult nsContentUtils::SendMouseEvent( int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, bool* aPreventDefault, bool aIsDOMEventSynthesized, @@ -979,7 +1010,7 @@ index 787d4c4e22715a72197e5d06831bd6d284129c2c..75fc73ce2863f994ce703b0f822acb92 if (aType.EqualsLiteral("mousedown")) { msg = eMouseDown; } else if (aType.EqualsLiteral("mouseup")) { -@@ -9462,6 +9464,12 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9558,6 +9560,12 @@ nsresult nsContentUtils::SendMouseEvent( msg = eMouseHitTest; } else if (aType.EqualsLiteral("MozMouseExploreByTouch")) { msg = eMouseExploreByTouch; @@ -992,7 +1023,7 @@ index 787d4c4e22715a72197e5d06831bd6d284129c2c..75fc73ce2863f994ce703b0f822acb92 } else { return NS_ERROR_FAILURE; } -@@ -9472,7 +9480,14 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9568,7 +9576,14 @@ nsresult nsContentUtils::SendMouseEvent( Maybe pointerEvent; Maybe mouseEvent; @@ -1008,7 +1039,7 @@ index 787d4c4e22715a72197e5d06831bd6d284129c2c..75fc73ce2863f994ce703b0f822acb92 MOZ_ASSERT(!aIsWidgetEventSynthesized, "The event shouldn't be dispatched as a synthesized event"); if (MOZ_UNLIKELY(aIsWidgetEventSynthesized)) { -@@ -9491,8 +9506,11 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9587,8 +9602,11 @@ nsresult nsContentUtils::SendMouseEvent( contextMenuKey ? WidgetMouseEvent::eContextMenuKey : WidgetMouseEvent::eNormal); } @@ -1020,7 +1051,7 @@ index 787d4c4e22715a72197e5d06831bd6d284129c2c..75fc73ce2863f994ce703b0f822acb92 mouseOrPointerEvent.pointerId = aIdentifier; mouseOrPointerEvent.mModifiers = GetWidgetModifiers(aModifiers); mouseOrPointerEvent.mButton = aButton; -@@ -9505,6 +9523,8 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -9601,6 +9619,8 @@ nsresult nsContentUtils::SendMouseEvent( mouseOrPointerEvent.mClickCount = aClickCount; mouseOrPointerEvent.mFlags.mIsSynthesizedForTests = aIsDOMEventSynthesized; mouseOrPointerEvent.mExitFrom = exitFrom; @@ -1030,10 +1061,10 @@ index 787d4c4e22715a72197e5d06831bd6d284129c2c..75fc73ce2863f994ce703b0f822acb92 nsPresContext* presContext = aPresShell->GetPresContext(); if (!presContext) return NS_ERROR_FAILURE; diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h -index 7d89626774660fb9e0f564808270e3059e4d7b3c..c7f748e6f33cbcd72b0c97d437b2abbcbe4242be 100644 +index a1b96bce18e1904f4068057defa26142ebe8874b..f2fc14da57cf08139723980dedc33f2d3a9a431b 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h -@@ -3078,8 +3078,9 @@ class nsContentUtils { +@@ -3080,8 +3080,9 @@ class nsContentUtils { int32_t aButton, int32_t aButtons, int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, @@ -1046,7 +1077,7 @@ index 7d89626774660fb9e0f564808270e3059e4d7b3c..c7f748e6f33cbcd72b0c97d437b2abbc static void FirePageShowEventForFrameLoaderSwap( nsIDocShellTreeItem* aItem, diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp -index e85140d5afebf57cf56bf16ef0c43c425c8d50c7..3062737c3319e35cdc4786c06750a1ac2a99565f 100644 +index c6c5833cd29ef041da348d4398513bab7ef2f9aa..424cc396bfc211bc7debb3df203cfa26da7a4c55 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -707,6 +707,26 @@ nsDOMWindowUtils::GetPresShellId(uint32_t* aPresShellId) { @@ -1113,7 +1144,7 @@ index e85140d5afebf57cf56bf16ef0c43c425c8d50c7..3062737c3319e35cdc4786c06750a1ac NS_IMETHODIMP diff --git a/dom/base/nsDOMWindowUtils.h b/dom/base/nsDOMWindowUtils.h -index a8a48d28fc4ef612f8234bc2490a41672f1704f5..f702b0c9a0783ec547a41bbefd68e18a27a239fe 100644 +index 4553ad5e7696055e861be5f840f8ce2bc54a5b29..1afc16325fcb63a3e510bdc387c8386eccf5d48b 100644 --- a/dom/base/nsDOMWindowUtils.h +++ b/dom/base/nsDOMWindowUtils.h @@ -94,7 +94,7 @@ class nsDOMWindowUtils final : public nsIDOMWindowUtils, @@ -1126,10 +1157,10 @@ index a8a48d28fc4ef612f8234bc2490a41672f1704f5..f702b0c9a0783ec547a41bbefd68e18a MOZ_CAN_RUN_SCRIPT nsresult SendTouchEventCommon( diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp -index be89a1c984982ea005e9bf7f440f5c8a2e8bab55..f8154882b9af02c5e9d7181e7a15b78824be8df9 100644 +index 62c4bfb96dbb6e64aeadd9e45c296905b7956811..83f1e7303e2ebabfc73921d9bd27a255304a2ea4 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp -@@ -1719,6 +1719,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, +@@ -1717,6 +1717,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, (GetActiveBrowsingContext() == newRootBrowsingContext); } @@ -1140,7 +1171,7 @@ index be89a1c984982ea005e9bf7f440f5c8a2e8bab55..f8154882b9af02c5e9d7181e7a15b788 // Exit fullscreen if a website focuses another window if (StaticPrefs::full_screen_api_exit_on_windowRaise() && !isElementInActiveWindow && (aFlags & FLAG_RAISE)) { -@@ -2305,6 +2309,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2303,6 +2307,7 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, bool aIsLeavingDocument, bool aAdjustWidget, bool aRemainActive, Element* aElementToFocus, uint64_t aActionId) { @@ -1148,7 +1179,7 @@ index be89a1c984982ea005e9bf7f440f5c8a2e8bab55..f8154882b9af02c5e9d7181e7a15b788 LOGFOCUS(("<>", aActionId)); // hold a reference to the focused content, which may be null -@@ -2351,6 +2356,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, +@@ -2346,6 +2351,11 @@ bool nsFocusManager::BlurImpl(BrowsingContext* aBrowsingContextToClear, return true; } @@ -1160,7 +1191,7 @@ index be89a1c984982ea005e9bf7f440f5c8a2e8bab55..f8154882b9af02c5e9d7181e7a15b788 // Keep a ref to presShell since dispatching the DOM event may cause // the document to be destroyed. RefPtr presShell = docShell->GetPresShell(); -@@ -3061,7 +3071,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, +@@ -3046,7 +3056,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, } } @@ -1172,7 +1203,7 @@ index be89a1c984982ea005e9bf7f440f5c8a2e8bab55..f8154882b9af02c5e9d7181e7a15b788 // 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 42ee50b53a666c05c6540a1ddcf3745694aaed2d..b15150f7d2e293c2e338f8cd3ada927c052b30b2 100644 +index 5e2844f6e65da71ca9e1dadb1a88a74ab45f485c..a8f033e17ffbc28261072d561c89914d4bd2e325 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -2511,10 +2511,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, @@ -1217,10 +1248,10 @@ index 42ee50b53a666c05c6540a1ddcf3745694aaed2d..b15150f7d2e293c2e338f8cd3ada927c void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) { diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h -index a846e57a8786e77e055d17474c5d910a6844cd5f..02815da6a94e98d452e8b4781a998fc0d5ed1124 100644 +index 1fbb506b07714f9ab2a2c9aff3683aa7fec4b156..42878f8f0c6365c7e2958a3b35fce0e7db9abfff 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h -@@ -320,6 +320,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, +@@ -318,6 +318,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, // Outer windows only. void DispatchDOMWindowCreated(); @@ -1229,10 +1260,10 @@ index a846e57a8786e77e055d17474c5d910a6844cd5f..02815da6a94e98d452e8b4781a998fc0 // Outer windows only. virtual void EnsureSizeAndPositionUpToDate() override; diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp -index 7d5e58f27b2ae07f8e8ac23c6d12bf90d2fdd8b7..2510572d9bfe8ea2909c48d9c3e86aa02c69e28e 100644 +index 7b8da8b4a5e8de02d0d2e1befc8407da88fbf890..533f3bf77e1ef78dd231ac899e3d8032938ea812 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp -@@ -1498,6 +1498,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, +@@ -1500,6 +1500,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, mozilla::GetBoxQuadsFromWindowOrigin(this, aOptions, aResult, aRv); } @@ -1295,10 +1326,10 @@ index 7d5e58f27b2ae07f8e8ac23c6d12bf90d2fdd8b7..2510572d9bfe8ea2909c48d9c3e86aa0 DOMQuad& aQuad, const GeometryNode& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h -index 6a982b3f278bf810dd582b3d5ebc33967323047e..4e991ef317c572c4a79c053d468f14df6c8880b5 100644 +index c3d84856e1bc92caf0437be312ccdbf7a2726ba5..d81c8e7152ca79b0fbb1ebee0f6f3aa40d0f34e2 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h -@@ -2417,6 +2417,10 @@ class nsINode : public mozilla::dom::EventTarget { +@@ -2421,6 +2421,10 @@ class nsINode : public mozilla::dom::EventTarget { nsTArray>& aResult, ErrorResult& aRv); @@ -1310,10 +1341,10 @@ index 6a982b3f278bf810dd582b3d5ebc33967323047e..4e991ef317c572c4a79c053d468f14df DOMQuad& aQuad, const TextOrElementOrDocument& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp -index bf7eb34da03c0958de688deecb53b407d430f645..a2ec3b1b7e86f72bee38d890c0834abfe4be8637 100644 +index aed59277e27a5a90f4244dd4513f9b4feb5858c3..26750fa09bead1ffabb22482468dea5999899f18 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp -@@ -149,6 +149,11 @@ bool nsJSUtils::GetEnvironmentChainForElement(JSContext* aCx, Element* aElement, +@@ -151,6 +151,11 @@ bool nsJSUtils::GetEnvironmentChainForElement(JSContext* aCx, Element* aElement, return true; } @@ -1338,7 +1369,7 @@ index f32e21752d5013bf143eb45391ab9218debab08e..83763d2354dade2f8d2b7930ba18ae91 static bool DumpEnabled(); diff --git a/dom/chrome-webidl/BrowsingContext.webidl b/dom/chrome-webidl/BrowsingContext.webidl -index 7923fcfb3e70aabddf343ab3ec2f25313bbd227e..cf02ce032d11d85a13bcf91e93e98882eaa9f7c7 100644 +index 6d150cc3ad77f694af5aa943c60eac37ba0733c0..9e68e18601cfb3e9e9c03b4bf0057c1a3d50a9d5 100644 --- a/dom/chrome-webidl/BrowsingContext.webidl +++ b/dom/chrome-webidl/BrowsingContext.webidl @@ -62,6 +62,26 @@ enum ForcedColorsOverride { @@ -1368,7 +1399,7 @@ index 7923fcfb3e70aabddf343ab3ec2f25313bbd227e..cf02ce032d11d85a13bcf91e93e98882 /** * Allowed overrides of platform/pref default behaviour for touch events. */ -@@ -226,6 +246,12 @@ interface BrowsingContext { +@@ -228,6 +248,12 @@ interface BrowsingContext { // Forced-colors simulation, for DevTools [SetterThrows] attribute ForcedColorsOverride forcedColorsOverride; @@ -1382,10 +1413,10 @@ index 7923fcfb3e70aabddf343ab3ec2f25313bbd227e..cf02ce032d11d85a13bcf91e93e98882 * A unique identifier for the browser element that is hosting this * BrowsingContext tree. Every BrowsingContext in the element's tree will diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp -index 2a29279a6d74770a2ec5cee80891bff9eadf1d13..bce59065615a33cf020aae4b20750ce8b1be66ce 100644 +index 52cf33bfc863d5ef1d3ac889ddfba3023600d60a..ccb521f367b8ccc8c40d8bad78aa621ab1b074c0 100644 --- a/dom/fetch/Fetch.cpp +++ b/dom/fetch/Fetch.cpp -@@ -702,6 +702,12 @@ already_AddRefed FetchRequest(nsIGlobalObject* aGlobal, +@@ -704,6 +704,12 @@ already_AddRefed FetchRequest(nsIGlobalObject* aGlobal, ipcArgs.hasCSPEventListener() = false; ipcArgs.isWorkerRequest() = false; @@ -1399,11 +1430,11 @@ index 2a29279a6d74770a2ec5cee80891bff9eadf1d13..bce59065615a33cf020aae4b20750ce8 mozilla::glean::networking::fetch_keepalive_request_count.Get("main"_ns) diff --git a/dom/fetch/FetchService.cpp b/dom/fetch/FetchService.cpp -index fcdddf2f772af305c68cc169ba891386a1dba982..d8b19d35719fff3f9c55c199718f4dc1d15cdfe9 100644 +index 1734429e8eeb155b742211ca58afcbeb73a8bf7c..15635a2e5c266f8085093a0d17288abe8ed54d9e 100644 --- a/dom/fetch/FetchService.cpp +++ b/dom/fetch/FetchService.cpp @@ -268,6 +268,14 @@ RefPtr FetchService::FetchInstance::Fetch() { - false // IsTrackingFetch + net::ClassificationFlags({0, 0}) // TrackingFlags ); + /* --> Playwright: associate keep-alive fetch with the window */ @@ -1417,11 +1448,107 @@ index fcdddf2f772af305c68cc169ba891386a1dba982..d8b19d35719fff3f9c55c199718f4dc1 if (mArgsType == FetchArgsType::WorkerFetch) { auto& args = mArgs.as(); mFetchDriver->SetWorkerScript(args.mWorkerScript); +diff --git a/dom/geolocation/Geolocation.cpp b/dom/geolocation/Geolocation.cpp +index 70ce9ce97c6d0ccba8b4129c55079cf9122e5b17..1c503c68c2c0949cfdaa18a76a263a81807952e1 100644 +--- a/dom/geolocation/Geolocation.cpp ++++ b/dom/geolocation/Geolocation.cpp +@@ -394,7 +394,10 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { + return NS_OK; + } + +- if (mBehavior != SystemGeolocationPermissionBehavior::NoPrompt) { ++ RefPtr gs = nsGeolocationService::GetGeolocationService( ++ mLocator->GetBrowsingContext()); ++ ++ if (mBehavior != SystemGeolocationPermissionBehavior::NoPrompt && !gs->IsOverride()) { + // Asynchronously present the system dialog or open system preferences + // (RequestGeolocationPermissionFromUser will know which to do), and wait + // for the permission to change or the request to be canceled. If the +@@ -426,8 +429,6 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { + return NS_OK; + } + +- RefPtr gs = nsGeolocationService::GetGeolocationService( +- mLocator->GetBrowsingContext()); + bool canUseCache = false; + CachedPositionAndAccuracy lastPosition = gs->GetCachedPosition(); + if (lastPosition.position) { +@@ -710,11 +711,16 @@ NS_INTERFACE_MAP_END + NS_IMPL_ADDREF(nsGeolocationService) + NS_IMPL_RELEASE(nsGeolocationService) + +-nsresult nsGeolocationService::Init() { ++nsresult nsGeolocationService::Init(bool isOverride) { + if (!StaticPrefs::geo_enabled()) { + return NS_ERROR_FAILURE; + } + ++ if (isOverride) { ++ mIsOverride = true; ++ mHigherAccuracy = true; ++ } ++ + if (XRE_IsContentProcess()) { + return NS_OK; + } +@@ -793,6 +799,10 @@ nsresult nsGeolocationService::Init() { + return NS_OK; + } + ++bool nsGeolocationService::IsOverride() { ++ return mIsOverride; ++} ++ + nsGeolocationService::~nsGeolocationService() = default; + + NS_IMETHODIMP +@@ -936,6 +946,10 @@ bool nsGeolocationService::HighAccuracyRequested() { + } + + void nsGeolocationService::UpdateAccuracy(bool aForceHigh) { ++ if (mIsOverride) { ++ return; ++ } ++ + bool highRequired = aForceHigh || HighAccuracyRequested(); + + if (XRE_IsContentProcess()) { +diff --git a/dom/geolocation/Geolocation.h b/dom/geolocation/Geolocation.h +index 57814242d551774e81403b7fdc20c795deadb625..c48c1b19a8d5499784ffb7b50d5e88e40c7b2a05 100644 +--- a/dom/geolocation/Geolocation.h ++++ b/dom/geolocation/Geolocation.h +@@ -67,7 +67,7 @@ class nsGeolocationService final : public nsIGeolocationUpdate, + + nsGeolocationService() = default; + +- nsresult Init(); ++ nsresult Init(bool isOverride = false); + + // Management of the Geolocation objects + void AddLocator(mozilla::dom::Geolocation* aLocator); +@@ -92,6 +92,8 @@ class nsGeolocationService final : public nsIGeolocationUpdate, + void UpdateAccuracy(bool aForceHigh = false); + bool HighAccuracyRequested(); + ++ bool IsOverride(); ++ + private: + ~nsGeolocationService(); + +@@ -118,6 +120,8 @@ class nsGeolocationService final : public nsIGeolocationUpdate, + // Nothing() if not being started, or a boolean reflecting the requested + // accuracy. + mozilla::Maybe mStarting; ++ ++ bool mIsOverride = false; + }; + + namespace mozilla::dom { diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp -index 9382c73dc527f3fb676e8ea3457a30eee2d9415f..f1785121db1de071ce5aa1a0ad38d3d603c486f7 100644 +index 5b0228d4a61dfe2b95e7a3ce016217007e8dee12..b753b0fceeec3278cb026d9137aafab5fb6ef968 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp -@@ -63,6 +63,7 @@ +@@ -64,6 +64,7 @@ #include "mozilla/dom/Document.h" #include "mozilla/dom/HTMLDataListElement.h" #include "mozilla/dom/HTMLOptionElement.h" @@ -1429,7 +1556,7 @@ index 9382c73dc527f3fb676e8ea3457a30eee2d9415f..f1785121db1de071ce5aa1a0ad38d3d6 #include "nsIFrame.h" #include "nsRangeFrame.h" #include "nsError.h" -@@ -816,6 +817,13 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { +@@ -817,6 +818,13 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { return NS_ERROR_FAILURE; } @@ -1444,12 +1571,12 @@ index 9382c73dc527f3fb676e8ea3457a30eee2d9415f..f1785121db1de071ce5aa1a0ad38d3d6 return NS_OK; } diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl -index 4cdfcaafa779ed402d02411f69c02ab0eb5b4e09..e69c837f7ec340a11e8ae9485cd5b714a3ea9a88 100644 +index 64a2dad65911395ea7eb8ded3374ae6bdd31cf3c..e333c802f8a9232e58d963e05187c0a1b30948f5 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl -@@ -374,6 +374,26 @@ interface nsIDOMWindowUtils : nsISupports { - [optional] in long aButtons, - [optional] in unsigned long aIdentifier); +@@ -390,6 +390,26 @@ cenum AsyncEnabledOption : 8 { + ASYNC_ENABLED = 1 + }; + /** + * Playwright: a separate method to dispatch mouse event with a @@ -1475,10 +1602,10 @@ index 4cdfcaafa779ed402d02411f69c02ab0eb5b4e09..e69c837f7ec340a11e8ae9485cd5b714 * touchstart, touchend, touchmove, and touchcancel * diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp -index 310e22a130612c055f7642d813b2bc06538c8797..8528cd75252c6cf0bebe42ffbf83c0220551ba28 100644 +index 780550d573644bcfe4a9bc03243aa4559a62d979..9ed69194ef329aad1e8a3e2c06041a443e4bc6ba 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp -@@ -1760,6 +1760,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, +@@ -1744,6 +1744,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, if (postLayerization) { postLayerization->Register(); } @@ -1501,10 +1628,10 @@ index 310e22a130612c055f7642d813b2bc06538c8797..8528cd75252c6cf0bebe42ffbf83c022 mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityRealMouseButtonEvent( diff --git a/dom/ipc/CoalescedMouseData.cpp b/dom/ipc/CoalescedMouseData.cpp -index 31d56e5d4ea1f21b4b827c763d6e4b34432eeb7d..8537ae198faeec5fd5cced71995bbce9dccf90c4 100644 +index 83aa0d08839f6fa5a150e5791b9b717e5aa9e751..fc1e1140ac7c6cda8cf116027c2fc2898dbe9d4b 100644 --- a/dom/ipc/CoalescedMouseData.cpp +++ b/dom/ipc/CoalescedMouseData.cpp -@@ -71,6 +71,9 @@ bool CoalescedMouseData::CanCoalesce(const WidgetMouseEvent& aEvent, +@@ -72,6 +72,9 @@ bool CoalescedMouseData::CanCoalesce(const WidgetMouseEvent& aEvent, mCoalescedInputEvent->pointerId != aEvent.pointerId || mCoalescedInputEvent->mButton != aEvent.mButton || mCoalescedInputEvent->mButtons != aEvent.mButtons || mGuid != aGuid || @@ -1748,7 +1875,7 @@ index d5964b27e9c99af76fe3f4076322592a9370c2d0..da217e2c1fbd9ca02e50ff74dde02818 return aGlobalOrNull; diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp -index 40844c900fc64415e39f4d2dead4c490d5ec301b..f63d0fd6a6df7ea932ca4d4bb70dfbd7562b2fa0 100644 +index 8b68f22ae64d19165bf4b3c58aea8f5c237ba351..c3733bfa4ed550c98ab5f72c406cd6d01a621aca 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -24,6 +24,7 @@ @@ -1759,7 +1886,7 @@ index 40844c900fc64415e39f4d2dead4c490d5ec301b..f63d0fd6a6df7ea932ca4d4bb70dfbd7 #include "mozilla/Assertions.h" #include "mozilla/Components.h" -@@ -135,6 +136,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, +@@ -136,6 +137,11 @@ void CSP_ApplyMetaCSPToDoc(mozilla::dom::Document& aDoc, return; } @@ -1795,10 +1922,10 @@ index aee376e971ae01ac1e512c3920b115bfaf06afa8..1701311534bf77e6cd9bafc0e3a28361 * returned quads are further translated relative to the window * origin -- which is not the layout origin. Further translation diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp -index 76035deec8f20933800284211a07ff23e124c1b9..d46c22728c82c15ed6b5c9d3c57f8b8e2229212b 100644 +index 83cef5b52b8f5c3168cd1d59266b4149425647fd..a80e89ec26a7e049c8ed84687ba2cd49597be05f 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp -@@ -1079,7 +1079,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { +@@ -1082,7 +1082,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { AssertIsOnMainThread(); nsTArray languages; @@ -1807,7 +1934,7 @@ index 76035deec8f20933800284211a07ff23e124c1b9..d46c22728c82c15ed6b5c9d3c57f8b8e RuntimeService* runtime = RuntimeService::GetService(); if (runtime) { -@@ -1269,8 +1269,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { +@@ -1272,8 +1272,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { } // The navigator overridden properties should have already been read. @@ -1817,7 +1944,7 @@ index 76035deec8f20933800284211a07ff23e124c1b9..d46c22728c82c15ed6b5c9d3c57f8b8e mNavigatorPropertiesLoaded = true; } -@@ -1898,6 +1897,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( +@@ -1901,6 +1900,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( } } @@ -1831,7 +1958,7 @@ index 76035deec8f20933800284211a07ff23e124c1b9..d46c22728c82c15ed6b5c9d3c57f8b8e template void RuntimeService::BroadcastAllWorkers(const Func& aFunc) { AssertIsOnMainThread(); -@@ -2438,6 +2444,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( +@@ -2451,6 +2457,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( } } @@ -1847,10 +1974,10 @@ index 76035deec8f20933800284211a07ff23e124c1b9..d46c22728c82c15ed6b5c9d3c57f8b8e MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(aCx); diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h -index b17efeafac1df3653ed9659e506c3d582044e2d0..3dc739c3b72980daf8a99190123920d0096da00c 100644 +index 6d75c6708bcb999dc1dc3b0172afa14136110bc6..809d0ef80ffe793beff5d3c11bf6bf7912385e99 100644 --- a/dom/workers/RuntimeService.h +++ b/dom/workers/RuntimeService.h -@@ -112,6 +112,8 @@ class RuntimeService final : public nsIObserver { +@@ -115,6 +115,8 @@ class RuntimeService final : public nsIObserver { void PropagateStorageAccessPermissionGranted( const nsPIDOMWindowInner& aWindow); @@ -1860,10 +1987,10 @@ index b17efeafac1df3653ed9659e506c3d582044e2d0..3dc739c3b72980daf8a99190123920d0 return mNavigatorProperties; } diff --git a/dom/workers/WorkerCommon.h b/dom/workers/WorkerCommon.h -index c928f8292a29ce7b53dd45aec4abc107263b1c8f..e11fdf6159623b2232e51160efbcbb6df5b6ed89 100644 +index af8d36c0d72683712a3fee22661f8c3279e103db..6b3a967c9acde2c81ab38148d4b1ac120a4717a2 100644 --- a/dom/workers/WorkerCommon.h +++ b/dom/workers/WorkerCommon.h -@@ -47,6 +47,8 @@ void ResumeWorkersForWindow(const nsPIDOMWindowInner& aWindow); +@@ -50,6 +50,8 @@ void ResumeWorkersForWindow(const nsPIDOMWindowInner& aWindow); void PropagateStorageAccessPermissionGrantedToWorkers( const nsPIDOMWindowInner& aWindow); @@ -1873,10 +2000,10 @@ index c928f8292a29ce7b53dd45aec4abc107263b1c8f..e11fdf6159623b2232e51160efbcbb6d bool IsWorkerGlobal(JSObject* global); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp -index e19f398e2672a6ffe07f53c820dd53c3210dd8b1..8dba789845e910986d3240f317a8749a37cd50b6 100644 +index 06083bb8f9546be06fa0b5c78d4e005a1617e51b..1753896265c1701ad50425c565f8d44392d0afb9 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp -@@ -755,6 +755,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable { +@@ -738,6 +738,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable { } }; @@ -1895,7 +2022,7 @@ index e19f398e2672a6ffe07f53c820dd53c3210dd8b1..8dba789845e910986d3240f317a8749a class UpdateLanguagesRunnable final : public WorkerThreadRunnable { nsTArray mLanguages; -@@ -2401,6 +2413,16 @@ void WorkerPrivate::UpdateContextOptions( +@@ -2334,6 +2346,16 @@ void WorkerPrivate::UpdateContextOptions( } } @@ -1912,7 +2039,7 @@ index e19f398e2672a6ffe07f53c820dd53c3210dd8b1..8dba789845e910986d3240f317a8749a void WorkerPrivate::UpdateLanguages(const nsTArray& aLanguages) { AssertIsOnParentThread(); -@@ -6374,6 +6396,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( +@@ -5996,6 +6018,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( } } @@ -1929,10 +2056,10 @@ index e19f398e2672a6ffe07f53c820dd53c3210dd8b1..8dba789845e910986d3240f317a8749a const nsTArray& aLanguages) { WorkerGlobalScope* globalScope = GlobalScope(); diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h -index d887a9ca510730aef61d71c6f8b2e58c3762e5df..7ffe86c8ec792558e3d83e5b7ca8fccd39147385 100644 +index 15c819c84fa934e25517ac8f55fd39ef8ba46986..fe01e09abcf2315abe41a3d19418c4e0f8c7df2b 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h -@@ -453,6 +453,8 @@ class WorkerPrivate final +@@ -457,6 +457,8 @@ class WorkerPrivate final void UpdateContextOptionsInternal(JSContext* aCx, const JS::ContextOptions& aContextOptions); @@ -1941,7 +2068,7 @@ index d887a9ca510730aef61d71c6f8b2e58c3762e5df..7ffe86c8ec792558e3d83e5b7ca8fccd void UpdateLanguagesInternal(const nsTArray& aLanguages); void UpdateJSWorkerMemoryParameterInternal(JSContext* aCx, JSGCParamKey key, -@@ -1099,6 +1101,8 @@ class WorkerPrivate final +@@ -1103,6 +1105,8 @@ class WorkerPrivate final void UpdateContextOptions(const JS::ContextOptions& aContextOptions); @@ -2019,10 +2146,10 @@ index 2d177b5aade6d158e9ae62d317d5155b72cdcf84..28af5d41eb06d4b33cd5f86484dc29c9 } diff --git a/js/src/vm/DateTime.cpp b/js/src/vm/DateTime.cpp -index a57b8fefa104f966393a99f5a81876b9a95f9743..adc42dd227e52643b06fb101170aeafb490c0acc 100644 +index cc366b4cc411ed8de972811237563edb376355e3..adf727cf80fadebce3be9301752dc1d0b9ee35b9 100644 --- a/js/src/vm/DateTime.cpp +++ b/js/src/vm/DateTime.cpp -@@ -185,6 +185,11 @@ void js::DateTimeInfo::internalResetTimeZone(ResetTimeZoneMode mode) { +@@ -188,6 +188,11 @@ void js::DateTimeInfo::internalResetTimeZone(ResetTimeZoneMode mode) { } } @@ -2034,7 +2161,7 @@ index a57b8fefa104f966393a99f5a81876b9a95f9743..adc42dd227e52643b06fb101170aeafb void js::DateTimeInfo::updateTimeZone() { MOZ_ASSERT(timeZoneStatus_ != TimeZoneStatus::Valid); -@@ -528,10 +533,24 @@ void js::ResetTimeZoneInternal(ResetTimeZoneMode mode) { +@@ -556,10 +561,24 @@ void js::ResetTimeZoneInternal(ResetTimeZoneMode mode) { js::DateTimeInfo::resetTimeZone(mode); } @@ -2059,7 +2186,7 @@ index a57b8fefa104f966393a99f5a81876b9a95f9743..adc42dd227e52643b06fb101170aeafb #if JS_HAS_INTL_API # if defined(XP_WIN) static bool IsOlsonCompatibleWindowsTimeZoneId(std::string_view tz) { -@@ -749,6 +768,15 @@ static bool ReadTimeZoneLink(std::string_view tz, +@@ -773,6 +792,15 @@ static bool ReadTimeZoneLink(std::string_view tz, void js::DateTimeInfo::internalResyncICUDefaultTimeZone() { #if JS_HAS_INTL_API @@ -2075,7 +2202,7 @@ index a57b8fefa104f966393a99f5a81876b9a95f9743..adc42dd227e52643b06fb101170aeafb // 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 -@@ -760,7 +788,6 @@ void js::DateTimeInfo::internalResyncICUDefaultTimeZone() { +@@ -784,7 +812,6 @@ void js::DateTimeInfo::internalResyncICUDefaultTimeZone() { if (const char* tzenv = std::getenv("TZ")) { std::string_view tz(tzenv); @@ -2084,19 +2211,19 @@ index a57b8fefa104f966393a99f5a81876b9a95f9743..adc42dd227e52643b06fb101170aeafb # if defined(XP_WIN) diff --git a/js/src/vm/DateTime.h b/js/src/vm/DateTime.h -index e3cf82daa3749664aa8ced7e6553b8c6434dfec8..b45b49c4f3bbf12853c4afb12de21d99ac88d77b 100644 +index 7be5b49afdce8e761af05dfbd48f3cb22e9ce318..3899c7988959f11bbadd0c005462acb979823fd1 100644 --- a/js/src/vm/DateTime.h +++ b/js/src/vm/DateTime.h -@@ -65,6 +65,8 @@ enum class ResetTimeZoneMode : bool { - */ - extern void ResetTimeZoneInternal(ResetTimeZoneMode mode); +@@ -75,6 +75,8 @@ using TimeZoneIdentifierVector = + SystemAllocPolicy>; + #endif +extern void SetTimeZoneOverrideInternal(std::string timeZone); + /** * Stores date/time information, particularly concerning the current local * time zone, and implements a small cache for daylight saving time offset -@@ -253,6 +255,7 @@ class DateTimeInfo { +@@ -258,6 +260,7 @@ class DateTimeInfo { private: // The method below should only be called via js::ResetTimeZoneInternal(). friend void js::ResetTimeZoneInternal(ResetTimeZoneMode); @@ -2104,7 +2231,7 @@ index e3cf82daa3749664aa8ced7e6553b8c6434dfec8..b45b49c4f3bbf12853c4afb12de21d99 static void resetTimeZone(ResetTimeZoneMode mode) { { -@@ -352,6 +355,8 @@ class DateTimeInfo { +@@ -362,6 +365,8 @@ class DateTimeInfo { JS::UniqueChars locale_; JS::UniqueTwoByteChars standardName_; JS::UniqueTwoByteChars daylightSavingsName_; @@ -2113,7 +2240,7 @@ index e3cf82daa3749664aa8ced7e6553b8c6434dfec8..b45b49c4f3bbf12853c4afb12de21d99 #else // Restrict the data-time range to the minimum required time_t range as // specified in POSIX. Most operating systems support 64-bit time_t -@@ -367,6 +372,8 @@ class DateTimeInfo { +@@ -377,6 +382,8 @@ class DateTimeInfo { void internalResetTimeZone(ResetTimeZoneMode mode); @@ -2123,12 +2250,12 @@ index e3cf82daa3749664aa8ced7e6553b8c6434dfec8..b45b49c4f3bbf12853c4afb12de21d99 void internalResyncICUDefaultTimeZone(); diff --git a/layout/base/GeometryUtils.cpp b/layout/base/GeometryUtils.cpp -index 4bfd336ddcbee8004ac538ca7b7d8216d04a61c3..cd22351c4aeacea8afc9828972222aca1b3063bf 100644 +index 67673c5c306e7237613b0560c7b3f888bd6ad1b8..fe4a278dad4b1747b41b5a824978636a70a9dea8 100644 --- a/layout/base/GeometryUtils.cpp +++ b/layout/base/GeometryUtils.cpp @@ -23,6 +23,7 @@ #include "nsContentUtils.h" - #include "nsCSSFrameConstructor.h" + #include "nsIFrame.h" #include "nsLayoutUtils.h" +#include "ChildIterator.h" @@ -2174,10 +2301,10 @@ index 4bfd336ddcbee8004ac538ca7b7d8216d04a61c3..cd22351c4aeacea8afc9828972222aca // No boxes to return return; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp -index 1922382f924e74dde81501540d38699dcf3d9e57..c05b9ed071a9a4c99e2afb28eef0dba376777976 100644 +index 26119628ab4839858733ce39c6c9ef2970092b49..a9c4dbc4936755fd25b8528511e9a4c62695de89 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp -@@ -11881,7 +11881,9 @@ bool PresShell::ComputeActiveness() const { +@@ -12150,7 +12150,9 @@ bool PresShell::ComputeActiveness() const { if (!browserChild->IsVisible()) { MOZ_LOG(gLog, LogLevel::Debug, (" > BrowserChild %p is not visible", browserChild)); @@ -2189,10 +2316,10 @@ index 1922382f924e74dde81501540d38699dcf3d9e57..c05b9ed071a9a4c99e2afb28eef0dba3 // 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 bc5b7ab177070178d1a3c49b563df0f04860e7d3..393f694c766bec5e5443d91922a8bc3524ade676 100644 +index ee4e4b7e04f0f949b0afc7e8097711fcefe8b3c3..3af1d380d514b70392d1daaa4bc623afd7a570e6 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp -@@ -708,6 +708,10 @@ bool nsLayoutUtils::AllowZoomingForDocument( +@@ -707,6 +707,10 @@ bool nsLayoutUtils::AllowZoomingForDocument( !aDocument->GetPresShell()->AsyncPanZoomEnabled()) { return false; } @@ -2203,7 +2330,7 @@ index bc5b7ab177070178d1a3c49b563df0f04860e7d3..393f694c766bec5e5443d91922a8bc35 // True if we allow zooming for all documents on this platform, or if we are // in RDM. BrowsingContext* bc = aDocument->GetBrowsingContext(); -@@ -9773,6 +9777,9 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont, +@@ -9772,6 +9776,9 @@ void nsLayoutUtils::ComputeSystemFont(nsFont* aSystemFont, /* static */ bool nsLayoutUtils::ShouldHandleMetaViewport(const Document* aDocument) { @@ -2214,10 +2341,10 @@ index bc5b7ab177070178d1a3c49b563df0f04860e7d3..393f694c766bec5e5443d91922a8bc35 return StaticPrefs::dom_meta_viewport_enabled() || (bc && bc->InRDMPane()); } diff --git a/layout/style/GeckoBindings.h b/layout/style/GeckoBindings.h -index 4cdceba041ddc5af98982d27b6e622a0dd5d0e34..50f644a91923e529ff06a164256f5704e5c4d8ae 100644 +index 9527443c79077e0a728d78c3184ab7319f1c9efd..4e193ed114b4f70fb72bea928709fc7723f35b88 100644 --- a/layout/style/GeckoBindings.h +++ b/layout/style/GeckoBindings.h -@@ -594,6 +594,7 @@ float Gecko_MediaFeatures_GetResolution(const mozilla::dom::Document*); +@@ -593,6 +593,7 @@ float Gecko_MediaFeatures_GetResolution(const mozilla::dom::Document*); bool Gecko_MediaFeatures_PrefersReducedMotion(const mozilla::dom::Document*); bool Gecko_MediaFeatures_PrefersReducedTransparency( const mozilla::dom::Document*); @@ -2226,7 +2353,7 @@ index 4cdceba041ddc5af98982d27b6e622a0dd5d0e34..50f644a91923e529ff06a164256f5704 const mozilla::dom::Document*); mozilla::StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme( diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp -index d843c5952e273c64703af6e9f2528798e3ada307..50dcfd6839777dd0ed9f806dfac3e1a4b0102efa 100644 +index 21bcc8e890a0d3f3e86b5ea6eed79d017dd2fb76..eefc7d5c934f03b4a9213dafcbb65dd32b695622 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -268,11 +268,7 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) { @@ -2264,10 +2391,10 @@ index d843c5952e273c64703af6e9f2528798e3ada307..50dcfd6839777dd0ed9f806dfac3e1a4 return StylePrefersContrast::NoPreference; } diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp -index c9d6cace8de545779ae9c4630973c5a920cd52c6..032a42b732179a951181f390199c2520fecd742b 100644 +index e5cf36273d5790de2c80acb42a6ee181bdb66f08..0523a37fc19b470e3817ae61c912a3dc54fc57a6 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp -@@ -792,7 +792,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) +@@ -801,7 +801,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) rhs.mHasInjectedCookieForCookieBannerHandling), mSchemelessInput(rhs.mSchemelessInput), mHttpsUpgradeTelemetry(rhs.mHttpsUpgradeTelemetry), @@ -2277,7 +2404,7 @@ index c9d6cace8de545779ae9c4630973c5a920cd52c6..032a42b732179a951181f390199c2520 } LoadInfo::LoadInfo( -@@ -2705,4 +2706,16 @@ void LoadInfo::UpdateParentAddressSpaceInfo() { +@@ -2778,4 +2779,16 @@ void LoadInfo::UpdateParentAddressSpaceInfo() { } } @@ -2295,10 +2422,10 @@ index c9d6cace8de545779ae9c4630973c5a920cd52c6..032a42b732179a951181f390199c2520 + } // namespace mozilla::net diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h -index 7946dacf862aa13da58c65aba3c72deef575dbba..eb307b58b5fda79fa44e5df94f1bcb4dfaa0a8b6 100644 +index 6547d451f3a764c8860dd0c19b5b490caecbf0af..feccce92e3769b8e9a3a4926cca9b85fccda86a5 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h -@@ -448,6 +448,8 @@ class LoadInfo final : public nsILoadInfo { +@@ -455,6 +455,8 @@ class LoadInfo final : public nsILoadInfo { bool mIsNewWindowTarget = false; bool mSkipHTTPSUpgrade = false; @@ -2308,10 +2435,10 @@ index 7946dacf862aa13da58c65aba3c72deef575dbba..eb307b58b5fda79fa44e5df94f1bcb4d // This is exposed solely for testing purposes and should not be used outside of // LoadInfo diff --git a/netwerk/base/TRRLoadInfo.cpp b/netwerk/base/TRRLoadInfo.cpp -index dd8cc849fb3dd56d6e979cc3cbff96727f702d90..dd2d543977cd9543494c52e862552831d955fdb2 100644 +index 551d89315243f4b515aa29d3a67eb23050ea9f0a..ac3a1ca6d846826c5d704d1b4abdaee55b834b0d 100644 --- a/netwerk/base/TRRLoadInfo.cpp +++ b/netwerk/base/TRRLoadInfo.cpp -@@ -973,5 +973,15 @@ TRRLoadInfo::GetFetchDestination(nsACString& aDestination) { +@@ -1010,5 +1010,15 @@ TRRLoadInfo::GetFetchDestination(nsACString& aDestination) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -2328,10 +2455,10 @@ index dd8cc849fb3dd56d6e979cc3cbff96727f702d90..dd2d543977cd9543494c52e862552831 } // namespace net } // namespace mozilla diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl -index 1cfda408c33c16c75a74ea839ae3bde6142ac92b..b3951bc2df4d448e6c3b7e51bef2c0050e97a35d 100644 +index f1b54736d9ee006292bf4c9cd0b3490d5ec8da66..257fda17a10f702cee39fb42ad69e0cd86ca95d1 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl -@@ -1650,4 +1650,6 @@ interface nsILoadInfo : nsISupports +@@ -1686,4 +1686,6 @@ interface nsILoadInfo : nsISupports return static_cast(userNavigationInvolvement); } %} @@ -2360,10 +2487,10 @@ index 7f91d2df6f8bb4020c75c132dc8f6bf26625fa1e..aaa5541a17039d6b13ad83ab176fdaaf * Set the status and reason for the forthcoming synthesized response. * Multiple calls overwrite existing values. diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp -index c486793f79e2c8c248e25f7963ba4e2c08f553d2..f1e625c59ec79c1104fe9594dbf86d39f3293438 100644 +index 1471432c1f1a47be5073ed01b746f1f13d3a0b47..585f81762e2bf51681d11c06c9459063121c34e9 100644 --- a/netwerk/ipc/DocumentLoadListener.cpp +++ b/netwerk/ipc/DocumentLoadListener.cpp -@@ -178,6 +178,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, +@@ -185,6 +185,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, loadInfo->SetTextDirectiveUserActivation( aLoadState->GetTextDirectiveUserActivation()); loadInfo->SetIsMetaRefresh(aLoadState->IsMetaRefresh()); @@ -2372,7 +2499,7 @@ index c486793f79e2c8c248e25f7963ba4e2c08f553d2..f1e625c59ec79c1104fe9594dbf86d39 return loadInfo.forget(); } diff --git a/netwerk/protocol/http/InterceptedHttpChannel.cpp b/netwerk/protocol/http/InterceptedHttpChannel.cpp -index fbf4bdf1e24d1102df113984be6c8dc3a7d0d810..787bf014d3bf0b8537f99bf5eb4074e100c78c18 100644 +index fbf4bdf1e24d1102df113984be6c8dc3a7d0d810..cf1978009d74221ae804b998e223904fa943a91f 100644 --- a/netwerk/protocol/http/InterceptedHttpChannel.cpp +++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp @@ -728,10 +728,33 @@ NS_IMPL_ISUPPORTS(ResetInterceptionHeaderVisitor, nsIHttpHeaderVisitor) @@ -2445,10 +2572,10 @@ index 704404c9f094640ad63b685d64bd5a396e733e4b..92bdc21b4d6a015cc2f2bb22781ec675 * InterceptionTimeStamps is used to record the time stamps of the * interception. diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp -index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee69c460e7 100644 +index 1051d1e91c1ebf036f2e5db82a37636dd7cda4c3..3ef53c09442e24fb50308740950aa6d354703b7d 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp -@@ -688,11 +688,9 @@ nsresult nsHttpChannel::OnBeforeConnect() { +@@ -685,11 +685,9 @@ nsresult nsHttpChannel::OnBeforeConnect() { // SecurityInfo.sys.mjs mLoadInfo->SetHstsStatus(isSecureURI); @@ -2461,7 +2588,7 @@ index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass())) { return NS_ERROR_OFFLINE; } -@@ -805,9 +803,7 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRForUpgrade(bool aShouldUpgrade, +@@ -802,9 +800,7 @@ nsresult nsHttpChannel::MaybeUseHTTPSRRForUpgrade(bool aShouldUpgrade, return aStatus; } @@ -2472,7 +2599,7 @@ index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee if (mURI->SchemeIs("https") || aShouldUpgrade || !LoadUseHTTPSSVC() || forceOffline) { -@@ -1266,15 +1262,14 @@ nsresult nsHttpChannel::ContinueConnect() { +@@ -1263,15 +1259,14 @@ nsresult nsHttpChannel::ContinueConnect() { "CORS preflight must have been finished by the time we " "do the rest of ContinueConnect"); @@ -2490,7 +2617,7 @@ index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass())) { return NS_ERROR_OFFLINE; } -@@ -1316,7 +1311,7 @@ nsresult nsHttpChannel::ContinueConnect() { +@@ -1313,7 +1308,7 @@ nsresult nsHttpChannel::ContinueConnect() { } // We're about to hit the network. Don't if we're forced offline. @@ -2499,7 +2626,7 @@ index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee return NS_ERROR_OFFLINE; } -@@ -1421,12 +1416,9 @@ void nsHttpChannel::SpeculativeConnect() { +@@ -1418,12 +1413,9 @@ void nsHttpChannel::SpeculativeConnect() { // don't speculate if we are offline, when doing http upgrade (i.e. // websockets bootstrap), or if we can't do keep-alive (because then we // couldn't reuse the speculative connection anyhow). @@ -2513,7 +2640,7 @@ index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee return; } -@@ -4198,9 +4190,6 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) { +@@ -4240,9 +4232,6 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) { uint32_t cacheEntryOpenFlags; bool offline = gIOService->IsOffline(); @@ -2523,7 +2650,7 @@ index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee bool maybeRCWN = false; nsAutoCString cacheControlRequestHeader; -@@ -4211,7 +4200,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) { +@@ -4253,7 +4242,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal(bool isHttps) { return NS_OK; } @@ -2532,7 +2659,7 @@ index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee if (offline || (mLoadFlags & INHIBIT_CACHING) || forceOffline) { if (BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass()) && !offline && !forceOffline) { -@@ -7315,6 +7304,20 @@ void nsHttpChannel::MaybeStartDNSPrefetch() { +@@ -7357,6 +7346,20 @@ void nsHttpChannel::MaybeStartDNSPrefetch() { } } @@ -2554,10 +2681,10 @@ index af4c6482ad41ad67f41b93183c94d6f341fb4989..0a18827e53760b4132381fd0aff286ee nsHttpChannel::GetEncodedBodySize(uint64_t* aEncodedBodySize) { if (mCacheEntry && !LoadCacheEntryIsWriteOnly()) { diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h -index fb16e050efea8d49cd315203bfc6a0779f34bb02..c7b5a9894cb993bd420a5407c1aefb4aacd35595 100644 +index 9d28bae2d270690517c11383abe4c4bcc0edda96..9087d345b1b63bdce0912abb0c880c50900a797b 100644 --- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h -@@ -303,6 +303,10 @@ class nsHttpChannel final : public HttpBaseChannel, +@@ -305,6 +305,10 @@ class nsHttpChannel final : public HttpBaseChannel, void MaybeResolveProxyAndBeginConnect(); void MaybeStartDNSPrefetch(); @@ -2569,10 +2696,10 @@ index fb16e050efea8d49cd315203bfc6a0779f34bb02..c7b5a9894cb993bd420a5407c1aefb4a // end server host name. ProxyDNSStrategy GetProxyDNSStrategy(); diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp -index 324d71a1567ef2acbd5e9a008961e39a11445419..e76d57612f318b7ad325196684e2e57660008a94 100644 +index ce2a868b9a915b98938518b6c935870f8169e0f7..e6d0a75bb3f5e8dea3f3e7f3448b553979860bd3 100644 --- a/parser/html/nsHtml5TreeOpExecutor.cpp +++ b/parser/html/nsHtml5TreeOpExecutor.cpp -@@ -1359,6 +1359,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( +@@ -1361,6 +1361,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( void nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); @@ -2669,10 +2796,10 @@ index 3d8837cdb38fb5b25abfb9e3e369ad6fe688706e..867ce2efaa10eaea87ffeeb2669cc5a7 constructor() { this._policies = null; diff --git a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp -index 7dc1cee243017e1647521b021424781532552d8c..47908d73a7a39a7f95ae8ea28362b4f29505508f 100644 +index 52fa968554a88d1624bf9403b07781a8b42c93b6..2bd5162859dbc482361e2f6aaf5b7a732e9a5929 100644 --- a/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp +++ b/toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp -@@ -587,7 +587,7 @@ void PopulateLanguages() { +@@ -588,7 +588,7 @@ void PopulateLanguages() { // sufficient to only collect this information as the other properties are // just reformats of Navigator::GetAcceptLanguages. nsTArray languages; @@ -2682,7 +2809,7 @@ index 7dc1cee243017e1647521b021424781532552d8c..47908d73a7a39a7f95ae8ea28362b4f2 for (const auto& language : languages) { diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp -index 316a86d5fcadba99918254ba132f363fb462cc3f..9dcd1b208ffd2d42db6c8ff52476a22791149eb4 100644 +index d8f0c072c8a52c2837d87fe749ccac6e3e59e48a..6837927e6a49a8ff4c9f709502bf8d8983bd735c 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -361,7 +361,7 @@ nsAppStartup::Quit(uint32_t aMode, int aExitCode, bool* aUserAllowedQuit) { @@ -2695,10 +2822,10 @@ index 316a86d5fcadba99918254ba132f363fb462cc3f..9dcd1b208ffd2d42db6c8ff52476a227 if (windowEnumerator) { bool more; diff --git a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp -index 89f7233835b4d03e7a140ca2c75ed8db097d482d..ed7c92d30b3cd77c102467eb0f12c9f482a08fde 100644 +index c0d60b927542653ab9beee730ec2c07f4b3d911c..85c416315f567a5edf8cfc89262dd7a48250dfd6 100644 --- a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp +++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp -@@ -174,8 +174,8 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress* aWebProgress, +@@ -176,8 +176,8 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress* aWebProgress, } NS_IMETHODIMP @@ -2710,10 +2837,10 @@ index 89f7233835b4d03e7a140ca2c75ed8db097d482d..ed7c92d30b3cd77c102467eb0f12c9f4 int32_t aMaxSelfProgress, int32_t aCurTotalProgress, diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.cpp b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -index 811fb16410e8cf900ad873797269e5fe715579a5..821f5b0c2af8e1dc8754cd023571d1d0ff09eeb6 100644 +index 622ff7fe214d22e1e5d5a561753cffe3e1eafe31..ac2f30e00a9a6d18c61d00b0d6d4bf41ff48af95 100644 --- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp +++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -@@ -1880,7 +1880,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( +@@ -1882,7 +1882,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( // Open a minimal popup. *aIsPopupRequested = true; @@ -2727,10 +2854,10 @@ index 811fb16410e8cf900ad873797269e5fe715579a5..821f5b0c2af8e1dc8754cd023571d1d0 /** diff --git a/toolkit/mozapps/update/UpdateService.sys.mjs b/toolkit/mozapps/update/UpdateService.sys.mjs -index 26d633f4f4fe9125df557ee7367809c8591d7211..6c558e8297114ac3f94ae3836c25e9edd51cc4d4 100644 +index 5d5a3f2c46138b578b583ad4a3506e1d227607ad..6d414635b80a74edb0b5ecfc6a98dd0fee763952 100644 --- a/toolkit/mozapps/update/UpdateService.sys.mjs +++ b/toolkit/mozapps/update/UpdateService.sys.mjs -@@ -3873,6 +3873,8 @@ export class UpdateService { +@@ -3874,6 +3874,8 @@ export class UpdateService { } get disabledForTesting() { @@ -2740,10 +2867,10 @@ index 26d633f4f4fe9125df557ee7367809c8591d7211..6c558e8297114ac3f94ae3836c25e9ed } diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild -index 304c39a11bd88e0b8cf681a3c3bc5dc11ed929ec..71e57ce2164e5436fac68d696b632d120a85d6f2 100644 +index e8399d277ec0b64e5ea29aa7262b118936a02779..983ed73ad1d6d734af55a9066a8e8a6cf3ae3f45 100644 --- a/toolkit/toolkit.mozbuild +++ b/toolkit/toolkit.mozbuild -@@ -151,6 +151,7 @@ if CONFIG["ENABLE_WEBDRIVER"]: +@@ -155,6 +155,7 @@ if CONFIG["ENABLE_WEBDRIVER"]: "/remote", "/testing/firefox-ui", "/testing/marionette", @@ -2787,7 +2914,7 @@ index 7eb9e1104682d4eb47060654f43a1efa8b2a6bb2..a8315d6decf654b5302bea5beeea3414 // Only run this code if LauncherProcessWin.h was included beforehand, thus // signalling that the hosting process should support launcher mode. diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp -index 444116840b68443c31d8df66699d47a582ce4622..9ae13a8462301a8a3024bffb10d9a20f9accff1d 100644 +index 9ef5370d1524ddecb965785a73a3cfea39867324..e0245cca94e496bcffba40c9660a52b518803d44 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -861,6 +861,12 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout, @@ -2804,7 +2931,7 @@ index 444116840b68443c31d8df66699d47a582ce4622..9ae13a8462301a8a3024bffb10d9a20f // 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 7cd8c24d871465bc96fe7249eb9a41c999057eb5..02b3ce1fbaa8056219a139a3bc3f107343f9bb89 100644 +index 5bd60b585b53cc77e75c0b68c763957f90b7e164..940b3b62b09ca70ae5e69c3e94eda11ad35b9dfe 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -112,6 +112,7 @@ @@ -2828,7 +2955,7 @@ index 7cd8c24d871465bc96fe7249eb9a41c999057eb5..02b3ce1fbaa8056219a139a3bc3f1073 nsresult nsExternalHelperAppService::GetFileTokenForPath( const char16_t* aPlatformAppPath, nsIFile** aFile) { nsDependentString platformAppPath(aPlatformAppPath); -@@ -1486,7 +1493,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { +@@ -1500,7 +1507,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { // Strip off the ".part" from mTempLeafName mTempLeafName.Truncate(mTempLeafName.Length() - std::size(".part") + 1); @@ -2841,7 +2968,7 @@ index 7cd8c24d871465bc96fe7249eb9a41c999057eb5..02b3ce1fbaa8056219a139a3bc3f1073 mSaver = do_CreateInstance(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); -@@ -1671,7 +1683,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1684,7 +1696,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { return NS_OK; } @@ -2879,7 +3006,7 @@ index 7cd8c24d871465bc96fe7249eb9a41c999057eb5..02b3ce1fbaa8056219a139a3bc3f1073 if (NS_FAILED(rv)) { nsresult transferError = rv; -@@ -1732,6 +1773,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1745,6 +1786,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { bool alwaysAsk = true; mMimeInfo->GetAlwaysAskBeforeHandling(&alwaysAsk); @@ -2889,7 +3016,7 @@ index 7cd8c24d871465bc96fe7249eb9a41c999057eb5..02b3ce1fbaa8056219a139a3bc3f1073 if (alwaysAsk) { // But we *don't* ask if this mimeInfo didn't come from // our user configuration datastore and the user has said -@@ -2248,6 +2292,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, +@@ -2261,6 +2305,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, NotifyTransfer(aStatus); } @@ -2906,7 +3033,7 @@ index 7cd8c24d871465bc96fe7249eb9a41c999057eb5..02b3ce1fbaa8056219a139a3bc3f1073 return NS_OK; } -@@ -2731,6 +2785,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { +@@ -2744,6 +2798,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { } } @@ -2923,10 +3050,10 @@ index 7cd8c24d871465bc96fe7249eb9a41c999057eb5..02b3ce1fbaa8056219a139a3bc3f1073 // OnStartRequest) mDialog = nullptr; diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h -index 68f240c9f9280c498900561e6cdb3bc4c4d45a38..395f54e8c47d56b0892c75a513e5828de7e4fceb 100644 +index 26dfc6f04298420317c8b87b2ecc3f2f47f59598..c458ab5efb238c62499ee13452f2d750e0569e38 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.h +++ b/uriloader/exthandler/nsExternalHelperAppService.h -@@ -254,6 +254,8 @@ class nsExternalHelperAppService : public nsIExternalHelperAppService, +@@ -263,6 +263,8 @@ class nsExternalHelperAppService : public nsIExternalHelperAppService, mozilla::dom::BrowsingContext* aContentContext, bool aForceSave, nsIInterfaceRequestor* aWindowContext, nsIStreamListener** aStreamListener); @@ -2935,7 +3062,7 @@ index 68f240c9f9280c498900561e6cdb3bc4c4d45a38..395f54e8c47d56b0892c75a513e5828d }; /** -@@ -451,6 +453,9 @@ class nsExternalAppHandler final : public nsIStreamListener, +@@ -460,6 +462,9 @@ class nsExternalAppHandler final : public nsIStreamListener, * Upon successful return, both mTempFile and mSaver will be valid. */ nsresult SetUpTempFile(nsIChannel* aChannel); @@ -2946,7 +3073,7 @@ index 68f240c9f9280c498900561e6cdb3bc4c4d45a38..395f54e8c47d56b0892c75a513e5828d * 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 53ea934dd4876e4b491b724385c8fbf7d00ee6cd..0b7b88c853b21ce778d8e87fea0a2bfe839ad412 100644 +index e6490ebb086eb4dca9db560c14e073a9e7722e29..2792373dcb30ebc787a9bdca306ac12e72aa19ec 100644 --- a/uriloader/exthandler/nsIExternalHelperAppService.idl +++ b/uriloader/exthandler/nsIExternalHelperAppService.idl @@ -6,8 +6,11 @@ @@ -3017,10 +3144,10 @@ index 7098db301770ecb5b9a506d7caec89d5cf63384b..aff8d7562f8a3e595a077ce8e5910087 } #endif diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h -index 8004d6fe2130246252e57198f2ea731f84d1968a..7a0774b8320741108dc209c3b7069f524b1360ca 100644 +index 4f7ca9d0d460da3124ec8489917a9484661d5624..a04c3661b3e1e2be030ac6fe90041c81e653d26e 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h -@@ -375,6 +375,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, +@@ -380,6 +380,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, // Otherwise, this must be 0. uint32_t mClickCount = 0; @@ -3030,7 +3157,7 @@ index 8004d6fe2130246252e57198f2ea731f84d1968a..7a0774b8320741108dc209c3b7069f52 // Whether the event should ignore scroll frame bounds during dispatch. bool mIgnoreRootScrollFrame = false; -@@ -398,6 +401,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, +@@ -407,6 +410,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, mContextMenuTrigger = aEvent.mContextMenuTrigger; mExitFrom = aEvent.mExitFrom; mClickCount = aEvent.mClickCount; @@ -3042,7 +3169,7 @@ diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings. index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf56dbd408e 100644 --- a/widget/cocoa/NativeKeyBindings.mm +++ b/widget/cocoa/NativeKeyBindings.mm -@@ -549,6 +549,13 @@ +@@ -549,6 +549,13 @@ void NativeKeyBindings::GetEditCommandsForTests( break; case KEY_NAME_INDEX_ArrowLeft: if (aEvent.IsAlt()) { @@ -3056,7 +3183,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5 break; } if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) { -@@ -571,6 +578,13 @@ +@@ -571,6 +578,13 @@ void NativeKeyBindings::GetEditCommandsForTests( break; case KEY_NAME_INDEX_ArrowRight: if (aEvent.IsAlt()) { @@ -3070,7 +3197,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5 break; } if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) { -@@ -593,6 +607,10 @@ +@@ -593,6 +607,10 @@ void NativeKeyBindings::GetEditCommandsForTests( break; case KEY_NAME_INDEX_ArrowUp: if (aEvent.IsControl()) { @@ -3081,7 +3208,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5 break; } if (aEvent.IsMeta()) { -@@ -603,7 +621,7 @@ +@@ -603,7 +621,7 @@ void NativeKeyBindings::GetEditCommandsForTests( !aEvent.IsShift() ? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:)) : ToObjcSelectorPtr( @@ -3090,7 +3217,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5 aCommands); break; } -@@ -630,6 +648,10 @@ +@@ -630,6 +648,10 @@ void NativeKeyBindings::GetEditCommandsForTests( break; case KEY_NAME_INDEX_ArrowDown: if (aEvent.IsControl()) { @@ -3102,7 +3229,7 @@ index 24b70173c2e8bb9be9fd6255984a70efe3b14099..75ac367a1c4bb44d4b68b5f4ecc6adf5 } if (aEvent.IsMeta()) { diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp -index 02b7b185caf4a2352522c0ed4185d89b514c1738..912a270b6d87e1154d844bde2ffe6a3c2b8f3061 100644 +index f09b0e4994304413cbd75f14e6650cf3f9df9025..41c184e74df2b9c59315a236506946bcb5d69216 100644 --- a/widget/gtk/nsFilePicker.cpp +++ b/widget/gtk/nsFilePicker.cpp @@ -21,6 +21,7 @@ @@ -3260,7 +3387,7 @@ index facd2bc65afab8ec1aa322faa20a67464964dfb9..3c5751ad1b7f042bc7cd9a63895cebcd } // namespace widget diff --git a/widget/headless/HeadlessWidget.cpp b/widget/headless/HeadlessWidget.cpp -index daa2d455374fd9f75a5c6ac9f7b91696d88b065c..f45184137b52db0a5774bf3365b15f784532fbdf 100644 +index 290de12f9d0ff858474564fa8ce54814a04f6088..c144a891b84c3c57f394d6d551e6c89dcd6d9829 100644 --- a/widget/headless/HeadlessWidget.cpp +++ b/widget/headless/HeadlessWidget.cpp @@ -111,6 +111,8 @@ void HeadlessWidget::Destroy() { @@ -3288,12 +3415,12 @@ index daa2d455374fd9f75a5c6ac9f7b91696d88b065c..f45184137b52db0a5774bf3365b15f78 } // namespace widget } // namespace mozilla diff --git a/widget/headless/HeadlessWidget.h b/widget/headless/HeadlessWidget.h -index 39833c28e40c61e354119cde429b8389056bafac..a638fb7520b857219ce58fcbf9ca0ed939528924 100644 +index 60598d097d9dae829ebdc15dede78bd915e3107d..3b5ac5e5590dcb36440e28569f71592db3c1218c 100644 --- a/widget/headless/HeadlessWidget.h +++ b/widget/headless/HeadlessWidget.h -@@ -132,6 +132,9 @@ class HeadlessWidget final : public nsBaseWidget { - int32_t aModifierFlags, - nsIObserver* aObserver) override; +@@ -131,6 +131,9 @@ class HeadlessWidget final : public nsBaseWidget { + double aDeltaX, double aDeltaY, int32_t aModifierFlags, + nsISynthesizedEventCallback* aCallback) override; + using SnapshotListener = std::function&&)>; + void SetSnapshotListener(SnapshotListener&& listener); @@ -3302,10 +3429,10 @@ index 39833c28e40c61e354119cde429b8389056bafac..a638fb7520b857219ce58fcbf9ca0ed9 ~HeadlessWidget(); bool mEnabled; diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h -index f7262978239665cbe20470da0790d4d177d4c501..70d11aca3d5b509cf5b37d626299a23fede73ba3 100644 +index 2f4c33f151870bb9233899b186a5eccfaa6f5da6..6acf66e4938e3f9727916824a08d6294f8993452 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h -@@ -244,6 +244,7 @@ struct ParamTraits { +@@ -251,6 +251,7 @@ struct ParamTraits { aParam.mExitFrom.value())); } WriteParam(aWriter, aParam.mClickCount); @@ -3313,7 +3440,7 @@ index f7262978239665cbe20470da0790d4d177d4c501..70d11aca3d5b509cf5b37d626299a23f } static bool Read(MessageReader* aReader, paramType* aResult) { -@@ -268,6 +269,7 @@ struct ParamTraits { +@@ -275,6 +276,7 @@ struct ParamTraits { aResult->mExitFrom = Some(static_cast(exitFrom)); } rv = rv && ReadParam(aReader, &aResult->mClickCount); diff --git a/browser_patches/firefox/preferences/playwright.cfg b/browser_patches/firefox/preferences/playwright.cfg index 5dc8986c19..85deeb3816 100644 --- a/browser_patches/firefox/preferences/playwright.cfg +++ b/browser_patches/firefox/preferences/playwright.cfg @@ -36,6 +36,7 @@ pref("fission.bfcacheInParent", false); // When it is enabled, we have to retain "thirdPartyCookie^" permissions // in the storageState. pref("network.cookie.cookieBehavior", 4); +pref("network.cookie.CHIPS.enabled", false); // Increase max number of child web processes so that new pages // get a new process by default and we have a process isolation diff --git a/browser_patches/webkit/UPSTREAM_CONFIG.sh b/browser_patches/webkit/UPSTREAM_CONFIG.sh index d6e587bc4a..fddf578548 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="db897909f7c31d9b38793374c66427b6a4cb3dd3" +BASE_REVISION="486de399887bc8fa8a69e2f194ebc9476589a08a" diff --git a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m index 0d100edad0..b89fa92d7e 100644 --- a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m +++ b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m @@ -186,9 +186,6 @@ - (WKWebsiteDataStore *)persistentDataStore NSURL *cookieFile = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/cookie.db", _userDataDir]]; [configuration _setCookieStorageFile:cookieFile]; - NSURL *applicationCacheDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/ApplicationCache", _userDataDir]]; - [configuration setApplicationCacheDirectory:applicationCacheDirectory]; - NSURL *cacheStorageDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/CacheStorage", _userDataDir]]; [configuration _setCacheStorageDirectory:cacheStorageDirectory]; @@ -327,15 +324,19 @@ - (WKWebView *)createHeadfulPage:(WKWebViewConfiguration *)configuration withURL - (WKWebView *)createHeadlessPage:(WKWebViewConfiguration *)configuration withURL:(NSString*)urlString { NSRect rect = NSMakeRect(0, 0, 1280, 720); - NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0]; - NSRect windowRect = NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000); + + // https://github.com/microsoft/playwright/issues/36711 + // https://codereview.chromium.org/1380083005 + NSScreen *firstScreen = [[NSScreen screens] firstObject]; + + NSRect windowRect = firstScreen ? NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000) : rect; NSWindow* window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSWindowStyleMaskBorderless backing:(NSBackingStoreType)_NSBackingStoreUnbuffered defer:YES]; WKWebView* webView = [[WKWebView alloc] initWithFrame:[window.contentView bounds] configuration:configuration]; - webView._windowOcclusionDetectionEnabled = NO; if (!webView) return nil; + webView._windowOcclusionDetectionEnabled = NO; webView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; [window.contentView addSubview:webView]; [window setIsVisible:YES]; diff --git a/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp b/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp index 2261c2b810..8dde328f19 100644 --- a/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp +++ b/browser_patches/webkit/embedder/Playwright/win/WinMain.cpp @@ -109,7 +109,6 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, auto configuration = adoptWK(WKWebsiteDataStoreConfigurationCreate()); if (g_options.userDataDir.length()) { std::string profileFolder = toUTF8String(g_options.userDataDir, g_options.userDataDir.length()); - WKWebsiteDataStoreConfigurationSetApplicationCacheDirectory(configuration.get(), toWK(profileFolder + "\\ApplicationCache").get()); WKWebsiteDataStoreConfigurationSetNetworkCacheDirectory(configuration.get(), toWK(profileFolder + "\\Cache").get()); WKWebsiteDataStoreConfigurationSetCacheStorageDirectory(configuration.get(), toWK(profileFolder + "\\CacheStorage").get()); WKWebsiteDataStoreConfigurationSetIndexedDBDatabaseDirectory(configuration.get(), toWK(profileFolder + "\\Databases" + "\\IndexedDB").get()); diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff index f713c6fa09..80d62c3967 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 1b7690be3268f54cc649a97206fc38fb27453e08..d14a541e585d2b43d6738c9bb5eb26642522b46b 100644 +index 1262273a2d71853caba03827fd454f1d4fa5124e..cd5bf3b6bc2268b8d50d2a7b8c344d4bda65ad30 100644 --- a/Source/JavaScriptCore/CMakeLists.txt +++ b/Source/JavaScriptCore/CMakeLists.txt -@@ -1418,21 +1418,26 @@ set(JavaScriptCore_INSPECTOR_DOMAINS +@@ -1561,21 +1561,26 @@ set(JavaScriptCore_INSPECTOR_DOMAINS ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json @@ -60,10 +60,10 @@ index 53809cbc20c8fb942304a25899a2e5ecccc79ee3..63d93e08bcf8089e4e315e48d5d20937 $(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 cb42b0e750a8b6a64ebc58f1bfe65c50e7b4c99c..ed548bf0ac70da0273a20178a2786e232907ce68 100644 +index f0058c1cea010b2ea0f128fb4670f0fcde93924b..717df1beaa22a0e7c8df0a50f3c0585ada0385d7 100644 --- a/Source/JavaScriptCore/DerivedSources.make +++ b/Source/JavaScriptCore/DerivedSources.make -@@ -303,21 +303,26 @@ INSPECTOR_DOMAINS := \ +@@ -299,21 +299,26 @@ INSPECTOR_DOMAINS := \ $(JavaScriptCore)/inspector/protocol/CSS.json \ $(JavaScriptCore)/inspector/protocol/Canvas.json \ $(JavaScriptCore)/inspector/protocol/Console.json \ @@ -169,7 +169,7 @@ index 6f8cae4d995d3ae020cd09aa0ba0c9ccc1e78409..fc3d0d1e0803ea38a70fee82ea946247 // 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 c988668bd732434ec4eaa485c7bbc0a93e2e64cf..75da5ed8a0575d8fe444f3f251c1af99fed78c97 100644 +index 0f7a5ff3cd0ad31ed9d816fb281a368e1c4ddcd2..8ce48015677d4fb6691a0ce0ac797f5bb370b622 100644 --- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h +++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h @@ -95,8 +95,11 @@ public: @@ -220,7 +220,7 @@ index 0cc2127c9c12c2d82dea9550bad73f4ffb99ba24..8ca65cc042d435cbc0e05dcc5c5dfc95 } diff --git a/Source/JavaScriptCore/inspector/InspectorTarget.h b/Source/JavaScriptCore/inspector/InspectorTarget.h -index b555c2e5a071d0a6a016061cc60755449557556d..d019346f0932296d15212c76a4a9b56beb565ff4 100644 +index 64b809b451dc6715ae7e762c702a32f1f8d722da..bfb39f616789786a1851b0a36635a8a2013ba6dc 100644 --- a/Source/JavaScriptCore/inspector/InspectorTarget.h +++ b/Source/JavaScriptCore/inspector/InspectorTarget.h @@ -66,8 +66,12 @@ public: @@ -268,7 +268,7 @@ index 6bbd0729a65b4a901e7da4dc50cc47c669bd9897..452b25d0e8eba3df1d5f6623dc222048 void warnUnimplemented(const String& method); void internalAddMessage(MessageType, MessageLevel, JSC::JSGlobalObject*, Ref&&); diff --git a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp -index 0cb6efeef2430faa5dbd812f71d4abfd5f6eb9df..787ec6a5f8413c0a9dc133cb0e51ccdab58d40d0 100644 +index a478fa0ed95015757707de9ceb163b7e05f52656..f83b62acf22c75b65f5c12346d0756ee3bfa06a1 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 @@ -295,7 +295,7 @@ index 0cb6efeef2430faa5dbd812f71d4abfd5f6eb9df..787ec6a5f8413c0a9dc133cb0e51ccda { Protocol::ErrorString errorString; diff --git a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h -index 816633a6dfc75a1248f6edb44807e5d4f602568c..687fb7dadfad9357e15a27e0869fa145c46fb39a 100644 +index 8240c23298f680abb6c379d02841c566fb287f1c..c9567e12c54c5775af6d52e59663e18b3a2682e4 100644 --- a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h +++ b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h @@ -64,6 +64,7 @@ public: @@ -307,7 +307,7 @@ index 816633a6dfc75a1248f6edb44807e5d4f602568c..687fb7dadfad9357e15a27e0869fa145 Protocol::ErrorStringOr> getPreview(const Protocol::Runtime::RemoteObjectId&) final; Protocol::ErrorStringOr>, RefPtr>>> getProperties(const Protocol::Runtime::RemoteObjectId&, std::optional&& ownProperties, std::optional&& fetchStart, std::optional&& fetchCount, std::optional&& generatePreview) final; diff --git a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp -index db75bf0f9edf28d3e23ab40740dfb86a6fd3b104..045caf300e3f9085e5d0ae7feb424f4bf3cf964f 100644 +index bc315cb8bd326b10a883aaeace698f531d3d24ca..580cf5987e1652d757227b4c8c293427dc0bd9ac 100644 --- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp +++ b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp @@ -90,6 +90,34 @@ Protocol::ErrorStringOr InspectorTargetAgent::sendMessageToTarget(const St @@ -345,7 +345,7 @@ index db75bf0f9edf28d3e23ab40740dfb86a6fd3b104..045caf300e3f9085e5d0ae7feb424f4b void InspectorTargetAgent::sendMessageFromTargetToFrontend(const String& targetId, const String& message) { ASSERT_WITH_MESSAGE(m_targets.get(targetId), "Sending a message from an untracked target to the frontend."); -@@ -147,7 +175,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target) +@@ -149,7 +177,17 @@ void InspectorTargetAgent::targetDestroyed(InspectorTarget& target) if (!m_isConnected) return; @@ -365,7 +365,7 @@ index db75bf0f9edf28d3e23ab40740dfb86a6fd3b104..045caf300e3f9085e5d0ae7feb424f4b void InspectorTargetAgent::didCommitProvisionalTarget(const String& oldTargetID, const String& committedTargetID) diff --git a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h -index d1ebed23d1fbacd95e1543606b2591438826b0d2..8536f8325de2afa21e814c2d2ce4bef8189bda70 100644 +index 6d221e260d0f3bc6ba3914b8bb14b35befd332b5..a74deeaf80ce411fe9e8600532162f74251b1e22 100644 --- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h +++ b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h @@ -53,8 +53,11 @@ public: @@ -866,7 +866,7 @@ index 96af27ece2ac200e11c4311b3ca0d9d3b5a048da..3168f7806fcbdabec07acc5e304bae1e ], "events": [ diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json -index 3d032713a7f3bb9645bfc7d42455a0494b5376c0..913dda5e90b86cc5f8e4ca6881f6db57520a7f66 100644 +index a9a991e82e5354f5f98949ce6d4a61ede0aba83f..2b37089c853e4e0aa430532e6c7db237d588b29f 100644 --- a/Source/JavaScriptCore/inspector/protocol/Page.json +++ b/Source/JavaScriptCore/inspector/protocol/Page.json @@ -20,7 +20,15 @@ @@ -1119,18 +1119,8 @@ index 3d032713a7f3bb9645bfc7d42455a0494b5376c0..913dda5e90b86cc5f8e4ca6881f6db57 { "name": "frameDetached", "description": "Fired when frame has been detached from its parent.", -@@ -381,7 +540,8 @@ - "targetTypes": ["page"], - "parameters": [ - { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has scheduled a navigation." }, -- { "name": "delay", "type": "number", "description": "Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start." } -+ { "name": "delay", "type": "number", "description": "Delay (in seconds) until the navigation is scheduled to begin. The navigation is not guaranteed to start." }, -+ { "name": "targetIsCurrentFrame", "type": "boolean", "description": "Whether the naviation will happen in the same frame." } - ] - }, - { -@@ -392,6 +552,22 @@ - { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." } +@@ -361,6 +520,22 @@ + { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has been detached." } ] }, + { @@ -1152,7 +1142,7 @@ index 3d032713a7f3bb9645bfc7d42455a0494b5376c0..913dda5e90b86cc5f8e4ca6881f6db57 { "name": "defaultUserPreferencesDidChange", "description": "Fired when the default value of a user preference changes at the system level.", -@@ -399,6 +575,42 @@ +@@ -368,6 +543,42 @@ "parameters": [ { "name": "preferences", "type": "array", "items": { "$ref": "UserPreference" }, "description": "List of user preferences that can be overriden and their new system (default) values." } ] @@ -1197,10 +1187,10 @@ index 3d032713a7f3bb9645bfc7d42455a0494b5376c0..913dda5e90b86cc5f8e4ca6881f6db57 } diff --git a/Source/JavaScriptCore/inspector/protocol/Playwright.json b/Source/JavaScriptCore/inspector/protocol/Playwright.json new file mode 100644 -index 0000000000000000000000000000000000000000..440dd95173e066a886de120fb3dab7597d85feb6 +index 0000000000000000000000000000000000000000..8dc7f2bd04172dd6cabb1d869a295569b4c38ed8 --- /dev/null +++ b/Source/JavaScriptCore/inspector/protocol/Playwright.json -@@ -0,0 +1,315 @@ +@@ -0,0 +1,316 @@ +{ + "domain": "Playwright", + "availability": ["web"], @@ -1306,7 +1296,8 @@ index 0000000000000000000000000000000000000000..440dd95173e066a886de120fb3dab759 + "description": "Creates new ephemeral browser context.", + "parameters": [ + { "name": "proxyServer", "type": "string", "optional": true, "description": "Proxy server, similar to the one passed to --proxy-server" }, -+ { "name": "proxyBypassList", "type": "string", "optional": true, "description": "Proxy bypass list, similar to the one passed to --proxy-bypass-list" } ++ { "name": "proxyBypassList", "type": "string", "optional": true, "description": "Proxy bypass list, similar to the one passed to --proxy-bypass-list" }, ++ { "name": "enableStoragePartitioning", "type": "boolean", "optional": true, "description": "Wether to use storage partitioning. Be default Playwright disables the partitioning." } + ], + "returns": [ + { "name": "browserContextId", "$ref": "ContextID", "description": "Unique identifier of the context." } @@ -1622,13 +1613,13 @@ index 0000000000000000000000000000000000000000..73a4e53ced3acc41316bb8d4c787306d + ] +} diff --git a/Source/JavaScriptCore/inspector/protocol/Target.json b/Source/JavaScriptCore/inspector/protocol/Target.json -index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..bbbabc4e7259088b9404e8cc07eecd6f45077da0 100644 +index a861a83b87e4e7752e547b7070ec1ef26e1cc3e5..16d6ec26034758e127dcb599f5cb170823182470 100644 --- a/Source/JavaScriptCore/inspector/protocol/Target.json +++ b/Source/JavaScriptCore/inspector/protocol/Target.json @@ -10,7 +10,7 @@ "properties": [ { "name": "targetId", "type": "string", "description": "Unique identifier for the target." }, - { "name": "type", "type": "string", "enum": ["page", "service-worker", "worker"] }, + { "name": "type", "type": "string", "enum": ["page", "frame", "service-worker", "worker"] }, - { "name": "isProvisional", "type": "boolean", "optional": true, "description": "Whether this is a provisional page target." }, + { "name": "isProvisional", "type": "boolean", "optional": true, "description": "True value indicates that this is a provisional page target i.e. Such target may be created when current page starts cross-origin navigation. Eventually each provisional target is either committed and swaps with the current target or gets destroyed, e.g. in case of load request failure." }, { "name": "isPaused", "type": "boolean", "optional": true, "description": "Whether the target is paused on start and has to be explicitely resumed by inspector." } @@ -1667,7 +1658,7 @@ index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..bbbabc4e7259088b9404e8cc07eecd6f }, { diff --git a/Source/JavaScriptCore/runtime/ConsoleClient.h b/Source/JavaScriptCore/runtime/ConsoleClient.h -index 24891ad836086fd23024fcb4d08ca63f6974c812..29f4b6b1923383fec7a99d28a4e815dc4536d160 100644 +index ce394be47840853ba08066ebbd1d909fad1f602e..bfd82684410312890c1e112aced16be797437893 100644 --- a/Source/JavaScriptCore/runtime/ConsoleClient.h +++ b/Source/JavaScriptCore/runtime/ConsoleClient.h @@ -78,6 +78,7 @@ public: @@ -1679,10 +1670,10 @@ index 24891ad836086fd23024fcb4d08ca63f6974c812..29f4b6b1923383fec7a99d28a4e815dc private: enum ArgumentRequirement { ArgumentRequired, ArgumentNotRequired }; diff --git a/Source/ThirdParty/libwebrtc/CMakeLists.txt b/Source/ThirdParty/libwebrtc/CMakeLists.txt -index a04e69b350a29f6b569a04d094a15872f0745870..6f2aa0dcb9fe06cdbc8184b80b13bf735729ad1f 100644 +index 5a6fca7b0bef95d05511baf41deff8841d872e04..1f59d06c9a89efe248c3b172c4324d95608e26bb 100644 --- a/Source/ThirdParty/libwebrtc/CMakeLists.txt +++ b/Source/ThirdParty/libwebrtc/CMakeLists.txt -@@ -1807,6 +1807,14 @@ list(APPEND webrtc_SOURCES +@@ -1796,6 +1796,14 @@ list(APPEND webrtc_SOURCES Source/third_party/boringssl/src/util/fipstools/acvp/modulewrapper/modulewrapper.cc ) @@ -1697,7 +1688,7 @@ index a04e69b350a29f6b569a04d094a15872f0745870..6f2aa0dcb9fe06cdbc8184b80b13bf73 if (WTF_CPU_X86_64 OR WTF_CPU_X86) list(APPEND webrtc_SOURCES Source/webrtc/common_audio/fir_filter_sse.cc -@@ -2399,6 +2407,14 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE +@@ -2387,6 +2395,14 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE Source/webrtc/modules/video_coding/include ) @@ -1726,13 +1717,13 @@ index 0c5c8e689bdddec766f9de5bffd4444a5e068d77..330dd1f585e530722178c65c883641a2 // FIXME: Set WEBRTC_USE_BUILTIN_ISAC_FIX and WEBRTC_USE_BUILTIN_ISAC_FLOAT for iOS and Mac diff --git a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp -index 30585bd097ec1e57d0c5f87180bf59a71f0192df..95b7a60b3cc66704c51fd6a6ce4e32582a089f9f 100644 +index 001fe26ea1ce01ec7d8a605b706db20ed9bf36f6..8906ae2fa79dd94378c61cf10df4a16e9c5e8642 100644 --- a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp +++ b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp -@@ -404,3 +404,16 @@ __ZTVN6webrtc14NetworkManagerE - __ZTVN6webrtc17AsyncPacketSocketE - __ZTVN6webrtc18NetworkManagerBaseE - __ZNK6webrtc9IPAddressneERKS0_ +@@ -411,3 +411,16 @@ __ZN6webrtc11EnableMediaERNS_33PeerConnectionFactoryDependenciesE + __ZN6webrtc18BasicPortAllocatorC1ERKNS_11EnvironmentEPNS_14NetworkManagerEPNS_19PacketSocketFactoryEPNS_14TurnCustomizerEPNS_25RelayPortFactoryInterfaceENSt3__110unique_ptrINS_44LocalNetworkAccessPermissionFactoryInterfaceENSC_14default_deleteISE_EEEE + __ZNK6webrtc12IceCandidate8ToStringEv + __ZN6webrtc12IceCandidate6CreateENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEiS5_PNS_13SdpParseErrorE +__ZN8mkvmuxer11SegmentInfo4InitEv +__ZN8mkvmuxer9MkvWriterC1EP7__sFILE +_ARGBToI420 @@ -1747,7 +1738,7 @@ index 30585bd097ec1e57d0c5f87180bf59a71f0192df..95b7a60b3cc66704c51fd6a6ce4e3258 +_vpx_codec_version_str +_vpx_codec_vp8_cx diff --git a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj -index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cbe458a06f 100644 +index 94a27d3d4cebbbbc79e0b5c263ecabca8eae23de..3be6c41a824cb82aaea89bc2934c8431cc75ba94 100644 --- a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj +++ b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj @@ -56,6 +56,20 @@ @@ -1769,9 +1760,9 @@ index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cb +/* End PBXAggregateTarget section */ + /* 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, ); }; }; -@@ -5852,6 +5866,13 @@ + 2938424F2E258DF1006DF6A9 /* aesni-gcm-x86_64-apple.S in Sources */ = {isa = PBXBuildFile; fileRef = 293841D82E258DF1006DF6A9 /* aesni-gcm-x86_64-apple.S */; }; + 293842512E258DF1006DF6A9 /* ghash-x86_64-apple.S in Sources */ = {isa = PBXBuildFile; fileRef = 293842002E258DF1006DF6A9 /* ghash-x86_64-apple.S */; }; +@@ -5692,6 +5706,13 @@ remoteGlobalIDString = DDF30D0527C5C003006A526F; remoteInfo = absl; }; @@ -1785,7 +1776,7 @@ index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cb /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ -@@ -24570,6 +24591,7 @@ +@@ -24341,6 +24362,7 @@ ); dependencies = ( 410B3827292B73E90003E515 /* PBXTargetDependency */, @@ -1793,7 +1784,7 @@ index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cb DD2E76E827C6B69A00F2A74C /* PBXTargetDependency */, CDEBB4CC24C01AB400ADBD44 /* PBXTargetDependency */, 411ED040212E0811004320BA /* PBXTargetDependency */, -@@ -24663,6 +24685,7 @@ +@@ -24434,6 +24456,7 @@ 4460B8B92B155B6A00392062 /* vp9_qp_parser_fuzzer */, 444A6EF02AEADFC9005FE121 /* vp9_replay_fuzzer */, 44945C512B9BA1C300447FFD /* webm_fuzzer */, @@ -1801,7 +1792,7 @@ index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cb ); }; /* End PBXProject section */ -@@ -24766,6 +24789,23 @@ +@@ -24537,6 +24560,23 @@ shellPath = /bin/sh; shellScript = "[ -z \"${WK_DERIVED_SDK_HEADERS_DIR}\" -o -d \"${WK_DERIVED_SDK_HEADERS_DIR}\" ] && touch \"${SCRIPT_OUTPUT_FILE_0}\"\n"; }; @@ -1825,7 +1816,7 @@ index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cb /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ -@@ -27789,6 +27829,11 @@ +@@ -27611,6 +27651,11 @@ target = DDF30D0527C5C003006A526F /* absl */; targetProxy = DD2E76E727C6B69A00F2A74C /* PBXContainerItemProxy */; }; @@ -1837,7 +1828,7 @@ index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cb /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ -@@ -28556,6 +28601,27 @@ +@@ -28378,6 +28423,27 @@ }; name = Production; }; @@ -1865,7 +1856,7 @@ index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cb FB39D0711200ED9200088E69 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D7C59C71208C68B001C873E /* DebugRelease.xcconfig */; -@@ -28938,6 +29004,16 @@ +@@ -28760,6 +28826,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; @@ -1883,7 +1874,7 @@ index df544586f202dfdcb53b0c16ecf7a51b60ca3767..81f39ca4766d0368109ae90b94beb3cb isa = XCConfigurationList; buildConfigurations = ( diff --git a/Source/ThirdParty/skia/CMakeLists.txt b/Source/ThirdParty/skia/CMakeLists.txt -index 8675218a87262162d91bf992d00a1eecaf83f289..7dfe83ab3f9dd97bb13721f7034b4963efce3a30 100644 +index 462e0e6993c543ed3c264ff12347ed703e3787cf..6422f9369f496ff9045abc7eac8f511c6c82f19b 100644 --- a/Source/ThirdParty/skia/CMakeLists.txt +++ b/Source/ThirdParty/skia/CMakeLists.txt @@ -10,6 +10,8 @@ if (USE_SKIA_ENCODERS) @@ -1895,7 +1886,7 @@ index 8675218a87262162d91bf992d00a1eecaf83f289..7dfe83ab3f9dd97bb13721f7034b4963 if (ANDROID) find_package(EXPAT REQUIRED) endif () -@@ -958,6 +960,7 @@ endif () +@@ -960,6 +962,7 @@ endif () target_link_libraries(Skia PRIVATE JPEG::JPEG PNG::PNG @@ -1904,10 +1895,10 @@ index 8675218a87262162d91bf992d00a1eecaf83f289..7dfe83ab3f9dd97bb13721f7034b4963 WEBKIT_ADD_TARGET_CXX_FLAGS(Skia diff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb81574982ee7fd1 100644 +index 6542cff8231649d79b5eb2a1b1cf65e9640e2977..d989cb91ee9ea5323eebcb48aedd17ca8b143e0d 100644 --- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml +++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -@@ -562,6 +562,7 @@ ApplePayEnabled: +@@ -540,6 +540,7 @@ ApplePayEnabled: richJavaScript: true # FIXME: This is on by default in WebKit2 PLATFORM(COCOA). Perhaps we should consider turning it on for WebKitLegacy as well. @@ -1915,7 +1906,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 AsyncClipboardAPIEnabled: type: bool status: mature -@@ -572,7 +573,7 @@ AsyncClipboardAPIEnabled: +@@ -550,7 +551,7 @@ AsyncClipboardAPIEnabled: default: false WebKit: "PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE)" : true @@ -1924,7 +1915,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 WebCore: default: false -@@ -832,13 +833,10 @@ BlobFileAccessEnforcementEnabled: +@@ -811,13 +812,10 @@ BlobFileAccessEnforcementEnabled: sharedPreferenceForWebProcess: true defaultValue: WebKitLegacy: @@ -1938,7 +1929,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false BlockFontServiceInWebContentSandbox: -@@ -2089,6 +2087,7 @@ CrossOriginEmbedderPolicyEnabled: +@@ -2080,6 +2078,7 @@ CrossOriginEmbedderPolicyEnabled: WebCore: default: false @@ -1946,7 +1937,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 CrossOriginOpenerPolicyEnabled: type: bool status: stable -@@ -2162,6 +2161,7 @@ DOMAudioSessionFullEnabled: +@@ -2153,6 +2152,7 @@ DOMAudioSessionFullEnabled: WebCore: default: false @@ -1954,7 +1945,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 DOMPasteAccessRequestsEnabled: type: bool status: internal -@@ -2173,7 +2173,7 @@ DOMPasteAccessRequestsEnabled: +@@ -2164,7 +2164,7 @@ DOMPasteAccessRequestsEnabled: default: false WebKit: "PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(VISION)": true @@ -1963,7 +1954,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 WebCore: default: false -@@ -2239,10 +2239,10 @@ DataListElementEnabled: +@@ -2230,10 +2230,10 @@ DataListElementEnabled: WebKitLegacy: default: false WebKit: @@ -1976,7 +1967,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false sharedPreferenceForWebProcess: true -@@ -2255,7 +2255,7 @@ DataTransferItemsEnabled: +@@ -2246,7 +2246,7 @@ DataTransferItemsEnabled: WebKitLegacy: default: true WebKit: @@ -1985,7 +1976,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false WebCore: default: false -@@ -2497,7 +2497,7 @@ DirectoryUploadEnabled: +@@ -2489,7 +2489,7 @@ DirectoryUploadEnabled: WebKitLegacy: default: false WebKit: @@ -1994,7 +1985,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false WebCore: default: false -@@ -3022,10 +3022,10 @@ FullScreenEnabled: +@@ -3057,10 +3057,10 @@ FullScreenEnabled: WebKitLegacy: default: false WebKit: @@ -2007,7 +1998,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false sharedPreferenceForWebProcess: true -@@ -3632,7 +3632,7 @@ InputTypeColorEnabled: +@@ -3737,7 +3737,7 @@ InputTypeColorEnabled: WebKitLegacy: default: false WebKit: @@ -2016,7 +2007,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false WebCore: default: false -@@ -3665,7 +3665,7 @@ InputTypeDateEnabled: +@@ -3770,7 +3770,7 @@ InputTypeDateEnabled: "PLATFORM(IOS_FAMILY)": true default: false WebKit: @@ -2025,7 +2016,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false WebCore: default: false -@@ -3681,7 +3681,7 @@ InputTypeDateTimeLocalEnabled: +@@ -3786,7 +3786,7 @@ InputTypeDateTimeLocalEnabled: "PLATFORM(IOS_FAMILY)": true default: false WebKit: @@ -2034,7 +2025,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false WebCore: default: false -@@ -3713,7 +3713,7 @@ InputTypeTimeEnabled: +@@ -3818,7 +3818,7 @@ InputTypeTimeEnabled: "PLATFORM(IOS_FAMILY)": true default: false WebKit: @@ -2043,7 +2034,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 default: false WebCore: default: false -@@ -3774,6 +3774,7 @@ InspectorMaximumResourcesContentSize: +@@ -3879,6 +3879,7 @@ InspectorMaximumResourcesContentSize: "PLATFORM(WPE)": 50 default: 200 @@ -2051,7 +2042,7 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 InspectorStartsAttached: type: bool status: embedder -@@ -3781,7 +3782,7 @@ InspectorStartsAttached: +@@ -3886,7 +3887,7 @@ InspectorStartsAttached: exposed: [ WebKit ] defaultValue: WebKit: @@ -2060,36 +2051,16 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 InspectorSupportsShowingCertificate: type: bool -@@ -5701,7 +5702,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 -@@ -5780,6 +5781,19 @@ PitchCorrectionAlgorithm: +@@ -5980,7 +5981,7 @@ PointerLockEnabled: + "PLATFORM(IOS_FAMILY)": false + default: true WebCore: - default: MediaPlayerEnums::PitchCorrectionAlgorithm::BestAllAround - -+# Playwright: add preference 'PointerLockEnabled'. -+PointerLockEnabled: -+ type: bool -+ status: embedder -+ condition: ENABLE(POINTER_LOCK) -+ defaultValue: -+ WebKitLegacy: -+ default: true -+ WebKit: -+ default: true -+ WebCore: +- default: false + default: true -+ + PointerLockOptionsEnabled: type: bool - status: stable -@@ -6364,7 +6378,7 @@ ScreenOrientationAPIEnabled: +@@ -6568,7 +6569,7 @@ ScreenOrientationAPIEnabled: WebKitLegacy: default: false WebKit: @@ -2098,45 +2069,11 @@ index fde8f264b4df392fc8c6a06309f9a676f9c04c9c..955a01995909ccda6d486479bb815749 WebCore: default: false sharedPreferenceForWebProcess: true -@@ -7847,6 +7861,7 @@ UseDamagingInformationForCompositing: - WebCore: - default: false - -+# Playwright: force-disable on Windows. - UseGPUProcessForCanvasRenderingEnabled: - type: bool - status: stable -@@ -7859,7 +7874,7 @@ UseGPUProcessForCanvasRenderingEnabled: - defaultValue: - WebKit: - "ENABLE(GPU_PROCESS_BY_DEFAULT)": true -- "USE(GRAPHICS_LAYER_WC)": true -+ "USE(GRAPHICS_LAYER_WC)": false - default: false - - UseGPUProcessForDOMRenderingEnabled: -@@ -7904,6 +7919,7 @@ UseGPUProcessForMediaEnabled: - sharedPreferenceForWebProcess: true - mediaPlaybackRelated: true - -+# Playwright: force-disable on Windows. - UseGPUProcessForWebGLEnabled: - type: bool - status: internal -@@ -7915,7 +7931,7 @@ UseGPUProcessForWebGLEnabled: - default: false - WebKit: - "ENABLE(GPU_PROCESS_BY_DEFAULT) && ENABLE(GPU_PROCESS_WEBGL_BY_DEFAULT)": true -- "USE(GRAPHICS_LAYER_WC)": true -+ "USE(GRAPHICS_LAYER_WC)": false - default: false - 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 c7bb871d6471f8ad9144db5063f39e37db20a396..0c09abedbc001572341f30deabefe588e4938e71 100644 +index 8304087cdf984c0bf5b48a638b4ae9ac85aa2f0e..96761b8bde2865a0b4a673febaf8b48b74dc421e 100644 --- a/Source/WTF/wtf/PlatformEnable.h +++ b/Source/WTF/wtf/PlatformEnable.h -@@ -381,7 +381,7 @@ +@@ -385,7 +385,7 @@ // ORIENTATION_EVENTS should never get enabled on Desktop, only Mobile. #if !defined(ENABLE_ORIENTATION_EVENTS) @@ -2144,8 +2081,8 @@ index c7bb871d6471f8ad9144db5063f39e37db20a396..0c09abedbc001572341f30deabefe588 +#define ENABLE_ORIENTATION_EVENTS 1 #endif - #if !defined(ENABLE_OVERFLOW_SCROLLING_TOUCH) -@@ -498,7 +498,7 @@ + #if OS(WINDOWS) +@@ -494,7 +494,7 @@ #endif #if !defined(ENABLE_TOUCH_EVENTS) @@ -2155,10 +2092,10 @@ index c7bb871d6471f8ad9144db5063f39e37db20a396..0c09abedbc001572341f30deabefe588 #if !defined(ENABLE_TOUCH_ACTION_REGIONS) diff --git a/Source/WTF/wtf/PlatformEnableCocoa.h b/Source/WTF/wtf/PlatformEnableCocoa.h -index ab4579dd256f98d3984882e2a2f26a527993416e..3a529e1864e88ccf3ce2df47176b0215427eb4bc 100644 +index a11439b16d2427d9a2ecbf4d2bf29f99bb1bafb0..69f1fd6c1b0f5e6b439b2313d5563af981fcfcab 100644 --- a/Source/WTF/wtf/PlatformEnableCocoa.h +++ b/Source/WTF/wtf/PlatformEnableCocoa.h -@@ -795,7 +795,7 @@ +@@ -783,7 +783,7 @@ #endif #if !defined(ENABLE_SEC_ITEM_SHIM) @@ -2168,10 +2105,10 @@ index ab4579dd256f98d3984882e2a2f26a527993416e..3a529e1864e88ccf3ce2df47176b0215 #if !defined(ENABLE_SERVER_PRECONNECT) diff --git a/Source/WTF/wtf/PlatformHave.h b/Source/WTF/wtf/PlatformHave.h -index bd819cb4b1bef3c4758353827ee0de710708848e..40c923882da567889b48730d3ec3b809aa040b1a 100644 +index bfaf9b0b2f4a95af1cea02e180685cbbbe743f9e..a5f63c3b8f2efd4f8bb00d44523e08db9858377f 100644 --- a/Source/WTF/wtf/PlatformHave.h +++ b/Source/WTF/wtf/PlatformHave.h -@@ -1059,7 +1059,8 @@ +@@ -1069,7 +1069,8 @@ #endif #if PLATFORM(MAC) @@ -2182,12 +2119,12 @@ index bd819cb4b1bef3c4758353827ee0de710708848e..40c923882da567889b48730d3ec3b809 #if !defined(HAVE_LOCKDOWN_MODE_PDF_ADDITIONS) && \ diff --git a/Source/WTF/wtf/unicode/UTF8Conversion.h b/Source/WTF/wtf/unicode/UTF8Conversion.h -index 007b8fe3292f326504013be8198ae020f7aacf35..1c722c473732ffe05fdb61010fa4417e3e399d1f 100644 +index f507b6b97236e9e2e01d2b007c74b404e0ced2cb..ccd616e75835a389de17c5fc8314e2ce225635ff 100644 --- a/Source/WTF/wtf/unicode/UTF8Conversion.h +++ b/Source/WTF/wtf/unicode/UTF8Conversion.h @@ -27,6 +27,11 @@ - #include + #include +// Can be probably removed when we drop Debian 11. +#ifdef Success @@ -2198,10 +2135,10 @@ index 007b8fe3292f326504013be8198ae020f7aacf35..1c722c473732ffe05fdb61010fa4417e namespace Unicode { diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make -index 6d76e72ddae832186e6f3609146ac29b91e77a85..18a0976d7c065968d688fb1f585b0022541bac04 100644 +index 0f68d7a3ff54d2bb7ddb9b4e21436a323a782367..9d7134d62756baa12f1428d6b627b12d383f76b4 100644 --- a/Source/WebCore/DerivedSources.make +++ b/Source/WebCore/DerivedSources.make -@@ -1230,6 +1230,10 @@ JS_BINDING_IDLS := \ +@@ -1240,6 +1240,10 @@ JS_BINDING_IDLS := \ $(WebCore)/dom/SubscriberCallback.idl \ $(WebCore)/dom/SubscriptionObserver.idl \ $(WebCore)/dom/SubscriptionObserverCallback.idl \ @@ -2212,7 +2149,7 @@ index 6d76e72ddae832186e6f3609146ac29b91e77a85..18a0976d7c065968d688fb1f585b0022 $(WebCore)/dom/Text.idl \ $(WebCore)/dom/TextDecoder.idl \ $(WebCore)/dom/TextDecoderStream.idl \ -@@ -1830,9 +1834,6 @@ JS_BINDING_IDLS := \ +@@ -1852,9 +1856,6 @@ JS_BINDING_IDLS := \ ADDITIONAL_BINDING_IDLS = \ DocumentTouch.idl \ GestureEvent.idl \ @@ -2223,17 +2160,17 @@ index 6d76e72ddae832186e6f3609146ac29b91e77a85..18a0976d7c065968d688fb1f585b0022 vpath %.in $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp -index 51d4e0b4cbc69d2c5c5f76b7063b54865b6fc2d0..d23693e52b96d579f0d828dd825c5dab8572e7c7 100644 +index 0896a8a08f0548a1758623b926bbfce683d6795c..354495b7ca6d4663d87473b34e113e193d15fffd 100644 --- a/Source/WebCore/Modules/geolocation/Geolocation.cpp +++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp -@@ -374,8 +374,9 @@ bool Geolocation::shouldBlockGeolocationRequests() +@@ -376,8 +376,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 (isLocalOrigin || (isSecure && !hasMixedContent)) -+ if (isLocalOrigin || (isSecure && !hasMixedContent) || isPotentiallyTrustworthy) +- if (isLocalOrigin || isSecure) ++ if (isLocalOrigin || isSecure || isPotentiallyTrustworthy) return false; } @@ -2286,13 +2223,13 @@ index 72b2846f2c82818fc9a64fd90b7cba0c0601e15f..22277ab6c3233f040852d9daf9becf7b elseif (USE_SKIA) list(APPEND WebCore_SOURCES diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt -index f09f2e709ee13060d25d4419c05affd987e6328f..16a6491a03dc6aeaf5bfdb4c5b75c3bd6dcd6944 100644 +index 40e8b4e9d5ceb5d499acf8e5804e6357cf3e15e8..a4f037ca12093f0c5b72efeb1e36fa1649649453 100644 --- a/Source/WebCore/SourcesCocoa.txt +++ b/Source/WebCore/SourcesCocoa.txt -@@ -732,3 +732,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm +@@ -734,3 +734,9 @@ testing/cocoa/WebViewVisualIdentificationOverlay.mm @nonARC platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify - platform/graphics/cocoa/GraphicsContextGLCocoa.mm @no-unify - platform/graphics/cv/GraphicsContextGLCVCocoa.mm @no-unify + platform/graphics/cocoa/GraphicsContextGLCocoa.mm @nonARC @no-unify + platform/graphics/cv/GraphicsContextGLCVCocoa.mm @nonARC @no-unify + +// Playwright begin +JSTouch.cpp @@ -2300,10 +2237,10 @@ index f09f2e709ee13060d25d4419c05affd987e6328f..16a6491a03dc6aeaf5bfdb4c5b75c3bd +JSTouchList.cpp +// Playwright end diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt -index 393fc726c204fc3037287d67cc6b7aa9a5a9c4c3..7e45bf78bb7f0688cf3e09449728ad32e2be3870 100644 +index 55b8164ff85ba521e9e5e858109dafc1e24a6636..abb09e02ff454bee9e86667655d66ada16c5e104 100644 --- a/Source/WebCore/SourcesGTK.txt +++ b/Source/WebCore/SourcesGTK.txt -@@ -113,3 +113,10 @@ platform/unix/SharedMemoryUnix.cpp +@@ -117,3 +117,10 @@ platform/unix/SharedMemoryUnix.cpp platform/xdg/MIMETypeRegistryXdg.cpp platform/xr/openxr/PlatformXROpenXR.cpp @@ -2315,36 +2252,23 @@ index 393fc726c204fc3037287d67cc6b7aa9a5a9c4c3..7e45bf78bb7f0688cf3e09449728ad32 +JSSpeechSynthesisEventInit.cpp +// Playwright: end. diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt -index f5fe901c57ba84d42c8ee3be47c404069ac6fed8..599a40b75fdb63306f706dbb7ff845b9e29a473a 100644 +index 2a5fdd8fd9ad31ed9145917d2335820b0b4975c1..b8085a7b2f0ad0535bfb673077e0273cee98a28b 100644 --- a/Source/WebCore/SourcesWPE.txt +++ b/Source/WebCore/SourcesWPE.txt -@@ -48,6 +48,8 @@ editing/glib/WebContentReaderGLib.cpp - - loader/soup/ResourceLoaderSoup.cpp - -+page/wpe/DragControllerWPE.cpp -+ - page/linux/ResourceUsageOverlayLinux.cpp - page/linux/ResourceUsageThreadLinux.cpp - -@@ -99,3 +101,12 @@ platform/wpe/PlatformScreenWPE.cpp +@@ -109,3 +109,8 @@ platform/wpe/PlatformScreenWPE.cpp platform/xdg/MIMETypeRegistryXdg.cpp platform/xr/openxr/PlatformXROpenXR.cpp + -+// Playwright: begin. -+platform/wpe/DragDataWPE.cpp -+ +JSSpeechSynthesisErrorCode.cpp +JSSpeechSynthesisErrorEvent.cpp +JSSpeechSynthesisErrorEventInit.cpp +JSSpeechSynthesisEventInit.cpp -+// Playwright: end. diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -index 612c2492b160e840f942b1b5bef3faf995f411cf..221ffcfc32818d1d2839aa984eefc43f60d2ba31 100644 +index be2dd5b204efd83fc08698d13c24cc8aff92ba52..9e145d385b52bb65b865712f5e49af1e9b8b821e 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -@@ -6503,6 +6503,13 @@ +@@ -6733,6 +6733,13 @@ EE62BD9D2DE12C1B006C9A05 /* ResolvedScopedName.h in Headers */ = {isa = PBXBuildFile; fileRef = EE62BD9B2DE12BD4006C9A05 /* ResolvedScopedName.h */; settings = {ATTRIBUTES = (Private, ); }; }; EEE349082DE0061C00A7D4BB /* StyleScopeIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = EEE349072DE005FC00A7D4BB /* StyleScopeIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; EFCC6C8F20FE914400A2321B /* CanvasActivityRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -2356,12 +2280,12 @@ index 612c2492b160e840f942b1b5bef3faf995f411cf..221ffcfc32818d1d2839aa984eefc43f + F050E17423AD6A800011CE47 /* DocumentTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F050E17323AD6A800011CE47 /* DocumentTouch.cpp */; }; + F050E17823AD70C50011CE47 /* PlatformTouchPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = F050E17623AD70C40011CE47 /* PlatformTouchPoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F12171F416A8BC63000053CA /* WebVTTElement.h */; }; + F30EE46B2E721BA800935B60 /* FrameInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = F30EE46A2E721B9D00935B60 /* FrameInspectorController.h */; settings = {ATTRIBUTES = (Private, ); }; }; 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, ); }; }; -@@ -21257,6 +21264,14 @@ - EEE349072DE005FC00A7D4BB /* StyleScopeIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StyleScopeIdentifier.h; sourceTree = ""; }; - EFB7287B2124C73D005C2558 /* CanvasActivityRecord.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasActivityRecord.cpp; sourceTree = ""; }; +@@ -21844,6 +21851,14 @@ EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasActivityRecord.h; sourceTree = ""; }; + F088343F2E721B29001B2348 /* AXLocalFrame.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXLocalFrame.h; sourceTree = ""; }; + F08834402E721B33001B2348 /* AXLocalFrame.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AXLocalFrame.cpp; sourceTree = ""; }; + F050E16623AC9C070011CE47 /* PlatformTouchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformTouchEvent.h; sourceTree = ""; }; + F050E16923AD660C0011CE47 /* Touch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Touch.cpp; path = dom/Touch.cpp; sourceTree = SOURCE_ROOT; }; + F050E16B23AD66620011CE47 /* TouchList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TouchList.h; path = dom/TouchList.h; sourceTree = SOURCE_ROOT; }; @@ -2372,8 +2296,8 @@ index 612c2492b160e840f942b1b5bef3faf995f411cf..221ffcfc32818d1d2839aa984eefc43f + F050E17623AD70C40011CE47 /* PlatformTouchPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformTouchPoint.h; sourceTree = ""; }; 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 = ""; }; -@@ -29046,6 +29061,11 @@ + F30EE46A2E721B9D00935B60 /* FrameInspectorController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameInspectorController.h; sourceTree = ""; }; +@@ -29744,6 +29759,11 @@ BC4A5324256055590028C592 /* TextDirectionSubmenuInclusionBehavior.h */, 2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */, 2D4F96F21A1ECC240098BF88 /* TextIndicator.h */, @@ -2383,9 +2307,9 @@ index 612c2492b160e840f942b1b5bef3faf995f411cf..221ffcfc32818d1d2839aa984eefc43f + F050E16C23AD66630011CE47 /* TouchList.cpp */, + F050E16B23AD66620011CE47 /* TouchList.h */, F48570A42644C76D00C05F71 /* TranslationContextMenuInfo.h */, - F4E1965F21F26E4E00285078 /* UndoItem.cpp */, - 2ECDBAD521D8906300F00ECD /* UndoItem.h */, -@@ -36194,6 +36214,8 @@ + D640B24C2E3058C800EB6C49 /* UADataValues.h */, + D640B24E2E3058C800EB6C49 /* UADataValues.idl */, +@@ -37333,6 +37353,8 @@ 29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */, 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */, 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */, @@ -2394,7 +2318,7 @@ index 612c2492b160e840f942b1b5bef3faf995f411cf..221ffcfc32818d1d2839aa984eefc43f FE3DC9932D0C063C0021B6FC /* PlatformTZoneImpls.cpp */, 0FD7C21D23CE41E30096D102 /* PlatformWheelEvent.cpp */, 935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */, -@@ -39050,6 +39072,7 @@ +@@ -40227,6 +40249,7 @@ AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */, 6BDB5DC1227BD3B800919770 /* DocumentStorageAccess.cpp */, 6BDB5DC0227BD3B800919770 /* DocumentStorageAccess.h */, @@ -2402,7 +2326,7 @@ index 612c2492b160e840f942b1b5bef3faf995f411cf..221ffcfc32818d1d2839aa984eefc43f 7CE7FA5B1EF882300060C9D6 /* DocumentTouch.cpp */, 7CE7FA591EF882300060C9D6 /* DocumentTouch.h */, A8185F3209765765005826D9 /* DocumentType.cpp */, -@@ -44014,6 +44037,8 @@ +@@ -45281,6 +45304,8 @@ F4E90A3C2B52038E002DA469 /* PlatformTextAlternatives.h in Headers */, 0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */, 074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */, @@ -2411,49 +2335,50 @@ index 612c2492b160e840f942b1b5bef3faf995f411cf..221ffcfc32818d1d2839aa984eefc43f CDD08ABD277E542600EA3755 /* PlatformTrackConfiguration.h in Headers */, CD1F9B022700323D00617EB6 /* PlatformVideoColorPrimaries.h in Headers */, CD1F9B01270020B700617EB6 /* PlatformVideoColorSpace.h in Headers */, -@@ -45423,6 +45448,7 @@ +@@ -46858,6 +46883,7 @@ 0F54DD081881D5F5003EEDBB /* Touch.h in Headers */, 71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */, 0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */, + F050E16D23AD66630011CE47 /* TouchList.h in Headers */, 0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */, 070334D71459FFD5008D8D45 /* TrackBase.h in Headers */, - BE88E0C21715CE2600658D98 /* TrackListBase.h in Headers */, -@@ -46627,6 +46653,8 @@ + 513C7B6E2E7C2E7A00079881 /* TrackInfo.h in Headers */, +@@ -48087,7 +48113,9 @@ 2D22830323A8470700364B7E /* CursorMac.mm in Sources */, 5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */, 07E4BDBF2A3A5FAB000D5509 /* DictationCaretAnimator.cpp in Sources */, + F050E17423AD6A800011CE47 /* DocumentTouch.cpp in Sources */, + 0749E9512E275A23009B912B /* EditingHTMLConverter.mm in Sources */, + 329C0C2528BD96EB00F187D2 /* ElementName.cpp in Sources */, 7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */, 4667EA3E2968D9DA00BAB1E2 /* GameControllerHapticEffect.mm in Sources */, 46FE73D32968E52000B8064C /* GameControllerHapticEngines.mm in Sources */, -@@ -46718,6 +46746,9 @@ - CE88EE262414467B007F29C2 /* TextAlternativeWithRange.mm in Sources */, +@@ -48181,6 +48209,9 @@ + 072F696F2E755BFA00281FC5 /* TextListParser.cpp in Sources */, BE39137129B267F500FA5D4F /* TextTransformCocoa.cpp in Sources */, 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */, + F050E16A23AD660C0011CE47 /* Touch.cpp in Sources */, + F050E17123AD669F0011CE47 /* TouchEvent.cpp in Sources */, + F050E16E23AD66630011CE47 /* TouchList.cpp in Sources */, - 538EC8031F96AF81004D22A8 /* UnifiedSource1-mm.mm in Sources */, + 538EC8031F96AF81004D22A8 /* UnifiedSource1-nonARC.mm in Sources */, 538EC8021F96AF81004D22A8 /* UnifiedSource1.cpp in Sources */, - 538EC8051F96AF81004D22A8 /* UnifiedSource2-mm.mm in Sources */, + 538EC8051F96AF81004D22A8 /* UnifiedSource2-nonARC.mm in Sources */, diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp -index 9587b90007ab8ee8ab32f7f86219732f11d457bf..81e09081c42db3c905f1adb2f917b0bca32c24c2 100644 +index 8e1a3e5d52305d451dff8cfee3fc9028cda42494..3a3468329217444a1d24cb1aced5e0f2a53ca3dc 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityObject.cpp -@@ -72,6 +72,7 @@ +@@ -78,6 +78,7 @@ #include "HTMLTableSectionElement.h" #include "HTMLTextAreaElement.h" #include "HitTestResult.h" +#include "InspectorInstrumentation.h" #include "LocalFrame.h" #include "LocalizedStrings.h" - #include "MathMLNames.h" -@@ -3998,7 +3999,12 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const - if (role() == AccessibilityRole::ApplicationDialog) + #include "Logging.h" +@@ -3897,7 +3898,12 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const + // to search within them for revealable text matching the search query string. return AccessibilityObjectInclusion::IncludeObject; - + } - return accessibilityPlatformIncludesObject(); + AccessibilityObjectInclusion platformBehavior = accessibilityPlatformIncludesObject(); + if (platformBehavior != AccessibilityObjectInclusion::DefaultBehavior) { @@ -2465,10 +2390,10 @@ index 9587b90007ab8ee8ab32f7f86219732f11d457bf..81e09081c42db3c905f1adb2f917b0bc bool AccessibilityObject::isWithinHiddenWebArea() const diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h -index c4b32aaefc75bdef3b52f2469786f9abe11fb8d4..6d84e95ff7f766a2e26c1414be92af89fa7d73cf 100644 +index 84d30421b5b6993853f92627544d64713754821e..f9bbe4d630fe9269fb549c3b0aca5dc8afab3835 100644 --- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h +++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h -@@ -190,6 +190,8 @@ namespace WebCore { +@@ -192,6 +192,8 @@ namespace WebCore { macro(DelayNode) \ macro(DeprecationReportBody) \ macro(DigitalCredential) \ @@ -2524,7 +2449,7 @@ index c0b9d058536120b4c368ab8094c16f19a5d2acba..37e7e016f5862bab19d750d06bd72b10 { auto dataTransfer = adoptRef(*new DataTransfer(StoreMode::ReadWrite, makeUnique(), Type::DragAndDropData)); diff --git a/Source/WebCore/dom/DataTransfer.h b/Source/WebCore/dom/DataTransfer.h -index 315635014cf133628d72942eb230df4e8cad036c..5424ad948028c192d9fc165cde0102e15ad65b56 100644 +index b22db7093505b1bfc39b15200640db5a1363e0ef..e96117436863ace7d52c894f37027187e33c182b 100644 --- a/Source/WebCore/dom/DataTransfer.h +++ b/Source/WebCore/dom/DataTransfer.h @@ -92,6 +92,9 @@ public: @@ -2561,44 +2486,8 @@ index 9043052540b13d8120fb641de6337af46c3b36ef..a0f89e64b64640d2d4dbc14734868c4d Exposed=Window ] interface DeviceOrientationEvent : Event { readonly attribute unrestricted double? alpha; -diff --git a/Source/WebCore/dom/Document+PointerLock.idl b/Source/WebCore/dom/Document+PointerLock.idl -index 2e9c9fda6a920cd8904432bd1bdbfbf32d01c085..2fd33597e905b0544665ff765f310945305a0c4a 100644 ---- a/Source/WebCore/dom/Document+PointerLock.idl -+++ b/Source/WebCore/dom/Document+PointerLock.idl -@@ -25,6 +25,7 @@ - - // https://w3c.github.io/pointerlock/#extensions-to-the-document-interface - [ -+ EnabledBySetting=PointerLockEnabled, - Conditional=POINTER_LOCK - ] partial interface Document { - attribute EventHandler onpointerlockchange; -diff --git a/Source/WebCore/dom/DocumentOrShadowRoot+PointerLock.idl b/Source/WebCore/dom/DocumentOrShadowRoot+PointerLock.idl -index 9b8dbfc15ce078702321abcd6c0e636df7a60510..2956f7098e87af10ab8f5584b456ce9a6d432a20 100644 ---- a/Source/WebCore/dom/DocumentOrShadowRoot+PointerLock.idl -+++ b/Source/WebCore/dom/DocumentOrShadowRoot+PointerLock.idl -@@ -25,6 +25,7 @@ - - // https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin - [ -+ EnabledBySetting=PointerLockEnabled, - Conditional=POINTER_LOCK - ] partial interface mixin DocumentOrShadowRoot { - readonly attribute Element? pointerLockElement; -diff --git a/Source/WebCore/dom/Element+PointerLock.idl b/Source/WebCore/dom/Element+PointerLock.idl -index 9b344003de17b96d8b9ca8c7f32143a27543b1ea..2208a3f2b7d930bcd291e65b474d4c3023d2a7e4 100644 ---- a/Source/WebCore/dom/Element+PointerLock.idl -+++ b/Source/WebCore/dom/Element+PointerLock.idl -@@ -24,6 +24,7 @@ - */ - - [ -+ EnabledBySetting=PointerLockEnabled, - Conditional=POINTER_LOCK - ] 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 6b0390aba75731707ce48ea206b87974ffb15857..8c634c0748f0d447476d460ee2800f82d232d7ff 100644 +index b691425261078163e043b062a0a9f1fe5215d2b5..d3a8a99b08099cf16f0b0274d680c32e9ffef54e 100644 --- a/Source/WebCore/dom/PointerEvent.cpp +++ b/Source/WebCore/dom/PointerEvent.cpp @@ -28,10 +28,13 @@ @@ -2615,8 +2504,8 @@ index 6b0390aba75731707ce48ea206b87974ffb15857..8c634c0748f0d447476d460ee2800f82 namespace WebCore { -@@ -293,4 +296,59 @@ void PointerEvent::receivedTarget() - predictedEvent->setTarget(this->target()); +@@ -331,4 +334,59 @@ double PointerEvent::offsetY() + return adjustedCoordinateForType(offsetLocation().y()); } +#if ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS_FAMILY) && !PLATFORM(WPE) @@ -2641,29 +2530,29 @@ index 6b0390aba75731707ce48ea206b87974ffb15857..8c634c0748f0d447476d460ee2800f82 + return nullAtom(); +} + -+Ref PointerEvent::create(const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref&& view, const IntPoint& touchDelta) ++Ref PointerEvent::create(const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref&& view, const DoublePoint& touchDelta) +{ + const auto& type = pointerEventType(event.touchPoints().at(touchIndex).state()); + return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, typeCanBubble(type), typeIsCancelable(type), touchIndex, isPrimary, WTFMove(view), touchDelta)); +} + -+Ref PointerEvent::create(const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref&& view, const IntPoint& touchDelta) ++Ref PointerEvent::create(const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref&& view, const DoublePoint& touchDelta) +{ + const auto& type = pointerEventType(event.touchPoints().at(touchIndex).state()); + return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, canBubble, isCancelable, touchIndex, isPrimary, WTFMove(view), touchDelta)); +} + -+Ref PointerEvent::create(const AtomString& type, const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref&& view, const IntPoint& touchDelta) ++Ref PointerEvent::create(const AtomString& type, const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref&& view, const DoublePoint& touchDelta) +{ + return adoptRef(*new PointerEvent(type, event, coalescedEvents, predictedEvents, typeCanBubble(type), typeIsCancelable(type), touchIndex, isPrimary, WTFMove(view), touchDelta)); +} + -+PointerEvent::PointerEvent(const AtomString& type, const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref&& view, const IntPoint& touchDelta) ++PointerEvent::PointerEvent(const AtomString& type, const PlatformTouchEvent& event, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref&& view, const DoublePoint& touchDelta) + : MouseEvent(EventInterfaceType::PointerEvent, type, canBubble, isCancelable, typeIsComposed(type), event.timestamp().approximateMonotonicTime(), WTFMove(view), 0, + event.touchPoints().at(touchIndex).pos(), event.touchPoints().at(touchIndex).pos(), touchDelta.x(), touchDelta.y(), event.modifiers(), buttonForType(type), buttonsForType(type), nullptr, 0, SyntheticClickType::NoTap, { }, { }, IsSimulated::No, IsTrusted::Yes) + , m_pointerId(event.touchPoints().at(touchIndex).id()) -+ , m_width(2 * event.touchPoints().at(touchIndex).radiusX()) -+ , m_height(2 * event.touchPoints().at(touchIndex).radiusY()) ++ , m_width(2 * event.touchPoints().at(touchIndex).radius().width()) ++ , m_height(2 * event.touchPoints().at(touchIndex).radius().height()) + , m_pressure(event.touchPoints().at(touchIndex).force()) + , m_pointerType(touchPointerEventType()) + , m_isPrimary(isPrimary) @@ -2676,10 +2565,10 @@ index 6b0390aba75731707ce48ea206b87974ffb15857..8c634c0748f0d447476d460ee2800f82 + } // namespace WebCore diff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h -index b034595d01bb63f3d72183c427fcc14695339ae2..1886e4bbba04c6177fad1562c891f2aeff0a8247 100644 +index b721aea206773db628f2a7c2bbba3bec3beeb8ec..74da0c84c430f4959125b4c690d100e6289cea8b 100644 --- a/Source/WebCore/dom/PointerEvent.h +++ b/Source/WebCore/dom/PointerEvent.h -@@ -34,6 +34,8 @@ +@@ -35,6 +35,8 @@ #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS_FAMILY) #include "PlatformTouchEventIOS.h" @@ -2688,22 +2577,22 @@ index b034595d01bb63f3d72183c427fcc14695339ae2..1886e4bbba04c6177fad1562c891f2ae #endif #if ENABLE(TOUCH_EVENTS) && PLATFORM(WPE) -@@ -94,7 +96,7 @@ public: +@@ -95,7 +97,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)) +#if ENABLE(TOUCH_EVENTS) - static Ref create(const PlatformTouchEvent&, const Vector>& coalescedEvents, const Vector>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref&&, const IntPoint& touchDelta = { }); - static Ref create(const PlatformTouchEvent&, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble, IsCancelable, unsigned touchIndex, bool isPrimary, Ref&& view, const IntPoint& touchDelta = { }); - static Ref create(const AtomString& type, const PlatformTouchEvent&, const Vector>& coalescedEvents, const Vector>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref&&, const IntPoint& touchDelta = { }); -@@ -173,7 +175,7 @@ private: + static Ref create(const PlatformTouchEvent&, const Vector>& coalescedEvents, const Vector>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref&&, const DoublePoint& touchDelta = { }); + static Ref create(const PlatformTouchEvent&, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble, IsCancelable, unsigned touchIndex, bool isPrimary, Ref&& view, const DoublePoint& touchDelta = { }); + static Ref create(const AtomString& type, const PlatformTouchEvent&, const Vector>& coalescedEvents, const Vector>& predictedEvents, unsigned touchIndex, bool isPrimary, Ref&&, const DoublePoint& touchDelta = { }); +@@ -188,7 +190,7 @@ private: PointerEvent(); PointerEvent(const AtomString&, Init&&, IsTrusted); PointerEvent(const AtomString& type, PointerID, const String& pointerType, IsPrimary); -#if ENABLE(TOUCH_EVENTS) && (PLATFORM(IOS_FAMILY) || PLATFORM(WPE)) +#if ENABLE(TOUCH_EVENTS) - PointerEvent(const AtomString& type, const PlatformTouchEvent&, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref&&, const IntPoint& touchDelta = { }); + PointerEvent(const AtomString& type, const PlatformTouchEvent&, const Vector>& coalescedEvents, const Vector>& predictedEvents, CanBubble canBubble, IsCancelable isCancelable, unsigned touchIndex, bool isPrimary, Ref&&, const DoublePoint& touchDelta = { }); #endif diff --git a/Source/WebCore/editing/libwpe/EditorLibWPE.cpp b/Source/WebCore/editing/libwpe/EditorLibWPE.cpp @@ -2734,7 +2623,7 @@ index d0a3d5c048647b07772e1581c76c4eb60ecf41b0..bec324636991079264e620c0dfdaf984 #endif // USE(LIBWPE) diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp -index 64137520fb575aac59fbb4a8fc8509cbdd8cc04e..5bdac5378686cefef1e05f4aa01a49729c3fd398 100644 +index 51176f56b3e691937622f5b4be0ff39f5e85630b..68c84ce1199ca81180db2b087b53bee2ab3798b5 100644 --- a/Source/WebCore/html/FileInputType.cpp +++ b/Source/WebCore/html/FileInputType.cpp @@ -38,6 +38,7 @@ @@ -2758,10 +2647,10 @@ index 64137520fb575aac59fbb4a8fc8509cbdd8cc04e..5bdac5378686cefef1e05f4aa01a4972 return; diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp -index af0482d2d06db91a7964b7662dd3379804062fff..49ed24c301cecabeb21ac5f3d06d2777218cd538 100644 +index 4f11be48fc6f3bed8d02579b166c54221f442e58..7150b1a4f16d467cc31bce52c3c5c0095cf5cf49 100644 --- a/Source/WebCore/inspector/InspectorController.cpp +++ b/Source/WebCore/inspector/InspectorController.cpp -@@ -296,6 +296,8 @@ void InspectorController::disconnectFrontend(FrontendChannel& frontendChannel) +@@ -297,6 +297,8 @@ void InspectorController::disconnectFrontend(FrontendChannel& frontendChannel) // Unplug all instrumentations since they aren't needed now. InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get()); @@ -2769,8 +2658,8 @@ index af0482d2d06db91a7964b7662dd3379804062fff..49ed24c301cecabeb21ac5f3d06d2777 + m_pauseOnStart = PauseCondition::DONT_PAUSE; } - m_inspectorClient->frontendCountChanged(m_frontendRouter->frontendCount()); -@@ -315,6 +317,8 @@ void InspectorController::disconnectAllFrontends() + m_inspectorBackendClient->frontendCountChanged(m_frontendRouter->frontendCount()); +@@ -316,6 +318,8 @@ void InspectorController::disconnectAllFrontends() // The frontend should call setInspectorFrontendClient(nullptr) under closeWindow(). ASSERT(!m_inspectorFrontendClient); @@ -2779,7 +2668,7 @@ index af0482d2d06db91a7964b7662dd3379804062fff..49ed24c301cecabeb21ac5f3d06d2777 if (!m_frontendRouter->hasFrontends()) return; -@@ -398,8 +402,8 @@ void InspectorController::inspect(Node* node) +@@ -399,8 +403,8 @@ void InspectorController::inspect(Node* node) if (!enabled()) return; @@ -2790,7 +2679,7 @@ index af0482d2d06db91a7964b7662dd3379804062fff..49ed24c301cecabeb21ac5f3d06d2777 ensureDOMAgent().inspect(node); } -@@ -542,4 +546,34 @@ void InspectorController::didComposite(LocalFrame& frame) +@@ -548,4 +552,34 @@ void InspectorController::didComposite(LocalFrame& frame) InspectorInstrumentation::didComposite(frame); } @@ -2826,10 +2715,10 @@ index af0482d2d06db91a7964b7662dd3379804062fff..49ed24c301cecabeb21ac5f3d06d2777 + } // namespace WebCore diff --git a/Source/WebCore/inspector/InspectorController.h b/Source/WebCore/inspector/InspectorController.h -index d56afdb6e48840802c5a4f28b9a954695f09965d..7c3223c9f57bc45f4109325433ac4f5e745eb986 100644 +index aeeca8fc1b3d6e6133ee7e85005febadd17c5c00..a0019b8cf2dc43622a34d79d687426fbb7174312 100644 --- a/Source/WebCore/inspector/InspectorController.h +++ b/Source/WebCore/inspector/InspectorController.h -@@ -106,6 +106,12 @@ public: +@@ -107,6 +107,12 @@ public: WEBCORE_EXPORT void willComposite(LocalFrame&); WEBCORE_EXPORT void didComposite(LocalFrame&); @@ -2842,7 +2731,7 @@ index d56afdb6e48840802c5a4f28b9a954695f09965d..7c3223c9f57bc45f4109325433ac4f5e // Testing support. bool isUnderTest() const { return m_isUnderTest; } void setIsUnderTest(bool isUnderTest) { m_isUnderTest = isUnderTest; } -@@ -136,6 +142,7 @@ private: +@@ -137,6 +143,7 @@ private: PageAgentContext pageAgentContext(); void createLazyAgents(); @@ -2850,7 +2739,7 @@ index d56afdb6e48840802c5a4f28b9a954695f09965d..7c3223c9f57bc45f4109325433ac4f5e WeakRef m_page; const Ref m_instrumentingAgents; -@@ -159,6 +166,7 @@ private: +@@ -160,6 +167,7 @@ private: bool m_isAutomaticInspection { false }; bool m_pauseAfterInitialization = { false }; bool m_didCreateLazyAgents { false }; @@ -2859,10 +2748,10 @@ index d56afdb6e48840802c5a4f28b9a954695f09965d..7c3223c9f57bc45f4109325433ac4f5e } // namespace WebCore diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp -index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224959ba08c 100644 +index 93f631d3897bcce961d5f8ea71cd75411d71df87..c654164fdd0f4a7ff6d5509873192fc3bce4a2f2 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.cpp +++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp -@@ -595,6 +595,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i +@@ -598,6 +598,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i pageAgent->applyUserAgentOverride(userAgent); } @@ -2875,7 +2764,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents& instrumentingAgents, AtomString& media) { if (auto* pageAgent = instrumentingAgents.enabledPageAgent()) -@@ -678,6 +684,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. } @@ -2888,7 +2777,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 void InspectorInstrumentation::willLoadXHRSynchronouslyImpl(InstrumentingAgents& instrumentingAgents) { if (auto* networkAgent = instrumentingAgents.enabledNetworkAgent()) -@@ -710,20 +722,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& +@@ -713,20 +725,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { @@ -2912,7 +2801,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 } void InspectorInstrumentation::frameDetachedFromParentImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) -@@ -803,12 +812,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins +@@ -806,12 +815,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins pageDOMDebuggerAgent->frameDocumentUpdated(frame); } @@ -2925,20 +2814,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { if (frame.isMainFrame()) { -@@ -839,10 +842,10 @@ void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& inst - inspectorPageAgent->frameStoppedLoading(frame); - } - --void InspectorInstrumentation::frameScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, Seconds delay) -+void InspectorInstrumentation::frameScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, Seconds delay, bool targetIsCurrentFrame) - { - if (auto* inspectorPageAgent = instrumentingAgents.enabledPageAgent()) -- inspectorPageAgent->frameScheduledNavigation(frame, delay); -+ inspectorPageAgent->frameScheduledNavigation(frame, delay, targetIsCurrentFrame); - } - - void InspectorInstrumentation::frameClearedScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame) -@@ -857,6 +860,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA +@@ -842,6 +845,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA inspectorPageAgent->accessibilitySettingsDidChange(); } @@ -2951,7 +2827,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 #if ENABLE(DARK_MODE_CSS) void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents) { -@@ -909,6 +918,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru +@@ -894,6 +903,12 @@ void InspectorInstrumentation::interceptResponseImpl(InstrumentingAgents& instru networkAgent->interceptResponse(response, identifier, WTFMove(handler)); } @@ -2964,7 +2840,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 // JavaScriptCore InspectorDebuggerAgent should know Console MessageTypes. static bool isConsoleAssertMessage(MessageSource source, MessageType type) { -@@ -1027,6 +1042,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent +@@ -1012,6 +1027,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent canvasAgent->consoleStopRecordingCanvas(context); } @@ -2977,7 +2853,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents& instrumentingAgents, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin) { if (auto* domStorageAgent = instrumentingAgents.enabledDOMStorageAgent()) -@@ -1317,6 +1338,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins +@@ -1309,6 +1330,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins layerTreeAgent->renderLayerDestroyed(renderLayer); } @@ -3014,7 +2890,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(WorkerOrWorkletGlobalScope& globalScope) { return globalScope.inspectorController().m_instrumentingAgents; -@@ -1333,6 +1384,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(Page& page) +@@ -1343,6 +1394,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(Page& page) return page.inspectorController().m_instrumentingAgents.get(); } @@ -3029,7 +2905,7 @@ index 1c660f381ad7e9a9201aeced2906f39135e810f6..6c47abc2f32b39fd5c0bf9048b9c1224 { // Using RefPtr makes us hit the m_inRemovedLastRefFunction assert. diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h -index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c463626bf0118f 100644 +index 274fa998f725feb20d05a66caa9e2ba18bcf26aa..e5e4e184d1528938dc2589be7dd52868794bf2c5 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.h +++ b/Source/WebCore/inspector/InspectorInstrumentation.h @@ -31,6 +31,7 @@ @@ -3040,23 +2916,23 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 #include "CSSSelector.h" #include "CanvasBase.h" #include "CanvasRenderingContext.h" -@@ -45,6 +46,7 @@ - #include "LocalFrame.h" - #include "LocalFrameView.h" +@@ -42,6 +43,7 @@ + #include "HitTestResult.h" + #include "InspectorInstrumentationPublic.h" #include "Page.h" +#include "ResourceError.h" #include "ResourceLoader.h" #include "ResourceLoaderIdentifier.h" #include "StorageArea.h" -@@ -78,6 +80,7 @@ class DOMWrapperWorld; - class Document; +@@ -76,6 +78,7 @@ class Document; class DocumentLoader; + class DocumentThreadableLoader; class EventListener; +class HTMLInputElement; class HTTPHeaderMap; class InspectorTimelineAgent; class InstrumentingAgents; -@@ -197,6 +200,7 @@ public: +@@ -199,6 +202,7 @@ public: static void didRecalculateStyle(Document&); static void didScheduleStyleRecalculation(Document&); static void applyUserAgentOverride(LocalFrame&, String&); @@ -3064,7 +2940,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static void applyEmulatedMedia(LocalFrame&, AtomString&); static void flexibleBoxRendererBeganLayout(const RenderObject&); -@@ -209,6 +213,7 @@ public: +@@ -211,6 +215,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&); @@ -3072,7 +2948,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static void willSendRequest(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, ResourceRequest&); static void didReceiveResourceResponse(ServiceWorkerGlobalScope&, ResourceLoaderIdentifier, const ResourceResponse&); -@@ -235,13 +240,13 @@ public: +@@ -237,11 +242,11 @@ public: static void frameDetachedFromParent(LocalFrame&); static void didCommitLoad(LocalFrame&, DocumentLoader*); static void frameDocumentUpdated(LocalFrame&); @@ -3080,9 +2956,6 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static void frameStartedLoading(LocalFrame&); static void frameStoppedLoading(LocalFrame&); static void didCompleteRenderingFrame(Frame&); -- static void frameScheduledNavigation(Frame&, Seconds delay); -+ static void frameScheduledNavigation(Frame&, Seconds delay, bool targetIsCurrentFrame); - static void frameClearedScheduledNavigation(Frame&); static void accessibilitySettingsDidChange(Page&); + static void didNavigateWithinPage(LocalFrame&); #if ENABLE(DARK_MODE_CSS) @@ -3094,7 +2967,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static void interceptResponse(const LocalFrame&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); + static void setStoppingLoadingDueToProcessSwap(Page*, bool); - static void addMessageToConsole(Page&, std::unique_ptr); + static void addMessageToConsole(LocalFrame&, std::unique_ptr); static void addMessageToConsole(WorkerOrWorkletGlobalScope&, std::unique_ptr); @@ -277,6 +283,7 @@ public: static void stopProfiling(WorkerOrWorkletGlobalScope&, const String& title); @@ -3142,7 +3015,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&); static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&); static void scriptImportedImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const String& sourceString); -@@ -451,13 +468,13 @@ private: +@@ -451,11 +468,11 @@ private: static void frameDetachedFromParentImpl(InstrumentingAgents&, LocalFrame&); static void didCommitLoadImpl(InstrumentingAgents&, LocalFrame&, DocumentLoader*); static void frameDocumentUpdatedImpl(InstrumentingAgents&, LocalFrame&); @@ -3150,15 +3023,12 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static void frameStartedLoadingImpl(InstrumentingAgents&, LocalFrame&); static void didCompleteRenderingFrameImpl(InstrumentingAgents&); static void frameStoppedLoadingImpl(InstrumentingAgents&, LocalFrame&); -- static void frameScheduledNavigationImpl(InstrumentingAgents&, Frame&, Seconds delay); -+ static void frameScheduledNavigationImpl(InstrumentingAgents&, Frame&, Seconds delay, bool targetIsCurrentFrame); - static void frameClearedScheduledNavigationImpl(InstrumentingAgents&, Frame&); static void accessibilitySettingsDidChangeImpl(InstrumentingAgents&); + static void didNavigateWithinPageImpl(InstrumentingAgents&, LocalFrame&); #if ENABLE(DARK_MODE_CSS) static void defaultAppearanceDidChangeImpl(InstrumentingAgents&); #endif -@@ -468,6 +485,7 @@ private: +@@ -466,6 +483,7 @@ private: static bool shouldInterceptResponseImpl(InstrumentingAgents&, const ResourceResponse&); static void interceptRequestImpl(InstrumentingAgents&, ResourceLoader&, Function&&); static void interceptResponseImpl(InstrumentingAgents&, const ResourceResponse&, ResourceLoaderIdentifier, CompletionHandler)>&&); @@ -3166,7 +3036,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr); -@@ -482,6 +500,7 @@ private: +@@ -480,6 +498,7 @@ private: static void stopProfilingImpl(InstrumentingAgents&, const String& title); static void consoleStartRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options); static void consoleStopRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&); @@ -3174,7 +3044,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static void performanceMarkImpl(InstrumentingAgents&, const String& label, std::optional); -@@ -535,6 +554,12 @@ private: +@@ -533,6 +552,12 @@ private: static void layerTreeDidChangeImpl(InstrumentingAgents&); static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&); @@ -3187,7 +3057,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 static InstrumentingAgents& instrumentingAgents(Page&); static InstrumentingAgents& instrumentingAgents(WorkerOrWorkletGlobalScope&); static InstrumentingAgents& instrumentingAgents(ServiceWorkerGlobalScope&); -@@ -1094,6 +1119,13 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame, +@@ -1093,6 +1118,13 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame, applyUserAgentOverrideImpl(*agents, userAgent); } @@ -3201,7 +3071,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 inline void InspectorInstrumentation::applyEmulatedMedia(LocalFrame& frame, AtomString& media) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1196,6 +1228,13 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& g +@@ -1195,6 +1227,13 @@ inline void InspectorInstrumentation::didFailLoading(ServiceWorkerGlobalScope& g didFailLoadingImpl(instrumentingAgents(globalScope), identifier, nullptr, error); } @@ -3215,7 +3085,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(LocalFrame& frame, ResourceLoaderIdentifier identifier, DocumentLoader& loader, const ResourceResponse& response) { // Treat the same as didReceiveResponse. -@@ -1286,13 +1325,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame) +@@ -1285,13 +1324,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame) frameDocumentUpdatedImpl(*agents, frame); } @@ -3229,21 +3099,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 inline void InspectorInstrumentation::frameStartedLoading(LocalFrame& frame) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1314,11 +1346,11 @@ inline void InspectorInstrumentation::frameStoppedLoading(LocalFrame& frame) - frameStoppedLoadingImpl(*agents, frame); - } - --inline void InspectorInstrumentation::frameScheduledNavigation(Frame& frame, Seconds delay) -+inline void InspectorInstrumentation::frameScheduledNavigation(Frame& frame, Seconds delay, bool targetIsCurrentFrame) - { - FAST_RETURN_IF_NO_FRONTENDS(void()); - if (auto* agents = instrumentingAgents(frame)) -- frameScheduledNavigationImpl(*agents, frame, delay); -+ frameScheduledNavigationImpl(*agents, frame, delay, targetIsCurrentFrame); - } - - inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& frame) -@@ -1334,6 +1366,13 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page) +@@ -1319,6 +1351,13 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page) accessibilitySettingsDidChangeImpl(instrumentingAgents(page)); } @@ -3257,7 +3113,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 #if ENABLE(DARK_MODE_CSS) inline void InspectorInstrumentation::defaultAppearanceDidChange(Page& page) { -@@ -1386,6 +1425,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame, +@@ -1371,6 +1410,13 @@ inline void InspectorInstrumentation::interceptResponse(const LocalFrame& frame, interceptResponseImpl(*agents, response, identifier, WTFMove(handler)); } @@ -3271,7 +3127,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 inline void InspectorInstrumentation::didDispatchDOMStorageEvent(Page& page, const String& key, const String& oldValue, const String& newValue, StorageType storageType, const SecurityOrigin& securityOrigin) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1726,6 +1772,11 @@ inline void InspectorInstrumentation::performanceMark(ScriptExecutionContext& co +@@ -1710,6 +1756,11 @@ inline void InspectorInstrumentation::performanceMark(ScriptExecutionContext& co performanceMarkImpl(*agents, label, WTFMove(startTime)); } @@ -3283,7 +3139,7 @@ index ed15dcc0dd1eb8d22dc48d8c6515b2258db574c5..c297c2d0e61b8ca1f881bb7942c46362 inline void InspectorInstrumentation::didRequestAnimationFrame(ScriptExecutionContext& scriptExecutionContext, int callbackId) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1782,6 +1833,42 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren +@@ -1766,6 +1817,42 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren renderLayerDestroyedImpl(*agents, renderLayer); } @@ -3341,7 +3197,7 @@ index a67a1244fa526ad5759068e97e0d220f59565d6e..0048589109fccb9472fe35a410337771 + } // namespace WebCore diff --git a/Source/WebCore/inspector/InspectorInstrumentationWebKit.h b/Source/WebCore/inspector/InspectorInstrumentationWebKit.h -index c028341e84e59a6b1b16107fd74feb21f70b12ab..d385418ac34e8f315f201801a2c65226c8f6fee2 100644 +index b8a1585c14a753344d5b52b316511d2efb2d2bfe..910b98291328cd90109beeeb66e9ecf22e124a89 100644 --- a/Source/WebCore/inspector/InspectorInstrumentationWebKit.h +++ b/Source/WebCore/inspector/InspectorInstrumentationWebKit.h @@ -33,6 +33,7 @@ @@ -3379,10 +3235,10 @@ index c028341e84e59a6b1b16107fd74feb21f70b12ab..d385418ac34e8f315f201801a2c65226 + } diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp -index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a93705e1a0 100644 +index e138241c41a6b0c1e238fd6f3a531b20b9c99624..b24364ad05988a8230af80b9e60874b18123ce70 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp -@@ -54,6 +54,7 @@ +@@ -55,6 +55,7 @@ #include "Cookie.h" #include "CookieJar.h" #include "CustomElementRegistry.h" @@ -3390,7 +3246,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 #include "DOMEditor.h" #include "DOMException.h" #include "DOMPatchSupport.h" -@@ -65,9 +66,14 @@ +@@ -66,9 +67,14 @@ #include "Event.h" #include "EventListener.h" #include "EventNames.h" @@ -3405,7 +3261,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 #include "HTMLMediaElement.h" #include "HTMLNames.h" #include "HTMLScriptElement.h" -@@ -102,12 +108,14 @@ +@@ -104,12 +110,14 @@ #include "Pasteboard.h" #include "PseudoElement.h" #include "RenderGrid.h" @@ -3420,9 +3276,9 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 #include "StaticNodeList.h" #include "StyleProperties.h" #include "StyleResolver.h" -@@ -149,7 +157,8 @@ using namespace HTMLNames; +@@ -151,7 +159,8 @@ using namespace HTMLNames; static const size_t maxTextSize = 10000; - static const UChar horizontalEllipsisUChar[] = { horizontalEllipsis, 0 }; + static const char16_t horizontalEllipsisUChar[] = { horizontalEllipsis, 0 }; -static std::optional parseColor(RefPtr&& colorObject) +// static @@ -3430,7 +3286,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 { if (!colorObject) return std::nullopt; -@@ -168,7 +177,7 @@ static std::optional parseColor(RefPtr&& colorObject) +@@ -170,7 +179,7 @@ static std::optional parseColor(RefPtr&& colorObject) static std::optional parseRequiredConfigColor(const String& fieldName, JSON::Object& configObject) { @@ -3439,7 +3295,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 } static Color parseOptionalConfigColor(const String& fieldName, JSON::Object& configObject) -@@ -195,6 +204,20 @@ static bool parseQuad(Ref&& quadArray, FloatQuad* quad) +@@ -197,6 +206,20 @@ static bool parseQuad(Ref&& quadArray, FloatQuad* quad) return true; } @@ -3460,7 +3316,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 class RevalidateStyleAttributeTask final : public CanMakeCheckedPtr { WTF_MAKE_TZONE_ALLOCATED(RevalidateStyleAttributeTask); WTF_OVERRIDE_DELETE_FOR_CHECKED_PTR(RevalidateStyleAttributeTask); -@@ -475,6 +498,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin +@@ -477,6 +500,20 @@ Node* InspectorDOMAgent::assertNode(Inspector::Protocol::ErrorString& errorStrin return node.get(); } @@ -3481,7 +3337,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 Document* InspectorDOMAgent::assertDocument(Inspector::Protocol::ErrorString& errorString, Inspector::Protocol::DOM::NodeId nodeId) { RefPtr node = assertNode(errorString, nodeId); -@@ -1593,16 +1630,7 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::o +@@ -1595,16 +1632,7 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::o Inspector::Protocol::ErrorStringOr InspectorDOMAgent::highlightNode(std::optional&& nodeId, const Inspector::Protocol::Runtime::RemoteObjectId& objectId, Ref&& highlightInspectorObject, RefPtr&& gridOverlayInspectorObject, RefPtr&& flexOverlayInspectorObject, std::optional&& showRulers) { Inspector::Protocol::ErrorString errorString; @@ -3499,7 +3355,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 if (!node) return makeUnexpected(errorString); -@@ -1857,15 +1885,159 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setInspectedNode(Ins +@@ -1859,15 +1887,159 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setInspectedNode(Ins return { }; } @@ -3662,7 +3518,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 if (!object) return makeUnexpected("Missing injected script for given nodeId"_s); -@@ -3131,7 +3303,7 @@ Inspector::Protocol::ErrorStringOr InspectorDO +@@ -3133,7 +3305,7 @@ Inspector::Protocol::ErrorStringOr InspectorDO return makeUnexpected("Missing node for given path"_s); } @@ -3671,7 +3527,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 { Document* document = &node->document(); if (auto* templateHost = document->templateDocumentHost()) -@@ -3140,12 +3312,18 @@ RefPtr InspectorDOMAgent::resolveNod +@@ -3142,12 +3314,18 @@ RefPtr InspectorDOMAgent::resolveNod if (!frame) return nullptr; @@ -3693,7 +3549,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 } Node* InspectorDOMAgent::scriptValueAsNode(JSC::JSValue value) -@@ -3291,4 +3469,53 @@ Inspector::Protocol::ErrorStringOr> In +@@ -3295,4 +3473,53 @@ Inspector::Protocol::ErrorStringOr> In #endif } @@ -3748,7 +3604,7 @@ index 08bdd6e6cd5295f4be4df37c3e3e830b03916dc7..078ef814e006a45c4b83ff1c2ff341a9 + } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.h b/Source/WebCore/inspector/agents/InspectorDOMAgent.h -index 185ba93a265317bf876cc5fedd5f3d5cf3a8757e..664fc4f47f0540e5b84d96ba4c6a530d44aacf25 100644 +index cd5edd3322a55e72643560ad852af14f7104f35b..25c3d3c73c3b9395323b4c853a70d5502c15ae52 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.h +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.h @@ -59,6 +59,7 @@ namespace WebCore { @@ -3821,7 +3677,7 @@ index 185ba93a265317bf876cc5fedd5f3d5cf3a8757e..664fc4f47f0540e5b84d96ba4c6a530d void discardBindings(); diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp -index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f334334e8ac86 100644 +index ccedbcac06dec7ae5ddfec6f682092c9869c330d..e2dc52d5a6cbada4f5a44d9bb5b7612885e24b47 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp @@ -58,6 +58,7 @@ @@ -3843,7 +3699,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 } if (resourceLoader) { -@@ -398,6 +399,8 @@ RefPtr InspectorNetworkAgent::buildObjec +@@ -397,6 +398,8 @@ RefPtr InspectorNetworkAgent::buildObjec .setSource(responseSource(response.source())) .release(); @@ -3852,7 +3708,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 if (resourceLoader) { auto* metrics = response.deprecatedNetworkLoadMetricsOrNull(); responseObject->setTiming(buildObjectForTiming(metrics ? *metrics : NetworkLoadMetrics::emptyMetrics(), *resourceLoader)); -@@ -684,6 +687,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier, +@@ -683,6 +686,9 @@ void InspectorNetworkAgent::didFailLoading(ResourceLoaderIdentifier identifier, String requestId = IdentifiersFactory::requestId(identifier.toUInt64()); if (loader && m_resourcesData->resourceType(requestId) == InspectorPageAgent::DocumentResource) { @@ -3862,7 +3718,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 auto* frame = loader->frame(); if (frame && frame->loader().documentLoader() && frame->document()) { m_resourcesData->addResourceSharedBuffer(requestId, -@@ -913,6 +919,7 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::disable() +@@ -912,6 +918,7 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::disable() m_instrumentingAgents.setEnabledNetworkAgent(nullptr); m_resourcesData->clear(); m_extraRequestHeaders.clear(); @@ -3870,7 +3726,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 continuePendingRequests(); continuePendingResponses(); -@@ -958,6 +965,7 @@ void InspectorNetworkAgent::continuePendingResponses() +@@ -957,6 +964,7 @@ void InspectorNetworkAgent::continuePendingResponses() Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setExtraHTTPHeaders(Ref&& headers) { @@ -3878,7 +3734,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 for (auto& entry : headers.get()) { auto stringValue = entry.value->asString(); if (!!stringValue) -@@ -1207,6 +1215,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response, +@@ -1206,6 +1214,11 @@ void InspectorNetworkAgent::interceptResponse(const ResourceResponse& response, m_frontendDispatcher->responseIntercepted(requestId, resourceResponse.releaseNonNull()); } @@ -3890,7 +3746,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptContinue(const Inspector::Protocol::Network::RequestId& requestId, Inspector::Protocol::Network::NetworkStage networkStage) { switch (networkStage) { -@@ -1236,6 +1249,9 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptWithReq +@@ -1235,6 +1248,9 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptWithReq return makeUnexpected("Missing pending intercept request for given requestId"_s); auto& loader = *pendingRequest->m_loader; @@ -3900,7 +3756,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 ResourceRequest request = loader.request(); if (!!url) request.setURL(URL({ }, url)); -@@ -1331,13 +1347,22 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptRequest +@@ -1330,13 +1346,22 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::interceptRequest response.setHTTPStatusCode(status); response.setHTTPStatusText(String { statusText }); HTTPHeaderMap explicitHeaders; @@ -3924,7 +3780,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 loader->didReceiveResponse(WTFMove(response), [loader, buffer = data.releaseNonNull()]() { if (loader->reachedTerminalState()) return; -@@ -1401,6 +1426,12 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setEmulatedCondi +@@ -1400,6 +1425,12 @@ Inspector::Protocol::ErrorStringOr InspectorNetworkAgent::setEmulatedCondi #endif // ENABLE(INSPECTOR_NETWORK_THROTTLING) @@ -3938,7 +3794,7 @@ index dfb469de2c5dcaa39b03ef6c188eda34d869401c..4d1fb3b02d63c8b425b50b92c25f3343 { return startsWithLettersIgnoringASCIICase(mimeType, "text/"_s) diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h -index 66da07b880259dd1388703cb6c8c7b10d63c32d7..ff00bc16dd84f34056fe0b36896c0049d8fa9a49 100644 +index 7ae1b53be8a9b5f0d0e2787a22f5534500b7ab19..f6f33d05bcdb4084f55631fdcfd3b4d012dfc804 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h @@ -35,6 +35,8 @@ @@ -3975,13 +3831,14 @@ index 66da07b880259dd1388703cb6c8c7b10d63c32d7..ff00bc16dd84f34056fe0b36896c0049 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp -index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e19a9056d 100644 +index 7ee1926dd2f20af854d33095dcd7431fa24c2db9..a40c4ae43f849229b4ca65f33823ff70df0d7f81 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp -@@ -32,19 +32,27 @@ +@@ -32,20 +32,29 @@ #include "config.h" #include "InspectorPageAgent.h" ++#include "AccessibilityObjectInlines.h" +#include "AXCoreObject.h" +#include "AXObjectCache.h" +#include "BackForwardController.h" @@ -3995,6 +3852,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e #include "DocumentLoader.h" +#include "Editor.h" #include "ElementInlines.h" + #include "EventTargetInlines.h" +#include "FocusController.h" #include "ForcedAccessibilityValue.h" #include "FrameLoadRequest.h" @@ -4005,8 +3863,8 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e +#include "HTMLInputElement.h" #include "HTMLNames.h" #include "ImageBuffer.h" - #include "InspectorClient.h" -@@ -57,24 +65,38 @@ + #include "InspectorBackendClient.h" +@@ -58,24 +67,38 @@ #include "MIMETypeRegistry.h" #include "MemoryCache.h" #include "Page.h" @@ -4045,7 +3903,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e #include #if ENABLE(APPLICATION_MANIFEST) -@@ -96,6 +118,11 @@ using namespace Inspector; +@@ -97,6 +120,11 @@ using namespace Inspector; WTF_MAKE_TZONE_ALLOCATED_IMPL(InspectorPageAgent); @@ -4057,7 +3915,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e static bool decodeBuffer(std::span buffer, const String& textEncodingName, String* result) { if (buffer.data()) { -@@ -348,6 +375,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien +@@ -350,6 +378,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorBacke , m_frontendDispatcher(makeUniqueRef(context.frontendRouter)) , m_backendDispatcher(Inspector::PageBackendDispatcher::create(context.backendDispatcher, this)) , m_inspectedPage(context.inspectedPage) @@ -4065,7 +3923,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e , m_client(client) , m_overlay(overlay) { -@@ -377,12 +405,20 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::enable() +@@ -379,12 +408,20 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::enable() defaultUserPreferencesDidChange(); @@ -4086,7 +3944,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e setShowPaintRects(false); #if !PLATFORM(IOS_FAMILY) -@@ -435,6 +471,22 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::reload(std::optiona +@@ -437,6 +474,22 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::reload(std::optiona return { }; } @@ -4109,7 +3967,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e Inspector::Protocol::ErrorStringOr InspectorPageAgent::navigate(const String& url) { RefPtr localMainFrame = m_inspectedPage->localMainFrame(); -@@ -461,6 +513,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(c +@@ -463,6 +516,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(c return { }; } @@ -4123,7 +3981,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Inspector::Protocol::Page::Setting setting, std::optional&& value) { auto& inspectedPageSettings = m_inspectedPage->settings(); -@@ -474,6 +533,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -476,6 +536,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setAuthorAndUserStylesEnabledInspectorOverride(value); return { }; @@ -4136,8 +3994,8 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e case Inspector::Protocol::Page::Setting::ICECandidateFilteringEnabled: inspectedPageSettings.setICECandidateFilteringEnabledInspectorOverride(value); return { }; -@@ -500,6 +565,39 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins - m_client->setDeveloperPreferenceOverride(InspectorClient::DeveloperPreference::NeedsSiteSpecificQuirks, value); +@@ -502,6 +568,39 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins + m_client->setDeveloperPreferenceOverride(InspectorBackendClient::DeveloperPreference::NeedsSiteSpecificQuirks, value); return { }; +#if ENABLE(NOTIFICATIONS) @@ -4176,7 +4034,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e case Inspector::Protocol::Page::Setting::ScriptEnabled: inspectedPageSettings.setScriptEnabledInspectorOverride(value); return { }; -@@ -512,6 +610,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins +@@ -514,6 +613,12 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Ins inspectedPageSettings.setShowRepaintCounterInspectorOverride(value); return { }; @@ -4189,7 +4047,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e case Inspector::Protocol::Page::Setting::WebSecurityEnabled: inspectedPageSettings.setWebSecurityEnabledInspectorOverride(value); return { }; -@@ -920,15 +1024,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(b +@@ -922,15 +1027,16 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(b return { }; } @@ -4211,7 +4069,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e } void InspectorPageAgent::frameNavigated(LocalFrame& frame) -@@ -936,13 +1041,29 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) +@@ -938,13 +1044,29 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame)); } @@ -4244,7 +4102,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e } Frame* InspectorPageAgent::frameForId(const Inspector::Protocol::Network::FrameId& frameId) -@@ -954,20 +1075,21 @@ String InspectorPageAgent::frameId(Frame* frame) +@@ -956,20 +1078,21 @@ String InspectorPageAgent::frameId(Frame* frame) { if (!frame) return emptyString(); @@ -4274,31 +4132,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e } LocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& errorString, const Inspector::Protocol::Network::FrameId& frameId) -@@ -978,11 +1100,6 @@ LocalFrame* InspectorPageAgent::assertFrame(Inspector::Protocol::ErrorString& er - return frame; - } - --void InspectorPageAgent::loaderDetachedFromFrame(DocumentLoader& loader) --{ -- m_loaderToIdentifier.remove(&loader); --} -- - void InspectorPageAgent::frameStartedLoading(LocalFrame& frame) - { - m_frontendDispatcher->frameStartedLoading(frameId(&frame)); -@@ -993,9 +1110,9 @@ void InspectorPageAgent::frameStoppedLoading(LocalFrame& frame) - m_frontendDispatcher->frameStoppedLoading(frameId(&frame)); - } - --void InspectorPageAgent::frameScheduledNavigation(Frame& frame, Seconds delay) -+void InspectorPageAgent::frameScheduledNavigation(Frame& frame, Seconds delay, bool targetIsCurrentFrame) - { -- m_frontendDispatcher->frameScheduledNavigation(frameId(&frame), delay.value()); -+ m_frontendDispatcher->frameScheduledNavigation(frameId(&frame), delay.value(), targetIsCurrentFrame); - } - - void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame) -@@ -1042,6 +1159,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() +@@ -1024,6 +1147,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() m_frontendDispatcher->defaultUserPreferencesDidChange(WTFMove(defaultUserPreferences)); } @@ -4311,7 +4145,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e #if ENABLE(DARK_MODE_CSS) void InspectorPageAgent::defaultAppearanceDidChange() { -@@ -1055,6 +1178,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp +@@ -1037,6 +1166,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp return; if (m_bootstrapScript.isEmpty()) @@ -4321,7 +4155,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e return; frame.script().evaluateIgnoringException(ScriptSourceCode(m_bootstrapScript, JSC::SourceTaintedOrigin::Untainted, URL { "web-inspector://bootstrap.js"_str })); -@@ -1102,6 +1228,51 @@ void InspectorPageAgent::didRecalculateStyle() +@@ -1084,6 +1216,51 @@ void InspectorPageAgent::didRecalculateStyle() protectedOverlay()->update(); } @@ -4373,7 +4207,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e Ref InspectorPageAgent::buildObjectForFrame(LocalFrame* frame) { ASSERT_ARG(frame, frame); -@@ -1195,6 +1366,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) +@@ -1177,6 +1354,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) userAgent = m_userAgentOverride; } @@ -4386,14 +4220,14 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e void InspectorPageAgent::applyEmulatedMedia(AtomString& media) { if (!m_emulatedMedia.isEmpty()) -@@ -1222,11 +1399,13 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Insp +@@ -1204,11 +1387,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 { { }, ImageBufferPixelFormat::BGRA8, DestinationColorSpace::SRGB() }; + SnapshotOptions options { { }, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }; if (coordinateSystem == Inspector::Protocol::Page::CoordinateSystem::Viewport) options.flags.add(SnapshotFlags::InViewCoordinates); + if (omitDeviceScaleFactor.has_value() && *omitDeviceScaleFactor) @@ -4401,7 +4235,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e IntRect rectangle(x, y, width, height); RefPtr localMainFrame = m_inspectedPage->localMainFrame(); -@@ -1240,6 +1419,43 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int +@@ -1222,6 +1407,43 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int return snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); } @@ -4445,7 +4279,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e #if ENABLE(WEB_ARCHIVE) && USE(CF) Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() { -@@ -1256,7 +1472,6 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() +@@ -1238,7 +1460,6 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::archive() } #endif @@ -4453,7 +4287,7 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverride(std::optional&& width, std::optional&& height) { if (width.has_value() != height.has_value()) -@@ -1274,6 +1489,496 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverri +@@ -1256,6 +1477,500 @@ Inspector::Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverri localMainFrame->setOverrideScreenSize(FloatSize(width.value_or(0), height.value_or(0))); return { }; } @@ -4556,6 +4390,8 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e + return "Footnote"_s; + case AccessibilityRole::Form: + return "Form"_s; ++ case AccessibilityRole::FrameHost: ++ return "FrameHost"_s; + case AccessibilityRole::Generic: + return "Generic"_s; + case AccessibilityRole::GraphicsDocument: @@ -4618,6 +4454,8 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e + return "ListItem"_s; + case AccessibilityRole::ListMarker: + return "ListMarker"_s; ++ case AccessibilityRole::LocalFrame: ++ return "LocalFrame"_s; + case AccessibilityRole::Mark: + return "Mark"_s; + case AccessibilityRole::MathElement: @@ -4952,21 +4790,10 @@ index 7ec43a15440452915980d0eca565f25b8c6880e9..868a6279fd57ddc3f880eeef18d0559e } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h -index 169a3023f68227a6ab6538dc6b1271882154deb9..b300be1ff6f278a79601613f76266c06c5ac92a8 100644 +index 194a97b59c553830963e72fd4a2ff4f796e0a065..256b1377b89024b5c2bcbb91615e5e62ed28a3dc 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.h +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h -@@ -32,8 +32,10 @@ - #pragma once - - #include "CachedResource.h" -+#include "FrameIdentifier.h" - #include "InspectorWebAgentBase.h" - #include "LayoutRect.h" -+#include "ProcessIdentifier.h" - #include - #include - #include -@@ -43,11 +45,16 @@ +@@ -44,11 +44,16 @@ #include #include @@ -4980,10 +4807,10 @@ index 169a3023f68227a6ab6538dc6b1271882154deb9..b300be1ff6f278a79601613f76266c06 class DocumentLoader; class Frame; +class HTMLInputElement; - class InspectorClient; + class InspectorBackendClient; class InspectorOverlay; class LocalFrame; -@@ -80,6 +87,8 @@ public: +@@ -81,6 +86,8 @@ public: OtherResource, }; @@ -4992,7 +4819,7 @@ index 169a3023f68227a6ab6538dc6b1271882154deb9..b300be1ff6f278a79601613f76266c06 static bool sharedBufferContent(RefPtr&&, const String& textEncodingName, bool withBase64Encode, String* result); static Vector cachedResourcesForFrame(LocalFrame*); static void resourceContent(Inspector::Protocol::ErrorString&, LocalFrame*, const URL&, String* result, bool* base64Encoded); -@@ -100,8 +109,11 @@ public: +@@ -101,8 +108,11 @@ public: Inspector::Protocol::ErrorStringOr enable(); Inspector::Protocol::ErrorStringOr disable(); Inspector::Protocol::ErrorStringOr reload(std::optional&& ignoreCache, std::optional&& revalidateAllResources); @@ -5004,7 +4831,7 @@ index 169a3023f68227a6ab6538dc6b1271882154deb9..b300be1ff6f278a79601613f76266c06 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(); -@@ -117,45 +129,65 @@ public: +@@ -118,41 +128,62 @@ public: #endif Inspector::Protocol::ErrorStringOr setShowPaintRects(bool); Inspector::Protocol::ErrorStringOr setEmulatedMedia(const String&); @@ -5037,12 +4864,7 @@ index 169a3023f68227a6ab6538dc6b1271882154deb9..b300be1ff6f278a79601613f76266c06 + void loadEventFired(LocalFrame&); void frameNavigated(LocalFrame&); void frameDetached(LocalFrame&); -- void loaderDetachedFromFrame(DocumentLoader&); - void frameStartedLoading(LocalFrame&); - void frameStoppedLoading(LocalFrame&); -- void frameScheduledNavigation(Frame&, Seconds delay); -+ void frameScheduledNavigation(Frame&, Seconds delay, bool targetIsCurrentFrame); - void frameClearedScheduledNavigation(Frame&); + void loaderDetachedFromFrame(DocumentLoader&); void accessibilitySettingsDidChange(); void defaultUserPreferencesDidChange(); + void didNavigateWithinPage(LocalFrame&); @@ -5077,12 +4899,12 @@ index 169a3023f68227a6ab6538dc6b1271882154deb9..b300be1ff6f278a79601613f76266c06 Ref protectedOverlay() const; -@@ -173,17 +205,22 @@ private: +@@ -170,17 +201,22 @@ private: const Ref m_backendDispatcher; WeakRef m_inspectedPage; + Inspector::InjectedScriptManager& m_injectedScriptManager; - InspectorClient* m_client { nullptr }; + InspectorBackendClient* m_client { nullptr }; WeakRef m_overlay; - WeakHashMap m_frameToIdentifier; @@ -5102,20 +4924,20 @@ index 169a3023f68227a6ab6538dc6b1271882154deb9..b300be1ff6f278a79601613f76266c06 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp -index 2f591841f3db6618a2936802d5e4e9604cd25963..639bf063a684a361e71b04c7a17c4dfc2541513a 100644 +index 157249fd95354782e13a63e860757383c0aaf51d..f0220b54eeb035f926013c9e6405bfe6774e10ff 100644 --- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp +++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp -@@ -34,6 +34,7 @@ - +@@ -35,6 +35,7 @@ #include "DOMWrapperWorld.h" #include "Document.h" + #include "FrameConsoleClient.h" +#include "FrameLoader.h" #include "InspectorPageAgent.h" #include "InstrumentingAgents.h" #include "JSDOMWindowCustom.h" @@ -42,6 +43,7 @@ + #include "LocalFrame.h" #include "Page.h" - #include "PageConsoleClient.h" #include "ScriptController.h" +#include "ScriptSourceCode.h" #include "SecurityOrigin.h" @@ -5268,7 +5090,7 @@ index 6544b61b15956b218e97814b0ceb7250809f8ed3..c6657031bcd27573533a34be62e0ea0d } // namespace WebCore diff --git a/Source/WebCore/loader/CookieJar.h b/Source/WebCore/loader/CookieJar.h -index 5dbca10d65d0426d90c743b789e18c3786025817..56b1aa222343649be7c28e104e6ae1dde598e59f 100644 +index ed8bec9c10c9d1bf659efab09f77ad7d8e439594..49bdaf8b08d157ecb7cd412ea847eb8ceedb8adf 100644 --- a/Source/WebCore/loader/CookieJar.h +++ b/Source/WebCore/loader/CookieJar.h @@ -48,6 +48,7 @@ class NetworkStorageSession; @@ -5290,10 +5112,10 @@ index 5dbca10d65d0426d90c743b789e18c3786025817..56b1aa222343649be7c28e104e6ae1dd protected: static SameSiteInfo sameSiteInfo(const Document&, IsForDOMCookieAccess = IsForDOMCookieAccess::No); diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp -index c63569ec7dbb402d261f16a5b5febdf428cfe749..b5cff81dcf8fbcc5a0a8cb6f05857f4382b090be 100644 +index 9d47b5803f10fb3484d9a1f82d65e728f2b26500..3aa64308c20835f4e69a80344bfe93814f1f1099 100644 --- a/Source/WebCore/loader/DocumentLoader.cpp +++ b/Source/WebCore/loader/DocumentLoader.cpp -@@ -775,8 +775,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc +@@ -753,8 +753,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc if (!didReceiveRedirectResponse) return completionHandler(WTFMove(newRequest)); @@ -5304,7 +5126,7 @@ index c63569ec7dbb402d261f16a5b5febdf428cfe749..b5cff81dcf8fbcc5a0a8cb6f05857f43 switch (navigationPolicyDecision) { case NavigationPolicyDecision::IgnoreLoad: case NavigationPolicyDecision::LoadWillContinueInAnotherProcess: -@@ -1592,11 +1594,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo +@@ -1532,11 +1534,17 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWillCo if (auto navigationID = std::exchange(m_navigationID, { })) frame->loader().client().documentLoaderDetached(*navigationID, loadWillContinueInAnotherProcess); @@ -5325,10 +5147,10 @@ index c63569ec7dbb402d261f16a5b5febdf428cfe749..b5cff81dcf8fbcc5a0a8cb6f05857f43 { m_navigationID = navigationID; diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h -index 061494ea45af99d0516cf16af3f11c25a180e970..eff67613ea81446d7f53ecf2e66d5b428b4c6bab 100644 +index f64c002d4e2fe48eb38058ae52fd8939a6bab31b..e6f6679d6a40cfa9cacc3a8e3fd629a774283551 100644 --- a/Source/WebCore/loader/DocumentLoader.h +++ b/Source/WebCore/loader/DocumentLoader.h -@@ -220,6 +220,8 @@ public: +@@ -221,6 +221,8 @@ public: WEBCORE_EXPORT virtual void detachFromFrame(LoadWillContinueInAnotherProcess); @@ -5338,10 +5160,10 @@ index 061494ea45af99d0516cf16af3f11c25a180e970..eff67613ea81446d7f53ecf2e66d5b42 WEBCORE_EXPORT RefPtr protectedFrameLoader() const; WEBCORE_EXPORT SubresourceLoader* mainResourceLoader() const; diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp -index 1263d20c197bc21cb5a4098a07493943fd2830e4..fbcfaa000c4095c9ba9257dfb2229424229ee670 100644 +index 65040a4e2fa0def1672638668e298eab3228c3f8..65faf6687413a223828be10d55f3c8f8c1789739 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp -@@ -1332,6 +1332,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat +@@ -1335,6 +1335,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat } m_client->dispatchDidNavigateWithinPage(); @@ -5349,7 +5171,7 @@ index 1263d20c197bc21cb5a4098a07493943fd2830e4..fbcfaa000c4095c9ba9257dfb2229424 document->statePopped(stateObject ? stateObject.releaseNonNull() : SerializedScriptValue::nullValue()); m_client->dispatchDidPopStateWithinPage(); -@@ -1874,6 +1875,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1879,6 +1880,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t const String& httpMethod = loader->request().httpMethod(); if (shouldPerformFragmentNavigation(isFormSubmission, httpMethod, policyChecker().loadType(), newURL)) { @@ -5357,7 +5179,7 @@ index 1263d20c197bc21cb5a4098a07493943fd2830e4..fbcfaa000c4095c9ba9257dfb2229424 RefPtr oldDocumentLoader = m_documentLoader; NavigationAction action { frame->protectedDocument().releaseNonNull(), loader->request(), InitiatedByMainFrame::Unknown, loader->isRequestFromClientOrUserInput(), policyChecker().loadType(), isFormSubmission }; -@@ -1912,7 +1914,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1917,7 +1919,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t auto policyDecisionMode = loader->triggeringAction().isFromNavigationAPI() ? PolicyDecisionMode::Synchronous : PolicyDecisionMode::Asynchronous; RELEASE_ASSERT(!isBackForwardLoadType(policyChecker().loadType()) || history().provisionalItem()); @@ -5367,7 +5189,7 @@ index 1263d20c197bc21cb5a4098a07493943fd2830e4..fbcfaa000c4095c9ba9257dfb2229424 continueLoadAfterNavigationPolicy(request, RefPtr { weakFormState.get() }.get(), navigationPolicyDecision, allowNavigationToInvalidURL); completionHandler(); }, policyDecisionMode); -@@ -3238,10 +3242,15 @@ String FrameLoader::userAgent(const URL& url) const +@@ -3255,10 +3259,15 @@ String FrameLoader::userAgent(const URL& url) const String FrameLoader::navigatorPlatform() const { @@ -5385,7 +5207,7 @@ index 1263d20c197bc21cb5a4098a07493943fd2830e4..fbcfaa000c4095c9ba9257dfb2229424 } void FrameLoader::dispatchOnloadEvents() -@@ -3702,6 +3711,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill +@@ -3719,6 +3728,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error, LoadWill checkCompleted(); if (frame->page()) checkLoadComplete(loadWillContinueInAnotherProcess); @@ -5394,7 +5216,7 @@ index 1263d20c197bc21cb5a4098a07493943fd2830e4..fbcfaa000c4095c9ba9257dfb2229424 } void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, const SecurityOrigin* requesterOrigin, bool shouldContinue, NavigationHistoryBehavior historyHandling) -@@ -4591,9 +4602,6 @@ String FrameLoader::referrer() const +@@ -4668,9 +4679,6 @@ String FrameLoader::referrer() const void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() { @@ -5404,7 +5226,7 @@ index 1263d20c197bc21cb5a4098a07493943fd2830e4..fbcfaa000c4095c9ba9257dfb2229424 Vector> worlds; ScriptController::getAllWorlds(worlds); for (auto& world : worlds) -@@ -4603,13 +4611,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() +@@ -4680,13 +4688,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world) { Ref frame = m_frame.get(); @@ -5425,10 +5247,10 @@ index 1263d20c197bc21cb5a4098a07493943fd2830e4..fbcfaa000c4095c9ba9257dfb2229424 InspectorInstrumentation::didClearWindowObjectInWorld(frame, world); } diff --git a/Source/WebCore/loader/LoaderStrategy.h b/Source/WebCore/loader/LoaderStrategy.h -index a33d00c3ce3a861f8746e58b01ea51e5777cb2ea..9cf20e3c47c7a0bb9db72b9385431cc3df48df86 100644 +index 2ab5e8426274fcf96f6ea97ca816a4e166876ed1..291f5a495d4f3af67a766d7f51e18e4e9c399cc5 100644 --- a/Source/WebCore/loader/LoaderStrategy.h +++ b/Source/WebCore/loader/LoaderStrategy.h -@@ -86,6 +86,7 @@ public: +@@ -89,6 +89,7 @@ public: virtual bool isOnLine() const = 0; virtual void addOnlineStateChangeListener(Function&&) = 0; @@ -5436,21 +5258,8 @@ index a33d00c3ce3a861f8746e58b01ea51e5777cb2ea..9cf20e3c47c7a0bb9db72b9385431cc3 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 350f729ee5dc95ba3dd7018542db1dbfb00b382e..f8d31dfc86c0cbc10b474e1773ddbf682b3c9b66 100644 ---- a/Source/WebCore/loader/NavigationScheduler.cpp -+++ b/Source/WebCore/loader/NavigationScheduler.cpp -@@ -803,7 +803,7 @@ void NavigationScheduler::startTimer() - - Seconds delay = 1_s * m_redirect->delay(); - m_timer.startOneShot(delay); -- InspectorInstrumentation::frameScheduledNavigation(frame, delay); -+ InspectorInstrumentation::frameScheduledNavigation(frame, delay, m_redirect->targetIsCurrentFrame()); - m_redirect->didStartTimer(frame, m_timer); // m_redirect may be null on return (e.g. the client canceled the load) - } - diff --git a/Source/WebCore/loader/ProgressTracker.cpp b/Source/WebCore/loader/ProgressTracker.cpp -index 1832114445abe51041c241f40df9731d6e0a2f8d..3213517c4cd0b235ff12c098e34389987e6ea090 100644 +index 48105098fe5559ba6a668df6e10391b70327c9c6..b8ee8e094a9b8f383379f364e586cdaa6315af67 100644 --- a/Source/WebCore/loader/ProgressTracker.cpp +++ b/Source/WebCore/loader/ProgressTracker.cpp @@ -163,6 +163,8 @@ void ProgressTracker::progressCompleted(LocalFrame& frame) @@ -5472,10 +5281,10 @@ index 1832114445abe51041c241f40df9731d6e0a2f8d..3213517c4cd0b235ff12c098e3438998 } diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -index b78b91913be6fd14efc7621e251bb5adab05c315..b7f3252e4f201c2c44bca48997f20a3205301486 100644 +index 6d78143371282d29ade0ae86f54bdec1e495cb39..a6cdf8022abd836425c1224cac5602bc92ef7235 100644 --- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp +++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -@@ -1180,8 +1180,11 @@ ResourceErrorOr> CachedResourceLoader::requ +@@ -1121,8 +1121,11 @@ ResourceErrorOr> CachedResourceLoader::requ request.updateReferrerPolicy(document ? document->referrerPolicy() : ReferrerPolicy::Default); @@ -5489,7 +5298,7 @@ index b78b91913be6fd14efc7621e251bb5adab05c315..b7f3252e4f201c2c44bca48997f20a32 if (RefPtr documentLoader = m_documentLoader.get()) { bool madeHTTPS { request.resourceRequest().wasSchemeOptimisticallyUpgraded() }; -@@ -1816,8 +1819,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const +@@ -1758,8 +1761,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const ResourceErrorOr> CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequest&& request) { @@ -5502,10 +5311,10 @@ index b78b91913be6fd14efc7621e251bb5adab05c315..b7f3252e4f201c2c44bca48997f20a32 RefPtr document = m_document.get(); ASSERT(document); diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h -index 7f6d70366b7841b4e5215a3b8709554fe995ba64..342de0c124714355bd5beaea78310500a9c184b7 100644 +index 29f97b1ce6fe791d79f7e0551ff28177bb777843..4ccd94a3bc1c6f0eec47a32297d16b6eaf85173f 100644 --- a/Source/WebCore/page/ChromeClient.h +++ b/Source/WebCore/page/ChromeClient.h -@@ -379,7 +379,7 @@ public: +@@ -366,7 +366,7 @@ public: #endif #if ENABLE(ORIENTATION_EVENTS) @@ -5515,10 +5324,10 @@ index 7f6d70366b7841b4e5215a3b8709554fe995ba64..342de0c124714355bd5beaea78310500 virtual RefPtr createColorChooser(ColorChooserClient&, const Color&) = 0; diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp -index d501516df133e721bc2dcf580b4dd1533b3368f3..63fac9ac1a69d522ed733dae33945ca6b685e4e4 100644 +index f4b2f2a8fa6fe7928cf264c2bd75bccc3ebce4f7..1d31e44020610fc76ed0bc8d1765b6942f54458e 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp -@@ -4515,6 +4515,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr +@@ -4721,6 +4721,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr if (!document) return false; @@ -5531,7 +5340,7 @@ index d501516df133e721bc2dcf580b4dd1533b3368f3..63fac9ac1a69d522ed733dae33945ca6 dragState().dataTransfer = DataTransfer::createForDrag(*document); auto hasNonDefaultPasteboardData = HasNonDefaultPasteboardData::No; -@@ -5119,6 +5125,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint& +@@ -5325,6 +5331,7 @@ static HitTestResult hitTestResultInFrame(LocalFrame* frame, const LayoutPoint& return result; } @@ -5539,7 +5348,7 @@ index d501516df133e721bc2dcf580b4dd1533b3368f3..63fac9ac1a69d522ed733dae33945ca6 Expected EventHandler::handleTouchEvent(const PlatformTouchEvent& event) { Ref frame = m_frame.get(); -@@ -5192,7 +5199,7 @@ Expected EventHandler::handleTouchEvent(co +@@ -5398,7 +5405,7 @@ Expected EventHandler::handleTouchEvent(co // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap. unsigned touchPointTargetKey = point.id() + 1; @@ -5548,7 +5357,7 @@ index d501516df133e721bc2dcf580b4dd1533b3368f3..63fac9ac1a69d522ed733dae33945ca6 bool pointerCancelled = false; #endif RefPtr touchTarget; -@@ -5239,7 +5246,7 @@ Expected EventHandler::handleTouchEvent(co +@@ -5445,7 +5452,7 @@ Expected EventHandler::handleTouchEvent(co // we also remove it from the map. touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey); @@ -5557,7 +5366,7 @@ index d501516df133e721bc2dcf580b4dd1533b3368f3..63fac9ac1a69d522ed733dae33945ca6 HitTestResult result = hitTestResultAtPoint(pagePoint, hitType | HitTestRequest::Type::AllowChildFrameContent); pointerTarget = result.targetElement(); pointerCancelled = (pointerTarget != touchTarget); -@@ -5262,7 +5269,7 @@ Expected EventHandler::handleTouchEvent(co +@@ -5468,7 +5475,7 @@ Expected EventHandler::handleTouchEvent(co if (!targetFrame) continue; @@ -5566,7 +5375,7 @@ index d501516df133e721bc2dcf580b4dd1533b3368f3..63fac9ac1a69d522ed733dae33945ca6 // FIXME: WPE currently does not send touch stationary events, so create a naive TouchReleased PlatformTouchPoint // on release if the hit test result changed since the previous TouchPressed or TouchMoved if (pointState == PlatformTouchPoint::TouchReleased && pointerCancelled) { -@@ -5352,6 +5359,7 @@ Expected EventHandler::handleTouchEvent(co +@@ -5555,6 +5562,7 @@ Expected EventHandler::handleTouchEvent(co return swallowedEvent; } @@ -5575,10 +5384,10 @@ index d501516df133e721bc2dcf580b4dd1533b3368f3..63fac9ac1a69d522ed733dae33945ca6 #if ENABLE(TOUCH_EVENTS) diff --git a/Source/WebCore/page/FocusController.cpp b/Source/WebCore/page/FocusController.cpp -index 79636a0a8528bfd4e86d8373f9ab7e96e9ac8346..f2a2ebeb6a7e41a3900d35dabde88f9fd7c4ae82 100644 +index 22583fed98df02646b25410c9d6528005350f37f..7222c97da3878e77960f47aac6f747a06157f059 100644 --- a/Source/WebCore/page/FocusController.cpp +++ b/Source/WebCore/page/FocusController.cpp -@@ -595,13 +595,14 @@ bool FocusController::relinquishFocusToChrome(FocusDirection direction) +@@ -617,13 +617,14 @@ bool FocusController::relinquishFocusToChrome(FocusDirection direction) return false; Ref page = m_page.get(); @@ -5595,11 +5404,40 @@ index 79636a0a8528bfd4e86d8373f9ab7e96e9ac8346..f2a2ebeb6a7e41a3900d35dabde88f9f return true; } +diff --git a/Source/WebCore/page/FrameConsoleClient.cpp b/Source/WebCore/page/FrameConsoleClient.cpp +index ec1ebf9ce1d2501bc8fb39772a9cbc24d562fac5..de5d867d6cea82ebf36385da5792a46367c4b1e6 100644 +--- a/Source/WebCore/page/FrameConsoleClient.cpp ++++ b/Source/WebCore/page/FrameConsoleClient.cpp +@@ -476,4 +476,12 @@ void FrameConsoleClient::screenshot(JSC::JSGlobalObject* lexicalGlobalObject, Re + addMessage(makeUnique(MessageSource::ConsoleAPI, MessageType::Image, MessageLevel::Log, dataURL, WTFMove(arguments), lexicalGlobalObject, 0, timestamp)); + } + ++void FrameConsoleClient::bindingCalled(JSC::JSGlobalObject* globalObject, const String& name, const String& arg) ++{ ++ RefPtr frame = m_frame.get(); ++ if (!frame) ++ return; ++ InspectorInstrumentation::bindingCalled(*frame->page(), globalObject, name, arg); ++} ++ + } // namespace WebCore +diff --git a/Source/WebCore/page/FrameConsoleClient.h b/Source/WebCore/page/FrameConsoleClient.h +index 66c57501b719d3c58ab8d6f780d9e7e7b5df3745..0e31080ca92bf2095d592cbccb1838cf4a00d6ca 100644 +--- a/Source/WebCore/page/FrameConsoleClient.h ++++ b/Source/WebCore/page/FrameConsoleClient.h +@@ -92,6 +92,7 @@ private: + void record(JSC::JSGlobalObject*, Ref&&) override; + void recordEnd(JSC::JSGlobalObject*, Ref&&) override; + void screenshot(JSC::JSGlobalObject*, Ref&&) override; ++ void bindingCalled(JSC::JSGlobalObject*, const String& name, const String& arg) override; + + WeakRef m_frame; + }; diff --git a/Source/WebCore/page/FrameSnapshotting.cpp b/Source/WebCore/page/FrameSnapshotting.cpp -index 3474800864049dcbe6c84746c4216e72a68fa48f..8f5d536921eeb41c77fe689c036dcb77e625e431 100644 +index c0f0a17079be7a5574c40fdbbdeeedd3a45ef078..b6480851049f40e9f64926dda0407bb4d3be97e7 100644 --- a/Source/WebCore/page/FrameSnapshotting.cpp +++ b/Source/WebCore/page/FrameSnapshotting.cpp -@@ -115,7 +115,7 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -120,7 +120,7 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& // Other paint behaviors are set by paintContentsForSnapshot. frame.view()->setPaintBehavior(paintBehavior); @@ -5608,7 +5446,7 @@ index 3474800864049dcbe6c84746c4216e72a68fa48f..8f5d536921eeb41c77fe689c036dcb77 if (options.flags.contains(SnapshotFlags::PaintWith3xBaseScale)) scaleFactor = 3; -@@ -134,6 +134,8 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -139,6 +139,8 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& return nullptr; buffer->context().translate(-imageRect.location()); @@ -5617,7 +5455,7 @@ index 3474800864049dcbe6c84746c4216e72a68fa48f..8f5d536921eeb41c77fe689c036dcb77 if (!clipRects.isEmpty()) { Path clipPath; -@@ -142,7 +144,10 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& +@@ -147,7 +149,10 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& buffer->context().clipPath(clipPath); } @@ -5630,19 +5468,19 @@ index 3474800864049dcbe6c84746c4216e72a68fa48f..8f5d536921eeb41c77fe689c036dcb77 } diff --git a/Source/WebCore/page/FrameSnapshotting.h b/Source/WebCore/page/FrameSnapshotting.h -index fd9df9d9564fe29c64342fbf77082ad595612e90..af5687c79e2a5be20cde653107e5827c1d8981e5 100644 +index 4935bfd9a6e43d59a101c153fa89a8484fcb49e2..8384f5b5db8e405f86e1201d144d92d76a1a5ebd 100644 --- a/Source/WebCore/page/FrameSnapshotting.h +++ b/Source/WebCore/page/FrameSnapshotting.h -@@ -58,6 +58,7 @@ enum class SnapshotFlags : uint16_t { - PaintWith3xBaseScale = 1 << 10, +@@ -59,6 +59,7 @@ enum class SnapshotFlags : uint16_t { ExcludeText = 1 << 11, FixedAndStickyLayersOnly = 1 << 12, -+ OmitDeviceScaleFactor = 1 << 13, + DraggableElement = 1 << 13, ++ OmitDeviceScaleFactor = 1 << 14, }; struct SnapshotOptions { diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp -index f2dfb5966f445ee52b4430e65e0accb7e41bb913..1d25db7e91beaaea3c083f315ec3f21b317f271f 100644 +index 221c0273606e72f0b8c36e822a0115d3cd1e0add..a674c72ea49aefae98affd84331539f8a03a0049 100644 --- a/Source/WebCore/page/History.cpp +++ b/Source/WebCore/page/History.cpp @@ -32,6 +32,7 @@ @@ -5653,7 +5491,7 @@ index f2dfb5966f445ee52b4430e65e0accb7e41bb913..1d25db7e91beaaea3c083f315ec3f21b #include "LocalFrame.h" #include "LocalFrameLoaderClient.h" #include "Logging.h" -@@ -309,6 +310,8 @@ ExceptionOr History::stateObjectAdded(RefPtr&& data +@@ -310,6 +311,8 @@ ExceptionOr History::stateObjectAdded(RefPtr&& data } frame->loader().updateURLAndHistory(fullURL, WTFMove(data), historyBehavior); @@ -5663,7 +5501,7 @@ index f2dfb5966f445ee52b4430e65e0accb7e41bb913..1d25db7e91beaaea3c083f315ec3f21b } diff --git a/Source/WebCore/page/LocalFrame.cpp b/Source/WebCore/page/LocalFrame.cpp -index 018a1445506e0b3cae8b7d4056f37bcdd21eb1dd..a1cd251e84d2faa8b58b5ebbf5077bacb1e5bf6e 100644 +index 225fa07a08763d986141eb5cc2fb3f8dd4c5598d..c99e75c04355479d97ace4f1e2c14955f585a2d1 100644 --- a/Source/WebCore/page/LocalFrame.cpp +++ b/Source/WebCore/page/LocalFrame.cpp @@ -42,6 +42,7 @@ @@ -5674,7 +5512,7 @@ index 018a1445506e0b3cae8b7d4056f37bcdd21eb1dd..a1cd251e84d2faa8b58b5ebbf5077bac #include "DiagnosticLoggingClient.h" #include "DiagnosticLoggingKeys.h" #include "DocumentLoader.h" -@@ -60,6 +61,7 @@ +@@ -62,6 +63,7 @@ #include "FrameSelection.h" #include "GraphicsContext.h" #include "GraphicsLayer.h" @@ -5682,7 +5520,7 @@ index 018a1445506e0b3cae8b7d4056f37bcdd21eb1dd..a1cd251e84d2faa8b58b5ebbf5077bac #include "HTMLAttachmentElement.h" #include "HTMLFormControlElement.h" #include "HTMLFormElement.h" -@@ -82,6 +84,7 @@ +@@ -84,6 +86,7 @@ #include "Logging.h" #include "Navigator.h" #include "NodeList.h" @@ -5690,7 +5528,7 @@ index 018a1445506e0b3cae8b7d4056f37bcdd21eb1dd..a1cd251e84d2faa8b58b5ebbf5077bac #include "NodeTraversal.h" #include "Page.h" #include "PaymentSession.h" -@@ -217,6 +220,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifie +@@ -216,6 +219,7 @@ LocalFrame::LocalFrame(Page& page, ClientCreator&& clientCreator, FrameIdentifie void LocalFrame::init() { @@ -5707,8 +5545,8 @@ index 018a1445506e0b3cae8b7d4056f37bcdd21eb1dd..a1cd251e84d2faa8b58b5ebbf5077bac return 0; } #endif // ENABLE(ORIENTATION_EVENTS) -@@ -1599,6 +1603,364 @@ RefPtr LocalFrame::frameDocumentSecurityOrigin() const - return nullptr; +@@ -1647,6 +1651,364 @@ Ref LocalFrame::protectedInspectorController() + return m_inspectorController.get(); } +#if !PLATFORM(IOS_FAMILY) @@ -6073,18 +5911,18 @@ index 018a1445506e0b3cae8b7d4056f37bcdd21eb1dd..a1cd251e84d2faa8b58b5ebbf5077bac #undef FRAME_RELEASE_LOG_ERROR diff --git a/Source/WebCore/page/LocalFrame.h b/Source/WebCore/page/LocalFrame.h -index 92a21d8efb29d588a7a530e823079ad299cbd40a..3a925cc017500b37abee9d2d26662f9eccc2eebc 100644 +index f58a04b7d8d985e05cffa434f4ed4e12f7d80698..730c98188deeabc4c2da3e06ffcff4c1ae6db95e 100644 --- a/Source/WebCore/page/LocalFrame.h +++ b/Source/WebCore/page/LocalFrame.h @@ -29,6 +29,7 @@ - #include "DOMPasteAccess.h" - #include "Frame.h" -+#include "IntDegrees.h" - #include "ScrollbarMode.h" + #include + #include ++#include + #include #include #include -@@ -122,8 +123,8 @@ enum { +@@ -125,8 +126,8 @@ enum { }; enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll }; @@ -6094,7 +5932,7 @@ index 92a21d8efb29d588a7a530e823079ad299cbd40a..3a925cc017500b37abee9d2d26662f9e class LocalFrame final : public Frame { public: -@@ -229,10 +230,6 @@ public: +@@ -235,10 +236,6 @@ public: WEBCORE_EXPORT DataDetectionResultsStorage& dataDetectionResults(); #endif @@ -6105,7 +5943,7 @@ index 92a21d8efb29d588a7a530e823079ad299cbd40a..3a925cc017500b37abee9d2d26662f9e 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); -@@ -240,6 +237,10 @@ public: +@@ -246,6 +243,10 @@ public: WEBCORE_EXPORT Node* nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation); WEBCORE_EXPORT Node* approximateNodeAtViewportLocationLegacy(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation); @@ -6116,7 +5954,7 @@ index 92a21d8efb29d588a7a530e823079ad299cbd40a..3a925cc017500b37abee9d2d26662f9e WEBCORE_EXPORT NSArray *wordsInCurrentParagraph() const; WEBCORE_EXPORT CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const; -@@ -307,6 +308,7 @@ public: +@@ -313,6 +314,7 @@ public: WEBCORE_EXPORT FloatSize screenSize() const; void setOverrideScreenSize(FloatSize&&); @@ -6124,7 +5962,7 @@ index 92a21d8efb29d588a7a530e823079ad299cbd40a..3a925cc017500b37abee9d2d26662f9e void selfOnlyRef(); void selfOnlyDeref(); -@@ -378,7 +380,6 @@ private: +@@ -393,7 +395,6 @@ private: #if ENABLE(DATA_DETECTION) std::unique_ptr m_dataDetectionResults; #endif @@ -6132,7 +5970,7 @@ index 92a21d8efb29d588a7a530e823079ad299cbd40a..3a925cc017500b37abee9d2d26662f9e 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); -@@ -386,6 +387,7 @@ private: +@@ -401,6 +402,7 @@ private: enum class ShouldFindRootEditableElement : bool { No, Yes }; Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, const NodeQualifier&, ShouldApproximate, ShouldFindRootEditableElement = ShouldFindRootEditableElement::Yes); @@ -6140,11 +5978,28 @@ index 92a21d8efb29d588a7a530e823079ad299cbd40a..3a925cc017500b37abee9d2d26662f9e void setTimersPausedInternal(bool); const UniqueRef m_viewportArguments; +diff --git a/Source/WebCore/page/Navigation.cpp b/Source/WebCore/page/Navigation.cpp +index bcff12eb045a53365d90988679d4c4740f3489da..3a7800b80d16a8c0479a619e61ead5ff21e17b84 100644 +--- a/Source/WebCore/page/Navigation.cpp ++++ b/Source/WebCore/page/Navigation.cpp +@@ -161,8 +161,10 @@ void Navigation::initializeForNewWindow(std::optional + + m_currentEntryIndex = getEntryIndexOfHistoryItem(m_entries, *currentItem); + +- ASSERT(navigationType); +- m_activation = NavigationActivation::create(*navigationType, *currentEntry(), WTFMove(previousEntry)); ++ if (m_currentEntryIndex) { ++ ASSERT(navigationType); ++ m_activation = NavigationActivation::create(*navigationType, *currentEntry(), WTFMove(previousEntry)); ++ } + + return; + } diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp -index 6b60173931046a6361e7f0d388c6663166236dfe..fe3175f67a82a3328e1a3c1bc74521daa792dedc 100644 +index 6f2b8ef8748bcf5a9a3f4abd30df2a2a8703f34b..78dc7bd99ffa49b43ce0a8009011af681c9bc556 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp -@@ -667,6 +667,45 @@ void Page::setOverrideViewportArguments(const std::optional& +@@ -676,6 +676,45 @@ void Page::setOverrideViewportArguments(const std::optional& localTopDocument->updateViewportArguments(); } @@ -6190,7 +6045,7 @@ index 6b60173931046a6361e7f0d388c6663166236dfe..fe3175f67a82a3328e1a3c1bc74521da ScrollingCoordinator* Page::scrollingCoordinator() { if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) { -@@ -4292,6 +4331,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) +@@ -4379,6 +4418,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) appearanceDidChange(); } @@ -6218,10 +6073,10 @@ index 6b60173931046a6361e7f0d388c6663166236dfe..fe3175f67a82a3328e1a3c1bc74521da { if (insets == m_fullscreenInsets) diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h -index cd29ee00f3499c50379f02981fe85e7bdd950d93..10b653145543c308afd3ed1497f622d7adf08e9d 100644 +index 4d3d400560b95af2f632f36597a0628d58911445..102f5efc2e43d668d703c0941d0cb7687c3b2d44 100644 --- a/Source/WebCore/page/Page.h +++ b/Source/WebCore/page/Page.h -@@ -391,6 +391,9 @@ public: +@@ -407,6 +407,9 @@ public: const ViewportArguments* overrideViewportArguments() const { return m_overrideViewportArguments.get(); } WEBCORE_EXPORT void setOverrideViewportArguments(const std::optional&); @@ -6231,7 +6086,7 @@ index cd29ee00f3499c50379f02981fe85e7bdd950d93..10b653145543c308afd3ed1497f622d7 static void refreshPlugins(bool reload); WEBCORE_EXPORT PluginData& pluginData(); WEBCORE_EXPORT Ref protectedPluginData(); -@@ -488,6 +491,10 @@ public: +@@ -506,6 +509,10 @@ public: #if ENABLE(DRAG_SUPPORT) DragController& dragController() { return m_dragController.get(); } const DragController& dragController() const { return m_dragController.get(); } @@ -6242,7 +6097,7 @@ index cd29ee00f3499c50379f02981fe85e7bdd950d93..10b653145543c308afd3ed1497f622d7 #endif FocusController& focusController() const { return m_focusController; } #if ENABLE(CONTEXT_MENUS) -@@ -671,6 +678,10 @@ public: +@@ -696,6 +703,10 @@ public: WEBCORE_EXPORT void setUseColorAppearance(bool useDarkAppearance, bool useElevatedUserInterfaceLevel); bool defaultUseDarkAppearance() const { return m_useDarkAppearance; } void setUseDarkAppearanceOverride(std::optional); @@ -6253,7 +6108,7 @@ index cd29ee00f3499c50379f02981fe85e7bdd950d93..10b653145543c308afd3ed1497f622d7 #if ENABLE(TEXT_AUTOSIZING) float textAutosizingWidth() const { return m_textAutosizingWidth; } -@@ -1148,6 +1159,11 @@ public: +@@ -1168,6 +1179,11 @@ public: WEBCORE_EXPORT void setInteractionRegionsEnabled(bool); #endif @@ -6265,7 +6120,7 @@ index cd29ee00f3499c50379f02981fe85e7bdd950d93..10b653145543c308afd3ed1497f622d7 #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY) DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); } #endif -@@ -1437,6 +1453,9 @@ private: +@@ -1479,6 +1495,9 @@ private: #if ENABLE(DRAG_SUPPORT) const UniqueRef m_dragController; @@ -6275,7 +6130,7 @@ index cd29ee00f3499c50379f02981fe85e7bdd950d93..10b653145543c308afd3ed1497f622d7 #endif const UniqueRef m_focusController; #if ENABLE(CONTEXT_MENUS) -@@ -1515,6 +1534,8 @@ private: +@@ -1557,6 +1576,8 @@ private: bool m_useElevatedUserInterfaceLevel { false }; bool m_useDarkAppearance { false }; std::optional m_useDarkAppearanceOverride; @@ -6284,7 +6139,7 @@ index cd29ee00f3499c50379f02981fe85e7bdd950d93..10b653145543c308afd3ed1497f622d7 #if ENABLE(TEXT_AUTOSIZING) float m_textAutosizingWidth { 0 }; -@@ -1696,6 +1717,11 @@ private: +@@ -1735,6 +1756,11 @@ private: #endif std::unique_ptr m_overrideViewportArguments; @@ -6296,34 +6151,8 @@ index cd29ee00f3499c50379f02981fe85e7bdd950d93..10b653145543c308afd3ed1497f622d7 #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 e3f5517e30956f17aea53324fc3c5ce11238254c..278ddea00b98d979797e1e82a5cb3f97239b63bc 100644 ---- a/Source/WebCore/page/PageConsoleClient.cpp -+++ b/Source/WebCore/page/PageConsoleClient.cpp -@@ -456,4 +456,9 @@ Ref PageConsoleClient::protectedPage() const - return m_page.get(); - } - -+void PageConsoleClient::bindingCalled(JSC::JSGlobalObject* globalObject, const String& name, const String& arg) -+{ -+ InspectorInstrumentation::bindingCalled(m_page, globalObject, name, arg); -+} -+ - } // namespace WebCore -diff --git a/Source/WebCore/page/PageConsoleClient.h b/Source/WebCore/page/PageConsoleClient.h -index 153fc36199f26adbfb61cbef6744ffe31a68b951..cc667e06700013fd5e994467e19536d2e4cab189 100644 ---- a/Source/WebCore/page/PageConsoleClient.h -+++ b/Source/WebCore/page/PageConsoleClient.h -@@ -86,6 +86,7 @@ private: - void record(JSC::JSGlobalObject*, Ref&&) override; - void recordEnd(JSC::JSGlobalObject*, Ref&&) override; - void screenshot(JSC::JSGlobalObject*, Ref&&) override; -+ void bindingCalled(JSC::JSGlobalObject*, const String& name, const String& arg) override; - - Ref protectedPage() const; - diff --git a/Source/WebCore/page/PointerCaptureController.cpp b/Source/WebCore/page/PointerCaptureController.cpp -index f01c803f6afa4e2949378bc9a758af4a55681dc5..9d35c28b4ff837f4333ac50bc917513bbf2b5773 100644 +index a4644c7a7a7f5bd55701972c4a8e716b82bde08f..5a0b18b5c842db0cfe63fd42ec402c27782ac5a0 100644 --- a/Source/WebCore/page/PointerCaptureController.cpp +++ b/Source/WebCore/page/PointerCaptureController.cpp @@ -207,7 +207,7 @@ bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(Poi @@ -6345,19 +6174,19 @@ index f01c803f6afa4e2949378bc9a758af4a55681dc5..9d35c28b4ff837f4333ac50bc917513b #endif diff --git a/Source/WebCore/page/PointerCaptureController.h b/Source/WebCore/page/PointerCaptureController.h -index 2c3ae18820bd2be191dbd8d6bd513c0302a1f580..21538527135e659493ee812aa61c943ae37c0b74 100644 +index f893be35388e1fb933e369e616ebd6f4e55900a3..937be6100c16a1625f99f02efe2d6d14df1465a0 100644 --- a/Source/WebCore/page/PointerCaptureController.h +++ b/Source/WebCore/page/PointerCaptureController.h -@@ -60,7 +60,7 @@ public: +@@ -63,7 +63,7 @@ public: RefPtr pointerEventForMouseEvent(const MouseEvent&, PointerID, const String& pointerType); -#if ENABLE(TOUCH_EVENTS) && (PLATFORM(IOS_FAMILY) || PLATFORM(WPE)) +#if ENABLE(TOUCH_EVENTS) - void dispatchEventForTouchAtIndex(EventTarget&, const PlatformTouchEvent&, unsigned, bool isPrimary, WindowProxy&, const IntPoint&); + void dispatchEventForTouchAtIndex(EventTarget&, const PlatformTouchEvent&, unsigned, bool isPrimary, WindowProxy&, const DoublePoint&); #endif -@@ -81,12 +81,12 @@ private: +@@ -84,12 +84,12 @@ private: WeakPtr activeDocument; RefPtr pendingTargetOverride; RefPtr targetOverride; @@ -6373,10 +6202,10 @@ index 2c3ae18820bd2be191dbd8d6bd513c0302a1f580..21538527135e659493ee812aa61c943a #endif ; diff --git a/Source/WebCore/page/Screen.cpp b/Source/WebCore/page/Screen.cpp -index c45965ee6b7fe6c066871b87d7883e639a849adb..16c3a5b027222d1de5bb540c71c0b6aa107c4657 100644 +index cb7069099b5983761e38f7474e0a2a9dbdd8e127..eeef89846d28005372412f46ea04c7e087d978a6 100644 --- a/Source/WebCore/page/Screen.cpp +++ b/Source/WebCore/page/Screen.cpp -@@ -124,6 +124,9 @@ int Screen::availLeft() const +@@ -125,6 +125,9 @@ int Screen::availLeft() const if (shouldApplyScreenFingerprintingProtections(*frame)) return 0; @@ -6386,7 +6215,7 @@ index c45965ee6b7fe6c066871b87d7883e639a849adb..16c3a5b027222d1de5bb540c71c0b6aa return static_cast(screenAvailableRect(frame->protectedView().get()).x()); } -@@ -139,6 +142,9 @@ int Screen::availTop() const +@@ -140,6 +143,9 @@ int Screen::availTop() const if (shouldApplyScreenFingerprintingProtections(*frame)) return 0; @@ -6396,7 +6225,7 @@ index c45965ee6b7fe6c066871b87d7883e639a849adb..16c3a5b027222d1de5bb540c71c0b6aa return static_cast(screenAvailableRect(frame->protectedView().get()).y()); } -@@ -154,6 +160,9 @@ int Screen::availHeight() const +@@ -155,6 +161,9 @@ int Screen::availHeight() const if (shouldApplyScreenFingerprintingProtections(*frame)) return static_cast(frame->screenSize().height()); @@ -6406,7 +6235,7 @@ index c45965ee6b7fe6c066871b87d7883e639a849adb..16c3a5b027222d1de5bb540c71c0b6aa return static_cast(screenAvailableRect(frame->protectedView().get()).height()); } -@@ -169,6 +178,9 @@ int Screen::availWidth() const +@@ -170,6 +179,9 @@ int Screen::availWidth() const if (shouldApplyScreenFingerprintingProtections(*frame)) return static_cast(frame->screenSize().width()); @@ -6417,10 +6246,10 @@ index c45965ee6b7fe6c066871b87d7883e639a849adb..16c3a5b027222d1de5bb540c71c0b6aa } diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -index 5ba13e25cbe12ea5c7e543a3e9377f662cbfe50e..b5ab59f41db851cb03a56c9dfaf76e47182f8e85 100644 +index 4def6177eda669ebf2a48537afc25ed564e19108..b2cdbe97821585bc32fa4a6238c63552628445bd 100644 --- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp +++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -@@ -374,6 +374,8 @@ template +@@ -353,6 +353,8 @@ template bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, Predicate&& predicate, Args&&... args) const requires (!std::is_convertible_v) { @@ -6429,7 +6258,7 @@ index 5ba13e25cbe12ea5c7e543a3e9377f662cbfe50e..b5ab59f41db851cb03a56c9dfaf76e47 bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; for (auto& policy : m_policies) { if (policy->isReportOnly() != isReportOnly) -@@ -387,6 +389,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit +@@ -366,6 +368,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit template bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, ViolatedDirectiveCallback&& callback, Predicate&& predicate, Args&&... args) const { @@ -6438,7 +6267,7 @@ index 5ba13e25cbe12ea5c7e543a3e9377f662cbfe50e..b5ab59f41db851cb03a56c9dfaf76e47 bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; bool isAllowed = true; for (auto& policy : m_policies) { -@@ -403,6 +407,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit +@@ -382,6 +386,8 @@ bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposit template bool ContentSecurityPolicy::allPoliciesAllow(NOESCAPE const ViolatedDirectiveCallback& callback, Predicate&& predicate, Args&&... args) const { @@ -6449,10 +6278,10 @@ index 5ba13e25cbe12ea5c7e543a3e9377f662cbfe50e..b5ab59f41db851cb03a56c9dfaf76e47 if (const ContentSecurityPolicyDirective* violatedDirective = (policy.get()->*predicate)(std::forward(args)...)) { diff --git a/Source/WebCore/page/wpe/DragControllerWPE.cpp b/Source/WebCore/page/wpe/DragControllerWPE.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..803239911006cfb3b03ea911c003f2d233f67600 +index 0000000000000000000000000000000000000000..7bea08826a16de4774a55c81ccba0d81f7d72472 --- /dev/null +++ b/Source/WebCore/page/wpe/DragControllerWPE.cpp -@@ -0,0 +1,80 @@ +@@ -0,0 +1,82 @@ +/* + * Copyright (C) 2007-20 Apple Inc. All rights reserved. + * @@ -6488,6 +6317,8 @@ index 0000000000000000000000000000000000000000..803239911006cfb3b03ea911c003f2d2 +#include "Element.h" +#include "Frame.h" +#include "FrameDestructionObserverInlines.h" ++#include "LocalFrameInlines.h" ++#include "NodeInlines.h" +#include "Pasteboard.h" +#include "markup.h" + @@ -6534,19 +6365,10 @@ index 0000000000000000000000000000000000000000..803239911006cfb3b03ea911c003f2d2 + +} diff --git a/Source/WebCore/platform/DragData.h b/Source/WebCore/platform/DragData.h -index f76eab27bd22db72e23cd53d98fe721f0d7e48b7..9757103efe88c0fed3b68671c3042faa29b31433 100644 +index c0dcbbb5f740871254f9bb1e0b56c638f2501cb1..5db61fd8ac5b1451e2bda863464c8e8251b68f64 100644 --- a/Source/WebCore/platform/DragData.h +++ b/Source/WebCore/platform/DragData.h -@@ -47,7 +47,7 @@ typedef void* DragDataRef; - - #elif PLATFORM(WIN) - typedef struct IDataObject* DragDataRef; --#elif PLATFORM(GTK) -+#elif PLATFORM(GTK) || PLATFORM(WPE) - namespace WebCore { - class SelectionData; - } -@@ -92,8 +92,8 @@ public: +@@ -93,8 +93,8 @@ public: // is initialized by the decoder and not in the constructor. DragData() = default; #if PLATFORM(WIN) @@ -6557,7 +6379,7 @@ index f76eab27bd22db72e23cd53d98fe721f0d7e48b7..9757103efe88c0fed3b68671c3042faa void getDragFileDescriptorData(int& size, String& pathname); void getDragFileContentData(int size, void* dataBlob); #endif -@@ -143,7 +143,7 @@ private: +@@ -144,7 +144,7 @@ private: String m_pasteboardName; #endif #if PLATFORM(WIN) @@ -6566,45 +6388,26 @@ index f76eab27bd22db72e23cd53d98fe721f0d7e48b7..9757103efe88c0fed3b68671c3042faa #endif bool m_disallowFileAccess { false }; }; +diff --git a/Source/WebCore/platform/GStreamer.cmake b/Source/WebCore/platform/GStreamer.cmake +index 86f926e951590926d149a75f6a5aa166ea40db19..1cee66e548af766d6ec872545ae3fa33aaf355f1 100644 +--- a/Source/WebCore/platform/GStreamer.cmake ++++ b/Source/WebCore/platform/GStreamer.cmake +@@ -1,6 +1,10 @@ + include(CheckCXXSymbolExists) + + if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO) ++ list(APPEND WebCore_LIBRARIES ++ GLib::GioUnix ++ ) ++ + list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES + "${WEBCORE_DIR}/Modules/mediastream/gstreamer" + "${WEBCORE_DIR}/platform/graphics/gstreamer" diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h -index f8de8815d483bd3ac684c018159c593798c0495a..e84ce8eec7424fbc3456623289588b1832d9fb7f 100644 +index 9c281b53044eb2f37ae814a772dd7f01a2b91e9f..05efee508f3ec4e91bf66c1142672d5fc574a81b 100644 --- a/Source/WebCore/platform/Pasteboard.h +++ b/Source/WebCore/platform/Pasteboard.h -@@ -46,7 +46,7 @@ OBJC_CLASS NSString; - OBJC_CLASS NSArray; - #endif - --#if PLATFORM(GTK) -+#if PLATFORM(GTK) || PLATFORM(WPE) - #include "SelectionData.h" - #endif - -@@ -200,6 +200,11 @@ public: - explicit Pasteboard(std::unique_ptr&&, const String& name); - #endif - -+#if PLATFORM(WPE) && ENABLE(DRAG_SUPPORT) -+ explicit Pasteboard(std::unique_ptr&&, SelectionData&); -+ explicit Pasteboard(std::unique_ptr&&, SelectionData&&); -+#endif -+ - #if PLATFORM(WIN) - explicit Pasteboard(std::unique_ptr&&, IDataObject*); - explicit Pasteboard(std::unique_ptr&&, WCDataObject*); -@@ -266,6 +271,12 @@ public: - static std::unique_ptr createForGlobalSelection(std::unique_ptr&&); - #endif - -+#if PLATFORM(WPE) -+ const SelectionData& selectionData() const { -+ return *m_selectionData; -+ } -+#endif -+ - #if PLATFORM(IOS_FAMILY) - explicit Pasteboard(std::unique_ptr&&, int64_t changeCount); - explicit Pasteboard(std::unique_ptr&&, const String& pasteboardName); -@@ -311,6 +322,7 @@ public: +@@ -313,6 +313,7 @@ public: COMPtr dataObject() const { return m_dataObject; } WEBCORE_EXPORT void setExternalDataObject(IDataObject*); const DragDataMap& dragDataMap() const { return m_dragDataMap; } @@ -6612,18 +6415,7 @@ index f8de8815d483bd3ac684c018159c593798c0495a..e84ce8eec7424fbc3456623289588b18 void writeURLToWritableDataObject(const URL&, const String&); COMPtr writableDataObject() const { return m_writableDataObject; } void writeImageToDataObject(Element&, const URL&); // FIXME: Layering violation. -@@ -366,6 +378,10 @@ private: - int64_t m_changeCount { 0 }; - #endif - -+#if PLATFORM(WPE) -+ std::optional m_selectionData; -+#endif -+ - #if PLATFORM(COCOA) - String m_pasteboardName; - int64_t m_changeCount; -@@ -381,6 +397,7 @@ private: +@@ -383,6 +384,7 @@ private: COMPtr m_dataObject; COMPtr m_writableDataObject; DragDataMap m_dragDataMap; @@ -6632,10 +6424,10 @@ index f8de8815d483bd3ac684c018159c593798c0495a..e84ce8eec7424fbc3456623289588b18 }; diff --git a/Source/WebCore/platform/PlatformKeyboardEvent.h b/Source/WebCore/platform/PlatformKeyboardEvent.h -index 241c4f1cc29a854e8329ba5227b7aaf0cca8138e..0a2a487dd91ddeec37fb996ecc6039fc70c4ba8d 100644 +index 6af0b4f643ec3edd83122637c4e2abdf002ff7ba..fe927a0d5a208ee01fb67e2df235e5b757f8b52c 100644 --- a/Source/WebCore/platform/PlatformKeyboardEvent.h +++ b/Source/WebCore/platform/PlatformKeyboardEvent.h -@@ -135,6 +135,7 @@ namespace WebCore { +@@ -139,6 +139,7 @@ namespace WebCore { static String keyCodeForHardwareKeyCode(unsigned); static String keyIdentifierForGdkKeyCode(unsigned); static int windowsKeyCodeForGdkKeyCode(unsigned); @@ -6643,7 +6435,7 @@ index 241c4f1cc29a854e8329ba5227b7aaf0cca8138e..0a2a487dd91ddeec37fb996ecc6039fc static String singleCharacterString(unsigned); #endif -@@ -143,6 +144,7 @@ namespace WebCore { +@@ -147,6 +148,7 @@ namespace WebCore { static String keyCodeForHardwareKeyCode(unsigned); static String keyIdentifierForWPEKeyCode(unsigned); static int windowsKeyCodeForWPEKeyCode(unsigned); @@ -6681,10 +6473,10 @@ index ef0abc9a93e878897ffc9d2497a3da0fca5b37b7..abd96c6d1a6c3ab9e0121c1e78f2f75a +} // namespace WebCore +#endif diff --git a/Source/WebCore/platform/PlatformScreen.h b/Source/WebCore/platform/PlatformScreen.h -index 26ca6a098bf39cff7e9a6505e84dbdbbd2aafc24..63d4fa7e39689a47269ae369bcf335642af6e669 100644 +index 4566e5537a36331a9b5bd75f7235f94d0d9d60d4..195cfe90a57fafb57dc6ff0cabd1fa15b984b979 100644 --- a/Source/WebCore/platform/PlatformScreen.h +++ b/Source/WebCore/platform/PlatformScreen.h -@@ -165,10 +165,14 @@ WEBCORE_EXPORT float screenScaleFactor(UIScreen * = nullptr); +@@ -164,10 +164,14 @@ WEBCORE_EXPORT float screenScaleFactor(UIScreen * = nullptr); #endif #if ENABLE(TOUCH_EVENTS) @@ -6715,10 +6507,10 @@ index 23f011953c66f401553bedfaef3485af215ae083..a73da2ebe47f0d8dc57f3d0159e8f299 // TouchCancelled touchPoints subsequently void setTouchPoints(Vector& touchPoints) { m_touchPoints = touchPoints; } diff --git a/Source/WebCore/platform/PlatformTouchPoint.h b/Source/WebCore/platform/PlatformTouchPoint.h -index 34715d27b529750fc866db87cd330b5184286771..3eefa218af075f76d98012cdeae7e4b344850116 100644 +index 1e04806dbf9cfb27dda3e5d2c3c61aa66efd8ae6..93aa8e77e9ddd315587cf2c93620874a8eaa91a8 100644 --- a/Source/WebCore/platform/PlatformTouchPoint.h +++ b/Source/WebCore/platform/PlatformTouchPoint.h -@@ -49,7 +49,7 @@ public: +@@ -47,7 +47,7 @@ public: { } @@ -6726,9 +6518,9 @@ index 34715d27b529750fc866db87cd330b5184286771..3eefa218af075f76d98012cdeae7e4b3 +#if !ENABLE(IOS_TOUCH_EVENTS) // 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) + PlatformTouchPoint(unsigned id, State state, DoublePoint screenPos, DoublePoint pos) diff --git a/Source/WebCore/platform/Skia.cmake b/Source/WebCore/platform/Skia.cmake -index c39b57e01190b833be46452c3d964fe243c216d3..6e4af1509037697421cf0c80e2459da0bad79ba8 100644 +index da490f391aa2e1876e792d66c08125e86e8a4719..eb8913849dd8934e4b2d60e9c18527ffc3d38264 100644 --- a/Source/WebCore/platform/Skia.cmake +++ b/Source/WebCore/platform/Skia.cmake @@ -14,6 +14,7 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS @@ -6740,10 +6532,10 @@ index c39b57e01190b833be46452c3d964fe243c216d3..6e4af1509037697421cf0c80e2459da0 platform/graphics/skia/SkiaHarfBuzzFontCache.h platform/graphics/skia/SkiaPaintingEngine.h diff --git a/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp b/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp -index 492c5e76290c2379cda40b9663f5f67ff8f66360..096752985edf39960eb4be6eb733ebe3713313cb 100644 +index 70667bd3d6ec5ace90c169df2783f1b8741de287..f81d431335e4e80321396edc81caaf55ecad1634 100644 --- a/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp +++ b/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp -@@ -46,7 +46,7 @@ +@@ -47,7 +47,7 @@ namespace WebCore { @@ -6753,10 +6545,10 @@ index 492c5e76290c2379cda40b9663f5f67ff8f66360..096752985edf39960eb4be6eb733ebe3 static const unsigned thumbBorderSize = 1; static const unsigned overlayThumbSize = 3; diff --git a/Source/WebCore/platform/graphics/ImageAdapter.h b/Source/WebCore/platform/graphics/ImageAdapter.h -index f5d16bcb2d300d6e54b90583a4e9489862a7dfd0..e9c945854a011e9ec1de96cc8dfbc08ef13a91e0 100644 +index ffb22298e8f9b336191b3250ff438c2a8de47dc6..a76a55c7ed8a59636ab0129a7af057d4411efed2 100644 --- a/Source/WebCore/platform/graphics/ImageAdapter.h +++ b/Source/WebCore/platform/graphics/ImageAdapter.h -@@ -61,11 +61,12 @@ typedef struct HBITMAP__ *HBITMAP; +@@ -63,6 +63,8 @@ typedef struct HBITMAP__ *HBITMAP; #include #endif @@ -6765,11 +6557,6 @@ index f5d16bcb2d300d6e54b90583a4e9489862a7dfd0..e9c945854a011e9ec1de96cc8dfbc08e namespace WebCore { class Image; - class IntSize; --class NativeImage; - - class ImageAdapter { - WTF_MAKE_TZONE_ALLOCATED(ImageAdapter); diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.h b/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.h index 5b659c763b9754b025a63f89522954cc39915b9a..448b50a2b131361a75d3f816cdcbb6a102551280 100644 --- a/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.h @@ -6796,7 +6583,7 @@ index 515ddea3cd42796efa9f41ad74be07a7447c337e..36db42e2a0822d5609b39046191f05a1 namespace WebCore { diff --git a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp -index 6239b3ab731ffc0826216ddda46d951d8dace5a0..270423347baa7e6fa47ad1da2154c10423037ae2 100644 +index 63d2978699a1ff636465def5191395a055e06c32..4c2cf5bd8a83f4ffe23920b77008008a5b517bd0 100644 --- a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp +++ b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp @@ -168,6 +168,33 @@ static Vector stringIndicesFromClusters(const Vector& clusters, @@ -6830,7 +6617,7 @@ index 6239b3ab731ffc0826216ddda46d951d8dace5a0..270423347baa7e6fa47ad1da2154c104 + return 1; +} + - void ComplexTextController::collectComplexTextRunsForCharacters(std::span cp, unsigned stringLocation, const Font* font) + void ComplexTextController::collectComplexTextRunsForCharacters(std::span cp, unsigned stringLocation, const Font* font) { if (!font) { @@ -197,6 +224,8 @@ void ComplexTextController::collectComplexTextRunsForCharacters(std::span& types) const { @@ -7442,6 +7229,7 @@ index f21f7d66c5dd661c289a453994597ae166c8f3d0..c293b72154e2cb8f4f1ad3cc222a05f2 - CString textString = content.text.utf8(); - CString markupString = content.markup.utf8(); - +- IGNORE_CLANG_WARNINGS_BEGIN("unsafe-buffer-usage-in-libc-call") - std::array pairs = { { - { { nullptr, 0 }, { nullptr, 0 } }, - { { nullptr, 0 }, { nullptr, 0 } }, @@ -7451,6 +7239,7 @@ index f21f7d66c5dd661c289a453994597ae166c8f3d0..c293b72154e2cb8f4f1ad3cc222a05f2 - wpe_pasteboard_string_initialize(&pairs[1].type, htmlText, strlen(htmlText)); - wpe_pasteboard_string_initialize(&pairs[1].string, markupString.data(), markupString.length()); - struct wpe_pasteboard_string_map map = { pairs.data(), pairs.size() }; +- IGNORE_CLANG_WARNINGS_END - - wpe_pasteboard_write(m_pasteboard, &map); - m_changeCount++; @@ -7486,8 +7275,29 @@ index f21f7d66c5dd661c289a453994597ae166c8f3d0..c293b72154e2cb8f4f1ad3cc222a05f2 } Vector PlatformPasteboard::typesSafeForDOMToReadAndWrite(const String&) const +diff --git a/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp b/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp +index 9dd62ba6c463d5d1e70bc8e9fe9b68bfbaa3cd96..b8a8186919b5c891289bc0b4bd839851e86809cc 100644 +--- a/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp ++++ b/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -77,7 +78,7 @@ public: + GstElement* makeElement(ASCIILiteral factoryName) + { + static Atomic elementId; +- auto name = makeString(Name(), "-dec-"_s, factoryName, "-"_s, elementId.exchangeAdd(1)); ++ auto name = makeString(unsafeSpan(Name()), "-dec-"_s, factoryName, "-"_s, elementId.exchangeAdd(1)); + return makeGStreamerElement(factoryName, name); + } + diff --git a/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoFrameLibWebRTC.cpp b/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoFrameLibWebRTC.cpp -index 80c20938d5ec8282485fb0152b96304c83124354..22975b7c1b99357a7689747251410f306bfb3dcc 100644 +index a629b8b54577cb26b3a89966991deef85c405163..b7b3ca8c854b516e6707c31f8f7b7d96162ba688 100644 --- a/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoFrameLibWebRTC.cpp +++ b/Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoFrameLibWebRTC.cpp @@ -23,6 +23,8 @@ @@ -7529,10 +7339,10 @@ index 1178c8fb001994bc9e6166376a367d9bc148913c..fcc6534568cad6b42a819a435f84ba2b m_commonHeaders.append(CommonHeader { name, value }); } diff --git a/Source/WebCore/platform/network/NetworkStorageSession.h b/Source/WebCore/platform/network/NetworkStorageSession.h -index 2216400912348ab0b6978a40fe02bfc12b249deb..2a0720873e26158c37d7ede83d9a1fd7a02f4409 100644 +index c250e3716214d4ce040cf956672902d9a204bb36..085998000445d48a8c3dd9fbac3f1c1876f61978 100644 --- a/Source/WebCore/platform/network/NetworkStorageSession.h +++ b/Source/WebCore/platform/network/NetworkStorageSession.h -@@ -198,6 +198,7 @@ public: +@@ -200,6 +200,7 @@ public: NetworkingContext* context() const; #endif @@ -7541,10 +7351,10 @@ index 2216400912348ab0b6978a40fe02bfc12b249deb..2a0720873e26158c37d7ede83d9a1fd7 WEBCORE_EXPORT HTTPCookieAcceptPolicy cookieAcceptPolicy() const; WEBCORE_EXPORT void setCookie(const Cookie&); diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp -index a3eefa06801c54642ce6ec1c3bc7675b491ccf5c..46a8197a447b4eba385eb6b89b4a949147955bbe 100644 +index ff4b0aa51b104f1f71246e223553458012b5ab4e..fc58265466d7177ad25cfde1aa664dfec0634e11 100644 --- a/Source/WebCore/platform/network/ResourceResponseBase.cpp +++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp -@@ -78,6 +78,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional&& +@@ -79,6 +79,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional&& , m_httpStatusText(data ? WTFMove(data->httpStatusText) : String { }) , m_httpVersion(data ? WTFMove(data->httpVersion) : String { }) , m_httpHeaderFields(data ? WTFMove(data->httpHeaderFields) : HTTPHeaderMap { }) @@ -7552,7 +7362,7 @@ index a3eefa06801c54642ce6ec1c3bc7675b491ccf5c..46a8197a447b4eba385eb6b89b4a9491 , m_networkLoadMetrics(data && data->networkLoadMetrics ? Box::create(WTFMove(*data->networkLoadMetrics)) : Box { }) , m_certificateInfo(data ? WTFMove(data->certificateInfo) : std::nullopt) , m_httpStatusCode(data ? data->httpStatusCode : 0) -@@ -904,6 +905,7 @@ std::optional ResourceResponseBase::getResponseData() cons +@@ -908,6 +909,7 @@ std::optional ResourceResponseBase::getResponseData() cons String { m_httpStatusText }, String { m_httpVersion }, HTTPHeaderMap { m_httpHeaderFields }, @@ -7560,7 +7370,7 @@ index a3eefa06801c54642ce6ec1c3bc7675b491ccf5c..46a8197a447b4eba385eb6b89b4a9491 m_networkLoadMetrics ? std::optional(*m_networkLoadMetrics) : std::nullopt, m_source, m_type, -@@ -979,6 +981,11 @@ std::optional Coder Coder httpStatusCode; decoder >> httpStatusCode; if (!httpStatusCode) -@@ -1038,6 +1045,7 @@ std::optional Coder Coder m_networkLoadMetrics; mutable std::optional m_certificateInfo; -@@ -297,7 +302,7 @@ struct ResourceResponseData { +@@ -306,7 +311,7 @@ struct ResourceResponseData { ResourceResponseData() = default; ResourceResponseData(ResourceResponseData&&) = default; ResourceResponseData& operator=(ResourceResponseData&&) = default; -- ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, String&& proxyName, bool isRangeRequested, std::optional certificateInfo) -+ ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, HTTPHeaderMap&& httpRequestHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, String&& proxyName, bool isRangeRequested, std::optional certificateInfo) +- ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, String&& proxyName, bool isRangeRequested, std::optional certificateInfo, IPAddressSpace ipAddressSpace) ++ ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, HTTPHeaderMap&& httpRequestHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, String&& proxyName, bool isRangeRequested, std::optional certificateInfo, IPAddressSpace ipAddressSpace) : url(WTFMove(url)) , mimeType(WTFMove(mimeType)) , expectedContentLength(expectedContentLength) -@@ -306,6 +311,7 @@ struct ResourceResponseData { +@@ -315,6 +320,7 @@ struct ResourceResponseData { , httpStatusText(WTFMove(httpStatusText)) , httpVersion(WTFMove(httpVersion)) , httpHeaderFields(WTFMove(httpHeaderFields)) @@ -7613,7 +7423,7 @@ index 545befb0776b62d546b7b7a28093e6f1c4478d2c..a12b31f99f380ea5fbd9b82916e397ca , networkLoadMetrics(WTFMove(networkLoadMetrics)) , source(source) , type(type) -@@ -329,6 +335,7 @@ struct ResourceResponseData { +@@ -339,6 +345,7 @@ struct ResourceResponseData { String httpStatusText; String httpVersion; HTTPHeaderMap httpHeaderFields; @@ -7622,15 +7432,16 @@ index 545befb0776b62d546b7b7a28093e6f1c4478d2c..a12b31f99f380ea5fbd9b82916e397ca ResourceResponseBase::Source source; ResourceResponseBase::Type type; diff --git a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm -index 632ec5128ee28f9d5ea33bdfaa311bad56ec6396..837d67d61ba14e509cf9f72320cf56457263501b 100644 +index f10d0326535f351b4a1c37d90d73e24585c86a14..6ee029953d785ee6272a8363a5c19d364384dda6 100644 --- a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm +++ b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm -@@ -553,6 +553,22 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSi +@@ -576,6 +576,28 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSi return false; } +void NetworkStorageSession::setCookiesFromResponse(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& setCookieValue) +{ ++ auto thirdPartyCookieBlockingDecision = ThirdPartyCookieBlockingDecision::None; + Vector cookieValues = setCookieValue.split('\n'); + size_t count = cookieValues.size(); + auto* cookies = [NSMutableArray arrayWithCapacity:count]; @@ -7642,7 +7453,12 @@ index 632ec5128ee28f9d5ea33bdfaa311bad56ec6396..837d67d61ba14e509cf9f72320cf5645 + [cookies addObject:parsedCookies[0]]; + } + NSURL *cookieURL = url.createNSURL().get(); -+ setHTTPCookiesForURL(cookieStorage().get(), cookies, cookieURL, firstParty.createNSURL().get(), sameSiteInfo); ++#if ENABLE(OPT_IN_PARTITIONED_COOKIES) && defined(CFN_COOKIE_ACCEPTS_POLICY_PARTITION) && CFN_COOKIE_ACCEPTS_POLICY_PARTITION ++ String partitionKey = isOptInCookiePartitioningEnabled() ? cookiePartitionIdentifier(firstParty) : String { }; ++#else ++ String partitionKey; ++#endif ++ setHTTPCookiesForURL(cookieStorage().get(), cookies, cookieURL, firstParty.createNSURL().get(), nsStringNilIfEmpty(partitionKey), sameSiteInfo, thirdPartyCookieBlockingDecision); +} + static NSHTTPCookieAcceptPolicy httpCookieAcceptPolicy(CFHTTPCookieStorageRef cookieStorage) @@ -7662,7 +7478,7 @@ index 37e129136c69b27d509acc01f10be42a8a1fe35a..9df0babc8f82372925fddf2211a7c8c9 bool m_detectedDatabaseCorruption { false }; diff --git a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp -index 78584cd0fb75884e96d489d9da6a24f6ddedbeca..ebbb8c3e9a469d11e7433ac6ef85300e5b6d2ad4 100644 +index a765e8f33e07b492c5db681bdb8d0a1b560f3a89..aeecd7d3e5f2b22b039c377178ce93b2d3aee109 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 @@ -7679,10 +7495,10 @@ index 78584cd0fb75884e96d489d9da6a24f6ddedbeca..ebbb8c3e9a469d11e7433ac6ef85300e { switch (cookieDatabase().acceptPolicy()) { diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp -index 5b3deb017487d8362e11479ea814e02e9221fd23..cb829266402ce26b193a62f7fa39d83681302a1e 100644 +index bcde277ededa3deeff602a8dede32d35c918b388..83ca088c2f7cdaed08d62f8450e63ef1d341d359 100644 --- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp +++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp -@@ -551,6 +551,26 @@ void NetworkStorageSession::replaceCookies(const Vector& cookies) +@@ -553,6 +553,26 @@ void NetworkStorageSession::replaceCookies(const Vector& cookies) g_signal_emit(jar, signalId, 0, nullptr, nullptr); } @@ -7710,7 +7526,7 @@ index 5b3deb017487d8362e11479ea814e02e9221fd23..cb829266402ce26b193a62f7fa39d836 { GUniquePtr targetCookie(cookie.toSoupCookie()); diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp -index 72e1784eff239b69db25a598934a671e7aead036..d647b0d8510edeed5aa27d780a06dd7e5cb413dd 100644 +index d78fc19ce5b5318256e9cb15dfea650fd29a3bb6..4256c020089b5e26886b680d945b695ce3a3bfc7 100644 --- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp +++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp @@ -40,6 +40,7 @@ @@ -7774,7 +7590,7 @@ index 0379437d84807e4a8d3846afac5ec8a70e743e70..5b0461bf12535d4900ffaddc2a878262 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 d450bf9d0fd1f0bf8f28db483ac9d3d60fa9d114..72a59403a0b5493aea4a8e28eb15eac24b652b09 100644 +index 90898196cd9077ceffa78cd00b024c917ce46e09..956d676a4bc32b682004c9662dba61b1c95fb188 100644 --- a/Source/WebCore/platform/win/KeyEventWin.cpp +++ b/Source/WebCore/platform/win/KeyEventWin.cpp @@ -243,10 +243,16 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(HWND, WPARAM code, LPARAM keyData, @@ -7798,7 +7614,7 @@ index d450bf9d0fd1f0bf8f28db483ac9d3d60fa9d114..72a59403a0b5493aea4a8e28eb15eac2 OptionSet PlatformKeyboardEvent::currentStateOfModifierKeys() diff --git a/Source/WebCore/platform/win/PasteboardWin.cpp b/Source/WebCore/platform/win/PasteboardWin.cpp -index e862b1201f827c58d0f6971bd1071e0c0d34d44d..3166f7a8dcb1f9c2d2d505eee846c17b370e76a7 100644 +index aac283d800d41c5185e1de655b6cbe4693c827a6..5ced4f99b3481ab88d8de7c12d44730bddf513d3 100644 --- a/Source/WebCore/platform/win/PasteboardWin.cpp +++ b/Source/WebCore/platform/win/PasteboardWin.cpp @@ -1144,7 +1144,21 @@ void Pasteboard::writeCustomData(const Vector& data) @@ -7849,328 +7665,32 @@ index e862b1201f827c58d0f6971bd1071e0c0d34d44d..3166f7a8dcb1f9c2d2d505eee846c17b +} + } // namespace WebCore -diff --git a/Source/WebCore/platform/wpe/DragDataWPE.cpp b/Source/WebCore/platform/wpe/DragDataWPE.cpp -new file mode 100644 -index 0000000000000000000000000000000000000000..fbd32d390129129fd5b213f7f9c3e96bdca9355b ---- /dev/null -+++ b/Source/WebCore/platform/wpe/DragDataWPE.cpp -@@ -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 -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#include "config.h" -+#include "DragData.h" -+#include "SelectionData.h" -+ -+namespace WebCore { -+ -+bool DragData::canSmartReplace() const -+{ -+ return false; -+} -+ -+bool DragData::containsColor() const -+{ -+ return false; -+} -+ -+bool DragData::containsFiles() const -+{ -+ return m_platformDragData->hasFilenames(); -+} -+ -+unsigned DragData::numberOfFiles() const -+{ -+ return m_platformDragData->filenames().size(); -+} -+ -+Vector DragData::asFilenames() const -+{ -+ return m_platformDragData->filenames(); -+} -+ -+bool DragData::containsPlainText() const -+{ -+ return m_platformDragData->hasText(); -+} -+ -+String DragData::asPlainText() const -+{ -+ return m_platformDragData->text(); -+} -+ -+Color DragData::asColor() const -+{ -+ return Color(); -+} -+ -+bool DragData::containsCompatibleContent(DraggingPurpose) const -+{ -+ return containsPlainText() || containsURL() || containsColor() || containsFiles(); -+} -+ -+bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const -+{ -+ return !asURL(filenamePolicy).isEmpty(); -+} -+ -+String DragData::asURL(FilenameConversionPolicy filenamePolicy, String* title) const -+{ -+ if (!m_platformDragData->hasURL()) -+ return String(); -+ if (filenamePolicy != ConvertFilenames) { -+ if (m_platformDragData->url().protocolIsFile()) -+ return { }; -+ } -+ -+ if (title) -+ *title = m_platformDragData->urlLabel(); -+ return m_platformDragData->url().string(); -+} -+ -+bool DragData::shouldMatchStyleOnDrop() const -+{ -+ return false; -+} -+ -+} -diff --git a/Source/WebCore/platform/wpe/PasteboardWPE.cpp b/Source/WebCore/platform/wpe/PasteboardWPE.cpp -index c0847a84e4aeba3dac78a8ffe9826d906d33a387..c1c60572473dad33e436ab4f52e5cac5bc2d2f76 100644 ---- a/Source/WebCore/platform/wpe/PasteboardWPE.cpp -+++ b/Source/WebCore/platform/wpe/PasteboardWPE.cpp -@@ -36,6 +36,10 @@ - #include "SharedBuffer.h" - #include - -+#if ENABLE(DRAG_SUPPORT) -+#include "DragData.h" -+#endif -+ - namespace WebCore { - - std::unique_ptr Pasteboard::createForCopyAndPaste(std::unique_ptr&& context) -@@ -55,8 +59,17 @@ Pasteboard::Pasteboard(std::unique_ptr&& context) - { +diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp +index f9d2a09bf46ab0f9ec829aa891fa7dc7a1177842..56e84e4dc60b71b45b8e8205311703509d9697c0 100644 +--- a/Source/WebCore/rendering/RenderTextControl.cpp ++++ b/Source/WebCore/rendering/RenderTextControl.cpp +@@ -256,13 +256,13 @@ void RenderTextControl::layoutExcludedChildren(RelayoutChildren relayoutChildren + } } --void Pasteboard::writeString(const String&, const String&) -+void Pasteboard::writeString(const String& type, const String& text) +-#if PLATFORM(IOS_FAMILY) + bool RenderTextControl::canScroll() const { -+ if (m_selectionData) { -+ if (type == "Files"_s || type == "text/uri-list"_s) -+ m_selectionData->setURIList(text); -+ else if (type == "text/html"_s) -+ m_selectionData->setMarkup(text); -+ else if (type == "text/plain"_s) -+ m_selectionData->setText(text); -+ return; -+ } - notImplemented(); + auto innerText = innerTextElement(); + return innerText && innerText->renderer() && innerText->renderer()->hasNonVisibleOverflow(); } -@@ -69,6 +82,11 @@ void Pasteboard::writePlainText(const String& text, SmartReplaceOption) - - void Pasteboard::write(const PasteboardURL& pasteboardURL) ++#if PLATFORM(IOS_FAMILY) + int RenderTextControl::innerLineHeight() const { -+ if (m_selectionData) { -+ m_selectionData->clearAll(); -+ m_selectionData->setURL(pasteboardURL.url, pasteboardURL.title); -+ return; -+ } - ASSERT(!pasteboardURL.url.isEmpty()); - SelectionData data; - data.setURL(pasteboardURL.url, pasteboardURL.title); -@@ -82,6 +100,15 @@ void Pasteboard::writeTrustworthyWebURLsPboardType(const PasteboardURL&) - - void Pasteboard::write(const PasteboardImage& pasteboardImage) - { -+ if (m_selectionData) { -+ m_selectionData->clearAll(); -+ if (!pasteboardImage.url.url.isEmpty()) { -+ m_selectionData->setURL(pasteboardImage.url.url, pasteboardImage.url.title); -+ m_selectionData->setMarkup(pasteboardImage.url.markup); -+ } -+ m_selectionData->setImage(pasteboardImage.image.get()); -+ return; -+ } - SelectionData data; - if (!pasteboardImage.url.url.isEmpty()) { - data.setURL(pasteboardImage.url.url, pasteboardImage.url.title); -@@ -98,6 +125,12 @@ void Pasteboard::write(const PasteboardBuffer&) - - void Pasteboard::write(const PasteboardWebContent& pasteboardContent) - { -+ if (m_selectionData) { -+ m_selectionData->clearAll(); -+ m_selectionData->setText(pasteboardContent.text); -+ m_selectionData->setMarkup(pasteboardContent.markup); -+ return; -+ } - SelectionData data; - data.setText(pasteboardContent.text); - data.setMarkup(pasteboardContent.markup); -@@ -191,6 +224,26 @@ bool Pasteboard::hasData() - - Vector Pasteboard::typesSafeForBindings(const String& origin) - { -+ if (m_selectionData) { -+ ListHashSet types; -+ if (auto& buffer = m_selectionData->customData()) { -+ auto customData = PasteboardCustomData::fromSharedBuffer(*buffer); -+ if (customData.origin() == origin) { -+ for (auto& type : customData.orderedTypes()) -+ types.add(type); -+ } -+ } -+ -+ if (m_selectionData->hasText()) -+ types.add("text/plain"_s); -+ if (m_selectionData->hasMarkup()) -+ types.add("text/html"_s); -+ if (m_selectionData->hasURIList()) -+ types.add("text/uri-list"_s); -+ -+ return copyToVector(types); -+ } -+ - return platformStrategies()->pasteboardStrategy()->typesSafeForDOMToReadAndWrite(m_name, origin, context()); - } - -@@ -201,6 +254,13 @@ Vector Pasteboard::typesForLegacyUnsafeBindings() - - String Pasteboard::readOrigin() - { -+ if (m_selectionData) { -+ if (auto& buffer = m_selectionData->customData()) -+ return PasteboardCustomData::fromSharedBuffer(*buffer).origin(); -+ -+ return { }; -+ } -+ - // FIXME: cache custom data? - if (auto buffer = platformStrategies()->pasteboardStrategy()->readBufferFromClipboard(m_name, PasteboardCustomData::wpeType())) - return PasteboardCustomData::fromSharedBuffer(*buffer).origin(); -@@ -210,11 +270,27 @@ String Pasteboard::readOrigin() - - String Pasteboard::readString(const String& type) - { -+ if (m_selectionData) { -+ if (type == "text/plain"_s) -+ return m_selectionData->text();; -+ if (type == "text/html"_s) -+ return m_selectionData->markup(); -+ if (type == "Files"_s || type == "text/uri-list"_s) -+ return m_selectionData->uriList(); -+ return { }; -+ } -+ - return platformStrategies()->pasteboardStrategy()->readTextFromClipboard(m_name, type); - } - - String Pasteboard::readStringInCustomData(const String& type) - { -+ if (m_selectionData) { -+ if (auto& buffer = m_selectionData->customData()) -+ return PasteboardCustomData::fromSharedBuffer(*buffer).readStringInCustomData(type); -+ -+ return { }; -+ } - // FIXME: cache custom data? - if (auto buffer = platformStrategies()->pasteboardStrategy()->readBufferFromClipboard(m_name, PasteboardCustomData::wpeType())) - return PasteboardCustomData::fromSharedBuffer(*buffer).readStringInCustomData(type); -@@ -244,6 +320,17 @@ void Pasteboard::writeMarkup(const String&) - - void Pasteboard::writeCustomData(const Vector& data) - { -+ if (m_selectionData) { -+ if (!data.isEmpty()) { -+ const auto& customData = data[0]; -+ customData.forEachPlatformString([this] (auto& type, auto& string) { -+ writeString(type, string); -+ }); -+ if (customData.hasSameOriginCustomData() || !customData.origin().isEmpty()) -+ m_selectionData->setCustomData(customData.createSharedBuffer()); -+ } -+ return; -+ } - m_changeCount = platformStrategies()->pasteboardStrategy()->writeCustomData(data, m_name, context()); - } - -@@ -257,6 +344,35 @@ int64_t Pasteboard::changeCount() const - return platformStrategies()->pasteboardStrategy()->changeCount(m_name); - } - -+#if ENABLE(DRAG_SUPPORT) -+Pasteboard::Pasteboard(std::unique_ptr&& context, SelectionData&& selectionData) -+ : m_context(WTFMove(context)) -+ , m_selectionData(WTFMove(selectionData)) -+{ -+} -+ -+Pasteboard::Pasteboard(std::unique_ptr&& context, SelectionData& selectionData) -+ : m_context(WTFMove(context)) -+ , m_selectionData(selectionData) -+{ -+} -+ -+std::unique_ptr Pasteboard::createForDragAndDrop(std::unique_ptr&& context) -+{ -+ return makeUnique(WTFMove(context), SelectionData()); -+} -+ -+std::unique_ptr Pasteboard::create(const DragData& dragData) -+{ -+ RELEASE_ASSERT(dragData.platformData()); -+ return makeUnique(dragData.createPasteboardContext(), *dragData.platformData()); -+} -+ -+void Pasteboard::setDragImage(DragImage, const IntPoint&) -+{ -+} -+#endif -+ - } // namespace WebCore - - #endif // PLATFORM(WPE) -diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp -index 1238b6ac1b2aa43f0b1f7a74e48e9436d67934fa..261ee362bbdc4fb70450a61da3c872ac3d3a8cc7 100644 ---- a/Source/WebCore/rendering/RenderTextControl.cpp -+++ b/Source/WebCore/rendering/RenderTextControl.cpp -@@ -230,13 +230,13 @@ void RenderTextControl::layoutExcludedChildren(RelayoutChildren relayoutChildren - } - } - --#if PLATFORM(IOS_FAMILY) - bool RenderTextControl::canScroll() const - { - auto innerText = innerTextElement(); - return innerText && innerText->renderer() && innerText->renderer()->hasNonVisibleOverflow(); - } - -+#if PLATFORM(IOS_FAMILY) - int RenderTextControl::innerLineHeight() const - { - if (auto innerTextElement = this->innerTextElement(); innerTextElement && innerTextElement->renderer()) -diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h -index 82e32c398dfdfa3e1fdb5dda86e98c827a290f84..c9eddb5739b1cd2ab5b744f57ecb8eb01079ad55 100644 ---- a/Source/WebCore/rendering/RenderTextControl.h -+++ b/Source/WebCore/rendering/RenderTextControl.h -@@ -38,8 +38,8 @@ public: - WEBCORE_EXPORT HTMLTextFormControlElement& textFormControlElement() const; - WEBCORE_EXPORT Ref protectedTextFormControlElement() const; + if (auto innerTextElement = this->innerTextElement(); innerTextElement && innerTextElement->renderer()) +diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h +index 5eba39f814e848db970d968ab42a482a9d1f0d3e..5a8dbd07b599daf3e6b5906ec677138531f996bf 100644 +--- a/Source/WebCore/rendering/RenderTextControl.h ++++ b/Source/WebCore/rendering/RenderTextControl.h +@@ -39,8 +39,8 @@ public: + WEBCORE_EXPORT HTMLTextFormControlElement& textFormControlElement() const; + WEBCORE_EXPORT Ref protectedTextFormControlElement() const; -#if PLATFORM(IOS_FAMILY) bool canScroll() const; @@ -8179,7 +7699,7 @@ index 82e32c398dfdfa3e1fdb5dda86e98c827a290f84..c9eddb5739b1cd2ab5b744f57ecb8eb0 #endif diff --git a/Source/WebCore/workers/WorkerConsoleClient.cpp b/Source/WebCore/workers/WorkerConsoleClient.cpp -index e675901b3a15cbdefdb731c949f8a4234af5dede..97d38d8ef0fb379ab689cb2dacba6563bcaf1e85 100644 +index a9e64a0a2aabebe6c150e959034e3a5aa41cc0b0..dfc1a928eb486f9021373fc4b49e7dabe921fbae 100644 --- a/Source/WebCore/workers/WorkerConsoleClient.cpp +++ b/Source/WebCore/workers/WorkerConsoleClient.cpp @@ -124,4 +124,6 @@ void WorkerConsoleClient::recordEnd(JSC::JSGlobalObject*, Ref&& @@ -8190,7 +7710,7 @@ index e675901b3a15cbdefdb731c949f8a4234af5dede..97d38d8ef0fb379ab689cb2dacba6563 + } // namespace WebCore diff --git a/Source/WebCore/workers/WorkerConsoleClient.h b/Source/WebCore/workers/WorkerConsoleClient.h -index db95c8273bd0deb3f903a45d02fc07bbbd8ab305..bf88228b4c838b90d11d430cc9429d5130631afa 100644 +index 248649b615c7aed9b37cae14ab58152eb5ca34f1..85f3e2b7f5519822f53564a8c63b8bcb05de8594 100644 --- a/Source/WebCore/workers/WorkerConsoleClient.h +++ b/Source/WebCore/workers/WorkerConsoleClient.h @@ -58,6 +58,7 @@ private: @@ -8199,13 +7719,13 @@ index db95c8273bd0deb3f903a45d02fc07bbbd8ab305..bf88228b4c838b90d11d430cc9429d51 void screenshot(JSC::JSGlobalObject*, Ref&&) override; + void bindingCalled(JSC::JSGlobalObject*, const String& name, const String& arg) override; - WorkerOrWorkletGlobalScope& m_globalScope; + WeakRef m_globalScope; }; diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp -index 2d8a4462ea7897aca4455d526fcb5e0fd6b3dcd3..53f0de10cdfb27736855fa837d9e4a650c18c90a 100644 +index 23c28e80ad53d469daf5c91c4c8bf684b532984a..124541dcc16a7c6028363a7ed611eb5c3509d76a 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp -@@ -97,6 +97,8 @@ +@@ -98,6 +98,8 @@ #if PLATFORM(COCOA) #include @@ -8214,7 +7734,7 @@ index 2d8a4462ea7897aca4455d526fcb5e0fd6b3dcd3..53f0de10cdfb27736855fa837d9e4a65 #endif #if ENABLE(APPLE_PAY_REMOTE_UI) -@@ -1232,6 +1234,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) +@@ -1264,6 +1266,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) storageSession->clearPageSpecificDataForResourceLoadStatistics(pageID); } @@ -8230,10 +7750,10 @@ index 2d8a4462ea7897aca4455d526fcb5e0fd6b3dcd3..53f0de10cdfb27736855fa837d9e4a65 { if (CheckedPtr storageSession = m_networkProcess->storageSession(m_sessionID)) diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h -index 96e3d7d1370b114591191dea8e0e042c9f06c0c8..a4ddbd6483b8bd1ffb8f360cad5552dbcbcfc018 100644 +index 4b7fe5bf71c5e3e1f63961259b8ad9d0a0834d34..3f1656764919c53b2d80067645ef7f19dc03c388 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h -@@ -388,6 +388,8 @@ private: +@@ -386,6 +386,8 @@ private: void clearPageSpecificData(WebCore::PageIdentifier); @@ -8243,20 +7763,20 @@ index 96e3d7d1370b114591191dea8e0e042c9f06c0c8..a4ddbd6483b8bd1ffb8f360cad5552db void logUserInteraction(RegistrableDomain&&); diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in -index 26d43eb49dc956a104782a5e10df084dc2b1e7e8..aa92cfd23b61eae7ee90c9fb7846189f9406e379 100644 +index 4bdff7c2b3a30297db5474cbff918bbb21e9bfdf..9fc3e410dc6cb49447dafa13dfd5e0207bc9959f 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in -@@ -80,6 +80,8 @@ messages -> NetworkConnectionToWebProcess WantsDispatchMessage { +@@ -83,6 +83,8 @@ messages -> NetworkConnectionToWebProcess WantsDispatchMessage { ClearPageSpecificData(WebCore::PageIdentifier pageID); + SetCookieFromResponse(URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, String setCookieValue); -+ - RemoveStorageAccessForFrame(WebCore::FrameIdentifier frameID, WebCore::PageIdentifier pageID); ++ + [EnabledBy=StorageAccessAPIEnabled] RemoveStorageAccessForFrame(WebCore::FrameIdentifier frameID, WebCore::PageIdentifier pageID); LogUserInteraction(WebCore::RegistrableDomain domain) ResourceLoadStatisticsUpdated(Vector statistics) -> () diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -index 23fbdde0494dae83161c9b715f870db48b8caff1..df27897d278c7bb755378ef309376b50d79124cb 100644 +index 9b6ca02653e98895b9fcde7f9d39386b3afe01dc..b939bfbc41a0d0c06c25bf656f2c12840eb653e1 100644 --- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm +++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm @@ -1136,6 +1136,14 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data @@ -8273,9 +7793,9 @@ index 23fbdde0494dae83161c9b715f870db48b8caff1..df27897d278c7bb755378ef309376b50 + networkDataTask->didReceiveResponse(WTFMove(resourceResponse), negotiatedLegacyTLS, privateRelayed, [completionHandler = makeBlockPtr(completionHandler), taskIdentifier](WebCore::PolicyAction policyAction) { #if !LOG_DISABLED - LOG(NetworkSession, "%llu didReceiveResponse completionHandler (%s)", taskIdentifier, toString(policyAction).characters()); + LOG(NetworkSession, "%zu didReceiveResponse completionHandler (%s)", taskIdentifier, toString(policyAction).characters()); diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp -index 7b1879c44551fae26e338352189adc5b9add0266..dac8034d87d3bcbbb56576c2ef37713ea0ef85ff 100644 +index 6b03d650bc91f5d6f634e2d627d4745ba44e93ca..db97531e193720058d423324c09b3f221ae6e4d2 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp +++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp @@ -166,6 +166,7 @@ void NetworkDataTaskCurl::curlDidReceiveResponse(CurlRequest& request, CurlRespo @@ -8287,10 +7807,10 @@ index 7b1879c44551fae26e338352189adc5b9add0266..dac8034d87d3bcbbb56576c2ef37713e handleCookieHeaders(request.resourceRequest(), receivedResponse); diff --git a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in -index aebce13abcf8f93c8fa48936120c2065f0a664b1..7b003cf0d65d0179b165fcbce775cfd5b6a19374 100644 +index 0f57c0d6cc2d0d494bc636625e85ba31210bef79..d8bbe4e4fc0a1faea7a9b8d47e800bf1d6637db2 100644 --- a/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in +++ b/Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in -@@ -451,9 +451,11 @@ +@@ -452,9 +452,11 @@ ;; FIXME: This should be removed when is fixed. ;; Restrict AppSandboxed processes from creating /Library/Keychains, but allow access to the contents of /Library/Keychains: @@ -8306,7 +7826,7 @@ index aebce13abcf8f93c8fa48936120c2065f0a664b1..7b003cf0d65d0179b165fcbce775cfd5 ;; 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 375489f4b3944b7b6f4ac03b1784aef8ca116206..6cce36bd75b872b45b7a6ecc07e2adff00bbc7a4 100644 +index 369be58defabbaa8e3ba2a4d2f422b99d49c07f1..9a02761ede19dc320218a10e500594443ba5e644 100644 --- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp +++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp @@ -461,6 +461,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr&& inputStream) @@ -8319,12 +7839,12 @@ index 375489f4b3944b7b6f4ac03b1784aef8ca116206..6cce36bd75b872b45b7a6ecc07e2adff } diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake -index d39a11b312cc9237973ee095e995afa379da1b0d..e5fc9f02cea359414154756b27958019cbb57374 100644 +index 7a447e1614d0306bf648dc7d0aae254673e49ecb..b594feaa95f41889558baeadf4d464c0f33b35c8 100644 --- a/Source/WebKit/PlatformGTK.cmake +++ b/Source/WebKit/PlatformGTK.cmake -@@ -320,6 +320,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES +@@ -325,6 +325,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES + ${GSTREAMER_INCLUDE_DIRS} ${GSTREAMER_PBUTILS_INCLUDE_DIRS} - ${GTK_INCLUDE_DIRS} ${LIBSOUP_INCLUDE_DIRS} +# Playwright begin + ${LIBVPX_INCLUDE_DIRS} @@ -8332,7 +7852,7 @@ index d39a11b312cc9237973ee095e995afa379da1b0d..e5fc9f02cea359414154756b27958019 ) list(APPEND WebKit_INTERFACE_INCLUDE_DIRECTORIES -@@ -363,6 +366,9 @@ if (USE_LIBWEBRTC) +@@ -368,6 +371,9 @@ if (USE_LIBWEBRTC) list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/libwebrtc/Source/" "${THIRDPARTY_DIR}/libwebrtc/Source/webrtc" @@ -8342,7 +7862,7 @@ index d39a11b312cc9237973ee095e995afa379da1b0d..e5fc9f02cea359414154756b27958019 ) endif () -@@ -414,6 +420,12 @@ else () +@@ -419,6 +425,12 @@ else () set(WebKitGTK_ENUM_HEADER_TEMPLATE ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitEnumTypesGtk3.h.in) endif () @@ -8356,20 +7876,20 @@ index d39a11b312cc9237973ee095e995afa379da1b0d..e5fc9f02cea359414154756b27958019 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 650a918189ad22a6fa76404c80ebca477331c193..74fc793279465c3aa9a586130a98c182e1334568 100644 +index e1043f03708269b7f1d5d07dbbbd3a047d1f15a6..eca0204c02c117a8c3c6831090236a5e0d9f2aad 100644 --- a/Source/WebKit/PlatformWPE.cmake +++ b/Source/WebKit/PlatformWPE.cmake -@@ -221,6 +221,7 @@ set(WPE_API_HEADER_TEMPLATES - ${WEBKIT_DIR}/UIProcess/API/glib/WebKitWindowProperties.h.in +@@ -224,6 +224,7 @@ set(WPE_API_HEADER_TEMPLATES ${WEBKIT_DIR}/UIProcess/API/glib/WebKitWebsitePolicies.h.in + ${WEBKIT_DIR}/UIProcess/API/glib/WebKitXRPermissionRequest.h.in ${WEBKIT_DIR}/UIProcess/API/glib/webkit.h.in + ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitPointerLockPermissionRequest.h.in ) if (ENABLE_2022_GLIB_API) -@@ -432,8 +433,17 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES - ${GIO_UNIX_INCLUDE_DIRS} - ${GLIB_INCLUDE_DIRS} +@@ -441,8 +442,17 @@ list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES + + list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES ${LIBSOUP_INCLUDE_DIRS} +# Playwright begin + "${THIRDPARTY_DIR}/libwebrtc/Source/third_party/libyuv/include" @@ -8383,10 +7903,10 @@ index 650a918189ad22a6fa76404c80ebca477331c193..74fc793279465c3aa9a586130a98c182 +# Playwright end + list(APPEND WebKit_LIBRARIES + GLib::Module WPE::libwpe - ${GLIB_LIBRARIES} diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake -index 8429fc8b2e3721830edf197b3369f4f21bb70a9a..35e99519b9a23ac19757a8b67fe477ce26c06cd0 100644 +index 86a1febedca9fcbe7203db8cec94e8db1ef25a43..5817071222a03d57dd4d6afa550f47559a244d54 100644 --- a/Source/WebKit/PlatformWin.cmake +++ b/Source/WebKit/PlatformWin.cmake @@ -54,8 +54,13 @@ list(APPEND WebKit_SOURCES @@ -8394,7 +7914,7 @@ index 8429fc8b2e3721830edf197b3369f4f21bb70a9a..35e99519b9a23ac19757a8b67fe477ce UIProcess/win/AutomationClientWin.cpp UIProcess/win/AutomationSessionClientWin.cpp + -+ UIProcess/win/InspectorTargetProxyWin.cpp ++ UIProcess/win/WebPageInspectorTargetProxyWin.cpp + UIProcess/win/InspectorPlaywrightAgentClientWin.cpp UIProcess/win/PageClientImpl.cpp UIProcess/win/WebContextMenuProxyWin.cpp @@ -8409,9 +7929,9 @@ index 8429fc8b2e3721830edf197b3369f4f21bb70a9a..35e99519b9a23ac19757a8b67fe477ce WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp + WebProcess/WebCoreSupport/win/WebDragClientWin.cpp - WebProcess/WebPage/AcceleratedSurface.cpp + WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp -@@ -121,6 +127,36 @@ list(APPEND WebKit_PRIVATE_LIBRARIES +@@ -119,6 +125,36 @@ list(APPEND WebKit_PRIVATE_LIBRARIES comctl32 ) @@ -8449,10 +7969,10 @@ index 8429fc8b2e3721830edf197b3369f4f21bb70a9a..35e99519b9a23ac19757a8b67fe477ce WebProcess/EntryPoint/win/WebProcessMain.cpp diff --git a/Source/WebKit/Shared/AuxiliaryProcess.h b/Source/WebKit/Shared/AuxiliaryProcess.h -index 35fd0f0397cd92c5bf025d89d7f7c8139c03c69d..b1559f1bb2d2d7a74d0b534f81352e366498bfc8 100644 +index f7e60f52af0df8081d3f223a21b10674e79c2542..e3cb79b52db7073122d78acabf03b2d19cabf1ea 100644 --- a/Source/WebKit/Shared/AuxiliaryProcess.h +++ b/Source/WebKit/Shared/AuxiliaryProcess.h -@@ -216,6 +216,11 @@ struct AuxiliaryProcessInitializationParameters { +@@ -221,6 +221,11 @@ struct AuxiliaryProcessInitializationParameters { IPC::Connection::Identifier connectionIdentifier; HashMap extraInitializationData; WTF::AuxiliaryProcessType processType; @@ -8465,7 +7985,7 @@ index 35fd0f0397cd92c5bf025d89d7f7c8139c03c69d..b1559f1bb2d2d7a74d0b534f81352e36 } // namespace WebKit diff --git a/Source/WebKit/Shared/NativeWebKeyboardEvent.h b/Source/WebKit/Shared/NativeWebKeyboardEvent.h -index 60a6308dbbd3f9a09c82214dcd97f86dda9d2078..31036d180a6f319d17c53a363d58d8bad1550a97 100644 +index 60a6308dbbd3f9a09c82214dcd97f86dda9d2078..b33855b4c9284698155cc13ac1023bc9923d73a1 100644 --- a/Source/WebKit/Shared/NativeWebKeyboardEvent.h +++ b/Source/WebKit/Shared/NativeWebKeyboardEvent.h @@ -33,6 +33,7 @@ @@ -8480,7 +8000,7 @@ index 60a6308dbbd3f9a09c82214dcd97f86dda9d2078..31036d180a6f319d17c53a363d58d8ba #if USE(APPKIT) // FIXME: Share iOS's HandledByInputMethod enum here instead of passing a boolean. NativeWebKeyboardEvent(NSEvent *, bool handledByInputMethod, bool replacesSoftSpace, const Vector&); -+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, WallTime timestamp, Vector&& commands) ++ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, MonotonicTime timestamp, Vector&& commands) + : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp, WTFMove(commands)) + { + } @@ -8489,7 +8009,7 @@ index 60a6308dbbd3f9a09c82214dcd97f86dda9d2078..31036d180a6f319d17c53a363d58d8ba NativeWebKeyboardEvent(GdkEvent*, const String&, bool isAutoRepeat, Vector&& commands); NativeWebKeyboardEvent(const String&, std::optional>&&, std::optional&&); NativeWebKeyboardEvent(WebEventType, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, Vector&& commands, bool isAutoRepeat, bool isKeypad, OptionSet); -+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, WallTime timestamp, Vector&& commands) ++ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, MonotonicTime timestamp, Vector&& commands) + : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp, WTFMove(commands)) + { + } @@ -8499,7 +8019,7 @@ index 60a6308dbbd3f9a09c82214dcd97f86dda9d2078..31036d180a6f319d17c53a363d58d8ba #elif USE(LIBWPE) enum class HandledByInputMethod : bool { No, Yes }; NativeWebKeyboardEvent(struct wpe_input_keyboard_event*, const String&, bool isAutoRepeat, HandledByInputMethod, std::optional>&&, std::optional&&); -+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, WallTime timestamp) ++ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, MonotonicTime timestamp) + : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp) + { + } @@ -8509,7 +8029,7 @@ index 60a6308dbbd3f9a09c82214dcd97f86dda9d2078..31036d180a6f319d17c53a363d58d8ba #endif #elif PLATFORM(WIN) NativeWebKeyboardEvent(HWND, UINT message, WPARAM, LPARAM, Vector&& pendingCharEvents); -+ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, WallTime timestamp) ++ NativeWebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, MonotonicTime timestamp) + : WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, isAutoRepeat, isKeypad, isSystemKey, modifiers, timestamp) + { + } @@ -8517,7 +8037,7 @@ index 60a6308dbbd3f9a09c82214dcd97f86dda9d2078..31036d180a6f319d17c53a363d58d8ba #if USE(APPKIT) diff --git a/Source/WebKit/Shared/NativeWebMouseEvent.h b/Source/WebKit/Shared/NativeWebMouseEvent.h -index a39b6dd673e1639f9fe64c23dd054f0ff57f7464..4026f6244889e5a0ee85edb72696d0be20ba531d 100644 +index 37f4fe60ee03fe314312417d3f550786d838f35f..d6388da22512fe1ef98fe33c79edc3ffc066b389 100644 --- a/Source/WebKit/Shared/NativeWebMouseEvent.h +++ b/Source/WebKit/Shared/NativeWebMouseEvent.h @@ -87,6 +87,11 @@ public: @@ -8525,7 +8045,7 @@ index a39b6dd673e1639f9fe64c23dd054f0ff57f7464..4026f6244889e5a0ee85edb72696d0be #endif +#if PLATFORM(GTK) || USE(LIBWPE) || PLATFORM(WIN) -+ NativeWebMouseEvent(WebEventType type, WebMouseEventButton button, unsigned short buttons, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, OptionSet modifiers, WallTime timestamp) ++ NativeWebMouseEvent(WebEventType type, WebMouseEventButton button, unsigned short buttons, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, OptionSet modifiers, MonotonicTime timestamp) + : WebMouseEvent({type, modifiers, timestamp}, button, buttons, position, globalPosition, deltaX, deltaY, deltaZ, clickCount) { } +#endif + @@ -8547,10 +8067,10 @@ index f8e96218fd2671d1c0aca5e549efe0d8b94ef0f9..6cebd61bceb39c08e916fe991e4c3fc6 NSEvent* nativeEvent() const { return m_nativeEvent.get(); } #elif PLATFORM(GTK) diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -index 6bb3cc33a43da97e85efe8afb8e7ea2400dd4787..79e2b2f0196d3edb62b2219d59229bb2822e549f 100644 +index 3cd24844ad5bec58aa2bdad353d861ead360170d..6678b4eb1e379ffea440a656c9b7be69e5cc4a27 100644 --- a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in +++ b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -@@ -2841,6 +2841,9 @@ class WebCore::AuthenticationChallenge { +@@ -2838,6 +2838,9 @@ class WebCore::AuthenticationChallenge { class WebCore::DragData { #if PLATFORM(COCOA) String pasteboardName(); @@ -8560,7 +8080,7 @@ index 6bb3cc33a43da97e85efe8afb8e7ea2400dd4787..79e2b2f0196d3edb62b2219d59229bb2 #endif WebCore::IntPoint clientPosition(); WebCore::IntPoint globalPosition(); -@@ -3649,6 +3652,7 @@ enum class WebCore::WasPrivateRelayed : bool; +@@ -3693,6 +3696,7 @@ enum class WebCore::WasPrivateRelayed : bool; String httpStatusText; String httpVersion; WebCore::HTTPHeaderMap httpHeaderFields; @@ -8569,14 +8089,14 @@ index 6bb3cc33a43da97e85efe8afb8e7ea2400dd4787..79e2b2f0196d3edb62b2219d59229bb2 WebCore::ResourceResponseBase::Source source; WebCore::ResourceResponseBase::Type type; diff --git a/Source/WebKit/Shared/WebKeyboardEvent.cpp b/Source/WebKit/Shared/WebKeyboardEvent.cpp -index 8040819bba9dcde87311aaafe7d8177d0e07281d..24972c0a357324d27910ae6ff1979d1c6b8bc758 100644 +index 8040819bba9dcde87311aaafe7d8177d0e07281d..b20b2d56a90d1139b5e01942a3a18b20c4f83714 100644 --- a/Source/WebKit/Shared/WebKeyboardEvent.cpp +++ b/Source/WebKit/Shared/WebKeyboardEvent.cpp @@ -51,6 +51,24 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S ASSERT(isKeyboardEventType(type())); } -+WebKeyboardEvent::WebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, WallTime timestamp, Vector&& commands) ++WebKeyboardEvent::WebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, MonotonicTime timestamp, Vector&& commands) + : WebEvent(type, modifiers, timestamp) + , m_text(text) + , m_unmodifiedText(text) @@ -8601,7 +8121,7 @@ index 8040819bba9dcde87311aaafe7d8177d0e07281d..24972c0a357324d27910ae6ff1979d1c ASSERT(isKeyboardEventType(type())); } -+WebKeyboardEvent::WebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, WallTime timestamp, Vector&& commands) ++WebKeyboardEvent::WebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, MonotonicTime timestamp, Vector&& commands) + : WebEvent(type, modifiers, timestamp) + , m_text(text) + , m_unmodifiedText(text) @@ -8628,7 +8148,7 @@ index 8040819bba9dcde87311aaafe7d8177d0e07281d..24972c0a357324d27910ae6ff1979d1c +#if PLATFORM(WIN) || USE(LIBWPE) + -+WebKeyboardEvent::WebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, WallTime timestamp) ++WebKeyboardEvent::WebKeyboardEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, MonotonicTime timestamp) + : WebEvent(type, modifiers, timestamp) + , m_text(text) + , m_unmodifiedText(text) @@ -8651,30 +8171,30 @@ index 8040819bba9dcde87311aaafe7d8177d0e07281d..24972c0a357324d27910ae6ff1979d1c { } diff --git a/Source/WebKit/Shared/WebKeyboardEvent.h b/Source/WebKit/Shared/WebKeyboardEvent.h -index 8e4e2d6d5ebb08fba210fe0a328d45290348dd11..32a43192ec1e918c33b1b046b71d2ec571dc92ff 100644 +index aacce0eda14902d8fe6cb2ca4bd9679737959a6f..cffe39a16c6ebbe64cad670059e4916728b134d1 100644 --- a/Source/WebKit/Shared/WebKeyboardEvent.h +++ b/Source/WebKit/Shared/WebKeyboardEvent.h @@ -42,14 +42,18 @@ public: #if USE(APPKIT) WebKeyboardEvent(WebEvent&&, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, const Vector&, bool isAutoRepeat, bool isKeypad, bool isSystemKey); -+ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet, WallTime timestamp, Vector&& commands); ++ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet, MonotonicTime timestamp, Vector&& commands); #elif PLATFORM(GTK) WebKeyboardEvent(WebEvent&&, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, std::optional>&&, std::optional&&, Vector&& commands, bool isAutoRepeat, bool isKeypad); -+ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet, WallTime timestamp, Vector&& commands); ++ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet, MonotonicTime timestamp, Vector&& commands); #elif PLATFORM(IOS_FAMILY) WebKeyboardEvent(WebEvent&&, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool handledByInputMethod, bool isAutoRepeat, bool isKeypad, bool isSystemKey); #elif USE(LIBWPE) WebKeyboardEvent(WebEvent&&, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, std::optional>&&, std::optional&&, bool isAutoRepeat, bool isKeypad); -+ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet, WallTime timestamp); ++ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet, MonotonicTime timestamp); #else WebKeyboardEvent(WebEvent&&, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey); -+ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet, WallTime timestamp); ++ WebKeyboardEvent(WebEventType, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet, MonotonicTime timestamp); #endif const String& text() const { return m_text; } diff --git a/Source/WebKit/Shared/WebMouseEvent.h b/Source/WebKit/Shared/WebMouseEvent.h -index 20a6e465457151b02daa22e6bc059cf0e117ece5..ef4b1f737aaa683bc13c447aa4ca77e5cf0d64d7 100644 +index 249ed5bf7a9ca037349cae92a063e718d015333d..6c179a0545456967f26ebf64f701e0290acaa589 100644 --- a/Source/WebKit/Shared/WebMouseEvent.h +++ b/Source/WebKit/Shared/WebMouseEvent.h @@ -70,6 +70,7 @@ public: @@ -8682,14 +8202,14 @@ index 20a6e465457151b02daa22e6bc059cf0e117ece5..ef4b1f737aaa683bc13c447aa4ca77e5 WebMouseEventButton button() const { return m_button; } unsigned short buttons() const { return m_buttons; } + void playwrightSetButtons(unsigned short buttons) { m_buttons = buttons; } - const WebCore::IntPoint& position() const { return m_position; } // Relative to the view. - void setPosition(const WebCore::IntPoint& position) { m_position = position; } - const WebCore::IntPoint& globalPosition() const { return m_globalPosition; } + const WebCore::DoublePoint& position() const { return m_position; } // Relative to the view. + void setPosition(const WebCore::DoublePoint& position) { m_position = position; } + const WebCore::DoublePoint& globalPosition() const { return m_globalPosition; } diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h -index 02b701cbe003b0f9e16b9712e98c4157ebedbd69..70269920251e4d31f2c73fddc2f8cecbff453498 100644 +index 2561e488be3e3bb74e1d4b154c14217476712dbd..16d8c3c5ff6ad1a62943b97aba11a2e8afc625c0 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.h +++ b/Source/WebKit/Shared/WebPageCreationParameters.h -@@ -303,6 +303,8 @@ struct WebPageCreationParameters { +@@ -311,6 +311,8 @@ struct WebPageCreationParameters { WebCore::ShouldRelaxThirdPartyCookieBlocking shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No }; bool httpsUpgradeEnabled { true }; @@ -8699,10 +8219,10 @@ index 02b701cbe003b0f9e16b9712e98c4157ebedbd69..70269920251e4d31f2c73fddc2f8cecb #if ENABLE(APP_HIGHLIGHTS) WebCore::HighlightVisibility appHighlightsVisible { WebCore::HighlightVisibility::Hidden }; diff --git a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -index 822229ba75d9afe290cc72966cd763bd476f76e1..4487e71729e4c874ffec33374f25aee2ce289c3e 100644 +index 12ad96808abbf6cc6072f45ba6cf51bd2e6ca23f..30c52b2d07bbb7321d518d1bbc74b245c2595387 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in +++ b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -@@ -225,6 +225,8 @@ enum class WebCore::UserInterfaceLayoutDirection : bool; +@@ -229,6 +229,8 @@ enum class WebCore::UserInterfaceLayoutDirection : bool; bool httpsUpgradeEnabled; @@ -8734,20 +8254,20 @@ index b41816f4ba670a7058014f078ef02441c3ab0abf..983d8679574a2555b348ab0df7699253 if (execDirectory) { String processPath = FileSystem::pathByAppendingComponent(FileSystem::stringFromFileSystemRepresentation(execDirectory), StringView::fromLatin1(processName)); diff --git a/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp b/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp -index 8aa8b7623aad418b7ddd81f46c803d9c59d6a943..ac3c89fbb0ec41afe841cffebf9250304581d768 100644 +index 70d2b8b67d93498b94ee6ff3d711d0c13b8ec6e9..9464788f0e3837fe23b717aa8390e9e220a7a37e 100644 --- a/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp +++ b/Source/WebKit/Shared/gtk/NativeWebKeyboardEventGtk.cpp @@ -51,7 +51,7 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent(const String& text, std::optional } NativeWebKeyboardEvent::NativeWebKeyboardEvent(WebEventType type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, Vector&& commands, bool isAutoRepeat, bool isKeypad, OptionSet modifiers) -- : WebKeyboardEvent(WebEvent(type, modifiers, WallTime::now()), text, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, false, std::nullopt, std::nullopt, WTFMove(commands), isAutoRepeat, isKeypad) -+ : WebKeyboardEvent(WebEvent(type, modifiers, WallTime::now()), text, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, false, std::nullopt, std::nullopt, WTFMove(commands), false, isKeypad) +- : WebKeyboardEvent(WebEvent(type, modifiers, MonotonicTime::now()), text, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, false, std::nullopt, std::nullopt, WTFMove(commands), isAutoRepeat, isKeypad) ++ : WebKeyboardEvent(WebEvent(type, modifiers, MonotonicTime::now()), text, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, false, std::nullopt, std::nullopt, WTFMove(commands), false, isKeypad) { } diff --git a/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp b/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp -index 7fcd22cd2172cd7fa77aee12ad5cfcf7a435abba..bc822b40eea889fb0499dd4e78f89f04d87c64a1 100644 +index dc348e105065fd3c5494aa827cd69690f593dc2e..ee883b24d9c62784890b2638014c9427f6ad43ae 100644 --- a/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp +++ b/Source/WebKit/Shared/unix/AuxiliaryProcessMain.cpp @@ -40,6 +40,15 @@ @@ -8766,7 +8286,7 @@ index 7fcd22cd2172cd7fa77aee12ad5cfcf7a435abba..bc822b40eea889fb0499dd4e78f89f04 AuxiliaryProcessMainCommon::AuxiliaryProcessMainCommon() { #if ENABLE(BREAKPAD) -@@ -94,6 +103,10 @@ WTF_ALLOW_UNSAFE_BUFFER_USAGE_END +@@ -81,6 +90,10 @@ WTF_ALLOW_UNSAFE_BUFFER_USAGE_END } #endif @@ -8793,10 +8313,10 @@ index 053e9336017d8818b3cbea79ce7c145fd5c46274..5632498d6ef875df80fc68ec206a9d08 JSC::Config::configureForTesting(); else if (!strcmp(argv[i], "-disable-jit")) diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt -index a978050575b323345d0de29d1abd1fa0bc993e77..f7ead71d28f77932edb9e7f8958b25e99b50fead 100644 +index 4e786e350a6f29dad57a696df0c8a143fe552cd3..ba9cc32943c6e85fee47cfec44ff5281b9fa1ea0 100644 --- a/Source/WebKit/Sources.txt +++ b/Source/WebKit/Sources.txt -@@ -392,6 +392,7 @@ UIProcess/AboutSchemeHandler.cpp +@@ -403,6 +403,7 @@ UIProcess/AboutSchemeHandler.cpp UIProcess/AuxiliaryProcessProxy.cpp UIProcess/BackgroundProcessResponsivenessTimer.cpp UIProcess/BrowsingContextGroup.cpp @@ -8804,7 +8324,7 @@ index a978050575b323345d0de29d1abd1fa0bc993e77..f7ead71d28f77932edb9e7f8958b25e9 UIProcess/DeviceIdHashSaltStorage.cpp UIProcess/DisplayLink.cpp UIProcess/DisplayLinkProcessProxyClient.cpp -@@ -401,6 +402,8 @@ UIProcess/FrameLoadState.cpp +@@ -412,6 +413,8 @@ UIProcess/FrameLoadState.cpp UIProcess/FrameProcess.cpp UIProcess/GeolocationPermissionRequestManagerProxy.cpp UIProcess/GeolocationPermissionRequestProxy.cpp @@ -8813,7 +8333,7 @@ index a978050575b323345d0de29d1abd1fa0bc993e77..f7ead71d28f77932edb9e7f8958b25e9 UIProcess/LegacyGlobalSettings.cpp UIProcess/MediaKeySystemPermissionRequestManagerProxy.cpp UIProcess/MediaKeySystemPermissionRequestProxy.cpp -@@ -408,10 +411,12 @@ UIProcess/ModelElementController.cpp +@@ -419,10 +422,12 @@ UIProcess/ModelElementController.cpp UIProcess/OverrideLanguages.cpp UIProcess/PageClient.cpp UIProcess/PageLoadState.cpp @@ -8826,7 +8346,7 @@ index a978050575b323345d0de29d1abd1fa0bc993e77..f7ead71d28f77932edb9e7f8958b25e9 UIProcess/RemotePageDrawingAreaProxy.cpp UIProcess/RemotePageFullscreenManagerProxy.cpp UIProcess/RemotePagePlaybackSessionManagerProxy.cpp -@@ -456,6 +461,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp +@@ -467,6 +472,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp UIProcess/WebPageDiagnosticLoggingClient.cpp UIProcess/WebPageGroup.cpp UIProcess/WebPageInjectedBundleClient.cpp @@ -8835,8 +8355,8 @@ index a978050575b323345d0de29d1abd1fa0bc993e77..f7ead71d28f77932edb9e7f8958b25e9 UIProcess/WebPageProxy.cpp UIProcess/WebPageProxyMessageReceiverRegistration.cpp UIProcess/WebPageProxyTesting.cpp -@@ -609,6 +616,9 @@ UIProcess/Inspector/WebPageDebuggable.cpp - UIProcess/Inspector/WebPageInspectorController.cpp +@@ -631,6 +638,9 @@ UIProcess/Inspector/WebPageInspectorController.cpp + UIProcess/Inspector/WebPageInspectorTargetProxy.cpp UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp +UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp @@ -8846,30 +8366,38 @@ index a978050575b323345d0de29d1abd1fa0bc993e77..f7ead71d28f77932edb9e7f8958b25e9 UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp UIProcess/Media/MediaUsageManager.cpp diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt -index 4e2c7431cfc5c1b952232c30d6aa7f46815813c7..095c1b78812df547ab8cbe62e4ac801b5eb98968 100644 +index e3e1925996d74c6837aaf09e74f1253b0e7445dd..bad2a8f00722e766c6e1562a990e845e75041f04 100644 --- a/Source/WebKit/SourcesCocoa.txt +++ b/Source/WebKit/SourcesCocoa.txt -@@ -270,6 +270,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm - UIProcess/API/Cocoa/_WKAttachment.mm - UIProcess/API/Cocoa/_WKAutomationSession.mm - UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm -+UIProcess/API/Cocoa/_WKBrowserInspector.mm - UIProcess/API/Cocoa/_WKContentRuleListAction.mm - UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm - UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @no-unify -@@ -467,6 +468,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm - UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.mm - - UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm -+UIProcess/Inspector/mac/ScreencastEncoderMac.mm - UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm - UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm - UIProcess/Inspector/mac/WKInspectorViewController.mm +@@ -279,6 +279,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm @nonARC + UIProcess/API/Cocoa/_WKAttachment.mm @nonARC + UIProcess/API/Cocoa/_WKAutomationSession.mm @nonARC + UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm @nonARC ++UIProcess/API/Cocoa/_WKBrowserInspector.mm @nonARC + UIProcess/API/Cocoa/_WKContentRuleListAction.mm @nonARC + UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm @nonARC + UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @nonARC @no-unify +@@ -518,6 +519,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm @nonARC + UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.mm @nonARC + + UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm @nonARC ++UIProcess/Inspector/mac/ScreencastEncoderMac.mm @nonARC + UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm @nonARC + UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm @nonARC + UIProcess/Inspector/mac/WKInspectorViewController.mm @nonARC diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt -index 68733a26a5cb0cd8f944b5ab48eacb256e147976..b8d320e417303329b9a6fa56ce4c3f6fccc286b8 100644 +index 6d57dee8517770c8b353a092cd2b42bddd922636..212f0db2f01803823a6f52553681cc3e6f948ffd 100644 --- a/Source/WebKit/SourcesGTK.txt +++ b/Source/WebKit/SourcesGTK.txt -@@ -122,6 +122,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify +@@ -53,6 +53,7 @@ NetworkProcess/soup/WebSocketTaskSoup.cpp + NetworkProcess/webrtc/LibWebRTCSocketClient.cpp + NetworkProcess/webrtc/NetworkRTCMonitor.cpp + NetworkProcess/webrtc/NetworkRTCProvider.cpp ++NetworkProcess/webrtc/NetworkRTCSharedMonitor.cpp + + Platform/IPC/glib/ConnectionGLib.cpp + +@@ -126,6 +127,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 @@ -8877,7 +8405,7 @@ index 68733a26a5cb0cd8f944b5ab48eacb256e147976..b8d320e417303329b9a6fa56ce4c3f6f UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify UIProcess/API/glib/WebKitCookieManager.cpp @no-unify UIProcess/API/glib/WebKitCredential.cpp @no-unify -@@ -254,6 +255,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cpp +@@ -259,6 +261,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cpp UIProcess/glib/DisplayVBlankMonitorThreaded.cpp UIProcess/glib/DisplayVBlankMonitorTimer.cpp UIProcess/glib/FenceMonitor.cpp @@ -8885,28 +8413,38 @@ index 68733a26a5cb0cd8f944b5ab48eacb256e147976..b8d320e417303329b9a6fa56ce4c3f6f UIProcess/glib/ScreenManager.cpp UIProcess/glib/SystemSettingsManagerProxy.cpp UIProcess/glib/WebPageProxyGLib.cpp -@@ -272,6 +274,7 @@ UIProcess/gtk/DisplayX11.cpp @no-unify +@@ -274,7 +277,6 @@ UIProcess/gtk/ClipboardGtk4.cpp @no-unify + UIProcess/gtk/Display.cpp @no-unify + UIProcess/gtk/DisplayX11.cpp @no-unify UIProcess/gtk/DisplayWayland.cpp @no-unify - UIProcess/gtk/WebDateTimePickerGtk.cpp +-UIProcess/gtk/WebDateTimePickerGtk.cpp UIProcess/gtk/HardwareAccelerationManager.cpp -+UIProcess/gtk/InspectorTargetProxyGtk.cpp UIProcess/gtk/KeyBindingTranslator.cpp UIProcess/gtk/PointerLockManager.cpp @no-unify - UIProcess/gtk/PointerLockManagerWayland.cpp @no-unify -@@ -285,6 +288,8 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp +@@ -289,6 +291,10 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp UIProcess/gtk/WebColorPickerGtk.cpp UIProcess/gtk/WebContextMenuProxyGtk.cpp UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp ++UIProcess/gtk/WebDateTimePickerGtk.cpp +UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp +UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp ++UIProcess/gtk/WebPageInspectorTargetProxyGtk.cpp UIProcess/gtk/WebPageProxyGtk.cpp @no-unify UIProcess/gtk/WebPasteboardProxyGtk.cpp UIProcess/gtk/WebPopupMenuProxyGtk.cpp diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt -index f3647727106bd3786d17adaf0c5f373184ace9fb..419a5a7002ed6567f0110fa63ff723691f027669 100644 +index 3d8dc9293ce3ff609e14f6a06618dd6b8c406ee4..cd5c076432bd59610fb7174a06126d68d72b1c60 100644 --- a/Source/WebKit/SourcesWPE.txt +++ b/Source/WebKit/SourcesWPE.txt -@@ -124,6 +124,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify +@@ -53,6 +53,7 @@ NetworkProcess/soup/WebSocketTaskSoup.cpp + NetworkProcess/webrtc/LibWebRTCSocketClient.cpp + NetworkProcess/webrtc/NetworkRTCMonitor.cpp + NetworkProcess/webrtc/NetworkRTCProvider.cpp ++NetworkProcess/webrtc/NetworkRTCSharedMonitor.cpp + + Platform/IPC/android/ArgumentCodersAndroid.cpp + +@@ -129,6 +130,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 @@ -8914,7 +8452,7 @@ index f3647727106bd3786d17adaf0c5f373184ace9fb..419a5a7002ed6567f0110fa63ff72369 UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify UIProcess/API/glib/WebKitCookieManager.cpp @no-unify UIProcess/API/glib/WebKitCredential.cpp @no-unify -@@ -157,6 +158,7 @@ UIProcess/API/glib/WebKitOptionMenu.cpp @no-unify +@@ -162,6 +164,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 @@ -8922,7 +8460,7 @@ index f3647727106bd3786d17adaf0c5f373184ace9fb..419a5a7002ed6567f0110fa63ff72369 UIProcess/API/glib/WebKitPolicyDecision.cpp @no-unify UIProcess/API/glib/WebKitPrivate.cpp @no-unify UIProcess/API/glib/WebKitProtocolHandler.cpp @no-unify -@@ -226,6 +228,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cpp +@@ -232,6 +235,7 @@ UIProcess/glib/DisplayVBlankMonitorDRM.cpp UIProcess/glib/DisplayVBlankMonitorThreaded.cpp UIProcess/glib/DisplayVBlankMonitorTimer.cpp UIProcess/glib/FenceMonitor.cpp @@ -8930,11 +8468,7 @@ index f3647727106bd3786d17adaf0c5f373184ace9fb..419a5a7002ed6567f0110fa63ff72369 UIProcess/glib/ScreenManager.cpp UIProcess/glib/SystemSettingsManagerProxy.cpp UIProcess/glib/WebPageProxyGLib.cpp -@@ -258,9 +261,15 @@ UIProcess/soup/WebProcessPoolSoup.cpp - - UIProcess/wpe/AcceleratedBackingStoreDMABuf.cpp - UIProcess/wpe/DisplayVBlankMonitorWPE.cpp -+UIProcess/wpe/InspectorTargetProxyWPE.cpp +@@ -267,6 +271,12 @@ UIProcess/wpe/DisplayVBlankMonitorWPE.cpp UIProcess/wpe/ScreenManagerWPE.cpp UIProcess/wpe/SystemSettingsManagerProxyWPE.cpp UIProcess/wpe/WPEUtilities.cpp @@ -8943,23 +8477,15 @@ index f3647727106bd3786d17adaf0c5f373184ace9fb..419a5a7002ed6567f0110fa63ff72369 +UIProcess/wpe/WebDateTimePickerWPE.cpp +UIProcess/wpe/WebPageInspectorEmulationAgentWPE.cpp +UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp ++UIProcess/wpe/WebPageInspectorTargetProxyWPE.cpp UIProcess/wpe/WebPageProxyWPE.cpp UIProcess/wpe/WebPasteboardProxyWPE.cpp UIProcess/wpe/WebPreferencesWPE.cpp -@@ -292,6 +301,8 @@ WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp - - WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp - -+WebProcess/WebCoreSupport/wpe/WebDragClientWPE.cpp -+ - WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp - - WebProcess/WebPage/AcceleratedSurface.cpp diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp -index 1182f2afe2c857598449d3dee6c1be028746c595..4256f65734adf9c68a30d70cc49c0b3a6fec1b1a 100644 +index e67ce2103b4f2f8b53ab8413541dfe5a8055f3f0..5aca33e2247686246480b743c19016388a854129 100644 --- a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp +++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp -@@ -273,6 +273,11 @@ RefPtr PageConfiguration::protectedRelatedPage() const +@@ -278,6 +278,11 @@ RefPtr PageConfiguration::protectedRelatedPage() const return relatedPage(); } @@ -8972,10 +8498,10 @@ index 1182f2afe2c857598449d3dee6c1be028746c595..4256f65734adf9c68a30d70cc49c0b3a { return m_data.pageToCloneSessionStorageFrom.get(); diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.h b/Source/WebKit/UIProcess/API/APIPageConfiguration.h -index 43a17d77b13b0e51217506425607b8e0698062e4..96c7747d26cfa1d196796c784c046f6c17666969 100644 +index 5f5eb4cc17480ce91e74711c5248d62be2fffc1f..9993fcefd2fd4f4ac6384e82da1172f8d4dafa93 100644 --- a/Source/WebKit/UIProcess/API/APIPageConfiguration.h +++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.h -@@ -160,6 +160,10 @@ public: +@@ -164,6 +164,10 @@ public: void setRelatedPage(WeakPtr&& relatedPage) { m_data.relatedPage = WTFMove(relatedPage); } RefPtr protectedRelatedPage() const; @@ -8986,7 +8512,7 @@ index 43a17d77b13b0e51217506425607b8e0698062e4..96c7747d26cfa1d196796c784c046f6c WebKit::WebPageProxy* pageToCloneSessionStorageFrom() const; void setPageToCloneSessionStorageFrom(WeakPtr&&); -@@ -516,6 +520,7 @@ private: +@@ -528,6 +532,7 @@ private: #endif RefPtr pageGroup; WeakPtr relatedPage; @@ -8995,7 +8521,7 @@ index 43a17d77b13b0e51217506425607b8e0698062e4..96c7747d26cfa1d196796c784c046f6c WebCore::Site openedSite; WTF::String openedMainFrameName; diff --git a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp -index e256b905bf9727aa7c8a48012237a6a6bc9acdbc..4e855c441af6f235f0fd8dfdd57b9bd6e4646492 100644 +index c5f71591fa0cc654a597eb0e25c60b5f9632596c..3638376f2e8ddcf7fe70355e7cd1d70057f8907e 100644 --- a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp +++ b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp @@ -52,6 +52,10 @@ Ref ProcessPoolConfiguration::copy() @@ -9010,7 +8536,7 @@ index e256b905bf9727aa7c8a48012237a6a6bc9acdbc..4e855c441af6f235f0fd8dfdd57b9bd6 copy->m_shouldTakeUIBackgroundAssertion = this->m_shouldTakeUIBackgroundAssertion; copy->m_shouldCaptureDisplayInUIProcess = this->m_shouldCaptureDisplayInUIProcess; diff --git a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h -index 2fe09a750bf32bd6f124603af08e16adba8a6c7c..5ca91400765fd53559b4f4cefa172b5a1f417196 100644 +index 24c73a26a542863f734cb698daeceadf693c70e0..871a97de130d0d15396a3716eca055334e31cae2 100644 --- a/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h +++ b/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h @@ -96,6 +96,16 @@ public: @@ -9030,7 +8556,7 @@ index 2fe09a750bf32bd6f124603af08e16adba8a6c7c..5ca91400765fd53559b4f4cefa172b5a bool alwaysRunsAtBackgroundPriority() const { return m_alwaysRunsAtBackgroundPriority; } void setAlwaysRunsAtBackgroundPriority(bool alwaysRunsAtBackgroundPriority) { m_alwaysRunsAtBackgroundPriority = alwaysRunsAtBackgroundPriority; } -@@ -178,6 +188,10 @@ private: +@@ -181,6 +191,10 @@ private: bool m_ignoreSynchronousMessagingTimeoutsForTesting { false }; bool m_attrStyleEnabled { false }; bool m_shouldThrowExceptionForGlobalConstantRedeclaration { true }; @@ -9042,17 +8568,17 @@ index 2fe09a750bf32bd6f124603af08e16adba8a6c7c..5ca91400765fd53559b4f4cefa172b5a bool m_shouldTakeUIBackgroundAssertion { true }; bool m_shouldCaptureDisplayInUIProcess { DEFAULT_CAPTURE_DISPLAY_IN_UI_PROCESS }; diff --git a/Source/WebKit/UIProcess/API/APIUIClient.h b/Source/WebKit/UIProcess/API/APIUIClient.h -index b5c743d02f89afbe0c9a90e5f7e746fbd31fbbb2..29dbedfcf6929788b4810b8e98acaee26d1a686d 100644 +index 30465b8aabd1981298ffc42c4cb643bc40a625fa..4c0a1887f886c735b5b715dcc6739daf3ab5e857 100644 --- a/Source/WebKit/UIProcess/API/APIUIClient.h +++ b/Source/WebKit/UIProcess/API/APIUIClient.h -@@ -114,6 +114,7 @@ public: +@@ -116,6 +116,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()); } + virtual void handleJavaScriptDialog(WebKit::WebPageProxy&, bool, const WTF::String&) { } virtual void setStatusText(WebKit::WebPageProxy*, const WTF::String&) { } - virtual void mouseDidMoveOverElement(WebKit::WebPageProxy&, const WebKit::WebHitTestResultData&, OptionSet, Object*) { } + virtual void mouseDidMoveOverElement(WebKit::WebPageProxy&, const WebKit::WebHitTestResultData&, OptionSet) { } diff --git a/Source/WebKit/UIProcess/API/C/WKInspector.cpp b/Source/WebKit/UIProcess/API/C/WKInspector.cpp index 1aa386d598a35dbda34161ed956d653a2da99bec..9aaeb894594f797931bac01314eb3e2ca8669855 100644 --- a/Source/WebKit/UIProcess/API/C/WKInspector.cpp @@ -9097,10 +8623,10 @@ index 026121d114c5fcad84c1396be8d692625beaa3bd..edd6e5cae033124c589959a42522fde0 } #endif diff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp -index e15be39b349437382ef59f303986dac5246856dd..08b0290d847a046a5861475b7a5015513b22551f 100644 +index 357460fbf0ab78dd06a34af9270a046d1191980b..79cce3a4dbe20915a2b02db2828bd9d16173596c 100644 --- a/Source/WebKit/UIProcess/API/C/WKPage.cpp +++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp -@@ -1943,6 +1943,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient +@@ -1911,6 +1911,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient m_client.addMessageToConsole(toAPI(&page), toAPI(message.impl()), m_client.base.clientInfo); } @@ -9114,7 +8640,7 @@ index e15be39b349437382ef59f303986dac5246856dd..08b0290d847a046a5861475b7a501551 void setStatusText(WebPageProxy* page, const String& text) final { if (!m_client.setStatusText) -@@ -1972,6 +1979,8 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient +@@ -1948,6 +1955,8 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient { if (!m_client.didNotHandleKeyEvent) return; @@ -9124,7 +8650,7 @@ index e15be39b349437382ef59f303986dac5246856dd..08b0290d847a046a5861475b7a501551 } diff --git a/Source/WebKit/UIProcess/API/C/WKPageUIClient.h b/Source/WebKit/UIProcess/API/C/WKPageUIClient.h -index fc43c44a85a0fc6bf5f8c643bd120a16ce762914..ee86fd213d25682f9b6553ec7da99bc8a812212b 100644 +index ae4a98c2fe5782eb2356dc8b6b486f6b44db6db3..62b2f3c351fe287af11c1ee2815f1fabe044d537 100644 --- a/Source/WebKit/UIProcess/API/C/WKPageUIClient.h +++ b/Source/WebKit/UIProcess/API/C/WKPageUIClient.h @@ -98,6 +98,7 @@ typedef void (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStri @@ -9135,7 +8661,7 @@ index fc43c44a85a0fc6bf5f8c643bd120a16ce762914..ee86fd213d25682f9b6553ec7da99bc8 typedef void (*WKPageRequestStorageAccessConfirmCallback)(WKPageRef page, WKFrameRef frame, WKStringRef requestingDomain, WKStringRef currentDomain, WKPageRequestStorageAccessConfirmResultListenerRef listener, const void *clientInfo); typedef void (*WKPageTakeFocusCallback)(WKPageRef page, WKFocusDirection direction, const void *clientInfo); typedef void (*WKPageFocusCallback)(WKPageRef page, const void *clientInfo); -@@ -1365,6 +1366,7 @@ typedef struct WKPageUIClientV14 { +@@ -1366,6 +1367,7 @@ typedef struct WKPageUIClientV14 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -9143,7 +8669,7 @@ index fc43c44a85a0fc6bf5f8c643bd120a16ce762914..ee86fd213d25682f9b6553ec7da99bc8 } WKPageUIClientV14; typedef struct WKPageUIClientV15 { -@@ -1472,6 +1474,7 @@ typedef struct WKPageUIClientV15 { +@@ -1473,6 +1475,7 @@ typedef struct WKPageUIClientV15 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -9151,7 +8677,7 @@ index fc43c44a85a0fc6bf5f8c643bd120a16ce762914..ee86fd213d25682f9b6553ec7da99bc8 // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1583,6 +1586,7 @@ typedef struct WKPageUIClientV16 { +@@ -1584,6 +1587,7 @@ typedef struct WKPageUIClientV16 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -9159,7 +8685,7 @@ index fc43c44a85a0fc6bf5f8c643bd120a16ce762914..ee86fd213d25682f9b6553ec7da99bc8 // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1697,6 +1701,7 @@ typedef struct WKPageUIClientV17 { +@@ -1698,6 +1702,7 @@ typedef struct WKPageUIClientV17 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -9167,7 +8693,7 @@ index fc43c44a85a0fc6bf5f8c643bd120a16ce762914..ee86fd213d25682f9b6553ec7da99bc8 // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1811,6 +1816,7 @@ typedef struct WKPageUIClientV18 { +@@ -1812,6 +1817,7 @@ typedef struct WKPageUIClientV18 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -9175,7 +8701,7 @@ index fc43c44a85a0fc6bf5f8c643bd120a16ce762914..ee86fd213d25682f9b6553ec7da99bc8 // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; -@@ -1927,6 +1933,7 @@ typedef struct WKPageUIClientV19 { +@@ -1928,6 +1934,7 @@ typedef struct WKPageUIClientV19 { // Version 14. WKPageRunWebAuthenticationPanelCallback runWebAuthenticationPanel; @@ -9201,7 +8727,7 @@ index 2ce017d213d7875eee965e554af6befb5a3c3908..79b11310d358d3edc49e30420728e1eb /*! @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 930357ac3469195e9f33d5ffce92777018bb0b13..f62555ec562f8416976d31692e8fb1751a04d458 100644 +index 47b1b5ed21a65035d9bef05a991845480cfa1e93..17bd5eeafa50f94062b6f2a1b178efbfd23722fc 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h @@ -138,6 +138,8 @@ WK_CLASS_AVAILABLE(macos(10.11), ios(9.0)) @@ -9214,7 +8740,7 @@ index 930357ac3469195e9f33d5ffce92777018bb0b13..f62555ec562f8416976d31692e8fb175 NS_ASSUME_NONNULL_END diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm -index e5c1fb49feda418fe4989474a7145016529409c5..ef1ffc4e07e9af85c50bb51d60d0af87c4352eeb 100644 +index 5b2e169144a7095dbb44a4d4f5d9779ab08a5c92..5793a58f259b57963463bc62450a5cb2a885da93 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm @@ -55,6 +55,7 @@ @@ -9368,7 +8894,7 @@ index 0000000000000000000000000000000000000000..69eb9c6aa30beb8ea21a0ef647e46304 +} +@end diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h -index 7b6c36521ebd5afbd58454192c8dece450b2e90a..a4a0ca2f69b1cc59fccbc261e1dff4e2f15d6e86 100644 +index da15690a3d5a783a96aa5557676abeb7c349061d..cf3c06c2f1e9def8fa342019770f03d3673f41d8 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h @@ -67,6 +67,7 @@ WK_EXTERN WK_API_DEPRECATED("Creating and using multiple instances of WKProcessP @@ -9380,7 +8906,7 @@ index 7b6c36521ebd5afbd58454192c8dece450b2e90a..a4a0ca2f69b1cc59fccbc261e1dff4e2 @property (nonatomic) BOOL processSwapsOnNavigationWithinSameNonHTTPFamilyProtocol WK_API_AVAILABLE(macos(12.0), ios(15.0)); @property (nonatomic) BOOL prewarmsProcessesAutomatically WK_API_AVAILABLE(macos(10.14.4), ios(12.2)); diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm -index 7d6be90da095403d61a44afbe8e08eb9569ecffc..c96e67fdd7887c18d150067cd94c99c62a4abfeb 100644 +index d12e529ffef1a56c0b451b9d78c5d4bf48be20c7..b2db01631e2511794a1511a2a8eacefa60fe407e 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm @@ -243,6 +243,16 @@ - (BOOL)processSwapsOnNavigation @@ -9629,10 +9155,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 ef24e41f2c62e77e701a6e2b698c60004eaf0789..fd332a5b07f1dea7792eeee3bd9b5efb48afc0c5 100644 +index 7649e25c72d68860639c609d1f7cc1a8a1908167..7f57f768d7075d95db4c6a02b52442a1d081c981 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp -@@ -101,6 +101,10 @@ private: +@@ -102,6 +102,10 @@ private: page.makeViewBlankIfUnpaintedSinceLastLoadCommit(); webkitWebViewRunJavaScriptPrompt(m_webView, message.utf8(), defaultValue.utf8(), WTFMove(completionHandler)); } @@ -9644,7 +9170,7 @@ index ef24e41f2c62e77e701a6e2b698c60004eaf0789..fd332a5b07f1dea7792eeee3bd9b5efb 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 dca689a7ace576571ca8ceb0b51921857b68b64c..e321049561de548aa517df0a8d6f91e86889e8e1 100644 +index 364957d88a8eac8b4ac7d851cc19e3d73eaf9d54..b21d76dda85b1bed7b937d8c7a4af34b158099a9 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp @@ -430,10 +430,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa @@ -9713,10 +9239,10 @@ index c1945fbe717a42afc1f51d64a80c7de3fa9009ba..ab63fe19b00ecbd64c9421e6eecad3e2 #endif +int webkitWebContextExistingCount(); diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031815a2202 100644 +index 0342e8e8d333ebc7f8c77a0f93f409f29f3db306..200520c65f644930ae8b3edfbab2e384c1d9c517 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -@@ -39,6 +39,7 @@ +@@ -40,6 +40,7 @@ #include "WebContextMenuItem.h" #include "WebContextMenuItemData.h" #include "WebFrameProxy.h" @@ -9724,7 +9250,7 @@ index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031 #include "WebKitAuthenticationRequestPrivate.h" #include "WebKitBackForwardListPrivate.h" #include "WebKitContextMenuClient.h" -@@ -154,6 +155,7 @@ enum { +@@ -155,6 +156,7 @@ enum { CLOSE, SCRIPT_DIALOG, @@ -9732,7 +9258,7 @@ index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031 DECIDE_POLICY, PERMISSION_REQUEST, -@@ -524,6 +526,13 @@ GRefPtr WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& p +@@ -529,6 +531,13 @@ GRefPtr WebKitWebViewClient::showOptionMenu(WebKitPopupMenu& p void WebKitWebViewClient::frameDisplayed(WKWPE::View&) { @@ -9746,7 +9272,7 @@ index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031 { SetForScope inFrameDisplayedGuard(m_webView->priv->inFrameDisplayed, true); for (const auto& callback : m_webView->priv->frameDisplayedCallbacks) { -@@ -540,6 +549,13 @@ void WebKitWebViewClient::frameDisplayed(WKWPE::View&) +@@ -545,6 +554,13 @@ void WebKitWebViewClient::frameDisplayed(WKWPE::View&) } } @@ -9760,7 +9286,7 @@ index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031 void WebKitWebViewClient::willStartLoad(WKWPE::View&) { webkitWebViewWillStartLoad(m_webView); -@@ -631,7 +647,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision* +@@ -636,7 +652,7 @@ static gboolean webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision* static gboolean webkitWebViewPermissionRequest(WebKitWebView*, WebKitPermissionRequest* request) { @@ -9769,7 +9295,7 @@ index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031 if (WEBKIT_IS_POINTER_LOCK_PERMISSION_REQUEST(request)) { webkit_permission_request_allow(request); return TRUE; -@@ -954,6 +970,10 @@ static void webkitWebViewConstructed(GObject* object) +@@ -959,6 +975,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); @@ -9780,7 +9306,7 @@ index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031 webkitWebViewCreatePage(webView, WTFMove(configuration)); webkitWebContextWebViewCreated(priv->context.get(), webView); -@@ -2022,6 +2042,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) +@@ -2044,6 +2064,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_SCRIPT_DIALOG); @@ -9796,7 +9322,7 @@ index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031 /** * WebKitWebView::decide-policy: * @web_view: the #WebKitWebView on which the signal is emitted -@@ -2812,6 +2841,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const +@@ -2834,6 +2863,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const webkit_script_dialog_unref(webView->priv->currentScriptDialog); } @@ -9821,7 +9347,7 @@ index 449a8b1247c7397cd9709e425f8824a90bc77404..b374e3f5104572d44a6fbbb8384d3031 { if (!webView->priv->currentScriptDialog) diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h -index c80a5073b50ae7273985c9165cffc1d361a2ff03..7b1ce505325c735a0bf1c23f031ad1ee10639b91 100644 +index 4e16a2a088f6e48f43362850cc047da7de3c88ef..5ca5ae9572d2ed962d80a5dd67f8f379cd9e8117 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h @@ -64,6 +64,7 @@ void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message, Fun @@ -9833,7 +9359,7 @@ index c80a5073b50ae7273985c9165cffc1d361a2ff03..7b1ce505325c735a0bf1c23f031ad1ee bool webkitWebViewIsScriptDialogRunning(WebKitWebView*, WebKitScriptDialog*); String webkitWebViewGetCurrentScriptDialogMessage(WebKitWebView*); diff --git a/Source/WebKit/UIProcess/API/glib/webkit.h.in b/Source/WebKit/UIProcess/API/glib/webkit.h.in -index 763cd55f7abca011ac8bc4fef7f233bf52854cda..bd43917b274bf19ff9f3d96b7e80e20710372cba 100644 +index f01ddc55dd7a09d975b937aa95d0a256c13d4995..bfbd8dc089048a34a75f7fe3457b40cd8bb97f5f 100644 --- a/Source/WebKit/UIProcess/API/glib/webkit.h.in +++ b/Source/WebKit/UIProcess/API/glib/webkit.h.in @@ -45,6 +45,7 @@ @@ -9845,7 +9371,7 @@ index 763cd55f7abca011ac8bc4fef7f233bf52854cda..bd43917b274bf19ff9f3d96b7e80e207 #include <@API_INCLUDE_PREFIX@/WebKitClipboardPermissionRequest.h> #include <@API_INCLUDE_PREFIX@/WebKitColorChooserRequest.h> diff --git a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp -index 92218ae7cac5f31db31d9ecde99094331a465ebf..e9d4e786b8640d93fb35187cba96496f6bbb1d32 100644 +index 9a36fe28ce7a5aac1b45350e3fc9e72b1a00dac1..cc661fa57e7ec1469e1ec003d783028d59836f06 100644 --- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp +++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp @@ -270,6 +270,8 @@ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool @@ -9870,7 +9396,7 @@ index 92218ae7cac5f31db31d9ecde99094331a465ebf..e9d4e786b8640d93fb35187cba96496f 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 3cafc1ed805da8f947dc8c8c28327116f1d3c8a4..a8ed97eb566e4f966f85b03ea55d8dfccc608e58 100644 +index ae0d906fb4bb5ff323f1e494f866c1f24b4d1e0e..e62064b583cef05f6d7c5a47b0130a4fc7e21ec8 100644 --- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h +++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h @@ -104,7 +104,7 @@ private: @@ -9983,7 +9509,7 @@ 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 b58f8dd27e62f047857ed2f36fcd6dbd80e8038d..897d4f038d6dcbd9a4a37dbdda91fae46f56f521 100644 +index da5d9873058905fc464c4793a352d69218f75538..20a4c43caa6571420370c1e0e1cbed45aaeb4198 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp @@ -2884,6 +2884,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase) @@ -10014,7 +9540,7 @@ index b58f8dd27e62f047857ed2f36fcd6dbd80e8038d..897d4f038d6dcbd9a4a37dbdda91fae4 #if !USE(GTK4) diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h -index 8a71b1d7d9b9ef8bfe4a6935e3788e40a5fe6d5d..dad4a47725cc3a5d9d3fd6b1f4ec23c866cfe973 100644 +index 9553631aa4fc49456ae6061abae2a896da9a6988..5b4fd77cb616b5ade74889bb35ff75299272b005 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h @@ -27,6 +27,7 @@ @@ -10024,7 +9550,7 @@ index 8a71b1d7d9b9ef8bfe4a6935e3788e40a5fe6d5d..dad4a47725cc3a5d9d3fd6b1f4ec23c8 +#include "AcceleratedBackingStore.h" #include "APIPageConfiguration.h" #include "InputMethodState.h" - #include "RendererBufferFormat.h" + #include "RendererBufferDescription.h" @@ -104,7 +105,7 @@ void webkitWebViewBaseStartDrag(WebKitWebViewBase*, WebCore::SelectionData&&, Op void webkitWebViewBaseDidPerformDragControllerAction(WebKitWebViewBase*); #endif @@ -10037,7 +9563,7 @@ index 8a71b1d7d9b9ef8bfe4a6935e3788e40a5fe6d5d..dad4a47725cc3a5d9d3fd6b1f4ec23c8 @@ -145,3 +146,5 @@ void webkitWebViewBaseSetPlugID(WebKitWebViewBase*, const String&); #endif - WebKit::RendererBufferFormat webkitWebViewBaseGetRendererBufferFormat(WebKitWebViewBase*); + WebKit::RendererBufferDescription webkitWebViewBaseGetRendererBufferDescription(WebKitWebViewBase*); + +WebKit::AcceleratedBackingStore* webkitWebViewBaseGetAcceleratedBackingStore(WebKitWebViewBase*); diff --git a/Source/WebKit/UIProcess/API/wpe/APIViewClient.h b/Source/WebKit/UIProcess/API/wpe/APIViewClient.h @@ -10067,7 +9593,7 @@ index 9091ae5198e765c2cfe0584d121afe4f88df3c0e..b0efedec419673ef2bfd0fd79406774e 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 ab67db0aab214edea4f3c7ff80e1fa27c7c0a95b..069d41ca9eb33fdc851fc96a7b260ceca9fdfa9a 100644 +index 0cc3b527fb27dcae943b6bae522ad5fd2925843c..b2c4aea4996b73da224f9f320522b3f74567ed08 100644 --- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp +++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp @@ -35,9 +35,12 @@ @@ -10096,7 +9622,7 @@ index ab67db0aab214edea4f3c7ff80e1fa27c7c0a95b..069d41ca9eb33fdc851fc96a7b260cec namespace WebKit { WTF_MAKE_TZONE_ALLOCATED_IMPL(PageClientImpl); -@@ -302,14 +311,14 @@ Ref PageClientImpl::createContextMenuProxy(WebPageProxy& pa +@@ -305,14 +314,14 @@ Ref PageClientImpl::createContextMenuProxy(WebPageProxy& pa } #endif @@ -10115,7 +9641,7 @@ index ab67db0aab214edea4f3c7ff80e1fa27c7c0a95b..069d41ca9eb33fdc851fc96a7b260cec } RefPtr PageClientImpl::createDateTimePicker(WebPageProxy& page) -@@ -551,6 +560,37 @@ void PageClientImpl::selectionDidChange() +@@ -554,6 +563,37 @@ void PageClientImpl::selectionDidChange() m_view.selectionDidChange(); } @@ -10153,7 +9679,7 @@ index ab67db0aab214edea4f3c7ff80e1fa27c7c0a95b..069d41ca9eb33fdc851fc96a7b260cec WebKitWebResourceLoadManager* PageClientImpl::webResourceLoadManager() { return m_view.webResourceLoadManager(); -@@ -561,4 +601,11 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler&& +@@ -564,4 +604,11 @@ void PageClientImpl::callAfterNextPresentationUpdate(CompletionHandler&& m_view.callAfterNextPresentationUpdate(WTFMove(callback)); } @@ -10166,10 +9692,10 @@ index ab67db0aab214edea4f3c7ff80e1fa27c7c0a95b..069d41ca9eb33fdc851fc96a7b260cec + } // namespace WebKit diff --git a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h -index 000b7c9950785f55fdfdcaa186026903a506c79e..2f0f821890ab40bcfa68b105710484674600a2db 100644 +index 8c257afe81fd1719434e74a3deea50991132b55b..14fd72fef0cc90464212f41770577c0c645bef9e 100644 --- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h +++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h -@@ -184,9 +184,15 @@ private: +@@ -185,9 +185,15 @@ private: void didChangeWebPageID() const override; void selectionDidChange() override; @@ -10184,8 +9710,8 @@ index 000b7c9950785f55fdfdcaa186026903a506c79e..2f0f821890ab40bcfa68b10571048467 +#endif + WKWPE::View& m_view; + DefaultUndoController m_undoController; #if ENABLE(FULLSCREEN_API) - std::unique_ptr m_fullscreenClientForTesting; diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitBrowserInspector.h b/Source/WebKit/UIProcess/API/wpe/WebKitBrowserInspector.h new file mode 100644 index 0000000000000000000000000000000000000000..273c5105cdf1638955cea01128c9bbab3e64436c @@ -10274,7 +9800,7 @@ index 0000000000000000000000000000000000000000..273c5105cdf1638955cea01128c9bbab + +#endif diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp -index 763bda5b29304f7ed7133c0a8158e6c8b94c5ea1..8ed962e8c1af62b9b73a68348d0d88765429861d 100644 +index 08e754111893d5f3c5dac7502b48ad2b3c760540..283f05d35729aee22659ab4b661686159ff9ad3b 100644 --- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp +++ b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp @@ -54,6 +54,7 @@ struct _WebKitWebViewBackend { @@ -10303,8 +9829,8 @@ index 763bda5b29304f7ed7133c0a8158e6c8b94c5ea1..8ed962e8c1af62b9b73a68348d0d8876 +} + namespace WTF { - - template <> WebKitWebViewBackend* refGPtr(WebKitWebViewBackend* ptr) + WTF_DEFINE_GREF_TRAITS(WebKitWebViewBackend, webkitWebViewBackendRef, webkitWebViewBackendUnref) + } diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h index 16dcc1f69c38cd8ad630bc49d6d69feaa3aa811e..98677028c19c12c3b6d513bb5e45375a1528fe8a 100644 --- a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h @@ -10335,10 +9861,10 @@ index 16dcc1f69c38cd8ad630bc49d6d69feaa3aa811e..98677028c19c12c3b6d513bb5e45375a #endif /* WebKitWebViewBackend_h */ diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h b/Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h -index e4b92ace1531090ae38a7aec3d3d4febf19aee84..b66b573f9148c39c5ce2738add6cd01a9a352be8 100644 +index 8987c95d8493e446e871545fc84306b279bb39b6..3e12d7f309f5bb76bde712b383d7c7c9bd682f26 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); +@@ -28,3 +28,5 @@ WTF_DECLARE_GREF_TRAITS(WebKitWebViewBackend) } void webkitWebViewBackendUnref(WebKitWebViewBackend*); @@ -10361,10 +9887,10 @@ index 0fa1f2e970ed0c0232df9b9c7b8b4bcd0ceac655..d68c6747edc699de7d84bae2a63b927d 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 d0a40e3e9f4d59f894c0574926ee13b2d83767ab..3dfd8e059273d2a14494b76892e5abfe66475c2e 100644 +index 495d3a628ca4d4988d1f31fc67a709f2b740da32..cda238e333dd668abbc8e22ce684b6d029a81e35 100644 --- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.h +++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.h -@@ -287,6 +287,8 @@ public: +@@ -297,6 +297,8 @@ public: void didDestroyFrame(WebCore::FrameIdentifier); @@ -10373,7 +9899,7 @@ index d0a40e3e9f4d59f894c0574926ee13b2d83767ab..3dfd8e059273d2a14494b76892e5abfe RefPtr webPageProxyForHandle(const String&); String handleForWebFrameID(std::optional); String handleForWebPageProxy(const WebPageProxy&); -@@ -338,7 +340,6 @@ private: +@@ -348,7 +350,6 @@ private: // Get base64-encoded PNG data from a bitmap. static std::optional platformGetBase64EncodedPNGData(WebCore::ShareableBitmap::Handle&&); @@ -10382,7 +9908,7 @@ index d0a40e3e9f4d59f894c0574926ee13b2d83767ab..3dfd8e059273d2a14494b76892e5abfe // 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 d5186484fee73b83dbcd611a9695d92a0a6f9579..e26cea229aeb1f6aad23f1265baccfe67e508a13 100644 +index 536a0b78e8b1ab110093fea33384e7bad528917b..ca4f5944f90868886bba20411e47b18598cc50a0 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp @@ -173,7 +173,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau @@ -10559,10 +10085,10 @@ index 89d125f7742f81ead8c50f218ecb1771b8000636..baa6cf58ad502c6c033ee6293a6cc8d4 namespace WebKit { diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h -index c633008451c5719866d79300c49d60f979ffb581..9cc370de9b38f70970a6ca11a43651cbb2549529 100644 +index e545bda40ad736cbf5bc6daf4861f9fbe6bd6100..d2ee20c86125f61d52ca08e7d16441e8cc093c97 100644 --- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h +++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h -@@ -103,6 +103,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; @@ -10570,7 +10096,7 @@ index c633008451c5719866d79300c49d60f979ffb581..9cc370de9b38f70970a6ca11a43651cb 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; -@@ -226,6 +227,7 @@ private: +@@ -229,6 +230,7 @@ private: bool webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler : 1; @@ -10579,10 +10105,10 @@ index c633008451c5719866d79300c49d60f979ffb581..9cc370de9b38f70970a6ca11a43651cb bool webViewRequestStorageAccessPanelForDomainUnderCurrentDomainForQuirkDomainsCompletionHandler : 1; bool webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm -index 6c934950b89e32e9ff58992497a313062658c235..c3f1b8d1193ae36efe9e5700f85eee4e86e8c548 100644 +index 3daa4d80bdbdd9c1e9ca74ba9f1c3217f6f4628f..9ee399d8417acca18c3e1fe55ccc88cac2a39c9b 100644 --- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm +++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm -@@ -135,6 +135,7 @@ void UIDelegate::setDelegate(id delegate) +@@ -136,6 +136,7 @@ void UIDelegate::setDelegate(id delegate) m_delegateMethods.webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:)]; m_delegateMethods.webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:)]; m_delegateMethods.webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:)]; @@ -10607,10 +10133,10 @@ index 6c934950b89e32e9ff58992497a313062658c235..c3f1b8d1193ae36efe9e5700f85eee4e { RefPtr uiDelegate = m_uiDelegate.get(); diff --git a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm -index 70f71e49666eb0bc9a732c5893d27179b051bd72..a6c273ea6793f213aadc64485fe7c1fb23854b72 100644 +index 7587e1142a070da697953b79070174730d259e52..b1a440eec49540d30312b4d17da59e5159eeaa71 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm -@@ -43,7 +43,9 @@ +@@ -44,7 +44,9 @@ #import "NativeWebKeyboardEvent.h" #import "NativeWebMouseEvent.h" #import "NavigationState.h" @@ -10620,9 +10146,9 @@ index 70f71e49666eb0bc9a732c5893d27179b051bd72..a6c273ea6793f213aadc64485fe7c1fb #import "PlatformXRSystem.h" #import "PlaybackSessionManagerProxy.h" #import "RemoteLayerTreeTransaction.h" -@@ -351,11 +353,86 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() +@@ -356,11 +358,86 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() - void WebPageProxy::startDrag(const DragItem& dragItem, ShareableBitmap::Handle&& dragImageHandle, const std::optional& elementID) + void WebPageProxy::startDrag(const DragItem& dragItem, ShareableBitmap::Handle&& dragImageHandle, const std::optional& nodeID) { + if (m_interceptDrags) { + NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName: m_overrideDragPasteboardName.createNSString().get()]; @@ -10656,7 +10182,7 @@ index 70f71e49666eb0bc9a732c5893d27179b051bd72..a6c273ea6793f213aadc64485fe7c1fb + } + if (RefPtr pageClient = this->pageClient()) - pageClient->startDrag(dragItem, WTFMove(dragImageHandle), elementID); + pageClient->startDrag(dragItem, WTFMove(dragImageHandle), nodeID); } -#endif @@ -10709,10 +10235,10 @@ index 70f71e49666eb0bc9a732c5893d27179b051bd72..a6c273ea6793f213aadc64485fe7c1fb #if ENABLE(ATTACHMENT_ELEMENT) diff --git a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -index 3b6663cb77c2c20e2e6822bfdbf822cea3022fdc..d0e67aa4714f4f8e01c3c2e1ef3fd1adc6274d20 100644 +index 7598f3e02823be871f4bf7f43171409a06aaac0e..f37ae417ee4cd8504cf7581afdcce6a5ca1fa5b9 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -@@ -442,7 +442,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END +@@ -449,7 +449,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END auto screenProperties = WebCore::collectScreenProperties(); parameters.screenProperties = WTFMove(screenProperties); #if PLATFORM(MAC) @@ -10721,7 +10247,7 @@ index 3b6663cb77c2c20e2e6822bfdbf822cea3022fdc..d0e67aa4714f4f8e01c3c2e1ef3fd1ad #endif #if PLATFORM(VISION) -@@ -841,8 +841,8 @@ void WebProcessPool::registerNotificationObservers() +@@ -859,8 +859,8 @@ void WebProcessPool::registerNotificationObservers() }]; m_scrollerStyleNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSPreferredScrollerStyleDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { @@ -10731,9 +10257,9 @@ index 3b6663cb77c2c20e2e6822bfdbf822cea3022fdc..d0e67aa4714f4f8e01c3c2e1ef3fd1ad + sendToAllProcesses(Messages::WebProcess::ScrollerStylePreferenceChanged(useOverlayScrollbars)); }]; - m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidBecomeActiveNotification object:NSApp queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { + m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidBecomeActiveNotification object:NSAppSingleton() queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp -index f356f65a1515e9ed17e51d4bde50a8c0758fd6e1..0caab4689c42a89d1d5060a3bdf9a0502e73b8ab 100644 +index c25814a7b7c26ad90c1b51ff10d334200da9472b..d9b6654e62a6766824a6df45b73408c3141e2893 100644 --- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp +++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp @@ -33,6 +33,7 @@ @@ -10744,7 +10270,7 @@ index f356f65a1515e9ed17e51d4bde50a8c0758fd6e1..0caab4689c42a89d1d5060a3bdf9a050 #include "WebPageProxy.h" #include "WebPreferences.h" #include "WebProcessPool.h" -@@ -40,15 +41,26 @@ +@@ -40,9 +41,15 @@ #include #include #include @@ -10760,18 +10286,7 @@ index f356f65a1515e9ed17e51d4bde50a8c0758fd6e1..0caab4689c42a89d1d5060a3bdf9a050 #endif #if USE(GLIB_EVENT_LOOP) - #include - #endif - -+#if PLATFORM(WIN) -+#include -+#include -+#endif -+ - namespace WebKit { - using namespace WebCore; - -@@ -182,6 +194,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange(CompletionH +@@ -182,6 +189,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange(CompletionH sendWithAsyncReply(Messages::DrawingArea::SetDeviceScaleFactor(page()->deviceScaleFactor()), WTFMove(completionHandler)); } @@ -10783,7 +10298,7 @@ index f356f65a1515e9ed17e51d4bde50a8c0758fd6e1..0caab4689c42a89d1d5060a3bdf9a050 void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable) { #if !PLATFORM(WPE) -@@ -243,6 +260,59 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6 +@@ -243,6 +255,44 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6 updateAcceleratedCompositingMode(layerTreeContext); } @@ -10824,26 +10339,11 @@ index f356f65a1515e9ed17e51d4bde50a8c0758fd6e1..0caab4689c42a89d1d5060a3bdf9a050 + protectedPage()->inspectorController().didPaint(WTFMove(skImage)); +} +#endif // PLATFORM(GTK) -+ -+#if PLATFORM(WIN) -+void DrawingAreaProxyCoordinatedGraphics::captureFrame() -+{ -+ if (!m_backingStore) -+ return; -+ auto surface = m_backingStore->surface(); -+ if (!surface) -+ return; -+ auto image = surface->makeImageSnapshot(); -+ if (!image) -+ return; -+ protectedPage()->inspectorController().didPaint(WTFMove(image)); -+} -+#endif // PLATFORM(WIN) + bool DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing() const { if (!page()) -@@ -310,6 +380,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() +@@ -310,6 +360,12 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() // we need to resend the new size here. if (m_lastSentSize != size()) sendUpdateGeometry(); @@ -10888,7 +10388,7 @@ index 61ce018548600fb7e4f3cdb3ee82b444d5b2429f..4e93f979cd98c36b24a08c00193b190a #if !PLATFORM(WPE) bool m_isBackingStoreDiscardable { true }; diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp -index bdc3efe299296ef6ef10d32672e22fba05ca230c..a24e9c7e4b0da65099326b6921ed03b4deb4cc86 100644 +index f84e75be2ecfd15ad97a45cac3a4bca4ec41faf2..73ef164a9eb25ae22032c35154d0c57a69e42ee9 100644 --- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp +++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp @@ -41,8 +41,10 @@ @@ -10983,7 +10483,7 @@ index bdc3efe299296ef6ef10d32672e22fba05ca230c..a24e9c7e4b0da65099326b6921ed03b4 // This can cause the DownloadProxy object to be deleted. if (RefPtr downloadProxyMap = m_downloadProxyMap.get()) diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.h b/Source/WebKit/UIProcess/Downloads/DownloadProxy.h -index 9a92a8cde3b5d1da0fbbf5fe7c549cebb8a7f2f7..9ce201ca2d7aa002c7bd389f1fe03edfb306df5d 100644 +index 770377f456a8008b19acc3f11f03a6c088514b76..51b0f6c6de24d495fa8aafedfbbb059e03574ff9 100644 --- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.h +++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.h @@ -166,6 +166,7 @@ private: @@ -10995,10 +10495,10 @@ index 9a92a8cde3b5d1da0fbbf5fe7c549cebb8a7f2f7..9ce201ca2d7aa002c7bd389f1fe03edf } // namespace WebKit diff --git a/Source/WebKit/UIProcess/DrawingAreaProxy.h b/Source/WebKit/UIProcess/DrawingAreaProxy.h -index c30c32f55aff3552bb05112dd53b9b8b62dd4a3f..32417be5f8cf613f58db900ce615518751b1509a 100644 +index f78505520812f91ea9b96c6a6a071ec84850371d..d23fa735d38e77ff6da92a9a2bb3f972feade9be 100644 --- a/Source/WebKit/UIProcess/DrawingAreaProxy.h +++ b/Source/WebKit/UIProcess/DrawingAreaProxy.h -@@ -94,6 +94,7 @@ public: +@@ -96,6 +96,7 @@ public: const WebCore::IntSize& size() const { return m_size; } bool setSize(const WebCore::IntSize&, const WebCore::IntSize& scrollOffset = { }); @@ -11008,10 +10508,10 @@ index c30c32f55aff3552bb05112dd53b9b8b62dd4a3f..32417be5f8cf613f58db900ce6155187 virtual void sizeToContentAutoSizeMaximumSizeDidChange() { } diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..c7a4a2f5fbd8c99d2b53fe0d3b1645c865d46634 +index 0000000000000000000000000000000000000000..3733d0c6e8875f325bd249232b8f8205256400f8 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp -@@ -0,0 +1,326 @@ +@@ -0,0 +1,341 @@ +/* + * Copyright (C) 2020 Microsoft Corporation. + * @@ -11069,6 +10569,10 @@ index 0000000000000000000000000000000000000000..c7a4a2f5fbd8c99d2b53fe0d3b1645c8 +#include +#endif + ++#if PLATFORM(WIN) ++#include "DrawingAreaProxyWC.h" ++#endif ++ +WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN + +namespace WebKit { @@ -11089,7 +10593,7 @@ index 0000000000000000000000000000000000000000..c7a4a2f5fbd8c99d2b53fe0d3b1645c8 +{ +} + -+void InspectorScreencastAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) ++void InspectorScreencastAgent::didCreateFrontendAndBackend() +{ +} + @@ -11268,7 +10772,7 @@ index 0000000000000000000000000000000000000000..c7a4a2f5fbd8c99d2b53fe0d3b1645c8 + if (!m_encoder && !m_screencast) + return; + -+ RunLoop::main().dispatchAfter(Seconds(1.0 / ScreencastEncoder::fps), [agent = WeakPtr { this }]() mutable { ++ RunLoop::mainSingleton().dispatchAfter(Seconds(1.0 / ScreencastEncoder::fps), [agent = WeakPtr { this }]() mutable { + if (!agent) + return; + if (!agent->m_page.hasPageClient()) @@ -11324,7 +10828,7 @@ index 0000000000000000000000000000000000000000..c7a4a2f5fbd8c99d2b53fe0d3b1645c8 +} +#endif + -+#if PLATFORM(GTK) || PLATFORM(WIN) ++#if PLATFORM(GTK) +void InspectorScreencastAgent::encodeFrame() +{ + if (!m_encoder && !m_screencast) @@ -11335,12 +10839,23 @@ index 0000000000000000000000000000000000000000..c7a4a2f5fbd8c99d2b53fe0d3b1645c8 +} +#endif + ++#if PLATFORM(WIN) ++void InspectorScreencastAgent::encodeFrame() ++{ ++ if (!m_encoder && !m_screencast) ++ return; ++ ++ if (auto* drawingArea = m_page.drawingArea()) ++ static_cast(drawingArea)->captureFrame(); ++} ++#endif ++ +} // namespace WebKit + +WTF_ALLOW_UNSAFE_BUFFER_USAGE_END diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..852c199da066320f730226653a47c8e5185dc560 +index 0000000000000000000000000000000000000000..e48ba1cc781e24afaa765661c713cef19ea2215b --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.h @@ -0,0 +1,106 @@ @@ -11406,12 +10921,12 @@ index 0000000000000000000000000000000000000000..852c199da066320f730226653a47c8e5 + +class InspectorScreencastAgent : public Inspector::InspectorAgentBase, public Inspector::ScreencastBackendDispatcherHandler, public CanMakeWeakPtr { + WTF_MAKE_NONCOPYABLE(InspectorScreencastAgent); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorScreencastAgent); +public: + InspectorScreencastAgent(Inspector::BackendDispatcher& backendDispatcher, Inspector::FrontendRouter& frontendRouter, WebPageProxy& page); + ~InspectorScreencastAgent() override; + -+ void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override; ++ void didCreateFrontendAndBackend() override; + void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override; + +#if USE(SKIA) @@ -11452,7 +10967,7 @@ index 0000000000000000000000000000000000000000..852c199da066320f730226653a47c8e5 +} // 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..203cedeea9cbec6964fd297884e03ef791632fe5 +index 0000000000000000000000000000000000000000..177f7f7c9a117bc5028f85b766427739e2e9cbc9 --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.cpp @@ -0,0 +1,398 @@ @@ -11590,7 +11105,7 @@ index 0000000000000000000000000000000000000000..203cedeea9cbec6964fd297884e03ef7 + +class ScreencastEncoder::VPXFrame { + WTF_MAKE_NONCOPYABLE(VPXFrame); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(ScreencastEncoder::VPXFrame); +public: +#if USE(SKIA) + explicit VPXFrame(sk_sp&& surface) @@ -11844,7 +11359,7 @@ index 0000000000000000000000000000000000000000..203cedeea9cbec6964fd297884e03ef7 + + flushLastFrame(); + m_vpxCodec->finishAsync([protectRef = Ref { *this }, callback = WTFMove(callback)] () mutable { -+ RunLoop::main().dispatch([callback = WTFMove(callback)] { ++ RunLoop::mainSingleton().dispatch([callback = WTFMove(callback)] { + callback(); + }); + }); @@ -11856,7 +11371,7 @@ index 0000000000000000000000000000000000000000..203cedeea9cbec6964fd297884e03ef7 +WTF_ALLOW_UNSAFE_BUFFER_USAGE_END diff --git a/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h new file mode 100644 -index 0000000000000000000000000000000000000000..433af017b68b71cfb68c3ebcc0bd2aeb9efc40f7 +index 0000000000000000000000000000000000000000..a414e07b64a5b6ee58a777822761c87ec05605ac --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/ScreencastEncoder.h @@ -0,0 +1,80 @@ @@ -11904,7 +11419,7 @@ index 0000000000000000000000000000000000000000..433af017b68b71cfb68c3ebcc0bd2aeb + +class ScreencastEncoder : public ThreadSafeRefCounted { + WTF_MAKE_NONCOPYABLE(ScreencastEncoder); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(ScreencastEncoder); +public: + static constexpr int fps = 25; + @@ -12074,105 +11589,11 @@ index 0000000000000000000000000000000000000000..e2ce910f3fd7f587add552275b7e7176 +}; + +} // namespace WebKit -diff --git a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp -index 76cc869ca4d5fc311040a285d50a44f00273fd63..633f8323697f0c2f30311a35ac3876bf8e03b741 100644 ---- a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp -+++ b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp -@@ -28,7 +28,7 @@ - - #include "MessageSenderInlines.h" - #include "ProvisionalPageProxy.h" --#include "WebFrameProxy.h" -+#include "WebPageInspectorController.h" - #include "WebPageInspectorTarget.h" - #include "WebPageMessages.h" - #include "WebPageProxy.h" -@@ -46,13 +46,13 @@ std::unique_ptr InspectorTargetProxy::create(WebPageProxy& - return makeUnique(page, targetId, type); - } - --std::unique_ptr InspectorTargetProxy::create(ProvisionalPageProxy& provisionalPage, const String& targetId, Inspector::InspectorTargetType type) -+std::unique_ptr InspectorTargetProxy::create(ProvisionalPageProxy& provisionalPage, const String& targetId) - { - RefPtr page = provisionalPage.page(); - if (!page) - return nullptr; - -- auto target = InspectorTargetProxy::create(*page, targetId, type); -+ auto target = InspectorTargetProxy::create(*page, targetId, Inspector::InspectorTargetType::Page); - target->m_provisionalPage = provisionalPage; - return target; - } -@@ -108,6 +108,31 @@ void InspectorTargetProxy::didCommitProvisionalTarget() - m_provisionalPage = nullptr; - } - -+void InspectorTargetProxy::willResume() -+{ -+ if (m_page->hasRunningProcess()) -+ m_page->legacyMainFrameProcess().send(Messages::WebPage::ResumeInspectorIfPausedInNewWindow(), m_page->webPageIDInMainFrameProcess()); -+} -+ -+void InspectorTargetProxy::activate(String& error) -+{ -+ if (m_type != Inspector::InspectorTargetType::Page) -+ return InspectorTarget::activate(error); -+ -+ platformActivate(error); -+} -+ -+void InspectorTargetProxy::close(String& error, bool runBeforeUnload) -+{ -+ if (m_type != Inspector::InspectorTargetType::Page) -+ return InspectorTarget::close(error, runBeforeUnload); -+ -+ if (runBeforeUnload) -+ m_page->tryClose(); -+ else -+ m_page->closePage(); -+} -+ - bool InspectorTargetProxy::isProvisional() const - { - return !!m_provisionalPage; -diff --git a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.h b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.h -index edd6e7f1799279ed3d0eb81b6c2eef9f5b375134..d4231f84f3c52641f4d9e88559e8e1a4845b7163 100644 ---- a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.h -+++ b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.h -@@ -38,12 +38,12 @@ class WebPageProxy; - // NOTE: This UIProcess side InspectorTarget doesn't care about the frontend channel, since - // any target -> frontend messages will be routed to the WebPageProxy with a targetId. - --class InspectorTargetProxy final : public Inspector::InspectorTarget { -+class InspectorTargetProxy : public Inspector::InspectorTarget { - WTF_MAKE_TZONE_ALLOCATED(InspectorTargetProxy); - WTF_MAKE_NONCOPYABLE(InspectorTargetProxy); - public: - static std::unique_ptr create(WebPageProxy&, const String& targetId, Inspector::InspectorTargetType); -- static std::unique_ptr create(ProvisionalPageProxy&, const String& targetId, Inspector::InspectorTargetType); -+ static std::unique_ptr create(ProvisionalPageProxy&, const String& targetId); - InspectorTargetProxy(WebPageProxy&, const String& targetId, Inspector::InspectorTargetType); - ~InspectorTargetProxy() = default; - -@@ -56,8 +56,13 @@ public: - void connect(Inspector::FrontendChannel::ConnectionType) override; - void disconnect() override; - void sendMessageToTargetBackend(const String&) override; -+ void activate(String& error) override; -+ void close(String& error, bool runBeforeUnload) override; - - private: -+ void willResume() override; -+ void platformActivate(String& error) const; -+ - WeakRef m_page; - String m_identifier; - Inspector::InspectorTargetType m_type; diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp -index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a9009f018187 100644 +index a0a119f4269ce96a61ce4f1c2f35745fc8291780..3684c1683d622f7e906863dcf90e307964a06e11 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp -@@ -26,13 +26,23 @@ +@@ -26,16 +26,24 @@ #include "config.h" #include "WebPageInspectorController.h" @@ -12183,20 +11604,21 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 +#include "InspectorDialogAgent.h" +#include "InspectorScreencastAgent.h" #include "ProvisionalPageProxy.h" + #include "WebFrameInspectorTargetProxy.h" #include "WebFrameProxy.h" #include "WebPageInspectorAgentBase.h" +#include "WebPageInspectorEmulationAgent.h" +#include "WebPageInspectorInputAgent.h" #include "WebPageInspectorTarget.h" + #include "WebPageInspectorTargetProxy.h" #include "WebPageProxy.h" -+#include "WebPreferences.h" + #include "WebsiteDataStore.h" +#include -+#include +#include #include #include #include -@@ -52,34 +62,115 @@ static String getTargetID(const ProvisionalPageProxy& provisionalPage) +@@ -55,34 +63,115 @@ static String getTargetID(const ProvisionalPageProxy& provisionalPage) WTF_MAKE_TZONE_ALLOCATED_IMPL(WebPageInspectorController); @@ -12231,9 +11653,7 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 } void WebPageInspectorController::init() - { -- String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); -- createInspectorTarget(pageTargetId, Inspector::InspectorTargetType::Page); ++{ + auto targetAgent = makeUnique(m_frontendRouter.get(), m_backendDispatcher.get()); + m_targetAgent = targetAgent.get(); + m_agents.append(WTFMove(targetAgent)); @@ -12252,13 +11672,13 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 +} + +void WebPageInspectorController::didInitializeWebPage() -+{ -+ String pageTargetID = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageIDInMainFrameProcess()); + { + 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)) ++ if (m_targets.contains(pageTargetId)) + return; -+ createInspectorTarget(pageTargetID, Inspector::InspectorTargetType::Page); + createWebPageInspectorTarget(pageTargetId, Inspector::InspectorTargetType::Page); } void WebPageInspectorController::pageClosed() @@ -12319,7 +11739,7 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 } bool WebPageInspectorController::hasLocalFrontend() const -@@ -93,6 +184,17 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro +@@ -96,6 +185,14 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro bool connectingFirstFrontend = !m_frontendRouter->hasFrontends(); @@ -12330,14 +11750,11 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 + disconnectAllFrontends(); + connectingFirstFrontend = true; + } -+ -+ if (connectingFirstFrontend) -+ adjustPageSettings(); + m_frontendRouter->connectFrontend(frontendChannel); if (connectingFirstFrontend) -@@ -112,8 +214,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha +@@ -115,8 +212,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha m_frontendRouter->disconnectFrontend(frontendChannel); bool disconnectingLastFrontend = !m_frontendRouter->hasFrontends(); @@ -12349,7 +11766,7 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 Ref inspectedPage = m_inspectedPage.get(); inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); -@@ -137,6 +241,8 @@ void WebPageInspectorController::disconnectAllFrontends() +@@ -140,6 +239,8 @@ void WebPageInspectorController::disconnectAllFrontends() // Disconnect any remaining remote frontends. m_frontendRouter->disconnectAllFrontends(); @@ -12358,7 +11775,7 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 Ref inspectedPage = m_inspectedPage.get(); inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); -@@ -165,6 +271,66 @@ void WebPageInspectorController::setIndicating(bool indicating) +@@ -168,6 +269,66 @@ void WebPageInspectorController::setIndicating(bool indicating) } #endif @@ -12422,10 +11839,10 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 + s_observer->didFailProvisionalLoad(m_inspectedPage, navigationID, error.localizedDescription()); +} + - void WebPageInspectorController::createInspectorTarget(const String& targetId, Inspector::InspectorTargetType type) + void WebPageInspectorController::createWebPageInspectorTarget(const String& targetId, Inspector::InspectorTargetType type) { - addTarget(InspectorTargetProxy::create(protectedInspectedPage(), targetId, type)); -@@ -184,6 +350,52 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta + addTarget(WebPageInspectorTargetProxy::create(protectedInspectedPage(), targetId, type)); +@@ -192,6 +353,52 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta checkedTargetAgent()->sendMessageFromTargetToFrontend(targetId, message); } @@ -12478,56 +11895,27 @@ index 9e1e41b6a796082231a32b04fe8b13270b02eb3e..58b4d514f7a06b7fb7cdae111f99a900 bool WebPageInspectorController::shouldPauseLoading(const ProvisionalPageProxy& provisionalPage) const { if (!m_frontendRouter->hasFrontends()) -@@ -203,7 +415,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag +@@ -211,7 +418,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag void WebPageInspectorController::didCreateProvisionalPage(ProvisionalPageProxy& provisionalPage) { -- addTarget(InspectorTargetProxy::create(provisionalPage, getTargetID(provisionalPage), Inspector::InspectorTargetType::Page)); -+ addTarget(InspectorTargetProxy::create(provisionalPage, getTargetID(provisionalPage))); +- addTarget(WebPageInspectorTargetProxy::create(provisionalPage, getTargetID(provisionalPage), Inspector::InspectorTargetType::Page)); ++ addTarget(WebPageInspectorTargetProxy::create(provisionalPage, getTargetID(provisionalPage))); } void WebPageInspectorController::willDestroyProvisionalPage(const ProvisionalPageProxy& provisionalPage) -@@ -288,4 +500,29 @@ void WebPageInspectorController::browserExtensionsDisabled(HashSet&& ext - enabledBrowserAgent->extensionsDisabled(WTFMove(extensionIDs)); - } - -+void WebPageInspectorController::adjustPageSettings() -+{ -+ // Set this to true as otherwise updating any preferences will override its -+ // value in the Web Process to false (and InspectorController sets it locally -+ // to true when frontend is connected). -+ m_inspectedPage->preferences().setDeveloperExtrasEnabled(true); -+ -+ // Navigation to cached pages doesn't fire some of the events (e.g. execution context created) -+ // that inspector depends on. So we disable the cache when front-end connects. -+ m_inspectedPage->preferences().setUsesBackForwardCache(false); -+ -+ // Enable popup debugging. -+ // TODO: allow to set preferences over the inspector protocol or find a better place for this. -+ m_inspectedPage->preferences().setJavaScriptCanOpenWindowsAutomatically(true); -+ -+ // Enable media stream. -+ if (!m_inspectedPage->preferences().mediaDevicesEnabled()) { -+ m_inspectedPage->preferences().setMediaDevicesEnabled(true); -+ m_inspectedPage->preferences().setPeerConnectionEnabled(true); -+ } -+ -+ // Disable local storage partitioning. See https://github.com/microsoft/playwright/issues/32230 -+ m_inspectedPage->preferences().setStorageBlockingPolicy(static_cast(WebCore::StorageBlockingPolicy::AllowAll)); -+} -+ - } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h -index 0e6766e155e83f9f5fde89080448b3f08a3a27e5..8ed8b9baf74866fad6498a1a13c6db96f0e2b460 100644 +index 43345234f9bbcdfac9c532e6b7e972002ef59eff..2a6418236f1ab9848c6e2828937bd4e14a9ebe9c 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h -@@ -26,19 +26,39 @@ - #pragma once +@@ -27,20 +27,40 @@ #include "InspectorTargetProxy.h" + #include "ProvisionalPageProxy.h" +#include "ProcessTerminationReason.h" #include #include + #include +#include #include #include @@ -12561,8 +11949,8 @@ index 0e6766e155e83f9f5fde89080448b3f08a3a27e5..8ed8b9baf74866fad6498a1a13c6db96 } namespace WebKit { -@@ -46,6 +66,23 @@ namespace WebKit { - class InspectorBrowserAgent; +@@ -49,6 +69,23 @@ class InspectorBrowserAgent; + class ProvisionalPageProxy; struct WebPageAgentContext; +class InspectorScreencastAgent; @@ -12585,7 +11973,7 @@ index 0e6766e155e83f9f5fde89080448b3f08a3a27e5..8ed8b9baf74866fad6498a1a13c6db96 class WebPageInspectorController { WTF_MAKE_TZONE_ALLOCATED(WebPageInspectorController); WTF_MAKE_NONCOPYABLE(WebPageInspectorController); -@@ -54,7 +91,21 @@ public: +@@ -57,7 +94,21 @@ public: ~WebPageInspectorController(); void init(); @@ -12607,7 +11995,7 @@ index 0e6766e155e83f9f5fde89080448b3f08a3a27e5..8ed8b9baf74866fad6498a1a13c6db96 bool hasLocalFrontend() const; -@@ -67,11 +118,27 @@ public: +@@ -70,12 +121,28 @@ public: #if ENABLE(REMOTE_INSPECTOR) void setIndicating(bool); #endif @@ -12622,7 +12010,8 @@ index 0e6766e155e83f9f5fde89080448b3f08a3a27e5..8ed8b9baf74866fad6498a1a13c6db96 + + void didFailProvisionalLoadForFrame(WebCore::NavigationIdentifier navigationID, const WebCore::ResourceError& error); - void createInspectorTarget(const String& targetId, Inspector::InspectorTargetType); + void createWebPageInspectorTarget(const String& targetId, Inspector::InspectorTargetType); + void createWebFrameInspectorTarget(WebFrameProxy&, const String& targetId); void destroyInspectorTarget(const String& targetId); void sendMessageToInspectorFrontend(const String& targetId, const String& message); @@ -12635,7 +12024,7 @@ index 0e6766e155e83f9f5fde89080448b3f08a3a27e5..8ed8b9baf74866fad6498a1a13c6db96 bool shouldPauseLoading(const ProvisionalPageProxy&) const; void setContinueLoadingCallback(const ProvisionalPageProxy&, WTF::Function&&); -@@ -86,12 +153,13 @@ public: +@@ -90,7 +157,7 @@ public: void browserExtensionsDisabled(HashSet&&); private: @@ -12644,13 +12033,7 @@ index 0e6766e155e83f9f5fde89080448b3f08a3a27e5..8ed8b9baf74866fad6498a1a13c6db96 CheckedPtr checkedTargetAgent() { return m_targetAgent; } WebPageAgentContext webPageAgentContext(); void createLazyAgents(); - - void addTarget(std::unique_ptr&&); -+ void adjustPageSettings(); - - const Ref m_frontendRouter; - const Ref m_backendDispatcher; -@@ -102,9 +170,16 @@ private: +@@ -106,9 +173,16 @@ private: CheckedPtr m_targetAgent; HashMap> m_targets; @@ -12667,41 +12050,115 @@ index 0e6766e155e83f9f5fde89080448b3f08a3a27e5..8ed8b9baf74866fad6498a1a13c6db96 }; } // namespace WebKit -diff --git a/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm b/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm -new file mode 100644 -index 0000000000000000000000000000000000000000..6a04ee480bc3a8270a7de20b1cd0da718242b4c1 ---- /dev/null -+++ b/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm -@@ -0,0 +1,55 @@ -+/* -+ * Copyright (C) 2020 Microsoft Corporation. -+ * -+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT -+ * OWNER OR 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 "ScreencastEncoder.h" +diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.cpp +index 1c393ce01ed94f96908c674f969c383d4ddc50d7..404e46f4786f54b946f254efa6f6b06cad765bf3 100644 +--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.cpp ++++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.cpp +@@ -59,6 +59,11 @@ std::unique_ptr WebPageInspectorTargetProxy::create + return target; + } + ++std::unique_ptr WebPageInspectorTargetProxy::create(ProvisionalPageProxy& provisionalPage, const String& targetId) ++{ ++ return WebPageInspectorTargetProxy::create(provisionalPage, targetId, Inspector::InspectorTargetType::Page); ++} + -+#include + WebPageInspectorTargetProxy::WebPageInspectorTargetProxy(WebPageProxy& page, const String& targetId, Inspector::InspectorTargetType type) + : InspectorTargetProxy(targetId, type) + , m_page(page) +@@ -109,6 +114,31 @@ void WebPageInspectorTargetProxy::didCommitProvisionalTarget() + m_provisionalPage = nullptr; + } + ++void WebPageInspectorTargetProxy::willResume() ++{ ++ if (m_page->hasRunningProcess()) ++ m_page->legacyMainFrameProcess().send(Messages::WebPage::ResumeInspectorIfPausedInNewWindow(), m_page->webPageIDInMainFrameProcess()); ++} ++ ++void WebPageInspectorTargetProxy::activate(String& error) ++{ ++ if (type() != Inspector::InspectorTargetType::Page) ++ return InspectorTarget::activate(error); ++ ++ platformActivate(error); ++} ++ ++void WebPageInspectorTargetProxy::close(String& error, bool runBeforeUnload) ++{ ++ if (type() != Inspector::InspectorTargetType::Page) ++ return InspectorTarget::close(error, runBeforeUnload); ++ ++ if (runBeforeUnload) ++ m_page->tryClose(); ++ else ++ m_page->closePage(); ++} ++ + bool WebPageInspectorTargetProxy::isProvisional() const + { + return !!m_provisionalPage; +diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.h +index 32e18c59ffdeae8564664dbc851ad1f26aebdfc4..ecc55f78d2deed7d7342ecbc90c2766adfb1799d 100644 +--- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.h ++++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorTargetProxy.h +@@ -43,6 +43,7 @@ class WebPageInspectorTargetProxy final : public InspectorTargetProxy { + public: + static std::unique_ptr create(WebPageProxy&, const String& targetId, Inspector::InspectorTargetType); + static std::unique_ptr create(ProvisionalPageProxy&, const String& targetId, Inspector::InspectorTargetType); ++ static std::unique_ptr create(ProvisionalPageProxy&, const String& targetId); + WebPageInspectorTargetProxy(WebPageProxy&, const String& targetId, Inspector::InspectorTargetType); + ~WebPageInspectorTargetProxy() = default; + +@@ -52,8 +53,13 @@ public: + void connect(Inspector::FrontendChannel::ConnectionType) override; + void disconnect() override; + void sendMessageToTargetBackend(const String&) override; ++ void activate(String& error) override; ++ void close(String& error, bool runBeforeUnload) override; + + private: ++ void willResume() override; ++ void platformActivate(String& error) const; ++ + WeakRef m_page; + WeakPtr m_provisionalPage; + }; +diff --git a/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm b/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm +new file mode 100644 +index 0000000000000000000000000000000000000000..6a04ee480bc3a8270a7de20b1cd0da718242b4c1 +--- /dev/null ++++ b/Source/WebKit/UIProcess/Inspector/mac/ScreencastEncoderMac.mm +@@ -0,0 +1,55 @@ ++/* ++ * Copyright (C) 2020 Microsoft Corporation. ++ * ++ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT ++ * OWNER OR 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 "ScreencastEncoder.h" ++ ++#include +#include +#include + @@ -12730,7 +12187,7 @@ index 0000000000000000000000000000000000000000..6a04ee480bc3a8270a7de20b1cd0da71 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/InspectorDialogAgent.cpp b/Source/WebKit/UIProcess/InspectorDialogAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..663f92f0df76042cf6385b056f8a917d688259f9 +index 0000000000000000000000000000000000000000..1c1a7640e41edfc9faf85e2bcd63e7eafbc4dc50 --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorDialogAgent.cpp @@ -0,0 +1,88 @@ @@ -12785,7 +12242,7 @@ index 0000000000000000000000000000000000000000..663f92f0df76042cf6385b056f8a917d + disable(); +} + -+void InspectorDialogAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) ++void InspectorDialogAgent::didCreateFrontendAndBackend() +{ +} + @@ -12824,7 +12281,7 @@ index 0000000000000000000000000000000000000000..663f92f0df76042cf6385b056f8a917d +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/InspectorDialogAgent.h b/Source/WebKit/UIProcess/InspectorDialogAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..d0e11ed81a6257c011df23d5870da7403f8e9fe4 +index 0000000000000000000000000000000000000000..7f5e7e87c2c1f76c5c3046cb5393d808d419a32f --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorDialogAgent.h @@ -0,0 +1,70 @@ @@ -12876,12 +12333,12 @@ index 0000000000000000000000000000000000000000..d0e11ed81a6257c011df23d5870da740 + +class InspectorDialogAgent : public Inspector::InspectorAgentBase, public Inspector::DialogBackendDispatcherHandler { + WTF_MAKE_NONCOPYABLE(InspectorDialogAgent); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorDialogAgent); +public: + InspectorDialogAgent(Inspector::BackendDispatcher& backendDispatcher, Inspector::FrontendRouter& frontendRouter, WebPageProxy& page); + ~InspectorDialogAgent() override; + -+ void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override; ++ void didCreateFrontendAndBackend() override; + void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override; + + Inspector::Protocol::ErrorStringOr enable() override; @@ -12900,10 +12357,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..8026d3e9aaca3434fc1d7316a19cd92827566a67 +index 0000000000000000000000000000000000000000..13e45ef13e4d43dce84a8847bde2518af300a4d0 --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp -@@ -0,0 +1,1009 @@ +@@ -0,0 +1,1040 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -12956,6 +12413,7 @@ index 0000000000000000000000000000000000000000..8026d3e9aaca3434fc1d7316a19cd928 +#include "WebPageInspectorTarget.h" +#include "WebPageMessages.h" +#include "WebPageProxy.h" ++#include "WebPreferences.h" +#include "WebProcessPool.h" +#include "WebProcessProxy.h" +#include "WebsiteDataRecord.h" @@ -12965,6 +12423,7 @@ index 0000000000000000000000000000000000000000..8026d3e9aaca3434fc1d7316a19cd928 +#include +#include +#include ++#include +#include +#include +#include @@ -12982,7 +12441,7 @@ index 0000000000000000000000000000000000000000..8026d3e9aaca3434fc1d7316a19cd928 +namespace WebKit { + +class InspectorPlaywrightAgent::PageProxyChannel : public FrontendChannel { -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorPlaywrightAgent); +public: + PageProxyChannel(FrontendChannel& frontendChannel, String browserContextID, String pageProxyID, WebPageProxy& page) + : m_browserContextID(browserContextID) @@ -13148,6 +12607,33 @@ index 0000000000000000000000000000000000000000..8026d3e9aaca3434fc1d7316a19cd928 + .release(); +} + ++void adjustInspectedPagePreferences(WebPreferences& preferences, std::optional enableStoragePartitioning) ++{ ++ // Set this to true as otherwise updating any preferences will override its ++ // value in the Web Process to false (and InspectorController sets it locally ++ // to true when frontend is connected). ++ preferences.setDeveloperExtrasEnabled(true); ++ ++ // Navigation to cached pages doesn't fire some of the events (e.g. execution context created) ++ // that inspector depends on. So we disable the cache when front-end connects. ++ preferences.setUsesBackForwardCache(false); ++ ++ // Enable popup debugging. ++ // TODO: allow to set preferences over the inspector protocol or find a better place for this. ++ preferences.setJavaScriptCanOpenWindowsAutomatically(true); ++ ++ // Enable media stream. ++ if (!preferences.mediaDevicesEnabled()) { ++ preferences.setMediaDevicesEnabled(true); ++ preferences.setPeerConnectionEnabled(true); ++ } ++ ++ if (!enableStoragePartitioning || !*enableStoragePartitioning) { ++ // Disable local storage partitioning. See https://github.com/microsoft/playwright/issues/32230 ++ preferences.setStorageBlockingPolicy(static_cast(WebCore::StorageBlockingPolicy::AllowAll)); ++ } ++} ++ +} // namespace + +BrowserContext::BrowserContext() = default; @@ -13156,7 +12642,7 @@ index 0000000000000000000000000000000000000000..8026d3e9aaca3434fc1d7316a19cd928 + +class InspectorPlaywrightAgent::BrowserContextDeletion { + WTF_MAKE_NONCOPYABLE(BrowserContextDeletion); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorPlaywrightAgent::BrowserContextDeletion); +public: + BrowserContextDeletion(std::unique_ptr&& context, size_t numberOfPages, Ref&& callback) + : m_browserContext(WTFMove(context)) @@ -13295,6 +12781,7 @@ index 0000000000000000000000000000000000000000..8026d3e9aaca3434fc1d7316a19cd928 + + // Auto-connect to all new pages. + auto pageProxyChannel = makeUnique(*m_frontendChannel, browserContextID, pageProxyID, page); ++ adjustInspectedPagePreferences(page.preferences(), browserContext->enableStoragePartitioning); + page.inspectorController().connectFrontend(*pageProxyChannel); + // Always pause new targets if controlled remotely. + page.inspectorController().setPauseOnStart(true); @@ -13480,13 +12967,14 @@ index 0000000000000000000000000000000000000000..8026d3e9aaca3434fc1d7316a19cd928 + +} + -+Inspector::Protocol::ErrorStringOr InspectorPlaywrightAgent::createContext(const String& proxyServer, const String& proxyBypassList) ++Inspector::Protocol::ErrorStringOr InspectorPlaywrightAgent::createContext(const String& proxyServer, const String& proxyBypassList, std::optional&& enableStoragePartitioning) +{ + String errorString; + std::unique_ptr browserContext = m_client->createBrowserContext(errorString, proxyServer, proxyBypassList); + if (!browserContext) + return makeUnexpected(errorString); + ++ browserContext->enableStoragePartitioning = WTFMove(enableStoragePartitioning); + // Ensure network process. + browserContext->dataStore->networkProcess(); + browserContext->dataStore->setDownloadInstrumentation(this); @@ -13915,7 +13403,7 @@ index 0000000000000000000000000000000000000000..8026d3e9aaca3434fc1d7316a19cd928 +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..f9185788a118f57e98bec149909a206dc1aa5d99 +index 0000000000000000000000000000000000000000..23cf8d2dbcb21b21f3ffedbd5ef369c796cae34a --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h @@ -0,0 +1,141 @@ @@ -13987,7 +13475,7 @@ index 0000000000000000000000000000000000000000..f9185788a118f57e98bec149909a206d + , public Inspector::PlaywrightBackendDispatcherHandler + , public DownloadInstrumentation { + WTF_MAKE_NONCOPYABLE(InspectorPlaywrightAgent); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorPlaywrightAgent); +public: + explicit InspectorPlaywrightAgent(std::unique_ptr client); + ~InspectorPlaywrightAgent() override; @@ -14014,7 +13502,7 @@ index 0000000000000000000000000000000000000000..f9185788a118f57e98bec149909a206d + Inspector::Protocol::ErrorStringOr disable() override; + Inspector::Protocol::ErrorStringOr getInfo() override; + void close(Ref&&) override; -+ Inspector::Protocol::ErrorStringOr createContext(const String& proxyServer, const String& proxyBypassList) override; ++ Inspector::Protocol::ErrorStringOr createContext(const String& proxyServer, const String& proxyBypassList, std::optional&& enableStoragePartitioning) override; + void deleteContext(const String& browserContextID, Ref&& callback) override; + Inspector::Protocol::ErrorStringOr createPage(const String& browserContextID) override; + void navigate(const String& url, const String& pageProxyID, const String& frameId, const String& referrer, Ref&&) override; @@ -14062,10 +13550,10 @@ index 0000000000000000000000000000000000000000..f9185788a118f57e98bec149909a206d +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgentClient.h b/Source/WebKit/UIProcess/InspectorPlaywrightAgentClient.h new file mode 100644 -index 0000000000000000000000000000000000000000..e7a3dcc533294bb6e12f65d79b5b716bd3c12236 +index 0000000000000000000000000000000000000000..af71e4077eb0c6f95396de7bfef89a3efb5f12d9 --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgentClient.h -@@ -0,0 +1,73 @@ +@@ -0,0 +1,74 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -14113,7 +13601,7 @@ index 0000000000000000000000000000000000000000..e7a3dcc533294bb6e12f65d79b5b716b + +class BrowserContext { + WTF_MAKE_NONCOPYABLE(BrowserContext); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(BrowserContext); +public: + BrowserContext(); + ~BrowserContext(); @@ -14122,6 +13610,7 @@ index 0000000000000000000000000000000000000000..e7a3dcc533294bb6e12f65d79b5b716b + RefPtr processPool; + HashSet pages; + WeakPtr geolocationProvider; ++ std::optional enableStoragePartitioning; +}; + +class InspectorPlaywrightAgentClient { @@ -14140,10 +13629,10 @@ index 0000000000000000000000000000000000000000..e7a3dcc533294bb6e12f65d79b5b716b + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp -index f5c20099e6f746c3d26035313bf67641927549ec..4d3a40809a303bcb49bcc65cce7b7ce06ac7a96f 100644 +index b16dfdb4a9d5d30a0e7e4185261646c2f2b598eb..eb2498f8d174b574c5ae9015d2080b6f08714d4d 100644 --- a/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp +++ b/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp -@@ -168,6 +168,13 @@ void ProcessLauncher::launchProcess() +@@ -164,6 +164,13 @@ void ProcessLauncher::launchProcess() nargs++; } #endif @@ -14157,7 +13646,7 @@ index f5c20099e6f746c3d26035313bf67641927549ec..4d3a40809a303bcb49bcc65cce7b7ce0 WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN // GTK/WPE port -@@ -188,6 +195,10 @@ void ProcessLauncher::launchProcess() +@@ -181,6 +188,10 @@ void ProcessLauncher::launchProcess() if (configureJSCForTesting) argv[i++] = const_cast("--configure-jsc-for-testing"); #endif @@ -14169,7 +13658,7 @@ index f5c20099e6f746c3d26035313bf67641927549ec..4d3a40809a303bcb49bcc65cce7b7ce0 WTF_ALLOW_UNSAFE_BUFFER_USAGE_END diff --git a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp -index 71f80f5414e3e0cec1588fb3b4432665aa6facde..23bbdb9f5eac73ebd0cc5aea33bb08bcc67b60dc 100644 +index 6723ee0d9943be07bc8ad09d2b678838aca968df..0d7fb3c7b1a4c877a2ff2f2189d12c7d00eb8f7b 100644 --- a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp +++ b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp @@ -91,14 +91,21 @@ void ProcessLauncher::launchProcess() @@ -14196,7 +13685,7 @@ index 71f80f5414e3e0cec1588fb3b4432665aa6facde..23bbdb9f5eac73ebd0cc5aea33bb08bc BOOL result = ::CreateProcess(0, commandLine.mutableSpan().data(), 0, 0, true, 0, 0, 0, &startupInfo, &processInformation); diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h -index 48b9ebe975bff1b8179ac26a31b4724a028ecb94..f61094aa9f8db7832f3adcb3fd77bb19005abc40 100644 +index 5eb9a2c8ffee283bd4cf23b32a3319d21c675299..d0d864d4b1e098b7b909afb0055a4c88b354ae59 100644 --- a/Source/WebKit/UIProcess/PageClient.h +++ b/Source/WebKit/UIProcess/PageClient.h @@ -74,6 +74,11 @@ @@ -14211,7 +13700,7 @@ index 48b9ebe975bff1b8179ac26a31b4724a028ecb94..f61094aa9f8db7832f3adcb3fd77bb19 OBJC_CLASS AVPlayerViewController; OBJC_CLASS CALayer; OBJC_CLASS NSFileWrapper; -@@ -381,7 +386,16 @@ public: +@@ -387,7 +392,16 @@ public: virtual void selectionDidChange() = 0; #endif @@ -14301,7 +13790,7 @@ index 0000000000000000000000000000000000000000..95b682567eba682f927317cd3327a531 +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h new file mode 100644 -index 0000000000000000000000000000000000000000..a8a92a6c5f4b03724decc97828291f6f27cfc6aa +index 0000000000000000000000000000000000000000..f855bb5ff6e91cc3383fb9a96d32392ff7aa5493 --- /dev/null +++ b/Source/WebKit/UIProcess/PlaywrightFullScreenManagerProxyClient.h @@ -0,0 +1,56 @@ @@ -14341,7 +13830,7 @@ index 0000000000000000000000000000000000000000..a8a92a6c5f4b03724decc97828291f6f +class WebPageProxy; + +class PlaywrightFullScreenManagerProxyClient : public WebFullScreenManagerProxyClient { -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(PlaywrightFullScreenManagerProxyClient); +public: + PlaywrightFullScreenManagerProxyClient(WebPageProxy&); + ~PlaywrightFullScreenManagerProxyClient() override = default; @@ -14362,7 +13851,7 @@ index 0000000000000000000000000000000000000000..a8a92a6c5f4b03724decc97828291f6f + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp -index 493bde430bef5c064ff6807296ad088d8dee1a72..9b6dbc259e150fba3ba5fb4b488d91e3fb16be7e 100644 +index 39a815b0819e99e9575d8f3deec07affd2e9c404..5c9196627dd1bcdbf80fb41c09d77fb21bb2fa44 100644 --- a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp +++ b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp @@ -25,6 +25,7 @@ @@ -14373,12 +13862,32 @@ index 493bde430bef5c064ff6807296ad088d8dee1a72..9b6dbc259e150fba3ba5fb4b488d91e3 #include "FrameProcess.h" #include "ProvisionalFrameCreationParameters.h" +diff --git a/Source/WebKit/UIProcess/ProvisionalPageProxy.h b/Source/WebKit/UIProcess/ProvisionalPageProxy.h +index eb26056800aaec0f2919438d97ffceb72e70fc31..4e53ec412c541efbf9a5cdb0311adf56cceaca1e 100644 +--- a/Source/WebKit/UIProcess/ProvisionalPageProxy.h ++++ b/Source/WebKit/UIProcess/ProvisionalPageProxy.h +@@ -34,6 +34,7 @@ + #include "WebFramePolicyListenerProxy.h" + #include "WebPageProxyIdentifier.h" + #include "WebPageProxyMessageReceiverRegistration.h" ++#include "WebsiteDataStore.h" + #include + #include + #include +@@ -74,7 +75,6 @@ class WebBackForwardListItem; + class WebFrameProxy; + class WebPageProxy; + class WebProcessProxy; +-class WebsiteDataStore; + + struct FrameInfoData; + struct NavigationActionData; diff --git a/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp b/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..be84b2a5ce00ec2e242785fe8b00a08c44900215 +index 0000000000000000000000000000000000000000..2d2e6bb485c9a95b871d9545b8720cfd061dd789 --- /dev/null +++ b/Source/WebKit/UIProcess/RemoteInspectorPipe.cpp -@@ -0,0 +1,230 @@ +@@ -0,0 +1,229 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -14493,8 +14002,7 @@ index 0000000000000000000000000000000000000000..be84b2a5ce00ec2e242785fe8b00a08c +} // namespace + +class RemoteInspectorPipe::RemoteFrontendChannel : public Inspector::FrontendChannel { -+ WTF_MAKE_FAST_ALLOCATED; -+ ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(RemoteInspectorPipe::RemoteFrontendChannel); +public: + RemoteFrontendChannel() + : m_senderQueue(WorkQueue::create("Inspector pipe writer"_s)) @@ -14571,7 +14079,7 @@ index 0000000000000000000000000000000000000000..be84b2a5ce00ec2e242785fe8b00a08c + while (!m_terminated) { + size_t size = ReadBytes(buffer.get(), bufSize, false); + if (!size) { -+ RunLoop::main().dispatch([this] { ++ RunLoop::mainSingleton().dispatch([this] { + if (!m_terminated) + m_playwrightAgent.disconnectFrontend(); + }); @@ -14590,7 +14098,7 @@ index 0000000000000000000000000000000000000000..be84b2a5ce00ec2e242785fe8b00a08c + + if (end > start) { + String message = String::fromUTF8({ line.mutableSpan().data() + start, end - start }); -+ RunLoop::main().dispatch([this, message = WTFMove(message)] { ++ RunLoop::mainSingleton().dispatch([this, message = WTFMove(message)] { + if (!m_terminated) + m_playwrightAgent.dispatchMessageFromFrontend(message); + }); @@ -14611,7 +14119,7 @@ index 0000000000000000000000000000000000000000..be84b2a5ce00ec2e242785fe8b00a08c +WTF_ALLOW_UNSAFE_BUFFER_USAGE_END diff --git a/Source/WebKit/UIProcess/RemoteInspectorPipe.h b/Source/WebKit/UIProcess/RemoteInspectorPipe.h new file mode 100644 -index 0000000000000000000000000000000000000000..6d04f9290135069359ce6bf8726546482fd1dc95 +index 0000000000000000000000000000000000000000..23626aa70d5a14e6484c81e05b146b375379be4f --- /dev/null +++ b/Source/WebKit/UIProcess/RemoteInspectorPipe.h @@ -0,0 +1,65 @@ @@ -14658,7 +14166,7 @@ index 0000000000000000000000000000000000000000..6d04f9290135069359ce6bf872654648 + +class RemoteInspectorPipe { + WTF_MAKE_NONCOPYABLE(RemoteInspectorPipe); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(RemoteInspectorPipe); +public: + explicit RemoteInspectorPipe(InspectorPlaywrightAgent&); + ~RemoteInspectorPipe(); @@ -14680,6 +14188,18 @@ index 0000000000000000000000000000000000000000..6d04f9290135069359ce6bf872654648 +} // namespace WebKit + +#endif // ENABLE(REMOTE_INSPECTOR) +diff --git a/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm b/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm +index b3557b3f7ff2283113191f61b5a5ea1fce8065e2..1ded8a28fcd870b0bae4965d60a56c1d582077b9 100644 +--- a/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm ++++ b/Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm +@@ -46,6 +46,7 @@ + #import + #import + #import ++#import + #import + + namespace WebKit { diff --git a/Source/WebKit/UIProcess/RemotePagePlaybackSessionManagerProxy.h b/Source/WebKit/UIProcess/RemotePagePlaybackSessionManagerProxy.h index 3f6cd845733e2e8f5e25c318e7ab54f77032d4cf..e4399bfd734a28ef5df5ec855b7c78b46634c91d 100644 --- a/Source/WebKit/UIProcess/RemotePagePlaybackSessionManagerProxy.h @@ -14698,7 +14218,7 @@ index 3f6cd845733e2e8f5e25c318e7ab54f77032d4cf..e4399bfd734a28ef5df5ec855b7c78b4 class RemotePagePlaybackSessionManagerProxy : public IPC::MessageReceiver, public RefCounted { diff --git a/Source/WebKit/UIProcess/RemotePageProxy.cpp b/Source/WebKit/UIProcess/RemotePageProxy.cpp -index 22c8a561850249008f998405712e88f1c2229336..70e7f76c32af780642d254003ee834204784694f 100644 +index 75cbe6ba806eb865a83119b2a15a6a86dd632c59..a21c6d7f4dab3ab2456ffc3c7b558464268295a6 100644 --- a/Source/WebKit/UIProcess/RemotePageProxy.cpp +++ b/Source/WebKit/UIProcess/RemotePageProxy.cpp @@ -37,6 +37,7 @@ @@ -14736,9 +14256,23 @@ index 697a350812e1bf73dd44cc3d723a6a291f9d59d1..a8e1edd710d88f48632d51fd05aa9647 WebPageProxy* page() const { return m_page.get(); } RefPtr protectedPage() const; +diff --git a/Source/WebKit/UIProcess/WebFrameProxy.cpp b/Source/WebKit/UIProcess/WebFrameProxy.cpp +index 5fdb94c7c596bf6fc32c1dc29544a7b662bed349..dcb9a97492039ea8bc5006635c07f509eb93ca3a 100644 +--- a/Source/WebKit/UIProcess/WebFrameProxy.cpp ++++ b/Source/WebKit/UIProcess/WebFrameProxy.cpp +@@ -183,6 +183,9 @@ void WebFrameProxy::webProcessWillShutDown() + for (auto& childFrame : std::exchange(m_childFrames, { })) + childFrame->webProcessWillShutDown(); + ++ if (RefPtr page = m_page.get()) ++ page->inspectorController().destroyInspectorTarget(WebFrameInspectorTarget::toTargetID(frameID())); ++ + m_page = nullptr; + + if (RefPtr activeListener = m_activeListener) { diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..653b3550dda624df82de679315711fd1dd4ed0b6 +index 0000000000000000000000000000000000000000..058b9a31fc23cc36a228ef63cc89a80ccf3fa62e --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp @@ -0,0 +1,159 @@ @@ -14793,7 +14327,7 @@ index 0000000000000000000000000000000000000000..653b3550dda624df82de679315711fd1 +{ +} + -+void WebPageInspectorEmulationAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) ++void WebPageInspectorEmulationAgent::didCreateFrontendAndBackend() +{ +} + @@ -14817,7 +14351,7 @@ index 0000000000000000000000000000000000000000..653b3550dda624df82de679315711fd1 + if (deviceScaleFactor) + m_page.setCustomDeviceScaleFactor(deviceScaleFactor.value(), [] { }); + m_page.setUseFixedLayout(fixedlayout); -+ if (!m_page.pageClient()->isViewVisible() && m_page.configuration().relatedPage()) { ++ if (!m_page.pageClient()->isActiveViewVisible() && m_page.configuration().relatedPage()) { + m_commandsToRunWhenShown.append([this, width, height, callback = WTFMove(callback)]() mutable { + setSize(width, height, WTFMove(callback)); + }); @@ -14903,7 +14437,7 @@ index 0000000000000000000000000000000000000000..653b3550dda624df82de679315711fd1 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..d00d00ce8fd800dc1497b36b8a495c5b9aef6f58 +index 0000000000000000000000000000000000000000..14db923537ba3cad1961a748ae5e1d66c7c9322c --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.h @@ -0,0 +1,76 @@ @@ -14954,12 +14488,12 @@ index 0000000000000000000000000000000000000000..d00d00ce8fd800dc1497b36b8a495c5b + +class WebPageInspectorEmulationAgent : public Inspector::InspectorAgentBase, public Inspector::EmulationBackendDispatcherHandler { + WTF_MAKE_NONCOPYABLE(WebPageInspectorEmulationAgent); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(WebPageInspectorEmulationAgent); +public: + WebPageInspectorEmulationAgent(Inspector::BackendDispatcher& backendDispatcher, WebPageProxy& page); + ~WebPageInspectorEmulationAgent() override; + -+ void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override; ++ void didCreateFrontendAndBackend() override; + void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override; + + void setDeviceMetricsOverride(int width, int height, bool fixedlayout, std::optional&& deviceScaleFactor, Ref&&) override; @@ -14985,7 +14519,7 @@ index 0000000000000000000000000000000000000000..d00d00ce8fd800dc1497b36b8a495c5b +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49fd8e9cda +index 0000000000000000000000000000000000000000..6552cca25752823321adf0aea2b46a2df90a3ec1 --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp @@ -0,0 +1,394 @@ @@ -15038,7 +14572,7 @@ index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49 + +template +class CallbackList { -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(CallbackList); +public: + ~CallbackList() + { @@ -15098,7 +14632,7 @@ index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49 + m_wheelCallbacks->sendSuccess(); +} + -+void WebPageInspectorInputAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) ++void WebPageInspectorInputAgent::didCreateFrontendAndBackend() +{ + m_keyboardCallbacks = makeUnique(); + m_mouseCallbacks = makeUnique(); @@ -15180,7 +14714,7 @@ index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49 + bool eventIsSystemKey = false; + if (isSystemKey) + eventIsSystemKey = *isSystemKey; -+ WallTime timestamp = WallTime::now(); ++ MonotonicTime timestamp = MonotonicTime::now(); + + // cancel any active drag on Escape + if (eventType == WebEventType::KeyDown && key == "Escape"_s && m_page.cancelDragIfNeeded()) { @@ -15272,7 +14806,7 @@ index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49 + UNUSED_VARIABLE(eventClickCount); + platformDispatchMouseEvent(type, x, y, WTFMove(modifiers), button, WTFMove(clickCount), eventButtons); +#elif PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN) -+ WallTime timestamp = WallTime::now(); ++ MonotonicTime timestamp = MonotonicTime::now(); + NativeWebMouseEvent event( + eventType, + eventButton, @@ -15300,7 +14834,7 @@ index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49 +{ + float rotationAngle = 0.0; + float force = 1.0; -+ const WebCore::IntSize radius(1, 1); ++ const WebCore::DoubleSize radius(1, 1); + + uint8_t unsignedModifiers = modifiers ? static_cast(*modifiers) : 0; + OptionSet eventModifiers; @@ -15344,7 +14878,7 @@ index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49 + touchPoints.append(WebPlatformTouchPoint(id, state, position, position, radius, rotationAngle, force)); + } + -+ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, WallTime::now()}, WTFMove(touchPoints), {}, {}); ++ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, MonotonicTime::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); @@ -15373,7 +14907,7 @@ index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49 + x = clampToInteger(roundf(x * totalScale)); + y = clampToInteger(roundf(y * totalScale)); + -+ WallTime timestamp = WallTime::now(); ++ MonotonicTime timestamp = MonotonicTime::now(); + WebCore::FloatSize delta = {-eventDeltaX, -eventDeltaY}; + WebCore::FloatSize wheelTicks = delta; + wheelTicks.scale(1.0f / WebCore::Scrollbar::pixelsPerLineStep()); @@ -15385,7 +14919,7 @@ index 0000000000000000000000000000000000000000..6cb20d95c1cd8682b025cfdf4ac74f49 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..26a2a3c0791c334f811ec99a630314f8e8521d02 +index 0000000000000000000000000000000000000000..1430b24f8d4b992ccd637ef6ff6a27e961e914de --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.h @@ -0,0 +1,87 @@ @@ -15437,7 +14971,7 @@ index 0000000000000000000000000000000000000000..26a2a3c0791c334f811ec99a630314f8 + +class WebPageInspectorInputAgent : public Inspector::InspectorAgentBase, public Inspector::InputBackendDispatcherHandler { + WTF_MAKE_NONCOPYABLE(WebPageInspectorInputAgent); -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(WebPageInspectorInputAgent); +public: + WebPageInspectorInputAgent(Inspector::BackendDispatcher& backendDispatcher, WebPageProxy& page); + ~WebPageInspectorInputAgent() override; @@ -15446,7 +14980,7 @@ index 0000000000000000000000000000000000000000..26a2a3c0791c334f811ec99a630314f8 + void didProcessAllPendingMouseEvents(); + void didProcessAllPendingWheelEvents(); + -+ void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override; ++ void didCreateFrontendAndBackend() override; + void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override; + + // Protocol handler @@ -15457,7 +14991,7 @@ index 0000000000000000000000000000000000000000..26a2a3c0791c334f811ec99a630314f8 + void dispatchWheelEvent(int x, int y, std::optional&& modifiers, std::optional&& deltaX, std::optional&& deltaY, Ref&& callback) override; + +private: -+ void platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& commands, WallTime timestamp); ++ void platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& commands, MonotonicTime timestamp); +#if PLATFORM(MAC) + void platformDispatchMouseEvent(const String& type, int x, int y, std::optional&& modifier, const String& button, std::optional&& clickCount, unsigned short buttons); +#endif @@ -15477,18 +15011,18 @@ index 0000000000000000000000000000000000000000..26a2a3c0791c334f811ec99a630314f8 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp -index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda102142943 100644 +index 5d0aee4580888ea1714d2c7aa0f7cd77f6a7c3bf..3e3a8a01d25af9ae0c88e941c094dc115017379a 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit/UIProcess/WebPageProxy.cpp -@@ -206,6 +206,7 @@ - #include +@@ -210,6 +210,7 @@ #include #include + #include +#include #include #include #include -@@ -218,6 +219,7 @@ +@@ -222,6 +223,7 @@ #include #include #include @@ -15496,7 +15030,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 #include #include #include -@@ -242,6 +244,7 @@ +@@ -245,6 +247,7 @@ #include #include #include @@ -15504,10 +15038,10 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 #include #include #include -@@ -250,10 +253,13 @@ - #include +@@ -254,10 +257,13 @@ #include #include + #include +#include #include #include @@ -15518,29 +15052,19 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 #include #include #include -@@ -349,6 +355,9 @@ - #if USE(GBM) - #include "AcceleratedBackingStoreDMABuf.h" +@@ -345,7 +351,7 @@ + #include "ViewSnapshotStore.h" #endif -+#endif -+ + +-#if PLATFORM(GTK) +#if PLATFORM(GTK) || PLATFORM(WPE) #include #endif -@@ -474,6 +483,8 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; - static constexpr Seconds audibleActivityClearDelay = 10_s; - #endif +@@ -1016,6 +1022,10 @@ WebPageProxy::~WebPageProxy() -+using namespace WebCore; -+ - DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webPageProxyCounter, ("WebPageProxy")); - - #if PLATFORM(COCOA) -@@ -1006,6 +1017,10 @@ WebPageProxy::~WebPageProxy() - #endif - - internals().updatePlayingMediaDidChangeTimer.stop(); + ASSERT(webPageProxyMap().get(m_identifier) == this); + webPageProxyMap().remove(m_identifier); + +#if PLATFORM(COCOA) + releaseInspectorDragPasteboard(); @@ -15548,7 +15072,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 } Ref WebPageProxy::Internals::protectedPage() const -@@ -1590,7 +1605,7 @@ void WebPageProxy::didAttachToRunningProcess() +@@ -1593,7 +1603,7 @@ void WebPageProxy::didAttachToRunningProcess() #if ENABLE(FULLSCREEN_API) ASSERT(!m_fullScreenManager); @@ -15557,7 +15081,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 #endif #if ENABLE(VIDEO_PRESENTATION_MODE) ASSERT(!m_playbackSessionManager); -@@ -1754,6 +1769,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags eff +@@ -1757,6 +1767,7 @@ void WebPageProxy::initializeWebPage(const Site& site, WebCore::SandboxFlags eff if (preferences->siteIsolationEnabled()) browsingContextGroup->addPage(*this); process->send(Messages::WebProcess::CreateWebPage(m_webPageID, creationParameters(process, *protectedDrawingArea(), m_mainFrame->frameID(), std::nullopt)), 0); @@ -15565,7 +15089,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 #if ENABLE(WINDOW_PROXY_PROPERTY_ACCESS_NOTIFICATION) internals().frameLoadStateObserver = WebPageProxyFrameLoadStateObserver::create(); -@@ -2036,6 +2052,21 @@ Ref WebPageProxy::ensureProtectedRunningProcess() +@@ -2071,6 +2082,21 @@ Ref WebPageProxy::ensureProtectedRunningProcess() return ensureRunningProcess(); } @@ -15584,10 +15108,10 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 + return navigation; +} + - RefPtr WebPageProxy::loadRequest(WebCore::ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, IsPerformingHTTPFallback isPerformingHTTPFallback, std::unique_ptr&& lastNavigationAction, API::Object* userData) + RefPtr WebPageProxy::loadRequest(WebCore::ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, IsPerformingHTTPFallback isPerformingHTTPFallback, std::unique_ptr&& lastNavigationAction, API::Object* userData, bool isRequestFromClientOrUserInput) { if (m_isClosed) -@@ -2152,11 +2183,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref&& proces +@@ -2190,11 +2216,29 @@ void WebPageProxy::loadRequestWithNavigationShared(Ref&& proces navigation->setIsLoadedWithNavigationShared(true); protectedProcess->markProcessAsRecentlyUsed(); @@ -15621,8 +15145,8 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 }); } -@@ -2712,6 +2761,63 @@ void WebPageProxy::setControlledByAutomation(bool controlled) - protectedWebsiteDataStore()->protectedNetworkProcess()->send(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation), 0); +@@ -2757,6 +2801,63 @@ RefPtr WebPageProxy::activeAutomationSession() const + return m_configuration->processPool().automationSession(); } +void WebPageProxy::setAuthCredentialsForAutomation(std::optional&& credentials, std::optional&& origin) @@ -15685,7 +15209,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 void WebPageProxy::createInspectorTarget(IPC::Connection& connection, const String& targetId, Inspector::InspectorTargetType type) { MESSAGE_CHECK_BASE(!targetId.isEmpty(), connection); -@@ -2999,6 +3105,24 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) +@@ -3044,6 +3145,24 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) bool wasVisible = isViewVisible(); RefPtr pageClient = this->pageClient(); internals().activityState.remove(flagsToUpdate); @@ -15710,7 +15234,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 if (flagsToUpdate & ActivityState::IsFocused && pageClient->isViewFocused()) internals().activityState.add(ActivityState::IsFocused); if (flagsToUpdate & ActivityState::WindowIsActive && pageClient->isViewWindowActive()) -@@ -3762,7 +3886,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt +@@ -3809,7 +3928,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt if (!hasRunningProcess()) return; @@ -15719,7 +15243,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 URL url { dragData.asURL() }; if (url.protocolIsFile()) protectedLegacyMainFrameProcess()->assumeReadAccessToBaseURL(*this, url.string(), [] { }); -@@ -3790,6 +3914,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag +@@ -3837,6 +3956,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag if (!hasRunningProcess()) return; @@ -15728,7 +15252,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 auto completionHandler = [this, protectedThis = Ref { *this }, action, dragData] (std::optional dragOperation, WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const IntRect& insertionRect, const IntRect& editableElementRect, std::optional remoteUserInputEventData) mutable { if (!m_pageClient) return; -@@ -3801,7 +3927,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag +@@ -3848,7 +3969,7 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag dragData.setClientPosition(remoteUserInputEventData->transformedPoint); performDragControllerAction(action, dragData, remoteUserInputEventData->targetFrameID); }; @@ -15737,7 +15261,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 ASSERT(dragData.platformData()); sendWithAsyncReplyToProcessContainingFrame(frameID, Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags()), WTFMove(completionHandler)); #else -@@ -3836,14 +3962,35 @@ void WebPageProxy::didPerformDragControllerAction(std::optionalpageClient()) pageClient->didPerformDragControllerAction(); @@ -15746,27 +15270,26 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 + m_inspectorController->didProcessAllPendingMouseEvents(); } --#if PLATFORM(GTK) -+#if PLATFORM(GTK) || PLATFORM(WPE) + #if PLATFORM(GTK) || PLATFORM(WPE) void WebPageProxy::startDrag(SelectionData&& selectionData, OptionSet dragOperationMask, std::optional&& dragImageHandle, IntPoint&& dragImageHotspot) { -- if (RefPtr pageClient = this->pageClient()) { -- RefPtr dragImage = dragImageHandle ? ShareableBitmap::create(WTFMove(*dragImageHandle)) : nullptr; -- pageClient->startDrag(WTFMove(selectionData), dragOperationMask, WTFMove(dragImage), WTFMove(dragImageHotspot)); + if (m_interceptDrags) { + m_dragSelectionData = WTFMove(selectionData); + m_dragSourceOperationMask = dragOperationMask; + } else { -+#if PLATFORM(GTK) + #if PLATFORM(GTK) +- if (RefPtr pageClient = this->pageClient()) { +- RefPtr dragImage = dragImageHandle ? ShareableBitmap::create(WTFMove(*dragImageHandle)) : nullptr; +- pageClient->startDrag(WTFMove(selectionData), dragOperationMask, WTFMove(dragImage), WTFMove(dragImageHotspot)); + if (RefPtr pageClient = this->pageClient()) { + RefPtr dragImage = dragImageHandle ? ShareableBitmap::create(WTFMove(*dragImageHandle)) : nullptr; + pageClient->startDrag(WTFMove(selectionData), dragOperationMask, WTFMove(dragImage), WTFMove(dragImageHotspot)); + } +#endif -+ } + } + didStartDrag(); +} -+#endif + #endif + +#if PLATFORM(WIN) && ENABLE(DRAG_SUPPORT) +void WebPageProxy::startDrag(WebCore::DragDataMap&& dragDataMap) @@ -15774,10 +15297,11 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 + if (m_interceptDrags) { + m_dragSelectionData = WTFMove(dragDataMap); + m_dragSourceOperationMask = WebCore::anyDragOperation(); - } ++ } didStartDrag(); } -@@ -3865,6 +4012,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo + #endif +@@ -3914,6 +4054,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo setDragCaretRect({ }); } @@ -15802,7 +15326,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 void WebPageProxy::didStartDrag() { if (!hasRunningProcess()) -@@ -3872,6 +4037,26 @@ void WebPageProxy::didStartDrag() +@@ -3921,6 +4079,26 @@ void WebPageProxy::didStartDrag() discardQueuedMouseEvents(); send(Messages::WebPage::DidStartDrag()); @@ -15829,12 +15353,12 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 } void WebPageProxy::dragCancelled() -@@ -4043,26 +4228,47 @@ void WebPageProxy::processNextQueuedMouseEvent() +@@ -4092,26 +4270,47 @@ void WebPageProxy::processNextQueuedMouseEvent() process->startResponsivenessTimer(); } - std::optional> sandboxExtensions; -+ m_lastMousePositionForDrag = event->position(); ++ m_lastMousePositionForDrag = roundedIntPoint(event->position()); + if (!m_dragSelectionData) { + std::optional> sandboxExtensions; @@ -15869,9 +15393,9 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 + internals().coalescedMouseEvents.clear(); + } else { +#if PLATFORM(WIN) || PLATFORM(COCOA) -+ DragData dragData(*m_dragSelectionData, event->position(), event->globalPosition(), m_dragSourceOperationMask); ++ DragData dragData(*m_dragSelectionData, roundedIntPoint(event->position()), roundedIntPoint(event->globalPosition()), m_dragSourceOperationMask); +#else -+ DragData dragData(&*m_dragSelectionData, event->position(), event->globalPosition(), m_dragSourceOperationMask); ++ DragData dragData(&*m_dragSelectionData, roundedIntPoint(event->position()), roundedIntPoint(event->globalPosition()), m_dragSourceOperationMask); +#endif + if (eventType == WebEventType::MouseMove) { + dragUpdated(dragData); @@ -15882,15 +15406,15 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 + performDragOperation(dragData, ""_s, WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionsForUpload)); + } + m_dragSelectionData = std::nullopt; -+ dragEnded(event->position(), event->globalPosition(), m_dragSourceOperationMask); ++ dragEnded(roundedIntPoint(event->position()), roundedIntPoint(event->globalPosition()), m_dragSourceOperationMask); + } + didReceiveEventIPC(process->connection(), eventType, true, std::nullopt); + } } void WebPageProxy::doAfterProcessingAllPendingMouseEvents(WTF::Function&& action) -@@ -4260,6 +4466,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) - +@@ -4309,6 +4508,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) + if (RefPtr automationSession = m_configuration->processPool().automationSession()) automationSession->wheelEventsFlushedForPage(*this); + @@ -15898,7 +15422,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 } void WebPageProxy::cacheWheelEventScrollingAccelerationCurve(const NativeWebWheelEvent& nativeWheelEvent) -@@ -4396,7 +4604,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) +@@ -4444,7 +4645,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent) { @@ -15907,15 +15431,15 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 for (auto& touchPoint : touchStartEvent.touchPoints()) { auto location = touchPoint.locationInRootView(); auto update = [this, location](TrackingType& trackingType, EventTrackingRegions::EventType eventType) { -@@ -5078,6 +5286,7 @@ Ref WebPageProxy::navigationOriginatingPage(const FrameInfoData& f +@@ -5163,6 +5364,7 @@ Ref WebPageProxy::navigationOriginatingPage(const FrameInfoData& f - void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, RefPtr&& websitePolicies, Ref&& navigationAction, WillContinueLoadInNewProcess willContinueLoadInNewProcess, std::optional sandboxExtensionHandle, std::optional&& consoleMessage, CompletionHandler&& completionHandler) + void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, std::optional, Ref>>&& websitePoliciesAndProcess, Ref&& navigationAction, WillContinueLoadInNewProcess willContinueLoadInNewProcess, std::optional sandboxExtensionHandle, std::optional&& consoleMessage, CompletionHandler&& completionHandler) { + m_inspectorController->didReceivePolicyDecision(action, navigation ? std::optional { navigation->navigationID() } : std::nullopt); if (!hasRunningProcess()) return completionHandler(PolicyDecision { }); -@@ -6080,6 +6289,7 @@ void WebPageProxy::viewScaleFactorDidChange(IPC::Connection& connection, double +@@ -6174,6 +6376,7 @@ void WebPageProxy::viewScaleFactorDidChange(IPC::Connection& connection, double MESSAGE_CHECK_BASE(scaleFactorIsValid(scaleFactor), connection); if (!legacyMainFrameProcess().hasConnection(connection)) return; @@ -15923,7 +15447,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 forEachWebContentProcess([&] (auto& process, auto pageID) { if (&process == &legacyMainFrameProcess()) -@@ -6731,6 +6941,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, We +@@ -6836,6 +7039,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, We RefPtr protectedPageClient { pageClient() }; m_navigationState->didDestroyNavigation(process->coreProcessIdentifier(), navigationID); @@ -15931,7 +15455,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 } void WebPageProxy::didStartProvisionalLoadForFrame(IPC::Connection& connection, FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, std::optional navigationID, URL&& url, URL&& unreachableURL, const UserData& userData, WallTime timestamp) -@@ -7079,6 +7290,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p +@@ -7202,6 +7406,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p m_failingProvisionalLoadURL = { }; @@ -15940,7 +15464,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 // If the provisional page's load fails then we destroy the provisional page. if (m_provisionalPage && m_provisionalPage->mainFrame() == &frame && (willContinueLoading == WillContinueLoading::No || protectedPreferences()->siteIsolationEnabled())) m_provisionalPage = nullptr; -@@ -8642,6 +8855,8 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w +@@ -8779,6 +8985,8 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w if (RefPtr page = originatingFrameInfo->page()) openerAppInitiatedState = page->lastNavigationWasAppInitiated(); @@ -15949,7 +15473,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 auto completionHandler = [ this, protectedThis = Ref { *this }, -@@ -8721,6 +8936,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w +@@ -8865,6 +9073,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w configuration->setOpenedMainFrameName(openedMainFrameName); if (!protectedPreferences()->siteIsolationEnabled()) configuration->setRelatedPage(*this); @@ -15957,7 +15481,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 if (RefPtr openerFrame = WebFrameProxy::webFrame(originatingFrameInfoData.frameID); navigationActionData.hasOpener && openerFrame) { configuration->setOpenerInfo({ { -@@ -8748,6 +8964,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w +@@ -8894,6 +9103,7 @@ void WebPageProxy::createNewPage(IPC::Connection& connection, WindowFeatures&& w void WebPageProxy::showPage() { m_uiClient->showPage(this); @@ -15965,7 +15489,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 } bool WebPageProxy::hasOpenedPage() const -@@ -8898,6 +9115,10 @@ void WebPageProxy::closePage() +@@ -9032,6 +9242,10 @@ void WebPageProxy::closePage() if (isClosed()) return; @@ -15976,7 +15500,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 WEBPAGEPROXY_RELEASE_LOG(Process, "closePage:"); if (RefPtr pageClient = this->pageClient()) pageClient->clearAllEditCommands(); -@@ -8936,6 +9157,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi +@@ -9070,6 +9284,8 @@ void WebPageProxy::runJavaScriptAlert(IPC::Connection& connection, FrameIdentifi } runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), WTFMove(message), [reply = WTFMove(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler&& completion) mutable { @@ -15985,7 +15509,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 page.m_uiClient->runJavaScriptAlert(page, WTFMove(message), frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)]() mutable { reply(); completion(); -@@ -8958,6 +9181,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti +@@ -9092,6 +9308,8 @@ void WebPageProxy::runJavaScriptConfirm(IPC::Connection& connection, FrameIdenti if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this, message, std::nullopt); } @@ -15994,7 +15518,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), WTFMove(message), [reply = WTFMove(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler&& completion) mutable { page.m_uiClient->runJavaScriptConfirm(page, WTFMove(message), frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)](bool result) mutable { -@@ -8982,6 +9207,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif +@@ -9116,6 +9334,8 @@ void WebPageProxy::runJavaScriptPrompt(IPC::Connection& connection, FrameIdentif if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this, message, defaultValue); } @@ -16003,7 +15527,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), WTFMove(message), [reply = WTFMove(reply), defaultValue= WTFMove(defaultValue)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, String&& message, CompletionHandler&& completion) mutable { page.m_uiClient->runJavaScriptPrompt(page, WTFMove(message), WTFMove(defaultValue), frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)](auto& result) mutable { -@@ -9123,6 +9350,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram +@@ -9252,6 +9472,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(IPC::Connection& connection, Fram return; } } @@ -16012,7 +15536,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer and the tryClose timer. webProcess->stopResponsivenessTimer(); -@@ -9758,6 +9987,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, +@@ -9897,6 +10119,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, } #if ENABLE(FULLSCREEN_API) @@ -16024,7 +15548,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 WebFullScreenManagerProxy* WebPageProxy::fullScreenManager() { return m_fullScreenManager.get(); -@@ -9890,6 +10124,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc +@@ -10029,6 +10256,17 @@ void WebPageProxy::requestDOMPasteAccess(IPC::Connection& connection, DOMPasteAc } } @@ -16042,7 +15566,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 protectedPageClient()->requestDOMPasteAccess(pasteAccessCategory, requiresInteraction, elementRect, originIdentifier, WTFMove(completionHandler)); } -@@ -10900,6 +11145,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event +@@ -11064,6 +11302,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->mouseEventsFlushedForPage(*this); didFinishProcessingAllPendingMouseEvents(); @@ -16051,7 +15575,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 } } -@@ -10935,6 +11182,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy +@@ -11099,6 +11339,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy if (!canProcessMoreKeyEvents) { if (RefPtr automationSession = configuration().processPool().automationSession()) automationSession->keyboardEventsFlushedForPage(*this); @@ -16059,7 +15583,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 } } -@@ -11369,7 +11617,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process +@@ -11533,7 +11774,10 @@ void WebPageProxy::dispatchProcessDidTerminate(WebProcessProxy& process, Process if (protectedPreferences()->siteIsolationEnabled()) protectedBrowsingContextGroup()->processDidTerminate(*this, process); @@ -16071,16 +15595,16 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 if (m_loaderClient) handledByClient = reason != ProcessTerminationReason::RequestedByClient && m_loaderClient->processDidCrash(*this); else -@@ -12022,6 +12273,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc - parameters.canUseCredentialStorage = m_canUseCredentialStorage; - +@@ -12195,6 +12439,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc parameters.httpsUpgradeEnabled = preferences->upgradeKnownHostsToHTTPSEnabled() ? m_configuration->httpsUpgradeEnabled() : false; -+ + parameters.allowPostingLegacySynchronousMessages = m_configuration->allowPostingLegacySynchronousMessages(); + + parameters.shouldPauseInInspectorWhenShown = m_inspectorController->shouldPauseInInspectorWhenShown(); - ++ #if ENABLE(APP_HIGHLIGHTS) parameters.appHighlightsVisible = appHighlightsVisibility() ? HighlightVisibility::Visible : HighlightVisibility::Hidden; -@@ -12190,8 +12443,47 @@ void WebPageProxy::allowGamepadAccess() + #endif +@@ -12368,8 +12614,47 @@ void WebPageProxy::allowGamepadAccess() #endif // ENABLE(GAMEPAD) @@ -16128,7 +15652,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes) { m_navigationClient->shouldAllowLegacyTLS(*this, authenticationChallenge.get(), [this, protectedThis = Ref { *this }, authenticationChallenge] (bool shouldAllowLegacyTLS) { if (shouldAllowLegacyTLS) -@@ -12287,6 +12579,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect +@@ -12465,6 +12750,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(IPC::Connection& connect request->deny(); }; @@ -16141,7 +15665,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 // 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 -@@ -12353,6 +12651,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi +@@ -12531,6 +12822,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi shouldChangeDeniedToPrompt = false; if (sessionID().isEphemeral()) { @@ -16154,7 +15678,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); return; } -@@ -12367,6 +12671,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi +@@ -12545,6 +12842,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi return; } @@ -16168,7 +15692,7 @@ index 26edaf188b554c9d0622ee3419d343e0e500e7f9..a884af86f2c56693a1aba8246168fda1 completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); return; diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h -index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172ef8a2def 100644 +index d52e894d265b737d653497c418369a8b79c58c26..35404a588d4b5c45848f6921ea2c3191030c1b39 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.h +++ b/Source/WebKit/UIProcess/WebPageProxy.h @@ -28,6 +28,7 @@ @@ -16208,8 +15732,8 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 class FloatRect; class FloatSize; class FontAttributeChanges; -@@ -745,6 +761,8 @@ public: - void setControlledByAutomation(bool); +@@ -773,6 +789,8 @@ public: + RefPtr activeAutomationSession() const; WebPageInspectorController& inspectorController() { return m_inspectorController.get(); } + InspectorDialogAgent* inspectorDialogAgent() { return m_inspectorDialogAgent; } @@ -16217,7 +15741,7 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 #if PLATFORM(IOS_FAMILY) void showInspectorIndication(); -@@ -778,6 +796,7 @@ public: +@@ -806,6 +824,7 @@ public: bool hasSleepDisabler() const; #if ENABLE(FULLSCREEN_API) @@ -16225,7 +15749,7 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 WebFullScreenManagerProxy* fullScreenManager(); RefPtr protectedFullScreenManager(); void setFullScreenClientForTesting(std::unique_ptr&&); -@@ -870,6 +889,12 @@ public: +@@ -898,6 +917,12 @@ public: void setPageLoadStateObserver(RefPtr&&); @@ -16235,19 +15759,19 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 + void setActiveForAutomation(std::optional active); + void logToStderr(const String& str); + - void initializeWebPage(const WebCore::Site&, WebCore::SandboxFlags); + void initializeWebPage(const WebCore::Site&, WebCore::SandboxFlags, WebCore::ReferrerPolicy); void setDrawingArea(RefPtr&&); -@@ -901,6 +926,8 @@ public: +@@ -929,6 +954,8 @@ public: RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::IsPerformingHTTPFallback); - RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::IsPerformingHTTPFallback, std::unique_ptr&&, API::Object* userData = nullptr); + RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, WebCore::IsPerformingHTTPFallback, std::unique_ptr&&, API::Object* userData = nullptr, bool isRequestFromClientOrUserInput = true); + RefPtr loadRequestForInspector(WebCore::ResourceRequest&&, WebFrameProxy*); + RefPtr loadFile(const String& fileURL, const String& resourceDirectoryURL, bool isAppInitiated = true, API::Object* userData = nullptr); RefPtr loadData(Ref&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr); RefPtr loadData(Ref&&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldOpenExternalURLsPolicy); -@@ -990,6 +1017,7 @@ public: +@@ -1021,6 +1048,7 @@ public: PageClient* pageClient() const; RefPtr protectedPageClient() const; @@ -16255,24 +15779,23 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 void setViewNeedsDisplay(const WebCore::Region&); void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated); -@@ -1635,17 +1663,23 @@ public: +@@ -1674,10 +1702,13 @@ public: void didStartDrag(); void dragCancelled(); void setDragCaretRect(const WebCore::IntRect&); + void setInterceptDrags(bool shouldIntercept); + bool cancelDragIfNeeded(); #if PLATFORM(COCOA) - void startDrag(const WebCore::DragItem&, WebCore::ShareableBitmapHandle&& dragImageHandle, const std::optional&); + void startDrag(const WebCore::DragItem&, WebCore::ShareableBitmapHandle&& dragImageHandle, const std::optional&); 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 --#if PLATFORM(GTK) -+#if PLATFORM(GTK) || PLATFORM(WPE) + #if PLATFORM(GTK) || PLATFORM(WPE) void startDrag(WebCore::SelectionData&&, OptionSet, std::optional&& dragImage, WebCore::IntPoint&& dragImageHotspot); - #endif +@@ -1685,6 +1716,9 @@ public: #if ENABLE(MODEL_PROCESS) - void modelDragEnded(const WebCore::ElementIdentifier); + void modelDragEnded(const WebCore::NodeIdentifier); #endif +#if PLATFORM(WIN) + void startDrag(WebCore::DragDataMap&& dragDataMap); @@ -16280,7 +15803,7 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 #endif void processDidBecomeUnresponsive(); -@@ -1897,6 +1931,7 @@ public: +@@ -1930,6 +1964,7 @@ public: void setViewportSizeForCSSViewportUnits(const WebCore::FloatSize&); WebCore::FloatSize viewportSizeForCSSViewportUnits() const; @@ -16288,7 +15811,7 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 void didReceiveAuthenticationChallengeProxy(Ref&&, NegotiatedLegacyTLS); void negotiatedLegacyTLS(); void didNegotiateModernTLS(const URL&); -@@ -1930,6 +1965,8 @@ public: +@@ -1962,6 +1997,8 @@ public: #if PLATFORM(COCOA) || PLATFORM(GTK) RefPtr takeViewSnapshot(std::optional&&); RefPtr takeViewSnapshot(std::optional&&, ForceSoftwareCapturingViewportSnapshot); @@ -16297,7 +15820,7 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 #endif void serializeAndWrapCryptoKey(IPC::Connection&, WebCore::CryptoKeyData&&, CompletionHandler>&&)>&&); -@@ -2956,6 +2993,7 @@ private: +@@ -3012,6 +3049,7 @@ private: RefPtr launchProcessForReload(); void requestNotificationPermission(const String& originString, CompletionHandler&&); @@ -16305,7 +15828,7 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 void didChangeContentSize(const WebCore::IntSize&); void didChangeIntrinsicContentSize(const WebCore::IntSize&); -@@ -3482,8 +3520,10 @@ private: +@@ -3541,8 +3579,10 @@ private: String m_openedMainFrameName; RefPtr m_inspector; @@ -16316,7 +15839,7 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 RefPtr m_fullScreenManager; std::unique_ptr m_fullscreenClient; #endif -@@ -3680,6 +3720,22 @@ private: +@@ -3743,6 +3783,22 @@ private: std::optional m_currentDragOperation; bool m_currentDragIsOverFileInput { false }; unsigned m_currentDragNumberOfFilesToBeAccepted { 0 }; @@ -16339,7 +15862,7 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 #endif bool m_mainFrameHasHorizontalScrollbar { false }; -@@ -3851,6 +3907,10 @@ private: +@@ -3913,6 +3969,10 @@ private: RefPtr messageBody; }; Vector m_pendingInjectedBundleMessages; @@ -16351,23 +15874,18 @@ index 9cf73b03b77ddb5e68cfa1866c368b3126405610..ffcd057469132f3be590d06469518172 #if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION) RefPtr m_webDeviceOrientationUpdateProviderProxy; diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in -index fcb0649584da102c1446029342c8f31c59628301..5559c5f690a568bb1b39fe4bc0ac181a8e1953b3 100644 +index 0e03626bb05e7d28b053bca6524c51c962d05050..fb5e6ff170dd0f163b0803183a49bff9239480eb 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in @@ -35,6 +35,7 @@ messages -> WebPageProxy { RunJavaScriptConfirm(WebCore::FrameIdentifier frameID, struct WebKit::FrameInfoData frameInfo, String message) -> (bool result) Synchronous RunJavaScriptPrompt(WebCore::FrameIdentifier frameID, struct WebKit::FrameInfoData frameInfo, String message, String defaultValue) -> (String result) Synchronous - MouseDidMoveOverElement(struct WebKit::WebHitTestResultData hitTestResultData, OptionSet modifiers, WebKit::UserData userData) + MouseDidMoveOverElement(struct WebKit::WebHitTestResultData hitTestResultData, OptionSet modifiers) + LogToStderr(String text) DidReceiveEventIPC(enum:uint8_t WebKit::WebEventType eventType, bool handled, struct std::optional remoteUserInputEventData) SetCursor(WebCore::Cursor cursor) -@@ -333,10 +334,14 @@ messages -> WebPageProxy { - StartDrag(struct WebCore::DragItem dragItem, WebCore::ShareableBitmapHandle dragImage, std::optional elementID) - SetPromisedDataForImage(String pasteboardName, WebCore::SharedMemory::Handle imageHandle, String filename, String extension, String title, String url, String visibleURL, WebCore::SharedMemory::Handle archiveHandle, String originIdentifier) - #endif --#if PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) -+#if (PLATFORM(GTK) || PLATFORM(WPE)) && ENABLE(DRAG_SUPPORT) +@@ -332,6 +333,10 @@ messages -> WebPageProxy { StartDrag(WebCore::SelectionData selectionData, OptionSet dragOperationMask, std::optional dragImage, WebCore::IntPoint dragImageHotspot) #endif @@ -16377,12 +15895,12 @@ index fcb0649584da102c1446029342c8f31c59628301..5559c5f690a568bb1b39fe4bc0ac181a + #if PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT) WillReceiveEditDragSnapshot() - DidReceiveEditDragSnapshot(struct std::optional textIndicator) + DidReceiveEditDragSnapshot(RefPtr textIndicator) diff --git a/Source/WebKit/UIProcess/WebProcessCache.cpp b/Source/WebKit/UIProcess/WebProcessCache.cpp -index 9619dd597aec77547cccdf0d3ce6c711335f6244..db169d23388fd7b1cb7b79eef4160301aee0e0ef 100644 +index 2f731b7a81c5aef52bc3542fad9a958ae1629298..56d3681fbefe55417e388f27b4b7a5a28cfc4f9d 100644 --- a/Source/WebKit/UIProcess/WebProcessCache.cpp +++ b/Source/WebKit/UIProcess/WebProcessCache.cpp -@@ -100,6 +100,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const +@@ -111,6 +111,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const return false; } @@ -16394,10 +15912,10 @@ index 9619dd597aec77547cccdf0d3ce6c711335f6244..db169d23388fd7b1cb7b79eef4160301 } diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp -index a406b5a1e1523c07cb6dc2eebc493fa4f0026575..1f4fc38edd3756d5423e89a41c30a8ce7d5bf71f 100644 +index 22c373f5888aabdaa20aadbcba1aefdbc783dc25..0ce3b02ceca179b47fe91c4dba5225d52e3f2c7b 100644 --- a/Source/WebKit/UIProcess/WebProcessPool.cpp +++ b/Source/WebKit/UIProcess/WebProcessPool.cpp -@@ -439,10 +439,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& +@@ -429,10 +429,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& void WebProcessPool::setOverrideLanguages(Vector&& languages) { @@ -16410,7 +15928,7 @@ index a406b5a1e1523c07cb6dc2eebc493fa4f0026575..1f4fc38edd3756d5423e89a41c30a8ce #if ENABLE(GPU_PROCESS) if (RefPtr gpuProcess = GPUProcessProxy::singletonIfCreated()) -@@ -450,9 +450,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) +@@ -440,9 +440,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) #endif #if USE(SOUP) for (Ref networkProcess : NetworkProcessProxy::allNetworkProcesses()) @@ -16422,7 +15940,7 @@ index a406b5a1e1523c07cb6dc2eebc493fa4f0026575..1f4fc38edd3756d5423e89a41c30a8ce void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled) { -@@ -999,7 +1000,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa +@@ -1002,7 +1003,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa #endif parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel(); @@ -16432,10 +15950,10 @@ index a406b5a1e1523c07cb6dc2eebc493fa4f0026575..1f4fc38edd3756d5423e89a41c30a8ce parameters.urlSchemesRegisteredAsSecure = copyToVector(LegacyGlobalSettings::singleton().schemesToRegisterAsSecure()); diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp -index 51546b2db1e5ca415ceb550e69dc2daa982df450..6d10b802e49a3a0b803eb8a630e7c1c83c53f79c 100644 +index 749651e725c4485514ab2b17f78bb2e03d865e10..e50620b733cea8055e02aca6196287efeba56d96 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.cpp +++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp -@@ -208,6 +208,11 @@ Vector> WebProcessProxy::allProcesses() +@@ -209,6 +209,11 @@ Vector> WebProcessProxy::allProcesses() }); } @@ -16447,7 +15965,7 @@ index 51546b2db1e5ca415ceb550e69dc2daa982df450..6d10b802e49a3a0b803eb8a630e7c1c8 RefPtr WebProcessProxy::processForIdentifier(ProcessIdentifier identifier) { return allProcessMap().get(identifier); -@@ -577,6 +582,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt +@@ -534,6 +539,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt if (WebKit::isInspectorProcessPool(protectedProcessPool())) launchOptions.extraInitializationData.add("inspector-process"_s, "1"_s); @@ -16475,10 +15993,10 @@ index 51546b2db1e5ca415ceb550e69dc2daa982df450..6d10b802e49a3a0b803eb8a630e7c1c8 if (isPrewarmed()) diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h -index 4512391119154ce5b0ebb892e853499bda9747d9..33404c266e230e0cf62a0d9a597a7b59a047a1f3 100644 +index 35bfcf566f59ebd82525b5dc75e6782a624e485c..7f761e12fe836ad9dd54a77343f223bbdec92a44 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.h +++ b/Source/WebKit/UIProcess/WebProcessProxy.h -@@ -185,6 +185,7 @@ public: +@@ -193,6 +193,7 @@ public: static void forWebPagesWithOrigin(PAL::SessionID, const WebCore::SecurityOriginData&, NOESCAPE const Function&); static Vector> allowedFirstPartiesForCookies(); @@ -16487,10 +16005,10 @@ index 4512391119154ce5b0ebb892e853499bda9747d9..33404c266e230e0cf62a0d9a597a7b59 void initializeWebProcess(WebProcessCreationParameters&&); diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -index 606401f719eecd52737fc3f6f15a328f74f4f5d9..be13e62a1461f21543f0a51c57003779bb3c1c79 100644 +index 9c3fc4c42aa0369937dc6ba34bdbb2ee4db6dcfb..8d36b66176c4c94af03611a599ae111430852d96 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -@@ -321,15 +321,10 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W +@@ -320,15 +320,10 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W static Ref networkProcessForSession(PAL::SessionID sessionID) { @@ -16509,7 +16027,7 @@ index 606401f719eecd52737fc3f6f15a328f74f4f5d9..be13e62a1461f21543f0a51c57003779 #else UNUSED_PARAM(sessionID); return NetworkProcessProxy::ensureDefaultNetworkProcess(); -@@ -2061,6 +2056,15 @@ void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheMode +@@ -2085,6 +2080,15 @@ void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheMode processPool->setCacheModelSynchronouslyForTesting(cacheModel); } @@ -16525,7 +16043,7 @@ index 606401f719eecd52737fc3f6f15a328f74f4f5d9..be13e62a1461f21543f0a51c57003779 Vector WebsiteDataStore::parametersFromEachWebsiteDataStore() { return WTF::map(allDataStores(), [](auto& entry) { -@@ -2504,6 +2508,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin, +@@ -2519,6 +2523,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin, protectedNetworkProcess()->websiteDataOriginDirectoryForTesting(m_sessionID, WTFMove(origin), type, WTFMove(completionHandler)); } @@ -16539,7 +16057,7 @@ index 606401f719eecd52737fc3f6f15a328f74f4f5d9..be13e62a1461f21543f0a51c57003779 void WebsiteDataStore::hasAppBoundSession(CompletionHandler&& completionHandler) const { diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h -index 64d8fb4e83836c3dde325e77ded6b014e819cb10..c4b923995301697f8a52d72e74c842dcf4ec8161 100644 +index 428e7bf7c1804e635312c6ee3fda1c29c1a61a5e..b497045e01412826d3a4116577472e4f8b9b6f95 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h @@ -98,6 +98,7 @@ class DeviceIdHashSaltStorage; @@ -16573,7 +16091,7 @@ index 64d8fb4e83836c3dde325e77ded6b014e819cb10..c4b923995301697f8a52d72e74c842dc class WebsiteDataStore : public API::ObjectImpl, public CanMakeWeakPtr { public: static Ref defaultDataStore(); -@@ -321,8 +331,10 @@ public: +@@ -324,8 +334,10 @@ public: #if USE(SOUP) void setPersistentCredentialStorageEnabled(bool); bool persistentCredentialStorageEnabled() const { return m_persistentCredentialStorageEnabled && isPersistent(); } @@ -16584,7 +16102,7 @@ index 64d8fb4e83836c3dde325e77ded6b014e819cb10..c4b923995301697f8a52d72e74c842dc void setNetworkProxySettings(WebCore::SoupNetworkProxySettings&&); const WebCore::SoupNetworkProxySettings& networkProxySettings() const { return m_networkProxySettings; } void setCookiePersistentStorage(const String&, SoupCookiePersistentStorageType); -@@ -419,6 +431,12 @@ public: +@@ -421,6 +433,12 @@ public: static const String& defaultBaseDataDirectory(); #endif @@ -16597,7 +16115,7 @@ index 64d8fb4e83836c3dde325e77ded6b014e819cb10..c4b923995301697f8a52d72e74c842dc void resetQuota(CompletionHandler&&); void resetStoragePersistedState(CompletionHandler&&); #if PLATFORM(IOS_FAMILY) -@@ -616,7 +634,9 @@ private: +@@ -623,7 +641,9 @@ private: #if USE(SOUP) bool m_persistentCredentialStorageEnabled { true }; @@ -16608,8 +16126,8 @@ index 64d8fb4e83836c3dde325e77ded6b014e819cb10..c4b923995301697f8a52d72e74c842dc WebCore::SoupNetworkProxySettings m_networkProxySettings; String m_cookiePersistentStoragePath; SoupCookiePersistentStorageType m_cookiePersistentStorageType { SoupCookiePersistentStorageType::SQLite }; -@@ -643,6 +663,10 @@ private: - RefPtr m_cookieStore; +@@ -650,6 +670,10 @@ private: + const RefPtr m_cookieStore; RefPtr m_networkProcess; + std::optional m_allowDownloadForAutomation; @@ -16617,10 +16135,10 @@ index 64d8fb4e83836c3dde325e77ded6b014e819cb10..c4b923995301697f8a52d72e74c842dc + DownloadInstrumentation* m_downloadInstrumentation { nullptr }; + #if HAVE(APP_SSO) - std::unique_ptr m_soAuthorizationCoordinator; + const std::unique_ptr m_soAuthorizationCoordinator; #endif diff --git a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp -index 19934de3173ecc0507c5e59956bcf6730a8a88b4..bc0e52f6f28caeca8b9b7aab14b7ff991d7e6b41 100644 +index de9b08ac0588999d167cf97dc172ee35a8f8ab56..bab2b6ca88d666f16be6c1c32d05be5e02b88119 100644 --- a/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp +++ b/Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp @@ -114,6 +114,14 @@ void GeoclueGeolocationProvider::stop() @@ -16861,7 +16379,7 @@ index 0000000000000000000000000000000000000000..dfa06245b5411f2bc6ca7cebdb7c6d5f +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.h b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.h new file mode 100644 -index 0000000000000000000000000000000000000000..441442d899e4088f5c24ae9f70c3e4ffa1e6d340 +index 0000000000000000000000000000000000000000..68bc7b610703bfcd3eff0d1c032092f6967fdc16 --- /dev/null +++ b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.h @@ -0,0 +1,61 @@ @@ -16905,7 +16423,7 @@ index 0000000000000000000000000000000000000000..441442d899e4088f5c24ae9f70c3e4ff +namespace WebKit { + +class InspectorPlaywrightAgentClientGlib : public InspectorPlaywrightAgentClient { -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorPlaywrightAgentClientGlib); +public: + InspectorPlaywrightAgentClientGlib(const WTF::String& proxyURI, const char* const* ignoreHosts); + ~InspectorPlaywrightAgentClientGlib() override = default; @@ -16927,7 +16445,7 @@ index 0000000000000000000000000000000000000000..441442d899e4088f5c24ae9f70c3e4ff + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp -index 4d782728182319b3d6e8e6d05580d96dd7ea19ac..c28dff07b154dba6ba82e94953b7b24e25a89106 100644 +index 212f082e04070610eda84021d673b7c7a95aabf8..7d6219192016964ea6a5f6d380f2ee6f3dd2ced0 100644 --- a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp +++ b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp @@ -126,6 +126,8 @@ static OptionSet availableInputDevices() @@ -16939,37 +16457,16 @@ index 4d782728182319b3d6e8e6d05580d96dd7ea19ac..c28dff07b154dba6ba82e94953b7b24e #if ENABLE(TOUCH_EVENTS) return AvailableInputDevices::Touchscreen; #else -diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h -index 5529f52048b24290f424e877cd9dbfb890e02ffb..c2b76b6188dd9596c4a1f31c137daff7d7644c7f 100644 ---- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h -+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h -@@ -32,6 +32,7 @@ - #include - - typedef struct _cairo cairo_t; -+typedef struct _cairo_surface cairo_surface_t; - - #if USE(GTK4) - typedef struct _GdkSnapshot GdkSnapshot; -@@ -62,6 +63,8 @@ public: - #else - virtual bool paint(cairo_t*, const WebCore::IntRect&) = 0; - #endif -+ virtual cairo_surface_t* surface() { return nullptr; } -+ - virtual void realize() { }; - 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 395a409b6302d4146606fc0b45a15cff63c7f327..666d9629e0155e8c03b0672f7a9274de7f04d642 100644 ---- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -@@ -812,4 +812,30 @@ RefPtr AcceleratedBackingStoreDMABuf::bufferAsNativeImageF +diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp +index 7a8478ed880bdb584b54c250b250f2805000f4aa..5d7b63ba6fbb5426f5746b36ef6ccfa4bb6c9592 100644 +--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp ++++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp +@@ -848,4 +848,30 @@ RefPtr AcceleratedBackingStore::bufferAsNativeImageForTesting() con return m_committedBuffer->asNativeImageForTesting(); } +// Playwright begin -+cairo_surface_t* AcceleratedBackingStoreDMABuf::surface() ++cairo_surface_t* AcceleratedBackingStore::surface() +{ + RefPtr buffer = m_committedBuffer.get(); + if (!buffer) @@ -16995,25 +16492,34 @@ index 395a409b6302d4146606fc0b45a15cff63c7f327..666d9629e0155e8c03b0672f7a9274de +// Playwright end + } // namespace WebKit -diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h -index 63dfbed03bd898c822d426a5449141fec2841226..eaf141843da3f02c5ba6fd0322f3175248a7195b 100644 ---- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h -+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h -@@ -98,6 +98,7 @@ private: - #else - bool paint(cairo_t*, const WebCore::IntRect&) override; - #endif -+ cairo_surface_t* surface() override; - void unrealize() override; - void update(const LayerTreeContext&) override; - RendererBufferFormat bufferFormat() const override; -@@ -253,6 +254,9 @@ private: +diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h +index d305b6bf990f6befccb3f3e7c22a9949c4be41d3..22b0558d5729cf52fadc64b9e191b8a1f7330608 100644 +--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h ++++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h +@@ -41,6 +41,7 @@ + #include + + typedef void *EGLImage; ++typedef struct _cairo_surface cairo_surface_t; + + #if USE(GBM) + struct gbm_bo; +@@ -84,6 +85,7 @@ public: + void unrealize(); + RendererBufferDescription bufferDescription() const; + RefPtr bufferAsNativeImageForTesting() const; ++ cairo_surface_t* surface(); + + private: + explicit AcceleratedBackingStore(WebPageProxy&); +@@ -251,6 +253,10 @@ private: RefPtr m_committedBuffer; Rects m_pendingDamageRects; HashMap> m_buffers; +// Playwright begin + RefPtr m_flippedSurface; +// Playwright end ++ }; } // namespace WebKit @@ -17086,10 +16592,10 @@ index 349cd3d9efd7a921560fa2f1a9e1a2238e415938..9df937535595281039660b060c7fba22 GtkFontRendering fontRendering; diff --git a/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..6d763018a12b3d7cd33af84b23f4340cea194bce +index 0000000000000000000000000000000000000000..61d5b3f7f453fc67e6440da545fb5b4ae63ff64d --- /dev/null +++ b/Source/WebKit/UIProcess/gtk/WebPageInspectorEmulationAgentGtk.cpp -@@ -0,0 +1,119 @@ +@@ -0,0 +1,121 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -17173,7 +16679,9 @@ index 0000000000000000000000000000000000000000..6d763018a12b3d7cd33af84b23f4340c + height += windowAllocation.height - viewAllocation.height; + + if (auto* drawingArea = static_cast(m_page.drawingArea())) { -+ bool didNotHaveInitialAllocation = !windowAllocation.width && !windowAllocation.height; ++ bool didNotHaveInitialAllocation = (!windowAllocation.width && !windowAllocation.height) || ++ // Default size for new windows from browser_window_init in Tools/MiniBrowser/gtk/BrowserWindow.c. ++ (windowAllocation.width == 1024 && windowAllocation.height == 768); + // 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) @@ -17211,7 +16719,7 @@ index 0000000000000000000000000000000000000000..6d763018a12b3d7cd33af84b23f4340c +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..36ab6e9aec9f8d79fb13a8a49beadaafb3da58f5 +index 0000000000000000000000000000000000000000..1cfdb88580573649d816a875b51ebe650c091170 --- /dev/null +++ b/Source/WebKit/UIProcess/gtk/WebPageInspectorInputAgentGtk.cpp @@ -0,0 +1,76 @@ @@ -17264,7 +16772,7 @@ index 0000000000000000000000000000000000000000..36ab6e9aec9f8d79fb13a8a49beadaaf + return state; +} + -+void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& macCommands, WallTime timestamp) ++void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& macCommands, MonotonicTime timestamp) +{ + Vector commands; + const guint keyVal = WebCore::PlatformKeyboardEvent::gdkKeyCodeForWindowsKeyCode(windowsVirtualKeyCode); @@ -17291,6 +16799,60 @@ index 0000000000000000000000000000000000000000..36ab6e9aec9f8d79fb13a8a49beadaaf +} + +} // namespace WebKit +diff --git a/Source/WebKit/UIProcess/gtk/WebPageInspectorTargetProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPageInspectorTargetProxyGtk.cpp +new file mode 100644 +index 0000000000000000000000000000000000000000..1230758b42b5affc40b85ca98ed4af7547342588 +--- /dev/null ++++ b/Source/WebKit/UIProcess/gtk/WebPageInspectorTargetProxyGtk.cpp +@@ -0,0 +1,48 @@ ++/* ++ * Copyright (C) 2019 Microsoft Corporation. ++ * ++ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT ++ * OWNER OR 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 "WebPageInspectorTargetProxy.h" ++ ++#include "WebPageProxy.h" ++#include ++#include ++ ++namespace WebKit { ++ ++void WebPageInspectorTargetProxy::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 ++ error = "The view is not on screen"_s; ++} ++ ++} // namespace WebKit diff --git a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp index e4f31f89b42bc7884da760a18150bd1274d0383d..b2390de63e48a8a48a798199aa99203ef9390451 100644 --- a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp @@ -17327,7 +16889,7 @@ index 8afb6132fad823816f84328a8b0a1a514f998bf7..54b582e60f4b16b3c7ba038c8c52466c CorrectionPanel(); diff --git a/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.h b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.h new file mode 100644 -index 0000000000000000000000000000000000000000..2aabc02a4b5432f68a6e85fd9689775608f05a67 +index 0000000000000000000000000000000000000000..edb4581e8f1f484976a9081d37cb61e54b9b81c5 --- /dev/null +++ b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.h @@ -0,0 +1,53 @@ @@ -17366,7 +16928,7 @@ index 0000000000000000000000000000000000000000..2aabc02a4b5432f68a6e85fd96897756 +namespace WebKit { + +class InspectorPlaywrightAgentClientMac : public InspectorPlaywrightAgentClient { -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorPlaywrightAgentClientMac); +public: + InspectorPlaywrightAgentClientMac(_WKBrowserInspectorDelegate* delegate, bool headless); + ~InspectorPlaywrightAgentClientMac() override = default; @@ -17535,7 +17097,7 @@ index 0000000000000000000000000000000000000000..8adbd51bfecad2a273117588bf50f8f7 + +#endif diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h -index c0de66cc6e82f1a2459ba006b5ac0fd63d8da261..a01639bab522df3ecff9df5aa4b6218633b2f049 100644 +index 06d85d02ad62fdfaf211deb534126b0a5e966493..ab16123d697e7dab5907e4e5d4386cb84f03756e 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h @@ -31,9 +31,11 @@ @@ -17559,7 +17121,7 @@ index c0de66cc6e82f1a2459ba006b5ac0fd63d8da261..a01639bab522df3ecff9df5aa4b62186 PageClientImpl(NSView *, WKWebView *); virtual ~PageClientImpl(); -@@ -175,6 +179,9 @@ private: +@@ -176,6 +180,9 @@ private: void updateAcceleratedCompositingMode(const LayerTreeContext&) override; void didFirstLayerFlush(const LayerTreeContext&) override; @@ -17569,7 +17131,7 @@ index c0de66cc6e82f1a2459ba006b5ac0fd63d8da261..a01639bab522df3ecff9df5aa4b62186 RefPtr takeViewSnapshot(std::optional&&) override; RefPtr takeViewSnapshot(std::optional&&, ForceSoftwareCapturingViewportSnapshot) override; void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override; -@@ -226,6 +233,10 @@ private: +@@ -227,6 +234,10 @@ private: void beganExitFullScreen(const WebCore::IntRect& initialFrame, const WebCore::IntRect& finalFrame, CompletionHandler&&) override; #endif @@ -17581,10 +17143,10 @@ index c0de66cc6e82f1a2459ba006b5ac0fd63d8da261..a01639bab522df3ecff9df5aa4b62186 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 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a1407e22afe2 100644 +index 8b6e600a9b85e37c19bdddde5b32666a2179e14b..56c2b8949b2fb027ec40374d8eb2c2577da0c302 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm -@@ -107,6 +107,13 @@ namespace WebKit { +@@ -108,6 +108,13 @@ namespace WebKit { using namespace WebCore; @@ -17598,7 +17160,7 @@ index 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a140 PageClientImpl::PageClientImpl(NSView *view, WKWebView *webView) : PageClientImplCocoa(webView) , m_view(view) -@@ -162,6 +169,9 @@ NSWindow *PageClientImpl::activeWindow() const +@@ -163,6 +170,9 @@ NSWindow *PageClientImpl::activeWindow() const bool PageClientImpl::isViewWindowActive() { @@ -17608,7 +17170,7 @@ index 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a140 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer)); RetainPtr activeViewWindow = activeWindow(); return activeViewWindow.get().isKeyWindow || (activeViewWindow && [NSApp keyWindow] == activeViewWindow.get()); -@@ -169,6 +179,9 @@ bool PageClientImpl::isViewWindowActive() +@@ -170,6 +180,9 @@ bool PageClientImpl::isViewWindowActive() bool PageClientImpl::isViewFocused() { @@ -17618,17 +17180,17 @@ index 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a140 // 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 (CheckedPtr impl = m_impl.get()) -@@ -192,6 +205,9 @@ void PageClientImpl::makeFirstResponder() +@@ -193,6 +206,9 @@ void PageClientImpl::makeFirstResponder() - bool PageClientImpl::isViewVisible() + bool PageClientImpl::isViewVisible(NSView *view, NSWindow *viewWindow) { + if (_headless) + return true; + - RetainPtr activeView = this->activeView(); - RetainPtr activeViewWindow = activeWindow(); - -@@ -267,7 +283,8 @@ void PageClientImpl::didRelaunchProcess() + auto windowIsOccluded = [&]()->bool { + return m_impl && m_impl->windowOcclusionDetectionEnabled() && (viewWindow.occlusionState & NSWindowOcclusionStateVisible) != NSWindowOcclusionStateVisible; + }; +@@ -280,7 +296,8 @@ void PageClientImpl::didRelaunchProcess() void PageClientImpl::preferencesDidChange() { @@ -17638,7 +17200,7 @@ index 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a140 } void PageClientImpl::toolTipChanged(const String& oldToolTip, const String& newToolTip) -@@ -477,6 +494,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) +@@ -494,6 +511,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) { @@ -17647,7 +17209,7 @@ index 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a140 checkedImpl()->doneWithKeyEvent(event.nativeEvent(), eventWasHandled); } -@@ -496,6 +515,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl +@@ -513,6 +532,8 @@ void PageClientImpl::computeHasVisualSearchResults(const URL& imageURL, Shareabl RefPtr PageClientImpl::createPopupMenuProxy(WebPageProxy& page) { @@ -17656,7 +17218,7 @@ index 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a140 return WebPopupMenuProxyMac::create(m_view.get().get(), page.checkedPopupMenuClient().get()); } -@@ -621,6 +642,12 @@ CALayer *PageClientImpl::footerBannerLayer() const +@@ -638,6 +659,12 @@ CALayer *PageClientImpl::footerBannerLayer() const return m_impl->footerBannerLayer(); } @@ -17669,7 +17231,7 @@ index 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a140 RefPtr PageClientImpl::takeViewSnapshot(std::optional&&) { return checkedImpl()->takeViewSnapshot(); -@@ -832,6 +859,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR +@@ -849,6 +876,13 @@ void PageClientImpl::beganExitFullScreen(const IntRect& initialFrame, const IntR #endif // ENABLE(FULLSCREEN_API) @@ -17683,7 +17245,7 @@ index 0af0f031313b707c18ad675115385c42d5a1284f..4408666f4d7b4e67670f3edfabe9a140 void PageClientImpl::navigationGestureDidBegin() { checkedImpl()->dismissContentRelativeChildWindowsWithAnimation(true); -@@ -1012,6 +1046,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c +@@ -1029,6 +1063,9 @@ void PageClientImpl::requestScrollToRect(const WebCore::FloatRect& targetRect, c bool PageClientImpl::windowIsFrontWindowUnderMouse(const NativeWebMouseEvent& event) { @@ -17716,18 +17278,18 @@ index f46895285dbc84c624537a194814c18f771a0c08..29ef9e5afa13b8d2b47b7f2dd4ce3784 } +#endif -diff --git a/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm b/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm -index b9ffbadc03edbe9d260d546b59933c1c50d4148d..d0559dbd0bdfe0aa7c83ad97f5d01d8213c0caf2 100644 ---- a/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm -+++ b/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm -@@ -29,6 +29,7 @@ - #if ENABLE(FULLSCREEN_API) && !PLATFORM(IOS_FAMILY) +diff --git a/Source/WebKit/UIProcess/mac/WKTextAnimationManagerMac.mm b/Source/WebKit/UIProcess/mac/WKTextAnimationManagerMac.mm +index 1e32d91466e9785f20fd1d63b8fa93ee192d5f55..e355cb75d3c25f63f51d030190fb49f20831fda8 100644 +--- a/Source/WebKit/UIProcess/mac/WKTextAnimationManagerMac.mm ++++ b/Source/WebKit/UIProcess/mac/WKTextAnimationManagerMac.mm +@@ -35,6 +35,7 @@ + #import "WebViewImpl.h" + #import + #import ++#import + #import - #import "AppKitSPI.h" -+#import "GPUProcessProxy.h" - #import "LayerTreeContext.h" - #import "NativeWebMouseEvent.h" - #import "VideoPresentationManagerProxy.h" + @interface WKTextAnimationTypeEffectData : NSObject diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h index a3c53c0bf913385d4d2d92900360d5f7d75927f8..e5570ef599ff1b59224648c353f8ab16f8fe7f88 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h @@ -17741,10 +17303,10 @@ index a3c53c0bf913385d4d2d92900360d5f7d75927f8..e5570ef599ff1b59224648c353f8ab16 bool showAfterPostProcessingContextData(); diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -index 273569e22d7c39c451fa39b21d4a0672b04773ad..84632cafb18c3d0f5367ba771daea12e30b2110a 100644 +index 14ced1d7fee6409e39301c9bf6d589a733b16afe..4bd68c01564c3d3828e45bce68529c5ea284a1a9 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm +++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -@@ -527,6 +527,12 @@ RetainPtr WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT +@@ -521,6 +521,12 @@ RetainPtr WebContextMenuProxyMac::createShareMenuItem(ShareMenuItemT } #endif @@ -17809,7 +17371,7 @@ index 0000000000000000000000000000000000000000..6113f4cd60a5d72b8ead61176cb43200 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm new file mode 100644 -index 0000000000000000000000000000000000000000..dd52991f936aa1c046b404801ee97237d0a55748 +index 0000000000000000000000000000000000000000..2db75618ed4a975cc158dd21a9744a78f696a7ae --- /dev/null +++ b/Source/WebKit/UIProcess/mac/WebPageInspectorInputAgentMac.mm @@ -0,0 +1,135 @@ @@ -17917,7 +17479,7 @@ index 0000000000000000000000000000000000000000..dd52991f936aa1c046b404801ee97237 + m_page.handleMouseEvent(nativeEvent); +} + -+void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& commands, WallTime timestamp) ++void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& commands, MonotonicTime timestamp) +{ + Vector macCommands; + for (const String& command : commands) { @@ -17948,8 +17510,56 @@ index 0000000000000000000000000000000000000000..dd52991f936aa1c046b404801ee97237 +} + +} // namespace WebKit +diff --git a/Source/WebKit/UIProcess/mac/WebPageInspectorTargetProxyMac.mm b/Source/WebKit/UIProcess/mac/WebPageInspectorTargetProxyMac.mm +new file mode 100644 +index 0000000000000000000000000000000000000000..c58e17e9095c73eb9670ca55e5465b0d3afd6223 +--- /dev/null ++++ b/Source/WebKit/UIProcess/mac/WebPageInspectorTargetProxyMac.mm +@@ -0,0 +1,42 @@ ++/* ++ * Copyright (C) 2019 Microsoft Corporation. ++ * ++ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT ++ * OWNER OR 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. ++ */ ++ ++#import "config.h" ++#import "WebPageInspectorTargetProxy.h" ++#import "WebPageProxy.h" ++ ++#if PLATFORM(MAC) ++ ++namespace WebKit { ++ ++void WebPageInspectorTargetProxy::platformActivate(String& error) const ++{ ++ NSWindow* window = m_page->platformWindow(); ++ [window makeKeyAndOrderFront:nil]; ++} ++ ++} // namespace WebKit ++ ++#endif diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.h b/Source/WebKit/UIProcess/mac/WebViewImpl.h -index ad45b454acf088d5bb375971aae99684ea06d3ab..a9b4c26971969cf352cc045b01505a1751b44e46 100644 +index 62b5fc6f5e08c4192774f659f2589085e7f8b5ed..58576d276501e29afc0e77ff5b32b645ec433108 100644 --- a/Source/WebKit/UIProcess/mac/WebViewImpl.h +++ b/Source/WebKit/UIProcess/mac/WebViewImpl.h @@ -34,6 +34,7 @@ @@ -17960,7 +17570,7 @@ index ad45b454acf088d5bb375971aae99684ea06d3ab..a9b4c26971969cf352cc045b01505a17 #include #include #include -@@ -565,6 +566,9 @@ public: +@@ -579,6 +580,9 @@ public: void provideDataForPasteboard(NSPasteboard *, NSString *type); NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination); @@ -17971,10 +17581,10 @@ index ad45b454acf088d5bb375971aae99684ea06d3ab..a9b4c26971969cf352cc045b01505a17 RefPtr takeViewSnapshot(ForceSoftwareCapturingViewportSnapshot); void saveBackForwardSnapshotForCurrentItem(); diff --git a/Source/WebKit/UIProcess/mac/WebViewImpl.mm b/Source/WebKit/UIProcess/mac/WebViewImpl.mm -index 1e906144a471367de596ccf5dd0ece2706306fe6..51cc9282b0b6d0b66df9f3b4fb69da7261b6e8d3 100644 +index 65e89d47c58ba4449b72db525153313ab41bcc85..df70a7c2beda025db41651d558c1978d65632710 100644 --- a/Source/WebKit/UIProcess/mac/WebViewImpl.mm +++ b/Source/WebKit/UIProcess/mac/WebViewImpl.mm -@@ -2477,6 +2477,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace() +@@ -2497,6 +2497,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace() if (!m_colorSpace) m_colorSpace = [NSColorSpace sRGBColorSpace]; } @@ -17986,7 +17596,7 @@ index 1e906144a471367de596ccf5dd0ece2706306fe6..51cc9282b0b6d0b66df9f3b4fb69da72 ASSERT(m_colorSpace); return WebCore::DestinationColorSpace { [m_colorSpace CGColorSpace] }; -@@ -4693,6 +4698,17 @@ static RetainPtr takeWindowSnapshot(CGSWindowID windowID, bool captu +@@ -4777,6 +4782,17 @@ static RetainPtr takeWindowSnapshot(CGSWindowID windowID, bool captu return WebCore::cgWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, windowID, imageOptions); } @@ -18004,6 +17614,51 @@ index 1e906144a471367de596ccf5dd0ece2706306fe6..51cc9282b0b6d0b66df9f3b4fb69da72 RefPtr WebViewImpl::takeViewSnapshot() { return takeViewSnapshot(ForceSoftwareCapturingViewportSnapshot::No); +diff --git a/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp b/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp +index 3f4c7f86c46a39036d6c52f8b77e50d915b740da..a9990ef434d86b432e6e77911145c96b15dff06c 100644 +--- a/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp ++++ b/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.cpp +@@ -35,6 +35,7 @@ + #include "MessageSenderInlines.h" + #include "UpdateInfo.h" + #include "WebPageProxy.h" ++#include "WebPageInspectorController.h" + #include + + namespace WebKit { +@@ -116,6 +117,19 @@ void DrawingAreaProxyWC::discardBackingStore() + m_backingStore = std::nullopt; + } + ++void DrawingAreaProxyWC::captureFrame() ++{ ++ if (!m_backingStore) ++ return; ++ auto surface = m_backingStore->surface(); ++ if (!surface) ++ return; ++ auto image = surface->makeImageSnapshot(); ++ if (!image) ++ return; ++ page()->inspectorController().didPaint(WTFMove(image)); ++} ++ + } // namespace WebKit + + #endif // USE(GRAPHICS_LAYER_WC) +diff --git a/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.h b/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.h +index 5ede972f4b6efe213ccdd866ef77594acfcbf162..67f66b7c685eea3478b6386e1ec449d94dfff17f 100644 +--- a/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.h ++++ b/Source/WebKit/UIProcess/wc/DrawingAreaProxyWC.h +@@ -50,6 +50,8 @@ public: + + void paint(PlatformPaintContextPtr, const WebCore::IntRect&, WebCore::Region& unpaintedRegion); + ++ void captureFrame(); ++ + private: + DrawingAreaProxyWC(WebPageProxy&, WebProcessProxy&); + diff --git a/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.cpp b/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4f54a9445e5a7ecdb750c5c521da4f397776e633 @@ -18101,7 +17756,7 @@ index 0000000000000000000000000000000000000000..4f54a9445e5a7ecdb750c5c521da4f39 +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.h b/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.h new file mode 100644 -index 0000000000000000000000000000000000000000..df18883b2b7d22d73540cb084d3dd5291231097d +index 0000000000000000000000000000000000000000..18be1f2e544e3069df48cdd1e55ad8536f57802a --- /dev/null +++ b/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.h @@ -0,0 +1,60 @@ @@ -18146,7 +17801,7 @@ index 0000000000000000000000000000000000000000..df18883b2b7d22d73540cb084d3dd529 +namespace WebKit { + +class InspectorPlaywrightAgentClientWin : public InspectorPlaywrightAgentClient { -+ WTF_MAKE_FAST_ALLOCATED; ++ WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorPlaywrightAgentClientWin); +public: + InspectorPlaywrightAgentClientWin(ConfigureDataStoreCallback, CreatePageCallback, QuitCallback); + ~InspectorPlaywrightAgentClientWin() override = default; @@ -18301,7 +17956,7 @@ index 0000000000000000000000000000000000000000..df55ee613ec085cb85ed12b45deff3a1 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/win/WebPageInspectorInputAgentWin.cpp b/Source/WebKit/UIProcess/win/WebPageInspectorInputAgentWin.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..8b474c730139b44a13c9d5b2d13ee20403e3e7f3 +index 0000000000000000000000000000000000000000..36fc7af8eb98b3f70d255ee858dccf580fae6679 --- /dev/null +++ b/Source/WebKit/UIProcess/win/WebPageInspectorInputAgentWin.cpp @@ -0,0 +1,55 @@ @@ -18340,7 +17995,7 @@ index 0000000000000000000000000000000000000000..8b474c730139b44a13c9d5b2d13ee204 + +namespace WebKit { + -+void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& macCommands, WallTime timestamp) ++void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& macCommands, MonotonicTime timestamp) +{ + NativeWebKeyboardEvent event( + type, @@ -18360,27 +18015,14 @@ index 0000000000000000000000000000000000000000..8b474c730139b44a13c9d5b2d13ee204 +} + +} // namespace WebKit -diff --git a/Source/WebKit/UIProcess/win/WebView.cpp b/Source/WebKit/UIProcess/win/WebView.cpp -index 2487c6de5b717dfea02a6b5a127c815019582d3c..eae5b89de5f54e94f439a7fbe72547743ad96749 100644 ---- a/Source/WebKit/UIProcess/win/WebView.cpp -+++ b/Source/WebKit/UIProcess/win/WebView.cpp -@@ -576,7 +576,7 @@ LRESULT WebView::onSizeEvent(HWND hwnd, UINT, WPARAM, LPARAM lParam, bool& handl - float intrinsicDeviceScaleFactor = deviceScaleFactorForWindow(hwnd); - if (m_page) - m_page->setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor); -- m_viewSize = expandedIntSize(FloatSize(LOWORD(lParam), HIWORD(lParam)) / intrinsicDeviceScaleFactor); -+ 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 +diff --git a/Source/WebKit/UIProcess/win/WebPageInspectorTargetProxyWin.cpp b/Source/WebKit/UIProcess/win/WebPageInspectorTargetProxyWin.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..24da079059ed4a45131e18d7fbf56a29a54bd513 +index 0000000000000000000000000000000000000000..5b3222e904d3f56d8606b1f1158b2947263eac44 --- /dev/null -+++ b/Source/WebKit/UIProcess/wpe/InspectorTargetProxyWPE.cpp -@@ -0,0 +1,40 @@ ++++ b/Source/WebKit/UIProcess/win/WebPageInspectorTargetProxyWin.cpp +@@ -0,0 +1,36 @@ +/* -+ * Copyright (C) 2019 Microsoft Corporation. ++ * Copyright (C) 2020 Microsoft Corporation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions @@ -18405,20 +18047,29 @@ index 0000000000000000000000000000000000000000..24da079059ed4a45131e18d7fbf56a29 + */ + +#include "config.h" -+#include "InspectorTargetProxy.h" -+ ++#include "WebPageInspectorTargetProxy.h" +#include "WebPageProxy.h" -+#include + +namespace WebKit { + -+void InspectorTargetProxy::platformActivate(String& error) const ++void WebPageInspectorTargetProxy::platformActivate(String& error) const +{ -+ struct wpe_view_backend* backend = m_page->viewBackend(); -+ wpe_view_backend_add_activity_state(backend, wpe_view_activity_state_visible | wpe_view_activity_state_focused | wpe_view_activity_state_in_window); +} + +} // namespace WebKit +diff --git a/Source/WebKit/UIProcess/win/WebView.cpp b/Source/WebKit/UIProcess/win/WebView.cpp +index 22124ffc5c0daf37be6ac7d115d587925613b4cd..83fbf4182132b87c0b90416e5cd83372e6c2b99f 100644 +--- a/Source/WebKit/UIProcess/win/WebView.cpp ++++ b/Source/WebKit/UIProcess/win/WebView.cpp +@@ -569,7 +569,7 @@ LRESULT WebView::onSizeEvent(HWND hwnd, UINT, WPARAM, LPARAM lParam, bool& handl + float intrinsicDeviceScaleFactor = deviceScaleFactorForWindow(hwnd); + if (m_page) + m_page->setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor); +- m_viewSize = expandedIntSize(FloatSize(LOWORD(lParam), HIWORD(lParam)) / intrinsicDeviceScaleFactor); ++ m_viewSize = expandedIntSize(FloatSize(LOWORD(lParam), HIWORD(lParam))); + + if (m_page && m_page->drawingArea()) { + // FIXME specify correctly layerPosition. diff --git a/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp b/Source/WebKit/UIProcess/wpe/WebColorPickerWPE.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7df77e30c2e7303dc6aaad560434e5b8e35f4f3c @@ -18839,7 +18490,7 @@ index 0000000000000000000000000000000000000000..182398f24909cbc42cac897d66546991 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..a7d88f8c745f95af21db71dcfce368ba4832a328 +index 0000000000000000000000000000000000000000..c6af56767484e2889208c96d454a0924f290ba9c --- /dev/null +++ b/Source/WebKit/UIProcess/wpe/WebPageInspectorInputAgentWPE.cpp @@ -0,0 +1,55 @@ @@ -18878,7 +18529,7 @@ index 0000000000000000000000000000000000000000..a7d88f8c745f95af21db71dcfce368ba + +namespace WebKit { + -+void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& macCommands, WallTime timestamp) ++void WebPageInspectorInputAgent::platformDispatchKeyEvent(WebEventType type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet modifiers, Vector& macCommands, MonotonicTime timestamp) +{ + NativeWebKeyboardEvent event( + type, @@ -18898,6 +18549,52 @@ index 0000000000000000000000000000000000000000..a7d88f8c745f95af21db71dcfce368ba +} + +} // namespace WebKit +diff --git a/Source/WebKit/UIProcess/wpe/WebPageInspectorTargetProxyWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPageInspectorTargetProxyWPE.cpp +new file mode 100644 +index 0000000000000000000000000000000000000000..83148bef5b410a70c29bbaf30bb833b9f033ae9a +--- /dev/null ++++ b/Source/WebKit/UIProcess/wpe/WebPageInspectorTargetProxyWPE.cpp +@@ -0,0 +1,40 @@ ++/* ++ * Copyright (C) 2019 Microsoft Corporation. ++ * ++ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT ++ * OWNER OR 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 "WebPageInspectorTargetProxy.h" ++ ++#include "WebPageProxy.h" ++#include ++ ++namespace WebKit { ++ ++void WebPageInspectorTargetProxy::platformActivate(String& error) const ++{ ++ struct wpe_view_backend* backend = m_page->viewBackend(); ++ wpe_view_backend_add_activity_state(backend, wpe_view_activity_state_visible | wpe_view_activity_state_focused | wpe_view_activity_state_in_window); ++} ++ ++} // namespace WebKit diff --git a/Source/WebKit/UIProcess/wpe/WebPreferencesWPE.cpp b/Source/WebKit/UIProcess/wpe/WebPreferencesWPE.cpp index 9b688ad328317fea4fd96ce66e9714bad8f0f937..402a36a9c565e13ec298aa7f014f0d9208ebddb7 100644 --- a/Source/WebKit/UIProcess/wpe/WebPreferencesWPE.cpp @@ -18914,10 +18611,10 @@ index 9b688ad328317fea4fd96ce66e9714bad8f0f937..402a36a9c565e13ec298aa7f014f0d92 } // namespace WebKit diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj -index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279ad3acae1 100644 +index 081685223da21e0053b76380ebdb2cf878a7ab23..22c488e25c2b20c9a0f8fe57e5630d2ff404e2b8 100644 --- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj -@@ -1565,6 +1565,7 @@ +@@ -1499,6 +1499,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 */; }; @@ -18925,7 +18622,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 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 */; }; -@@ -2352,6 +2353,18 @@ +@@ -2281,6 +2282,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 */; }; @@ -18938,13 +18635,13 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 + D71A944C237239FB002C4D9E /* BrowserInspectorPipe.h in Headers */ = {isa = PBXBuildFile; fileRef = D71A944B237239FB002C4D9E /* BrowserInspectorPipe.h */; }; + D76D6888238DBD81008D314B /* InspectorDialogAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = D76D6887238DBD80008D314B /* InspectorDialogAgent.h */; }; + D79902B1236E9404005D6F7E /* WebPageInspectorEmulationAgentMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = D79902AE236E9404005D6F7E /* WebPageInspectorEmulationAgentMac.mm */; }; -+ D79902B2236E9404005D6F7E /* InspectorTargetProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = D79902AF236E9404005D6F7E /* InspectorTargetProxyMac.mm */; }; ++ D79902B2236E9404005D6F7E /* WebPageInspectorTargetProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = D79902AF236E9404005D6F7E /* WebPageInspectorTargetProxyMac.mm */; }; + D79902B3236E9404005D6F7E /* WebPageInspectorInputAgentMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = D79902B0236E9404005D6F7E /* WebPageInspectorInputAgentMac.mm */; }; + D7EB04E72372A73B00F744CE /* InspectorPlaywrightAgentClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = D7EB04E62372A73B00F744CE /* InspectorPlaywrightAgentClientMac.mm */; }; 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, ); }; }; -@@ -2452,6 +2465,8 @@ +@@ -2381,6 +2394,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 */; }; @@ -18953,7 +18650,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 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 */; }; -@@ -2491,6 +2506,9 @@ +@@ -2424,6 +2439,9 @@ F3EEEE592DB318270038CC1D /* BidiBrowserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EEEE572DB318270038CC1D /* BidiBrowserAgent.h */; }; F3EEEE5A2DB318270038CC1D /* BidiBrowserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3EEEE582DB318270038CC1D /* BidiBrowserAgent.cpp */; }; F404455C2D5CFB56000E587E /* AppKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = F404455A2D5CFB56000E587E /* AppKitSoftLink.h */; }; @@ -18963,7 +18660,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 F409BA181E6E64BC009DA28E /* WKDragDestinationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */; settings = {ATTRIBUTES = (Private, ); }; }; F40C3B712AB401C5007A3567 /* WKDatePickerPopoverController.h in Headers */ = {isa = PBXBuildFile; fileRef = F40C3B6F2AB40167007A3567 /* WKDatePickerPopoverController.h */; }; F41145682CD939E0004CDBD1 /* _WKTouchEventGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = F41145652CD939E0004CDBD1 /* _WKTouchEventGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; -@@ -6458,6 +6476,7 @@ +@@ -6446,6 +6464,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 = ""; }; @@ -18971,7 +18668,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 5CAECB5E27465AE300AB78D0 /* UnifiedSource115.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource115.cpp; sourceTree = ""; }; 5CAF7AA426F93A750003F19E /* adattributiond */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = adattributiond; sourceTree = BUILT_PRODUCTS_DIR; }; 5CAF7AA526F93A950003F19E /* adattributiond.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = adattributiond.cpp; sourceTree = ""; }; -@@ -8191,6 +8210,19 @@ +@@ -8213,6 +8232,19 @@ DF0C5F24252ECB8D00D921DB /* WKDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownload.h; sourceTree = ""; }; DF0C5F25252ECB8E00D921DB /* WKDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownloadInternal.h; sourceTree = ""; }; DF0C5F26252ECB8E00D921DB /* WKDownloadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDownloadDelegate.h; sourceTree = ""; }; @@ -18985,13 +18682,13 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 + D71A944B237239FB002C4D9E /* BrowserInspectorPipe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BrowserInspectorPipe.h; sourceTree = ""; }; + D76D6887238DBD80008D314B /* InspectorDialogAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDialogAgent.h; sourceTree = ""; }; + D79902AE236E9404005D6F7E /* WebPageInspectorEmulationAgentMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPageInspectorEmulationAgentMac.mm; sourceTree = ""; }; -+ D79902AF236E9404005D6F7E /* InspectorTargetProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InspectorTargetProxyMac.mm; sourceTree = ""; }; ++ D79902AF236E9404005D6F7E /* WebPageInspectorTargetProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPageInspectorTargetProxyMac.mm; sourceTree = ""; }; + D79902B0236E9404005D6F7E /* WebPageInspectorInputAgentMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPageInspectorInputAgentMac.mm; sourceTree = ""; }; + D7EB04E62372A73B00F744CE /* InspectorPlaywrightAgentClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InspectorPlaywrightAgentClientMac.mm; sourceTree = ""; }; DF462E0E23F22F5300EFF35F /* WKHTTPCookieStorePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHTTPCookieStorePrivate.h; sourceTree = ""; }; DF462E1123F338AD00EFF35F /* WKContentWorldPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentWorldPrivate.h; sourceTree = ""; }; DF58C6311371AC5800F9A37C /* NativeWebWheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebWheelEvent.h; sourceTree = ""; }; -@@ -8365,6 +8397,8 @@ +@@ -8393,6 +8425,8 @@ E5CBA76127A3187900DF7858 /* UnifiedSource118.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource118.cpp; sourceTree = ""; }; E5CBA76227A3187900DF7858 /* UnifiedSource117.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource117.cpp; sourceTree = ""; }; E5CBA76327A3187B00DF7858 /* UnifiedSource116.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UnifiedSource116.cpp; sourceTree = ""; }; @@ -19000,7 +18697,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 E5DEFA6726F8F42600AB68DB /* PhotosUISPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotosUISPI.h; sourceTree = ""; }; E838FCAF2DE90BF800703353 /* ISO18013MobileDocumentRequest+Extras.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ISO18013MobileDocumentRequest+Extras.swift"; sourceTree = ""; }; E88885662DC914C400C572B8 /* WKISO18013Request.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKISO18013Request.h; sourceTree = ""; }; -@@ -8418,6 +8452,14 @@ +@@ -8454,6 +8488,14 @@ F404455A2D5CFB56000E587E /* AppKitSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitSoftLink.h; sourceTree = ""; }; F404455B2D5CFB56000E587E /* AppKitSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppKitSoftLink.mm; sourceTree = ""; }; F4063DDE2D71481E00F3FE6E /* LLVMProfiling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LLVMProfiling.h; sourceTree = ""; }; @@ -19015,7 +18712,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 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 = ""; }; -@@ -8850,6 +8892,7 @@ +@@ -8928,6 +8970,7 @@ 3766F9EE189A1241003CF19B /* JavaScriptCore.framework in Frameworks */, 3766F9F1189A1254003CF19B /* libicucore.dylib in Frameworks */, 7B9FC5BB28A5233B007570E7 /* libWebKitPlatform.a in Frameworks */, @@ -19023,7 +18720,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 3766F9EF189A1244003CF19B /* QuartzCore.framework in Frameworks */, 37694525184FC6B600CDE21F /* Security.framework in Frameworks */, 37BEC4DD1948FC6A008B4286 /* WebCore.framework in Frameworks */, -@@ -12053,6 +12096,7 @@ +@@ -12215,6 +12258,7 @@ 99788ACA1F421DCA00C08000 /* _WKAutomationSessionConfiguration.mm */, 990D28A81C6404B000986977 /* _WKAutomationSessionDelegate.h */, 990D28AF1C65203900986977 /* _WKAutomationSessionInternal.h */, @@ -19031,7 +18728,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 5C4609E222430E4C009943C2 /* _WKContentRuleListAction.h */, 5C4609E322430E4D009943C2 /* _WKContentRuleListAction.mm */, 5C4609E422430E4D009943C2 /* _WKContentRuleListActionInternal.h */, -@@ -13433,6 +13477,7 @@ +@@ -13636,6 +13680,7 @@ E34B110C27C46BC6006D2F2E /* libWebCoreTestShim.dylib */, E34B110F27C46D09006D2F2E /* libWebCoreTestSupport.dylib */, DDE992F4278D06D900F60D26 /* libWebKitAdditions.a */, @@ -19039,7 +18736,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 57A9FF15252C6AEF006A2040 /* libWTF.a */, 5750F32A2032D4E500389347 /* LocalAuthentication.framework */, 570DAAB0230273D200E8FC04 /* NearField.framework */, -@@ -14015,6 +14060,12 @@ +@@ -14232,6 +14277,12 @@ children = ( 9197940423DBC4BB00257892 /* InspectorBrowserAgent.cpp */, 9197940323DBC4BB00257892 /* InspectorBrowserAgent.h */, @@ -19052,7 +18749,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 ); path = Agents; sourceTree = ""; -@@ -14023,6 +14074,7 @@ +@@ -14240,6 +14291,7 @@ isa = PBXGroup; children = ( A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorUIProxyMac.mm */, @@ -19060,7 +18757,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 1CA8B935127C774E00576C2B /* WebInspectorUIProxyMac.mm */, 99A7ACE326012919006D57FD /* WKInspectorResourceURLSchemeHandler.h */, 99A7ACE42601291A006D57FD /* WKInspectorResourceURLSchemeHandler.mm */, -@@ -14778,6 +14830,7 @@ +@@ -15007,6 +15059,7 @@ E1513C65166EABB200149FCB /* AuxiliaryProcessProxy.h */, 46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */, 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */, @@ -19068,7 +18765,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 5C6D69352AC3935D0099BDAF /* BrowsingContextGroup.cpp */, 5C6D69362AC3935D0099BDAF /* BrowsingContextGroup.h */, 5CA98549210BEB5A0057EB6B /* BrowsingWarning.h */, -@@ -14802,6 +14855,8 @@ +@@ -15031,6 +15084,8 @@ BC06F43912DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp */, BC06F43812DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h */, 2DD5A72A1EBF09A7009BA597 /* HiddenPageThrottlingAutoIncreasesCounter.h */, @@ -19077,7 +18774,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 5CEABA2B2333251400797797 /* LegacyGlobalSettings.cpp */, 5CEABA2A2333247700797797 /* LegacyGlobalSettings.h */, 31607F3819627002009B87DA /* LegacySessionStateCoding.h */, -@@ -14832,6 +14887,7 @@ +@@ -15061,6 +15116,7 @@ 4683569B21E81CC7006E27A3 /* ProvisionalPageProxy.cpp */, 4683569A21E81CC7006E27A3 /* ProvisionalPageProxy.h */, 411B89CB27B2B89600F9EBD3 /* QueryPermissionResultCallback.h */, @@ -19085,7 +18782,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 5CCB54DC2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.cpp */, 5CCB54DB2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.h */, FABBBC802D35AC6800820017 /* RemotePageFullscreenManagerProxy.cpp */, -@@ -14939,6 +14995,8 @@ +@@ -15170,6 +15226,8 @@ BC7B6204129A0A6700D174A4 /* WebPageGroup.h */, 2D9EA3101A96D9EB002D2807 /* WebPageInjectedBundleClient.cpp */, 2D9EA30E1A96CBFF002D2807 /* WebPageInjectedBundleClient.h */, @@ -19094,7 +18791,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 9B7F8A502C785725000057F3 /* WebPageLoadTiming.h */, BC111B0B112F5E4F00337BAB /* WebPageProxy.cpp */, BC032DCB10F4389F0058C15A /* WebPageProxy.h */, -@@ -15118,6 +15176,7 @@ +@@ -15354,6 +15412,7 @@ BC646C1911DD399F006455B0 /* WKBackForwardListItemRef.h */, BC646C1611DD399F006455B0 /* WKBackForwardListRef.cpp */, BC646C1711DD399F006455B0 /* WKBackForwardListRef.h */, @@ -19102,17 +18799,17 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 BCB9E24A1120E15C00A137E0 /* WKContext.cpp */, BCB9E2491120E15C00A137E0 /* WKContext.h */, 1AE52F9319201F6B00A1FA37 /* WKContextConfigurationRef.cpp */, -@@ -15694,6 +15753,9 @@ +@@ -15935,6 +15994,9 @@ 07EF07592745A8160066EA04 /* DisplayCaptureSessionManager.h */, 07EF07582745A8160066EA04 /* DisplayCaptureSessionManager.mm */, 7AFA6F682A9F57C50055322A /* DisplayLinkMac.cpp */, + D71A94302370E025002C4D9E /* InspectorPlaywrightAgentClientMac.h */, + D7EB04E62372A73B00F744CE /* InspectorPlaywrightAgentClientMac.mm */, -+ D79902AF236E9404005D6F7E /* InspectorTargetProxyMac.mm */, ++ D79902AF236E9404005D6F7E /* WebPageInspectorTargetProxyMac.mm */, 1AFDE65B1954E8D500C48FFA /* LegacySessionStateCoding.cpp */, 0FCB4E5818BBE3D9000FCFC9 /* PageClientImplMac.h */, 0FCB4E5918BBE3D9000FCFC9 /* PageClientImplMac.mm */, -@@ -15717,6 +15779,8 @@ +@@ -15958,6 +16020,8 @@ E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */, E55CD20124D09F1F0042DB9C /* WebDateTimePickerMac.h */, E55CD20224D09F1F0042DB9C /* WebDateTimePickerMac.mm */, @@ -19121,7 +18818,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */, BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */, BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */, -@@ -16826,6 +16890,7 @@ +@@ -17065,6 +17129,7 @@ 99788ACB1F421DDA00C08000 /* _WKAutomationSessionConfiguration.h in Headers */, 990D28AC1C6420CF00986977 /* _WKAutomationSessionDelegate.h in Headers */, 990D28B11C65208D00986977 /* _WKAutomationSessionInternal.h in Headers */, @@ -19129,7 +18826,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 5C4609E7224317B4009943C2 /* _WKContentRuleListAction.h in Headers */, 5C4609E8224317BB009943C2 /* _WKContentRuleListActionInternal.h in Headers */, 9B4CE9512CD99B7C00351173 /* _WKContentWorldConfiguration.h in Headers */, -@@ -17139,6 +17204,7 @@ +@@ -17386,6 +17451,7 @@ E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */, 4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */, 1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */, @@ -19137,7 +18834,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 5CA9854A210BEB640057EB6B /* BrowsingWarning.h in Headers */, A7E69BCC2B2117A100D43D3F /* BufferAndBackendInfo.h in Headers */, BC3065FA1259344E00E71278 /* CacheModel.h in Headers */, -@@ -17321,7 +17387,11 @@ +@@ -17569,7 +17635,11 @@ BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */, CE550E152283752200D28791 /* InsertTextOptions.h in Headers */, 9197940523DBC4BB00257892 /* InspectorBrowserAgent.h in Headers */, @@ -19149,15 +18846,15 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */, C5BCE5DF1C50766A00CDE3FA /* InteractionInformationAtPosition.h in Headers */, 2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */, -@@ -17581,6 +17651,7 @@ - 0F6E7C532C4C386800F1DB85 /* RemoteDisplayListRecorderMessages.h in Headers */, - F451C0FE2703B263002BA03B /* RemoteDisplayListRecorderProxy.h in Headers */, +@@ -17833,6 +17903,7 @@ + 0F6E7C532C4C386800F1DB85 /* RemoteGraphicsContextMessages.h in Headers */, + F451C0FE2703B263002BA03B /* RemoteGraphicsContextProxy.h in Headers */, A78A5FE42B0EB39E005036D3 /* RemoteImageBufferSetIdentifier.h in Headers */, + D71A943A2370F061002C4D9E /* RemoteInspectorPipe.h in Headers */, 2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */, 2DDF731518E95060004F5A66 /* RemoteLayerBackingStoreCollection.h in Headers */, 1AB16AEA164B3A8800290D62 /* RemoteLayerTreeContext.h in Headers */, -@@ -17638,6 +17709,7 @@ +@@ -17889,6 +17960,7 @@ E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */, E36FF00327F36FBD004BE21A /* SandboxStateVariables.h in Headers */, 7BAB111025DD02B3008FC479 /* ScopedActiveMessageReceiveQueue.h in Headers */, @@ -19165,7 +18862,7 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 6D4DF20C2D824242001F964C /* ScreenTimeWebsiteDataSupport.h in Headers */, 463BB93A2B9D08D80098C5C3 /* ScriptMessageHandlerIdentifier.h in Headers */, F4E28A362C923814008120DD /* ScriptTrackingPrivacyFilter.h in Headers */, -@@ -18002,6 +18074,8 @@ +@@ -18260,6 +18332,8 @@ 939EF87029D112EE00F23AEE /* WebPageInlines.h in Headers */, 9197940823DBC4CB00257892 /* WebPageInspectorAgentBase.h in Headers */, A513F5402154A5D700662841 /* WebPageInspectorController.h in Headers */, @@ -19174,12 +18871,12 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 A543E30C215C8A8D00279CD9 /* WebPageInspectorTarget.h in Headers */, A543E30D215C8A9000279CD9 /* WebPageInspectorTargetController.h in Headers */, A543E307215AD13700279CD9 /* WebPageInspectorTargetFrontendChannel.h in Headers */, -@@ -20621,7 +20695,43 @@ +@@ -20917,7 +20991,43 @@ 522F792928D50EBB0069B45B /* HidService.mm in Sources */, 2749F6442146561B008380BF /* InjectedBundleNodeHandle.cpp in Sources */, 2749F6452146561E008380BF /* InjectedBundleRangeHandle.cpp in Sources */, + D7EB04E72372A73B00F744CE /* InspectorPlaywrightAgentClientMac.mm in Sources */, -+ D79902B2236E9404005D6F7E /* InspectorTargetProxyMac.mm in Sources */, ++ D79902B2236E9404005D6F7E /* WebPageInspectorTargetProxyMac.mm in Sources */, + 1CC94E532AC92F190045F269 /* JSWebExtensionAPIAction.mm in Sources */, + 1C2B4D4B2A819D0D00C528A1 /* JSWebExtensionAPIAlarms.mm in Sources */, + 1C8ECFEA2AFC7DCB007BAA62 /* JSWebExtensionAPICommands.mm in Sources */, @@ -19215,10 +18912,10 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 + 337042022B58A0B70077FF78 /* JSWebExtensionAPIWebRequestEvent.mm in Sources */, + 1C5ACFA62A96F8C400C041C0 /* JSWebExtensionAPIWindows.mm in Sources */, + 1C5ACFA72A96F8C400C041C0 /* JSWebExtensionAPIWindowsEvent.mm in Sources */, - 1C5DC45F2909B05A0061EC62 /* JSWebExtensionWrapperCocoa.mm in Sources */, C14D37FE24ACE086007FF014 /* LaunchServicesDatabaseManager.mm in Sources */, C1710CF724AA643200D7C112 /* LaunchServicesDatabaseObserver.mm in Sources */, -@@ -21023,6 +21133,8 @@ + 41A0EB142641714900794471 /* LibWebRTCCodecsProxy.mm in Sources */, +@@ -21258,6 +21368,8 @@ 078B04A02CF18EAB00B453A6 /* WebPage+NavigationPreferences.swift in Sources */, 071467782DFE84E500F77867 /* WebPage+Transferable.swift in Sources */, 07CB79962CE9435700199C49 /* WebPage.swift in Sources */, @@ -19226,12 +18923,12 @@ index 54b3c159ca5c86663abb3c67cacce504aff0bc0b..d59f2a64a2be81756d44a1e6ebb7f279 + D79902B3236E9404005D6F7E /* WebPageInspectorInputAgentMac.mm in Sources */, 7CE9CE101FA0767A000177DE /* WebPageUpdatePreferences.cpp in Sources */, 079A4DA12D72CC0D00CA387F /* WebPageWebView.swift in Sources */, - CA2506A82DD65327001D1954 /* WebPageWebViewAdditions.swift in Sources */, + 7CEB00DD1FA69ABE0065473B /* WebPreferencesFeatures.cpp in Sources */, diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp -index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548ee42dec6c 100644 +index 717468dc02f8f50567a8e421eb5a2b5a28d63411..6c6a06b93f6ef26e7b5acd73f89f9d515a99c5af 100644 --- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp +++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp -@@ -271,6 +271,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou +@@ -272,6 +272,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou } #endif @@ -19243,7 +18940,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e #if ENABLE(PDFJS) if (tryLoadingUsingPDFJSHandler(resourceLoader, trackingParameters)) return; -@@ -285,12 +290,16 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou +@@ -293,12 +298,16 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou } if (InspectorInstrumentationWebKit::shouldInterceptRequest(resourceLoader)) { @@ -19266,7 +18963,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e } WEBLOADERSTRATEGY_RELEASE_LOG_FORWARDABLE(WEBLOADERSTRATEGY_SCHEDULELOAD); -@@ -415,7 +424,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara +@@ -425,7 +434,7 @@ static void addParametersShared(const LocalFrame* frame, NetworkResourceLoadPara parameters.linkPreconnectEarlyHintsEnabled = mainFrame->settings().linkPreconnectEarlyHintsEnabled(); } @@ -19275,12 +18972,12 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e { auto identifier = *resourceLoader.identifier(); -@@ -427,10 +436,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -437,10 +446,10 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL && resourceLoader.frameLoader()->notifier().isInitialRequestIdentifier(identifier) ? MainFrameMainResource::Yes : MainFrameMainResource::No; if (!page->allowsLoadFromURL(request.url(), mainFrameMainResource)) { -- RunLoop::protectedMain()->dispatch([resourceLoader = Ref { resourceLoader }, error = blockedError(request)] { -+ RunLoop::protectedMain()->dispatch([resourceLoader = Ref { resourceLoader }, error = platformStrategies()->loaderStrategy()->blockedError(request)] { +- RunLoop::mainSingleton().dispatch([resourceLoader = Ref { resourceLoader }, error = blockedError(request)] { ++ RunLoop::mainSingleton().dispatch([resourceLoader = Ref { resourceLoader }, error = platformStrategies()->loaderStrategy()->blockedError(request)] { resourceLoader->didFail(error); }); - return; @@ -19288,7 +18985,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e } } -@@ -440,14 +449,6 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -450,14 +459,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); @@ -19303,7 +19000,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e loadParameters.identifier = identifier; loadParameters.parentPID = legacyPresentingApplicationPID(); loadParameters.contentSniffingPolicy = contentSniffingPolicy; -@@ -531,14 +532,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -541,14 +542,11 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL if (loadParameters.options.mode != FetchOptions::Mode::Navigate) { ASSERT(loadParameters.sourceOrigin); @@ -19321,9 +19018,9 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e loadParameters.isMainFrameNavigation = isMainFrameNavigation; if (loadParameters.isMainFrameNavigation && document) -@@ -589,6 +587,25 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL - if (RefPtr frameLoader = resourceLoader.frameLoader()) - loadParameters.requiredCookiesVersion = frameLoader->requiredCookiesVersion(); +@@ -602,6 +600,25 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL + if (CachedResourceHandle handle = resourceLoader.cachedResource()) + loadParameters.isInitiatorPrefetch = handle->type() == CachedResource::Type::LinkPrefetch; + return true; +} @@ -19347,7 +19044,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e std::optional existingNetworkResourceLoadIdentifierToResume; if (loadParameters.isMainFrameNavigation) existingNetworkResourceLoadIdentifierToResume = std::exchange(m_existingNetworkResourceLoadIdentifierToResume, std::nullopt); -@@ -603,7 +620,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL +@@ -617,7 +634,7 @@ void WebLoaderStrategy::scheduleLoadFromNetworkProcess(ResourceLoader& resourceL } auto loader = WebResourceLoader::create(resourceLoader, trackingParameters); @@ -19356,7 +19053,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e } void WebLoaderStrategy::scheduleInternallyFailedLoad(WebCore::ResourceLoader& resourceLoader) -@@ -1021,7 +1038,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier +@@ -1035,7 +1052,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier bool WebLoaderStrategy::isOnLine() const { @@ -19365,7 +19062,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e } void WebLoaderStrategy::addOnlineStateChangeListener(Function&& listener) -@@ -1047,6 +1064,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet +@@ -1061,6 +1078,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet void WebLoaderStrategy::setOnLineState(bool isOnLine) { @@ -19377,7 +19074,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e if (m_isOnLine == isOnLine) return; -@@ -1055,6 +1077,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) +@@ -1069,6 +1091,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) listener(isOnLine); } @@ -19391,7 +19088,7 @@ index 8e116cc2cd63a59282b330acb00f42a926ecb33b..1b979a29a149803177300c93aec4548e { WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled(enabled), 0); diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h -index af1f8eb6b578367e8cb818b1c6020377c5a07a37..41f1a38348b11aa0d99fc9fa429fe6b88b41dbab 100644 +index 2c63aa572dda8af5d9b33b9636c33f04172563ae..1b30460e13a334b43be2b6b0f58a88b2f307cd30 100644 --- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h +++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h @@ -26,6 +26,7 @@ @@ -19402,7 +19099,7 @@ index af1f8eb6b578367e8cb818b1c6020377c5a07a37..41f1a38348b11aa0d99fc9fa429fe6b8 #include "WebResourceLoader.h" #include #include -@@ -96,6 +97,9 @@ public: +@@ -97,6 +98,9 @@ public: bool isOnLine() const final; void addOnlineStateChangeListener(Function&&) final; void setOnLineState(bool); @@ -19412,7 +19109,7 @@ index af1f8eb6b578367e8cb818b1c6020377c5a07a37..41f1a38348b11aa0d99fc9fa429fe6b8 void setExistingNetworkResourceLoadIdentifierToResume(std::optional existingNetworkResourceLoadIdentifierToResume) { m_existingNetworkResourceLoadIdentifierToResume = existingNetworkResourceLoadIdentifierToResume; } -@@ -164,6 +168,7 @@ private: +@@ -165,6 +169,7 @@ private: Vector> m_onlineStateChangeListeners; std::optional m_existingNetworkResourceLoadIdentifierToResume; bool m_isOnLine { true }; @@ -19421,10 +19118,10 @@ index af1f8eb6b578367e8cb818b1c6020377c5a07a37..41f1a38348b11aa0d99fc9fa429fe6b8 } // namespace WebKit diff --git a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp -index 6d448ac1d302be3e9ad938ade807d26ddd39d103..06d1995872db8de9edc0ad14f0ab556dec75eb7a 100644 +index 46c2cccc74f7d650a2c2624aa5bb72a93206b9bc..74c1bc4de3d3ab304c7faebebe1ada62a81ff660 100644 --- a/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp +++ b/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp -@@ -202,9 +202,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR +@@ -204,9 +204,6 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR coreLoader->didReceiveResponse(ResourceResponse { inspectorResponse }, [this, protectedThis = Ref { *this }, interceptedRequestIdentifier, policyDecisionCompletionHandler = WTFMove(policyDecisionCompletionHandler), overrideData = WTFMove(overrideData)]() mutable { RefPtr coreLoader = m_coreLoader; @@ -19434,7 +19131,7 @@ index 6d448ac1d302be3e9ad938ade807d26ddd39d103..06d1995872db8de9edc0ad14f0ab556d if (!m_coreLoader || !coreLoader->identifier()) { m_interceptController.continueResponse(interceptedRequestIdentifier); return; -@@ -221,6 +218,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR +@@ -223,6 +220,8 @@ void WebResourceLoader::didReceiveResponse(ResourceResponse&& response, PrivateR } }); }); @@ -19444,34 +19141,34 @@ index 6d448ac1d302be3e9ad938ade807d26ddd39d103..06d1995872db8de9edc0ad14f0ab556d } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -index de8c8f2890b146c6dd4f34c121b92402900e8df5..11792945a16cca303a9b2d3c101edf835f60b398 100644 +index 69ad1034b9f01a8582c84841f0e44fadc12a6367..af0f824672baec478b17b8c8f53dd2df56bd731a 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -@@ -534,6 +534,9 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev +@@ -494,6 +494,9 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev if (!page) return; + if (level == MessageLevel::Error) + page->send(Messages::WebPageProxy::LogToStderr(message)); + - // FIXME: Remove this after rdar://143399667 is fixed. + #if !PLATFORM(COCOA) page->injectedBundleUIClient().willAddMessageToConsole(page.get(), source, level, message, lineNumber, columnNumber, sourceID); - + #endif diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp -index dca2495f0196552e79c73bb0b7466b5c4fa0be46..999a7ab4eef2b8cc1a65b5a26cd69e369dcb7ab7 100644 +index 771f8c77b51976e3aa332fa10befd9fd5b258edc..f46b5bf3a6d5a1cb832b602e0c024dbde808b7b9 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp @@ -53,7 +53,7 @@ OptionSet WebDragClient::dragSourceActionMaskForPoint(const In return protectedPage()->allowedDragSourceActions(); } --#if !PLATFORM(COCOA) && !PLATFORM(GTK) +-#if !PLATFORM(COCOA) && !PLATFORM(GTK) && !PLATFORM(WPE) +#if !PLATFORM(COCOA) && !PLATFORM(GTK) && !PLATFORM(WPE) && !PLATFORM(WIN) - void WebDragClient::startDrag(DragItem, DataTransfer&, Frame&, const std::optional&) + void WebDragClient::startDrag(DragItem, DataTransfer&, Frame&, const std::optional&) { } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp -index bb924c778ae3999d549b14e6d810b32167baece4..341355502afeaf69827308fee41ce964c0c66541 100644 +index f0e2863e578c60cfc0ddc98a50b45061fad1fc0b..81e59abd8c5201d0550bff3ad8ecf284765cfc40 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp @@ -26,6 +26,7 @@ @@ -19483,7 +19180,7 @@ index bb924c778ae3999d549b14e6d810b32167baece4..341355502afeaf69827308fee41ce964 #include #include diff --git a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm -index 0abeb42354ed65e20d5ad5ab72c31bf00e49d528..259caa5c016b7f5c7eab156bbe4f0ce105339f76 100644 +index 5819df852bf76f0ed4ce50105b93c0fd697123d6..2fc578b7ff70877738278fe7006f14262e82e7a2 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm +++ b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm @@ -128,7 +128,8 @@ static WebCore::CachedImage* cachedImage(Element& element) @@ -19498,7 +19195,7 @@ index 0abeb42354ed65e20d5ad5ab72c31bf00e49d528..259caa5c016b7f5c7eab156bbe4f0ce1 diff --git a/Source/WebKit/WebProcess/WebCoreSupport/win/WebDragClientWin.cpp b/Source/WebKit/WebProcess/WebCoreSupport/win/WebDragClientWin.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..2d2ab369bfc1b42695dbc207e1d6e05deb16990f +index 0000000000000000000000000000000000000000..741ef5b11fe8718529105339cda0fab597bad9de --- /dev/null +++ b/Source/WebKit/WebProcess/WebCoreSupport/win/WebDragClientWin.cpp @@ -0,0 +1,58 @@ @@ -19537,7 +19234,7 @@ index 0000000000000000000000000000000000000000..2d2ab369bfc1b42695dbc207e1d6e05d +#include "WebPageProxyMessages.h" +#include +#include -+#include ++#include +#include +#include +#include @@ -19551,7 +19248,7 @@ index 0000000000000000000000000000000000000000..2d2ab369bfc1b42695dbc207e1d6e05d +{ +} + -+void WebDragClient::startDrag(DragItem, DataTransfer& dataTransfer, Frame& frame, const std::optional&) ++void WebDragClient::startDrag(DragItem, DataTransfer& dataTransfer, Frame& frame, const std::optional&) +{ + m_page->willStartDrag(); + m_page->send(Messages::WebPageProxy::StartDrag(dataTransfer.pasteboard().createDragDataMap())); @@ -19560,73 +19257,8 @@ index 0000000000000000000000000000000000000000..2d2ab369bfc1b42695dbc207e1d6e05d +}; // namespace WebKit. + +#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..d069b5eba1a64add1a2c370f8d519826ec7be213 ---- /dev/null -+++ b/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebDragClientWPE.cpp -@@ -0,0 +1,59 @@ -+/* -+ * 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. -+ */ -+ -+#include "config.h" -+#include "WebDragClient.h" -+ -+#if ENABLE(DRAG_SUPPORT) -+ -+#include "WebPage.h" -+#include "WebPageProxyMessages.h" -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+namespace WebKit { -+using namespace WebCore; -+ -+void WebDragClient::didConcludeEditDrag() -+{ -+} -+ -+void WebDragClient::startDrag(DragItem, DataTransfer& dataTransfer, Frame&, const std::optional&) -+{ -+ m_page->willStartDrag(); -+ -+ std::optional handle; -+ m_page->send(Messages::WebPageProxy::StartDrag(dataTransfer.pasteboard().selectionData(), dataTransfer.sourceOperationMask(), WTFMove(handle), dataTransfer.dragLocation())); -+} -+ -+}; // namespace WebKit. -+ -+#endif // ENABLE(DRAG_SUPPORT) diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp -index 5fed15fd5dbbfbaff305ce26a8bcf5ba3d0435d9..fec04b9a4d640dcf47e0a2312d8b71234bf10d09 100644 +index 4c4daaa62270c3236ee0f3352076c740968dcd89..780ddeb80f18eb8e314867a6c49a19fd0e9354a9 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp @@ -39,6 +39,7 @@ @@ -19634,14 +19266,14 @@ index 5fed15fd5dbbfbaff305ce26a8bcf5ba3d0435d9..fec04b9a4d640dcf47e0a2312d8b7123 #include "WebProcess.h" #include +#include - #include + #include #include #include diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h -index 5c8694cb4229ee87c50f68f8c24b47e5598a5aee..581637fb988e0d9b465a7029fb1bac9884c09b6c 100644 +index 4ffe3d98d023cd6f415782d59e40d52bb15ab1be..d8d38f57fc57ab51585aaeea8c9c1e92bef5ce2d 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h -@@ -145,6 +145,7 @@ public: +@@ -140,6 +140,7 @@ public: #if PLATFORM(WPE) && USE(GBM) && ENABLE(WPE_PLATFORM) void preferredBufferFormatsDidChange(); #endif @@ -19650,7 +19282,7 @@ index 5c8694cb4229ee87c50f68f8c24b47e5598a5aee..581637fb988e0d9b465a7029fb1bac98 void updateRootLayer(); WebCore::FloatRect visibleContentsRect() const; diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp b/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp -index e4b6fc981ce302979fd3280e9602bcbea91b9d1f..9ed589d3f29b17c18018798642f34fa375afc1a2 100644 +index 04f3e2cebec36db9487ee5b5d4f33eb2ca8db3b8..4677b87d3cdfdc98e4b10747bf483df3ec1feec0 100644 --- a/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp +++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.cpp @@ -27,6 +27,7 @@ @@ -19662,7 +19294,7 @@ index e4b6fc981ce302979fd3280e9602bcbea91b9d1f..9ed589d3f29b17c18018798642f34fa3 #include "WebPage.h" #include "WebPageCreationParameters.h" diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp -index c42601a113c5f4f390630b3f20328de17f4f7d31..1a8f3dcccae5c09220f0f519d275eeaba83b1a5e 100644 +index 7ff2b1ad2dd19a2b25c5f5c3afbe7f580dd02c4e..eceb689621ed65f4e19461489e43e9f1690f0ea1 100644 --- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp @@ -44,6 +44,7 @@ @@ -19687,31 +19319,31 @@ index c42601a113c5f4f390630b3f20328de17f4f7d31..1a8f3dcccae5c09220f0f519d275eeab String WebCookieJar::cookiesInPartitionedCookieStorage(const WebCore::Document&, const URL&, const WebCore::SameSiteInfo&) const diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.h b/Source/WebKit/WebProcess/WebPage/WebCookieJar.h -index d5bac4fe6d5103b4e752a7219d7870d4cddcaf27..033effbb445f5da6db5798594e2dbef34afec363 100644 +index a7ad18fc1201e5de2cc1528539a765599ecfc41e..ebea233bc54ab6e56fb7093ff63e2368e8670ccd 100644 --- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.h +++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.h -@@ -77,6 +77,8 @@ public: - - void clearCache() final; +@@ -81,6 +81,8 @@ public: + void setOptInCookiePartitioningEnabled(bool); + #endif + void setCookieFromResponse(WebCore::ResourceLoader&, const String& setCookieValue); + - #if HAVE(ALLOW_ONLY_PARTITIONED_COOKIES) - void setOptInCookiePartitioningEnabled(bool); - #endif + private: + WebCookieJar(); + diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98af4924ff6 100644 +index dfeb32a72c1954e4ae456ed89c4fe7b44c533875..3278fd1b672ea8b406e415cce31995fefefaac83 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -@@ -244,6 +244,7 @@ +@@ -249,6 +249,7 @@ #include #include #include +#include #include + #include #include - #include -@@ -1165,6 +1166,12 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) +@@ -1185,6 +1186,12 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) setLinkDecorationFilteringData(WTFMove(parameters.linkDecorationFilteringData)); setAllowedQueryParametersForAdvancedPrivacyProtections(WTFMove(parameters.allowedQueryParametersForAdvancedPrivacyProtections)); #endif @@ -19724,7 +19356,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a if (parameters.windowFeatures) { page->applyWindowFeatures(*parameters.windowFeatures); page->chrome().show(); -@@ -2098,6 +2105,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, st +@@ -2115,6 +2122,22 @@ void WebPage::loadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, st frame->loadDidCommitInAnotherProcess(layerHostingContextIdentifier); } @@ -19747,7 +19379,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a void WebPage::loadRequest(LoadParameters&& loadParameters) { WEBPAGE_RELEASE_LOG_FORWARDABLE(Loading, WEBPAGE_LOADREQUEST, loadParameters.navigationID ? loadParameters.navigationID->toUInt64() : 0, static_cast(loadParameters.shouldTreatAsContinuingLoad), loadParameters.request.isAppInitiated(), loadParameters.existingNetworkResourceLoadIdentifierToResume ? loadParameters.existingNetworkResourceLoadIdentifierToResume->toUInt64() : 0); -@@ -2298,7 +2321,9 @@ void WebPage::stopLoading() +@@ -2315,7 +2338,9 @@ void WebPage::stopLoading() void WebPage::stopLoadingDueToProcessSwap() { SetForScope isStoppingLoadingDueToProcessSwap(m_isStoppingLoadingDueToProcessSwap, true); @@ -19757,7 +19389,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a } bool WebPage::defersLoading() const -@@ -2874,7 +2899,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum +@@ -2891,7 +2916,7 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum #if PLATFORM(IOS_FAMILY) if (m_viewportConfiguration.setViewportArguments(viewportArguments)) viewportConfigurationChanged(); @@ -19766,7 +19398,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a // Adjust view dimensions when using fixed layout. RefPtr localMainFrame = this->localMainFrame(); RefPtr view = localMainFrame ? localMainFrame->view() : nullptr; -@@ -3631,6 +3656,13 @@ void WebPage::flushDeferredScrollEvents() +@@ -3689,6 +3714,13 @@ void WebPage::flushDeferredScrollEvents() protectedCorePage()->flushDeferredScrollEvents(); } @@ -19780,7 +19412,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a void WebPage::flushDeferredDidReceiveMouseEvent() { if (auto info = std::exchange(m_deferredDidReceiveMouseEvent, std::nullopt)) -@@ -3905,6 +3937,97 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandler eventModifiers; + eventModifiers = eventModifiers.fromRaw(modifiers); + @@ -19806,7 +19438,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a + WebPlatformTouchPoint::State state = WebPlatformTouchPoint::State::Pressed; + touchPoints.append(WebPlatformTouchPoint(id, state, screenPosition, position, radius, rotationAngle, force)); + -+ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, WallTime::now()}, WTFMove(touchPoints), {}, {}); ++ WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, MonotonicTime::now()}, WTFMove(touchPoints), {}, {}); + + CurrentEvent currentEvent(touchEvent); + handled = handleTouchEvent(m_page->mainFrame().frameID(), touchEvent, m_page.get()).value_or(false); @@ -19816,7 +19448,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a + WebPlatformTouchPoint::State state = WebPlatformTouchPoint::State::Released; + touchPoints.append(WebPlatformTouchPoint(id, state, screenPosition, position, radius, rotationAngle, force)); + -+ WebTouchEvent touchEvent({WebEventType::TouchEnd, eventModifiers, WallTime::now()}, WTFMove(touchPoints), {}, {}); ++ WebTouchEvent touchEvent({WebEventType::TouchEnd, eventModifiers, MonotonicTime::now()}, WTFMove(touchPoints), {}, {}); + + CurrentEvent currentEvent(touchEvent); + handled = handleTouchEvent(m_page->mainFrame().frameID(), touchEvent, m_page.get()).value_or(false) || handled; @@ -19846,7 +19478,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a + PlatformEvent::Type::MouseMoved, + 0, + modifiers, -+ WallTime::now(), ++ MonotonicTime::now(), + force, + syntheticClickType + )); @@ -19857,7 +19489,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a + PlatformEvent::Type::MousePressed, + 1, + modifiers, -+ WallTime::now(), ++ MonotonicTime::now(), + force, + syntheticClickType + )); @@ -19868,7 +19500,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a + PlatformEvent::Type::MouseReleased, + 1, + modifiers, -+ WallTime::now(), ++ MonotonicTime::now(), + force, + syntheticClickType + )); @@ -19878,7 +19510,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a #endif void WebPage::cancelPointer(WebCore::PointerID pointerId, const WebCore::IntPoint& documentPoint) -@@ -3993,6 +4116,16 @@ void WebPage::sendMessageToTargetBackend(const String& targetId, const String& m +@@ -4047,6 +4170,16 @@ void WebPage::sendMessageToTargetBackend(const String& targetId, const String& m m_inspectorTargetController->sendMessageToTargetBackend(targetId, message); } @@ -19895,7 +19527,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a void WebPage::insertNewlineInQuotedContent() { RefPtr frame = corePage()->focusController().focusedOrMainFrame(); -@@ -4236,6 +4369,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed) +@@ -4290,6 +4423,7 @@ void WebPage::setMainFrameDocumentVisualUpdatesAllowed(bool allowed) void WebPage::show() { send(Messages::WebPageProxy::ShowPage()); @@ -19903,7 +19535,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a } void WebPage::setIsTakingSnapshotsForApplicationSuspension(bool isTakingSnapshotsForApplicationSuspension) -@@ -5456,7 +5590,7 @@ RefPtr WebPage::protectedNotificationPermi +@@ -5489,7 +5623,7 @@ RefPtr WebPage::protectedNotificationPermi #if ENABLE(DRAG_SUPPORT) @@ -19912,10 +19544,10 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a 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) -@@ -7952,6 +8086,10 @@ void WebPage::didCommitLoad(WebFrame* frame) - m_needsFixedContainerEdgesUpdate = true; +@@ -8217,6 +8351,10 @@ void WebPage::didCommitLoad(WebFrame* frame) - flushDeferredDidReceiveMouseEvent(); + if (frame && frame->isMainFrame()) + m_networkResourceRequestIdentifiersForPageLoadTiming.clear(); +// Playwright begin + if (frame->isMainFrame()) + send(Messages::WebPageProxy::ViewScaleFactorDidChange(viewScaleFactor())); @@ -19923,7 +19555,7 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a } void WebPage::didFinishDocumentLoad(WebFrame& frame) -@@ -8261,6 +8399,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, ResourceReq +@@ -8526,6 +8664,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, ResourceReq m_allowsContentJavaScriptFromMostRecentNavigation = m_internals->pendingWebsitePolicies->allowsContentJavaScript; WebsitePoliciesData::applyToDocumentLoader(*std::exchange(m_internals->pendingWebsitePolicies, std::nullopt), documentLoader); } @@ -19934,18 +19566,18 @@ index 8913ab7dc32c76a251b57449ff31cc53f9a6b9e0..04beed37ef9f9702a41a75acc17cc98a return documentLoader; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h -index 47921d36d270fc271bf966dfe183129993ac7336..91da48500f900ddb3b0eb4e99dbd43ef92230dcf 100644 +index 0577245e9f59eb2cb5875be0edcfa28c464d16aa..e24ca4acfde65e2da499e834212290ba2253123c 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit/WebProcess/WebPage/WebPage.h -@@ -46,6 +46,7 @@ - #include +@@ -47,6 +47,7 @@ + #include #include #include +#include #include #include #include -@@ -1286,11 +1287,11 @@ public: +@@ -1321,11 +1322,11 @@ public: void clearSelection(); void restoreSelectionInFocusedEditableElement(); @@ -19959,9 +19591,9 @@ index 47921d36d270fc271bf966dfe183129993ac7336..91da48500f900ddb3b0eb4e99dbd43ef void performDragControllerAction(std::optional, DragControllerAction, WebCore::DragData&&, CompletionHandler, WebCore::DragHandlingMethod, bool, unsigned, WebCore::IntRect, WebCore::IntRect, std::optional)>&&); void performDragOperation(WebCore::DragData&&, SandboxExtensionHandle&&, Vector&&, CompletionHandler&&); #endif -@@ -1308,6 +1309,9 @@ public: +@@ -1343,6 +1344,9 @@ public: #if ENABLE(MODEL_PROCESS) - void modelDragEnded(WebCore::ElementIdentifier); + void modelDragEnded(WebCore::NodeIdentifier); #endif +#if PLATFORM(MAC) + void setDragPasteboardName(const String& pasteboardName) { m_page->setDragPasteboardName(pasteboardName); } @@ -19969,7 +19601,7 @@ index 47921d36d270fc271bf966dfe183129993ac7336..91da48500f900ddb3b0eb4e99dbd43ef #endif #if ENABLE(MODEL_PROCESS) -@@ -1394,8 +1398,11 @@ public: +@@ -1444,8 +1448,11 @@ public: void gestureEvent(WebCore::FrameIdentifier, const WebGestureEvent&, CompletionHandler, bool, std::optional)>&&); #endif @@ -19982,7 +19614,7 @@ index 47921d36d270fc271bf966dfe183129993ac7336..91da48500f900ddb3b0eb4e99dbd43ef void dynamicViewportSizeUpdate(const DynamicViewportSizeUpdate&); bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; } void willStartUserTriggeredZooming(); -@@ -1548,6 +1555,8 @@ public: +@@ -1607,6 +1614,8 @@ public: void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType); void disconnectInspector(const String& targetId); void sendMessageToTargetBackend(const String& targetId, const String& message); @@ -19991,7 +19623,7 @@ index 47921d36d270fc271bf966dfe183129993ac7336..91da48500f900ddb3b0eb4e99dbd43ef void insertNewlineInQuotedContent(); -@@ -1972,6 +1981,7 @@ public: +@@ -2031,6 +2040,7 @@ public: void showContextMenuFromFrame(const FrameInfoData&, const ContextMenuContextData&, const UserData&); #endif void loadRequest(LoadParameters&&); @@ -19999,7 +19631,7 @@ index 47921d36d270fc271bf966dfe183129993ac7336..91da48500f900ddb3b0eb4e99dbd43ef void setObscuredContentInsets(const WebCore::FloatBoxExtent&); -@@ -2176,6 +2186,7 @@ private: +@@ -2255,6 +2265,7 @@ private: void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled); #elif ENABLE(TOUCH_EVENTS) void touchEvent(const WebTouchEvent&, CompletionHandler, bool)>&&); @@ -20007,7 +19639,7 @@ index 47921d36d270fc271bf966dfe183129993ac7336..91da48500f900ddb3b0eb4e99dbd43ef #endif void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&); -@@ -2947,6 +2958,7 @@ private: +@@ -3035,6 +3046,7 @@ private: bool m_isAppNapEnabled { true }; Markable m_pendingNavigationID; @@ -20016,10 +19648,10 @@ index 47921d36d270fc271bf966dfe183129993ac7336..91da48500f900ddb3b0eb4e99dbd43ef bool m_mainFrameProgressCompleted { false }; bool m_shouldDispatchFakeMouseMoveEvents { true }; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in -index a2bdf0b62ddcb75a5c834b8aed481e1b14d5737a..e09d2ae7bbe7a1f0b34b84d6a97d2593e89b39f4 100644 +index 961e4cde3b7f7dcfeed3826cbece0700c63e6fc5..97ba51f4608de657d9f7475d2d5b26a08c553426 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in -@@ -60,10 +60,13 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -61,10 +61,13 @@ messages -> WebPage WantsAsyncDispatchMessage { MouseEvent(WebCore::FrameIdentifier frameID, WebKit::WebMouseEvent event, std::optional> sandboxExtensions) SetLastKnownMousePosition(WebCore::FrameIdentifier frameID, WebCore::IntPoint eventPoint, WebCore::IntPoint globalPoint); @@ -20034,7 +19666,7 @@ index a2bdf0b62ddcb75a5c834b8aed481e1b14d5737a..e09d2ae7bbe7a1f0b34b84d6a97d2593 SetOverrideViewportArguments(struct std::optional arguments) DynamicViewportSizeUpdate(struct WebKit::DynamicViewportSizeUpdate target) -@@ -155,6 +158,7 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -159,6 +162,7 @@ messages -> WebPage WantsAsyncDispatchMessage { ConnectInspector(String targetId, Inspector::FrontendChannel::ConnectionType connectionType) DisconnectInspector(String targetId) SendMessageToTargetBackend(String targetId, String message) @@ -20042,7 +19674,7 @@ index a2bdf0b62ddcb75a5c834b8aed481e1b14d5737a..e09d2ae7bbe7a1f0b34b84d6a97d2593 #if ENABLE(REMOTE_INSPECTOR) SetIndicating(bool indicating); -@@ -165,6 +169,7 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -169,6 +173,7 @@ messages -> WebPage WantsAsyncDispatchMessage { #endif #if !ENABLE(IOS_TOUCH_EVENTS) && ENABLE(TOUCH_EVENTS) TouchEvent(WebKit::WebTouchEvent event) -> (enum:uint8_t std::optional eventType, bool handled) @@ -20050,7 +19682,7 @@ index a2bdf0b62ddcb75a5c834b8aed481e1b14d5737a..e09d2ae7bbe7a1f0b34b84d6a97d2593 #endif CancelPointer(WebCore::PointerID pointerId, WebCore::IntPoint documentPoint) -@@ -190,6 +195,7 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -194,6 +199,7 @@ messages -> WebPage WantsAsyncDispatchMessage { LoadDataInFrame(std::span data, String MIMEType, String encodingName, URL baseURL, WebCore::FrameIdentifier frameID) LoadRequest(struct WebKit::LoadParameters loadParameters) LoadDidCommitInAnotherProcess(WebCore::FrameIdentifier frameID, std::optional layerHostingContextIdentifier) @@ -20058,7 +19690,7 @@ index a2bdf0b62ddcb75a5c834b8aed481e1b14d5737a..e09d2ae7bbe7a1f0b34b84d6a97d2593 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) -@@ -354,10 +360,10 @@ messages -> WebPage WantsAsyncDispatchMessage { +@@ -358,10 +364,10 @@ messages -> WebPage WantsAsyncDispatchMessage { RemoveLayerForFindOverlay() -> () # Drag and drop. @@ -20071,8 +19703,8 @@ index a2bdf0b62ddcb75a5c834b8aed481e1b14d5737a..e09d2ae7bbe7a1f0b34b84d6a97d2593 PerformDragControllerAction(std::optional frameID, enum:uint8_t WebKit::DragControllerAction action, WebCore::DragData dragData) -> (enum:uint8_t std::optional dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional remoteUserInputEventData) PerformDragOperation(WebCore::DragData dragData, WebKit::SandboxExtensionHandle sandboxExtensionHandle, Vector sandboxExtensionsForUpload) -> (bool handled) #endif -@@ -377,6 +383,10 @@ messages -> WebPage WantsAsyncDispatchMessage { - ModelDragEnded(WebCore::ElementIdentifier elementID) +@@ -381,6 +387,10 @@ messages -> WebPage WantsAsyncDispatchMessage { + ModelDragEnded(WebCore::NodeIdentifier nodeID) #endif +#if PLATFORM(MAC) && ENABLE(DRAG_SUPPORT) @@ -20083,10 +19715,10 @@ index a2bdf0b62ddcb75a5c834b8aed481e1b14d5737a..e09d2ae7bbe7a1f0b34b84d6a97d2593 RequestDragStart(std::optional remoteFrameID, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet allowedActionsMask) -> (struct WebKit::DragInitiationResult result) RequestAdditionalItemsForDragSession(std::optional rootFrameID, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet allowedActionsMask) -> (struct WebKit::DragInitiationResult result) diff --git a/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp b/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp -index 40ec42bb4f998774a2ce4a19e82f68512ad2ebb8..080794e14bfbb3a336d8a89791baee0e1aec3c75 100644 +index 907f750f7e6c9c3d2b15a7eafd5480a6582b3a69..0163098c7ea168b985ee92f9dbf0b31c502bf6b8 100644 --- a/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp +++ b/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp -@@ -210,16 +210,23 @@ String WebPage::platformUserAgent(const URL& url) const +@@ -211,16 +211,23 @@ String WebPage::platformUserAgent(const URL& url) const bool WebPage::hoverSupportedByPrimaryPointingDevice() const { @@ -20110,7 +19742,7 @@ index 40ec42bb4f998774a2ce4a19e82f68512ad2ebb8..080794e14bfbb3a336d8a89791baee0e const auto& primaryPointingDevice = WebProcess::singleton().primaryPointingDevice(); if (primaryPointingDevice == AvailableInputDevices::Mouse) return PointerCharacteristics::Fine; -@@ -230,6 +237,9 @@ std::optional WebPage::pointerCharacteristicsOfPrimaryPo +@@ -231,6 +238,9 @@ std::optional WebPage::pointerCharacteristicsOfPrimaryPo OptionSet WebPage::pointerCharacteristicsOfAllAvailablePointingDevices() const { @@ -20121,10 +19753,10 @@ index 40ec42bb4f998774a2ce4a19e82f68512ad2ebb8..080794e14bfbb3a336d8a89791baee0e const auto& availableInputs = WebProcess::singleton().availableInputDevices(); if (availableInputs.contains(AvailableInputDevices::Mouse)) diff --git a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -index e36cd746c4a8d35d076b68fd76ccd211a79d63a6..156cacab648a4ad53b854bf880c924bbe13ca4b6 100644 +index 12c8c15f4e02fe442110815bfb37a3433e2f7e78..21504a7d64e4313cfe86c85e60a0ec2879d36087 100644 --- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm +++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -@@ -701,21 +701,37 @@ String WebPage::platformUserAgent(const URL&) const +@@ -703,21 +703,37 @@ String WebPage::platformUserAgent(const URL&) const bool WebPage::hoverSupportedByPrimaryPointingDevice() const { @@ -20213,10 +19845,10 @@ index ea3a03b5ee6d4ecadd771314c6059268db917087..91be6f4c687157afcfdaa431d7a1a6ff } diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp -index fe47c90bccb9a567803485e7313e093b48ad4d4c..ec76a5edc15a914d1f00955493625f6c135d75ce 100644 +index f0544767cec6c08f3a8ff7da1c7df40ad10488e7..2345e5dc795240cd963e1c56f7da2a1c38503425 100644 --- a/Source/WebKit/WebProcess/WebProcess.cpp +++ b/Source/WebKit/WebProcess/WebProcess.cpp -@@ -93,6 +93,7 @@ +@@ -94,6 +94,7 @@ #include "WebsiteData.h" #include "WebsiteDataStoreParameters.h" #include "WebsiteDataType.h" @@ -20224,7 +19856,7 @@ index fe47c90bccb9a567803485e7313e093b48ad4d4c..ec76a5edc15a914d1f00955493625f6c #include #include #include -@@ -388,6 +389,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter +@@ -391,6 +392,14 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter { JSC::Options::AllowUnfinalizedAccessScope scope; JSC::Options::allowNonSPTagging() = false; @@ -20239,7 +19871,7 @@ index fe47c90bccb9a567803485e7313e093b48ad4d4c..ec76a5edc15a914d1f00955493625f6c JSC::Options::notifyOptionsChanged(); } -@@ -395,6 +404,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter +@@ -398,6 +407,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter platformInitializeProcess(parameters); updateCPULimit(); @@ -20248,7 +19880,7 @@ index fe47c90bccb9a567803485e7313e093b48ad4d4c..ec76a5edc15a914d1f00955493625f6c } void WebProcess::initializeConnection(IPC::Connection* connection) -@@ -979,6 +990,8 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters& +@@ -1002,6 +1013,8 @@ void WebProcess::createWebPage(PageIdentifier pageID, WebPageCreationParameters& accessibilityRelayProcessSuspended(false); } ASSERT(result.iterator->value); @@ -20258,10 +19890,10 @@ index fe47c90bccb9a567803485e7313e093b48ad4d4c..ec76a5edc15a914d1f00955493625f6c void WebProcess::removeWebPage(PageIdentifier pageID) diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm -index 01f0546169ab61e79b730ac1fe4bded1b80ade9d..f274262554df2cc924e85b79467e16110e12af43 100644 +index 50897a0f972d994224ceada9dfeb5c95c12cfd69..fde414357c688fe3b26eba1f2157bd8e295e2589 100644 --- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm -@@ -4219,7 +4219,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END +@@ -4210,7 +4210,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END _private->handlingMouseDownEvent = NO; } @@ -20271,10 +19903,10 @@ index 01f0546169ab61e79b730ac1fe4bded1b80ade9d..f274262554df2cc924e85b79467e1611 - (void)touch:(WebEvent *)event { diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm -index 30baa8fa7a4f030680c683eebb7e93f9723da373..f236d24511f25dcbcf84af26fe29d8eb3742512d 100644 +index db58f96c27158f1234477f90d47a98911af98d95..c2091651640b081c266486fd8a50a414ff246f4b 100644 --- a/Source/WebKitLegacy/mac/WebView/WebView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebView.mm -@@ -3972,7 +3972,7 @@ + (void)_doNotStartObservingNetworkReachability +@@ -3929,7 +3929,7 @@ + (void)_doNotStartObservingNetworkReachability } #endif // PLATFORM(IOS_FAMILY) @@ -20283,7 +19915,7 @@ index 30baa8fa7a4f030680c683eebb7e93f9723da373..f236d24511f25dcbcf84af26fe29d8eb - (NSArray *)_touchEventRegions { -@@ -4014,7 +4014,7 @@ - (NSArray *)_touchEventRegions +@@ -3971,7 +3971,7 @@ - (NSArray *)_touchEventRegions }).autorelease(); } @@ -20326,13 +19958,13 @@ index 0000000000000000000000000000000000000000..a9db9ec38d05e36517414248237e885b + LIBVPX_LIBRARIES +) diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake -index 7b9783fe14ac1eca2c6a48e42b74e6f294359b6d..584c9f2ea30a8f670b18ef271ca2f0681c637fdc 100644 +index a47bbb70db0ef0688d63ada76eddc2cf382685cf..a19dfc1206a89e940105c3a77b4479f45a28c139 100644 --- a/Source/cmake/OptionsGTK.cmake +++ b/Source/cmake/OptionsGTK.cmake @@ -9,6 +9,10 @@ set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string") # Update Source/WTF/wtf/Platform.h to match required GLib versions. - find_package(GLIB 2.70.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule) + find_package(GLib 2.70.0 REQUIRED COMPONENTS GioUnix Thread Module) + +set(CMAKE_THREAD_PREFER_PTHREAD TRUE) +set(THREADS_PREFER_PTHREAD_FLAG TRUE) @@ -20385,12 +20017,12 @@ index 7b9783fe14ac1eca2c6a48e42b74e6f294359b6d..584c9f2ea30a8f670b18ef271ca2f068 WEBKIT_OPTION_DEPEND(ENABLE_WEBXR ENABLE_GAMEPAD) diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake -index d04d2c2504b829f240633a9c7e3de15876190ba0..9f3a7febd7374a60a55c1d6aaee50cc26df59fc6 100644 +index 9303f05609cef53f6fccb0b3d8d42213efabec79..aced5eff5e07ba8de1ca7835f1decb4a0690cf10 100644 --- a/Source/cmake/OptionsWPE.cmake +++ b/Source/cmake/OptionsWPE.cmake -@@ -23,6 +23,9 @@ find_package(WebP REQUIRED COMPONENTS demux) - find_package(WPE REQUIRED) - find_package(ZLIB REQUIRED) +@@ -33,6 +33,9 @@ else () + set(ENABLE_MEDIA_SESSION_DEFAULT ON) + endif () +set(CMAKE_THREAD_PREFER_PTHREAD TRUE) +set(THREADS_PREFER_PTHREAD_FLAG TRUE) @@ -20398,7 +20030,7 @@ index d04d2c2504b829f240633a9c7e3de15876190ba0..9f3a7febd7374a60a55c1d6aaee50cc2 WEBKIT_OPTION_BEGIN() SET_AND_EXPOSE_TO_BUILD(ENABLE_DEVELOPER_MODE ${DEVELOPER_MODE}) -@@ -81,6 +84,22 @@ else () +@@ -92,6 +95,22 @@ else () WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SKIA PRIVATE OFF) endif () @@ -20421,7 +20053,7 @@ index d04d2c2504b829f240633a9c7e3de15876190ba0..9f3a7febd7374a60a55c1d6aaee50cc2 # 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. -@@ -116,6 +135,11 @@ WEBKIT_OPTION_DEPEND(USE_QT6 ENABLE_WPE_PLATFORM) +@@ -127,6 +146,11 @@ WEBKIT_OPTION_DEPEND(USE_QT6 ENABLE_WPE_PLATFORM) WEBKIT_OPTION_DEPEND(USE_SKIA_OPENTYPE_SVG USE_SKIA) WEBKIT_OPTION_DEPEND(USE_SYSTEM_SYSPROF_CAPTURE USE_SYSPROF_CAPTURE) @@ -20434,7 +20066,7 @@ index d04d2c2504b829f240633a9c7e3de15876190ba0..9f3a7febd7374a60a55c1d6aaee50cc2 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BUBBLEWRAP_SANDBOX PUBLIC ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON) diff --git a/Source/cmake/OptionsWin.cmake b/Source/cmake/OptionsWin.cmake -index 1a8e2da4c2a377e0dbfd7f7b1bc7b5ce597d4a4e..cee24362b16102e6efb9e017c77810ca4bdf32d7 100644 +index 38684436bf8272f2e6d05681e7b1cb257479e877..20007a8425728241a8b039570c61dd2be703b818 100644 --- a/Source/cmake/OptionsWin.cmake +++ b/Source/cmake/OptionsWin.cmake @@ -55,6 +55,10 @@ find_package(ZLIB 1.2.11 REQUIRED) @@ -20448,7 +20080,7 @@ index 1a8e2da4c2a377e0dbfd7f7b1bc7b5ce597d4a4e..cee24362b16102e6efb9e017c77810ca WEBKIT_OPTION_BEGIN() # FIXME: Most of these options should not be public. -@@ -112,6 +116,14 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) +@@ -113,6 +117,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) @@ -20464,7 +20096,7 @@ index 1a8e2da4c2a377e0dbfd7f7b1bc7b5ce597d4a4e..cee24362b16102e6efb9e017c77810ca set(USE_ANGLE_EGL ON) diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake -index d8fe5503609122c55c2c675934b3678cfe709cf0..2e706bb436d6c01689bec8cc7b7de3c125ca258a 100644 +index 692287a5dc9380b9f09fcf4638c4b73bc6003f4c..5cddb30b6c2df2d56a80a459776206e8d688f5c6 100644 --- a/Source/cmake/WebKitCompilerFlags.cmake +++ b/Source/cmake/WebKitCompilerFlags.cmake @@ -122,7 +122,7 @@ macro(WEBKIT_ADD_TARGET_CXX_FLAGS _target) @@ -20473,9 +20105,9 @@ index d8fe5503609122c55c2c675934b3678cfe709cf0..2e706bb436d6c01689bec8cc7b7de3c1 -option(DEVELOPER_MODE_FATAL_WARNINGS "Build with warnings as errors if DEVELOPER_MODE is also enabled" ON) +option(DEVELOPER_MODE_FATAL_WARNINGS "Build with warnings as errors if DEVELOPER_MODE is also enabled" OFF) + set(DEVELOPER_MODE_CXX_FLAGS) if (DEVELOPER_MODE AND DEVELOPER_MODE_FATAL_WARNINGS) if (MSVC) - set(FATAL_WARNINGS_FLAG /WX) diff --git a/Tools/DumpRenderTree/DerivedSources.make b/Tools/DumpRenderTree/DerivedSources.make index 576835410df6deac60f0158f1d2d1ef1e5f4c78d..9b492cfe5fef8de340a80f2af70a7d68672ef2e4 100644 --- a/Tools/DumpRenderTree/DerivedSources.make @@ -20491,10 +20123,10 @@ index 576835410df6deac60f0158f1d2d1ef1e5f4c78d..9b492cfe5fef8de340a80f2af70a7d68 WEB_PREFERENCES_GENERATED_FILES = \ TestOptionsGeneratedWebKitLegacyKeyMapping.cpp \ diff --git a/Tools/MiniBrowser/gtk/BrowserTab.c b/Tools/MiniBrowser/gtk/BrowserTab.c -index 6d48c378699e87f55bbd2550d4971a295b831a24..efb0d8e1e0f7db5d4ce81bc58a97e6c4034ff0b3 100644 +index a7d4d6ce8ee32140eb188610fbd0996921dc7168..9ecb09431c5d427e6a878f1da7f010ea9faeb8be 100644 --- a/Tools/MiniBrowser/gtk/BrowserTab.c +++ b/Tools/MiniBrowser/gtk/BrowserTab.c -@@ -117,19 +117,38 @@ static void isLoadingChanged(WebKitWebView *webView, GParamSpec *paramSpec, Brow +@@ -118,19 +118,38 @@ static void isLoadingChanged(WebKitWebView *webView, GParamSpec *paramSpec, Brow } } @@ -20537,7 +20169,7 @@ index 6d48c378699e87f55bbd2550d4971a295b831a24..efb0d8e1e0f7db5d4ce81bc58a97e6c4 return TRUE; } -@@ -180,6 +199,11 @@ static void loadChanged(WebKitWebView *webView, WebKitLoadEvent loadEvent, Brows +@@ -181,6 +200,11 @@ static void loadChanged(WebKitWebView *webView, WebKitLoadEvent loadEvent, Brows #endif } @@ -20549,7 +20181,7 @@ index 6d48c378699e87f55bbd2550d4971a295b831a24..efb0d8e1e0f7db5d4ce81bc58a97e6c4 static GtkWidget *createInfoBarQuestionMessage(const char *title, const char *text) { GtkWidget *dialog = gtk_info_bar_new_with_buttons("No", GTK_RESPONSE_NO, "Yes", GTK_RESPONSE_YES, NULL); -@@ -746,6 +770,7 @@ static void browserTabConstructed(GObject *gObject) +@@ -805,6 +829,7 @@ static void browserTabConstructed(GObject *gObject) g_signal_connect(tab->webView, "notify::is-loading", G_CALLBACK(isLoadingChanged), tab); g_signal_connect(tab->webView, "decide-policy", G_CALLBACK(decidePolicy), tab); g_signal_connect(tab->webView, "load-changed", G_CALLBACK(loadChanged), tab); @@ -20557,7 +20189,7 @@ index 6d48c378699e87f55bbd2550d4971a295b831a24..efb0d8e1e0f7db5d4ce81bc58a97e6c4 g_signal_connect(tab->webView, "load-failed-with-tls-errors", G_CALLBACK(loadFailedWithTLSerrors), tab); g_signal_connect(tab->webView, "permission-request", G_CALLBACK(decidePermissionRequest), tab); g_signal_connect(tab->webView, "run-color-chooser", G_CALLBACK(runColorChooserCallback), tab); -@@ -798,6 +823,9 @@ static char *getInternalURI(const char *uri) +@@ -860,6 +885,9 @@ static char *getInternalURI(const char *uri) if (g_str_has_prefix(uri, "about:") && !g_str_equal(uri, "about:blank")) return g_strconcat(BROWSER_ABOUT_SCHEME, uri + strlen ("about"), NULL); @@ -20879,7 +20511,7 @@ index d3fbb968ee463f86c64fecb855b46c8634b4b72d..01dbbfbb93f2cfa6eb6440cce9794ec9 g_clear_object(&interfaceSettings); diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp -index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a59760455329d316e33 100644 +index 3f0a7b883e30c982c68d53ab09ae36c54ea40030..0fc2fa2b8c9c3b0af7de861f681734f87e16dcc6 100644 --- a/Tools/MiniBrowser/wpe/main.cpp +++ b/Tools/MiniBrowser/wpe/main.cpp @@ -52,6 +52,9 @@ static gboolean headlessMode; @@ -20902,7 +20534,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" }, { nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr } }; -@@ -288,15 +294,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul +@@ -302,15 +308,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul g_main_loop_quit(data->mainLoop); } @@ -20943,7 +20575,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 { auto backend = createViewBackend(defaultWindowWidthLegacyAPI, defaultWindowHeightLegacyAPI); WebKitWebViewBackend* viewBackend = nullptr; -@@ -311,12 +340,27 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi +@@ -325,12 +354,27 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi }, backend.release()); } @@ -20977,7 +20609,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 #if ENABLE_WPE_PLATFORM if (auto* wpeView = webkit_web_view_get_wpe_view(newWebView)) { -@@ -328,9 +372,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi +@@ -342,9 +386,13 @@ static WebKitWebView* createWebView(WebKitWebView* webView, WebKitNavigationActi g_signal_connect(newWebView, "create", G_CALLBACK(createWebView), user_data); g_signal_connect(newWebView, "close", G_CALLBACK(webViewClose), user_data); @@ -20993,7 +20625,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 return newWebView; } -@@ -418,13 +466,105 @@ void loadConfigFile(WPESettings* settings) +@@ -432,13 +480,105 @@ void loadConfigFile(WPESettings* settings) } #endif @@ -21100,7 +20732,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 webkit_network_session_set_itp_enabled(networkSession, enableITP); if (proxy) { -@@ -451,10 +591,18 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -465,10 +605,18 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* webkit_cookie_manager_set_persistent_storage(cookieManager, cookiesFile, storageType); } } @@ -21121,7 +20753,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 webkit_website_data_manager_set_itp_enabled(manager, enableITP); if (proxy) { -@@ -485,6 +633,7 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -499,6 +647,7 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* } #endif @@ -21129,7 +20761,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 WebKitUserContentManager* userContentManager = nullptr; if (contentFilter) { GFile* contentFilterFile = g_file_new_for_commandline_arg(contentFilter); -@@ -563,6 +712,15 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -577,6 +726,15 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* "autoplay", WEBKIT_AUTOPLAY_ALLOW, nullptr); @@ -21145,7 +20777,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, "backend", viewBackend, "web-context", webContext, -@@ -609,12 +767,16 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -623,12 +781,16 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* } #endif @@ -21164,7 +20796,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 g_hash_table_add(openViews, webView); WebKitColor color; -@@ -622,16 +784,11 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* +@@ -636,16 +798,11 @@ static void activate(GApplication* application, WPEToolingBackends::ViewBackend* webkit_web_view_set_background_color(webView, &color); if (uriArguments) { @@ -21186,7 +20818,7 @@ index 247a2dc5cf369dbf26434358de0898cb36cba100..1aff934e53a808df82ba4a5976045532 webkit_web_view_load_uri(webView, "https://wpewebkit.org"); g_object_unref(webContext); -@@ -728,8 +885,14 @@ int main(int argc, char *argv[]) +@@ -742,8 +899,14 @@ int main(int argc, char *argv[]) } } @@ -21229,10 +20861,10 @@ 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 567ccd8d7a4bdb3c576c60230123b78465da6505..75bf76270063878f3f1ded7b47eb2f8cc90271d8 100644 +index 763464258cd174b858fe04e00c21a87d5a644c8d..cbe6d4dde62803d491bb8f1818d54d7b40ecb718 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp -@@ -713,6 +713,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* par +@@ -763,6 +763,7 @@ PlatformWebView* TestController::createOtherPlatformWebView(PlatformWebView* par nullptr, // requestStorageAccessConfirm nullptr, // shouldAllowDeviceOrientationAndMotionAccess nullptr, // runWebAuthenticationPanel @@ -21240,7 +20872,7 @@ index 567ccd8d7a4bdb3c576c60230123b78465da6505..75bf76270063878f3f1ded7b47eb2f8c nullptr, // decidePolicyForSpeechRecognitionPermissionRequest nullptr, // decidePolicyForMediaKeySystemPermissionRequest nullptr, // queryPermission -@@ -1188,6 +1189,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) +@@ -1241,6 +1242,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) nullptr, // requestStorageAccessConfirm shouldAllowDeviceOrientationAndMotionAccess, runWebAuthenticationPanel, @@ -21249,10 +20881,10 @@ index 567ccd8d7a4bdb3c576c60230123b78465da6505..75bf76270063878f3f1ded7b47eb2f8c decidePolicyForMediaKeySystemPermissionRequest, queryPermission, diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm -index 9419696018c076d0e5b4ef04ea7c58be9504cd96..06c537e3c022517449068a11ea59400413e8f4dc 100644 +index b5e56675d2005f78dfd7def861601c63398c069d..038e763aa8dead3e570f9dd0bdcc5a7aa7734436 100644 --- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm +++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm -@@ -961,4 +961,51 @@ void EventSenderProxy::waitForPendingMouseEvents() +@@ -967,4 +967,51 @@ void EventSenderProxy::waitForPendingMouseEvents() } } @@ -21305,7 +20937,7 @@ index 9419696018c076d0e5b4ef04ea7c58be9504cd96..06c537e3c022517449068a11ea594004 + } // namespace WTR diff --git a/Tools/jhbuild/jhbuild-minimal.modules b/Tools/jhbuild/jhbuild-minimal.modules -index 3a0b7425900b14ce2aa0d48aa914cd69bff1f332..0ce07cc1368c6f521b51d6300dca9c4d078beef3 100644 +index 5af40246b94fb365453f94f8b1b2ba29f3a84b20..91e6e4600557e8dcd4cd886fa1316f63a4c81138 100644 --- a/Tools/jhbuild/jhbuild-minimal.modules +++ b/Tools/jhbuild/jhbuild-minimal.modules @@ -67,8 +67,8 @@ diff --git a/docs/src/api/class-accessibility.md b/docs/src/api/class-accessibility.md deleted file mode 100644 index e5efc9b21f..0000000000 --- a/docs/src/api/class-accessibility.md +++ /dev/null @@ -1,170 +0,0 @@ -# class: Accessibility -* since: v1.8 -* langs: csharp, js, python -* deprecated: This class is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe. - -The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by -assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or -[switches](https://en.wikipedia.org/wiki/Switch_access). - -Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might -have wildly different output. - -Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated into different -platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree. - -Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific AX-Tree or by -assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the -"interesting" nodes of the tree. - -## async method: Accessibility.snapshot -* since: v1.8 -* deprecated: This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe. - -- returns: <[null]|[Object]> - - `role` <[string]> The [role](https://www.w3.org/TR/wai-aria/#usage). - - `name` <[string]> A human readable name for the node. - - `value` <[string]|[float]> The current value of the node, if applicable. - - `description` <[string]> An additional human readable description of the node, if applicable. - - `keyshortcuts` <[string]> Keyboard shortcuts associated with this node, if applicable. - - `roledescription` <[string]> A human readable alternative to the role, if applicable. - - `valuetext` <[string]> A description of the current value, if applicable. - - `disabled` <[boolean]> Whether the node is disabled, if applicable. - - `expanded` <[boolean]> Whether the node is expanded or collapsed, if applicable. - - `focused` <[boolean]> Whether the node is focused, if applicable. - - `modal` <[boolean]> Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable. - - `multiline` <[boolean]> Whether the node text input supports multiline, if applicable. - - `multiselectable` <[boolean]> Whether more than one child can be selected, if applicable. - - `readonly` <[boolean]> Whether the node is read only, if applicable. - - `required` <[boolean]> Whether the node is required, if applicable. - - `selected` <[boolean]> Whether the node is selected in its parent node, if applicable. - - `checked` <[boolean]|"mixed"> Whether the checkbox is checked, or "mixed", if applicable. - - `pressed` <[boolean]|"mixed"> Whether the toggle button is checked, or "mixed", if applicable. - - `level` <[int]> The level of a heading, if applicable. - - `valuemin` <[float]> The minimum value in a node, if applicable. - - `valuemax` <[float]> The maximum value in a node, if applicable. - - `autocomplete` <[string]> What kind of autocomplete is supported by a control, if applicable. - - `haspopup` <[string]> What kind of popup is currently being shown for a node, if applicable. - - `invalid` <[string]> Whether and in what way this node's value is invalid, if applicable. - - `orientation` <[string]> Whether the node is oriented horizontally or vertically, if applicable. - - `children` <[Array]<[Object]>> Child nodes, if any, if applicable. - -Captures the current state of the accessibility tree. The returned object represents the root accessible node of the -page. - -:::note -The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright -will discard them as well for an easier to process tree, unless [`option: interestingOnly`] is set to `false`. -::: - -**Usage** - -An example of dumping the entire accessibility tree: - -```js -const snapshot = await page.accessibility.snapshot(); -console.log(snapshot); -``` - -```java -String snapshot = page.accessibility().snapshot(); -System.out.println(snapshot); -``` - -```python async -snapshot = await page.accessibility.snapshot() -print(snapshot) -``` - -```python sync -snapshot = page.accessibility.snapshot() -print(snapshot) -``` - -```csharp -var accessibilitySnapshot = await page.Accessibility.SnapshotAsync(); -Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot)); -``` - -An example of logging the focused node's name: - -```js -const snapshot = await page.accessibility.snapshot(); -const node = findFocusedNode(snapshot); -console.log(node && node.name); - -function findFocusedNode(node) { - if (node.focused) - return node; - for (const child of node.children || []) { - const foundNode = findFocusedNode(child); - if (foundNode) - return foundNode; - } - return null; -} -``` - -```csharp -var accessibilitySnapshot = await page.Accessibility.SnapshotAsync(); -Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot)); -``` - -```java -// FIXME -String snapshot = page.accessibility().snapshot(); -``` - -```python async -def find_focused_node(node): - if node.get("focused"): - return node - for child in (node.get("children") or []): - found_node = find_focused_node(child) - if found_node: - return found_node - return None - -snapshot = await page.accessibility.snapshot() -node = find_focused_node(snapshot) -if node: - print(node["name"]) -``` - -```python sync -def find_focused_node(node): - if node.get("focused"): - return node - for child in (node.get("children") or []): - found_node = find_focused_node(child) - if found_node: - return found_node - return None - -snapshot = page.accessibility.snapshot() -node = find_focused_node(snapshot) -if node: - print(node["name"]) -``` - -## async method: Accessibility.snapshot -* since: v1.8 -* langs: java -- returns: <[null]|[string]> - -## async method: Accessibility.snapshot -* since: v1.8 -* langs: csharp -- returns: <[null]|[JsonElement]> - -### option: Accessibility.snapshot.interestingOnly -* since: v1.8 -- `interestingOnly` <[boolean]> - -Prune uninteresting nodes from the tree. Defaults to `true`. - -### option: Accessibility.snapshot.root -* since: v1.8 -- `root` <[ElementHandle]> - -The root DOM element for the snapshot. Defaults to the whole page. diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index 97c9303225..3e7529c482 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -327,9 +327,9 @@ await context.AddCookiesAsync(new[] { cookie1, cookie2 }); - `cookies` <[Array]<[Object]>> - `name` <[string]> - `value` <[string]> - - `url` ?<[string]> Either url or domain / path are required. Optional. - - `domain` ?<[string]> For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url or domain / path are required. Optional. - - `path` ?<[string]> Either url or domain / path are required Optional. + - `url` ?<[string]> Either `url` or both `domain` and `path` are required. Optional. + - `domain` ?<[string]> For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either `url` or both `domain` and `path` are required. Optional. + - `path` ?<[string]> Either `url` or both `domain` and `path` are required. Optional. - `expires` ?<[float]> Unix time in seconds. Optional. - `httpOnly` ?<[boolean]> Optional. - `secure` ?<[boolean]> Optional. @@ -948,6 +948,8 @@ Here are some permissions that may be supported by some browsers: * `'clipboard-write'` * `'geolocation'` * `'gyroscope'` +* `'local-fonts'` +* `'local-network-access'` * `'magnetometer'` * `'microphone'` * `'midi-sysex'` (system-exclusive midi) @@ -955,7 +957,6 @@ Here are some permissions that may be supported by some browsers: * `'notifications'` * `'payment-handler'` * `'storage-access'` -* `'local-fonts'` ### option: BrowserContext.grantPermissions.origin * since: v1.8 diff --git a/docs/src/api/class-consolemessage.md b/docs/src/api/class-consolemessage.md index f856dffe55..b712bca267 100644 --- a/docs/src/api/class-consolemessage.md +++ b/docs/src/api/class-consolemessage.md @@ -150,3 +150,9 @@ The text of the console message. One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`, `'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`, `'count'`, `'timeEnd'`. + +## method: ConsoleMessage.worker +* since: v1.57 +- returns: <[null]|[Worker]> + +The web worker or service worker that produced this console message, if any. Note that console messages from web workers also have non-null [`method: ConsoleMessage.page`]. diff --git a/docs/src/api/class-download.md b/docs/src/api/class-download.md index 3333d36996..11b0c68e15 100644 --- a/docs/src/api/class-download.md +++ b/docs/src/api/class-download.md @@ -74,6 +74,10 @@ Upon successful cancellations, `download.failure()` would resolve to `'canceled' Returns a readable stream for a successful download, or throws for a failed/canceled download. +:::note +If you don't need a readable stream, it's usually simpler to read the file from disk after the download completed. See [`method: Download.path`]. +::: + ## async method: Download.delete * since: v1.8 diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md index c8f54c7380..730269950f 100644 --- a/docs/src/api/class-elementhandle.md +++ b/docs/src/api/class-elementhandle.md @@ -234,6 +234,9 @@ When all steps combined have not finished during the specified [`option: timeout ### option: ElementHandle.click.trial = %%-input-trial-%% * since: v1.11 +### option: ElementHandle.click.steps = %%-input-mousemove-steps-%% +* since: v1.57 + ## async method: ElementHandle.contentFrame * since: v1.8 - returns: <[null]|[Frame]> @@ -287,6 +290,9 @@ When all steps combined have not finished during the specified [`option: timeout ### option: ElementHandle.dblclick.trial = %%-input-trial-%% * since: v1.11 +### option: ElementHandle.dblclick.steps = %%-input-mousemove-steps-%% +* since: v1.57 + ## async method: ElementHandle.dispatchEvent * since: v1.8 * discouraged: Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md). diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md index e286c63bfa..f9c366e427 100644 --- a/docs/src/api/class-frame.md +++ b/docs/src/api/class-frame.md @@ -482,6 +482,9 @@ Optional event-specific initialization properties. ### option: Frame.dragAndDrop.targetPosition = %%-input-target-position-%% * since: v1.14 +### option: Frame.dragAndDrop.steps = %%-input-drag-steps-%% +* since: v1.57 + ## async method: Frame.evalOnSelector * since: v1.9 * discouraged: This method does not wait for the element to pass the actionability diff --git a/docs/src/api/class-genericassertions.md b/docs/src/api/class-genericassertions.md index 180a15dc4b..603995eddd 100644 --- a/docs/src/api/class-genericassertions.md +++ b/docs/src/api/class-genericassertions.md @@ -354,6 +354,7 @@ expect(value).toEqual({ prop: 1 }); * [`method: GenericAssertions.any`] * [`method: GenericAssertions.anything`] * [`method: GenericAssertions.arrayContaining`] +* [`method: GenericAssertions.arrayOf`] * [`method: GenericAssertions.closeTo`] * [`method: GenericAssertions.objectContaining`] * [`method: GenericAssertions.stringContaining`] @@ -625,6 +626,28 @@ expect([1, 2, 3]).not.toEqual(expect.arrayContaining([1, 4])); Expected array that is a subset of the received value. +## method: GenericAssertions.arrayOf +* since: v1.57 + +`expect.arrayOf()` matches array of objects created from the [`param: constructor`] or a corresponding primitive type. Use it inside [`method: GenericAssertions.toEqual`] to perform pattern matching. + +**Usage** + +```js +// Match instance of a class. +class Example {} +expect([new Example(), new Example()]).toEqual(expect.arrayOf(Example)); + +// Match any string. +expect(['a', 'b', 'c']).toEqual(expect.arrayOf(String)); +``` + +### param: GenericAssertions.arrayOf.constructor +* since: v1.57 +- `constructor` <[Function]> + +Constructor of the expected object like `ExampleClass`, or a primitive boxed type like `Number`. + ## method: GenericAssertions.closeTo * since: v1.9 diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md index a5a92939bc..042c08bb99 100644 --- a/docs/src/api/class-locator.md +++ b/docs/src/api/class-locator.md @@ -497,6 +497,9 @@ await page.Locator("canvas").ClickAsync(new() { ### option: Locator.click.trial = %%-input-trial-with-modifiers-%% * since: v1.14 +### option: Locator.click.steps = %%-input-mousemove-steps-%% +* since: v1.57 + ## async method: Locator.count * since: v1.14 - returns: <[int]> @@ -580,6 +583,9 @@ When all steps combined have not finished during the specified [`option: timeout ### option: Locator.dblclick.trial = %%-input-trial-with-modifiers-%% * since: v1.14 +### option: Locator.dblclick.steps = %%-input-mousemove-steps-%% +* since: v1.57 + ## method: Locator.describe * since: v1.53 - returns: <[Locator]> @@ -620,6 +626,54 @@ await button.ClickAsync(); Locator description. +## method: Locator.description +* since: v1.57 +- returns: <[null]|[string]> + +Returns locator description previously set with [`method: Locator.describe`]. Returns `null` if no custom description has been set. Prefer `Locator.toString()` for a human-readable representation, as it uses the description when available. + +**Usage** + +```js +const button = page.getByRole('button').describe('Subscribe button'); +console.log(button.description()); // "Subscribe button" + +const input = page.getByRole('textbox'); +console.log(input.description()); // null +``` + +```python async +button = page.get_by_role("button").describe("Subscribe button") +print(button.description()) # "Subscribe button" + +input = page.get_by_role("textbox") +print(input.description()) # None +``` + +```python sync +button = page.get_by_role("button").describe("Subscribe button") +print(button.description()) # "Subscribe button" + +input = page.get_by_role("textbox") +print(input.description()) # None +``` + +```java +Locator button = page.getByRole(AriaRole.BUTTON).describe("Subscribe button"); +System.out.println(button.description()); // "Subscribe button" + +Locator input = page.getByRole(AriaRole.TEXTBOX); +System.out.println(input.description()); // null +``` + +```csharp +var button = Page.GetByRole(AriaRole.Button).Describe("Subscribe button"); +Console.WriteLine(button.Description()); // "Subscribe button" + +var input = Page.GetByRole(AriaRole.Textbox); +Console.WriteLine(input.Description()); // null +``` + ## async method: Locator.dispatchEvent * since: v1.14 @@ -821,6 +875,9 @@ Locator of the element to drag to. ### option: Locator.dragTo.targetPosition = %%-input-target-position-%% * since: v1.18 +### option: Locator.dragTo.steps = %%-input-drag-steps-%% +* since: v1.57 + ## async method: Locator.elementHandle * since: v1.14 * discouraged: Always prefer using [Locator]s and web assertions over [ElementHandle]s because latter are inherently racy. diff --git a/docs/src/api/class-mouse.md b/docs/src/api/class-mouse.md index 1897482bac..179677db57 100644 --- a/docs/src/api/class-mouse.md +++ b/docs/src/api/class-mouse.md @@ -143,11 +143,8 @@ X coordinate relative to the main frame's viewport in CSS pixels. Y coordinate relative to the main frame's viewport in CSS pixels. -### option: Mouse.move.steps +### option: Mouse.move.steps = %%-input-mousemove-steps-%% * since: v1.8 -- `steps` <[int]> - -Defaults to 1. Sends intermediate `mousemove` events. ## async method: Mouse.up * since: v1.8 diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md index c45b55a32f..717cbf06cb 100644 --- a/docs/src/api/class-page.md +++ b/docs/src/api/class-page.md @@ -557,13 +557,6 @@ Emitted when [WebSocket] request is sent. Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the page. -## property: Page.accessibility -* since: v1.8 -* langs: csharp, js, python -* deprecated: This property is discouraged. Please use other libraries such as - [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe. -- type: <[Accessibility]> - ## async method: Page.addInitScript * since: v1.8 @@ -1109,6 +1102,9 @@ await Page.DragAndDropAsync("#source", "#target", new() ### option: Page.dragAndDrop.targetPosition = %%-input-target-position-%% * since: v1.14 +### option: Page.dragAndDrop.steps = %%-input-drag-steps-%% +* since: v1.57 + ## async method: Page.emulateMedia * since: v1.8 diff --git a/docs/src/api/class-worker.md b/docs/src/api/class-worker.md index fe69a84248..bd41abc1cd 100644 --- a/docs/src/api/class-worker.md +++ b/docs/src/api/class-worker.md @@ -58,6 +58,12 @@ foreach(var pageWorker in page.Workers) Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is terminated. +## event: Worker.console +* since: v1.57 +- argument: <[ConsoleMessage]> + +Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`. + ## async method: Worker.evaluate * since: v1.8 - returns: <[Serializable]> @@ -123,3 +129,58 @@ Performs action and waits for the Worker to close. ### param: Worker.waitForClose.callback = %%-java-wait-for-event-callback-%% * since: v1.9 + +## async method: Worker.waitForEvent +* since: v1.57 +* langs: js, python + - alias-python: expect_event +- returns: <[any]> + +Waits for event to fire and passes its value into the predicate function. +Returns when the predicate returns truthy value. +Will throw an error if the page is closed before the event is fired. +Returns the event data value. + +**Usage** + +```js +// Start waiting for download before clicking. Note no await. +const consolePromise = worker.waitForEvent('console'); +await worker.evaluate('console.log(42)'); +const consoleMessage = await consolePromise; +``` + +```python async +async with worker.expect_event("console") as event_info: + await worker.evaluate("console.log(42)") +message = await event_info.value +``` + +```python sync +with worker.expect_event("console") as event_info: + worker.evaluate("console.log(42)") +message = event_info.value +``` + +## async method: Worker.waitForEvent +* since: v1.57 +* langs: python +- returns: <[EventContextManager]> + +### param: Worker.waitForEvent.event = %%-wait-for-event-event-%% +* since: v1.57 + +### param: Worker.waitForEvent.optionsOrPredicate +* since: v1.57 +* langs: js +- `optionsOrPredicate` ?<[function]|[Object]> + - `predicate` <[function]> Receives the event data and resolves to truthy value when the waiting should resolve. + - `timeout` ?<[float]> Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods. + +Either a predicate that receives an event or an options object. Optional. + +### option: Worker.waitForEvent.predicate = %%-wait-for-event-predicate-%% +* since: v1.57 + +### option: Worker.waitForEvent.timeout = %%-wait-for-event-timeout-%% +* since: v1.57 diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 993b8bc296..37f6665a93 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -103,6 +103,16 @@ A selector to search for an element to drop onto. If there are multiple elements A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element. +## input-mousemove-steps +- `steps` <[int]> + +Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location. + +## input-drag-steps +- `steps` <[int]> + +Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location. + ## input-modifiers - `modifiers` <[Array]<[KeyboardModifier]<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">>> diff --git a/docs/src/ci.md b/docs/src/ci.md index 31615c0f2d..585295b8d9 100644 --- a/docs/src/ci.md +++ b/docs/src/ci.md @@ -83,7 +83,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: lts/* - name: Install dependencies @@ -92,7 +92,7 @@ jobs: run: npx playwright install --with-deps - name: Run Playwright tests run: npx playwright test - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 if: ${{ !cancelled() }} with: name: playwright-report @@ -130,7 +130,7 @@ jobs: run: python -m playwright install --with-deps - name: Run your tests run: pytest --tracing=retain-on-failure - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 if: ${{ !cancelled() }} with: name: playwright-traces @@ -212,7 +212,7 @@ jobs: options: --user 1001 steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: lts/* - name: Install dependencies @@ -317,7 +317,7 @@ jobs: if: github.event.deployment_status.state == 'success' steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: lts/* - name: Install dependencies @@ -432,7 +432,7 @@ jobs: # Force a non-shallow checkout, so that we can reference $GITHUB_BASE_REF. # See https://github.com/actions/checkout for more details. fetch-depth: 0 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: lts/* - name: Install dependencies @@ -444,7 +444,7 @@ jobs: if: github.event_name == 'pull_request' - name: Run Playwright tests run: npx playwright test - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 if: ${{ !cancelled() }} with: name: playwright-report diff --git a/docs/src/codegen.md b/docs/src/codegen.md index 7f2358bdaa..8cafd449c5 100644 --- a/docs/src/codegen.md +++ b/docs/src/codegen.md @@ -59,7 +59,7 @@ In the test file in VS Code you will see your new generated actions added to you ### Generating locators You can generate locators with the test generator. -- Click on the **Pick locator** button form the testing sidebar and then hover over elements in the browser window to see the [locator](./locators.md) highlighted underneath each element. +- Click on the **Pick locator** button from the testing sidebar and then hover over elements in the browser window to see the [locator](./locators.md) highlighted underneath each element. - Click the element you require and it will now show up in the **Pick locator** box in VS Code. - Press Enter on your keyboard to copy the locator into the clipboard and then paste anywhere in your code. Or press 'escape' if you want to cancel. diff --git a/docs/src/images/cft-logo-change.png b/docs/src/images/cft-logo-change.png new file mode 100644 index 0000000000..89c5695e29 Binary files /dev/null and b/docs/src/images/cft-logo-change.png differ diff --git a/docs/src/images/speedboard.png b/docs/src/images/speedboard.png new file mode 100644 index 0000000000..e6fa26ab61 Binary files /dev/null and b/docs/src/images/speedboard.png differ diff --git a/docs/src/intro-js.md b/docs/src/intro-js.md index 33827ae864..68c0a649ee 100644 --- a/docs/src/intro-js.md +++ b/docs/src/intro-js.md @@ -79,13 +79,11 @@ package.json package-lock.json # Or yarn.lock / pnpm-lock.yaml tests/ example.spec.ts # Minimal example test -tests-examples/ - demo-todo-app.spec.ts # Richer example tests ``` The [playwright.config](./test-configuration.md) centralizes configuration: target browsers, timeouts, retries, projects, reporters and more. In existing projects dependencies are added to your current `package.json`. -`tests/` contains a minimal starter test. `tests-examples/` provides richer samples (e.g. a todo app) to explore patterns. +`tests/` contains a minimal starter test. ## Running the Example Test diff --git a/docs/src/network.md b/docs/src/network.md index 6d0c676d6e..7ee76e8c71 100644 --- a/docs/src/network.md +++ b/docs/src/network.md @@ -769,6 +769,11 @@ page.WebSocket += (_, ws) => Playwright's built-in [`method: BrowserContext.route`] and [`method: Page.route`] allow your tests to natively route requests and perform mocking and interception. -1. If you're using Playwright's native [`method: BrowserContext.route`] and [`method: Page.route`], and it appears network events are missing, disable Service Workers by setting [`option: Browser.newContext.serviceWorkers`] to `'block'`. -1. It might be that you are using a mock tool such as Mock Service Worker (MSW). While this tool works out of the box for mocking responses, it adds its own Service Worker that takes over the network requests, hence making them invisible to [`method: BrowserContext.route`] and [`method: Page.route`]. If you are interested in both network testing and mocking, consider using built-in [`method: BrowserContext.route`] and [`method: Page.route`] for [response mocking](#handle-requests). -1. If you're interested in not solely using Service Workers for testing and network mocking, but in routing and listening for requests made by Service Workers themselves, please see [this experimental feature](https://github.com/microsoft/playwright/issues/15684). +If you're using Playwright's native [`method: BrowserContext.route`] and [`method: Page.route`], and it appears network events are missing, disable Service Workers by setting [`option: Browser.newContext.serviceWorkers`] to `'block'`. + +It might be that you are using a mock tool such as Mock Service Worker (MSW). While this tool works out of the box for mocking responses, it adds its own Service Worker that takes over the network requests, hence making them invisible to [`method: BrowserContext.route`] and [`method: Page.route`]. If you are interested in both network testing and mocking, consider using built-in [`method: BrowserContext.route`] and [`method: Page.route`] for [response mocking](#handle-requests). + +###### +* langs: js + +If you're interested in not solely using Service Workers for testing and network mocking, but in routing and listening for requests made by Service Workers themselves, please see [this guide](./service-workers.md). diff --git a/docs/src/release-notes-csharp.md b/docs/src/release-notes-csharp.md index f954e68cff..099ccd0d73 100644 --- a/docs/src/release-notes-csharp.md +++ b/docs/src/release-notes-csharp.md @@ -4,6 +4,27 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.56 + +### New APIs + +- New methods [`method: Page.consoleMessages`] and [`method: Page.pageErrors`] for retrieving the most recent console messages from the page +- New method [`method: Page.requests`] for retrieving the most recent network requests from the page + +### Breaking Changes + +- Event [`event: BrowserContext.backgroundPage`] has been deprecated and will not be emitted. Method [`method: BrowserContext.backgroundPages`] will return an empty list + +### Miscellaneous + +- Aria snapshots render and compare `input` `placeholder` + +### Browser Versions + +- Chromium 141.0.7390.37 +- Mozilla Firefox 142.0.1 +- WebKit 26.0 + ## Version 1.55 ### Codegen diff --git a/docs/src/release-notes-java.md b/docs/src/release-notes-java.md index ed8d74746a..b8f877419a 100644 --- a/docs/src/release-notes-java.md +++ b/docs/src/release-notes-java.md @@ -4,6 +4,27 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.56 + +### New APIs + +- New methods [`method: Page.consoleMessages`] and [`method: Page.pageErrors`] for retrieving the most recent console messages from the page +- New method [`method: Page.requests`] for retrieving the most recent network requests from the page + +### Breaking Changes + +- Event [`event: BrowserContext.backgroundPage`] has been deprecated and will not be emitted. Method [`method: BrowserContext.backgroundPages`] will return an empty list + +### Miscellaneous + +- Aria snapshots render and compare `input` `placeholder` + +### Browser Versions + +- Chromium 141.0.7390.37 +- Mozilla Firefox 142.0.1 +- WebKit 26.0 + ## Version 1.55 ### Codegen diff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.md index 39f494d2b4..af898272a2 100644 --- a/docs/src/release-notes-js.md +++ b/docs/src/release-notes-js.md @@ -6,16 +6,90 @@ toc_max_heading_level: 2 import LiteYouTube from '@site/src/components/LiteYouTube'; +## Version 1.57 + +### Speedboard + +In HTML reporter, there's a new tab we call "Speedboard": + +![Speedboard](./images/speedboard.png) + +It shows you all your executed tests sorted by slowness, +and can help you understand where your test suite is taking longer than expected. +Take a look at yours - maybe you'll find some tests that are spending a longer time waiting than they should! + +### Chrome for Testing + +Starting with this release, Playwright switches from Chromium, to using [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) builds. Both headed and headless browsers are subject to this. Your tests should still be passing after upgrading to Playwright 1.57. + +We're expecting no functional changes to come from this switch. The biggest change is the new icon and title in your toolbar. + +![new and old logo](./images/cft-logo-change.png) + +If you still see an unexpected behaviour change, please [file an issue](https://github.com/microsoft/playwright/issues/new). + +On Arm64 Linux, Playwright continues to use Chromium. + +### Waiting for webserver output + +[`property: TestConfig.webServer`] added a `wait` field. Pass a regular expression, and Playwright will wait until the webserver logs match it. + +```js +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + webServer: { + command: 'npm run start', + wait: { + stdout: '/Listening on port (?\\d+)/' + }, + }, +}); +``` + +If you include a named capture group into the expression, then Playwright will provide the capture group contents via environment variables: + +```js +import { test, expect } from '@playwright/test'; + +test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` }); + +test('homepage', async ({ page }) => { + await page.goto('/'); +}); +``` + +This is not just useful for capturing varying ports of dev servers. You can also use it to wait for readiness of a service that doesn't expose an HTTP readiness check, but instead prints a readiness message to stdout or stderr. + +### Breaking Change + +After 3 years of being deprecated, we removed `Page#accessibility` from our API. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe. + +### New APIs + +- New property [`property: TestConfig.tag`] adds a tag to all tests in this run. This is useful when using [merge-reports](./test-sharding.md#merging-reports-from-multiple-shards). +- [`event: Worker.console`] event is emitted when JavaScript within the worker calls one of console API methods, e.g. console.log or console.dir. [`method: Worker.waitForEvent`] can be used to wait for it. +- [`method: Locator.description`] returns locator description previously set with [`method: Locator.describe`], and `Locator.toString()` now uses the description when available. +- New option [`option: Locator.click.steps`] in [`method: Locator.click`] and [`method: Locator.dragTo`] that configures the number of `mousemove` events emitted while moving the mouse pointer to the target element. +- Network requests issued by [Service Workers](./service-workers.md#network-events-and-routing) are now reported and can be routed through the [BrowserContext](./api/class-browsercontext.md), only in Chromium. You can opt out using the `PLAYWRIGHT_DISABLE_SERVICE_WORKER_NETWORK` environment variable. +- Console messages from Service Workers are dispatched through [`event: Worker.console`]. You can opt out of this using the `PLAYWRIGHT_DISABLE_SERVICE_WORKER_CONSOLE` environment variable. + +### Browser Versions + +- Chromium 143.0.7499.4 +- Mozilla Firefox 142.0.1 +- WebKit 26.0 + ## Version 1.56 -### Playwright Agents +### Playwright Test Agents -Introducing Playwright Agents, three custom agent definitions designed to guide LLMs through the core process of building a Playwright test: +Introducing Playwright Test Agents, three custom agent definitions designed to guide LLMs through the core process of building a Playwright test: * **🎭 planner** explores the app and produces a Markdown test plan @@ -35,7 +109,7 @@ npx playwright init-agents --loop=claude npx playwright init-agents --loop=opencode ``` -[Learn more about Playwright Agents](./test-agents.md) +[Learn more about Playwright Test Agents](./test-agents.md) ### New APIs diff --git a/docs/src/release-notes-python.md b/docs/src/release-notes-python.md index 0ecd8eb89e..5c5359b352 100644 --- a/docs/src/release-notes-python.md +++ b/docs/src/release-notes-python.md @@ -4,6 +4,27 @@ title: "Release notes" toc_max_heading_level: 2 --- +## Version 1.56 + +### New APIs + +- New methods [`method: Page.consoleMessages`] and [`method: Page.pageErrors`] for retrieving the most recent console messages from the page +- New method [`method: Page.requests`] for retrieving the most recent network requests from the page + +### Breaking Changes + +- Event [`event: BrowserContext.backgroundPage`] has been deprecated and will not be emitted. Method [`method: BrowserContext.backgroundPages`] will return an empty list + +### Miscellaneous + +- Aria snapshots render and compare `input` `placeholder` + +### Browser Versions + +- Chromium 141.0.7390.37 +- Mozilla Firefox 142.0.1 +- WebKit 26.0 + ## Version 1.55 ### Codegen diff --git a/docs/src/service-workers-experimental-network-events-js.md b/docs/src/service-workers-experimental-network-events-js.md deleted file mode 100644 index 43f32d7e61..0000000000 --- a/docs/src/service-workers-experimental-network-events-js.md +++ /dev/null @@ -1,235 +0,0 @@ ---- -id: service-workers-experimental -title: "(Experimental) Service Worker Network Events" ---- - -## Introduction - -:::warning -If you're looking to do general network mocking, routing, and interception, please see the [Network Guide](./network.md) first. Playwright provides built-in APIs for this use case that don't require the information below. However, if you're interested in requests made by Service Workers themselves, please read below. -::: - -[Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) provide a browser-native method of handling requests made by a page with the native [Fetch API (`fetch`)](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) along with other network-requested assets (like scripts, css, and images). - -They can act as a **network proxy** between the page and the external network to perform caching logic or can provide users with an offline experience if the Service Worker adds a [FetchEvent](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent#examples) listener. - -Many sites that use Service Workers simply use them as a transparent optimization technique. While users might notice a faster experience, the app's implementation is unaware of their existence. Running the app with or without Service Workers enabled appears functionally equivalent. - -## How to Enable - -Playwright's inspection and routing of requests made by Service Workers are **experimental** and disabled by default. - -Set the `PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS` environment variable to `1` (or any other value) to enable the feature. Only Chrome/Chromium are currently supported. - -If you're using (or are interested in using this feature), please comment on [this issue](https://github.com/microsoft/playwright/issues/15684) letting us know your use case. - -## Service Worker Fetch - -### Accessing Service Workers and Waiting for Activation - -You can use [`method: BrowserContext.serviceWorkers`] to list the Service [Worker]s, or specifically watch for the Service [Worker] if you anticipate a page will trigger its [registration](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register): - -```js -const serviceWorkerPromise = context.waitForEvent('serviceworker'); -await page.goto('/example-with-a-service-worker.html'); -const serviceworker = await serviceWorkerPromise; -``` - -[`event: BrowserContext.serviceWorker`] is fired ***before*** the Service Worker's main script has been evaluated, so ***before*** calling service[`method: Worker.evaluate`] you should wait on its activation. - -There are more idiomatic methods of waiting for a Service Worker to be activated, but the following is an implementation agnostic method: - -```js -await page.evaluate(async () => { - const registration = await window.navigator.serviceWorker.getRegistration(); - if (registration.active?.state === 'activated') - return; - await new Promise(res => - window.navigator.serviceWorker.addEventListener('controllerchange', res), - ); -}); -``` - -### Network Events and Routing - -Any network request made by the **Service Worker** will have: - -* [`event: BrowserContext.request`] and its corresponding events ([`event: BrowserContext.requestFinished`] and [`event: BrowserContext.response`], or [`event: BrowserContext.requestFailed`]) -* [`method: BrowserContext.route`] will see the request -* [`method: Request.serviceWorker`] will be set to the Service [Worker] instance, and [`method: Request.frame`] will **throw** -* [`method: Response.fromServiceWorker`] will return `false` - -Additionally, any network request made by the **Page** (including its sub-[Frame]s) will have: - -* [`event: BrowserContext.request`] and its corresponding events ([`event: BrowserContext.requestFinished`] and [`event: BrowserContext.response`], or [`event: BrowserContext.requestFailed`]) -* [`event: Page.request`] and its corresponding events ([`event: Page.requestFinished`] and [`event: Page.response`], or [`event: Page.requestFailed`]) -* [`method: Page.route`] and [`method: Page.route`] will **not** see the request (if a Service Worker's fetch handler was registered) -* [`method: Request.serviceWorker`] will be set to `null`, and [`method: Request.frame`] will return the [Frame] -* [`method: Response.fromServiceWorker`] will return `true` (if a Service Worker's fetch handler was registered) - -Many Service Worker implementations simply execute the request from the page (possibly with some custom caching/offline logic omitted for simplicity): - -```js title="transparent-service-worker.js" -self.addEventListener('fetch', event => { - // actually make the request - const responsePromise = fetch(event.request); - // send it back to the page - event.respondWith(responsePromise); -}); - -self.addEventListener('activate', event => { - event.waitUntil(clients.claim()); -}); -``` - -If a page registers the above Service Worker: - -```html - - -``` - -On the first visit to the page via [`method: Page.goto`], the following Request/Response events would be emitted (along with the corresponding network lifecycle events): - -| Event | Owner | URL | Routed | [`method: Response.fromServiceWorker`] | -| - | - | - | - | - | -| [`event: BrowserContext.request`] | [Frame] | index.html | Yes | | -| [`event: Page.request`] | [Frame] | index.html | Yes | | -| [`event: BrowserContext.request`] | Service [Worker] | transparent-service-worker.js | Yes | | -| [`event: BrowserContext.request`] | Service [Worker] | data.json | Yes | | -| [`event: BrowserContext.request`] | [Frame] | data.json | | Yes | -| [`event: Page.request`] | [Frame] | data.json | | Yes | - - - -Since the example Service Worker just acts a basic transparent "proxy": - -* There's 2 [`event: BrowserContext.request`] events for `data.json`; one [Frame]-owned, the other Service [Worker]-owned. -* Only the Service [Worker]-owned request for the resource was routable via [`method: BrowserContext.route`]; the [Frame]-owned events for `data.json` are not routeable, as they would not have even had the possibility to hit the external network since the Service Worker has a fetch handler registered. - -:::caution -It's important to note: calling [`method: Request.frame`] or [`method: Response.frame`] will **throw** an exception, if called on a [Request]/[Response] that has a non-null [`method: Request.serviceWorker`]. -::: - - -#### Advanced Example - -When a Service Worker handles a page's request, the Service Worker can make 0 to n requests to the external network. The Service Worker might respond directly from a cache, generate a response in memory, rewrite the request, make two requests and then combine into 1, etc. - -Consider the code snippets below to understand Playwright's view into the Request/Responses and how it impacts routing in some of these cases. - - -```js title="complex-service-worker.js" -self.addEventListener('install', function(event) { - event.waitUntil( - caches.open('v1').then(function(cache) { - // 1. Pre-fetches and caches /addressbook.json - return cache.add('/addressbook.json'); - }) - ); -}); - -// Opt to handle FetchEvent's from the page -self.addEventListener('fetch', event => { - event.respondWith( - (async () => { - // 1. Try to first serve directly from caches - const response = await caches.match(event.request); - if (response) - return response; - - // 2. Re-write request for /foo to /bar - if (event.request.url.endsWith('foo')) - return fetch('./bar'); - - // 3. Prevent tracker.js from being retrieved, and returns a placeholder response - if (event.request.url.endsWith('tracker.js')) { - return new Response('console.log("no trackers!")', { - status: 200, - headers: { 'Content-Type': 'text/javascript' }, - }); - } - - // 4. Otherwise, fallthrough, perform the fetch and respond - return fetch(event.request); - })() - ); -}); - -self.addEventListener('activate', event => { - event.waitUntil(clients.claim()); -}); -``` - -And a page that simply registers the Service Worker: - -```html - - -``` - -On the first visit to the page via [`method: Page.goto`], the following Request/Response events would be emitted: - -| Event | Owner | URL | Routed | [`method: Response.fromServiceWorker`] | -| - | - | - | - | - | -| [`event: BrowserContext.request`] | [Frame] | index.html | Yes | | -| [`event: Page.request`] | [Frame] | index.html | Yes | | -| [`event: BrowserContext.request`] | Service [Worker] | complex-service-worker.js | Yes | | -| [`event: BrowserContext.request`] | Service [Worker] | addressbook.json | Yes | | - -It's important to note that [`cache.add`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/add) caused the Service Worker to make a request (Service [Worker]-owned), even before `addressbook.json` was asked for in the page. - -Once the Service Worker is activated and handling FetchEvents, if the page makes the following requests: - -```js -await page.evaluate(() => fetch('/addressbook.json')); -await page.evaluate(() => fetch('/foo')); -await page.evaluate(() => fetch('/tracker.js')); -await page.evaluate(() => fetch('/fallthrough.txt')); -``` - -The following Request/Response events would be emitted: - -| Event | Owner | URL | Routed | [`method: Response.fromServiceWorker`] | -| - | - | - | - | - | -| [`event: BrowserContext.request`] | [Frame] | addressbook.json | | Yes | -| [`event: Page.request`] | [Frame] | addressbook.json | | Yes | -| [`event: BrowserContext.request`] | Service [Worker] | bar | Yes | | -| [`event: BrowserContext.request`] | [Frame] | foo | | Yes | -| [`event: Page.request`] | [Frame] | foo | | Yes | -| [`event: BrowserContext.request`] | [Frame] | tracker.js | | Yes | -| [`event: Page.request`] | [Frame] | tracker.js | | Yes | -| [`event: BrowserContext.request`] | Service [Worker] | fallthrough.txt | Yes | | -| [`event: BrowserContext.request`] | [Frame] | fallthrough.txt | | Yes | -| [`event: Page.request`] | [Frame] | fallthrough.txt | | Yes | - -It's important to note: - -* The page requested `/foo`, but the Service Worker requested `/bar`, so there are only [Frame]-owned events for `/foo`, but not `/bar`. -* Likewise, the Service Worker never hit the network for `tracker.js`, so only [Frame]-owned events were emitted for that request. - -## Routing Service Worker Requests Only - -```js -await context.route('**', async route => { - if (route.request().serviceWorker()) { - // NB: calling route.request().frame() here would THROW - return route.fulfill({ - contentType: 'text/plain', - status: 200, - body: 'from sw', - }); - } else { - return route.continue(); - } -}); -``` - -## Known Limitations - -Requests for updated Service Worker main script code currently cannot be routed (https://github.com/microsoft/playwright/issues/14711). - diff --git a/docs/src/service-workers-js.md b/docs/src/service-workers-js.md new file mode 100644 index 0000000000..4db2e32a35 --- /dev/null +++ b/docs/src/service-workers-js.md @@ -0,0 +1,132 @@ +--- +id: service-workers +title: "Service Workers" +--- + +## Introduction + +:::warning +Service workers are only supported on Chromium-based browsers. +::: + + +:::note +If you're looking to do general network mocking, routing, and interception, please see the [Network Guide](./network.md) first. Playwright provides built-in APIs for this use case that don't require the information below. However, if you're interested in requests made by Service Workers themselves, please read below. +::: + +[Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) provide a browser-native method of handling requests made by a page with the native [Fetch API (`fetch`)](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) along with other network-requested assets (like scripts, css, and images). + +They can act as a **network proxy** between the page and the external network to perform caching logic or can provide users with an offline experience if the Service Worker adds a [FetchEvent](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent#examples) listener. + +Many sites that use Service Workers simply use them as a transparent optimization technique. While users might notice a faster experience, the app's implementation is unaware of their existence. Running the app with or without Service Workers enabled appears functionally equivalent. + +## How to Disable Service Workers + +Playwright allows to disable Service Workers during testing. This makes tests more predictable and performant. However, if your actual page uses a Service Worker, the behavior might be different. + +To disable service workers, set [`property: TestOptions.serviceWorkers`] to `'block'`. + +```js title="playwright.config.ts" +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + use: { + serviceWorkers: 'allow' + }, +}); +``` + +## Accessing Service Workers and Waiting for Activation + +You can use [`method: BrowserContext.serviceWorkers`] to list the Service [Worker]s, or specifically watch for the Service [Worker] if you anticipate a page will trigger its [registration](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register): + +```js +const serviceWorkerPromise = context.waitForEvent('serviceworker'); +await page.goto('/example-with-a-service-worker.html'); +const serviceworker = await serviceWorkerPromise; +``` + +[`event: BrowserContext.serviceWorker`] event is fired ***before*** the Service Worker has taken control over the page, so ***before*** evaluating in the worker with [`method: Worker.evaluate`] you should wait on its activation. + +There are more idiomatic methods of waiting for a Service Worker to be activated, but the following is an implementation agnostic method: + +```js +await page.evaluate(async () => { + const registration = await window.navigator.serviceWorker.getRegistration(); + if (registration.active?.state === 'activated') + return; + await new Promise(resolve => { + window.navigator.serviceWorker.addEventListener('controllerchange', resolve); + }); +}); +``` + +## Network Events and Routing + +Any network request made by the **Service Worker** is reported through the [BrowserContext] object: + +* [`event: BrowserContext.request`], [`event: BrowserContext.requestFinished`], [`event: BrowserContext.response`] and [`event: BrowserContext.requestFailed`] are fired +* [`method: BrowserContext.route`] sees the request +* [`method: Request.serviceWorker`] will be set to the Service [Worker] instance, and [`method: Request.frame`] will **throw** + +Additionally, for any network request made by the **Page**, method [`method: Response.fromServiceWorker`] return `true` when the request was handled a Service Worker's fetch handler. + +Consider a simple service worker that fetches every request made by the page: + +```js title="transparent-service-worker.js" +self.addEventListener('fetch', event => { + // actually make the request + const responsePromise = fetch(event.request); + // send it back to the page + event.respondWith(responsePromise); +}); + +self.addEventListener('activate', event => { + event.waitUntil(clients.claim()); +}); +``` + +If `index.html` registers this service worker, and then fetches `data.json`, the following Request/Response events would be emitted (along with the corresponding network lifecycle events): + +| Event | Owner | URL | Routed | [`method: Response.fromServiceWorker`] | +| - | - | - | - | - | +| [`event: BrowserContext.request`] | [Frame] | index.html | Yes | | +| [`event: Page.request`] | [Frame] | index.html | Yes | | +| [`event: BrowserContext.request`] | Service [Worker] | transparent-service-worker.js | Yes | | +| [`event: BrowserContext.request`] | Service [Worker] | data.json | Yes | | +| [`event: BrowserContext.request`] | [Frame] | data.json | | Yes | +| [`event: Page.request`] | [Frame] | data.json | | Yes | + + + +Since the example Service Worker just acts a basic transparent "proxy": + +* There's 2 [`event: BrowserContext.request`] events for `data.json`; one [Frame]-owned, the other Service [Worker]-owned. +* Only the Service [Worker]-owned request for the resource was routable via [`method: BrowserContext.route`]; the [Frame]-owned events for `data.json` are not routeable, as they would not have even had the possibility to hit the external network since the Service Worker has a fetch handler registered. + +:::caution +It's important to note: calling [`method: Request.frame`] or [`method: Response.frame`] will **throw** an exception, if called on a [Request]/[Response] that has a non-null [`method: Request.serviceWorker`]. +::: + + +## Routing Service Worker Requests Only + +```js +await context.route('**', async route => { + if (route.request().serviceWorker()) { + // NB: calling route.request().frame() here would THROW + await route.fulfill({ + contentType: 'text/plain', + status: 200, + body: 'from sw', + }); + } else { + await route.continue(); + } +}); +``` + +## Known Limitations + +Requests for updated Service Worker main script code currently cannot be routed (https://github.com/microsoft/playwright/issues/14711). + diff --git a/docs/src/test-agents-js.md b/docs/src/test-agents-js.md index b608ab7909..727fcea3bd 100644 --- a/docs/src/test-agents-js.md +++ b/docs/src/test-agents-js.md @@ -3,9 +3,13 @@ id: test-agents title: "Agents" --- -# Playwright Agents +import LiteYouTube from '@site/src/components/LiteYouTube'; -Playwright comes with three Playwright Agents out of the box: **🎭 planner**, **🎭 generator** and **🎭 healer**. +# Playwright Test Agents + +## Introduction + +Playwright comes with three Playwright Test Agents out of the box: **🎭 planner**, **🎭 generator** and **🎭 healer**. These agents can be used independently, sequentially, or as the chained calls in the agentic loop. Using them sequentially will produce test coverage for your product. @@ -16,9 +20,14 @@ Using them sequentially will produce test coverage for your product. * **🎭 healer** executes the test suite and automatically repairs failing tests + + ### Getting Started -Start with adding Playwright Agent definitions to your project using +Start with adding Playwright Test Agent definitions to your project using the `init-agents` command. These definitions should be regenerated whenever Playwright is updated to pick up new tools and instructions. @@ -34,6 +43,10 @@ npx playwright init-agents --loop=claude npx playwright init-agents --loop=opencode ``` +:::note +VS Code v1.105 (released October 9, 2025) is needed for the agentic experience to function properly in VS Code. +::: + Once the agents have been generated, you can use your AI tool of choice to command these agents to build Playwright Tests. diff --git a/docs/src/test-api/class-fullconfig.md b/docs/src/test-api/class-fullconfig.md index edbc991bfd..7ce3da974b 100644 --- a/docs/src/test-api/class-fullconfig.md +++ b/docs/src/test-api/class-fullconfig.md @@ -112,6 +112,12 @@ Base directory for all relative paths used in the reporters. See [`property: TestConfig.shard`]. +## property: FullConfig.tags +* since: v1.57 +- type: <[Array]<[string]>> + +Resolved global tags. See [`property: TestConfig.tag`]. + ## property: FullConfig.updateSnapshots * since: v1.10 - type: <[UpdateSnapshots]<"all"|"changed"|"missing"|"none">> diff --git a/docs/src/test-api/class-test.md b/docs/src/test-api/class-test.md index 977c9d83e5..990c49d873 100644 --- a/docs/src/test-api/class-test.md +++ b/docs/src/test-api/class-test.md @@ -1652,7 +1652,7 @@ function step(target: Function, context: ClassMethodDecoratorContext) { const name = this.constructor.name + '.' + (context.name as string); return test.step(name, async () => { return await target.call(this, ...args); - }); + }, { box: true }); }; } diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md index fddbe8e3dd..d8247126c7 100644 --- a/docs/src/test-api/class-testconfig.md +++ b/docs/src/test-api/class-testconfig.md @@ -456,7 +456,7 @@ The list of reporters to use. Each reporter can be: * A module name like `'my-awesome-reporter'`. * A relative path to the reporter like `'./reporters/my-awesome-reporter.js'`. -You can pass options to the reporter in a tuple like `['json', { outputFile: './report.json' }]`. +You can pass options to the reporter in a tuple like `['json', { outputFile: './report.json' }]`. If the property is not specified, Playwright uses the `'dot'` reporter when the CI environment variable is set, and the `'list'` reporter otherwise. Learn more in the [reporters guide](../test-reporters.md). @@ -535,6 +535,25 @@ export default defineConfig({ ``` +## property: TestConfig.tag +* since: v1.57 +- type: ?<[string]|[Array]<[string]>> + +Tag or tags prepended to each test in the report. Useful for tagging your test run to differentiate between [CI environments](../test-sharding.md#merging-reports-from-multiple-environments). + +Note that each tag must start with `@` symbol. Learn more about [tagging](../test-annotations.md#tag-tests). + +**Usage** + +```js title="playwright.config.ts" +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + tag: process.env.CI_ENVIRONMENT_NAME, // for example "@APIv2" +}); +``` + + ## property: TestConfig.testDir * since: v1.10 - type: ?<[string]> @@ -685,6 +704,9 @@ export default defineConfig({ - `reuseExistingServer` ?<[boolean]> If true, it will re-use an existing server on the `port` or `url` when available. If no server is running on that `port` or `url`, it will run the command to start a new server. If `false`, it will throw if an existing process is listening on the `port` or `url`. This should be commonly set to `!process.env.CI` to allow the local dev server when running tests locally. - `stderr` ?<["pipe"|"ignore"]> Whether to pipe the stderr of the command to the process stderr or ignore it. Defaults to `"pipe"`. - `stdout` ?<["pipe"|"ignore"]> If `"pipe"`, it will pipe the stdout of the command to the process stdout. If `"ignore"`, it will ignore the stdout of the command. Default to `"ignore"`. + - `wait` ?<[Object]> Consider command started only when given output has been produced. + - `stdout` ?<[RegExp]> Regular expression to wait for in the `stdout` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. + - `stderr` ?<[RegExp]> Regular expression to wait for in the `stderr` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. - `timeout` ?<[int]> How long to wait for the process to start up and be available in milliseconds. Defaults to 60000. - `url` ?<[string]> The url on your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. Redirects (3xx status codes) are being followed and the new location is checked. Either `port` or `url` should be specified. @@ -757,6 +779,31 @@ export default defineConfig({ }); ``` +If your webserver runs on varying ports, use `wait` to capture the port: + +```js +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + webServer: { + command: 'npm run start', + wait: { + stdout: '/Listening on port (?\\d+)/' + }, + }, +}); +``` + +```js +import { test, expect } from '@playwright/test'; + +test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` }); + +test('homepage', async ({ page }) => { + await page.goto('/'); +}); +``` + ## property: TestConfig.workers * since: v1.10 - type: ?<[int]|[string]> diff --git a/docs/src/test-assertions-js.md b/docs/src/test-assertions-js.md index 3efc0db5e5..c809dce782 100644 --- a/docs/src/test-assertions-js.md +++ b/docs/src/test-assertions-js.md @@ -91,13 +91,21 @@ Prefer [auto-retrying](#auto-retrying-assertions) assertions whenever possible. | [`method: GenericAssertions.toMatchObject`] | Object contains specified properties | | [`method: GenericAssertions.toStrictEqual`] | Value is similar, including property types | | [`method: GenericAssertions.toThrow`] | Function throws an error | -| [`method: GenericAssertions.any`] | Matches any instance of a class/primitive | -| [`method: GenericAssertions.anything`] | Matches anything | -| [`method: GenericAssertions.arrayContaining`] | Array contains specific elements | -| [`method: GenericAssertions.closeTo`] | Number is approximately equal | -| [`method: GenericAssertions.objectContaining`] | Object contains specific properties | -| [`method: GenericAssertions.stringContaining`] | String contains a substring | -| [`method: GenericAssertions.stringMatching`] | String matches a regular expression | + +## Asymmetric matchers + +These expressions can be nested in other assertions to allow more relaxed matching against a given condition. + +| Matcher | Description | +| :- | :- | +| [expect.any()](./api/class-genericassertions.md#generic-assertions-any) | Matches any instance of a class/primitive | +| [expect.anything()](./api/class-genericassertions.md#generic-assertions-anything) | Matches anything | +| [expect.arrayContaining()](./api/class-genericassertions.md#generic-assertions-array-containing) | Array contains specific elements | +| [expect.arrayOf()](./api/class-genericassertions.md#generic-assertions-array-of) | Array contains elements of specific type | +| [expect.closeTo()](./api/class-genericassertions.md#generic-assertions-close-to) | Number is approximately equal | +| [expect.objectContaining()](./api/class-genericassertions.md#generic-assertions-object-containing) | Object contains specific properties | +| [expect.stringContaining()](./api/class-genericassertions.md#generic-assertions-string-containing) | String contains a substring | +| [expect.stringMatching()](./api/class-genericassertions.md#generic-assertions-string-matching) | String matches a regular expression | ## Negating matchers diff --git a/docs/src/test-cli-js.md b/docs/src/test-cli-js.md index d45ee1d6a3..de9ff5ff33 100644 --- a/docs/src/test-cli-js.md +++ b/docs/src/test-cli-js.md @@ -254,12 +254,15 @@ Analyze and view test traces for debugging. [Read more about Trace Viewer](./tra #### Syntax ```bash -npx playwright show-trace [options] +npx playwright show-trace [options] [trace] ``` #### Examples ```bash +# Open trace viewer without a specific trace (can load traces via UI) +npx playwright show-trace + # View a trace file npx playwright show-trace trace.zip diff --git a/docs/src/test-reporter-api/class-reporter.md b/docs/src/test-reporter-api/class-reporter.md index 44a148ba35..cd6cf1e643 100644 --- a/docs/src/test-reporter-api/class-reporter.md +++ b/docs/src/test-reporter-api/class-reporter.md @@ -87,6 +87,11 @@ and [`method: Reporter.onError`] is called when something went wrong outside of If your custom reporter does not print anything to the terminal, implement [`method: Reporter.printsToStdio`] and return `false`. This way, Playwright will use one of the standard terminal reporters in addition to your custom reporter to enhance user experience. +**Reporter errors** + +Playwright will swallow any errors thrown in your custom reporter methods. If you need to detect or fail on reporter +errors, you must wrap and handle them yourself. + **Merged report API notes** When merging multiple [`blob`](../test-reporters#blob-reporter) reports via [`merge-reports`](../test-sharding#merge-reports-cli) CLI diff --git a/docs/src/test-reporters-js.md b/docs/src/test-reporters-js.md index 973cc1d641..45da71e19d 100644 --- a/docs/src/test-reporters-js.md +++ b/docs/src/test-reporters-js.md @@ -220,7 +220,7 @@ export default defineConfig({ }); ``` -If you are uploading attachments from data folder to other location, you can use `attachmentsBaseURL` option to let html report where to look for them. +If you are uploading attachments from a data folder to another location, you can use `attachmentsBaseURL` option to let html report know where to look for them. ```js title="playwright.config.ts" import { defineConfig } from '@playwright/test'; @@ -263,16 +263,50 @@ Blob reports contain all the details about the test run and can be used later to npx playwright test --reporter=blob ``` -By default, the report is written into the `blob-report` directory in the package.json directory or current working directory (if no package.json is found). The report file name looks like `report-.zip` or `report--.zip` when [sharding](./test-sharding.md) is used. The hash is an optional value computed from `--grep`, `--grepInverted`, `--project` and file filters passed as command line arguments. The hash guarantees that running Playwright with different command line options will produce different but stable between runs report names. The output file name can be overridden in the configuration file or pass as `'PLAYWRIGHT_BLOB_OUTPUT_FILE'` environment variable. +By default, the report is written into the `blob-report` directory in the package.json directory or current working directory (if no package.json is found). + +The report file name looks like `report-.zip` or `report--.zip` when [sharding](./test-sharding.md) is used. The hash is an optional value computed from `--grep`, `--grepInverted`, `--project`, [`property: TestConfig.tag`] and file filters passed as command line arguments. The hash guarantees that running Playwright with different command line options will produce different but stable between runs report names. The output file name can be overridden in the configuration file or passed as `'PLAYWRIGHT_BLOB_OUTPUT_FILE'` environment variable. + + + + + +When using blob report to merge multiple shards, you don't have to pass any options. + +```js title="playwright.config.ts" +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + reporter: 'blob', +}); +``` + + + + + +When running tests in different environments, you might want to use [`property: TestConfig.tag`] to add a global tag corresponding to the environment. This tag will bring clarity to the merged report, and it will be used to produce a unique blob report name. ```js title="playwright.config.ts" import { defineConfig } from '@playwright/test'; export default defineConfig({ - reporter: [['blob', { outputFile: `./blob-report/report-${os.platform()}.zip` }]], + reporter: 'blob', + tag: process.env.CI_ENVIRONMENT_NAME, // for example "@APIv2" or "@linux" }); ``` + + + + Blob report supports following configuration options and environment variables: | Environment Variable Name | Reporter Config Option| Description | Default diff --git a/docs/src/test-sharding-js.md b/docs/src/test-sharding-js.md index 31dc23bc09..f0722a9bd4 100644 --- a/docs/src/test-sharding-js.md +++ b/docs/src/test-sharding-js.md @@ -58,7 +58,7 @@ export default defineConfig({ }); ``` -Blob report contains information about all the tests that were run and their results as well as all test attachments such as traces and screenshot diffs. Blob reports can be merged and converted to any other Playwright report. By default, blob report will be generated into `blob-report` directory. +Blob report contains information about all the tests that were run and their results as well as all test attachments such as traces and screenshot diffs. Blob reports can be merged and converted to any other Playwright report. By default, blob report will be generated into `blob-report` directory. You can learn about [blob report options here](./test-reporters.md#blob-reporter). To merge reports from multiple shards, put the blob report files into a single directory, for example `all-blob-reports`. Blob report names contain shard number, so they will not clash. @@ -164,6 +164,22 @@ You can now see the reports have been merged and a combined HTML report is avail image +## Merging reports from multiple environments + +If you want to run the same tests in multiple environments, as opposed to shard your tests onto multiple machines, you need to differentiate these enviroments. + +In this case, it is useful to specify the [`property: TestConfig.tag`] property, to tag all tests with the environment name. This tag will be automatically picked up by the blob report and later on by the merge tool. + +```js title="playwright.config.ts" +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + reporter: process.env.CI ? 'blob' : 'html', + tag: process.env.CI_ENVIRONMENT_NAME, // for example "@APIv2" +}); +``` + + ## Merge-reports CLI `npx playwright merge-reports path/to/blob-reports-dir` reads all blob reports from the passed directory and merges them into a single report. diff --git a/docs/src/test-webserver-js.md b/docs/src/test-webserver-js.md index 65e1eecfda..3022691851 100644 --- a/docs/src/test-webserver-js.md +++ b/docs/src/test-webserver-js.md @@ -5,11 +5,11 @@ title: "Web server" ## Introduction -Playwright comes with a `webserver` option in the config file which gives you the ability to launch a local dev server before running your tests. This is ideal for when writing your tests during development and when you don't have a staging or production url to test against. +Playwright comes with a `webServer` option in the config file which gives you the ability to launch a local dev server before running your tests. This is ideal for when writing your tests during development and when you don't have a staging or production url to test against. ## Configuring a web server -Use the `webserver` property in your Playwright config to launch a development web server during the tests. +Use the `webServer` property in your Playwright config to launch a development web server during the tests. ```js title="playwright.config.ts" import { defineConfig } from '@playwright/test'; @@ -35,11 +35,13 @@ export default defineConfig({ | `gracefulShutdown` | How to shut down the process. If unspecified, the process group is forcefully `SIGKILL`ed. If set to `{ signal: 'SIGTERM', timeout: 500 }`, the process group is sent a `SIGTERM` signal, followed by `SIGKILL` if it doesn't exit within 500ms. You can also use `SIGINT` as the signal instead. A `0` timeout means no `SIGKILL` will be sent. Windows doesn't support `SIGTERM` and `SIGINT` signals, so this option is ignored on Windows. Note that shutting down a Docker container requires `SIGTERM`. | | `ignoreHTTPSErrors` | Whether to ignore HTTPS errors when fetching the `url`. Defaults to `false`. | | `name` | Specifies a custom name for the web server. This name will be prefixed to log messages. Defaults to `[WebServer]`. | -| `reuseExistingServer`| If `true`, it will re-use an existing server on the url when available. If no server is running on that url, it will run the command to start a new server. If `false`, it will throw if an existing process is listening on the url. To see the stdout, you can set the `DEBUG=pw:webserver` environment variable. | +| `port` | **Deprecated**. User `url` instead. The port that your http server is expected to appear on. It does wait until it accepts connections. Either `port` or `url` should be specified. | +| `reuseExistingServer`| If `true`, it will re-use an existing server on the `port` or `url` when available. If no server is running on that `port` or `url`, it will run the command to start a new server. If `false`, it will throw if an existing process is listening on the `port` or `url`. This should be commonly set to `!process.env.CI` to allow the local dev server when running tests locally. | | `stderr` | Whether to pipe the stderr of the command to the process stderr or ignore it. Defaults to `"pipe"`. | | `stdout` | If `"pipe"`, it will pipe the stdout of the command to the process stdout. If `"ignore"`, it will ignore the stdout of the command. Default to `"ignore"`. | | `timeout` | How long to wait for the process to start up and be available in milliseconds. Defaults to 60000. | -| `url`| URL of your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. | +| `url`| URL of your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. Either `port` or `url` should be specified. | +| `wait` | Consider command started only when given output has been produced. Takes an object with optional `stdout` and/or `stderr` regular expressions. Named capture groups in the regex are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. | ## Adding a server timeout diff --git a/docs/src/testing-library-js.md b/docs/src/testing-library-js.md index d7f7c05d82..bff0eb6162 100644 --- a/docs/src/testing-library-js.md +++ b/docs/src/testing-library-js.md @@ -119,7 +119,7 @@ You can create a locator inside another locator with [`method: Locator.locator`] ```js // Testing Library -const messages = document.getElementById('messages'); +const messages = screen.getByTestId('messages'); const helloMessage = within(messages).getByText('hello'); // Playwright diff --git a/docs/src/trace-viewer.md b/docs/src/trace-viewer.md index c597c16f6e..f7bb39eaa8 100644 --- a/docs/src/trace-viewer.md +++ b/docs/src/trace-viewer.md @@ -39,7 +39,7 @@ pwsh bin/Debug/netX/playwright.ps1 show-trace trace.zip ### Using [trace.playwright.dev](https://trace.playwright.dev) -[trace.playwright.dev](https://trace.playwright.dev) is a statically hosted variant of the Trace Viewer. You can upload trace files using drag and drop or via the `Select file(s)` button. +[trace.playwright.dev](https://trace.playwright.dev) is a statically hosted variant of the Trace Viewer. You can upload a trace file using drag and drop or via the `Select file` button. Trace Viewer loads the trace entirely in your browser and does not transmit any data externally. @@ -68,7 +68,7 @@ pwsh bin/Debug/netX/playwright.ps1 show-trace https://example.com/trace.zip When using [trace.playwright.dev](https://trace.playwright.dev), you can also pass the URL of your uploaded trace at some accessible storage (e.g. inside your CI) as a query parameter. CORS (Cross-Origin Resource Sharing) rules might apply. ```txt -https://trace.playwright.dev/?trace=https://demo.playwright.dev/reports/todomvc/data/fa874b0d59cdedec675521c21124e93161d66533.zip +https://trace.playwright.dev/?trace=https://demo.playwright.dev/reports/todomvc/data/e6099cadf79aa753d5500aa9508f9d1dbd87b5ee.zip ``` ## Recording a trace diff --git a/eslint.config.mjs b/eslint.config.mjs index e6b5669319..4b4cafa39f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -312,6 +312,13 @@ function reactPackageSection(packageName) { rules: { ...baseRules, "no-console": 2, + "no-restricted-syntax": [ + "error", + { + selector: "JSXElement > JSXText[value=/^;\n/]", + message: 'Unexpected semicolon after JSX element', + }, + ] }, }; } diff --git a/examples/todomvc/.claude/agents/playwright-test-generator.md b/examples/todomvc/.claude/agents/playwright-test-generator.md index b82e9bc3a1..0504c924c6 100644 --- a/examples/todomvc/.claude/agents/playwright-test-generator.md +++ b/examples/todomvc/.claude/agents/playwright-test-generator.md @@ -1,7 +1,7 @@ --- name: playwright-test-generator -description: Use this agent when you need to create automated browser tests using Playwright. Examples: Context: User wants to test a login flow on their web application. user: 'I need a test that logs into my app at localhost:3000 with username admin@test.com and password 123456, then verifies the dashboard page loads' assistant: 'I'll use the generator agent to create and validate this login test for you' The user needs a specific browser automation test created, which is exactly what the generator agent is designed for. Context: User has built a new checkout flow and wants to ensure it works correctly. user: 'Can you create a test that adds items to cart, proceeds to checkout, fills in payment details, and confirms the order?' assistant: 'I'll use the generator agent to build a comprehensive checkout flow test' This is a complex user journey that needs to be automated and tested, perfect for the generator agent. -tools: Glob, Grep, Read, mcp__playwright-test__browser_click, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_verify_element_visible, mcp__playwright-test__browser_verify_list_visible, mcp__playwright-test__browser_verify_text_visible, mcp__playwright-test__browser_verify_value, mcp__playwright-test__browser_wait_for, mcp__playwright-test__generator_read_log, mcp__playwright-test__generator_setup_page, mcp__playwright-test__generator_write_test +description: 'Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item. ' +tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_verify_element_visible, mcp__playwright-test__browser_verify_list_visible, mcp__playwright-test__browser_verify_text_visible, mcp__playwright-test__browser_verify_value, mcp__playwright-test__browser_wait_for, mcp__playwright-test__generator_read_log, mcp__playwright-test__generator_setup_page, mcp__playwright-test__generator_write_test model: sonnet color: blue --- diff --git a/examples/todomvc/.claude/agents/playwright-test-healer.md b/examples/todomvc/.claude/agents/playwright-test-healer.md index 61efa5a1f5..b66280f03c 100644 --- a/examples/todomvc/.claude/agents/playwright-test-healer.md +++ b/examples/todomvc/.claude/agents/playwright-test-healer.md @@ -1,7 +1,7 @@ --- name: playwright-test-healer -description: Use this agent when you need to debug and fix failing Playwright tests. Examples: Context: A developer has a failing Playwright test that needs to be debugged and fixed. user: 'The login test is failing, can you fix it?' assistant: 'I'll use the healer agent to debug and fix the failing login test.' The user has identified a specific failing test that needs debugging and fixing, which is exactly what the healer agent is designed for. Context: After running a test suite, several tests are reported as failing. user: 'Test user-registration.spec.ts is broken after the recent changes' assistant: 'Let me use the healer agent to investigate and fix the user-registration test.' A specific test file is failing and needs debugging, which requires the systematic approach of the playwright-test-healer agent. -tools: Glob, Grep, Read, Write, Edit, MultiEdit, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_generate_locator, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_snapshot, mcp__playwright-test__test_debug, mcp__playwright-test__test_list, mcp__playwright-test__test_run +description: Use this agent when you need to debug and fix failing Playwright tests +tools: Glob, Grep, Read, LS, Edit, MultiEdit, Write, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_generate_locator, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_snapshot, mcp__playwright-test__test_debug, mcp__playwright-test__test_list, mcp__playwright-test__test_run model: sonnet color: red --- @@ -11,8 +11,8 @@ resolving Playwright test failures. Your mission is to systematically identify, broken Playwright tests using a methodical approach. Your workflow: -1. **Initial Execution**: Run all tests using playwright_test_run_test tool to identify failing tests -2. **Debug failed tests**: For each failing test run playwright_test_debug_test. +1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests +2. **Debug failed tests**: For each failing test run `test_debug`. 3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to: - Examine the error details - Capture page snapshot to understand the context diff --git a/examples/todomvc/.claude/agents/playwright-test-planner.md b/examples/todomvc/.claude/agents/playwright-test-planner.md index 9e468a85d8..da10326eb9 100644 --- a/examples/todomvc/.claude/agents/playwright-test-planner.md +++ b/examples/todomvc/.claude/agents/playwright-test-planner.md @@ -1,7 +1,7 @@ --- name: playwright-test-planner -description: Use this agent when you need to create comprehensive test plan for a web application or website. Examples: Context: User wants to test a new e-commerce checkout flow. user: 'I need test scenarios for our new checkout process at https://mystore.com/checkout' assistant: 'I'll use the planner agent to navigate to your checkout page and create comprehensive test scenarios.' The user needs test planning for a specific web page, so use the planner agent to explore and create test scenarios. Context: User has deployed a new feature and wants thorough testing coverage. user: 'Can you help me test our new user dashboard at https://app.example.com/dashboard?' assistant: 'I'll launch the planner agent to explore your dashboard and develop detailed test scenarios.' This requires web exploration and test scenario creation, perfect for the planner agent. -tools: Glob, Grep, Read, Write, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page +description: Use this agent when you need to create comprehensive test plan for a web application or website +tools: Glob, Grep, Read, LS, Edit, MultiEdit, Write, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page model: sonnet color: green --- @@ -16,7 +16,7 @@ You will: - Invoke the `planner_setup_page` tool once to set up page before using any other tools - Explore the browser snapshot - Do not take screenshots unless absolutely necessary - - Use browser_* tools to navigate and discover interface + - Use `browser_*` tools to navigate and discover interface - Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality 2. **Analyze User Flows** @@ -45,6 +45,7 @@ You will: - Executive summary of the tested page/application - Individual scenarios as separate sections - Each scenario formatted with numbered steps + - Each test case with proposed file name for implementation - Clear expected results for verification @@ -69,6 +70,9 @@ application features: **Seed:** `tests/seed.spec.ts` #### 1.1 Add Valid Todo + +**File** `tests/adding-new-todos/add-valid-todo.spec.ts` + **Steps:** 1. Click in the "What needs to be done?" input field 2. Type "Buy groceries" diff --git a/examples/todomvc/.claude/prompts/playwright-test-coverage.md b/examples/todomvc/.claude/prompts/playwright-test-coverage.md new file mode 100644 index 0000000000..e5b6f26c22 --- /dev/null +++ b/examples/todomvc/.claude/prompts/playwright-test-coverage.md @@ -0,0 +1,31 @@ +--- +agent: default +description: Produce test coverage +--- + +Parameters: +- Task: the task to perform +- Seed file (optional): the seed file to use, defaults to `tests/seed.spec.ts` +- Test plan file (optional): the test plan file to write, under `specs/` folder. + +1. Call #playwright-test-planner subagent with prompt: + + + + + + + +2. For each test case from the test plan file (1.1, 1.2, ...), one after another, not in parallel, call #playwright-test-generator subagent with prompt: + + + + + + + + + +3. Call #playwright-test-healer subagent with prompt: + +Run all tests and fix the failing ones one after another. diff --git a/examples/todomvc/.claude/prompts/playwright-test-generate.md b/examples/todomvc/.claude/prompts/playwright-test-generate.md new file mode 100644 index 0000000000..335e9fd8ad --- /dev/null +++ b/examples/todomvc/.claude/prompts/playwright-test-generate.md @@ -0,0 +1,8 @@ +--- +agent: playwright-test-generator +description: Generate test plan +--- + +Generate tests for the test plan's bullet 1.1 Add item to card. + +Test plan: `specs/coverage.plan.md` diff --git a/examples/todomvc/.claude/prompts/playwright-test-heal.md b/examples/todomvc/.claude/prompts/playwright-test-heal.md new file mode 100644 index 0000000000..f1ca0c67f4 --- /dev/null +++ b/examples/todomvc/.claude/prompts/playwright-test-heal.md @@ -0,0 +1,6 @@ +--- +agent: playwright-test-healer +description: Fix tests +--- + +Run all my tests and fix the failing ones. diff --git a/examples/todomvc/.claude/prompts/playwright-test-plan.md b/examples/todomvc/.claude/prompts/playwright-test-plan.md new file mode 100644 index 0000000000..1c1f3a1871 --- /dev/null +++ b/examples/todomvc/.claude/prompts/playwright-test-plan.md @@ -0,0 +1,9 @@ +--- +agent: playwright-test-planner +description: Create test plan +--- + +Create test plan for "add to cart" functionality of my app. + +- Seed file: `tests/seed.spec.ts` +- Test plan: `specs/coverage.plan.md` diff --git "a/examples/todomvc/.github/chatmodes/\360\237\216\255 generator.chatmode.md" b/examples/todomvc/.github/agents/playwright-test-generator.agent.md similarity index 50% rename from "examples/todomvc/.github/chatmodes/\360\237\216\255 generator.chatmode.md" rename to examples/todomvc/.github/agents/playwright-test-generator.agent.md index 6ada1226f4..b3722976b5 100644 --- "a/examples/todomvc/.github/chatmodes/\360\237\216\255 generator.chatmode.md" +++ b/examples/todomvc/.github/agents/playwright-test-generator.agent.md @@ -1,6 +1,45 @@ --- -description: Use this agent when you need to create automated browser tests using Playwright. -tools: ['search/fileSearch', 'search/textSearch', 'search/listDirectory', 'search/readFile', 'playwright-test/browser_click', 'playwright-test/browser_drag', 'playwright-test/browser_evaluate', 'playwright-test/browser_file_upload', 'playwright-test/browser_handle_dialog', 'playwright-test/browser_hover', 'playwright-test/browser_navigate', 'playwright-test/browser_press_key', 'playwright-test/browser_select_option', 'playwright-test/browser_snapshot', 'playwright-test/browser_type', 'playwright-test/browser_verify_element_visible', 'playwright-test/browser_verify_list_visible', 'playwright-test/browser_verify_text_visible', 'playwright-test/browser_verify_value', 'playwright-test/browser_wait_for', 'playwright-test/generator_read_log', 'playwright-test/generator_setup_page', 'playwright-test/generator_write_test'] +name: playwright-test-generator +description: 'Use this agent when you need to create automated browser tests + using Playwright Examples: Context: User wants to generate a test for + the test plan item. + ' +tools: + - search + - playwright-test/browser_click + - playwright-test/browser_drag + - playwright-test/browser_evaluate + - playwright-test/browser_file_upload + - playwright-test/browser_handle_dialog + - playwright-test/browser_hover + - playwright-test/browser_navigate + - playwright-test/browser_press_key + - playwright-test/browser_select_option + - playwright-test/browser_snapshot + - playwright-test/browser_type + - playwright-test/browser_verify_element_visible + - playwright-test/browser_verify_list_visible + - playwright-test/browser_verify_text_visible + - playwright-test/browser_verify_value + - playwright-test/browser_wait_for + - playwright-test/generator_read_log + - playwright-test/generator_setup_page + - playwright-test/generator_write_test +model: Claude Sonnet 4 +mcp-servers: + playwright-test: + type: stdio + command: npx + args: + - playwright + - run-test-mcp-server + tools: + - "*" --- You are a Playwright Test Generator, an expert in browser automation and end-to-end testing. @@ -54,5 +93,3 @@ application behavior. }); ``` -Context: User wants to test a login flow on their web application. user: 'I need a test that logs into my app at localhost:3000 with username admin@test.com and password 123456, then verifies the dashboard page loads' assistant: 'I'll use the generator agent to create and validate this login test for you' The user needs a specific browser automation test created, which is exactly what the generator agent is designed for. -Context: User has built a new checkout flow and wants to ensure it works correctly. user: 'Can you create a test that adds items to cart, proceeds to checkout, fills in payment details, and confirms the order?' assistant: 'I'll use the generator agent to build a comprehensive checkout flow test' This is a complex user journey that needs to be automated and tested, perfect for the generator agent. \ No newline at end of file diff --git "a/examples/todomvc/.github/chatmodes/\360\237\216\255 healer.chatmode.md" b/examples/todomvc/.github/agents/playwright-test-healer.agent.md similarity index 60% rename from "examples/todomvc/.github/chatmodes/\360\237\216\255 healer.chatmode.md" rename to examples/todomvc/.github/agents/playwright-test-healer.agent.md index 6604d74030..2e044868b0 100644 --- "a/examples/todomvc/.github/chatmodes/\360\237\216\255 healer.chatmode.md" +++ b/examples/todomvc/.github/agents/playwright-test-healer.agent.md @@ -1,6 +1,27 @@ --- -description: Use this agent when you need to debug and fix failing Playwright tests. -tools: ['edit/createFile', 'edit/createDirectory', 'edit/editFiles', 'search/fileSearch', 'search/textSearch', 'search/listDirectory', 'search/readFile', 'playwright-test/browser_console_messages', 'playwright-test/browser_evaluate', 'playwright-test/browser_generate_locator', 'playwright-test/browser_network_requests', 'playwright-test/browser_snapshot', 'playwright-test/test_debug', 'playwright-test/test_list', 'playwright-test/test_run'] +name: playwright-test-healer +description: Use this agent when you need to debug and fix failing Playwright tests +tools: + - search + - edit + - playwright-test/browser_console_messages + - playwright-test/browser_evaluate + - playwright-test/browser_generate_locator + - playwright-test/browser_network_requests + - playwright-test/browser_snapshot + - playwright-test/test_debug + - playwright-test/test_list + - playwright-test/test_run +model: Claude Sonnet 4 +mcp-servers: + playwright-test: + type: stdio + command: npx + args: + - playwright + - run-test-mcp-server + tools: + - "*" --- You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and @@ -8,8 +29,8 @@ resolving Playwright test failures. Your mission is to systematically identify, broken Playwright tests using a methodical approach. Your workflow: -1. **Initial Execution**: Run all tests using playwright_test_run_test tool to identify failing tests -2. **Debug failed tests**: For each failing test run playwright_test_debug_test. +1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests +2. **Debug failed tests**: For each failing test run `test_debug`. 3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to: - Examine the error details - Capture page snapshot to understand the context @@ -40,5 +61,3 @@ Key principles: of the expected behavior. - Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test. - Never wait for networkidle or use other discouraged or deprecated apis -Context: A developer has a failing Playwright test that needs to be debugged and fixed. user: 'The login test is failing, can you fix it?' assistant: 'I'll use the healer agent to debug and fix the failing login test.' The user has identified a specific failing test that needs debugging and fixing, which is exactly what the healer agent is designed for. -Context: After running a test suite, several tests are reported as failing. user: 'Test user-registration.spec.ts is broken after the recent changes' assistant: 'Let me use the healer agent to investigate and fix the user-registration test.' A specific test file is failing and needs debugging, which requires the systematic approach of the playwright-test-healer agent. \ No newline at end of file diff --git a/examples/todomvc/.github/agents/playwright-test-planner.agent.md b/examples/todomvc/.github/agents/playwright-test-planner.agent.md new file mode 100644 index 0000000000..6ac9a5f1f3 --- /dev/null +++ b/examples/todomvc/.github/agents/playwright-test-planner.agent.md @@ -0,0 +1,81 @@ +--- +name: playwright-test-planner +description: Use this agent when you need to create comprehensive test plan for + a web application or website +tools: + - search + - playwright-test/browser_click + - playwright-test/browser_close + - playwright-test/browser_console_messages + - playwright-test/browser_drag + - playwright-test/browser_evaluate + - playwright-test/browser_file_upload + - playwright-test/browser_handle_dialog + - playwright-test/browser_hover + - playwright-test/browser_navigate + - playwright-test/browser_navigate_back + - playwright-test/browser_network_requests + - playwright-test/browser_press_key + - playwright-test/browser_select_option + - playwright-test/browser_snapshot + - playwright-test/browser_take_screenshot + - playwright-test/browser_type + - playwright-test/browser_wait_for + - playwright-test/planner_setup_page + - playwright-test/planner_save_plan +model: Claude Sonnet 4 +mcp-servers: + playwright-test: + type: stdio + command: npx + args: + - playwright + - run-test-mcp-server + tools: + - "*" +--- + +You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test +scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage +planning. + +You will: + +1. **Navigate and Explore** + - Invoke the `planner_setup_page` tool once to set up page before using any other tools + - Explore the browser snapshot + - Do not take screenshots unless absolutely necessary + - Use `browser_*` tools to navigate and discover interface + - Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality + +2. **Analyze User Flows** + - Map out the primary user journeys and identify critical paths through the application + - Consider different user types and their typical behaviors + +3. **Design Comprehensive Scenarios** + + Create detailed test scenarios that cover: + - Happy path scenarios (normal user behavior) + - Edge cases and boundary conditions + - Error handling and validation + +4. **Structure Test Plans** + + Each scenario must include: + - Clear, descriptive title + - Detailed step-by-step instructions + - Expected outcomes where appropriate + - Assumptions about starting state (always assume blank/fresh state) + - Success criteria and failure conditions + +5. **Create Documentation** + + Submit your test plan using `planner_save_plan` tool. + +**Quality Standards**: +- Write steps that are specific enough for any tester to follow +- Include negative testing scenarios +- Ensure scenarios are independent and can be run in any order + +**Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and +professional formatting suitable for sharing with development and QA teams. diff --git "a/examples/todomvc/.github/chatmodes/ \360\237\216\255 planner.chatmode.md" "b/examples/todomvc/.github/chatmodes/ \360\237\216\255 planner.chatmode.md" deleted file mode 100644 index 5eca16632b..0000000000 --- "a/examples/todomvc/.github/chatmodes/ \360\237\216\255 planner.chatmode.md" +++ /dev/null @@ -1,92 +0,0 @@ ---- -description: Use this agent when you need to create comprehensive test plan for a web application or website. -tools: ['edit/createFile', 'edit/createDirectory', 'search/fileSearch', 'search/textSearch', 'search/listDirectory', 'search/readFile', 'playwright-test/browser_click', 'playwright-test/browser_close', 'playwright-test/browser_console_messages', 'playwright-test/browser_drag', 'playwright-test/browser_evaluate', 'playwright-test/browser_file_upload', 'playwright-test/browser_handle_dialog', 'playwright-test/browser_hover', 'playwright-test/browser_navigate', 'playwright-test/browser_navigate_back', 'playwright-test/browser_network_requests', 'playwright-test/browser_press_key', 'playwright-test/browser_select_option', 'playwright-test/browser_snapshot', 'playwright-test/browser_take_screenshot', 'playwright-test/browser_type', 'playwright-test/browser_wait_for', 'playwright-test/planner_setup_page'] ---- - -You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test -scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage -planning. - -You will: - -1. **Navigate and Explore** - - Invoke the `planner_setup_page` tool once to set up page before using any other tools - - Explore the browser snapshot - - Do not take screenshots unless absolutely necessary - - Use browser_* tools to navigate and discover interface - - Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality - -2. **Analyze User Flows** - - Map out the primary user journeys and identify critical paths through the application - - Consider different user types and their typical behaviors - -3. **Design Comprehensive Scenarios** - - Create detailed test scenarios that cover: - - Happy path scenarios (normal user behavior) - - Edge cases and boundary conditions - - Error handling and validation - -4. **Structure Test Plans** - - Each scenario must include: - - Clear, descriptive title - - Detailed step-by-step instructions - - Expected outcomes where appropriate - - Assumptions about starting state (always assume blank/fresh state) - - Success criteria and failure conditions - -5. **Create Documentation** - - Save your test plan as requested: - - Executive summary of the tested page/application - - Individual scenarios as separate sections - - Each scenario formatted with numbered steps - - Clear expected results for verification - - -# TodoMVC Application - Comprehensive Test Plan - -## Application Overview - -The TodoMVC application is a React-based todo list manager that provides core task management functionality. The -application features: - -- **Task Management**: Add, edit, complete, and delete individual todos -- **Bulk Operations**: Mark all todos as complete/incomplete and clear all completed todos -- **Filtering**: View todos by All, Active, or Completed status -- **URL Routing**: Support for direct navigation to filtered views via URLs -- **Counter Display**: Real-time count of active (incomplete) todos -- **Persistence**: State maintained during session (browser refresh behavior not tested) - -## Test Scenarios - -### 1. Adding New Todos - -**Seed:** `tests/seed.spec.ts` - -#### 1.1 Add Valid Todo -**Steps:** -1. Click in the "What needs to be done?" input field -2. Type "Buy groceries" -3. Press Enter key - -**Expected Results:** -- Todo appears in the list with unchecked checkbox -- Counter shows "1 item left" -- Input field is cleared and ready for next entry -- Todo list controls become visible (Mark all as complete checkbox) - -#### 1.2 -... - - -**Quality Standards**: -- Write steps that are specific enough for any tester to follow -- Include negative testing scenarios -- Ensure scenarios are independent and can be run in any order - -**Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and -professional formatting suitable for sharing with development and QA teams. -Context: User wants to test a new e-commerce checkout flow. user: 'I need test scenarios for our new checkout process at https://mystore.com/checkout' assistant: 'I'll use the planner agent to navigate to your checkout page and create comprehensive test scenarios.' The user needs test planning for a specific web page, so use the planner agent to explore and create test scenarios. -Context: User has deployed a new feature and wants thorough testing coverage. user: 'Can you help me test our new user dashboard at https://app.example.com/dashboard?' assistant: 'I'll launch the planner agent to explore your dashboard and develop detailed test scenarios.' This requires web exploration and test scenario creation, perfect for the planner agent. \ No newline at end of file diff --git a/examples/todomvc/.github/prompts/playwright-test-coverage.prompt.md b/examples/todomvc/.github/prompts/playwright-test-coverage.prompt.md new file mode 100644 index 0000000000..7852aa803a --- /dev/null +++ b/examples/todomvc/.github/prompts/playwright-test-coverage.prompt.md @@ -0,0 +1,31 @@ +--- +agent: agent +description: Produce test coverage +--- + +Parameters: +- Task: the task to perform +- Seed file (optional): the seed file to use, defaults to `tests/seed.spec.ts` +- Test plan file (optional): the test plan file to write, under `specs/` folder. + +1. Call #playwright-test-planner subagent with prompt: + + + + + + + +2. For each test case from the test plan file (1.1, 1.2, ...), one after another, not in parallel, call #playwright-test-generator subagent with prompt: + + + + + + + + + +3. Call #playwright-test-healer subagent with prompt: + +Run all tests and fix the failing ones one after another. diff --git a/examples/todomvc/.github/prompts/playwright-test-generate.prompt.md b/examples/todomvc/.github/prompts/playwright-test-generate.prompt.md new file mode 100644 index 0000000000..335e9fd8ad --- /dev/null +++ b/examples/todomvc/.github/prompts/playwright-test-generate.prompt.md @@ -0,0 +1,8 @@ +--- +agent: playwright-test-generator +description: Generate test plan +--- + +Generate tests for the test plan's bullet 1.1 Add item to card. + +Test plan: `specs/coverage.plan.md` diff --git a/examples/todomvc/.github/prompts/playwright-test-heal.prompt.md b/examples/todomvc/.github/prompts/playwright-test-heal.prompt.md new file mode 100644 index 0000000000..f1ca0c67f4 --- /dev/null +++ b/examples/todomvc/.github/prompts/playwright-test-heal.prompt.md @@ -0,0 +1,6 @@ +--- +agent: playwright-test-healer +description: Fix tests +--- + +Run all my tests and fix the failing ones. diff --git a/examples/todomvc/.github/prompts/playwright-test-plan.prompt.md b/examples/todomvc/.github/prompts/playwright-test-plan.prompt.md new file mode 100644 index 0000000000..1c1f3a1871 --- /dev/null +++ b/examples/todomvc/.github/prompts/playwright-test-plan.prompt.md @@ -0,0 +1,9 @@ +--- +agent: playwright-test-planner +description: Create test plan +--- + +Create test plan for "add to cart" functionality of my app. + +- Seed file: `tests/seed.spec.ts` +- Test plan: `specs/coverage.plan.md` diff --git a/examples/todomvc/.github/workflows/copilot-setup-steps.yml b/examples/todomvc/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000000..d9b5b711e6 --- /dev/null +++ b/examples/todomvc/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,34 @@ +name: "Copilot Setup Steps" + +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: Install dependencies + run: npm ci + + - name: Install Playwright Browsers + run: npx playwright install --with-deps + + # Customize this step as needed + - name: Build application + run: npx run build diff --git a/examples/todomvc/.vscode/mcp.json b/examples/todomvc/.vscode/mcp.json index df015d2ffa..f0c78a8aab 100644 --- a/examples/todomvc/.vscode/mcp.json +++ b/examples/todomvc/.vscode/mcp.json @@ -6,8 +6,7 @@ "args": [ "playwright", "run-test-mcp-server" - ], - "cwd": "${workspaceFolder}" + ] } }, "inputs": [] diff --git a/examples/todomvc/prompt.claudecode.md b/examples/todomvc/prompt.claudecode.md deleted file mode 100644 index 21ee6db859..0000000000 --- a/examples/todomvc/prompt.claudecode.md +++ /dev/null @@ -1,14 +0,0 @@ -## Objective -Test basic functionality of todo app. - -## Test setup: tests/template.spec.ts:11 - -## Steps -- Use `playwright-test-planner` subagent to create a test plan for "Basic operations". - Use seed test from `tests/seed.spec.ts` to init page. Save the test plan as `specs/basic-operations.md`. - -- For each scenario in `specs/basic-operations.md`, use `playwright-test-generator` - subagent to perform the scenario and generate the test source code into `tests/` folder. - Process all scenarios sequentially, do not run in parallel. - -- Use `playwright-test-healer` subagent to fix the failing tests. diff --git a/examples/todomvc/specs/basic-operations.md b/examples/todomvc/specs/basic-operations.md deleted file mode 100644 index 0adc624bdd..0000000000 --- a/examples/todomvc/specs/basic-operations.md +++ /dev/null @@ -1,468 +0,0 @@ -# TodoMVC Application - Basic Operations Test Plan - -## Application Overview - -The TodoMVC application is a React-based todo list manager that demonstrates standard todo application functionality. The application provides comprehensive task management capabilities with a clean, intuitive interface. Key features include: - -- **Task Management**: Add, edit, complete, and delete individual todos -- **Bulk Operations**: Mark all todos as complete/incomplete and clear all completed todos -- **Filtering System**: View todos by All, Active, or Completed status with URL routing support -- **Real-time Counter**: Display of active (incomplete) todo count -- **Interactive UI**: Hover states, edit-in-place functionality, and responsive design -- **State Persistence**: Maintains state during session navigation - -## Test Scenarios - -### 1. Adding New Todos - -**Seed:** `tests/seed.spec.ts` - -#### 1.1 Add Valid Todo - -**Steps:** -1. Click in the "What needs to be done?" input field -2. Type "Buy groceries" -3. Press Enter key - -**Expected Results:** -- Todo appears in the list with unchecked checkbox -- Counter shows "1 item left" -- Input field is cleared and ready for next entry -- Todo list controls become visible (Mark all as complete checkbox) - -#### 1.2 Add Multiple Todos - -**Steps:** -1. Add first todo: "Buy groceries" and press Enter -2. Add second todo: "Walk the dog" and press Enter -3. Add third todo: "Call dentist" and press Enter - -**Expected Results:** -- All three todos appear in the list in the order added -- Counter shows "3 items left" -- Each todo has its own unchecked checkbox -- Input field remains active and cleared after each addition - -#### 1.3 Add Todo with Special Characters - -**Steps:** -1. Type "Buy coffee & donuts (2-3 pieces) @$5.99!" in input field -2. Press Enter - -**Expected Results:** -- Todo appears exactly as typed with all special characters preserved -- Counter shows "1 item left" -- No encoding or display issues with special characters - -#### 1.4 Add Empty Todo (Negative Test) - -**Steps:** -1. Click in input field but don't type anything -2. Press Enter - -**Expected Results:** -- No todo is added to the list -- List remains empty -- No counter appears -- Input field remains focused and empty - -#### 1.5 Add Todo with Only Whitespace (Negative Test) - -**Steps:** -1. Type only spaces " " in input field -2. Press Enter - -**Expected Results:** -- No todo is added to the list -- List remains empty -- Input field is cleared -- No counter appears - -### 2. Marking Todos Complete/Incomplete - -#### 2.1 Mark Single Todo Complete - -**Steps:** -1. Add todo "Buy groceries" -2. Click the checkbox next to "Buy groceries" - -**Expected Results:** -- Checkbox becomes checked -- Todo text may show strikethrough or completed styling -- Counter shows "0 items left" -- "Clear completed" button appears -- Delete button (×) becomes visible on hover - -#### 2.2 Mark Multiple Todos Complete - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Click checkbox for "Buy groceries" -3. Click checkbox for "Call dentist" - -**Expected Results:** -- Two todos show as completed -- Counter shows "1 item left" (for "Walk the dog") -- "Clear completed" button appears -- Only "Walk the dog" remains unchecked - -#### 2.3 Toggle Todo Back to Incomplete - -**Steps:** -1. Add todo "Buy groceries" -2. Click checkbox to mark complete -3. Click checkbox again to mark incomplete - -**Expected Results:** -- Checkbox becomes unchecked -- Completed styling is removed -- Counter shows "1 item left" -- "Clear completed" button disappears if no other completed todos exist - -#### 2.4 Mark All Todos Complete - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Click the "Mark all as complete" checkbox - -**Expected Results:** -- All todo checkboxes become checked -- Counter shows "0 items left" -- "Clear completed" button appears -- "Mark all as complete" checkbox shows as checked - -#### 2.5 Toggle All Todos Back to Incomplete - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog" -2. Click "Mark all as complete" checkbox -3. Click "Mark all as complete" checkbox again - -**Expected Results:** -- All todo checkboxes become unchecked -- Counter shows "2 items left" -- "Clear completed" button disappears -- "Mark all as complete" checkbox shows as unchecked - -### 3. Editing Todos - -#### 3.1 Edit Todo Text - -**Steps:** -1. Add todo "Buy groceries" -2. Double-click on the todo text "Buy groceries" -3. Clear text and type "Buy organic groceries" -4. Press Enter - -**Expected Results:** -- Todo enters edit mode with text selected -- Text changes to "Buy organic groceries" -- Todo exits edit mode -- Counter remains "1 item left" - -#### 3.2 Cancel Edit with Escape - -**Steps:** -1. Add todo "Buy groceries" -2. Double-click on the todo text -3. Change text to "Buy organic groceries" -4. Press Escape key - -**Expected Results:** -- Todo exits edit mode -- Text reverts to original "Buy groceries" -- No changes are saved -- Todo remains in its original state - -#### 3.3 Edit Todo to Empty Text (Negative Test) - -**Steps:** -1. Add todo "Buy groceries" -2. Double-click on the todo text -3. Clear all text -4. Press Enter - -**Expected Results:** -- Todo should be deleted/removed from list -- Counter decrements appropriately -- List becomes empty if this was the only todo - -#### 3.4 Edit Multiple Todos - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog" -2. Double-click "Buy groceries", change to "Buy organic groceries", press Enter -3. Double-click "Walk the dog", change to "Walk the cat", press Enter - -**Expected Results:** -- Both todos are updated with new text -- Counter remains "2 items left" -- Both todos maintain their completion state - -### 4. Deleting Todos - -#### 4.1 Delete Single Todo - -**Steps:** -1. Add todo "Buy groceries" -2. Hover over the todo item -3. Click the delete button (×) - -**Expected Results:** -- Todo is removed from the list -- List becomes empty -- Counter disappears -- Todo controls (filters, mark all) disappear - -#### 4.2 Delete Multiple Todos - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Hover over "Walk the dog" and click delete (×) -3. Hover over "Call dentist" and click delete (×) - -**Expected Results:** -- Only "Buy groceries" remains in the list -- Counter shows "1 item left" -- List controls remain visible - -#### 4.3 Delete Completed Todo - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog" -2. Mark "Buy groceries" as complete -3. Hover over "Buy groceries" and click delete (×) - -**Expected Results:** -- "Buy groceries" is removed from list -- Only "Walk the dog" remains -- Counter shows "1 item left" -- "Clear completed" button disappears - -#### 4.4 Clear All Completed Todos - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Mark "Buy groceries" and "Call dentist" as complete -3. Click "Clear completed" button - -**Expected Results:** -- Both completed todos are removed -- Only "Walk the dog" remains -- Counter shows "1 item left" -- "Clear completed" button disappears - -### 5. Filtering Todos - -#### 5.1 Filter by All - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Mark "Buy groceries" as complete -3. Click "All" filter link - -**Expected Results:** -- All todos are visible (both completed and active) -- URL shows "#/" -- "All" filter appears active/highlighted -- Counter shows "2 items left" - -#### 5.2 Filter by Active - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Mark "Buy groceries" as complete -3. Click "Active" filter link - -**Expected Results:** -- Only incomplete todos are visible ("Walk the dog", "Call dentist") -- Completed todo "Buy groceries" is hidden -- URL shows "#/active" -- "Active" filter appears active/highlighted -- Counter shows "2 items left" - -#### 5.3 Filter by Completed - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Mark "Buy groceries" and "Walk the dog" as complete -3. Click "Completed" filter link - -**Expected Results:** -- Only completed todos are visible ("Buy groceries", "Walk the dog") -- Active todo "Call dentist" is hidden -- URL shows "#/completed" -- "Completed" filter appears active/highlighted -- Counter still shows "1 item left" (maintains global count) - -#### 5.4 Navigate Between Filters - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog" -2. Mark "Buy groceries" as complete -3. Click "Active" filter -4. Click "Completed" filter -5. Click "All" filter - -**Expected Results:** -- Each filter shows appropriate todos -- URL updates correctly for each filter -- Active filter is highlighted appropriately -- Counter remains consistent across filters -- Todos maintain their state when switching views - -### 6. Counter and Status Display - -#### 6.1 Counter with Single Item - -**Steps:** -1. Add one todo "Buy groceries" - -**Expected Results:** -- Counter displays "1 item left" (singular form) -- Counter updates immediately when todo is added - -#### 6.2 Counter with Multiple Items - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog" - -**Expected Results:** -- Counter displays "2 items left" (plural form) -- Counter shows correct count - -#### 6.3 Counter Updates with Completion - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Mark "Buy groceries" as complete -3. Mark "Walk the dog" as complete - -**Expected Results:** -- Counter starts at "3 items left" -- After first completion: "2 items left" -- After second completion: "1 item left" -- Counter updates immediately with each change - -#### 6.4 Counter with All Items Complete - -**Steps:** -1. Add todo "Buy groceries" -2. Mark it as complete - -**Expected Results:** -- Counter shows "0 items left" -- "Clear completed" button is visible -- Filter links remain functional - -### 7. Bulk Operations - -#### 7.1 Mark All Complete When None Completed - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Click "Mark all as complete" checkbox - -**Expected Results:** -- All todos become checked/completed -- Counter shows "0 items left" -- "Clear completed" button appears -- "Mark all as complete" checkbox shows as checked - -#### 7.2 Mark All Incomplete When All Completed - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog" -2. Mark both todos as complete individually -3. Click "Mark all as complete" checkbox - -**Expected Results:** -- All todos become unchecked/incomplete -- Counter shows "2 items left" -- "Clear completed" button disappears -- "Mark all as complete" checkbox shows as unchecked - -#### 7.3 Mark All with Mixed State - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" -2. Mark "Buy groceries" as complete -3. Click "Mark all as complete" checkbox - -**Expected Results:** -- All todos become completed (including the already completed one) -- Counter shows "0 items left" -- "Mark all as complete" checkbox shows as checked - -### 8. Edge Cases and Error Handling - -#### 8.1 Very Long Todo Text - -**Steps:** -1. Type a very long todo text (200+ characters) -2. Press Enter - -**Expected Results:** -- Todo is added successfully -- Text wraps appropriately in the display -- Interface remains usable -- Edit functionality works with long text - -#### 8.2 Rapid Sequential Actions - -**Steps:** -1. Quickly add multiple todos by typing and pressing Enter rapidly -2. Quickly toggle completion states -3. Rapidly switch between filters - -**Expected Results:** -- All actions are processed correctly -- Counter updates accurately -- No todos are lost or duplicated -- Interface remains responsive - -#### 8.3 Direct URL Navigation -**Steps:** -1. Navigate directly to `{base_url}#/active` -1. Navigate directly to `{base_url}#/completed` -2. Navigate directly to `{base_url}#/` - -**Expected Results:** -- Page loads correctly for each URL -- Appropriate filter is active -- Interface is fully functional -- No JavaScript errors occur - -#### 8.4 Todo Operations Across Filters - -**Steps:** -1. Add todos: "Buy groceries", "Walk the dog" -2. Navigate to "Active" filter -3. Mark "Buy groceries" as complete -4. Navigate to "Completed" filter -5. Delete "Buy groceries" - -**Expected Results:** -- Operations work correctly across filter views -- Todo states are maintained when switching filters -- Counter updates appropriately -- UI remains consistent - -## Test Data Considerations - -- **Todo Text Variations**: Test with short text, long text, special characters, Unicode characters, HTML entities -- **Volume Testing**: Test with 1, 2, 10, 50+ todos to ensure performance -- **State Combinations**: Test all combinations of completed/incomplete todos with different filters -- **Boundary Values**: Test edge cases like exactly 0 items, exactly 1 item, maximum reasonable todo count - -## Success Criteria - -All test scenarios should pass without: -- JavaScript console errors -- Visual layout issues -- Incorrect counter displays -- Lost or corrupted todo data -- Non-functional UI elements -- Accessibility violations - -The application should maintain consistent behavior across all supported browsers and provide a smooth, intuitive user experience for basic todo management operations. diff --git a/examples/todomvc/specs/basic-operations.plan.md b/examples/todomvc/specs/basic-operations.plan.md new file mode 100644 index 0000000000..192dde995b --- /dev/null +++ b/examples/todomvc/specs/basic-operations.plan.md @@ -0,0 +1,723 @@ +# TodoMVC Application - Basic Operations Test Plan + +## Application Overview + +The TodoMVC application is a React-based todo list manager accessible at https://demo.playwright.dev/todomvc. The application provides comprehensive task management functionality with the following features: + +- **Task Creation**: Add new todos via input field +- **Task Completion**: Mark individual todos as complete/incomplete via checkboxes +- **Task Editing**: Double-click to edit todo text inline +- **Task Deletion**: Remove individual todos via delete button +- **Bulk Operations**: Mark all todos as complete/incomplete and clear all completed todos +- **Filtering**: View todos by All, Active, or Completed status with URL routing support +- **Counter Display**: Real-time count of active (incomplete) todos +- **Input Validation**: Prevents empty or whitespace-only todos + +## Test Scenarios + +### 1. Adding New Todos + +**Seed:** `tests/seed.spec.ts` + +#### 1.1 Add Single Valid Todo + +**File:** `tests/adding-new-todos/add-single-valid-todo.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Click in the "What needs to be done?" input field +3. Type "Buy groceries" +4. Press Enter key + +**Expected Results:** +- Todo appears in the list with an unchecked checkbox +- Todo text displays as "Buy groceries" +- Counter shows "1 item left" +- Input field is cleared and ready for next entry +- "Mark all as complete" checkbox becomes visible + +#### 1.2 Add Multiple Todos + +**File:** `tests/adding-new-todos/add-multiple-todos.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add first todo: "Buy groceries" (type and press Enter) +3. Add second todo: "Walk the dog" (type and press Enter) +4. Add third todo: "Read a book" (type and press Enter) + +**Expected Results:** +- All three todos appear in the list in order of creation +- Each todo has an unchecked checkbox +- Counter shows "3 items left" (plural) +- Input field is cleared after each addition + +#### 1.3 Reject Empty Todo + +**File:** `tests/adding-new-todos/reject-empty-todo.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Click in the "What needs to be done?" input field +3. Press Enter without typing any text + +**Expected Results:** +- No todo is added to the list +- Todo list remains empty +- Counter is not displayed +- Input field remains focused + +#### 1.4 Reject Whitespace-Only Todo + +**File:** `tests/adding-new-todos/reject-whitespace-only-todo.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Click in the "What needs to be done?" input field +3. Type only spaces (e.g., " ") +4. Press Enter + +**Expected Results:** +- No todo is added to the list +- Todo list remains empty +- Counter is not displayed +- Input field is cleared + +#### 1.5 Add Todo with Special Characters + +**File:** `tests/adding-new-todos/add-todo-with-special-characters.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Type "Test with special chars: @#$%^&*()" +3. Press Enter + +**Expected Results:** +- Todo is successfully added +- Special characters are displayed correctly +- Counter shows "1 item left" + +#### 1.6 Add Todo with Long Text + +**File:** `tests/adding-new-todos/add-todo-with-long-text.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Type a very long text (e.g., "This is a very long todo item to test the character limit and see how the application handles extremely long text inputs that might break the layout or cause other issues") +3. Press Enter + +**Expected Results:** +- Todo is successfully added +- Long text is displayed (may wrap or truncate depending on design) +- Counter shows "1 item left" +- Layout remains intact + +### 2. Completing Todos + +**Seed:** `tests/seed.spec.ts` + +#### 2.1 Complete Single Todo + +**File:** `tests/completing-todos/complete-single-todo.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Click the checkbox next to "Buy groceries" + +**Expected Results:** +- Checkbox becomes checked +- Todo text may show visual indication of completion (strikethrough or style change) +- Counter shows "0 items left" +- "Clear completed" button appears +- Delete button becomes visible on hover + +#### 2.2 Complete Multiple Todos + +**File:** `tests/completing-todos/complete-multiple-todos.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Click the checkbox next to "Buy groceries" +4. Click the checkbox next to "Read a book" + +**Expected Results:** +- Both selected todos show as completed +- Counter shows "1 item left" (only "Walk the dog" remaining) +- "Clear completed" button appears +- One todo remains active + +#### 2.3 Uncomplete Todo + +**File:** `tests/completing-todos/uncomplete-todo.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Click the checkbox to complete it +4. Click the checkbox again to uncomplete it + +**Expected Results:** +- Checkbox becomes unchecked +- Todo returns to active state +- Counter shows "1 item left" +- "Clear completed" button disappears + +#### 2.4 Mark All as Complete + +**File:** `tests/completing-todos/mark-all-as-complete.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Click the "Mark all as complete" checkbox (chevron icon) + +**Expected Results:** +- All todos show as completed +- All individual checkboxes are checked +- "Mark all as complete" checkbox is checked +- Counter shows "0 items left" +- "Clear completed" button appears + +#### 2.5 Unmark All as Complete + +**File:** `tests/completing-todos/unmark-all-as-complete.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Click the "Mark all as complete" checkbox to complete all +4. Click the "Mark all as complete" checkbox again + +**Expected Results:** +- All todos return to active state +- All individual checkboxes are unchecked +- "Mark all as complete" checkbox is unchecked +- Counter shows "3 items left" +- "Clear completed" button disappears + +### 3. Editing Todos + +**Seed:** `tests/seed.spec.ts` + +#### 3.1 Edit Todo Successfully + +**File:** `tests/editing-todos/edit-todo-successfully.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Double-click on the todo text "Buy groceries" +4. Clear the existing text +5. Type "Buy groceries and milk" +6. Press Enter + +**Expected Results:** +- Todo enters edit mode (input field appears) +- Original text is pre-populated in the edit field +- After pressing Enter, todo text updates to "Buy groceries and milk" +- Todo exits edit mode +- Todo remains in the same state (active/completed) + +#### 3.2 Cancel Edit with Escape + +**File:** `tests/editing-todos/cancel-edit-with-escape.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Double-click on the todo text +4. Type "Changed text" +5. Press Escape key + +**Expected Results:** +- Todo exits edit mode +- Original text "Buy groceries" is preserved +- Changes are discarded +- Todo remains in the same state + +#### 3.3 Delete Todo by Clearing Text + +**File:** `tests/editing-todos/delete-todo-by-clearing-text.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Double-click on the todo text +4. Clear all text (delete all characters) +5. Press Enter + +**Expected Results:** +- Todo is removed from the list +- Counter decrements appropriately +- If no todos remain, counter and controls disappear + +#### 3.4 Edit Completed Todo + +**File:** `tests/editing-todos/edit-completed-todo.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Click the checkbox to complete it +4. Double-click on the todo text +5. Type "Buy groceries and milk" +6. Press Enter + +**Expected Results:** +- Todo enters edit mode +- Todo text is successfully updated +- Todo remains in completed state after editing +- Checkbox remains checked + +### 4. Deleting Todos + +**Seed:** `tests/seed.spec.ts` + +#### 4.1 Delete Single Active Todo + +**File:** `tests/deleting-todos/delete-single-active-todo.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Hover over the todo to reveal the delete button +4. Click the delete button (×) + +**Expected Results:** +- Todo is immediately removed from the list +- Counter decrements to "0 items left" or disappears +- Todo list controls disappear if no todos remain + +#### 4.2 Delete Single Completed Todo + +**File:** `tests/deleting-todos/delete-single-completed-todo.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Click the checkbox to complete it +4. Hover over the todo to reveal the delete button +5. Click the delete button (×) + +**Expected Results:** +- Todo is immediately removed from the list +- "Clear completed" button disappears +- Todo list controls disappear if no todos remain + +#### 4.3 Delete Multiple Todos Individually + +**File:** `tests/deleting-todos/delete-multiple-todos-individually.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Delete "Walk the dog" by clicking its delete button +4. Delete "Buy groceries" by clicking its delete button + +**Expected Results:** +- After first deletion, counter shows "2 items left" +- After second deletion, counter shows "1 item left" +- Only "Read a book" remains in the list + +#### 4.4 Clear All Completed Todos + +**File:** `tests/deleting-todos/clear-all-completed-todos.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Complete "Buy groceries" and "Walk the dog" by clicking their checkboxes +4. Click the "Clear completed" button + +**Expected Results:** +- Both completed todos are removed from the list +- Only "Read a book" (active) remains +- Counter shows "1 item left" +- "Clear completed" button disappears + +#### 4.5 Clear Completed When All Are Completed + +**File:** `tests/deleting-todos/clear-completed-when-all-are-completed.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Click "Mark all as complete" checkbox +4. Click "Clear completed" button + +**Expected Results:** +- All todos are removed from the list +- Todo list becomes empty +- Counter and controls disappear +- Only the input field remains visible + +### 5. Filtering Todos + +**Seed:** `tests/seed.spec.ts` + +#### 5.1 View All Todos (Default) + +**File:** `tests/filtering-todos/view-all-todos-default.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Complete "Walk the dog" by clicking its checkbox +4. Verify the "All" filter is selected by default + +**Expected Results:** +- All three todos are visible (both active and completed) +- "All" link appears selected/highlighted +- URL shows "/#/" or "/#" +- Counter shows "2 items left" + +#### 5.2 Filter Active Todos + +**File:** `tests/filtering-todos/filter-active-todos.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Complete "Walk the dog" by clicking its checkbox +4. Click the "Active" filter link + +**Expected Results:** +- Only active todos are visible ("Buy groceries" and "Read a book") +- Completed todo "Walk the dog" is hidden +- "Active" link appears selected/highlighted +- URL changes to "/#/active" +- Counter shows "2 items left" + +#### 5.3 Filter Completed Todos + +**File:** `tests/filtering-todos/filter-completed-todos.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Complete "Walk the dog" and "Buy groceries" by clicking their checkboxes +4. Click the "Completed" filter link + +**Expected Results:** +- Only completed todos are visible ("Walk the dog" and "Buy groceries") +- Active todo "Read a book" is hidden +- "Completed" link appears selected/highlighted +- URL changes to "/#/completed" +- Counter still shows "1 item left" (total active count) +- "Clear completed" button is visible + +#### 5.4 Switch Between Filters + +**File:** `tests/filtering-todos/switch-between-filters.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Complete "Walk the dog" +4. Click "Active" filter +5. Click "Completed" filter +6. Click "All" filter + +**Expected Results:** +- Each filter shows appropriate todos +- Filter selection updates correctly +- URL updates with each filter change +- Counter remains consistent across filter changes + +#### 5.5 Add Todo While Filtered + +**File:** `tests/filtering-todos/add-todo-while-filtered.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Complete it by clicking its checkbox +4. Click "Active" filter (should show no todos) +5. Add a new todo: "Walk the dog" + +**Expected Results:** +- New todo appears in the list (as it's active) +- Counter updates to "1 item left" +- Todo is visible because it matches the active filter + +#### 5.6 Complete Todo While on Active Filter + +**File:** `tests/filtering-todos/complete-todo-while-on-active-filter.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add two todos: "Buy groceries" and "Walk the dog" +3. Click "Active" filter +4. Complete "Buy groceries" by clicking its checkbox + +**Expected Results:** +- "Buy groceries" disappears from the active view +- Only "Walk the dog" remains visible +- Counter updates to "1 item left" +- Completed todo is not deleted, just filtered out + +#### 5.7 Delete Todo While Filtered + +**File:** `tests/filtering-todos/delete-todo-while-filtered.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add two todos: "Buy groceries" and "Walk the dog" +3. Complete "Buy groceries" +4. Click "Completed" filter +5. Delete "Buy groceries" using the delete button + +**Expected Results:** +- "Buy groceries" is removed from the list +- Completed filter shows no todos +- Counter shows "1 item left" (for the active todo) +- "Clear completed" button disappears + +### 6. Counter Display + +**Seed:** `tests/seed.spec.ts` + +#### 6.1 Counter Shows Correct Singular Form + +**File:** `tests/counter-display/counter-shows-singular-form.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a single todo: "Buy groceries" + +**Expected Results:** +- Counter displays "1 item left" (singular "item") + +#### 6.2 Counter Shows Correct Plural Form + +**File:** `tests/counter-display/counter-shows-plural-form.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add two todos: "Buy groceries" and "Walk the dog" + +**Expected Results:** +- Counter displays "2 items left" (plural "items") + +#### 6.3 Counter Updates When Completing Todo + +**File:** `tests/counter-display/counter-updates-when-completing.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add three todos: "Buy groceries", "Walk the dog", "Read a book" +3. Complete "Walk the dog" +4. Complete "Buy groceries" + +**Expected Results:** +- Initially shows "3 items left" +- After first completion shows "2 items left" +- After second completion shows "1 item left" + +#### 6.4 Counter Shows Zero When All Completed + +**File:** `tests/counter-display/counter-shows-zero-when-all-completed.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add two todos: "Buy groceries" and "Walk the dog" +3. Click "Mark all as complete" checkbox + +**Expected Results:** +- Counter displays "0 items left" +- Counter remains visible even at zero + +### 7. UI Controls Visibility + +**Seed:** `tests/seed.spec.ts` + +#### 7.1 Controls Hidden When No Todos + +**File:** `tests/ui-controls-visibility/controls-hidden-when-no-todos.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Verify the initial state with no todos + +**Expected Results:** +- "Mark all as complete" checkbox is not visible +- Counter is not displayed +- Filter links are not displayed +- Only the input field and header are visible + +#### 7.2 Controls Appear When First Todo Added + +**File:** `tests/ui-controls-visibility/controls-appear-when-first-todo-added.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" + +**Expected Results:** +- "Mark all as complete" checkbox becomes visible +- Counter appears showing "1 item left" +- Filter links (All/Active/Completed) appear +- Footer with controls is displayed + +#### 7.3 Controls Disappear When Last Todo Removed + +**File:** `tests/ui-controls-visibility/controls-disappear-when-last-todo-removed.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Delete it using the delete button + +**Expected Results:** +- All controls disappear +- View returns to initial empty state +- Only input field remains visible + +#### 7.4 Clear Completed Button Visibility + +**File:** `tests/ui-controls-visibility/clear-completed-button-visibility.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add two todos: "Buy groceries" and "Walk the dog" +3. Complete "Buy groceries" +4. Complete "Walk the dog" +5. Uncomplete "Walk the dog" + +**Expected Results:** +- "Clear completed" button appears after first completion +- Button remains visible while at least one todo is completed +- Button disappears when no todos are completed + +### 8. Edge Cases and Error Handling + +**Seed:** `tests/seed.spec.ts` + +#### 8.1 Rapidly Add Multiple Todos + +**File:** `tests/edge-cases/rapidly-add-multiple-todos.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Quickly add 10 todos by typing and pressing Enter rapidly + +**Expected Results:** +- All 10 todos are successfully added +- Counter shows "10 items left" +- Todos appear in the order they were added +- No todos are lost or duplicated + +#### 8.2 Rapidly Toggle Todo Completion + +**File:** `tests/edge-cases/rapidly-toggle-todo-completion.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Rapidly click the checkbox multiple times (5-10 clicks) + +**Expected Results:** +- Todo state toggles correctly with each click +- Final state is predictable (checked or unchecked) +- Counter updates correctly +- No UI glitches occur + +#### 8.3 Edit During Filter View + +**File:** `tests/edge-cases/edit-during-filter-view.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Click "Active" filter +4. Double-click to edit the todo +5. Change text to "Buy groceries and milk" +6. Press Enter + +**Expected Results:** +- Todo successfully enters edit mode +- Edit is saved correctly +- Todo remains visible in Active filter +- No filter state is lost + +#### 8.4 Navigate Directly to Filtered URL + +**File:** `tests/edge-cases/navigate-directly-to-filtered-url.spec.ts` + +**Steps:** +1. Navigate directly to "https://demo.playwright.dev/todomvc/#/active" +2. Add a todo: "Buy groceries" +3. Complete it + +**Expected Results:** +- Application loads with Active filter pre-selected +- New active todo is visible +- When completed, todo disappears from view +- Filter state is maintained + +#### 8.5 Multiple Browser Tabs (Session Isolation) + +**File:** `tests/edge-cases/multiple-browser-tabs-session-isolation.spec.ts` + +**Steps:** +1. Open TodoMVC in first tab +2. Add a todo: "Buy groceries" in first tab +3. Open TodoMVC in second tab +4. Verify todo list in second tab + +**Expected Results:** +- Second tab either shows the same todo (if using persistence) or starts empty (if session-based) +- Each tab operates independently without conflicts +- No errors occur from multiple instances + +#### 8.6 Hover States Work Correctly + +**File:** `tests/edge-cases/hover-states-work-correctly.spec.ts` + +**Steps:** +1. Navigate to the TodoMVC application +2. Add a todo: "Buy groceries" +3. Hover over the todo item +4. Move mouse away + +**Expected Results:** +- Delete button (×) appears on hover +- Delete button disappears when not hovering +- Hover state does not interfere with editing or clicking + +## Testing Notes + +### Assumptions +- All tests assume a fresh/blank application state at the start (provided by seed file) +- Tests are designed to be independent and can run in any order +- No persistence testing is included (refresh behavior not covered) + +### Browser Compatibility +- Tests should be run across all major browsers (Chromium, Firefox, WebKit) +- UI controls may have slight visual differences across browsers + +### Performance Considerations +- Application should handle at least 100 todos without performance degradation +- Filtering should be instantaneous even with many todos +- No memory leaks should occur with repeated operations + +### Accessibility Considerations +- All interactive elements should be keyboard accessible +- Screen readers should announce todo state changes +- Focus management should be logical during editing + +## Test Coverage Summary + +This test plan covers: +- **47 individual test scenarios** across 8 major functional areas +- Happy path scenarios for all core features +- Edge cases and boundary conditions +- Input validation and error prevention +- UI state management and visibility +- Filter functionality and URL routing +- Counter accuracy and formatting +- Bulk operations and individual actions + +Each test is independent, clearly documented, and designed for automation using Playwright. diff --git a/examples/todomvc/tests/adding-new-todos/add-multiple-todos.spec.ts b/examples/todomvc/tests/adding-new-todos/add-multiple-todos.spec.ts new file mode 100644 index 0000000000..234cdb43f0 --- /dev/null +++ b/examples/todomvc/tests/adding-new-todos/add-multiple-todos.spec.ts @@ -0,0 +1,34 @@ +// spec: Adding New Todos - should add multiple todos +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Adding New Todos', () => { + test('should add multiple todos', async ({ page }) => { + // Add first todo: "Buy groceries" (type and press Enter) + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Add second todo: "Walk the dog" (type and press Enter) + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Add third todo: "Read a book" (type and press Enter) + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Verify all three todos appear in the list in order of creation + await expect(page.locator('body')).toMatchAriaSnapshot(` +- list: + - listitem: "Buy groceries" + - listitem: "Walk the dog" + - listitem: "Read a book" +`); + + // Verify counter shows "3 items left" (plural) + await expect(page.getByText('3 items left')).toBeVisible(); + + // Verify input field is cleared after each addition + await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue(''); + }); +}); diff --git a/examples/todomvc/tests/adding-new-todos/add-single-valid-todo.spec.ts b/examples/todomvc/tests/adding-new-todos/add-single-valid-todo.spec.ts new file mode 100644 index 0000000000..5ba7c100a8 --- /dev/null +++ b/examples/todomvc/tests/adding-new-todos/add-single-valid-todo.spec.ts @@ -0,0 +1,31 @@ +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Adding New Todos', () => { + test('should add single valid todo', async ({ page }) => { + // Click in the "What needs to be done?" input field + await page.getByRole('textbox', { name: 'What needs to be done?' }).click(); + + // Type "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + + // Press Enter key + await page.keyboard.press('Enter'); + + // Todo appears in the list with an unchecked checkbox + await expect(page.getByTestId('todo-item')).toBeVisible(); + + // Todo text displays as "Buy groceries" + await expect(page.getByText('Buy groceries')).toBeVisible(); + + // Counter shows "1 item left" + await expect(page.getByText('1 item left')).toBeVisible(); + + // Input field is cleared and ready for next entry + await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue(''); + + // "Mark all as complete" checkbox becomes visible + await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/adding-new-todos/add-todo-with-long-text.spec.ts b/examples/todomvc/tests/adding-new-todos/add-todo-with-long-text.spec.ts new file mode 100644 index 0000000000..b0297040fe --- /dev/null +++ b/examples/todomvc/tests/adding-new-todos/add-todo-with-long-text.spec.ts @@ -0,0 +1,17 @@ +import { test, expect } from '../fixtures'; + +test.describe('Adding New Todos', () => { + test('should add todo with long text', async ({ page }) => { + // Type a very long text (e.g., "This is a very long todo item to test the character limit and see how the application handles extremely long text inputs that might break the layout or cause other issues") + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('This is a very long todo item to test the character limit and see how the application handles extremely long text inputs that might break the layout or cause other issues'); + + // Press Enter + await page.keyboard.press('Enter'); + + // Todo is successfully added - Long text is displayed (may wrap or truncate depending on design) + await expect(page.getByText('This is a very long todo item to test the character limit and see how the application handles extremely long text inputs that might break the layout or cause other issues')).toBeVisible(); + + // Counter shows "1 item left" + await expect(page.getByText('1 item left')).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/adding-new-todos/add-todo-with-special-characters.spec.ts b/examples/todomvc/tests/adding-new-todos/add-todo-with-special-characters.spec.ts new file mode 100644 index 0000000000..0850735af5 --- /dev/null +++ b/examples/todomvc/tests/adding-new-todos/add-todo-with-special-characters.spec.ts @@ -0,0 +1,20 @@ +// spec: Adding New Todos - should add todo with special characters +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Adding New Todos', () => { + test('should add todo with special characters', async ({ page }) => { + // Type "Test with special chars: @#$%^&*()" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Test with special chars: @#$%^&*()'); + + // Press Enter + await page.keyboard.press('Enter'); + + // Verify todo is successfully added and special characters are displayed correctly + await expect(page.getByText('Test with special chars: @#$%^&*()')).toBeVisible(); + + // Verify counter shows "1 item left" + await expect(page.getByText('1 item left')).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/adding-new-todos/reject-empty-todo.spec.ts b/examples/todomvc/tests/adding-new-todos/reject-empty-todo.spec.ts new file mode 100644 index 0000000000..74edbeb2b6 --- /dev/null +++ b/examples/todomvc/tests/adding-new-todos/reject-empty-todo.spec.ts @@ -0,0 +1,21 @@ +// spec: Adding New Todos +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Adding New Todos', () => { + test('should reject empty todo', async ({ page }) => { + // Click in the "What needs to be done?" input field + await page.getByRole('textbox', { name: 'What needs to be done?' }).click(); + + // Press Enter without typing any text + await page.keyboard.press('Enter'); + + // Verify no todo is added to the list and counter is not displayed + await expect(page.locator('.todo-list')).not.toBeVisible(); + await expect(page.locator('.todo-count')).not.toBeVisible(); + + // Verify input field remains focused + await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeFocused(); + }); +}); diff --git a/examples/todomvc/tests/adding-new-todos/reject-whitespace-only-todo.spec.ts b/examples/todomvc/tests/adding-new-todos/reject-whitespace-only-todo.spec.ts new file mode 100644 index 0000000000..3267557aaa --- /dev/null +++ b/examples/todomvc/tests/adding-new-todos/reject-whitespace-only-todo.spec.ts @@ -0,0 +1,31 @@ +// spec: Adding New Todos +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Adding New Todos', () => { + test('should reject whitespace-only todo', async ({ page }) => { + // 1. Navigate to the TodoMVC application + // (handled by seed) + + // 2. Click in the "What needs to be done?" input field + await page.getByRole('textbox', { name: 'What needs to be done?' }).click(); + + // 3. Type only spaces (e.g., " ") + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill(' '); + + // 4. Press Enter + await page.keyboard.press('Enter'); + + // Expected Results: + // - No todo is added to the list + // - Todo list remains empty + await expect(page.getByRole('list')).not.toBeVisible(); + + // - Counter is not displayed + await expect(page.getByText(/\d+ items? left/)).not.toBeVisible(); + + // - Input field retains the whitespace (application doesn't clear it) + await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue(' '); + }); +}); diff --git a/examples/todomvc/tests/completing-todos/complete-multiple-todos.spec.ts b/examples/todomvc/tests/completing-todos/complete-multiple-todos.spec.ts new file mode 100644 index 0000000000..d3dd381e87 --- /dev/null +++ b/examples/todomvc/tests/completing-todos/complete-multiple-todos.spec.ts @@ -0,0 +1,38 @@ +import { test, expect } from '../fixtures'; + +test.describe('Completing Todos', () => { + test('should complete multiple todos', async ({ page }) => { + // Add first todo: "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Add second todo: "Walk the dog" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Add third todo: "Read a book" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Click the checkbox next to "Buy groceries" + await page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo').click(); + + // Click the checkbox next to "Read a book" + await page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo').click(); + + // Verify "Buy groceries" is completed + await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).toBeChecked(); + + // Verify "Read a book" is completed + await expect(page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo')).toBeChecked(); + + // Verify counter shows "1 item left" + await expect(page.getByText('1 item left')).toBeVisible(); + + // Verify "Clear completed" button appears + await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); + + // Verify "Walk the dog" remains active (unchecked) + await expect(page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo')).not.toBeChecked(); + }); +}); diff --git a/examples/todomvc/tests/completing-todos/complete-single-todo.spec.ts b/examples/todomvc/tests/completing-todos/complete-single-todo.spec.ts new file mode 100644 index 0000000000..dee8cb1966 --- /dev/null +++ b/examples/todomvc/tests/completing-todos/complete-single-todo.spec.ts @@ -0,0 +1,27 @@ +// spec: Completing Todos - should complete single todo +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Completing Todos', () => { + test('should complete single todo', async ({ page }) => { + // Add a todo: "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Click the checkbox next to "Buy groceries" + await page.getByRole('checkbox', { name: 'Toggle Todo' }).click(); + + // Verify checkbox becomes checked + await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked(); + + // Verify counter shows "0 items left" + await expect(page.getByText('0 items left')).toBeVisible(); + + // Verify "Clear completed" button appears + await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); + + // Verify delete button becomes visible + await expect(page.getByRole('button', { name: 'Delete' })).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/completing-todos/mark-all-as-complete.spec.ts b/examples/todomvc/tests/completing-todos/mark-all-as-complete.spec.ts new file mode 100644 index 0000000000..363d7c2d8f --- /dev/null +++ b/examples/todomvc/tests/completing-todos/mark-all-as-complete.spec.ts @@ -0,0 +1,27 @@ +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Completing Todos', () => { + test('should mark all as complete', async ({ page }) => { + // Add three todos: "Buy groceries", "Walk the dog", "Read a book" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Click the "Mark all as complete" checkbox (chevron icon) + await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click(); + + // Verify "Mark all as complete" checkbox is checked + await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeChecked(); + + // Verify counter shows "0 items left" + await expect(page.getByText('0')).toBeVisible(); + + // Verify "Clear completed" button appears + await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/completing-todos/uncomplete-todo.spec.ts b/examples/todomvc/tests/completing-todos/uncomplete-todo.spec.ts new file mode 100644 index 0000000000..9b26a22cdf --- /dev/null +++ b/examples/todomvc/tests/completing-todos/uncomplete-todo.spec.ts @@ -0,0 +1,24 @@ +// spec: Completing Todos - should uncomplete todo +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Completing Todos', () => { + test('should uncomplete todo', async ({ page }) => { + // Add a todo: "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Click the checkbox to complete it + await page.getByRole('checkbox', { name: 'Toggle Todo' }).click(); + + // Click the checkbox again to uncomplete it + await page.getByRole('checkbox', { name: 'Toggle Todo' }).click(); + + // Verify checkbox becomes unchecked + await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).not.toBeChecked(); + + // Verify counter shows "1 item left" + await expect(page.getByText('1 item left')).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/completing-todos/unmark-all-as-complete.spec.ts b/examples/todomvc/tests/completing-todos/unmark-all-as-complete.spec.ts new file mode 100644 index 0000000000..afff06aebe --- /dev/null +++ b/examples/todomvc/tests/completing-todos/unmark-all-as-complete.spec.ts @@ -0,0 +1,37 @@ +// spec: Completing Todos - should unmark all as complete +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Completing Todos', () => { + test('should unmark all as complete', async ({ page }) => { + // Add first todo: "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Add second todo: "Walk the dog" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Add third todo: "Read a book" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Click the "Mark all as complete" checkbox to complete all + await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click(); + + // Click the "Mark all as complete" checkbox again + await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click(); + + // Verify "Mark all as complete" checkbox is unchecked + await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).not.toBeChecked(); + + // Verify all individual checkboxes are unchecked + await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).not.toBeChecked(); + await expect(page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo')).not.toBeChecked(); + await expect(page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo')).not.toBeChecked(); + + // Verify counter shows "3 items left" + await expect(page.getByText('3 items left')).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/create/add-empty-todo.spec.ts b/examples/todomvc/tests/create/add-empty-todo.spec.ts deleted file mode 100644 index 1ed79f985b..0000000000 --- a/examples/todomvc/tests/create/add-empty-todo.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Adding New Todos', () => { - test('Add Empty Todo (Negative Test)', async ({ page }) => { - // 1. Click in input field but don't type anything - const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - await todoInput.click(); - - // 2. Press Enter - await todoInput.press('Enter'); - - // Expected Results: - // - No todo is added to the list - await expect(page.locator('.todo-list li')).toHaveCount(0); - - // - List remains empty - await expect(page.locator('.todo-list')).not.toBeVisible(); - - // - No counter appears - await expect(page.getByText(/\d+ items? left/)).not.toBeVisible(); - - // - Input field remains focused and empty - await expect(todoInput).toBeFocused(); - await expect(todoInput).toHaveValue(''); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/create/add-multiple-todos.spec.ts b/examples/todomvc/tests/create/add-multiple-todos.spec.ts deleted file mode 100644 index a698ca5546..0000000000 --- a/examples/todomvc/tests/create/add-multiple-todos.spec.ts +++ /dev/null @@ -1,47 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Adding New Todos', () => { - test('Add Multiple Todos', async ({ page }) => { - const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - - // 1. Add first todo: "Buy groceries" and press Enter - await todoInput.fill('Buy groceries'); - await todoInput.press('Enter'); - - // 2. Add second todo: "Walk the dog" and press Enter - await todoInput.fill('Walk the dog'); - await todoInput.press('Enter'); - - // 3. Add third todo: "Call dentist" and press Enter - await todoInput.fill('Call dentist'); - await todoInput.press('Enter'); - - // Expected Results: - // - All three todos appear in the list in the order added - const todoItems = page.getByTestId('todo-item'); - await expect(todoItems).toHaveCount(3); - - await expect(todoItems.nth(0)).toContainText('Buy groceries'); - await expect(todoItems.nth(1)).toContainText('Walk the dog'); - await expect(todoItems.nth(2)).toContainText('Call dentist'); - - // - Counter shows "3 items left" - await expect(page.getByText('3 items left')).toBeVisible(); - - // - Each todo has its own unchecked checkbox - const todoCheckboxes = page.getByRole('checkbox', { name: 'Toggle Todo' }); - await expect(todoCheckboxes).toHaveCount(3); - - for (let i = 0; i < 3; i++) { - await expect(todoCheckboxes.nth(i)).toBeVisible(); - await expect(todoCheckboxes.nth(i)).not.toBeChecked(); - } - - // - Input field remains active and cleared after each addition - await expect(todoInput).toHaveValue(''); - await expect(todoInput).toBeFocused(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/create/add-todo-with-only-whitespace.spec.ts b/examples/todomvc/tests/create/add-todo-with-only-whitespace.spec.ts deleted file mode 100644 index 6a7b70d89d..0000000000 --- a/examples/todomvc/tests/create/add-todo-with-only-whitespace.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Adding New Todos', () => { - test('Add Todo with Only Whitespace (Negative Test)', async ({ page }) => { - // 1. Type only spaces " " in input field - const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - await todoInput.fill(' '); - - // 2. Press Enter - await todoInput.press('Enter'); - - // Expected Results: - // - No todo is added to the list - await expect(page.locator('.todo-list li')).toHaveCount(0); - - // - List remains empty - await expect(page.locator('.todo-list')).not.toBeVisible(); - - // - Input field retains the whitespace (actual behavior differs from spec) - await expect(todoInput).toHaveValue(' '); - - // - No counter appears - await expect(page.getByText(/\d+ items? left/)).not.toBeVisible(); - - // - Input field remains focused - await expect(todoInput).toBeFocused(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/create/add-todo-with-special-characters.spec.ts b/examples/todomvc/tests/create/add-todo-with-special-characters.spec.ts deleted file mode 100644 index 3b6bcaf427..0000000000 --- a/examples/todomvc/tests/create/add-todo-with-special-characters.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Adding New Todos', () => { - test('Add Todo with Special Characters', async ({ page }) => { - // 1. Type "Buy coffee & donuts (2-3 pieces) @$5.99!" in input field - const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - await todoInput.fill('Buy coffee & donuts (2-3 pieces) @$5.99!'); - - // 2. Press Enter - await todoInput.press('Enter'); - - // Expected Results: - // - Todo appears exactly as typed with all special characters preserved - await expect(page.getByText('Buy coffee & donuts (2-3 pieces) @$5.99!')).toBeVisible(); - - // - Counter shows "1 item left" - await expect(page.getByText('1 item left')).toBeVisible(); - - // - No encoding or display issues with special characters - const todoCheckbox = page.getByRole('checkbox', { name: 'Toggle Todo' }); - await expect(todoCheckbox).toBeVisible(); - await expect(todoCheckbox).not.toBeChecked(); - - // Verify input field is cleared - await expect(todoInput).toHaveValue(''); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/create/add-valid-todo.spec.ts b/examples/todomvc/tests/create/add-valid-todo.spec.ts deleted file mode 100644 index 0353dba82e..0000000000 --- a/examples/todomvc/tests/create/add-valid-todo.spec.ts +++ /dev/null @@ -1,35 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Adding New Todos', () => { - test('Add Valid Todo', async ({ page }) => { - // 1. Click in the "What needs to be done?" input field - const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - await todoInput.click(); - - // 2. Type "Buy groceries" - await todoInput.fill('Buy groceries'); - - // 3. Press Enter key - await todoInput.press('Enter'); - - // Expected Results: - // - Todo appears in the list with unchecked checkbox - await expect(page.getByText('Buy groceries')).toBeVisible(); - const todoCheckbox = page.getByRole('checkbox', { name: 'Toggle Todo' }); - await expect(todoCheckbox).toBeVisible(); - await expect(todoCheckbox).not.toBeChecked(); - - // - Counter shows "1 item left" - await expect(page.getByText('1 item left')).toBeVisible(); - - // - Input field is cleared and ready for next entry - await expect(todoInput).toHaveValue(''); - await expect(todoInput).toBeFocused(); - - // - Todo list controls become visible (Mark all as complete checkbox) - await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeVisible(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/edit/cancel-edit-with-escape.spec.ts b/examples/todomvc/tests/edit/cancel-edit-with-escape.spec.ts deleted file mode 100644 index 9fc5ad164b..0000000000 --- a/examples/todomvc/tests/edit/cancel-edit-with-escape.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Editing Todos', () => { - test('Cancel Edit with Escape', async ({ page }) => { - // 1. Add todo "Buy groceries" - await page.getByRole('textbox', { name: 'What needs to be done?' }).click(); - await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); - await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); - - // Verify todo was added - await expect(page.getByTestId('todo-title')).toHaveText('Buy groceries'); - await expect(page.locator('.todo-count')).toHaveText('1 item left'); - - // 2. Double-click on the todo text - await page.getByTestId('todo-title').dblclick(); - - // Verify todo enters edit mode with text selected - const editInput = page.getByRole('textbox', { name: 'Edit' }); - await expect(editInput).toBeVisible(); - await expect(editInput).toHaveValue('Buy groceries'); - await expect(editInput).toBeFocused(); - - // 3. Change text to "Buy organic groceries" - await editInput.fill('Buy organic groceries'); - - // Verify text was changed in edit input - await expect(editInput).toHaveValue('Buy organic groceries'); - - // 4. Press Escape key - await page.keyboard.press('Escape'); - - // Expected results: - // - Todo exits edit mode - await expect(editInput).not.toBeVisible(); - - // - Text reverts to original "Buy groceries" - await expect(page.getByTestId('todo-title')).toHaveText('Buy groceries'); - - // - No changes are saved (verified by text reversion above) - // - Todo remains in its original state - await expect(page.locator('.todo-count')).toHaveText('1 item left'); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/edit/edit-multiple-todos.spec.ts b/examples/todomvc/tests/edit/edit-multiple-todos.spec.ts deleted file mode 100644 index 643921ed7d..0000000000 --- a/examples/todomvc/tests/edit/edit-multiple-todos.spec.ts +++ /dev/null @@ -1,61 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Editing Todos', () => { - test('Edit Multiple Todos', async ({ page }) => { - // 1. Add todos: "Buy groceries", "Walk the dog" - await page.getByRole('textbox', { name: 'What needs to be done?' }).click(); - await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); - await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); - - await page.getByRole('textbox', { name: 'What needs to be done?' }).click(); - await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog'); - await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); - - // Verify both todos were added - await expect(page.getByText('Buy groceries')).toBeVisible(); - await expect(page.getByText('Walk the dog')).toBeVisible(); - await expect(page.locator('.todo-count')).toHaveText('2 items left'); - - // 2. Double-click "Buy groceries", change to "Buy organic groceries", press Enter - await page.getByText('Buy groceries').dblclick(); - - const editInput = page.getByRole('textbox', { name: 'Edit' }); - await expect(editInput).toBeVisible(); - await expect(editInput).toHaveValue('Buy groceries'); - - await editInput.fill('Buy organic groceries'); - await page.keyboard.press('Enter'); - - // 3. Double-click "Walk the dog", change to "Walk the cat", press Enter - await page.getByText('Walk the dog').dblclick(); - - const editInput2 = page.getByRole('textbox', { name: 'Edit' }); - await expect(editInput2).toBeVisible(); - await expect(editInput2).toHaveValue('Walk the dog'); - - await editInput2.fill('Walk the cat'); - await page.keyboard.press('Enter'); - - // Expected results: - // - Both todos are updated with new text - await expect(page.getByText('Buy organic groceries')).toBeVisible(); - await expect(page.getByText('Walk the cat')).toBeVisible(); - - // - Counter remains "2 items left" - await expect(page.locator('.todo-count')).toHaveText('2 items left'); - - // - Both todos maintain their completion state (uncompleted) - const todo1Checkbox = page.getByText('Buy organic groceries').locator('..').getByRole('checkbox', { name: 'Toggle Todo' }); - const todo2Checkbox = page.getByText('Walk the cat').locator('..').getByRole('checkbox', { name: 'Toggle Todo' }); - - await expect(todo1Checkbox).not.toBeChecked(); - await expect(todo2Checkbox).not.toBeChecked(); - - // Verify edit inputs are no longer visible - await expect(editInput).not.toBeVisible(); - await expect(editInput2).not.toBeVisible(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/edit/edit-todo-text.spec.ts b/examples/todomvc/tests/edit/edit-todo-text.spec.ts deleted file mode 100644 index f0629ba745..0000000000 --- a/examples/todomvc/tests/edit/edit-todo-text.spec.ts +++ /dev/null @@ -1,42 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Editing Todos', () => { - test('Edit Todo Text', async ({ page }) => { - // 1. Add todo "Buy groceries" - await page.getByRole('textbox', { name: 'What needs to be done?' }).click(); - await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); - await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); - - // Verify todo was added - await expect(page.getByTestId('todo-title')).toHaveText('Buy groceries'); - await expect(page.locator('.todo-count')).toHaveText('1 item left'); - - // 2. Double-click on the todo text "Buy groceries" - await page.getByTestId('todo-title').dblclick(); - - // Verify todo enters edit mode with text selected - const editInput = page.getByRole('textbox', { name: 'Edit' }); - await expect(editInput).toBeVisible(); - await expect(editInput).toHaveValue('Buy groceries'); - await expect(editInput).toBeFocused(); - - // 3. Clear text and type "Buy organic groceries" - await editInput.fill('Buy organic groceries'); - - // 4. Press Enter - await page.keyboard.press('Enter'); - - // Expected results: - // - Text changes to "Buy organic groceries" - await expect(page.getByTestId('todo-title')).toHaveText('Buy organic groceries'); - - // - Todo exits edit mode - await expect(editInput).not.toBeVisible(); - - // - Counter remains "1 item left" - await expect(page.locator('.todo-count')).toHaveText('1 item left'); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/edit/edit-todo-to-empty-text.spec.ts b/examples/todomvc/tests/edit/edit-todo-to-empty-text.spec.ts deleted file mode 100644 index 961e3e3921..0000000000 --- a/examples/todomvc/tests/edit/edit-todo-to-empty-text.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Editing Todos', () => { - test('Edit Todo to Empty Text (Negative Test)', async ({ page }) => { - // 1. Add todo "Buy groceries" - await page.getByRole('textbox', { name: 'What needs to be done?' }).click(); - await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); - await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); - - // Verify todo was added - await expect(page.getByTestId('todo-title')).toHaveText('Buy groceries'); - await expect(page.locator('.todo-count')).toHaveText('1 item left'); - - // 2. Double-click on the todo text - await page.getByTestId('todo-title').dblclick(); - - // Verify todo enters edit mode - const editInput = page.getByRole('textbox', { name: 'Edit' }); - await expect(editInput).toBeVisible(); - await expect(editInput).toHaveValue('Buy groceries'); - - // 3. Clear all text - await editInput.fill(''); - - // 4. Press Enter - await page.keyboard.press('Enter'); - - // Expected results: - // - Todo should be deleted/removed from list - await expect(page.getByTestId('todo-title')).not.toBeVisible(); - - // - Counter decrements appropriately (disappears when no todos) - await expect(page.locator('.todo-count')).not.toBeVisible(); - - // - List becomes empty if this was the only todo - await expect(page.locator('.todo-list')).not.toBeVisible(); - - // - Only the main input should remain visible - await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/editing-todos/cancel-edit-with-escape.spec.ts b/examples/todomvc/tests/editing-todos/cancel-edit-with-escape.spec.ts new file mode 100644 index 0000000000..9a7d57f07c --- /dev/null +++ b/examples/todomvc/tests/editing-todos/cancel-edit-with-escape.spec.ts @@ -0,0 +1,24 @@ +// spec: Editing Todos - Cancel edit with escape +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Editing Todos', () => { + test('should cancel edit with escape', async ({ page }) => { + // Add a todo: "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Double-click on the todo text + await page.getByTestId('todo-title').dblclick(); + + // Type "Changed text" + await page.getByRole('textbox', { name: 'Edit' }).fill('Changed text'); + + // Press Escape key + await page.keyboard.press('Escape'); + + // Verify original text "Buy groceries" is preserved + await expect(page.getByText('Buy groceries')).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/editing-todos/delete-todo-by-clearing-text.spec.ts b/examples/todomvc/tests/editing-todos/delete-todo-by-clearing-text.spec.ts new file mode 100644 index 0000000000..312002502d --- /dev/null +++ b/examples/todomvc/tests/editing-todos/delete-todo-by-clearing-text.spec.ts @@ -0,0 +1,24 @@ +// spec: Editing Todos - should delete todo by clearing text +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Editing Todos', () => { + test('should delete todo by clearing text', async ({ page }) => { + // Add a todo: "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Double-click on the todo text + await page.getByTestId('todo-title').dblclick(); + + // Clear all text (delete all characters) + await page.getByRole('textbox', { name: 'Edit' }).fill(''); + + // Press Enter + await page.keyboard.press('Enter'); + + // Verify the input field is still visible + await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/editing-todos/edit-completed-todo.spec.ts b/examples/todomvc/tests/editing-todos/edit-completed-todo.spec.ts new file mode 100644 index 0000000000..20d79b95d6 --- /dev/null +++ b/examples/todomvc/tests/editing-todos/edit-completed-todo.spec.ts @@ -0,0 +1,28 @@ +// spec: Editing Todos - Edit Completed Todo +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Editing Todos', () => { + test('should edit completed todo', async ({ page }) => { + // Add a todo: "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Click the checkbox to complete it + await page.getByRole('checkbox', { name: 'Toggle Todo' }).click(); + + // Double-click on the todo text + await page.getByTestId('todo-title').dblclick(); + + // Type "Buy groceries and milk" and press Enter + await page.getByRole('textbox', { name: 'Edit' }).fill('Buy groceries and milk'); + await page.getByRole('textbox', { name: 'Edit' }).press('Enter'); + + // Verify todo text is successfully updated + await expect(page.getByText('Buy groceries and milk')).toBeVisible(); + + // Verify checkbox remains checked (todo remains in completed state) + await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked(); + }); +}); diff --git a/examples/todomvc/tests/editing-todos/edit-todo-successfully.spec.ts b/examples/todomvc/tests/editing-todos/edit-todo-successfully.spec.ts new file mode 100644 index 0000000000..a9e9fcbfe0 --- /dev/null +++ b/examples/todomvc/tests/editing-todos/edit-todo-successfully.spec.ts @@ -0,0 +1,24 @@ +// spec: Editing Todos - should edit todo successfully +// seed: tests/seed.spec.ts + +import { test, expect } from '../fixtures'; + +test.describe('Editing Todos', () => { + test('should edit todo successfully', async ({ page }) => { + // Add a todo: "Buy groceries" + await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); + await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); + + // Double-click on the todo text "Buy groceries" + await page.getByTestId('todo-title').dblclick(); + + // Clear the existing text and type "Buy groceries and milk" + await page.getByRole('textbox', { name: 'Edit' }).fill('Buy groceries and milk'); + + // Press Enter to save the edited todo + await page.keyboard.press('Enter'); + + // Verify that todo text updates to "Buy groceries and milk" + await expect(page.getByText('Buy groceries and milk')).toBeVisible(); + }); +}); diff --git a/examples/todomvc/tests/integration.spec.ts b/examples/todomvc/tests/integration.spec.ts deleted file mode 100644 index f41b0a2d58..0000000000 --- a/examples/todomvc/tests/integration.spec.ts +++ /dev/null @@ -1,427 +0,0 @@ -/* eslint-disable notice/notice */ - -import { test, expect } from './fixtures'; -import type { Page } from '@playwright/test'; - -test.describe.configure({ mode: 'parallel' }); - -const TODO_ITEMS = [ - 'buy some cheese', - 'feed the cat', - 'book a doctors appointment' -]; - -test.describe('New Todo', () => { - test('should allow me to add todo items', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - // Create 1st todo. - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - // Make sure the list only has one todo item. - await expect(page.getByTestId('todo-title')).toHaveText([ - TODO_ITEMS[0] - ]); - - // Create 2nd todo. - await newTodo.fill(TODO_ITEMS[1]); - await newTodo.press('Enter'); - - // Make sure the list now has two todo items. - await expect(page.getByTestId('todo-title')).toHaveText([ - TODO_ITEMS[0], - TODO_ITEMS[1], - ]); - - await checkNumberOfTodosInLocalStorage(page, 2); - }); - - test('should clear text input field when an item is added', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create one todo item. - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - // Check that input is empty. - await expect(newTodo).toBeEmpty(); - await checkNumberOfTodosInLocalStorage(page, 1); - }); - - test('should append new items to the bottom of the list', async ({ page }) => { - // Create 3 items. - await createDefaultTodos(page); - - // Check test using different methods. - await expect(page.getByText('3 items left')).toBeVisible(); - await expect(page.getByTestId('todo-count')).toHaveText('3 items left'); - await expect(page.getByTestId('todo-count')).toContainText('3'); - await expect(page.getByTestId('todo-count')).toHaveText(/3/); - - // Check all items in one call. - await expect(page.getByTestId('todo-title')).toHaveText(TODO_ITEMS); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should show #main and #footer when items added', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - await expect(page.locator('.main')).toBeVisible(); - await expect(page.locator('.footer')).toBeVisible(); - await checkNumberOfTodosInLocalStorage(page, 1); - }); -}); - -test.describe('Mark all as completed', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test.afterEach(async ({ page }) => { - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should allow me to mark all items as completed', async ({ page }) => { - // Complete all todos. - await page.getByLabel('Mark all as complete').check(); - - // Ensure all todos have 'completed' class. - await expect(page.getByTestId('todo-item')).toHaveClass(['completed', 'completed', 'completed']); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - }); - - test('should allow me to clear the complete state of all items', async ({ page }) => { - const toggleAll = page.getByLabel('Mark all as complete'); - // Check and then immediately uncheck. - await toggleAll.check(); - await toggleAll.uncheck(); - - // Should be no completed classes. - await expect(page.getByTestId('todo-item')).toHaveClass(['', '', '']); - }); - - test('complete all checkbox should update state when items are completed / cleared', async ({ page }) => { - const toggleAll = page.getByLabel('Mark all as complete'); - await toggleAll.check(); - await expect(toggleAll).toBeChecked(); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - - // Uncheck first todo. - const firstTodo = page.getByTestId('todo-item').nth(0); - await firstTodo.getByRole('checkbox').uncheck(); - - // Reuse toggleAll locator and make sure its not checked. - await expect(toggleAll).not.toBeChecked(); - - await firstTodo.getByRole('checkbox').check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - - // Assert the toggle all is checked again. - await expect(toggleAll).toBeChecked(); - }); -}); - -test.describe('Item', () => { - - test('should allow me to mark items as complete', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create two items. - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - // Check first item. - const firstTodo = page.getByTestId('todo-item').nth(0); - await firstTodo.getByRole('checkbox').check(); - await expect(firstTodo).toHaveClass('completed'); - - // Check second item. - const secondTodo = page.getByTestId('todo-item').nth(1); - await expect(secondTodo).not.toHaveClass('completed'); - await secondTodo.getByRole('checkbox').check(); - - // Assert completed class. - await expect(firstTodo).toHaveClass('completed'); - await expect(secondTodo).toHaveClass('completed'); - }); - - test('should allow me to un-mark items as complete', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create two items. - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - const firstTodo = page.getByTestId('todo-item').nth(0); - const secondTodo = page.getByTestId('todo-item').nth(1); - await firstTodo.getByRole('checkbox').check(); - await expect(firstTodo).toHaveClass('completed'); - await expect(secondTodo).not.toHaveClass('completed'); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - await firstTodo.getByRole('checkbox').uncheck(); - await expect(firstTodo).not.toHaveClass('completed'); - await expect(secondTodo).not.toHaveClass('completed'); - await checkNumberOfCompletedTodosInLocalStorage(page, 0); - }); - - test('should allow me to edit an item', async ({ page }) => { - await createDefaultTodos(page); - - const todoItems = page.getByTestId('todo-item'); - const secondTodo = todoItems.nth(1); - await secondTodo.dblclick(); - await expect(secondTodo.getByRole('textbox', { name: 'Edit' })).toHaveValue(TODO_ITEMS[1]); - await secondTodo.getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await secondTodo.getByRole('textbox', { name: 'Edit' }).press('Enter'); - - // Explicitly assert the new text value. - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2] - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); -}); - -test.describe('Editing', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should hide other controls when editing', async ({ page }) => { - const todoItem = page.getByTestId('todo-item').nth(1); - await todoItem.dblclick(); - await expect(todoItem.getByRole('checkbox')).not.toBeVisible(); - await expect(todoItem.locator('label', { - hasText: TODO_ITEMS[1], - })).not.toBeVisible(); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should save edits on blur', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).dispatchEvent('blur'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2], - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); - - test('should trim entered text', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(' buy some sausages '); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2], - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); - - test('should remove the item if an empty text string was entered', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(''); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - TODO_ITEMS[2], - ]); - }); - - test('should cancel edits on escape', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Escape'); - await expect(todoItems).toHaveText(TODO_ITEMS); - }); -}); - -test.describe('Counter', () => { - test('should display the current number of todo items', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - await expect(page.getByTestId('todo-count')).toContainText('1'); - - await newTodo.fill(TODO_ITEMS[1]); - await newTodo.press('Enter'); - await expect(page.getByTestId('todo-count')).toContainText('2'); - - await checkNumberOfTodosInLocalStorage(page, 2); - }); -}); - -test.describe('Clear completed button', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - }); - - test('should display the correct text', async ({ page }) => { - await page.locator('.todo-list li .toggle').first().check(); - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); - }); - - test('should remove completed items when clicked', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).getByRole('checkbox').check(); - await page.getByRole('button', { name: 'Clear completed' }).click(); - await expect(todoItems).toHaveCount(2); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); - }); - - test('should be hidden when there are no items that are completed', async ({ page }) => { - await page.locator('.todo-list li .toggle').first().check(); - await page.getByRole('button', { name: 'Clear completed' }).click(); - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeHidden(); - }); -}); - -test.describe('Persistence', () => { - test('should persist its data', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(0).getByRole('checkbox').check(); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]); - await expect(todoItems).toHaveClass(['completed', '']); - - // Ensure there is 1 completed item. - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - // Now reload. - await page.reload(); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]); - await expect(todoItems).toHaveClass(['completed', '']); - }); -}); - -test.describe('Routing', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - // make sure the app had a chance to save updated todos in storage - // before navigating to a new view, otherwise the items can get lost :( - // in some frameworks like Durandal - await checkTodosInLocalStorage(page, TODO_ITEMS[0]); - }); - - test('should allow me to display active items', async ({ page }) => { - await page.locator('.todo-list li .toggle').nth(1).check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Active' }).click(); - await expect(page.getByTestId('todo-item')).toHaveCount(2); - await expect(page.getByTestId('todo-item')).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); - }); - - test('should respect the back button', async ({ page }) => { - await page.locator('.todo-list li .toggle').nth(1).check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - await test.step('Showing all items', async () => { - await page.getByRole('link', { name: 'All' }).click(); - await expect(page.getByTestId('todo-item')).toHaveCount(3); - }); - - await test.step('Showing active items', async () => { - await page.getByRole('link', { name: 'Active' }).click(); - }); - - await test.step('Showing completed items', async () => { - await page.getByRole('link', { name: 'Completed' }).click(); - }); - - await expect(page.getByTestId('todo-item')).toHaveCount(1); - await page.goBack(); - await expect(page.getByTestId('todo-item')).toHaveCount(2); - await page.goBack(); - await expect(page.getByTestId('todo-item')).toHaveCount(3); - }); - - test('should allow me to display completed items', async ({ page }) => { - await page.locator('.todo-list li .toggle').nth(1).check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Completed' }).click(); - await expect(page.getByTestId('todo-item')).toHaveCount(1); - }); - - test('should allow me to display all items', async ({ page }) => { - await page.locator('.todo-list li .toggle').nth(1).check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Active' }).click(); - await page.getByRole('link', { name: 'Completed' }).click(); - await page.getByRole('link', { name: 'All' }).click(); - await expect(page.getByTestId('todo-item')).toHaveCount(3); - }); - - test('should highlight the currently applied filter', async ({ page }) => { - await expect(page.getByRole('link', { name: 'All' })).toHaveClass('selected'); - await page.getByRole('link', { name: 'Active' }).click(); - // Page change - active items. - await expect(page.getByRole('link', { name: 'Active' })).toHaveClass('selected'); - await page.getByRole('link', { name: 'Completed' }).click(); - // Page change - completed items. - await expect(page.getByRole('link', { name: 'Completed' })).toHaveClass('selected'); - }); -}); - -async function createDefaultTodos(page) { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - for (const item of TODO_ITEMS) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } -} - -async function checkNumberOfTodosInLocalStorage(page: Page, expected: number) { - return await page.waitForFunction(e => { - return JSON.parse(localStorage['react-todos']).length === e; - }, expected); -} - -async function checkNumberOfCompletedTodosInLocalStorage(page: Page, expected: number) { - return await page.waitForFunction(e => { - return JSON.parse(localStorage['react-todos']).filter((todo: any) => todo.completed).length === e; - }, expected); -} - -async function checkTodosInLocalStorage(page: Page, title: string) { - return await page.waitForFunction(t => { - return JSON.parse(localStorage['react-todos']).map((todo: any) => todo.title).includes(t); - }, title); -} diff --git a/examples/todomvc/tests/toggle/mark-all-todos-complete.spec.ts b/examples/todomvc/tests/toggle/mark-all-todos-complete.spec.ts deleted file mode 100644 index 3bd89cb4df..0000000000 --- a/examples/todomvc/tests/toggle/mark-all-todos-complete.spec.ts +++ /dev/null @@ -1,39 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Marking Todos Complete/Incomplete', () => { - test('Mark All Todos Complete', async ({ page }) => { - // 1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" - const newTodoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - - await newTodoInput.fill('Buy groceries'); - await newTodoInput.press('Enter'); - - await newTodoInput.fill('Walk the dog'); - await newTodoInput.press('Enter'); - - await newTodoInput.fill('Call dentist'); - await newTodoInput.press('Enter'); - - // 2. Click the "Mark all as complete" checkbox - await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click(); - - // Expected results to verify: - // - All todo checkboxes become checked - const todoCheckboxes = page.getByRole('checkbox', { name: 'Toggle Todo' }); - await expect(todoCheckboxes.nth(0)).toBeChecked(); - await expect(todoCheckboxes.nth(1)).toBeChecked(); - await expect(todoCheckboxes.nth(2)).toBeChecked(); - - // - Counter shows "0 items left" - await expect(page.getByText('0 items left')).toBeVisible(); - - // - "Clear completed" button appears - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); - - // - "Mark all as complete" checkbox shows as checked - await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeChecked(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/toggle/mark-multiple-todos-complete.spec.ts b/examples/todomvc/tests/toggle/mark-multiple-todos-complete.spec.ts deleted file mode 100644 index 4a6ed1a2da..0000000000 --- a/examples/todomvc/tests/toggle/mark-multiple-todos-complete.spec.ts +++ /dev/null @@ -1,48 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Marking Todos Complete/Incomplete', () => { - test('Mark Multiple Todos Complete', async ({ page }) => { - const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - - // 1. Add todos: "Buy groceries", "Walk the dog", "Call dentist" - await todoInput.click(); - await todoInput.fill('Buy groceries'); - await todoInput.press('Enter'); - - await todoInput.fill('Walk the dog'); - await todoInput.press('Enter'); - - await todoInput.fill('Call dentist'); - await todoInput.press('Enter'); - - // Verify all todos are added - await expect(page.getByText('3 items left')).toBeVisible(); - - // 2. Click checkbox for "Buy groceries" - await page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo').click(); - - // 3. Click checkbox for "Call dentist" - await page.getByRole('listitem').filter({ hasText: 'Call dentist' }).getByLabel('Toggle Todo').click(); - - // Expected Results: - // - Two todos show as completed - const buyGroceriesCheckbox = page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo'); - const callDentistCheckbox = page.getByRole('listitem').filter({ hasText: 'Call dentist' }).getByLabel('Toggle Todo'); - const walkDogCheckbox = page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo'); - - await expect(buyGroceriesCheckbox).toBeChecked(); - await expect(callDentistCheckbox).toBeChecked(); - - // - Counter shows "1 item left" (for "Walk the dog") - await expect(page.getByText('1 item left')).toBeVisible(); - - // - "Clear completed" button appears - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); - - // - Only "Walk the dog" remains unchecked - await expect(walkDogCheckbox).not.toBeChecked(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/toggle/mark-single-todo-complete.spec.ts b/examples/todomvc/tests/toggle/mark-single-todo-complete.spec.ts deleted file mode 100644 index b76a25f412..0000000000 --- a/examples/todomvc/tests/toggle/mark-single-todo-complete.spec.ts +++ /dev/null @@ -1,39 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Marking Todos Complete/Incomplete', () => { - test('Mark Single Todo Complete', async ({ page }) => { - // 1. Add todo "Buy groceries" - const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - await todoInput.click(); - await todoInput.fill('Buy groceries'); - await todoInput.press('Enter'); - - // Verify todo was added successfully - await expect(page.getByText('Buy groceries')).toBeVisible(); - await expect(page.getByText('1 item left')).toBeVisible(); - - // 2. Click the checkbox next to "Buy groceries" - const todoCheckbox = page.getByRole('checkbox', { name: 'Toggle Todo' }); - await todoCheckbox.click(); - - // Expected Results: - // - Checkbox becomes checked - await expect(todoCheckbox).toBeChecked(); - - // - Todo text may show strikethrough or completed styling (verified by checking the todo is still visible) - await expect(page.getByText('Buy groceries')).toBeVisible(); - - // - Counter shows "0 items left" - await expect(page.getByText('0 items left')).toBeVisible(); - - // - "Clear completed" button appears - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); - - // - Delete button (×) becomes visible on hover - await page.getByText('Buy groceries').hover(); - await expect(page.getByRole('button', { name: 'Delete' })).toBeVisible(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/toggle/toggle-all-todos-incomplete.spec.ts b/examples/todomvc/tests/toggle/toggle-all-todos-incomplete.spec.ts deleted file mode 100644 index 11ec10d227..0000000000 --- a/examples/todomvc/tests/toggle/toggle-all-todos-incomplete.spec.ts +++ /dev/null @@ -1,37 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Marking Todos Complete/Incomplete', () => { - test('Toggle All Todos Back to Incomplete', async ({ page }) => { - // 1. Add todos: "Buy groceries", "Walk the dog" - await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries'); - await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); - - await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog'); - await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter'); - - // 2. Click "Mark all as complete" checkbox - await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click(); - - // 3. Click "Mark all as complete" checkbox again - await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click(); - - // Verify: All todo checkboxes become unchecked - const buyGroceriesCheckbox = page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByRole('checkbox', { name: 'Toggle Todo' }); - const walkDogCheckbox = page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByRole('checkbox', { name: 'Toggle Todo' }); - - await expect(buyGroceriesCheckbox).not.toBeChecked(); - await expect(walkDogCheckbox).not.toBeChecked(); - - // Verify: Counter shows "2 items left" - await expect(page.locator('text=2 items left')).toBeVisible(); - - // Verify: "Clear completed" button disappears - await expect(page.getByRole('button', { name: 'Clear completed' })).not.toBeVisible(); - - // Verify: "Mark all as complete" checkbox shows as unchecked - await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).not.toBeChecked(); - }); -}); \ No newline at end of file diff --git a/examples/todomvc/tests/toggle/toggle-todo-incomplete.spec.ts b/examples/todomvc/tests/toggle/toggle-todo-incomplete.spec.ts deleted file mode 100644 index 4f775fed38..0000000000 --- a/examples/todomvc/tests/toggle/toggle-todo-incomplete.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -// spec: specs/basic-operations.md -// seed: tests/seed.spec.ts - -import { test, expect } from '../fixtures'; - -test.describe('Marking Todos Complete/Incomplete', () => { - test('Toggle Todo Back to Incomplete', async ({ page }) => { - // 1. Add todo "Buy groceries" - const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' }); - await todoInput.click(); - await todoInput.fill('Buy groceries'); - await todoInput.press('Enter'); - - // Verify todo was added - const todoItem = page.getByText('Buy groceries'); - await expect(todoItem).toBeVisible(); - await expect(page.getByText('1 item left')).toBeVisible(); - - // 2. Click checkbox to mark complete - const todoCheckbox = page.getByRole('checkbox', { name: 'Toggle Todo' }); - await todoCheckbox.click(); - - // Verify todo is marked complete - await expect(todoCheckbox).toBeChecked(); - await expect(page.getByText('0 items left')).toBeVisible(); - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); - - // 3. Click checkbox again to mark incomplete - await todoCheckbox.click(); - - // Expected results to verify: - // - Checkbox becomes unchecked - await expect(todoCheckbox).not.toBeChecked(); - - // - Completed styling is removed (checkbox is unchecked indicates this) - // - Counter shows "1 item left" - await expect(page.getByText('1 item left')).toBeVisible(); - - // - "Clear completed" button disappears if no other completed todos exist - await expect(page.getByRole('button', { name: 'Clear completed' })).not.toBeVisible(); - - // Additional verification that the todo is still present and functional - await expect(todoItem).toBeVisible(); - await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).not.toBeChecked(); - }); -}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2235e615f9..ca73a9e87a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "playwright-internal", - "version": "1.56.0", + "version": "1.57.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "playwright-internal", - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "workspaces": [ "packages/*" @@ -34,9 +34,8 @@ "@vitejs/plugin-basic-ssl": "^1.1.0", "@vitejs/plugin-react": "^4.2.1", "@zip.js/zip.js": "^2.7.29", - "ansi-styles": "^4.3.0", "chokidar": "^3.5.3", - "chromium-bidi": "^9.0.0", + "chromium-bidi": "^11.0.0", "colors": "^1.4.0", "concurrently": "^6.2.1", "cross-env": "^7.0.3", @@ -49,7 +48,6 @@ "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^5.2.0", "formidable": "^2.1.1", - "immutable": "^4.3.7", "license-checker": "^25.0.1", "mime": "^3.0.0", "node-stream-zip": "^1.15.0", @@ -57,7 +55,7 @@ "react-dom": "^19.1.1", "ssim.js": "^3.5.0", "typescript": "^5.9.2", - "vite": "^6.3.6", + "vite": "^6.4.1", "ws": "^8.17.1", "xml2js": "^0.5.0", "yaml": "2.6.0", @@ -1781,6 +1779,13 @@ "node": ">=10" } }, + "node_modules/@tsconfig/node18": { + "version": "18.2.6", + "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.6.tgz", + "integrity": "sha512-eAWQzAjPj18tKnDzmWstz4OyWewLUNBm9tdoN9LayzoboRktYx3Enk1ZXPmThj55L7c4VWYq/Bzq0A51znZfhw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -2971,9 +2976,9 @@ } }, "node_modules/chromium-bidi": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-9.0.0.tgz", - "integrity": "sha512-CGUetd0G5Bq93BRnckGppWN1BwKYTTW7tMtaZ9PxeFF0LFj3GErytqfI60KgkmB7CcnvWIjdRDfVcFWvzErSyQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-11.0.0.tgz", + "integrity": "sha512-cM3DI+OOb89T3wO8cpPSro80Q9eKYJ7hGVXoGS3GkDPxnYSqiv+6xwpIf6XERyJ9Tdsl09hmNmY94BkgZdVekw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -4922,12 +4927,6 @@ "node": ">= 4" } }, - "node_modules/immutable": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", - "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", - "dev": true - }, "node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", @@ -7626,9 +7625,10 @@ } }, "node_modules/svelte": { - "version": "5.38.6", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.38.6.tgz", - "integrity": "sha512-ltBPlkvqk3bgCK7/N323atUpP3O3Y+DrGV4dcULrsSn4fZaaNnOmdplNznwfdWclAgvSr5rxjtzn/zJhRm6TKg==", + "version": "5.42.3", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.42.3.tgz", + "integrity": "sha512-+8dUmdJGvKSWEfbAgIaUmpD97s1bBAGxEf6s7wQonk+HNdMmrBZtpStzRypRqrYBFUmmhaUgBHUjraE8gLqWAw==", + "license": "MIT", "dependencies": { "@jridgewell/remapping": "^2.3.4", "@jridgewell/sourcemap-codec": "^1.5.0", @@ -8045,9 +8045,9 @@ } }, "node_modules/vite": { - "version": "6.3.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.6.tgz", - "integrity": "sha512-0msEVHJEScQbhkbVTb/4iHZdJ6SXp/AvxL2sjwYQFfBqleHtnCqv1J3sa9zbWz/6kW1m9Tfzn92vW+kZ1WV6QA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.1.tgz", + "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "license": "MIT", "dependencies": { "esbuild": "^0.25.0", @@ -8445,10 +8445,10 @@ "version": "0.0.0" }, "packages/playwright": { - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.0" + "playwright-core": "1.57.0" }, "bin": { "playwright": "cli.js" @@ -8462,11 +8462,11 @@ }, "packages/playwright-browser-chromium": { "name": "@playwright/browser-chromium", - "version": "1.56.0", + "version": "1.57.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.0" + "playwright-core": "1.57.0" }, "engines": { "node": ">=18" @@ -8474,11 +8474,11 @@ }, "packages/playwright-browser-firefox": { "name": "@playwright/browser-firefox", - "version": "1.56.0", + "version": "1.57.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.0" + "playwright-core": "1.57.0" }, "engines": { "node": ">=18" @@ -8486,22 +8486,22 @@ }, "packages/playwright-browser-webkit": { "name": "@playwright/browser-webkit", - "version": "1.56.0", + "version": "1.57.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.0" + "playwright-core": "1.57.0" }, "engines": { "node": ">=18" } }, "packages/playwright-chromium": { - "version": "1.56.0", + "version": "1.57.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.0" + "playwright-core": "1.57.0" }, "bin": { "playwright": "cli.js" @@ -8515,7 +8515,7 @@ "version": "0.0.0", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.0" + "playwright-core": "1.57.0" }, "engines": { "node": ">=18" @@ -8526,12 +8526,13 @@ "version": "1.0.0-next", "license": "Apache-2.0", "devDependencies": { + "@tsconfig/node18": "^18.2.6", "pkg-pr-new": "^0.0.59", "vite": "^6.1.0" } }, "packages/playwright-core": { - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" @@ -8542,12 +8543,12 @@ }, "packages/playwright-ct-core": { "name": "@playwright/experimental-ct-core", - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "dependencies": { - "playwright": "1.56.0", - "playwright-core": "1.56.0", - "vite": "^6.3.6" + "playwright": "1.57.0", + "playwright-core": "1.57.0", + "vite": "^6.4.1" }, "engines": { "node": ">=18" @@ -8555,10 +8556,10 @@ }, "packages/playwright-ct-react": { "name": "@playwright/experimental-ct-react", - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.56.0", + "@playwright/experimental-ct-core": "1.57.0", "@vitejs/plugin-react": "^4.2.1" }, "bin": { @@ -8570,10 +8571,10 @@ }, "packages/playwright-ct-react17": { "name": "@playwright/experimental-ct-react17", - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.56.0", + "@playwright/experimental-ct-core": "1.57.0", "@vitejs/plugin-react": "^4.2.1" }, "bin": { @@ -8585,10 +8586,10 @@ }, "packages/playwright-ct-svelte": { "name": "@playwright/experimental-ct-svelte", - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.56.0", + "@playwright/experimental-ct-core": "1.57.0", "@sveltejs/vite-plugin-svelte": "^5.1.0" }, "bin": { @@ -8603,10 +8604,10 @@ }, "packages/playwright-ct-vue": { "name": "@playwright/experimental-ct-vue", - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.56.0", + "@playwright/experimental-ct-core": "1.57.0", "@vitejs/plugin-vue": "^5.2.0" }, "bin": { @@ -8617,11 +8618,11 @@ } }, "packages/playwright-firefox": { - "version": "1.56.0", + "version": "1.57.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.0" + "playwright-core": "1.57.0" }, "bin": { "playwright": "cli.js" @@ -8632,10 +8633,10 @@ }, "packages/playwright-test": { "name": "@playwright/test", - "version": "1.56.0", + "version": "1.57.0", "license": "Apache-2.0", "dependencies": { - "playwright": "1.56.0" + "playwright": "1.57.0" }, "bin": { "playwright": "cli.js" @@ -8645,11 +8646,11 @@ } }, "packages/playwright-webkit": { - "version": "1.56.0", + "version": "1.57.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.0" + "playwright-core": "1.57.0" }, "bin": { "playwright": "cli.js" diff --git a/package.json b/package.json index 706751a1a4..d3bc13c159 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "playwright-internal", "private": true, - "version": "1.56.0", + "version": "1.57.0", "description": "A high-level API to automate web browsers", "repository": { "type": "git", @@ -25,8 +25,6 @@ "itest": "playwright test --config=tests/installation/playwright.config.ts", "stest": "playwright test --config=tests/stress/playwright.config.ts", "biditest": "playwright test --config=tests/bidi/playwright.config.ts", - "test-html-reporter": "playwright test --config=packages/html-reporter", - "test-web": "playwright test --config=packages/web", "ttest": "node ./tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli test --config=tests/playwright-test/playwright.config.ts", "ct": "playwright test tests/components/test-all.spec.js --reporter=list", "test": "playwright test --config=tests/library/playwright.config.ts", @@ -75,9 +73,8 @@ "@vitejs/plugin-basic-ssl": "^1.1.0", "@vitejs/plugin-react": "^4.2.1", "@zip.js/zip.js": "^2.7.29", - "ansi-styles": "^4.3.0", "chokidar": "^3.5.3", - "chromium-bidi": "^9.0.0", + "chromium-bidi": "^11.0.0", "colors": "^1.4.0", "concurrently": "^6.2.1", "cross-env": "^7.0.3", @@ -90,7 +87,6 @@ "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^5.2.0", "formidable": "^2.1.1", - "immutable": "^4.3.7", "license-checker": "^25.0.1", "mime": "^3.0.0", "node-stream-zip": "^1.15.0", @@ -98,7 +94,7 @@ "react-dom": "^19.1.1", "ssim.js": "^3.5.0", "typescript": "^5.9.2", - "vite": "^6.3.6", + "vite": "^6.4.1", "ws": "^8.17.1", "xml2js": "^0.5.0", "yaml": "2.6.0", diff --git a/packages/html-reporter/playwright.config.ts b/packages/html-reporter/playwright.config.ts deleted file mode 100644 index 1f849f807e..0000000000 --- a/packages/html-reporter/playwright.config.ts +++ /dev/null @@ -1,46 +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 { devices, defineConfig } from '@playwright/experimental-ct-react'; -import path from 'path'; -import url from 'url'; - -export default defineConfig({ - testDir: 'src', - forbidOnly: !!process.env.CI, - retries: process.env.CI ? 2 : 0, - snapshotPathTemplate: '{testDir}/__screenshots__/{projectName}/{testFilePath}/{arg}{ext}', - reporter: process.env.CI ? [ - ['blob', { fileName: `${process.env.PWTEST_BOT_NAME}.zip` }], - ] : [ - ['html'] - ], - use: { - ctPort: 3101, - ctViteConfig: { - resolve: { - alias: { - '@web': path.resolve(path.dirname(url.fileURLToPath(import.meta.url)), '../web/src'), - }, - } - }, - trace: 'on-first-retry', - }, - projects: [{ - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }], -}); diff --git a/packages/html-reporter/playwright/index.html b/packages/html-reporter/playwright/index.html deleted file mode 100644 index b18a1e9c7d..0000000000 --- a/packages/html-reporter/playwright/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - Playwright Test Report - - -
- - - diff --git a/packages/html-reporter/playwright/index.ts b/packages/html-reporter/playwright/index.ts deleted file mode 100644 index 5137631e68..0000000000 --- a/packages/html-reporter/playwright/index.ts +++ /dev/null @@ -1,17 +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 '../src/theme.css'; diff --git a/packages/html-reporter/src/chip.css b/packages/html-reporter/src/chip.css index 66d1ea3d9d..88137cdbcd 100644 --- a/packages/html-reporter/src/chip.css +++ b/packages/html-reporter/src/chip.css @@ -50,12 +50,17 @@ border-bottom-right-radius: 6px; padding: 16px; margin-bottom: 12px; + overflow: hidden; } .chip-body-no-insets { padding: 0; } +.chip-footer { + border-top: 1px solid var(--color-border-default); +} + @media only screen and (max-width: 600px) { .chip-header { border-radius: 0; diff --git a/packages/html-reporter/src/chip.spec.tsx b/packages/html-reporter/src/chip.spec.tsx deleted file mode 100644 index 8c88fee071..0000000000 --- a/packages/html-reporter/src/chip.spec.tsx +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * 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 { expect, test } from '@playwright/experimental-ct-react'; -import { AutoChip, Chip as LocalChip } from './chip'; - -test.use({ viewport: { width: 500, height: 500 } }); - -test('expand collapse', async ({ mount }) => { - const component = await mount( - Chip body - ); - await expect(component.getByText('Chip body')).toBeVisible(); - await component.getByText('Title').click(); - await expect(component.getByText('Chip body')).not.toBeVisible(); - await component.getByText('Title').click(); - await expect(component.getByText('Chip body')).toBeVisible(); -}); - -test('render long title', async ({ mount }) => { - const title = 'Extremely long title. '.repeat(10); - const component = await mount( - Chip body - ); - await expect(component).toContainText('Extremely long title.'); - await expect(component.getByText('Extremely long title.')).toHaveAttribute('title', title); -}); - -test('setExpanded is called', async ({ mount }) => { - const expandedValues: boolean[] = []; - const component = await mount( expandedValues.push(expanded)}> - ); - - await component.getByText('Title').click(); - expect(expandedValues).toEqual([true]); -}); - -test('setExpanded should work', async ({ mount }) => { - const component = await mount( - Body - ); - await component.getByText('Title').click(); - await expect(component).toMatchAriaSnapshot(` - - button "Title" [expanded] - - region: Body - `); -}); diff --git a/packages/html-reporter/src/chip.tsx b/packages/html-reporter/src/chip.tsx index 456c8157ed..93e79abd4b 100644 --- a/packages/html-reporter/src/chip.tsx +++ b/packages/html-reporter/src/chip.tsx @@ -24,12 +24,13 @@ import { type AnchorID, useAnchor } from './links'; export const Chip: React.FC<{ header: React.JSX.Element | string, + footer?: React.JSX.Element | string, expanded?: boolean, noInsets?: boolean, setExpanded?: (expanded: boolean) => void, children?: any, dataTestId?: string, -}> = ({ header, expanded, setExpanded, children, noInsets, dataTestId }) => { +}> = ({ header, footer, expanded, setExpanded, children, noInsets, dataTestId }) => { const id = React.useId(); return
setExpanded?.(!expanded)} title={typeof header === 'string' ? header : undefined}> - {setExpanded && !!expanded && icons.downArrow()} - {setExpanded && !expanded && icons.rightArrow()} + {setExpanded ? (expanded ? : ) : } {header}
- {(!setExpanded || expanded) &&
{children}
} + {(!setExpanded || expanded) &&
+ {children} + {footer &&
{footer}
} +
}
; }; diff --git a/packages/html-reporter/src/common.css b/packages/html-reporter/src/common.css index c34e279923..c67df07e6a 100644 --- a/packages/html-reporter/src/common.css +++ b/packages/html-reporter/src/common.css @@ -215,6 +215,10 @@ article, aside, details, figcaption, figure, footer, header, main, menu, nav, se background-color: var(--color-canvas-subtle); } +.subnav-item[aria-selected="true"] { + background: var(--color-control-transparent-bg-hover); +} + .subnav-item:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; @@ -312,6 +316,10 @@ dialog { margin-right: 0; } +.subnav-item .octicon.octicon-clock { + margin-right: 0; + color: var(--color-fg-default) !important; +} @media only screen and (max-width: 600px) { .subnav-item, .form-control { border-radius: 0 !important; diff --git a/packages/html-reporter/src/filter.ts b/packages/html-reporter/src/filter.ts index 7e54c98d4d..36da555464 100644 --- a/packages/html-reporter/src/filter.ts +++ b/packages/html-reporter/src/filter.ts @@ -213,13 +213,17 @@ function cacheSearchValues(test: TestCaseSummary & { [searchValuesSymbol]?: Sear // Extract quoted groups of search params, or tokens separated by whitespace const SEARCH_PARAM_GROUP_REGEX = /("[^"]*"|"[^"]*$|\S+)/g; -export function filterWithQuery(existingQuery: string, token: string, append: boolean): string { +export function filterWithQuery(searchParams: URLSearchParams, token: string, append: boolean): string { + const result = new URLSearchParams(searchParams); + const existingQuery = searchParams.get('q') ?? ''; const tokens = [...existingQuery.matchAll(SEARCH_PARAM_GROUP_REGEX)].map(m => { const rawValue = m[0]; return rawValue.startsWith('"') && rawValue.endsWith('"') && rawValue.length > 1 ? rawValue.slice(1, rawValue.length - 1) : rawValue; }); - if (append) - return '#?q=' + joinTokens(!tokens.includes(token) ? [...tokens, token] : tokens.filter(t => t !== token)); + if (append) { + result.set('q', joinTokens(!tokens.includes(token) ? [...tokens, token] : tokens.filter(t => t !== token))); + return '#?' + result; + } // if metaKey or ctrlKey is not pressed, replace existing token with new token let prefix: 's:' | 'p:' | '@'; @@ -232,7 +236,9 @@ export function filterWithQuery(existingQuery: string, token: string, append: bo const newTokens = tokens.filter(t => !t.startsWith(prefix)); newTokens.push(token); - return '#?q=' + joinTokens(newTokens); + + result.set('q', joinTokens(newTokens)); + return '#?' + result; } function joinTokens(tokens: string[]): string { diff --git a/packages/html-reporter/src/headerView.spec.tsx b/packages/html-reporter/src/headerView.spec.tsx deleted file mode 100644 index 85e78758b0..0000000000 --- a/packages/html-reporter/src/headerView.spec.tsx +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * 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 { test, expect } from '@playwright/experimental-ct-react'; -import { GlobalFilterView } from './headerView'; -import { SearchParamsProvider } from './links'; - -test.use({ viewport: { width: 720, height: 200 } }); - -test('should render counters', async ({ mount }) => { - const component = await mount( - { }} /> - ); - await expect(component.locator('a', { hasText: 'All' }).locator('.counter')).toHaveText('90'); - await expect(component.locator('a', { hasText: 'Passed' }).locator('.counter')).toHaveText('42'); - await expect(component.locator('a', { hasText: 'Failed' }).locator('.counter')).toHaveText('31'); - await expect(component.locator('a', { hasText: 'Flaky' }).locator('.counter')).toHaveText('17'); - await expect(component.locator('a', { hasText: 'Skipped' }).locator('.counter')).toHaveText('10'); - await expect(component).toMatchAriaSnapshot(` - - navigation: - - link "All90" - - link "Passed42" - - link "Failed31" - - link "Flaky17" - - link "Skipped10" - `); -}); - -test('should toggle filters', async ({ page, mount }) => { - const filters: string[] = []; - const component = await mount( - filters.push(filterText)} - /> - ); - await component.locator('a', { hasText: 'All' }).click(); - await component.locator('a', { hasText: 'Passed' }).click(); - await expect(page).toHaveURL(/#\?q=s:passed/); - await component.locator('a', { hasText: 'Failed' }).click(); - await expect(page).toHaveURL(/#\?q=s:failed/); - await component.locator('a', { hasText: 'Flaky' }).click(); - await expect(page).toHaveURL(/#\?q=s:flaky/); - await component.locator('a', { hasText: 'Skipped' }).click(); - await expect(page).toHaveURL(/#\?q=s:skipped/); - await component.getByRole('textbox').fill('annot:annotation type=annotation description'); - expect(filters).toEqual(['', '', 's:passed ', 's:failed ', 's:flaky ', 's:skipped ', 'annot:annotation type=annotation description']); -}); diff --git a/packages/html-reporter/src/headerView.tsx b/packages/html-reporter/src/headerView.tsx index 471818876e..8f82dcedaa 100644 --- a/packages/html-reporter/src/headerView.tsx +++ b/packages/html-reporter/src/headerView.tsx @@ -20,7 +20,7 @@ import './colors.css'; import './common.css'; import './headerView.css'; import * as icons from './icons'; -import { Link, navigate, SearchParamsContext } from './links'; +import { Link, navigate, useSearchParams } from './links'; import { statusIcon } from './statusIcon'; import { filterWithQuery } from './filter'; import { linkifyText } from '@web/renderUtils'; @@ -48,12 +48,12 @@ export const GlobalFilterView: React.FC<{ filterText: string, setFilterText: (filterText: string) => void, }> = ({ stats, filterText, setFilterText }) => { - const searchParams = React.useContext(SearchParamsContext); + const searchParams = useSearchParams(); + const query = searchParams.get('q'); React.useEffect(() => { // Add an extra space such that users can easily add to query - const query = searchParams.get('q'); setFilterText(query ? `${query.trim()} ` : ''); - }, [searchParams, setFilterText]); + }, [query, setFilterText]); return (<>
@@ -64,10 +64,15 @@ export const GlobalFilterView: React.FC<{ event => { event.preventDefault(); const url = new URL(window.location.href); + const currentParams = new URLSearchParams(url.hash.slice(1)); // If
onSubmit happens immediately after onChange, the filterText state is not updated yet. // Using FormData here is a workaround to get the latest value. const q = new FormData(event.target as HTMLFormElement).get('q') as string; - url.hash = q ? '?' + new URLSearchParams({ q }) : ''; + const params = new URLSearchParams({ q }); + if (currentParams.has('speedboard')) + params.set('speedboard', ''); + if (!!params.toString()) + url.hash = '?' + params.toString(); navigate(url); } }> @@ -84,6 +89,8 @@ export const GlobalFilterView: React.FC<{ const StatsNavView: React.FC<{ stats: Stats }> = ({ stats }) => { + const searchParams = useSearchParams(); + return ; }; @@ -101,12 +111,14 @@ const NavLink: React.FC<{ token: string, count: number, }> = ({ token, count }) => { - const searchParams = React.useContext(SearchParamsContext); - const q = searchParams.get('q')?.toString() || ''; + const searchParams = useSearchParams(); + searchParams.delete('speedboard'); + searchParams.delete('testId'); + const queryToken = `s:${token}`; - const clickUrl = filterWithQuery(q, queryToken, false); - const ctrlClickUrl = filterWithQuery(q, queryToken, true); + const clickUrl = filterWithQuery(searchParams, queryToken, false); + const ctrlClickUrl = filterWithQuery(searchParams, queryToken, true); const label = token.charAt(0).toUpperCase() + token.slice(1); @@ -136,24 +148,24 @@ const SettingsButton: React.FC = () => { }} onMouseDown={preventDefault}> {icons.settings()} + setSettingsOpen(false)} + anchor={settingsRef} + dataTestId='settings-dialog' + > + + +
- setSettingsOpen(false)} - anchor={settingsRef} - dataTestId='settings-dialog' - > - - - ; }; diff --git a/packages/html-reporter/src/icons.tsx b/packages/html-reporter/src/icons.tsx index 85ce05c3fc..9c5292168e 100644 --- a/packages/html-reporter/src/icons.tsx +++ b/packages/html-reporter/src/icons.tsx @@ -17,6 +17,10 @@ import './colors.css'; import './common.css'; +export const spacer = () => { + return ; +}; + export const search = () => { return ; return href - ? {baseLabel} + ? {baseLabel} : baseLabel; }; @@ -41,36 +41,31 @@ export const ProjectAndTagLabelsView: React.FC<{ projectNames: string[], activeProjectName: string, otherLabels: string[], - useLinks?: boolean, style?: React.CSSProperties, -}> = ({ projectNames, activeProjectName, otherLabels, useLinks, style }) => { +}> = ({ projectNames, activeProjectName, otherLabels, style }) => { // We can have an empty project name if we have no projects specified in the config const hasProjectNames = projectNames.length > 0 && !!activeProjectName; return (hasProjectNames || otherLabels.length > 0) && - {!!useLinks ? : } + ; }; const LabelsClickView: React.FC<{ labels: string[], }> = ({ labels }) => { - const searchParams = React.useContext(SearchParamsContext); + const searchParams = useSearchParams(); const onClickHandle = React.useCallback((e: React.MouseEvent, label: string) => { e.preventDefault(); - const q = searchParams.get('q')?.toString() || ''; - navigate(filterWithQuery(q, label, e.metaKey || e.ctrlKey)); + if (searchParams.has('testId')) + searchParams.delete('speedboard'); + searchParams.delete('testId'); + navigate(filterWithQuery(searchParams, label, e.metaKey || e.ctrlKey)); }, [searchParams]); return <> {labels.map(label =>