diff --git a/.eslintignore b/.eslintignore index 38c19d93ec..f7365e0082 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,9 +1,11 @@ test/assets/modernizr.js +/tests/third_party/ /packages/*/lib/ *.js /packages/playwright-core/src/generated/* /packages/playwright-core/src/third_party/ /packages/playwright-core/types/* +/packages/playwright-ct-core/src/generated/* /index.d.ts utils/generate_types/overrides.d.ts utils/generate_types/test/test.ts diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index 52eb7d6a3e..0000000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -name: Bug Report -about: Something doesn't work like it should? Tell us! -title: "[BUG]" -labels: '' -assignees: '' - ---- - - - - - - - -### System info -- Playwright Version: [v1.XX] -- Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.] -- Browser: [All, Chromium, Firefox, WebKit] -- Other info: - -### Source code - -- [ ] I provided exact source code that allows reproducing the issue locally. - - - - - - -**Link to the GitHub repository with the repro** - -[https://github.com/your_profile/playwright_issue_title] - -or - -**Config file** - -```js -// playwright.config.ts -import { defineConfig, devices } from '@playwright/test'; - -export default defineConfig({ - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'], }, - }, - ] -}); -``` - -**Test file (self-contained)** - -```js -it('should check the box using setChecked', async ({ page }) => { - await page.setContent(``); - await page.getByRole('checkbox').check(); - await expect(page.getByRole('checkbox')).toBeChecked(); -}); -``` - -**Steps** -- [Run the test] -- [...] - -**Expected** - -[Describe expected behavior] - -**Actual** - -[Describe actual behavior] diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000000..5baad382eb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,100 @@ +name: Bug Report 🪲 +description: Create a bug report to help us improve +title: '[Bug]: ' +body: + - type: markdown + attributes: + value: | + # Please follow these steps first: + - type: markdown + attributes: + value: | + ## Troubleshoot + If Playwright is not behaving the way you expect, we'd ask you to look at the [documentation](https://playwright.dev/docs/intro) and search the issue tracker for evidence supporting your expectation. + Please make reasonable efforts to troubleshoot and rule out issues with your code, the configuration, or any 3rd party libraries you might be using. + Playwright offers [several debugging tools](https://playwright.dev/docs/debug) that you can use to troubleshoot your issues. + - type: markdown + attributes: + value: | + ## Ask for help through appropriate channels + If you feel unsure about the cause of the problem, consider asking for help on for example [StackOverflow](https://stackoverflow.com/questions/ask) or our [Discord channel](https://aka.ms/playwright/discord) before posting a bug report. The issue tracker is not a help forum. + - type: markdown + attributes: + value: | + ## Make a minimal reproduction + To file the report, you will need a GitHub repository with a minimal (but complete) example and simple/clear steps on how to reproduce the bug. + The simpler you can make it, the more likely we are to successfully verify and fix the bug. + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > Bug reports without a minimal reproduction will be rejected. + + --- + - type: input + id: version + attributes: + label: Version + description: | + The version of Playwright you are using. + Is it the [latest](https://github.com/microsoft/playwright/releases)? Test and see if the bug has already been fixed. + placeholder: ex. 1.41.1 + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Steps to reproduce + description: Please link to a repository with a minimal reproduction and describe accurately how we can reproduce/verify the bug. + placeholder: | + Example steps (replace with your own): + 1. Clone my repo at https://github.com//example + 2. npm install + 3. npm run test + 4. You should see the error come up + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected behavior + description: A description of what you expect to happen. + placeholder: I expect to see X or Y + validations: + required: true + - type: textarea + id: what-happened + attributes: + label: Actual behavior + description: | + A clear and concise description of the unexpected behavior. + Please include any relevant output here, especially any error messages. + placeholder: A bug happened! + validations: + required: true + - type: textarea + id: context + attributes: + label: Additional context + description: Anything else that might be relevant + validations: + required: false + - type: textarea + id: envinfo + attributes: + label: Environment + description: | + Please paste the output of running `npx envinfo --preset playwright`. + This will be automatically formatted as a code block, so no need for backticks. + placeholder: | + System: + OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish) + CPU: (8) arm64 + Binaries: + Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node + npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm + npmPackages: + @playwright/test: 1.41.1 => 1.41.1 + render: shell + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index de71858775..5d9345c265 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,3 +1,4 @@ +blank_issues_enabled: false contact_links: - name: Join our Discord Server url: https://aka.ms/playwright/discord diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 0000000000..0a683969a6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,29 @@ +name: Documentation 📖 +description: Submit a request to add or update documentation +title: '[Docs]: ' +labels: ['Documentation :book:'] +body: + - type: markdown + attributes: + value: | + ### Thank you for helping us improve our documentation! + Please be sure you are looking at [the Next version of the documentation](https://playwright.dev/docs/next/intro) before opening an issue here. + - type: textarea + id: links + attributes: + label: Page(s) + description: | + Links to one or more documentation pages that should be modified. + If you are reporting an issue with a specific section of a page, try to link directly to the nearest anchor. + If you are suggesting that a new page be created, link to the parent of the proposed page. + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the change you are requesting. + If the issue pertains to a single function or matcher, be sure to specify the entire call signature. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 0000000000..efec3315c1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,30 @@ +name: Feature Request 🚀 +description: Submit a proposal for a new feature +title: '[Feature]: ' +body: + - type: markdown + attributes: + value: | + ### Thank you for taking the time to suggest a new feature! + - type: textarea + id: description + attributes: + label: '🚀 Feature Request' + description: A clear and concise description of what the feature is. + validations: + required: true + - type: textarea + id: example + attributes: + label: Example + description: Describe how this feature would be used. + validations: + required: false + - type: textarea + id: motivation + attributes: + label: Motivation + description: | + Outline your motivation for the proposal. How will it make Playwright better? + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 37ec8a7d25..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: Feature request -about: Request new features to be added -title: "[Feature]" -labels: '' -assignees: '' - ---- - -Let us know what functionality you'd like to see in Playwright and what your use case is. -Do you think others might benefit from this as well? diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000000..9615afdc8a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,27 @@ +name: 'Questions / Help 💬' +description: If you have questions, please check StackOverflow or Discord +title: '[Please read the message below]' +labels: [':speech_balloon: Question'] +body: + - type: markdown + attributes: + value: | + ## Questions and Help 💬 + + This issue tracker is reserved for bug reports and feature requests. + + For anything else, such as questions or getting help, please see: + + - [The Playwright documentation](https://playwright.dev) + - [Our Discord server](https://aka.ms/playwright/discord) + - type: checkboxes + id: no-post + attributes: + label: | + Please do not submit this issue. + description: | + > [!IMPORTANT] + > This issue will be closed. + options: + - label: I understand + required: true diff --git a/.github/ISSUE_TEMPLATE/regression.md b/.github/ISSUE_TEMPLATE/regression.md deleted file mode 100644 index d6d7510a4c..0000000000 --- a/.github/ISSUE_TEMPLATE/regression.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Report regression -about: Functionality that used to work and does not any more -title: "[REGRESSION]: " -labels: '' -assignees: '' - ---- - -**Context:** -- GOOD Playwright Version: [what Playwright version worked nicely?] -- BAD Playwright Version: [what Playwright version doesn't work any more?] -- Operating System: [e.g. Windows, Linux or Mac] -- Extra: [any specific details about your environment] - -**Code Snippet** - -Help us help you! Put down a short code snippet that illustrates your bug and -that we can run and debug locally. For example: - -```javascript -const {chromium, webkit, firefox} = require('playwright'); - -(async () => { - const browser = await chromium.launch(); - // ... -})(); -``` - -**Describe the bug** - -Add any other details about the problem here. diff --git a/.github/ISSUE_TEMPLATE/regression.yml b/.github/ISSUE_TEMPLATE/regression.yml new file mode 100644 index 0000000000..bc0a101502 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/regression.yml @@ -0,0 +1,96 @@ +name: Report regression +description: Functionality that used to work and does not any more +title: "[Regression]: " + +body: + - type: markdown + attributes: + value: | + # Please follow these steps first: + - type: markdown + attributes: + value: | + ## Make a minimal reproduction + To file the report, you will need a GitHub repository with a minimal (but complete) example and simple/clear steps on how to reproduce the regression. + The simpler you can make it, the more likely we are to successfully verify and fix the regression. + - type: markdown + attributes: + value: | + > [!IMPORTANT] + > Regression reports without a minimal reproduction will be rejected. + + --- + - type: input + id: goodVersion + attributes: + label: Last Good Version + description: | + Last version of Playwright where the feature was working. + placeholder: ex. 1.40.1 + validations: + required: true + - type: input + id: badVersion + attributes: + label: First Bad Version + description: | + First version of Playwright where the feature was broken. + Is it the [latest](https://github.com/microsoft/playwright/releases)? Test and see if the regression has already been fixed. + placeholder: ex. 1.41.1 + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Steps to reproduce + description: Please link to a repository with a minimal reproduction and describe accurately how we can reproduce/verify the bug. + placeholder: | + Example steps (replace with your own): + 1. Clone my repo at https://github.com//example + 2. npm install + 3. npm run test + 4. You should see the error come up + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected behavior + description: A description of what you expect to happen. + placeholder: I expect to see X or Y + validations: + required: true + - type: textarea + id: what-happened + attributes: + label: Actual behavior + description: A clear and concise description of the unexpected behavior. + placeholder: A bug happened! + validations: + required: true + - type: textarea + id: context + attributes: + label: Additional context + description: Anything else that might be relevant + validations: + required: false + - type: textarea + id: envinfo + attributes: + label: Environment + description: | + Please paste the output of running `npx envinfo --preset playwright`. + This will be automatically formatted as a code block, so no need for backticks. + placeholder: | + System: + OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish) + CPU: (8) arm64 + Binaries: + Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node + npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm + npmPackages: + @playwright/test: 1.41.1 => 1.41.1 + render: shell + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/vscode-extension.md b/.github/ISSUE_TEMPLATE/vscode-extension.md deleted file mode 100644 index e623fa9de1..0000000000 --- a/.github/ISSUE_TEMPLATE/vscode-extension.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: VSCode extension bug -about: Something doesn't work like it should inside the Visual Studio Code extension or you have a feature request? Tell us! -title: "[BUG]" -labels: '' -assignees: '' - ---- - -**Context:** -- Playwright Version: [what Playwright version do you use?] -- Operating System: [e.g. Windows, Linux or Mac] -- Node.js version: [e.g. 12.22, 14.6] -- Visual Studio Code version: [e.g. 1.65] -- Playwright for VSCode extension version: [e.g. 1.2.3] -- Browser: [e.g. All, Chromium, Firefox, WebKit] -- Extra: [any specific details about your environment] - -**Code Snippet** - -Help us help you! Put down a short code snippet that illustrates your bug and -that we can run and debug locally. For example: - -**Describe the bug** - -Add any other details about the problem here. diff --git a/.github/actions/download-artifact/action.yml b/.github/actions/download-artifact/action.yml index 874b202c06..d279df5f8d 100644 --- a/.github/actions/download-artifact/action.yml +++ b/.github/actions/download-artifact/action.yml @@ -1,8 +1,8 @@ -name: 'Download blob report' -description: 'Download blob report from GitHub artifacts' +name: 'Download artifacts' +description: 'Download artifacts from GitHub' inputs: - name: - description: 'Name of the artifact to download' + namePrefix: + description: 'Name prefix of the artifacts to download' required: true type: string default: 'blob-report' @@ -10,31 +10,37 @@ inputs: description: 'Directory with downloaded artifacts' required: true type: string - default: 'blob-report' + default: '.' runs: using: "composite" steps: - - name: Download blob report - uses: actions/github-script@v6 + - name: Create temp downloads dir + shell: bash + run: mkdir -p '${{ inputs.path }}/artifacts' + - name: Download artifacts + uses: actions/github-script@v7 with: script: | console.log(`downloading artifacts for workflow_run: ${context.payload.workflow_run.id}`); console.log(`workflow_run: ${JSON.stringify(context.payload.workflow_run, null, 2)}`); - const { data } = await github.rest.actions.listWorkflowRunArtifacts({ + const allArtifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, { ...context.repo, run_id: context.payload.workflow_run.id }); - console.log('total = ', data.total_count); - const name = '${{ inputs.name }}'; - const report = data.artifacts.filter(a => a.name === name)[0]; - const result = await github.rest.actions.downloadArtifact({ - ...context.repo, - artifact_id: report.id, - archive_format: 'zip' - }); - console.log('download result', result); + console.log('total = ', allArtifacts.length); + const artifacts = allArtifacts.filter(a => a.name.startsWith('${{ inputs.namePrefix }}')); const fs = require('fs'); - fs.writeFileSync(`${name}.zip`, Buffer.from(result.data)); - - name: Unzip blob report + for (const artifact of artifacts) { + const result = await github.rest.actions.downloadArtifact({ + ...context.repo, + artifact_id: artifact.id, + archive_format: 'zip' + }); + console.log('downloaded artifact', result); + fs.writeFileSync(`${{ inputs.path }}/artifacts/${artifact.name}.zip`, Buffer.from(result.data)); + } + - name: Unzip artifacts shell: bash - run: unzip ${{ inputs.name }}.zip -d ${{ inputs.path }} + run: | + unzip -n '${{ inputs.path }}/artifacts/*.zip' -d ${{ inputs.path }} + rm -rf '${{ inputs.path }}/artifacts' diff --git a/.github/actions/upload-blob-report/action.yml b/.github/actions/upload-blob-report/action.yml index 9a091dce5c..87eda3baf8 100644 --- a/.github/actions/upload-blob-report/action.yml +++ b/.github/actions/upload-blob-report/action.yml @@ -5,16 +5,21 @@ inputs: description: 'Directory containing blob report' required: true type: string - default: 'blob-report' + default: 'test-results/blob-report' + job_name: + description: 'Unique job name' + required: true + type: string + default: '' runs: using: "composite" steps: - name: Upload blob report to GitHub if: always() && github.event_name == 'pull_request' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: all-blob-reports - path: ${{ inputs.report_dir }} + name: blob-report-${{ inputs.job_name }} + path: ${{ inputs.report_dir }}/** retention-days: 7 - name: Write triggering pull request number in a file if: always() && github.event_name == 'pull_request' @@ -22,7 +27,7 @@ runs: run: echo '${{ github.event.number }}' > pull_request_number.txt; - name: Upload artifact with the pull request number if: always() && github.event_name == 'pull_request' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: pull-request - path: pull_request_number.txt + name: pull-request-${{ inputs.job_name }} + path: pull_request_number.txt \ No newline at end of file diff --git a/.github/workflows/cherry_pick_into_release_branch.yml b/.github/workflows/cherry_pick_into_release_branch.yml index c326509e35..6350d7ea0d 100644 --- a/.github/workflows/cherry_pick_into_release_branch.yml +++ b/.github/workflows/cherry_pick_into_release_branch.yml @@ -23,7 +23,7 @@ jobs: echo "Version is not a two digit semver version" exit 1 fi - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: release-${{ github.event.inputs.version }} fetch-depth: 0 diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml index 7359f332d8..bc31bf7623 100644 --- a/.github/workflows/create_test_report.yml +++ b/.github/workflows/create_test_report.yml @@ -12,8 +12,8 @@ jobs: if: ${{ github.event.workflow_run.event == 'pull_request' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 @@ -26,8 +26,8 @@ jobs: - name: Download blob report artifact uses: ./.github/actions/download-artifact with: - name: all-blob-reports - path: all-blob-reports + namePrefix: 'blob-report' + path: 'all-blob-reports' - name: Merge reports run: | @@ -49,8 +49,8 @@ jobs: - name: Read pull request number uses: ./.github/actions/download-artifact with: - name: 'pull-request' - path: './' + namePrefix: 'pull-request' + path: '.' - name: Comment on PR uses: actions/github-script@v6 diff --git a/.github/workflows/infra.yml b/.github/workflows/infra.yml index d3a3fa0030..3580ecc97a 100644 --- a/.github/workflows/infra.yml +++ b/.github/workflows/infra.yml @@ -18,8 +18,8 @@ jobs: name: "docs & lint" runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -40,8 +40,8 @@ jobs: name: "Lint snippets" runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - uses: actions/setup-python@v4 diff --git a/.github/workflows/pr_check_client_side_changes.yml b/.github/workflows/pr_check_client_side_changes.yml index 4ec7b16827..c048bc3ca0 100644 --- a/.github/workflows/pr_check_client_side_changes.yml +++ b/.github/workflows/pr_check_client_side_changes.yml @@ -4,9 +4,11 @@ on: branches: - main paths: + - 'docs/src/api/**/*' - 'packages/playwright-core/src/client/**/*' - 'packages/playwright-core/src/utils/isomorphic/**/*' - 'packages/playwright/src/matchers/matchers.ts' + - 'packages/protocol/src/protocol.yml' jobs: check: name: Check diff --git a/.github/workflows/publish_canary.yml b/.github/workflows/publish_canary.yml index 4ff33481de..6c9eb046e0 100644 --- a/.github/workflows/publish_canary.yml +++ b/.github/workflows/publish_canary.yml @@ -13,15 +13,15 @@ env: jobs: publish-canary: - name: "publish canary NPM & Publish canary Docker" + name: "publish canary NPM" runs-on: ubuntu-20.04 if: github.repository == 'microsoft/playwright' permissions: contents: read id-token: write steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 registry-url: 'https://registry.npmjs.org' @@ -57,25 +57,14 @@ jobs: run: | utils/build/build-playwright-driver.sh utils/build/upload-playwright-driver.sh - - uses: azure/docker-login@v1 - with: - login-server: playwright.azurecr.io - username: playwright - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Set up Docker QEMU for arm64 docker builds - uses: docker/setup-qemu-action@v2 - with: - platforms: arm64 - - name: publish docker canary - run: ./utils/docker/publish_docker.sh canary publish-trace-viewer: name: "publish Trace Viewer to trace.playwright.dev" runs-on: ubuntu-20.04 if: github.repository == 'microsoft/playwright' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - name: Deploy Canary diff --git a/.github/workflows/publish_release_docker.yml b/.github/workflows/publish_release_docker.yml index 31a361e564..bc836960f1 100644 --- a/.github/workflows/publish_release_docker.yml +++ b/.github/workflows/publish_release_docker.yml @@ -17,11 +17,11 @@ env: jobs: publish-docker-release: name: "publish to DockerHub" - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: github.repository == 'microsoft/playwright' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 registry-url: 'https://registry.npmjs.org' @@ -31,7 +31,7 @@ jobs: username: playwright password: ${{ secrets.DOCKER_PASSWORD }} - name: Set up Docker QEMU for arm64 docker builds - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 - run: npm ci diff --git a/.github/workflows/publish_release_driver.yml b/.github/workflows/publish_release_driver.yml index 56c9201bcd..61524f9cd2 100644 --- a/.github/workflows/publish_release_driver.yml +++ b/.github/workflows/publish_release_driver.yml @@ -13,8 +13,8 @@ jobs: runs-on: ubuntu-20.04 if: github.repository == 'microsoft/playwright' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/publish_release_npm.yml b/.github/workflows/publish_release_npm.yml index 68c4e27630..3b92a01b14 100644 --- a/.github/workflows/publish_release_npm.yml +++ b/.github/workflows/publish_release_npm.yml @@ -16,8 +16,8 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/publish_release_traceviewer.yml b/.github/workflows/publish_release_traceviewer.yml index 0d41425774..60af5442e9 100644 --- a/.github/workflows/publish_release_traceviewer.yml +++ b/.github/workflows/publish_release_traceviewer.yml @@ -10,8 +10,8 @@ jobs: runs-on: ubuntu-20.04 if: github.repository == 'microsoft/playwright' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - name: Deploy Stable diff --git a/.github/workflows/roll_browser_into_playwright.yml b/.github/workflows/roll_browser_into_playwright.yml index c474f848df..69dba0804d 100644 --- a/.github/workflows/roll_browser_into_playwright.yml +++ b/.github/workflows/roll_browser_into_playwright.yml @@ -7,12 +7,15 @@ on: env: ELECTRON_SKIP_BINARY_DOWNLOAD: 1 +permissions: + contents: write + jobs: roll: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci diff --git a/.github/workflows/roll_driver_nodejs.yml b/.github/workflows/roll_driver_nodejs.yml index bef065ca71..7a58f1ee2f 100644 --- a/.github/workflows/roll_driver_nodejs.yml +++ b/.github/workflows/roll_driver_nodejs.yml @@ -10,8 +10,8 @@ jobs: runs-on: ubuntu-22.04 if: github.repository == 'microsoft/playwright' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: node utils/build/update-playwright-driver-version.mjs diff --git a/.github/workflows/tests_components.yml b/.github/workflows/tests_components.yml index 2bed064f83..7291729220 100644 --- a/.github/workflows/tests_components.yml +++ b/.github/workflows/tests_components.yml @@ -32,8 +32,8 @@ jobs: node-version: 20 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm ci diff --git a/.github/workflows/tests_electron.yml b/.github/workflows/tests_electron.yml index 193c82f71f..4427cc5e9c 100644 --- a/.github/workflows/tests_electron.yml +++ b/.github/workflows/tests_electron.yml @@ -28,8 +28,8 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml index 86365a6345..0ad4b68294 100644 --- a/.github/workflows/tests_primary.yml +++ b/.github/workflows/tests_primary.yml @@ -42,9 +42,11 @@ jobs: node-version: 20 browser: chromium runs-on: ${{ matrix.os }} + env: + PWTEST_BOT_NAME: "${{ matrix.browser }}-${{ matrix.os }}-node${{ matrix.node-version }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm ci @@ -54,8 +56,6 @@ jobs: - run: npm run build - run: npx playwright install --with-deps ${{ matrix.browser }} chromium - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }} - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-${{ matrix.os }}-node${{ matrix.node-version }}" - run: node tests/config/checkCoverage.js ${{ matrix.browser }} - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() @@ -65,6 +65,7 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} test_linux_chromium_tot: name: ${{ matrix.os }} (chromium tip-of-tree) @@ -73,9 +74,11 @@ jobs: matrix: os: [ubuntu-20.04] runs-on: ${{ matrix.os }} + env: + PWTEST_BOT_NAME: "${{ matrix.os }}-chromium-tip-of-tree" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -87,7 +90,7 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=chromium env: PWTEST_CHANNEL: chromium-tip-of-tree - PWTEST_BLOB_REPORT_NAME: "${{ matrix.os }}-chromium-tip-of-tree" + PWTEST_BOT_NAME: "${{ matrix.os }}-chromium-tip-of-tree" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -96,6 +99,7 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} test_test_runner: name: Test Runner @@ -104,24 +108,31 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] node-version: [18] - shard: [1/2, 2/2] + shardIndex: [1, 2] + shardTotal: [2] include: - os: ubuntu-latest node-version: 16 - shard: 1/2 + shardIndex: 1 + shardTotal: 2 - os: ubuntu-latest node-version: 16 - shard: 2/2 + shardIndex: 2 + shardTotal: 2 - os: ubuntu-latest node-version: 20 - shard: 1/2 + shardIndex: 1 + shardTotal: 2 - os: ubuntu-latest node-version: 20 - shard: 2/2 + shardIndex: 2 + shardTotal: 2 runs-on: ${{ matrix.os }} + env: + PWTEST_BOT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}-${{ matrix.shardIndex }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{matrix.node-version}} - run: npm ci @@ -129,13 +140,9 @@ jobs: DEBUG: pw:install - run: npm run build - run: npx playwright install --with-deps - - run: npm run ttest -- --shard ${{ matrix.shard }} - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}" + - run: npm run ttest -- --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} if: matrix.os != 'ubuntu-latest' - - run: xvfb-run npm run ttest -- --shard ${{ matrix.shard }} - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.os }}-node${{ matrix.node-version }}" + - run: xvfb-run npm run ttest -- --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} if: matrix.os == 'ubuntu-latest' - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() @@ -145,13 +152,14 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} test_web_components: name: Web Components runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -162,29 +170,33 @@ jobs: - run: npx playwright install --with-deps - run: npm run test-html-reporter env: - PWTEST_BLOB_REPORT_NAME: "web-components-html-reporter" + PWTEST_BOT_NAME: "web-components-html-reporter" - name: Upload blob report if: always() 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: always() env: - PWTEST_BLOB_REPORT_NAME: "web-components-web" + PWTEST_BOT_NAME: "web-components-web" - name: Upload blob report if: always() 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" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -205,18 +217,16 @@ jobs: working-directory: ./playwright-vscode - name: Run extension tests run: npm run test -- --workers=1 - env: - PWTEST_BLOB_REPORT_NAME: "vscode-extension" working-directory: ./playwright-vscode - name: Upload blob report if: always() uses: ./.github/actions/upload-blob-report with: - report_dir: ./playwright-vscode/blob-report + report_dir: playwright-vscode/blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} test_package_installations: name: "Installation Test ${{ matrix.os }}" - runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -224,10 +234,13 @@ jobs: - ubuntu-latest - macos-latest - windows-latest + runs-on: ${{ matrix.os }} timeout-minutes: 30 + env: + PWTEST_BOT_NAME: "package-installations-${{ matrix.os }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -239,12 +252,8 @@ jobs: - run: npm install -g pnpm@8 - run: npm run itest if: matrix.os != 'ubuntu-latest' - env: - PWTEST_BLOB_REPORT_NAME: "package-installations-${{ matrix.os }}" - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run itest if: matrix.os == 'ubuntu-latest' - env: - PWTEST_BLOB_REPORT_NAME: "package-installations-${{ matrix.os }}" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -253,3 +262,4 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.yml index 61429074c2..816bf5c3f9 100644 --- a/.github/workflows/tests_secondary.yml +++ b/.github/workflows/tests_secondary.yml @@ -29,9 +29,11 @@ jobs: browser: [chromium, firefox, webkit] os: [ubuntu-20.04] runs-on: ${{ matrix.os }} + env: + PWTEST_BOT_NAME: "${{ matrix.browser }}-${{ matrix.os }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -41,8 +43,6 @@ jobs: - run: npm run build - run: npx playwright install --with-deps ${{ matrix.browser }} chromium - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }} - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-${{ matrix.os }}" - run: node tests/config/checkCoverage.js ${{ matrix.browser }} - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() @@ -52,18 +52,21 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} test_mac: name: ${{ matrix.os }} (${{ matrix.browser }}) strategy: fail-fast: false matrix: - os: [macos-12, macos-13] + os: [macos-12, macos-13, macos-14] browser: [chromium, firefox, webkit] runs-on: ${{ matrix.os }} + env: + PWTEST_BOT_NAME: "${{ matrix.browser }}-${{ matrix.os }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -73,8 +76,6 @@ jobs: - run: npm run build - run: npx playwright install --with-deps ${{ matrix.browser }} chromium - run: npm run test -- --project=${{ matrix.browser }} - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-${{ matrix.os }}" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -83,6 +84,7 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} test_win: name: "Windows" @@ -91,9 +93,11 @@ jobs: matrix: browser: [chromium, firefox, webkit] runs-on: windows-latest + env: + PWTEST_BOT_NAME: "${{ matrix.browser }}-windows-latest" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -105,13 +109,9 @@ jobs: - run: npm run test -- --project=${{ matrix.browser }} --workers=1 if: matrix.browser == 'firefox' shell: bash - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-windows-latest" - run: npm run test -- --project=${{ matrix.browser }} if: matrix.browser != 'firefox' shell: bash - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-windows-latest" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -120,6 +120,7 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} test-package-installations-other-node-versions: name: "Installation Test ${{ matrix.os }} (${{ matrix.node_version }})" @@ -134,8 +135,8 @@ jobs: node_version: 20 timeout-minutes: 30 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} - run: npm ci @@ -161,9 +162,11 @@ jobs: browser: [chromium, firefox, webkit] os: [ubuntu-20.04, ubuntu-22.04, macos-latest, windows-latest] runs-on: ${{ matrix.os }} + env: + PWTEST_BOT_NAME: "${{ matrix.browser }}-headed-${{ matrix.os }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -174,12 +177,8 @@ jobs: - run: npx playwright install --with-deps ${{ matrix.browser }} chromium - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }} --headed if: always() && startsWith(matrix.os, 'ubuntu-') - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-headed-${{ matrix.os }}" - run: npm run test -- --project=${{ matrix.browser }} --headed if: always() && !startsWith(matrix.os, 'ubuntu-') - env: - PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-headed-${{ matrix.os }}" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -188,6 +187,7 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} transport_linux: name: "Transport" @@ -196,9 +196,11 @@ jobs: matrix: mode: [driver, service] runs-on: ubuntu-20.04 + env: + PWTEST_BOT_NAME: "${{ matrix.mode }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -210,7 +212,6 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_MODE: ${{ matrix.mode }} - PWTEST_BLOB_REPORT_NAME: "${{ matrix.mode }}" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -219,6 +220,7 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} tracing_linux: name: Tracing ${{ matrix.browser }} ${{ matrix.channel }} @@ -232,9 +234,11 @@ jobs: - browser: chromium channel: chromium-tip-of-tree runs-on: ubuntu-20.04 + env: + PWTEST_BOT_NAME: "tracing-${{ matrix.channel || matrix.browser }}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -247,7 +251,6 @@ jobs: env: PWTEST_TRACE: 1 PWTEST_CHANNEL: ${{ matrix.channel }} - PWTEST_BLOB_REPORT_NAME: "tracing-${{ matrix.channel || matrix.browser }}" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -256,13 +259,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} chrome_stable_linux: name: "Chrome Stable (Linux)" runs-on: ubuntu-20.04 + env: + PWTEST_BOT_NAME: "chrome-stable-linux" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -273,7 +279,6 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: chrome - PWTEST_BLOB_REPORT_NAME: "chrome-stable-linux" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -282,13 +287,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} chrome_stable_win: name: "Chrome Stable (Win)" runs-on: windows-latest + env: + PWTEST_BOT_NAME: "chrome-stable-windows" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -300,7 +308,6 @@ jobs: shell: bash env: PWTEST_CHANNEL: chrome - PWTEST_BLOB_REPORT_NAME: "chrome-stable-windows" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -309,13 +316,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} chrome_stable_mac: name: "Chrome Stable (Mac)" runs-on: macos-latest + env: + PWTEST_BOT_NAME: "chrome-stable-mac" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -326,7 +336,6 @@ jobs: - run: npm run ctest env: PWTEST_CHANNEL: chrome - PWTEST_BLOB_REPORT_NAME: "chrome-stable-mac" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -335,17 +344,21 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} chromium_tot: name: Chromium TOT ${{ matrix.os }} runs-on: ${{ matrix.os }} + env: + PWTEST_CHANNEL: chromium-tip-of-tree + PWTEST_BOT_NAME: "tip-of-tree-${{ matrix.os }}" strategy: fail-fast: false matrix: os: [ubuntu-20.04, macos-12, windows-latest] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -355,14 +368,8 @@ jobs: - run: npx playwright install --with-deps chromium-tip-of-tree - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest if: matrix.os == 'ubuntu-20.04' - env: - PWTEST_CHANNEL: chromium-tip-of-tree - PWTEST_BLOB_REPORT_NAME: "tip-of-tree-${{ matrix.os }}" - run: npm run ctest if: matrix.os != 'ubuntu-20.04' - env: - PWTEST_CHANNEL: chromium-tip-of-tree - PWTEST_BLOB_REPORT_NAME: "tip-of-tree-${{ matrix.os }}" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -371,17 +378,21 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} chromium_tot_headed: name: Chromium TOT headed ${{ matrix.os }} runs-on: ${{ matrix.os }} + env: + PWTEST_CHANNEL: chromium-tip-of-tree + PWTEST_BOT_NAME: "tip-of-tree-headed-${{ matrix.os }}" strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -391,14 +402,8 @@ jobs: - run: npx playwright install --with-deps chromium-tip-of-tree - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest -- --headed if: matrix.os == 'ubuntu-latest' - env: - PWTEST_CHANNEL: chromium-tip-of-tree - PWTEST_BLOB_REPORT_NAME: "tip-of-tree-headed-${{ matrix.os }}" - run: npm run ctest -- --headed if: matrix.os != 'ubuntu-latest' - env: - PWTEST_CHANNEL: chromium-tip-of-tree - PWTEST_BLOB_REPORT_NAME: "tip-of-tree-headed-${{ matrix.os }}" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -407,13 +412,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} firefox_beta_linux: name: "Firefox Beta (Linux)" runs-on: ubuntu-20.04 + env: + PWTEST_BOT_NAME: "firefox-beta-linux" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -424,7 +432,6 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ftest env: PWTEST_CHANNEL: firefox-beta - PWTEST_BLOB_REPORT_NAME: "firefox-beta-linux" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -433,13 +440,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} firefox_beta_win: name: "Firefox Beta (Win)" runs-on: windows-latest + env: + PWTEST_BOT_NAME: "firefox-beta-windows" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -451,7 +461,6 @@ jobs: shell: bash env: PWTEST_CHANNEL: firefox-beta - PWTEST_BLOB_REPORT_NAME: "firefox-beta-windows" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -460,13 +469,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} firefox_beta_mac: name: "Firefox Beta (Mac)" runs-on: macos-latest + env: + PWTEST_BOT_NAME: "firefox-beta-mac" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -477,7 +489,6 @@ jobs: - run: npm run ftest env: PWTEST_CHANNEL: firefox-beta - PWTEST_BLOB_REPORT_NAME: "firefox-beta-mac" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -486,13 +497,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_stable_mac: name: "Edge Stable (Mac)" runs-on: macos-latest + env: + PWTEST_BOT_NAME: "edge-stable-mac" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -503,7 +517,6 @@ jobs: - run: npm run ctest env: PWTEST_CHANNEL: msedge - PWTEST_BLOB_REPORT_NAME: "edge-stable-mac" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -512,13 +525,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_stable_win: name: "Edge Stable (Win)" runs-on: windows-latest + env: + PWTEST_BOT_NAME: "edge-stable-windows" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -530,7 +546,6 @@ jobs: shell: bash env: PWTEST_CHANNEL: msedge - PWTEST_BLOB_REPORT_NAME: "edge-stable-windows" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -539,13 +554,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_stable_linux: name: "Edge Stable (Linux)" runs-on: ubuntu-20.04 + env: + PWTEST_BOT_NAME: "edge-stable-linux" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -556,7 +574,6 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: msedge - PWTEST_BLOB_REPORT_NAME: "edge-stable-linux" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -565,13 +582,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_beta_mac: name: "Edge Beta (Mac)" runs-on: macos-latest + env: + PWTEST_BOT_NAME: "edge-beta-mac" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -582,7 +602,6 @@ jobs: - run: npm run ctest env: PWTEST_CHANNEL: msedge-beta - PWTEST_BLOB_REPORT_NAME: "edge-beta-mac" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -591,13 +610,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_beta_win: name: "Edge Beta (Win)" runs-on: windows-latest + env: + PWTEST_BOT_NAME: "edge-beta-windows" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -609,7 +631,6 @@ jobs: shell: bash env: PWTEST_CHANNEL: msedge-beta - PWTEST_BLOB_REPORT_NAME: "edge-beta-windows" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -618,13 +639,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_beta_linux: name: "Edge Beta (Linux)" runs-on: ubuntu-20.04 + env: + PWTEST_BOT_NAME: "edge-beta-linux" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -635,7 +659,6 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: msedge-beta - PWTEST_BLOB_REPORT_NAME: "edge-beta-linux" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -644,13 +667,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_dev_mac: name: "Edge Dev (Mac)" runs-on: macos-latest + env: + PWTEST_BOT_NAME: "edge-dev-mac" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -661,7 +687,6 @@ jobs: - run: npm run ctest env: PWTEST_CHANNEL: msedge-dev - PWTEST_BLOB_REPORT_NAME: "edge-dev-mac" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -670,13 +695,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_dev_win: name: "Edge Dev (Win)" runs-on: windows-latest + env: + PWTEST_BOT_NAME: "edge-dev-windows" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -688,7 +716,6 @@ jobs: shell: bash env: PWTEST_CHANNEL: msedge-dev - PWTEST_BLOB_REPORT_NAME: "edge-dev-windows" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -697,13 +724,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} edge_dev_linux: name: "Edge Dev (Linux)" runs-on: ubuntu-20.04 + env: + PWTEST_BOT_NAME: "edge-dev-linux" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -714,7 +744,6 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: msedge-dev - PWTEST_BLOB_REPORT_NAME: "edge-dev-linux" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -723,13 +752,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} chrome_beta_linux: name: "Chrome Beta (Linux)" runs-on: ubuntu-20.04 + env: + PWTEST_BOT_NAME: "chrome-beta-linux" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -740,7 +772,6 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ctest env: PWTEST_CHANNEL: chrome-beta - PWTEST_BLOB_REPORT_NAME: "chrome-beta-linux" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -749,13 +780,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} chrome_beta_win: name: "Chrome Beta (Win)" runs-on: windows-latest + env: + PWTEST_BOT_NAME: "chrome-beta-windows" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -767,7 +801,6 @@ jobs: shell: bash env: PWTEST_CHANNEL: chrome-beta - PWTEST_BLOB_REPORT_NAME: "chrome-beta-windows" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -776,13 +809,16 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} chrome_beta_mac: name: "Chrome Beta (Mac)" runs-on: macos-latest + env: + PWTEST_BOT_NAME: "chrome-beta-mac" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -793,7 +829,6 @@ jobs: - run: npm run ctest env: PWTEST_CHANNEL: chrome-beta - PWTEST_BLOB_REPORT_NAME: "chrome-beta-mac" - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() shell: bash @@ -802,13 +837,14 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} build-playwright-driver: name: "build-playwright-driver" runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -819,9 +855,11 @@ jobs: test_linux_chromium_headless_new: name: Linux Chromium Headless New runs-on: ubuntu-latest + env: + PWTEST_BOT_NAME: "headless-new" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci @@ -833,7 +871,6 @@ jobs: - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=chromium env: PLAYWRIGHT_CHROMIUM_USE_HEADLESS_NEW: 1 - PWTEST_BLOB_REPORT_NAME: "headless-new" - run: node tests/config/checkCoverage.js chromium - run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json if: always() @@ -843,3 +880,4 @@ jobs: uses: ./.github/actions/upload-blob-report with: report_dir: blob-report + job_name: ${{ env.PWTEST_BOT_NAME }} diff --git a/.github/workflows/tests_service.yml b/.github/workflows/tests_service.yml index 6450c4c3a1..9c932f38e4 100644 --- a/.github/workflows/tests_service.yml +++ b/.github/workflows/tests_service.yml @@ -17,8 +17,8 @@ jobs: browser: [chromium, firefox, webkit] runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 @@ -27,7 +27,7 @@ jobs: env: PWTEST_MODE: service2 PWTEST_TRACE: 1 - PWTEST_BLOB_REPORT_NAME: "${{ matrix.browser }}-${{ matrix.service-os }}-service" + PWTEST_BOT_NAME: "${{ matrix.browser }}-${{ matrix.service-os }}-service" PLAYWRIGHT_SERVICE_ACCESS_KEY: ${{ secrets.PLAYWRIGHT_SERVICE_ACCESS_KEY }} PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }} PLAYWRIGHT_SERVICE_OS: ${{ matrix.service-os }} @@ -46,8 +46,8 @@ jobs: if: always() runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 diff --git a/.github/workflows/tests_stress.yml b/.github/workflows/tests_stress.yml index 8cfecb8d7c..7c2ce79088 100644 --- a/.github/workflows/tests_stress.yml +++ b/.github/workflows/tests_stress.yml @@ -27,8 +27,8 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 16 - run: npm ci @@ -40,13 +40,19 @@ jobs: if: always() - run: npm run stest browsers -- --project=chromium if: always() + - run: npm run stest frames -- --project=chromium + if: always() - run: npm run stest contexts -- --project=webkit if: always() - run: npm run stest browsers -- --project=webkit if: always() + - run: npm run stest frames -- --project=webkit + if: always() - run: npm run stest contexts -- --project=firefox if: always() - run: npm run stest browsers -- --project=firefox if: always() + - run: npm run stest frames -- --project=firefox + if: always() - run: npm run stest heap -- --project=chromium if: always() diff --git a/.github/workflows/tests_video.yml b/.github/workflows/tests_video.yml index 54c97bedca..f39b544f93 100644 --- a/.github/workflows/tests_video.yml +++ b/.github/workflows/tests_video.yml @@ -22,8 +22,8 @@ jobs: os: [ubuntu-20.04, ubuntu-22.04] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - run: npm ci diff --git a/.github/workflows/tests_webview2.yml b/.github/workflows/tests_webview2.yml index 4fd33af5ba..425a7bbc8a 100644 --- a/.github/workflows/tests_webview2.yml +++ b/.github/workflows/tests_webview2.yml @@ -25,13 +25,13 @@ jobs: name: WebView2 runs-on: windows-2022 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 - - uses: actions/setup-dotnet@v2 + - uses: actions/setup-dotnet@v3 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - run: npm ci env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 diff --git a/.gitignore b/.gitignore index 0978f13e88..8902876690 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,8 @@ node_modules/ .vscode .idea yarn.lock -/packages/playwright-core/src/generated/* +/packages/playwright-core/src/generated +/packages/playwright-ct-core/src/generated packages/*/lib/ drivers/ .android-sdk/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 81bbff56b6..264793fc2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ We strongly recommend that you open an issue before beginning any code modificat ### Getting Code -Make sure you're running Node.js 16+ and NPM 8+, to verify and upgrade NPM do: +Make sure you're running Node.js 20 to verify and upgrade NPM do: ```bash node --version diff --git a/README.md b/README.md index 52eae54863..4fffb3be52 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🎭 Playwright -[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) [![Chromium version](https://img.shields.io/badge/chromium-120.0.6099.5-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-118.0.1-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-17.4-blue.svg?logo=safari)](https://webkit.org/) +[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) [![Chromium version](https://img.shields.io/badge/chromium-122.0.6261.57-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-122.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-17.4-blue.svg?logo=safari)](https://webkit.org/) ## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright) @@ -8,9 +8,9 @@ Playwright is a framework for Web Testing and Automation. It allows testing [Chr | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 120.0.6099.5 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 122.0.6261.57 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 17.4 | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Firefox 118.0.1 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 122.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | Headless execution is supported for all browsers on all platforms. Check out [system requirements](https://playwright.dev/docs/intro#system-requirements) for details. diff --git a/babel.config.json b/babel.config.json index cb1cad7f3a..3e345f4274 100644 --- a/babel.config.json +++ b/babel.config.json @@ -4,11 +4,11 @@ }, "plugins": [ ["@babel/plugin-transform-typescript", { "allowDeclareFields": true } ], - "@babel/plugin-proposal-export-namespace-from", - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-logical-assignment-operators", - "@babel/plugin-proposal-nullish-coalescing-operator", - "@babel/plugin-proposal-optional-chaining", + "@babel/plugin-transform-export-namespace-from", + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-logical-assignment-operators", + "@babel/plugin-transform-nullish-coalescing-operator", + "@babel/plugin-transform-optional-chaining", "@babel/plugin-transform-modules-commonjs" ], "ignore": [ diff --git a/browser_patches/firefox/UPSTREAM_CONFIG.sh b/browser_patches/firefox/UPSTREAM_CONFIG.sh index 55da63f51e..5436a7ef44 100644 --- a/browser_patches/firefox/UPSTREAM_CONFIG.sh +++ b/browser_patches/firefox/UPSTREAM_CONFIG.sh @@ -1,3 +1,3 @@ REMOTE_URL="https://github.com/mozilla/gecko-dev" BASE_BRANCH="release" -BASE_REVISION="f5bc1abb4f0841558f7531e0c15a7577d23ed21c" +BASE_REVISION="7ab3cc0103090dd7bfa02e072a529b9fc784ab4e" diff --git a/browser_patches/firefox/juggler/Helper.js b/browser_patches/firefox/juggler/Helper.js index 797acd4627..9572aa37ad 100644 --- a/browser_patches/firefox/juggler/Helper.js +++ b/browser_patches/firefox/juggler/Helper.js @@ -3,7 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const uuidGen = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator); -const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); class Helper { decorateAsEventEmitter(objectToDecorate) { diff --git a/browser_patches/firefox/juggler/NetworkObserver.js b/browser_patches/firefox/juggler/NetworkObserver.js index c21c9effbe..b0413d2e2c 100644 --- a/browser_patches/firefox/juggler/NetworkObserver.js +++ b/browser_patches/firefox/juggler/NetworkObserver.js @@ -5,7 +5,6 @@ "use strict"; const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const {NetUtil} = ChromeUtils.import('resource://gre/modules/NetUtil.jsm'); const { ChannelEventSinkFactory } = ChromeUtils.import("chrome://remote/content/cdp/observers/ChannelEventSink.jsm"); @@ -232,8 +231,12 @@ class NetworkRequest { this._expectingResumedRequest = undefined; if (headers) { - for (const header of requestHeaders(this.httpChannel)) + for (const header of requestHeaders(this.httpChannel)) { + // We cannot remove the "host" header. + if (header.name.toLowerCase() === 'host') + continue; this.httpChannel.setRequestHeader(header.name, '', false /* merge */); + } for (const header of headers) this.httpChannel.setRequestHeader(header.name, header.value, false /* merge */); } else if (this._pageNetwork) { diff --git a/browser_patches/firefox/juggler/TargetRegistry.js b/browser_patches/firefox/juggler/TargetRegistry.js index 479d04d144..25be3c67af 100644 --- a/browser_patches/firefox/juggler/TargetRegistry.js +++ b/browser_patches/firefox/juggler/TargetRegistry.js @@ -4,7 +4,6 @@ const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); const {SimpleChannel} = ChromeUtils.import('chrome://juggler/content/SimpleChannel.js'); -const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm"); const {ContextualIdentityService} = ChromeUtils.import("resource://gre/modules/ContextualIdentityService.jsm"); const {NetUtil} = ChromeUtils.import('resource://gre/modules/NetUtil.jsm'); diff --git a/browser_patches/firefox/juggler/components/Juggler.js b/browser_patches/firefox/juggler/components/Juggler.js index a3740acc45..d919935fb5 100644 --- a/browser_patches/firefox/juggler/components/Juggler.js +++ b/browser_patches/firefox/juggler/components/Juggler.js @@ -6,7 +6,6 @@ var EXPORTED_SYMBOLS = ["Juggler", "JugglerFactory"]; const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {ComponentUtils} = ChromeUtils.import("resource://gre/modules/ComponentUtils.jsm"); -const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Dispatcher} = ChromeUtils.import("chrome://juggler/content/protocol/Dispatcher.js"); const {BrowserHandler} = ChromeUtils.import("chrome://juggler/content/protocol/BrowserHandler.js"); const {NetworkObserver} = ChromeUtils.import("chrome://juggler/content/NetworkObserver.js"); diff --git a/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm b/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm index 80b532c6b9..529f6d3b58 100644 --- a/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm +++ b/browser_patches/firefox/juggler/content/JugglerFrameChild.jsm @@ -1,7 +1,6 @@ "use strict"; const { Helper } = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); const { initialize } = ChromeUtils.import('chrome://juggler/content/content/main.js'); const Ci = Components.interfaces; diff --git a/browser_patches/firefox/juggler/content/PageAgent.js b/browser_patches/firefox/juggler/content/PageAgent.js index f3a3e745c2..614d5b5101 100644 --- a/browser_patches/firefox/juggler/content/PageAgent.js +++ b/browser_patches/firefox/juggler/content/PageAgent.js @@ -3,7 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; -const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const Ci = Components.interfaces; const Cr = Components.results; @@ -462,6 +461,10 @@ class PageAgent { } async _dispatchKeyEvent({type, keyCode, code, key, repeat, location, text}) { + if (code === 'OSLeft') + code = 'MetaLeft'; + else if (code === 'OSRight') + code = 'MetaRight'; const frame = this._frameTree.mainFrame(); const tip = frame.textInputProcessor(); if (key === 'Meta' && Services.appinfo.OS !== 'Darwin') diff --git a/browser_patches/firefox/juggler/content/Runtime.js b/browser_patches/firefox/juggler/content/Runtime.js index 3a132ae542..a5fa7a03dd 100644 --- a/browser_patches/firefox/juggler/content/Runtime.js +++ b/browser_patches/firefox/juggler/content/Runtime.js @@ -63,7 +63,6 @@ class Runtime { if (isWorker) { this._registerWorkerConsoleHandler(); } else { - const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); this._registerConsoleServiceListener(Services); this._registerConsoleAPIListener(Services); } @@ -240,8 +239,8 @@ class Runtime { return {success: true, obj: obj.promiseValue}; if (obj.promiseState === 'rejected') { const debuggee = executionContext._debuggee; - exceptionDetails.text = debuggee.executeInGlobalWithBindings('e.message', {e: obj.promiseReason}).return; - exceptionDetails.stack = debuggee.executeInGlobalWithBindings('e.stack', {e: obj.promiseReason}).return; + exceptionDetails.text = debuggee.executeInGlobalWithBindings('e.message', {e: obj.promiseReason}, {useInnerBindings: true}).return; + exceptionDetails.stack = debuggee.executeInGlobalWithBindings('e.stack', {e: obj.promiseReason}, {useInnerBindings: true}).return; return {success: false, obj: null}; } let resolve, reject; @@ -268,8 +267,8 @@ class Runtime { return; }; const debuggee = pendingPromise.executionContext._debuggee; - pendingPromise.exceptionDetails.text = debuggee.executeInGlobalWithBindings('e.message', {e: obj.promiseReason}).return; - pendingPromise.exceptionDetails.stack = debuggee.executeInGlobalWithBindings('e.stack', {e: obj.promiseReason}).return; + pendingPromise.exceptionDetails.text = debuggee.executeInGlobalWithBindings('e.message', {e: obj.promiseReason}, {useInnerBindings: true}).return; + pendingPromise.exceptionDetails.stack = debuggee.executeInGlobalWithBindings('e.stack', {e: obj.promiseReason}, {useInnerBindings: true}).return; pendingPromise.resolve({success: false, obj: null}); } @@ -442,7 +441,7 @@ class ExecutionContext { _instanceOf(debuggerObj, rawObj, className) { if (this._domWindow) return rawObj instanceof this._domWindow[className]; - return this._debuggee.executeInGlobalWithBindings('o instanceof this[className]', {o: debuggerObj, className: this._debuggee.makeDebuggeeValue(className)}).return; + return this._debuggee.executeInGlobalWithBindings('o instanceof this[className]', {o: debuggerObj, className: this._debuggee.makeDebuggeeValue(className)}, {useInnerBindings: true}).return; } _createRemoteObject(debuggerObj) { @@ -532,7 +531,7 @@ class ExecutionContext { } _serialize(obj) { - const result = this._debuggee.executeInGlobalWithBindings('stringify(e)', {e: obj, stringify: this._jsonStringifyObject}); + const result = this._debuggee.executeInGlobalWithBindings('stringify(e)', {e: obj, stringify: this._jsonStringifyObject}, {useInnerBindings: true}); if (result.throw) throw new Error('Object is not serializable'); return result.return === undefined ? undefined : JSON.parse(result.return); @@ -564,9 +563,9 @@ class ExecutionContext { if (!completionValue) throw new Error('evaluation terminated'); if (completionValue.throw) { - if (this._debuggee.executeInGlobalWithBindings('e instanceof Error', {e: completionValue.throw}).return) { - exceptionDetails.text = this._debuggee.executeInGlobalWithBindings('e.message', {e: completionValue.throw}).return; - exceptionDetails.stack = this._debuggee.executeInGlobalWithBindings('e.stack', {e: completionValue.throw}).return; + if (this._debuggee.executeInGlobalWithBindings('e instanceof Error', {e: completionValue.throw}, {useInnerBindings: true}).return) { + exceptionDetails.text = this._debuggee.executeInGlobalWithBindings('e.message', {e: completionValue.throw}, {useInnerBindings: true}).return; + exceptionDetails.stack = this._debuggee.executeInGlobalWithBindings('e.stack', {e: completionValue.throw}, {useInnerBindings: true}).return; } else { exceptionDetails.value = this._serialize(completionValue.throw); } diff --git a/browser_patches/firefox/juggler/content/main.js b/browser_patches/firefox/juggler/content/main.js index eb971b5d4d..4b891b3a76 100644 --- a/browser_patches/firefox/juggler/content/main.js +++ b/browser_patches/firefox/juggler/content/main.js @@ -2,7 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); const {FrameTree} = ChromeUtils.import('chrome://juggler/content/content/FrameTree.js'); const {SimpleChannel} = ChromeUtils.import('chrome://juggler/content/SimpleChannel.js'); diff --git a/browser_patches/firefox/juggler/protocol/BrowserHandler.js b/browser_patches/firefox/juggler/protocol/BrowserHandler.js index df32c10bb6..7bec58108a 100644 --- a/browser_patches/firefox/juggler/protocol/BrowserHandler.js +++ b/browser_patches/firefox/juggler/protocol/BrowserHandler.js @@ -5,7 +5,6 @@ "use strict"; const {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm"); -const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const {TargetRegistry} = ChromeUtils.import("chrome://juggler/content/TargetRegistry.js"); const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); const {PageHandler} = ChromeUtils.import("chrome://juggler/content/protocol/PageHandler.js"); diff --git a/browser_patches/firefox/juggler/protocol/PageHandler.js b/browser_patches/firefox/juggler/protocol/PageHandler.js index 7d148fa113..8bceb06979 100644 --- a/browser_patches/firefox/juggler/protocol/PageHandler.js +++ b/browser_patches/firefox/juggler/protocol/PageHandler.js @@ -5,7 +5,6 @@ "use strict"; const {Helper, EventWatcher} = ChromeUtils.import('chrome://juggler/content/Helper.js'); -const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); const {NetUtil} = ChromeUtils.import('resource://gre/modules/NetUtil.jsm'); const {NetworkObserver, PageNetwork} = ChromeUtils.import('chrome://juggler/content/NetworkObserver.js'); const {PageTarget} = ChromeUtils.import('chrome://juggler/content/TargetRegistry.js'); @@ -395,7 +394,7 @@ class PageHandler { 'nsIReferrerInfo', 'init' ); - referrerInfo = new ReferrerInfo(Ci.nsIHttpChannel.REFERRER_POLICY_UNSET, true, referrerURI); + referrerInfo = new ReferrerInfo(Ci.nsIReferrerInfo.UNSAFE_URL, true, referrerURI); } catch (e) { throw new Error(`Invalid referer: "${referer}"`); } diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diff index 4881645247..d58ec0332a 100644 --- a/browser_patches/firefox/patches/bootstrap.diff +++ b/browser_patches/firefox/patches/bootstrap.diff @@ -26,10 +26,10 @@ index 1886621c373fe1fd5ff54092afc4c64e9ca9a8fd..a0febf72885410b45227171c63e823ec + readonly attribute boolean isUpdatePendingForJugglerAccessibility; }; diff --git a/accessible/xpcom/xpcAccessibleDocument.cpp b/accessible/xpcom/xpcAccessibleDocument.cpp -index 94b04cf2f653a4b7274897eb6051dccdd4fe8404..fd6775e71c3d7c348ab2f1c5b4ea2dc4c18f787c 100644 +index d616e476b2149de5703077563680905e40db0459..7a8a48d5e7303a298a3e2e9fdf64558b3cdbe654 100644 --- a/accessible/xpcom/xpcAccessibleDocument.cpp +++ b/accessible/xpcom/xpcAccessibleDocument.cpp -@@ -132,6 +132,13 @@ xpcAccessibleDocument::GetChildDocumentAt(uint32_t aIndex, +@@ -131,6 +131,13 @@ xpcAccessibleDocument::GetChildDocumentAt(uint32_t aIndex, return *aDocument ? NS_OK : NS_ERROR_INVALID_ARG; } @@ -57,7 +57,7 @@ index 8e9bf2b413585b5a3db9370eee5d57fb6c6716ed..5a3b194b54e3813c89989f13a214c989 * Return XPCOM wrapper for the internal accessible. */ diff --git a/browser/app/winlauncher/LauncherProcessWin.cpp b/browser/app/winlauncher/LauncherProcessWin.cpp -index 082ada9ea705cf62420c6bd409a23517a591df82..781ac8d8ee9b9b01112b620e8c5c11682cdb9ef1 100644 +index d3fa2a973619ed3dc12d9aac9bc751e21a158406..ab3b84ce0a685d79ef56cbf38b5c4beeb7a1100c 100644 --- a/browser/app/winlauncher/LauncherProcessWin.cpp +++ b/browser/app/winlauncher/LauncherProcessWin.cpp @@ -22,6 +22,7 @@ @@ -68,7 +68,7 @@ index 082ada9ea705cf62420c6bd409a23517a591df82..781ac8d8ee9b9b01112b620e8c5c1168 #include #include -@@ -428,8 +429,18 @@ Maybe LauncherMain(int& argc, wchar_t* argv[], +@@ -422,8 +423,18 @@ Maybe LauncherMain(int& argc, wchar_t* argv[], HANDLE stdHandles[] = {::GetStdHandle(STD_INPUT_HANDLE), ::GetStdHandle(STD_OUTPUT_HANDLE), ::GetStdHandle(STD_ERROR_HANDLE)}; @@ -89,7 +89,7 @@ index 082ada9ea705cf62420c6bd409a23517a591df82..781ac8d8ee9b9b01112b620e8c5c1168 DWORD creationFlags = CREATE_SUSPENDED | CREATE_UNICODE_ENVIRONMENT; diff --git a/browser/installer/allowed-dupes.mn b/browser/installer/allowed-dupes.mn -index 93e7dbae2281680827abb482f6f34e90076f3b3a..f7045a29c6ed50876775abe2d45a47df7b7a2003 100644 +index bae6d0c5be1ef486b44563b519c5f4aa4b5bc769..636e801c940dea835dee55759cb638a6714a33cd 100644 --- a/browser/installer/allowed-dupes.mn +++ b/browser/installer/allowed-dupes.mn @@ -71,6 +71,12 @@ browser/features/webcompat@mozilla.org/shims/empty-shim.txt @@ -102,14 +102,14 @@ index 93e7dbae2281680827abb482f6f34e90076f3b3a..f7045a29c6ed50876775abe2d45a47df +chrome/juggler/content/server/stream-utils.js +chrome/marionette/content/stream-utils.js + - #ifdef MOZ_EME_WIN32_ARTIFACT - gmp-clearkey/0.1/manifest.json - i686/gmp-clearkey/0.1/manifest.json + # Bug 1496075 - Switch searchplugins to Web Extensions + browser/chrome/browser/search-extensions/amazon/favicon.ico + browser/chrome/browser/search-extensions/amazondotcn/favicon.ico diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in -index 41d13e23c4f4160e469aa81a632b5ed336130edb..3d690727ba3394485093f062093f26b2739ee497 100644 +index 1e48dd12b43ed48085f22f6576f8c6696153775f..3b79a0e6e607ae67a00c3c7403ff18261a2419b4 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in -@@ -203,6 +203,9 @@ +@@ -196,6 +196,9 @@ @RESPATH@/chrome/remote.manifest #endif @@ -167,10 +167,10 @@ index 4236ec2921bd57c58cfffdf1cdcf509d76fca3db..23d0cb1f06bb8c7a1cac8fcec94a99fb const transportProvider = { setListener(upgradeListener) { diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp -index db232f63e48e2950a997baac63f2b3cc069ddb18..3d2088308789276ad8e940dda4ebf3800f487e3a 100644 +index e6360a37dcdf0d01353175bb24211e48c54c6ac5..1aeaacb0f91c6bee166ec888196971d3bc957a41 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp -@@ -113,6 +113,20 @@ struct ParamTraits +@@ -114,6 +114,20 @@ struct ParamTraits mozilla::dom::PrefersColorSchemeOverride::None, mozilla::dom::PrefersColorSchemeOverride::EndGuard_> {}; @@ -191,7 +191,7 @@ index db232f63e48e2950a997baac63f2b3cc069ddb18..3d2088308789276ad8e940dda4ebf380 template <> struct ParamTraits : public ContiguousEnumSerializer< -@@ -2746,6 +2760,40 @@ void BrowsingContext::DidSet(FieldIndex, +@@ -2781,6 +2795,40 @@ void BrowsingContext::DidSet(FieldIndex, PresContextAffectingFieldChanged(); } @@ -233,10 +233,10 @@ index db232f63e48e2950a997baac63f2b3cc069ddb18..3d2088308789276ad8e940dda4ebf380 nsString&& aOldValue) { MOZ_ASSERT(IsTop()); diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h -index 4c245337b7db24f94011ad75fa2a3b32c9a3574c..946b4592794499455b7e2d7d208b7ca43242a414 100644 +index f9129bb2db492c7446a092c744b14f42449dc74c..a2abdfee35289be118b29baa6a5f3385a63f7085 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h -@@ -199,10 +199,10 @@ struct EmbedderColorSchemes { +@@ -200,10 +200,10 @@ struct EmbedderColorSchemes { FIELD(GVInaudibleAutoplayRequestStatus, GVAutoplayRequestStatus) \ /* ScreenOrientation-related APIs */ \ FIELD(CurrentOrientationAngle, float) \ @@ -249,7 +249,7 @@ index 4c245337b7db24f94011ad75fa2a3b32c9a3574c..946b4592794499455b7e2d7d208b7ca4 FIELD(EmbedderElementType, Maybe) \ FIELD(MessageManagerGroup, nsString) \ FIELD(MaxTouchPointsOverride, uint8_t) \ -@@ -240,6 +240,10 @@ struct EmbedderColorSchemes { +@@ -241,6 +241,10 @@ struct EmbedderColorSchemes { * embedder element. */ \ FIELD(EmbedderColorSchemes, EmbedderColorSchemes) \ FIELD(DisplayMode, dom::DisplayMode) \ @@ -260,7 +260,7 @@ index 4c245337b7db24f94011ad75fa2a3b32c9a3574c..946b4592794499455b7e2d7d208b7ca4 /* The number of entries added to the session history because of this \ * browsing context. */ \ FIELD(HistoryEntryCount, uint32_t) \ -@@ -924,6 +928,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -919,6 +923,14 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { return GetPrefersColorSchemeOverride(); } @@ -275,7 +275,7 @@ index 4c245337b7db24f94011ad75fa2a3b32c9a3574c..946b4592794499455b7e2d7d208b7ca4 bool IsInBFCache() const; bool AllowJavascript() const { return GetAllowJavascript(); } -@@ -1085,6 +1097,23 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { +@@ -1083,6 +1095,23 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { void WalkPresContexts(Callback&&); void PresContextAffectingFieldChanged(); @@ -300,10 +300,10 @@ index 4c245337b7db24f94011ad75fa2a3b32c9a3574c..946b4592794499455b7e2d7d208b7ca4 bool CanSet(FieldIndex, bool, ContentParent*) { diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp -index 42a6700afa0e9ff3c5161b1d18f327b3d9ed76f8..3b83cafc2e549fe3affad3547a1b145f821a888d 100644 +index a6bbc3c7c9a0eaf1b0dcf4a9a68c1d579aa79f70..6de37c24076abcb136e0c2014d1e94e60ea62720 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp -@@ -1456,6 +1456,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, +@@ -1465,6 +1465,12 @@ void CanonicalBrowsingContext::LoadURI(nsIURI* aURI, return; } @@ -317,7 +317,7 @@ index 42a6700afa0e9ff3c5161b1d18f327b3d9ed76f8..3b83cafc2e549fe3affad3547a1b145f } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp -index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531eac3d5da9 100644 +index 7669fbacd09a65cda1b06c74aa75f0ef7b625da2..8fd21c46640003c3f6d3cbc79697955ba4437afd 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -15,6 +15,12 @@ @@ -357,15 +357,15 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e #include "nsIDocumentLoaderFactory.h" #include "nsIDOMWindow.h" #include "nsIEditingSession.h" -@@ -207,6 +216,7 @@ - #include "nsFocusManager.h" - #include "nsGlobalWindow.h" +@@ -208,6 +217,7 @@ + #include "nsGlobalWindowInner.h" + #include "nsGlobalWindowOuter.h" #include "nsJSEnvironment.h" +#include "nsJSUtils.h" #include "nsNetCID.h" #include "nsNetUtil.h" #include "nsObjectLoadingContent.h" -@@ -349,6 +359,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, +@@ -350,6 +360,14 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, mAllowDNSPrefetch(true), mAllowWindowControl(true), mCSSErrorReportingEnabled(false), @@ -380,7 +380,7 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e mAllowAuth(mItemType == typeContent), mAllowKeywordFixup(false), mDisableMetaRefreshWhenInactive(false), -@@ -3197,6 +3215,234 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { +@@ -3204,6 +3222,234 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) { return NS_OK; } @@ -463,14 +463,14 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e + +static void SetIcuLocale(const nsAString& aLanguageOverride) { + icu::Locale locale(NS_LossyConvertUTF16toASCII(aLanguageOverride).get()); -+ if (icu::Locale::getDefault() == locale) -+ return; -+ UErrorCode error_code = U_ZERO_ERROR; -+ const char* lang = locale.getLanguage(); -+ if (lang != nullptr && *lang != '\0') { -+ icu::Locale::setDefault(locale, error_code); -+ } else { -+ fprintf(stderr, "SetIcuLocale Failed to set the ICU default locale to %s\n", NS_LossyConvertUTF16toASCII(aLanguageOverride).get()); ++ if (icu::Locale::getDefault() != locale) { ++ UErrorCode error_code = U_ZERO_ERROR; ++ const char* lang = locale.getLanguage(); ++ if (lang != nullptr && *lang != '\0') { ++ icu::Locale::setDefault(locale, error_code); ++ } else { ++ fprintf(stderr, "SetIcuLocale Failed to set the ICU default locale to %s\n", NS_LossyConvertUTF16toASCII(aLanguageOverride).get()); ++ } + } + + AutoJSAPI jsapi; @@ -615,7 +615,7 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e NS_IMETHODIMP nsDocShell::GetIsNavigating(bool* aOut) { *aOut = mIsNavigating; -@@ -4876,7 +5122,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { +@@ -4895,7 +5141,7 @@ nsDocShell::GetVisibility(bool* aVisibility) { } void nsDocShell::ActivenessMaybeChanged() { @@ -624,7 +624,7 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e if (RefPtr presShell = GetPresShell()) { presShell->ActivenessMaybeChanged(); } -@@ -6809,6 +7055,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, +@@ -6811,6 +7057,10 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType, return false; // no entry to save into } @@ -635,7 +635,7 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e MOZ_ASSERT(!mozilla::SessionHistoryInParent(), "mOSHE cannot be non-null with SHIP"); nsCOMPtr viewer = mOSHE->GetContentViewer(); -@@ -8590,6 +8840,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { +@@ -8595,6 +8845,12 @@ nsresult nsDocShell::PerformRetargeting(nsDocShellLoadState* aLoadState) { true, // aForceNoOpener getter_AddRefs(newBC)); MOZ_ASSERT(!newBC); @@ -648,7 +648,7 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e return rv; } -@@ -9665,6 +9921,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, +@@ -9670,6 +9926,16 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr); nsCOMPtr req; @@ -665,7 +665,7 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e rv = DoURILoad(aLoadState, aCacheKey, getter_AddRefs(req)); if (NS_SUCCEEDED(rv)) { -@@ -12825,6 +13091,9 @@ class OnLinkClickEvent : public Runnable { +@@ -12827,6 +13093,9 @@ class OnLinkClickEvent : public Runnable { mHandler->OnLinkClickSync(mContent, mLoadState, mNoOpenerImplied, mTriggeringPrincipal); } @@ -675,7 +675,7 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e return NS_OK; } -@@ -12909,6 +13178,8 @@ nsresult nsDocShell::OnLinkClick( +@@ -12911,6 +13180,8 @@ nsresult nsDocShell::OnLinkClick( nsCOMPtr ev = new OnLinkClickEvent(this, aContent, loadState, noOpenerImplied, aIsTrusted, aTriggeringPrincipal); @@ -685,7 +685,7 @@ index fb1b70fbcff37a233a4396a768358a36e773ddc3..c1c654f99462f2868607729c9126531e } diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h -index 0f360bf1f5f2e9067f42d270b4fb6745116a0ee2..8eee7e4d1a287b38d2d2aa1af1ac719a6c7c940b 100644 +index 21cd7c944b391bf0333c7bdc815200db33ef0afe..aa8d79b0d3bd34419c5d625678f3cd1231e2b46f 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -16,6 +16,7 @@ @@ -729,7 +729,7 @@ index 0f360bf1f5f2e9067f42d270b4fb6745116a0ee2..8eee7e4d1a287b38d2d2aa1af1ac719a // 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 -@@ -1323,6 +1336,17 @@ class nsDocShell final : public nsDocLoader, +@@ -1327,6 +1340,17 @@ class nsDocShell final : public nsDocLoader, bool mAllowDNSPrefetch : 1; bool mAllowWindowControl : 1; bool mCSSErrorReportingEnabled : 1; @@ -804,10 +804,10 @@ index 68f32e968c7e1bc1d0b2b2894320a177a9ae44d2..9e61465ffad927d7b3e972f753940196 * 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 b8d736619d4ea457b7db95d1815bd85697475133..d128299ab7a5e7f8fb00474571805361df0e00d2 100644 +index dbb0e7d060dacf26154b30f67c5980bdebb533c1..eba7dfb80333d3473a2167d8105544d1de46d939 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp -@@ -3682,6 +3682,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { +@@ -3671,6 +3671,9 @@ void Document::SendToConsole(nsCOMArray& aMessages) { } void Document::ApplySettingsFromCSP(bool aSpeculative) { @@ -817,7 +817,7 @@ index b8d736619d4ea457b7db95d1815bd85697475133..d128299ab7a5e7f8fb00474571805361 nsresult rv = NS_OK; if (!aSpeculative) { // 1) apply settings from regular CSP -@@ -3739,6 +3742,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { +@@ -3728,6 +3731,11 @@ nsresult Document::InitCSP(nsIChannel* aChannel) { MOZ_ASSERT(!mScriptGlobalObject, "CSP must be initialized before mScriptGlobalObject is set!"); @@ -829,7 +829,7 @@ index b8d736619d4ea457b7db95d1815bd85697475133..d128299ab7a5e7f8fb00474571805361 // If this is a data document - no need to set CSP. if (mLoadedAsData) { return NS_OK; -@@ -4578,6 +4586,10 @@ bool Document::HasFocus(ErrorResult& rv) const { +@@ -4544,6 +4552,10 @@ bool Document::HasFocus(ErrorResult& rv) const { return false; } @@ -840,7 +840,7 @@ index b8d736619d4ea457b7db95d1815bd85697475133..d128299ab7a5e7f8fb00474571805361 if (!fm->IsInActiveWindow(bc)) { return false; } -@@ -18471,6 +18483,68 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { +@@ -18535,6 +18547,68 @@ ColorScheme Document::PreferredColorScheme(IgnoreRFP aIgnoreRFP) const { return LookAndFeel::PreferredColorSchemeForContent(); } @@ -910,10 +910,10 @@ index b8d736619d4ea457b7db95d1815bd85697475133..d128299ab7a5e7f8fb00474571805361 if (!sLoadingForegroundTopLevelContentDocument) { return false; diff --git a/dom/base/Document.h b/dom/base/Document.h -index bb4e5a8e8114167d442e3593d240de74e9a6b12a..1a7b0a0bb8431c6c17dc0ccb1600ad97bbe005cd 100644 +index ed73acda064d3c899858b4c4bd6c8df4a5b2a964..5d49feda0146088128d1901d4168ca75d7062aa3 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h -@@ -4067,6 +4067,9 @@ class Document : public nsINode, +@@ -4066,6 +4066,9 @@ class Document : public nsINode, // color-scheme meta tag. ColorScheme DefaultColorScheme() const; @@ -924,10 +924,10 @@ index bb4e5a8e8114167d442e3593d240de74e9a6b12a..1a7b0a0bb8431c6c17dc0ccb1600ad97 static bool AutomaticStorageAccessPermissionCanBeGranted( diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp -index eedeee0364cefb0bcf5412483f452cb5454eb1a5..922775338a270ecd70f2ad284e627da63b37cb5b 100644 +index 9a5f6913b0682ad39824a2504734e58af9ae845e..baf24386e37daac95700d0715bf00cca1ebcd84f 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp -@@ -330,14 +330,18 @@ void Navigator::GetAppName(nsAString& aAppName, CallerType aCallerType) const { +@@ -327,14 +327,18 @@ void Navigator::GetAppName(nsAString& aAppName) const { * for more detail. */ /* static */ @@ -948,7 +948,7 @@ index eedeee0364cefb0bcf5412483f452cb5454eb1a5..922775338a270ecd70f2ad284e627da6 // Split values on commas. for (nsDependentSubstring lang : -@@ -389,7 +393,13 @@ void Navigator::GetLanguage(nsAString& aLanguage) { +@@ -386,7 +390,13 @@ void Navigator::GetLanguage(nsAString& aLanguage) { } void Navigator::GetLanguages(nsTArray& aLanguages) { @@ -963,7 +963,7 @@ index eedeee0364cefb0bcf5412483f452cb5454eb1a5..922775338a270ecd70f2ad284e627da6 // 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 -@@ -564,7 +574,13 @@ bool Navigator::CookieEnabled() { +@@ -561,7 +571,13 @@ bool Navigator::CookieEnabled() { return granted; } @@ -979,10 +979,10 @@ index eedeee0364cefb0bcf5412483f452cb5454eb1a5..922775338a270ecd70f2ad284e627da6 void Navigator::GetBuildID(nsAString& aBuildID, CallerType aCallerType, ErrorResult& aRv) const { diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h -index cbe8d6bb27eb75b1c0eb920c69eccc99fd6133b2..49da35b1f9ec2a81c5886f277fd52ec492ca8418 100644 +index f878c11dff3d448dfa2520c7fe7e4e9cb63f7ea7..c1a30391eb31e28e1c22dff82bb9526bc7e058dd 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h -@@ -216,7 +216,7 @@ class Navigator final : public nsISupports, public nsWrapperCache { +@@ -213,7 +213,7 @@ class Navigator final : public nsISupports, public nsWrapperCache { StorageManager* Storage(); @@ -992,10 +992,10 @@ index cbe8d6bb27eb75b1c0eb920c69eccc99fd6133b2..49da35b1f9ec2a81c5886f277fd52ec4 dom::MediaCapabilities* MediaCapabilities(); dom::MediaSession* MediaSession(); diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp -index 5cb5a088269287b6f9a3d36cca658043464cd5cc..d0b4929c5996efc03392b7093d14e01cabab8acf 100644 +index 1f9863a8bc538eece4dbf04b2e4bffbad50d5d00..b5cd6be99c8457030db1b23ac307fc2ff40e6e49 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp -@@ -8520,7 +8520,8 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8554,7 +8554,8 @@ nsresult nsContentUtils::SendMouseEvent( bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, PreventDefaultResult* aPreventDefault, bool aIsDOMEventSynthesized, @@ -1005,7 +1005,7 @@ index 5cb5a088269287b6f9a3d36cca658043464cd5cc..d0b4929c5996efc03392b7093d14e01c nsPoint offset; nsCOMPtr widget = GetWidget(aPresShell, &offset); if (!widget) return NS_ERROR_FAILURE; -@@ -8528,6 +8529,7 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8562,6 +8563,7 @@ nsresult nsContentUtils::SendMouseEvent( EventMessage msg; Maybe exitFrom; bool contextMenuKey = false; @@ -1013,7 +1013,7 @@ index 5cb5a088269287b6f9a3d36cca658043464cd5cc..d0b4929c5996efc03392b7093d14e01c if (aType.EqualsLiteral("mousedown")) { msg = eMouseDown; } else if (aType.EqualsLiteral("mouseup")) { -@@ -8552,6 +8554,12 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8586,6 +8588,12 @@ nsresult nsContentUtils::SendMouseEvent( msg = eMouseHitTest; } else if (aType.EqualsLiteral("MozMouseExploreByTouch")) { msg = eMouseExploreByTouch; @@ -1026,7 +1026,7 @@ index 5cb5a088269287b6f9a3d36cca658043464cd5cc..d0b4929c5996efc03392b7093d14e01c } else { return NS_ERROR_FAILURE; } -@@ -8560,12 +8568,21 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8594,12 +8602,21 @@ nsresult nsContentUtils::SendMouseEvent( aInputSourceArg = MouseEvent_Binding::MOZ_SOURCE_MOUSE; } @@ -1050,7 +1050,7 @@ index 5cb5a088269287b6f9a3d36cca658043464cd5cc..d0b4929c5996efc03392b7093d14e01c event.pointerId = aIdentifier; event.mModifiers = GetWidgetModifiers(aModifiers); event.mButton = aButton; -@@ -8576,8 +8593,10 @@ nsresult nsContentUtils::SendMouseEvent( +@@ -8610,8 +8627,10 @@ nsresult nsContentUtils::SendMouseEvent( event.mPressure = aPressure; event.mInputSource = aInputSourceArg; event.mClickCount = aClickCount; @@ -1062,10 +1062,10 @@ index 5cb5a088269287b6f9a3d36cca658043464cd5cc..d0b4929c5996efc03392b7093d14e01c nsPresContext* presContext = aPresShell->GetPresContext(); if (!presContext) return NS_ERROR_FAILURE; diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h -index 1259b13761c2d51e1ddca54433a49b2a5949a790..ec356bb54f04249d19a984e1f4b2d5d57009b64f 100644 +index 180c7fe15d6acbd68c477a5677a397ef2acc3c6b..b66187e2063b6b7660ae0ef5a0a34b5655b23a97 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h -@@ -2934,7 +2934,8 @@ class nsContentUtils { +@@ -2947,7 +2947,8 @@ class nsContentUtils { int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier, bool aToWindow, mozilla::PreventDefaultResult* aPreventDefault, @@ -1076,7 +1076,7 @@ index 1259b13761c2d51e1ddca54433a49b2a5949a790..ec356bb54f04249d19a984e1f4b2d5d5 static void FirePageShowEventForFrameLoaderSwap( nsIDocShellTreeItem* aItem, diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp -index 2ccd99469917b6fc0b0c99f8ff579d7040e65669..2968275ddc32b7bb9eb7337ef90328bb00c1aabf 100644 +index e6762018cce8e4c8691703ed15ea29e709f31cf2..4d0b679c4700e8fe18408a186b7e4d512a71dc30 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -684,6 +684,26 @@ nsDOMWindowUtils::GetPresShellId(uint32_t* aPresShellId) { @@ -1154,10 +1154,10 @@ index 63968c9b7a4e418e4c0de6e7a75fa215a36a9105..decf3ea3833ccdffd49a7aded2d600f9 MOZ_CAN_RUN_SCRIPT nsresult SendTouchEventCommon( diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp -index ba77a1f00d43be4ec98b698cf0d9f4fab8343dd2..f146d1dfadbaa2e75f8b60f3dafe056a179ef018 100644 +index 1be0c80cd30f8696a9451af1f9d381591f1ba0c0..9f9af9649c2cd55188e085e011819cc5db0fb6dc 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp -@@ -1656,6 +1656,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, +@@ -1672,6 +1672,10 @@ Maybe nsFocusManager::SetFocusInner(Element* aNewContent, (GetActiveBrowsingContext() == newRootBrowsingContext); } @@ -1168,7 +1168,7 @@ index ba77a1f00d43be4ec98b698cf0d9f4fab8343dd2..f146d1dfadbaa2e75f8b60f3dafe056a // Exit fullscreen if a website focuses another window if (StaticPrefs::full_screen_api_exit_on_windowRaise() && !isElementInActiveWindow && (aFlags & FLAG_RAISE)) { -@@ -2946,7 +2950,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, +@@ -2945,7 +2949,9 @@ void nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow, } } @@ -1180,10 +1180,10 @@ index ba77a1f00d43be4ec98b698cf0d9f4fab8343dd2..f146d1dfadbaa2e75f8b60f3dafe056a // 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 9893fb0ed13eeebe55f8eda7bb3d898ff6eebba7..247784c89d5d68840638f40f77523e600f13bbf6 100644 +index a784fe3c4bf9fe6a74bebca23fdce04524e0f473..100bae14efb8f4cc49238ce808e3f4e7fe1cd61c 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp -@@ -2482,7 +2482,7 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, +@@ -2490,7 +2490,7 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, &nsGlobalWindowInner::FireOnNewGlobalObject)); } @@ -1192,7 +1192,7 @@ index 9893fb0ed13eeebe55f8eda7bb3d898ff6eebba7..247784c89d5d68840638f40f77523e60 // We should probably notify. However if this is the, arguably bad, // situation when we're creating a temporary non-chrome-about-blank // document in a chrome docshell, don't notify just yet. Instead wait -@@ -2501,10 +2501,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, +@@ -2509,10 +2509,16 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument, }(); if (!isContentAboutBlankInChromeDocshell) { @@ -1213,7 +1213,7 @@ index 9893fb0ed13eeebe55f8eda7bb3d898ff6eebba7..247784c89d5d68840638f40f77523e60 } } -@@ -2625,6 +2631,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() { +@@ -2632,6 +2638,19 @@ void nsGlobalWindowOuter::DispatchDOMWindowCreated() { } } @@ -1234,10 +1234,10 @@ index 9893fb0ed13eeebe55f8eda7bb3d898ff6eebba7..247784c89d5d68840638f40f77523e60 void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) { diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h -index 0919dfe52ab1ced87c5483d0a60945f688f0eefe..c826b05d8599b7bf80415bdad1969a84a467a7ba 100644 +index 8a891ca19a56ff0cdecab26e1d6bb78f32b91abd..c05023ca6a88e0caef5b709a4f8c2846894d5c3c 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h -@@ -325,6 +325,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, +@@ -314,6 +314,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget, // Outer windows only. void DispatchDOMWindowCreated(); @@ -1246,7 +1246,7 @@ index 0919dfe52ab1ced87c5483d0a60945f688f0eefe..c826b05d8599b7bf80415bdad1969a84 // Outer windows only. virtual void EnsureSizeAndPositionUpToDate() override; diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp -index f2b1afabd27c3652632074c1788c4320277ef89f..bc60ca7e4820f9db27a4296acd27e86684ce59eb 100644 +index 77016f314939bf6ac11b48db1f71d1d3a82d4e83..67440e2643eb3f098e8e790179634216da7f851f 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -1358,6 +1358,61 @@ void nsINode::GetBoxQuadsFromWindowOrigin(const BoxQuadOptions& aOptions, @@ -1312,10 +1312,10 @@ index f2b1afabd27c3652632074c1788c4320277ef89f..bc60ca7e4820f9db27a4296acd27e866 DOMQuad& aQuad, const GeometryNode& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h -index 3617a4a3e31592c1cde00170ecf7b86cf4ab4737..51db576475772b5b9e1e5f87bb690577151b724b 100644 +index 73cfa7eb511e1c453b2634fe5a2aa7a042ba0221..759909ce15a5aff520d0d8429ee399a8b4787f11 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h -@@ -2193,6 +2193,10 @@ class nsINode : public mozilla::dom::EventTarget { +@@ -2212,6 +2212,10 @@ class nsINode : public mozilla::dom::EventTarget { nsTArray>& aResult, ErrorResult& aRv); @@ -1327,10 +1327,10 @@ index 3617a4a3e31592c1cde00170ecf7b86cf4ab4737..51db576475772b5b9e1e5f87bb690577 DOMQuad& aQuad, const TextOrElementOrDocument& aFrom, const ConvertCoordinateOptions& aOptions, CallerType aCallerType, diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp -index 86fe04583c34bd84f7239c3515c9f335d84f48a2..b6705bc48f216e856b556349d206756a0cf91867 100644 +index 66b0a09dda9e57f41643da11abb079896b9634d9..eb1dacdce7c8426de3f3cd34d2c22d1d13f49b5a 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp -@@ -169,6 +169,11 @@ bool nsJSUtils::GetScopeChainForElement( +@@ -177,6 +177,11 @@ bool nsJSUtils::GetScopeChainForElement( return true; } @@ -1343,10 +1343,10 @@ index 86fe04583c34bd84f7239c3515c9f335d84f48a2..b6705bc48f216e856b556349d206756a void nsJSUtils::ResetTimeZone() { JS::ResetTimeZone(); } diff --git a/dom/base/nsJSUtils.h b/dom/base/nsJSUtils.h -index 67682173f45c6a83cbad176c2922263d4f7dece9..7dd97f27bdf07673289fce62aaebe3b96492a2eb 100644 +index 36e906061588aab50dee129cc46dd2e4d3e153f8..c3591f98d4df19b166fc5c99332e559b1d499049 100644 --- a/dom/base/nsJSUtils.h +++ b/dom/base/nsJSUtils.h -@@ -78,6 +78,7 @@ class nsJSUtils { +@@ -79,6 +79,7 @@ class nsJSUtils { JSContext* aCx, mozilla::dom::Element* aElement, JS::MutableHandleVector aScopeChain); @@ -1397,7 +1397,7 @@ index db60c475931caa32110d12ba63bb56980a2b36cc..5d1d8fdceec7a73541799cbac367b173 * A unique identifier for the browser element that is hosting this * BrowsingContext tree. Every BrowsingContext in the element's tree will diff --git a/dom/geolocation/Geolocation.cpp b/dom/geolocation/Geolocation.cpp -index ff6fe276e3f5a19e3e22d98c4a38222880797d99..96157d17485534f97a4e39675ee77808ac495bfe 100644 +index 197146d71e9772af04e577663dbc0213c26a62cb..0e357893cdcf0d6b627bca803aa6041107079184 100644 --- a/dom/geolocation/Geolocation.cpp +++ b/dom/geolocation/Geolocation.cpp @@ -23,6 +23,7 @@ @@ -1405,10 +1405,10 @@ index ff6fe276e3f5a19e3e22d98c4a38222880797d99..96157d17485534f97a4e39675ee77808 #include "nsContentPermissionHelper.h" #include "nsContentUtils.h" +#include "nsDocShell.h" - #include "nsGlobalWindow.h" + #include "nsGlobalWindowInner.h" #include "mozilla/dom/Document.h" #include "nsINamed.h" -@@ -260,10 +261,8 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { +@@ -259,10 +260,8 @@ nsGeolocationRequest::Allow(JS::Handle aChoices) { return NS_OK; } @@ -1421,7 +1421,7 @@ index ff6fe276e3f5a19e3e22d98c4a38222880797d99..96157d17485534f97a4e39675ee77808 CachedPositionAndAccuracy lastPosition = gs->GetCachedPosition(); if (lastPosition.position) { EpochTimeStamp cachedPositionTime_ms; -@@ -441,8 +440,7 @@ void nsGeolocationRequest::Shutdown() { +@@ -440,8 +439,7 @@ void nsGeolocationRequest::Shutdown() { // If there are no other high accuracy requests, the geolocation service will // notify the provider to switch to the default accuracy. if (mOptions && mOptions->mEnableHighAccuracy) { @@ -1431,7 +1431,7 @@ index ff6fe276e3f5a19e3e22d98c4a38222880797d99..96157d17485534f97a4e39675ee77808 if (gs) { gs->UpdateAccuracy(); } -@@ -732,8 +730,14 @@ void nsGeolocationService::StopDevice() { +@@ -730,8 +728,14 @@ void nsGeolocationService::StopDevice() { StaticRefPtr nsGeolocationService::sService; already_AddRefed @@ -1447,7 +1447,7 @@ index ff6fe276e3f5a19e3e22d98c4a38222880797d99..96157d17485534f97a4e39675ee77808 if (nsGeolocationService::sService) { result = nsGeolocationService::sService; -@@ -825,7 +829,9 @@ nsresult Geolocation::Init(nsPIDOMWindowInner* aContentDom) { +@@ -823,7 +827,9 @@ nsresult Geolocation::Init(nsPIDOMWindowInner* aContentDom) { // If no aContentDom was passed into us, we are being used // by chrome/c++ and have no mOwner, no mPrincipal, and no need // to prompt. @@ -1496,10 +1496,10 @@ index 7e1af00d05fbafa2d828e2c7e4dcc5c82d115f5b..e85af9718d064e4d2865bc944e9d4ba1 ~Geolocation(); diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp -index 4a3e5b2c935ad1cfb1bff706933fc2373f90a937..d8eac957b88ea2a5edbf1f0f4fde177edcb07600 100644 +index c419fb6936dac5cebde8dbaf548d8edd49ffc64a..f5a0cd548721c5d87be6dc719a0183b0a7eeccfe 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp -@@ -57,6 +57,7 @@ +@@ -58,6 +58,7 @@ #include "mozilla/dom/Document.h" #include "mozilla/dom/HTMLDataListElement.h" #include "mozilla/dom/HTMLOptionElement.h" @@ -1507,7 +1507,7 @@ index 4a3e5b2c935ad1cfb1bff706933fc2373f90a937..d8eac957b88ea2a5edbf1f0f4fde177e #include "nsIFormControlFrame.h" #include "nsITextControlFrame.h" #include "nsIFrame.h" -@@ -780,6 +781,12 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { +@@ -782,6 +783,12 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { return NS_ERROR_FAILURE; } @@ -1521,10 +1521,10 @@ index 4a3e5b2c935ad1cfb1bff706933fc2373f90a937..d8eac957b88ea2a5edbf1f0f4fde177e return NS_OK; } diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl -index 82f7d4d206c7274858a945d5db61aa02c366e472..a23386a5749c4af48b9bb86c8c48928da6aa3a9e 100644 +index 4170a79023a2503831d080a6e65d5e143f34f241..3af08d6ea5f1cfbdc373774764a0c45fe3aa0e27 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl -@@ -374,6 +374,26 @@ interface nsIDOMWindowUtils : nsISupports { +@@ -373,6 +373,26 @@ interface nsIDOMWindowUtils : nsISupports { [optional] in long aButtons, [optional] in unsigned long aIdentifier); @@ -1552,10 +1552,10 @@ index 82f7d4d206c7274858a945d5db61aa02c366e472..a23386a5749c4af48b9bb86c8c48928d * touchstart, touchend, touchmove, and touchcancel * diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp -index 084c717432a853b8f95a087463dcce93215ca6e8..2689ba865758ce6085f68d86a5d09a27551d229c 100644 +index 996ee2edde76bab0ea409e072b89160a5158d452..7833fe75af2a85666e72627bfd0dd7467a1b8a80 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp -@@ -1672,6 +1672,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, +@@ -1668,6 +1668,21 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent, if (postLayerization) { postLayerization->Register(); } @@ -1592,7 +1592,7 @@ index 5aa445d2e0a6169e57c44569974d557b3baf7064..671f71979b407f0ca17c66f13805e851 } diff --git a/dom/media/systemservices/video_engine/desktop_capture_impl.cc b/dom/media/systemservices/video_engine/desktop_capture_impl.cc -index 2274a21e8a287932342bb4fb58af728d13b89224..367466efc8457f99c87af1d285131f7b6c71c8ef 100644 +index 3f03789fa3948bbf2528975ce112efb7eb987c24..2194e4144de537edb9a765857cc37b0af42dd8fd 100644 --- a/dom/media/systemservices/video_engine/desktop_capture_impl.cc +++ b/dom/media/systemservices/video_engine/desktop_capture_impl.cc @@ -135,11 +135,12 @@ int32_t ScreenDeviceInfoImpl::GetOrientation(const char* aDeviceUniqueIdUTF8, @@ -1611,7 +1611,7 @@ index 2274a21e8a287932342bb4fb58af728d13b89224..367466efc8457f99c87af1d285131f7b } int32_t WindowDeviceInfoImpl::Init() { -@@ -408,7 +409,7 @@ static bool UsePipewire() { +@@ -405,7 +406,7 @@ static bool UsePipewire() { static std::unique_ptr CreateDesktopCapturerAndThread( CaptureDeviceType aDeviceType, DesktopCapturer::SourceId aSourceId, @@ -1620,7 +1620,7 @@ index 2274a21e8a287932342bb4fb58af728d13b89224..367466efc8457f99c87af1d285131f7b DesktopCaptureOptions options = CreateDesktopCaptureOptions(); std::unique_ptr capturer; -@@ -458,8 +459,10 @@ static std::unique_ptr CreateDesktopCapturerAndThread( +@@ -455,8 +456,10 @@ static std::unique_ptr CreateDesktopCapturerAndThread( capturer->SelectSource(aSourceId); @@ -1633,7 +1633,7 @@ index 2274a21e8a287932342bb4fb58af728d13b89224..367466efc8457f99c87af1d285131f7b } else if (aDeviceType == CaptureDeviceType::Browser) { // XXX We don't capture cursors, so avoid the extra indirection layer. We // could also pass null for the pMouseCursorMonitor. -@@ -476,7 +479,8 @@ static std::unique_ptr CreateDesktopCapturerAndThread( +@@ -473,7 +476,8 @@ static std::unique_ptr CreateDesktopCapturerAndThread( } DesktopCaptureImpl::DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, @@ -1643,7 +1643,7 @@ index 2274a21e8a287932342bb4fb58af728d13b89224..367466efc8457f99c87af1d285131f7b : mModuleId(aId), mTrackingId(mozilla::TrackingId(CaptureEngineToTrackingSourceStr([&] { switch (aType) { -@@ -493,6 +497,7 @@ DesktopCaptureImpl::DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, +@@ -490,6 +494,7 @@ DesktopCaptureImpl::DesktopCaptureImpl(const int32_t aId, const char* aUniqueId, aId)), mDeviceUniqueId(aUniqueId), mDeviceType(aType), @@ -1651,7 +1651,7 @@ index 2274a21e8a287932342bb4fb58af728d13b89224..367466efc8457f99c87af1d285131f7b mControlThread(mozilla::GetCurrentSerialEventTarget()), mNextFrameMinimumTime(Timestamp::Zero()), mCallbacks("DesktopCaptureImpl::mCallbacks") {} -@@ -517,6 +522,19 @@ void DesktopCaptureImpl::DeRegisterCaptureDataCallback( +@@ -514,6 +519,19 @@ void DesktopCaptureImpl::DeRegisterCaptureDataCallback( } } @@ -1671,7 +1671,7 @@ index 2274a21e8a287932342bb4fb58af728d13b89224..367466efc8457f99c87af1d285131f7b int32_t DesktopCaptureImpl::StopCaptureIfAllClientsClose() { { auto callbacks = mCallbacks.Lock(); -@@ -549,7 +567,7 @@ int32_t DesktopCaptureImpl::StartCapture( +@@ -546,7 +564,7 @@ int32_t DesktopCaptureImpl::StartCapture( DesktopCapturer::SourceId sourceId = std::stoi(mDeviceUniqueId); std::unique_ptr capturer = CreateDesktopCapturerAndThread( @@ -1680,7 +1680,7 @@ index 2274a21e8a287932342bb4fb58af728d13b89224..367466efc8457f99c87af1d285131f7b MOZ_ASSERT(!capturer == !mCaptureThread); if (!capturer) { -@@ -650,6 +668,15 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult, +@@ -647,6 +665,15 @@ void DesktopCaptureImpl::OnCaptureResult(DesktopCapturer::Result aResult, frameInfo.height = aFrame->size().height(); frameInfo.videoType = VideoType::kARGB; @@ -1830,7 +1830,7 @@ index 1f2d92bcb5d989bf9ecc044f8c51006f991b0007..9cf5dd885e658e0fe5e7ab75e7fc1f97 return aGlobalOrNull; diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp -index a7b02a55a73c0ab459278ce475459e43beeedc8f..b8f292420f1b563bf409e47e01972f23ac1e852f 100644 +index d1bd1d060d749de3ac16bd6e9fd3383383e4dd9a..e6262c210accf12c3d071d42031b432b2a6332b5 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -22,6 +22,7 @@ @@ -1877,10 +1877,10 @@ index 2f71b284ee5f7e11f117c447834b48355784448c..2640bd57123c2b03bf4b06a2419cd020 * returned quads are further translated relative to the window * origin -- which is not the layout origin. Further translation diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp -index f049e706028b59f05f20b1091c5706449f396f8b..b37a9b721cf86cf6f06a2d723ed019f3a46a1176 100644 +index 9c49ad97054ec46cfc52082202d36bb2b53482fc..46d22e51cfeaded274e63b9673e0c3c83b517e7a 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp -@@ -985,7 +985,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { +@@ -986,7 +986,7 @@ void PrefLanguagesChanged(const char* /* aPrefName */, void* /* aClosure */) { AssertIsOnMainThread(); nsTArray languages; @@ -1889,7 +1889,7 @@ index f049e706028b59f05f20b1091c5706449f396f8b..b37a9b721cf86cf6f06a2d723ed019f3 RuntimeService* runtime = RuntimeService::GetService(); if (runtime) { -@@ -1187,8 +1187,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { +@@ -1173,8 +1173,7 @@ bool RuntimeService::RegisterWorker(WorkerPrivate& aWorkerPrivate) { } // The navigator overridden properties should have already been read. @@ -1899,7 +1899,7 @@ index f049e706028b59f05f20b1091c5706449f396f8b..b37a9b721cf86cf6f06a2d723ed019f3 mNavigatorPropertiesLoaded = true; } -@@ -1800,6 +1799,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( +@@ -1778,6 +1777,13 @@ void RuntimeService::PropagateStorageAccessPermissionGranted( } } @@ -1913,7 +1913,7 @@ index f049e706028b59f05f20b1091c5706449f396f8b..b37a9b721cf86cf6f06a2d723ed019f3 template void RuntimeService::BroadcastAllWorkers(const Func& aFunc) { AssertIsOnMainThread(); -@@ -2322,6 +2328,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( +@@ -2295,6 +2301,14 @@ void PropagateStorageAccessPermissionGrantedToWorkers( } } @@ -1929,10 +1929,10 @@ index f049e706028b59f05f20b1091c5706449f396f8b..b37a9b721cf86cf6f06a2d723ed019f3 MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(aCx); diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h -index a770d7330edb2f99483ab0363211817ae40028b0..f677f14e2ac42c94483726bac8538b52129615cc 100644 +index e6deb81f357043a937d032bb4b6c38207203f4d9..ff16582af9fbf550dfb7b5639658c34199524c45 100644 --- a/dom/workers/RuntimeService.h +++ b/dom/workers/RuntimeService.h -@@ -110,6 +110,8 @@ class RuntimeService final : public nsIObserver { +@@ -108,6 +108,8 @@ class RuntimeService final : public nsIObserver { void PropagateStorageAccessPermissionGranted( const nsPIDOMWindowInner& aWindow); @@ -1955,10 +1955,10 @@ index d10dabb5c5ff8e17851edf2bd2efc08e74584d8e..53c4070c5fde43b27fb8fbfdcf4c23d8 bool IsWorkerGlobal(JSObject* global); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp -index 3c6a2fa249f4b993a440563247a68435cd7820d8..c82dc3c4d740abb74735d909b48b600ead193c76 100644 +index f7a8cec1ef69778b4579b72c58adeaf91315299e..87c18442e643a980cb07d43b9b1005c90953770b 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp -@@ -709,6 +709,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable { +@@ -711,6 +711,18 @@ class UpdateContextOptionsRunnable final : public WorkerControlRunnable { } }; @@ -1977,7 +1977,7 @@ index 3c6a2fa249f4b993a440563247a68435cd7820d8..c82dc3c4d740abb74735d909b48b600e class UpdateLanguagesRunnable final : public WorkerRunnable { nsTArray mLanguages; -@@ -2004,6 +2016,16 @@ void WorkerPrivate::UpdateContextOptions( +@@ -2006,6 +2018,16 @@ void WorkerPrivate::UpdateContextOptions( } } @@ -1994,7 +1994,7 @@ index 3c6a2fa249f4b993a440563247a68435cd7820d8..c82dc3c4d740abb74735d909b48b600e void WorkerPrivate::UpdateLanguages(const nsTArray& aLanguages) { AssertIsOnParentThread(); -@@ -5412,6 +5434,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( +@@ -5417,6 +5439,15 @@ void WorkerPrivate::UpdateContextOptionsInternal( } } @@ -2011,7 +2011,7 @@ index 3c6a2fa249f4b993a440563247a68435cd7820d8..c82dc3c4d740abb74735d909b48b600e const nsTArray& aLanguages) { WorkerGlobalScope* globalScope = GlobalScope(); diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h -index e78423f757d81bebf6a82ad261348f15af30f063..ed1d5eca153a3eab9268fa5d6402d40c34281f2c 100644 +index 6eb840b8e64b5a4db3c621599780561ef2fdaef4..59e27e6949dfda389516d64a7b4ac0f0e5a60148 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -413,6 +413,8 @@ class WorkerPrivate final @@ -2085,10 +2085,10 @@ index dd82415624e1f05eaad818d68b8588ffb1b64ab1..c48ab77757aff777658fd4e37db6bdea inline ClippedTime TimeClip(double time); diff --git a/js/src/debugger/Object.cpp b/js/src/debugger/Object.cpp -index 9c3a652b60e09013f77b9a7f7da03d376d21cb6a..091daaee4a3402a0c572a21142517e4f9e706257 100644 +index 49525b426a9f8656a471192ccf62f47f555a90a4..f6c832af063326a5e9e7166662bb21bc4e41cdca 100644 --- a/js/src/debugger/Object.cpp +++ b/js/src/debugger/Object.cpp -@@ -2426,7 +2426,11 @@ Maybe DebuggerObject::call(JSContext* cx, +@@ -2413,7 +2413,11 @@ Maybe DebuggerObject::call(JSContext* cx, invokeArgs[i].set(args2[i]); } @@ -2255,25 +2255,25 @@ index dac899f7558b26d6848da8b98ed8a93555c8751a..2a07d67fa1c2840b25085566e84dc3b2 // No boxes to return return; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp -index bd8cfa12fa79306b8d41011f2abf4ed40c12c2c4..63c77656c2e7c6c9a4d713ca9561411f304e187e 100644 +index bb625a6dda2475164d3236ed03ee248bfc2f6d66..6e6d5aca3701c4eb2b69e74226cf6ed8b10b65cd 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp -@@ -10896,7 +10896,9 @@ auto PresShell::ComputeActiveness() const -> Activeness { +@@ -10925,7 +10925,9 @@ bool PresShell::ComputeActiveness() const { if (!browserChild->IsVisible()) { MOZ_LOG(gLog, LogLevel::Debug, (" > BrowserChild %p is not visible", browserChild)); -- return {false, inActiveTab}; +- return false; + bool isActive; + root->GetDocShell()->GetForceActiveState(&isActive); -+ return {isActive, inActiveTab}; ++ return isActive; } // If the browser is visible but just due to be preserving layers diff --git a/layout/style/GeckoBindings.h b/layout/style/GeckoBindings.h -index 9e5ffc264bbbfa13b0cdb37a5c987074f2d8e8c9..9b7164b10703b48f538ee983b1ef82146876e2bb 100644 +index 1d5d60bb4e7cc0d93ff7e6662c9102bde59509c1..ee1436d6e06f13a4386314e8bb8e4e3998ae5a0c 100644 --- a/layout/style/GeckoBindings.h +++ b/layout/style/GeckoBindings.h -@@ -629,6 +629,7 @@ float Gecko_MediaFeatures_GetResolution(const mozilla::dom::Document*); +@@ -630,6 +630,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*); @@ -2282,10 +2282,10 @@ index 9e5ffc264bbbfa13b0cdb37a5c987074f2d8e8c9..9b7164b10703b48f538ee983b1ef8214 const mozilla::dom::Document*); mozilla::StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme( diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp -index 581b6da29ba6bc321c549802b8bd5e3364724460..33827a19b46bc4814a0554629cea41e3d566bf8e 100644 +index 5e4fe65abcc373e6c0fba40458677cebb085266b..9425984faca3579cb90e96ae46ed47e66c2dc664 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp -@@ -277,11 +277,11 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) { +@@ -261,11 +261,11 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) { } bool Gecko_MediaFeatures_PrefersReducedMotion(const Document* aDocument) { @@ -2303,10 +2303,10 @@ index 581b6da29ba6bc321c549802b8bd5e3364724460..33827a19b46bc4814a0554629cea41e3 bool Gecko_MediaFeatures_PrefersReducedTransparency(const Document* aDocument) { diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js -index a366fdaeb88daf820734508f7916ec68c70273fd..ebbbe8cee358517a851cfec085738b58c3791421 100644 +index a38a760f9c5ce666ad8d51d46f7685c9ac45d7b3..ed4d6bf2512f2428781e83612643230a5974d80a 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js -@@ -3968,7 +3968,9 @@ pref("devtools.f12_enabled", true); +@@ -3933,7 +3933,9 @@ pref("devtools.f12_enabled", true); // doesn't provide a way to lock the pref pref("dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled", false); #else @@ -2318,10 +2318,10 @@ index a366fdaeb88daf820734508f7916ec68c70273fd..ebbbe8cee358517a851cfec085738b58 // Whether sites require the open-protocol-handler permission to open a diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp -index f7c5829c964217132bbd3b67b961a183df42fb77..cd1006e2234f50facc916f25e996a2b0bc444d0b 100644 +index 164a1c1457ef21a6e1019caf9d1e710649e9f754..07fd3ecbabc103599204606024d8e0403345f02e 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp -@@ -645,7 +645,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) +@@ -641,7 +641,8 @@ LoadInfo::LoadInfo(const LoadInfo& rhs) mUnstrippedURI(rhs.mUnstrippedURI), mInterceptionInfo(rhs.mInterceptionInfo), mHasInjectedCookieForCookieBannerHandling( @@ -2331,7 +2331,7 @@ index f7c5829c964217132bbd3b67b961a183df42fb77..cd1006e2234f50facc916f25e996a2b0 LoadInfo::LoadInfo( nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal, -@@ -2298,4 +2299,16 @@ LoadInfo::SetHasInjectedCookieForCookieBannerHandling( +@@ -2321,4 +2322,16 @@ LoadInfo::SetHasInjectedCookieForCookieBannerHandling( return NS_OK; } @@ -2349,10 +2349,10 @@ index f7c5829c964217132bbd3b67b961a183df42fb77..cd1006e2234f50facc916f25e996a2b0 + } // namespace mozilla::net diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h -index dace62e98dff10497c0271dac1c010afd3733a67..18e30006978a249ebdacdc8e07ce0b980e9c70ea 100644 +index f97d2389297ea1c4771ae2c7e55a0b3eade0743a..89c47840301480ffce5dd385bb5b0a34bfdd7390 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h -@@ -384,6 +384,8 @@ class LoadInfo final : public nsILoadInfo { +@@ -387,6 +387,8 @@ class LoadInfo final : public nsILoadInfo { nsCOMPtr mInterceptionInfo; bool mHasInjectedCookieForCookieBannerHandling = false; @@ -2362,10 +2362,10 @@ index dace62e98dff10497c0271dac1c010afd3733a67..18e30006978a249ebdacdc8e07ce0b98 // This is exposed solely for testing purposes and should not be used outside of diff --git a/netwerk/base/TRRLoadInfo.cpp b/netwerk/base/TRRLoadInfo.cpp -index 2b9360cd23f1f2009ee2788470c4ff30a2e6e6c1..f6f7ca21ef0509a8751bfa9e08e24219b32a5c3e 100644 +index 37b0b7bfe516ca69441e4cdd58861de9d595c692..6d3bb900624b6ad9e9449ce6f462a87dacfd4cb9 100644 --- a/netwerk/base/TRRLoadInfo.cpp +++ b/netwerk/base/TRRLoadInfo.cpp -@@ -827,5 +827,16 @@ TRRLoadInfo::SetHasInjectedCookieForCookieBannerHandling( +@@ -845,5 +845,16 @@ TRRLoadInfo::SetHasInjectedCookieForCookieBannerHandling( return NS_ERROR_NOT_IMPLEMENTED; } @@ -2383,10 +2383,10 @@ index 2b9360cd23f1f2009ee2788470c4ff30a2e6e6c1..f6f7ca21ef0509a8751bfa9e08e24219 } // namespace net } // namespace mozilla diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl -index f3f8304a1b88ba7b1b7465963a717997d812a2b4..06402586a95efdcc01397837d2cad06b4503f0b7 100644 +index 7f3422274f7c075fcd6486ae5b8f5cd073aa1ccc..b667ba1e7dcea7e5d31f27df211553929e069993 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl -@@ -1488,4 +1488,6 @@ interface nsILoadInfo : nsISupports +@@ -1505,4 +1505,6 @@ interface nsILoadInfo : nsISupports * handle a cookie banner. This is only done for top-level requests. */ [infallible] attribute boolean hasInjectedCookieForCookieBannerHandling; @@ -2406,10 +2406,10 @@ index d72dc570dc82ff9d576942b9e7c23d8a74d68049..a5fcddc4b0e53a862e5a77120b4ccff8 /** * Set the status and reason for the forthcoming synthesized response. diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp -index 7ce1ef0a864bc5fa6a616170dab03974c62aa8ed..d514ea18fd18d03ddb898636ba34d724d41cfdc2 100644 +index ec7f54c1cc7a177e6487f4bc317ef28bfa34f348..8e34230df1183b408a8f6439965c0b48826aa974 100644 --- a/netwerk/ipc/DocumentLoadListener.cpp +++ b/netwerk/ipc/DocumentLoadListener.cpp -@@ -163,6 +163,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, +@@ -165,6 +165,7 @@ static auto CreateDocumentLoadInfo(CanonicalBrowsingContext* aBrowsingContext, loadInfo->SetHasValidUserGestureActivation( aLoadState->HasValidUserGestureActivation()); loadInfo->SetIsMetaRefresh(aLoadState->IsMetaRefresh()); @@ -2418,7 +2418,7 @@ index 7ce1ef0a864bc5fa6a616170dab03974c62aa8ed..d514ea18fd18d03ddb898636ba34d724 return loadInfo.forget(); } diff --git a/netwerk/protocol/http/InterceptedHttpChannel.cpp b/netwerk/protocol/http/InterceptedHttpChannel.cpp -index c493259905d8b4e6b3a860cd6436c2606e8e8d29..7060deb04d3b3deb3e1cd90b75848229cf2252f2 100644 +index 03a2605c5d5591f7656ba4c4ff9a46f2e390c404..717f87b632995cb955fce5995604153ae4084561 100644 --- a/netwerk/protocol/http/InterceptedHttpChannel.cpp +++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp @@ -729,6 +729,14 @@ NS_IMPL_ISUPPORTS(ResetInterceptionHeaderVisitor, nsIHttpHeaderVisitor) @@ -2436,7 +2436,7 @@ index c493259905d8b4e6b3a860cd6436c2606e8e8d29..7060deb04d3b3deb3e1cd90b75848229 NS_IMETHODIMP InterceptedHttpChannel::ResetInterception(bool aBypass) { INTERCEPTED_LOG(("InterceptedHttpChannel::ResetInterception [%p] bypass: %s", -@@ -1071,11 +1079,18 @@ InterceptedHttpChannel::OnStartRequest(nsIRequest* aRequest) { +@@ -1072,11 +1080,18 @@ InterceptedHttpChannel::OnStartRequest(nsIRequest* aRequest) { GetCallback(mProgressSink); } @@ -2456,10 +2456,10 @@ index c493259905d8b4e6b3a860cd6436c2606e8e8d29..7060deb04d3b3deb3e1cd90b75848229 if (mPump && mLoadFlags & LOAD_CALL_CONTENT_SNIFFERS) { mPump->PeekStream(CallTypeSniffers, static_cast(this)); diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp -index 0908642956b66e867be59c5777f26e4c9f95d5ec..3d7677c454c5a0d2169686c2abad7b332f2413ce 100644 +index b2423f754063dd42ad80a607dc7a39ddc2bf89b3..99ce1ebd141ff1d2f6982b2fa8ed485c658d3abe 100644 --- a/parser/html/nsHtml5TreeOpExecutor.cpp +++ b/parser/html/nsHtml5TreeOpExecutor.cpp -@@ -1372,6 +1372,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( +@@ -1375,6 +1375,10 @@ void nsHtml5TreeOpExecutor::UpdateReferrerInfoFromMeta( void nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); @@ -2544,7 +2544,7 @@ index 6dfd07d6b676a99993408921de8dea9d561f201d..e3c6794363cd6336effbeac83a179f37 readonly attribute boolean securityCheckDisabled; }; diff --git a/services/settings/Utils.sys.mjs b/services/settings/Utils.sys.mjs -index 697409ab07c5274696b51c5033cb07ca408d5332..4bb56c915535d3578525e82a3309435ad333fba2 100644 +index d9150337a18c0d41fab89c46a3792049df89bc84..0257ee0899355c315da7f632deec645738732663 100644 --- a/services/settings/Utils.sys.mjs +++ b/services/settings/Utils.sys.mjs @@ -95,7 +95,7 @@ function _isUndefined(value) { @@ -2557,7 +2557,7 @@ index 697409ab07c5274696b51c5033cb07ca408d5332..4bb56c915535d3578525e82a3309435a : AppConstants.REMOTE_SETTINGS_SERVER_URL; }, diff --git a/servo/components/style/gecko/media_features.rs b/servo/components/style/gecko/media_features.rs -index 4ca746ea84d917b95dfb66953660ca0a4572e647..bafeb667f3dbc7fa66d4baf811bf5cd5eb728c60 100644 +index 986c5fe7d8dc07ae71057cb1cd778566184cd137..bf83c7504b457383f02ec4d211c0659ad3ca415b 100644 --- a/servo/components/style/gecko/media_features.rs +++ b/servo/components/style/gecko/media_features.rs @@ -291,10 +291,15 @@ pub enum ForcedColors { @@ -2594,10 +2594,10 @@ index 54de3abab5757dd706e3d909ccef6a0bed5deacc..f5c5480cd052ede0c76e5eec733dbb92 // ignored for Linux. const unsigned long CHROME_SUPPRESS_ANIMATION = 0x01000000; diff --git a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs -index acea04b6fd130ae60a9ddbd8d5e6ebfcec2d547a..74019bfce26447a8a900b0303f30db42c24325a9 100644 +index 61eda006f090e391b3c0f209e9400920f480c115..8fea8caf17913a2736884caca8f6087f1fb48d15 100644 --- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs +++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.sys.mjs -@@ -110,6 +110,12 @@ EnterprisePoliciesManager.prototype = { +@@ -108,6 +108,12 @@ EnterprisePoliciesManager.prototype = { Services.prefs.clearUserPref(PREF_POLICIES_APPLIED); } @@ -2639,10 +2639,10 @@ index 654903fadb709be976b72f36f155e23bc0622152..815b3dc24c9fda6b1db6c4666ac68904 int32_t aMaxSelfProgress, int32_t aCurTotalProgress, diff --git a/toolkit/components/windowwatcher/nsWindowWatcher.cpp b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -index 72ee99c7341de54f2282e3f2a686d6a33b26ecaf..4a739e7cad294cf809a697da905253adee4e24b1 100644 +index 9c8e6a919263899f95bc41b1ca419d5048e50b2a..4b3ad73393c24268b6df62823e56bcf4367cac21 100644 --- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp +++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp -@@ -1875,7 +1875,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( +@@ -1882,7 +1882,11 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForContent( // Open a minimal popup. *aIsPopupRequested = true; @@ -2656,10 +2656,10 @@ index 72ee99c7341de54f2282e3f2a686d6a33b26ecaf..4a739e7cad294cf809a697da905253ad /** diff --git a/toolkit/mozapps/update/UpdateService.sys.mjs b/toolkit/mozapps/update/UpdateService.sys.mjs -index a0ba7fe61e0449a7302302429993091075950c21..15e89c7d8000e66bbbf97dd0bb00da3e710e5ec0 100644 +index e79ef9a551dd4fd0854bbfae56d4d7ee105a70c7..814c53dcc65faf3441a66d253dbcd59363ee32ac 100644 --- a/toolkit/mozapps/update/UpdateService.sys.mjs +++ b/toolkit/mozapps/update/UpdateService.sys.mjs -@@ -3848,6 +3848,8 @@ UpdateService.prototype = { +@@ -3816,6 +3816,8 @@ UpdateService.prototype = { }, get disabledForTesting() { @@ -2681,23 +2681,22 @@ index d2ccd8748228b04c84754f9a6dce2ca3bf991e47..d3a8ea1d9994f724cd52cecd4d2cd285 ] diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp -index ea14a59b80bbfbaa17d7569734b8409d9d21fcde..28cb052c3115f91e6a036ad8466385ff1d740cd0 100644 +index 7eb9e1104682d4eb47060654f43a1efa8b2a6bb2..a8315d6decf654b5302bea5beeea34140c300ded 100644 --- a/toolkit/xre/nsWindowsWMain.cpp +++ b/toolkit/xre/nsWindowsWMain.cpp -@@ -14,9 +14,11 @@ +@@ -14,8 +14,10 @@ #endif #include "mozilla/Char16.h" +#include "mozilla/CmdLineAndEnvUtils.h" #include "nsUTF8Utils.h" - #include "nsWindowsHelpers.h" +#include #include - #include - -@@ -130,6 +132,19 @@ int wmain(int argc, WCHAR** argv) { + #ifdef __MINGW32__ +@@ -114,6 +116,19 @@ static void FreeAllocStrings(int argc, char** argv) { + int wmain(int argc, WCHAR** argv) { SanitizeEnvironmentVariables(); SetDllDirectoryW(L""); + bool hasJugglerPipe = @@ -2717,10 +2716,10 @@ index ea14a59b80bbfbaa17d7569734b8409d9d21fcde..28cb052c3115f91e6a036ad8466385ff // 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 e1e46ccdceae595f95d100116ff480905047e82b..eaa0252e768140120158525723ad867b8cb020be 100644 +index f779f0028e87a0fd1d7f633c9c23872f9d840cf6..29a2ec96eb52fd3b09994c63a0d5280437be2854 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp -@@ -830,6 +830,13 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout, +@@ -828,6 +828,13 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout, ("DocLoader:%p: Firing load event for document.open\n", this)); @@ -2735,7 +2734,7 @@ index e1e46ccdceae595f95d100116ff480905047e82b..eaa0252e768140120158525723ad867b // 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 ee210396f0e7265180f07f6f034c9389a87a02ce..6c0997ecb153547558ad1a0c146b0ca4e8ffbc46 100644 +index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295ea050b878 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -112,6 +112,7 @@ @@ -2746,7 +2745,7 @@ index ee210396f0e7265180f07f6f034c9389a87a02ce..6c0997ecb153547558ad1a0c146b0ca4 #include "mozilla/Preferences.h" #include "mozilla/ipc/URIUtils.h" -@@ -836,6 +837,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension( +@@ -831,6 +832,12 @@ NS_IMETHODIMP nsExternalHelperAppService::ApplyDecodingForExtension( return NS_OK; } @@ -2759,7 +2758,7 @@ index ee210396f0e7265180f07f6f034c9389a87a02ce..6c0997ecb153547558ad1a0c146b0ca4 nsresult nsExternalHelperAppService::GetFileTokenForPath( const char16_t* aPlatformAppPath, nsIFile** aFile) { nsDependentString platformAppPath(aPlatformAppPath); -@@ -1446,7 +1453,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { +@@ -1442,7 +1449,12 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel* aChannel) { // Strip off the ".part" from mTempLeafName mTempLeafName.Truncate(mTempLeafName.Length() - ArrayLength(".part") + 1); @@ -2772,7 +2771,7 @@ index ee210396f0e7265180f07f6f034c9389a87a02ce..6c0997ecb153547558ad1a0c146b0ca4 mSaver = do_CreateInstance(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); -@@ -1635,7 +1647,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1631,7 +1643,36 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { return NS_OK; } @@ -2810,7 +2809,7 @@ index ee210396f0e7265180f07f6f034c9389a87a02ce..6c0997ecb153547558ad1a0c146b0ca4 if (NS_FAILED(rv)) { nsresult transferError = rv; -@@ -1687,6 +1728,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { +@@ -1683,6 +1724,9 @@ NS_IMETHODIMP nsExternalAppHandler::OnStartRequest(nsIRequest* request) { bool alwaysAsk = true; mMimeInfo->GetAlwaysAskBeforeHandling(&alwaysAsk); @@ -2820,7 +2819,7 @@ index ee210396f0e7265180f07f6f034c9389a87a02ce..6c0997ecb153547558ad1a0c146b0ca4 if (alwaysAsk) { // But we *don't* ask if this mimeInfo didn't come from // our user configuration datastore and the user has said -@@ -2193,6 +2237,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, +@@ -2199,6 +2243,16 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver* aSaver, NotifyTransfer(aStatus); } @@ -2837,7 +2836,7 @@ index ee210396f0e7265180f07f6f034c9389a87a02ce..6c0997ecb153547558ad1a0c146b0ca4 return NS_OK; } -@@ -2674,6 +2728,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { +@@ -2680,6 +2734,15 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel(nsresult aReason) { } } @@ -2854,7 +2853,7 @@ index ee210396f0e7265180f07f6f034c9389a87a02ce..6c0997ecb153547558ad1a0c146b0ca4 // OnStartRequest) mDialog = nullptr; diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h -index 6c8cbc5871d3aa721a3f1a3ff6c0ef8b0044c63e..8e7c9af1a2cfe60c9c543af1ab55f6c229000bd4 100644 +index 205f73cfa127e15e171854165c92551fea957e84..6399525ea0abb55655c824b086a043d022392113 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.h +++ b/uriloader/exthandler/nsExternalHelperAppService.h @@ -257,6 +257,8 @@ class nsExternalHelperAppService : public nsIExternalHelperAppService, @@ -2866,7 +2865,7 @@ index 6c8cbc5871d3aa721a3f1a3ff6c0ef8b0044c63e..8e7c9af1a2cfe60c9c543af1ab55f6c2 }; /** -@@ -456,6 +458,9 @@ class nsExternalAppHandler final : public nsIStreamListener, +@@ -462,6 +464,9 @@ class nsExternalAppHandler final : public nsIStreamListener, * Upon successful return, both mTempFile and mSaver will be valid. */ nsresult SetUpTempFile(nsIChannel* aChannel); @@ -2877,19 +2876,22 @@ index 6c8cbc5871d3aa721a3f1a3ff6c0ef8b0044c63e..8e7c9af1a2cfe60c9c543af1ab55f6c2 * 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 307e6196a89df52d0bccc3ebd1359f58e32de75d..c3692d0f76178ac3aeb1c77a0e973bfa22359346 100644 +index 4a399acb72d4fd475c9ae43e9eadbc32f261e290..31e9490a7dfd7d7eff69ad23c9ce277f367d1524 100644 --- a/uriloader/exthandler/nsIExternalHelperAppService.idl +++ b/uriloader/exthandler/nsIExternalHelperAppService.idl -@@ -6,6 +6,8 @@ +@@ -6,8 +6,11 @@ #include "nsICancelable.idl" +webidl BrowsingContext; +interface nsIHelperAppLauncher; interface nsIURI; - interface nsIRequest; + interface nsIChannel; ++interface nsIRequest; interface nsIStreamListener; -@@ -15,6 +17,17 @@ interface nsIWebProgressListener2; + interface nsIFile; + interface nsIMIMEInfo; +@@ -15,6 +18,17 @@ interface nsIWebProgressListener2; interface nsIInterfaceRequestor; webidl BrowsingContext; @@ -2907,7 +2909,7 @@ index 307e6196a89df52d0bccc3ebd1359f58e32de75d..c3692d0f76178ac3aeb1c77a0e973bfa /** * The external helper app service is used for finding and launching * platform specific external applications for a given mime content type. -@@ -76,6 +89,7 @@ interface nsIExternalHelperAppService : nsISupports +@@ -76,6 +90,7 @@ interface nsIExternalHelperAppService : nsISupports boolean applyDecodingForExtension(in AUTF8String aExtension, in ACString aEncodingType); @@ -2944,34 +2946,34 @@ index 1c25e9d9a101233f71e92288a0f93125b81ac1c5..22cf67b0f6e3ddd2b3ed725a314ba6a9 } #endif diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h -index 5a19cb4082674ede982a0c66c84bf7c4642abe2b..5fe6ae7b5bf605e5d9130aa164d7cbbb486e54e0 100644 +index 5e20484e043e070dd8a6d7ee5ecab939435efc2c..f721212f147d01a8824e67c26216f249032254bf 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h -@@ -203,6 +203,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, +@@ -204,6 +204,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, : mReason(eReal), mContextMenuTrigger(eNormal), mClickCount(0), + mJugglerEventId(0), mIgnoreRootScrollFrame(false), - mUseLegacyNonPrimaryDispatch(false), mClickEventPrevented(false) {} -@@ -213,6 +214,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, + +@@ -215,6 +216,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, mReason(aReason), mContextMenuTrigger(eNormal), mClickCount(0), + mJugglerEventId(0), mIgnoreRootScrollFrame(false), - mUseLegacyNonPrimaryDispatch(false), mClickEventPrevented(false) {} -@@ -231,6 +233,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, + +@@ -234,6 +236,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, mReason(aReason), mContextMenuTrigger(aContextMenuTrigger), mClickCount(0), + mJugglerEventId(0), mIgnoreRootScrollFrame(false), - mUseLegacyNonPrimaryDispatch(false), mClickEventPrevented(false) { -@@ -280,6 +283,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, + if (aMessage == eContextMenu) { +@@ -282,6 +285,9 @@ class WidgetMouseEvent : public WidgetMouseEventBase, // Otherwise, this must be 0. uint32_t mClickCount; @@ -2981,19 +2983,19 @@ index 5a19cb4082674ede982a0c66c84bf7c4642abe2b..5fe6ae7b5bf605e5d9130aa164d7cbbb // Whether the event should ignore scroll frame bounds during dispatch. bool mIgnoreRootScrollFrame; -@@ -296,6 +302,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, +@@ -294,6 +300,7 @@ class WidgetMouseEvent : public WidgetMouseEventBase, mExitFrom = aEvent.mExitFrom; mClickCount = aEvent.mClickCount; + mJugglerEventId = aEvent.mJugglerEventId; mIgnoreRootScrollFrame = aEvent.mIgnoreRootScrollFrame; - mUseLegacyNonPrimaryDispatch = aEvent.mUseLegacyNonPrimaryDispatch; mClickEventPrevented = aEvent.mClickEventPrevented; + } diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.mm -index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c62b016eec 100644 +index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce8050630a1aa 100644 --- a/widget/cocoa/NativeKeyBindings.mm +++ b/widget/cocoa/NativeKeyBindings.mm -@@ -492,6 +492,13 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType, +@@ -528,6 +528,13 @@ break; case KEY_NAME_INDEX_ArrowLeft: if (aEvent.IsAlt()) { @@ -3007,7 +3009,7 @@ index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c6 break; } if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) { -@@ -512,6 +519,13 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType, +@@ -550,6 +557,13 @@ break; case KEY_NAME_INDEX_ArrowRight: if (aEvent.IsAlt()) { @@ -3021,7 +3023,7 @@ index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c6 break; } if (aEvent.IsMeta() || (aEvent.IsControl() && aEvent.IsShift())) { -@@ -532,6 +546,10 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType, +@@ -572,6 +586,10 @@ break; case KEY_NAME_INDEX_ArrowUp: if (aEvent.IsControl()) { @@ -3032,16 +3034,16 @@ index d3e5983259053175584254e7ac01ca9ce024f33a..97f5b851c402fea5477c0ee57af451c6 break; } if (aEvent.IsMeta()) { -@@ -541,7 +559,7 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType, - instance->AppendEditCommandsForSelector( +@@ -582,7 +600,7 @@ !aEvent.IsShift() ? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:)) -- : ToObjcSelectorPtr(@selector(moveToBegginingOfDocumentAndModifySelection:)), -+ : ToObjcSelectorPtr(@selector(moveToBeginningOfDocumentAndModifySelection:)), + : ToObjcSelectorPtr( +- @selector(moveToBegginingOfDocumentAndModifySelection:)), ++ @selector(moveToBeginningOfDocumentAndModifySelection:)), aCommands); break; } -@@ -564,6 +582,10 @@ void NativeKeyBindings::GetEditCommandsForTests(NativeKeyBindingsType aType, +@@ -609,6 +627,10 @@ break; case KEY_NAME_INDEX_ArrowDown: if (aEvent.IsControl()) { @@ -3244,7 +3246,7 @@ index 9856991ef32f25f51942f8cd664a09bec2192c70..948947a421179e91c51005aeb83ed0d1 ~HeadlessWidget(); bool mEnabled; diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h -index a4cd12a151e7a172389affb34adf0a4085e597a5..fb4c340644255b11a15cf5a3587d950ae4f091d7 100644 +index e8b831233338630c3106fd9debeba128228d3e0c..60422b1a1734e1bdeba7b6083727e29f0e5e9f35 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h @@ -234,6 +234,7 @@ struct ParamTraits { diff --git a/browser_patches/firefox/preferences/playwright.cfg b/browser_patches/firefox/preferences/playwright.cfg index 6c33bd2545..49976d7fd7 100644 --- a/browser_patches/firefox/preferences/playwright.cfg +++ b/browser_patches/firefox/preferences/playwright.cfg @@ -3,6 +3,8 @@ // ================================================================= // THESE ARE THE PROPERTIES THAT MUST BE ENABLED FOR JUGGLER TO WORK // ================================================================= +pref("dom.input_events.security.minNumTicks", 0); +pref("dom.input_events.security.minTimeElapsedInMS", 0); pref("datareporting.policy.dataSubmissionEnabled", false); pref("datareporting.policy.dataSubmissionPolicyAccepted", false); @@ -305,3 +307,5 @@ pref("extensions.blocklist.enabled", false); // Force Firefox Devtools to open in a separate window. pref("devtools.toolbox.host", "window"); +// Disable auto translations +pref("browser.translations.enable", false); diff --git a/browser_patches/webkit/UPSTREAM_CONFIG.sh b/browser_patches/webkit/UPSTREAM_CONFIG.sh index d72c74d470..aa9e856e37 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="30884546903f1ba774adb0cbef1adc91c6c53c64" +BASE_REVISION="bc0bc692bc9e368bbd9d530322db73b374cd6268" diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff index b3e9920535..e686675ca5 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 be40cc1430aaa1d3a2cd5a1675e9180a81eddc37..e7b8a2677a349a6ba5c9f64bbc81bd7210c38900 100644 +index ebb0626fd9e56c4cbdb17f1723ef8052155cea58..b87e04448c219703d18fc3d04693892423d36de2 100644 --- a/Source/JavaScriptCore/CMakeLists.txt +++ b/Source/JavaScriptCore/CMakeLists.txt -@@ -1417,22 +1417,27 @@ set(JavaScriptCore_INSPECTOR_DOMAINS +@@ -1436,22 +1436,27 @@ set(JavaScriptCore_INSPECTOR_DOMAINS ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json @@ -132,58 +132,8 @@ index eb25aedee4cd9ebe007e06c2515b37ee095b06f4..badf6559595c8377db1089ca3c25008e static String createIdentifier(); static String requestId(unsigned long identifier); }; -diff --git a/Source/JavaScriptCore/inspector/InjectedScript.cpp b/Source/JavaScriptCore/inspector/InjectedScript.cpp -index 4ce807389f1643cdd6249c645f581641ec3a5c71..555fef137b2ff085089f9e4cbd150dc7555da926 100644 ---- a/Source/JavaScriptCore/inspector/InjectedScript.cpp -+++ b/Source/JavaScriptCore/inspector/InjectedScript.cpp -@@ -90,7 +90,7 @@ void InjectedScript::awaitPromise(const String& promiseObjectId, bool returnByVa - makeAsyncCall(function, WTFMove(callback)); - } - --void InjectedScript::callFunctionOn(Protocol::ErrorString& errorString, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr& result, std::optional& wasThrown) -+void InjectedScript::callFunctionOn(const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, bool awaitPromise, AsyncCallCallback&& callback) - { - ScriptFunctionCall function(globalObject(), injectedScriptObject(), "callFunctionOn"_s, inspectorEnvironment()->functionCallHandler()); - function.appendArgument(objectId); -@@ -98,10 +98,8 @@ void InjectedScript::callFunctionOn(Protocol::ErrorString& errorString, const St - function.appendArgument(arguments); - function.appendArgument(returnByValue); - function.appendArgument(generatePreview); -- -- std::optional savedResultIndex; -- makeEvalCall(errorString, function, result, wasThrown, savedResultIndex); -- ASSERT(!savedResultIndex); -+ function.appendArgument(awaitPromise); -+ makeAsyncCall(function, WTFMove(callback)); - } - - void InjectedScript::evaluateOnCallFrame(Protocol::ErrorString& errorString, JSC::JSValue callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr& result, std::optional& wasThrown, std::optional& savedResultIndex) -@@ -288,6 +286,10 @@ RefPtr InjectedScript::wrapObject(JSC::JSValue - auto callResult = callFunctionWithEvalEnabled(wrapFunction); - if (!callResult) - return nullptr; -+ auto callResultValue = callResult.value(); -+ // callResultValue could be missing if the execution was terminated -+ if (!callResultValue) -+ return nullptr; - - auto resultValue = toInspectorValue(globalObject(), callResult.value()); - if (!resultValue) -diff --git a/Source/JavaScriptCore/inspector/InjectedScript.h b/Source/JavaScriptCore/inspector/InjectedScript.h -index f09e489283ebf688f73d1e740c3102306173017b..954c8cef9e9a2d3b7c0f128899fa0b2292258186 100644 ---- a/Source/JavaScriptCore/inspector/InjectedScript.h -+++ b/Source/JavaScriptCore/inspector/InjectedScript.h -@@ -64,7 +64,7 @@ public: - void evaluate(Protocol::ErrorString&, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr& result, std::optional& wasThrown, std::optional& savedResultIndex); - void awaitPromise(const String& promiseObjectId, bool returnByValue, bool generatePreview, bool saveResult, AsyncCallCallback&&); - void evaluateOnCallFrame(Protocol::ErrorString&, JSC::JSValue callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, bool saveResult, RefPtr& result, std::optional& wasThrown, std::optional& savedResultIndex); -- void callFunctionOn(Protocol::ErrorString&, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr& result, std::optional& wasThrown); -+ void callFunctionOn(const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, bool awaitPromise, AsyncCallCallback&&); - void getFunctionDetails(Protocol::ErrorString&, const String& functionId, RefPtr& result); - void functionDetails(Protocol::ErrorString&, JSC::JSValue, RefPtr& result); - void getPreview(Protocol::ErrorString&, const String& objectId, RefPtr& result); diff --git a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp -index 14585eabd64a109573bed2336643f4c52e11f180..a1c34d3891405f1c8f6148a031f5045d2fa4d079 100644 +index 731a91727561c1507d074ad27f592d274dfeb324..9320b24579466bb1baa8b68430fe9cbb6c152770 100644 --- a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp +++ b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp @@ -84,7 +84,10 @@ static RefPtr jsToInspectorValue(JSC::JSGlobalObject* globalObject, @@ -198,86 +148,6 @@ index 14585eabd64a109573bed2336643f4c52e11f180..a1c34d3891405f1c8f6148a031f5045d if (!inspectorValue) return nullptr; inspectorObject->setValue(name.string(), inspectorValue.releaseNonNull()); -diff --git a/Source/JavaScriptCore/inspector/InjectedScriptSource.js b/Source/JavaScriptCore/inspector/InjectedScriptSource.js -index a665049c589ad59f92b147ef2e9e058eb72bb67c..71f4db75938e830e5d8e201c291c17da3aaff6c9 100644 ---- a/Source/JavaScriptCore/inspector/InjectedScriptSource.js -+++ b/Source/JavaScriptCore/inspector/InjectedScriptSource.js -@@ -172,7 +172,7 @@ let InjectedScript = class InjectedScript extends PrototypelessObjectBase - return; - } - -- if (!(promiseObject instanceof @Promise)) { -+ if (InjectedScriptHost.internalConstructorName(promiseObject) !== 'Promise') { - callback("Object with given id is not a Promise"); - return; - } -@@ -207,14 +207,16 @@ let InjectedScript = class InjectedScript extends PrototypelessObjectBase - return this._evaluateAndWrap(callFrame.evaluateWithScopeExtension, callFrame, expression, objectGroup, isEvalOnCallFrame, includeCommandLineAPI, returnByValue, generatePreview, saveResult); - } - -- callFunctionOn(objectId, expression, args, returnByValue, generatePreview) -+ callFunctionOn(objectId, expression, args, returnByValue, generatePreview, awaitPromise, callback) - { - let parsedObjectId = this._parseObjectId(objectId); - let object = this._objectForId(parsedObjectId); - let objectGroupName = this._idToObjectGroupName[parsedObjectId.id]; - -- if (!isDefined(object)) -- return "Could not find object with given id"; -+ if (!isDefined(object)) { -+ callback(this._createThrownValue("Could not find object with given id", objectGroupName)); -+ return ; -+ } - - let resolvedArgs = @createArrayWithoutPrototype(); - if (args) { -@@ -223,22 +225,37 @@ let InjectedScript = class InjectedScript extends PrototypelessObjectBase - try { - resolvedArgs[i] = this._resolveCallArgument(callArgs[i]); - } catch (e) { -- return @String(e); -+ callback(this._createThrownValue(e, objectGroupName)); -+ return; - } - } - } - - try { - let func = InjectedScriptHost.evaluate("(" + expression + ")"); -- if (typeof func !== "function") -- return "Given expression does not evaluate to a function"; -- -- return @createObjectWithoutPrototype( -- "wasThrown", false, -- "result", RemoteObject.create(func.@apply(object, resolvedArgs), objectGroupName, returnByValue, generatePreview), -- ); -+ if (typeof func !== "function") { -+ callback(this._createThrownValue("Given expression does not evaluate to a function", objectGroupName)); -+ return; -+ } -+ let result = func.@apply(object, resolvedArgs); -+ if (awaitPromise && isDefined(result) && (InjectedScriptHost.internalConstructorName(result) === 'Promise')) { -+ result.then(value => { -+ callback({ -+ wasThrown: false, -+ result: RemoteObject.create(value, objectGroupName, returnByValue, generatePreview), -+ }); -+ }, reason => { -+ callback(this._createThrownValue(reason, objectGroupName)); -+ }); -+ } else { -+ callback({ -+ wasThrown: false, -+ result: RemoteObject.create(result, objectGroupName, returnByValue, generatePreview) -+ }); -+ } - } catch (e) { -- return this._createThrownValue(e, objectGroupName); -+ callback(this._createThrownValue(e, objectGroupName)); -+ return; - } - } - diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp index 820a08fc660633e09675d0e647bd0c50d2fa905a..5ca5ee5a6897b7ef332d906018b457122096df98 100644 --- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp @@ -352,10 +222,10 @@ index 0cc2127c9c12c2d82dea9550bad73f4ffb99ba24..8ca65cc042d435cbc0e05dcc5c5dfc95 } diff --git a/Source/JavaScriptCore/inspector/InspectorTarget.h b/Source/JavaScriptCore/inspector/InspectorTarget.h -index 4b95964db4d902b4b7f4b0b4c40afea51654ff2f..653842a82ed7a7be8603c9ef88ff48d1cda421be 100644 +index 80559d39722b74e325d513ea22054b0d399a4e8f..24977f9dfcfcdb29a20d178be608aca855cca532 100644 --- a/Source/JavaScriptCore/inspector/InspectorTarget.h +++ b/Source/JavaScriptCore/inspector/InspectorTarget.h -@@ -56,8 +56,12 @@ public: +@@ -57,8 +57,12 @@ public: virtual void connect(FrontendChannel::ConnectionType) = 0; virtual void disconnect() = 0; virtual void sendMessageToTargetBackend(const String&) = 0; @@ -400,94 +270,44 @@ index 6e573c4dfd1f356b76ef9b46dcee4254e9a28f27..8855604064f5130211baab6caa89318c 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 aef96857b46e980a12f2c0a4d38d6035c024ac99..2eb163fe20cbbd975c7f49d9835485152057993d 100644 +index 4c0b84a3ce88997372b05e54761fbd1d16350c84..5a8da96c4772f998efb188043484c6ba26f73cf0 100644 --- a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp +++ b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp -@@ -177,41 +177,43 @@ void InspectorRuntimeAgent::awaitPromise(const Protocol::Runtime::RemoteObjectId - }); - } - --Protocol::ErrorStringOr, std::optional /* wasThrown */>> InspectorRuntimeAgent::callFunctionOn(const Protocol::Runtime::RemoteObjectId& objectId, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture) -+void InspectorRuntimeAgent::callFunctionOn(const Protocol::Runtime::RemoteObjectId& objectId, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture, std::optional&& awaitPromise, Ref&& callback) - { - InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); -- if (injectedScript.hasNoValue()) -- return makeUnexpected("Missing injected script for given objectId"_s); -+ if (injectedScript.hasNoValue()) { -+ callback->sendFailure("Missing injected script for given objectId"_s); -+ return; -+ } - -- return callFunctionOn(injectedScript, objectId, functionDeclaration, WTFMove(arguments), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(emulateUserGesture)); -+ callFunctionOn(injectedScript, objectId, functionDeclaration, WTFMove(arguments), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(emulateUserGesture), WTFMove(awaitPromise), WTFMove(callback)); - } - --Protocol::ErrorStringOr, std::optional /* wasThrown */>> InspectorRuntimeAgent::callFunctionOn(InjectedScript& injectedScript, const Protocol::Runtime::RemoteObjectId& objectId, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& /* emulateUserGesture */) -+void InspectorRuntimeAgent::callFunctionOn(InjectedScript& injectedScript, const Protocol::Runtime::RemoteObjectId& objectId, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& /* emulateUserGesture */, std::optional&& awaitPromise, Ref&& callback) +@@ -191,9 +191,8 @@ void InspectorRuntimeAgent::callFunctionOn(const Protocol::Runtime::RemoteObject + void InspectorRuntimeAgent::callFunctionOn(InjectedScript& injectedScript, const Protocol::Runtime::RemoteObjectId& objectId, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& /* emulateUserGesture */, std::optional&& awaitPromise, Ref&& callback) { ASSERT(!injectedScript.hasNoValue()); - -- Protocol::ErrorString errorString; -- -- RefPtr result; -- std::optional wasThrown; -- -+ JSC::Debugger::TemporarilyDisableExceptionBreakpoints temporarilyDisableExceptionBreakpoints(m_debugger); - + bool pauseAndMute = doNotPauseOnExceptionsAndMuteConsole.value_or(false); if (pauseAndMute) { temporarilyDisableExceptionBreakpoints.replace(); - muteConsole(); - } -- -- injectedScript.callFunctionOn(errorString, objectId, functionDeclaration, arguments ? arguments->toJSONString() : nullString(), returnByValue.value_or(false), generatePreview.value_or(false), result, wasThrown); -+ -+ injectedScript.callFunctionOn(objectId, functionDeclaration, arguments ? arguments->toJSONString() : nullString(), returnByValue.value_or(false), generatePreview.value_or(false), awaitPromise.value_or(false), [callback=WTFMove(callback)] (Protocol::ErrorString& errorString, RefPtr&& result, std::optional&& wasThrown, std::optional&&) { -+ if (!result) -+ callback->sendFailure(errorString); -+ else -+ callback->sendSuccess(result.releaseNonNull(), WTFMove(wasThrown)); -+ }); - - if (pauseAndMute) +@@ -212,6 +211,11 @@ void InspectorRuntimeAgent::callFunctionOn(InjectedScript& injectedScript, const unmuteConsole(); -+} + } -- if (!result) -- return makeUnexpected(errorString); -- -- return { { result.releaseNonNull(), WTFMove(wasThrown) } }; +Protocol::ErrorStringOr InspectorRuntimeAgent::addBinding(const String&) +{ + return makeUnexpected("Not implemented in this type of agent."_s); - } - ++} ++ Protocol::ErrorStringOr> InspectorRuntimeAgent::getPreview(const Protocol::Runtime::RemoteObjectId& objectId) + { + Protocol::ErrorString errorString; diff --git a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h -index 1db64831b835df816130be4e7d42b7b213625656..11e6a6a9b027f2e4ea904e796019ee2a698509cf 100644 +index 5c3488200ab2df6dfc914ff780f05eba7ffd92a2..11e6a6a9b027f2e4ea904e796019ee2a698509cf 100644 --- a/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h +++ b/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h -@@ -62,7 +62,8 @@ public: - Protocol::ErrorStringOr>> parse(const String& expression) final; +@@ -63,6 +63,7 @@ public: Protocol::ErrorStringOr, std::optional /* wasThrown */, std::optional /* savedResultIndex */>> evaluate(const String& expression, const String& objectGroup, std::optional&& includeCommandLineAPI, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&&, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& saveResult, std::optional&& emulateUserGesture) override; void awaitPromise(const Protocol::Runtime::RemoteObjectId&, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& saveResult, Ref&&) final; -- Protocol::ErrorStringOr, std::optional /* wasThrown */>> callFunctionOn(const Protocol::Runtime::RemoteObjectId&, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture) override; -+ void callFunctionOn(const Protocol::Runtime::RemoteObjectId&, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture, std::optional&& awaitPromise, Ref&&) override; + void callFunctionOn(const Protocol::Runtime::RemoteObjectId&, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture, std::optional&& awaitPromise, Ref&&) override; + Protocol::ErrorStringOr addBinding(const String& name) override; Protocol::ErrorStringOr releaseObject(const Protocol::Runtime::RemoteObjectId&) final; 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; -@@ -82,7 +83,7 @@ protected: - InspectorRuntimeAgent(AgentContext&); - - Protocol::ErrorStringOr, std::optional /* wasThrown */, std::optional /* savedResultIndex */>> evaluate(InjectedScript&, const String& expression, const String& objectGroup, std::optional&& includeCommandLineAPI, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& saveResult, std::optional&& emulateUserGesture); -- Protocol::ErrorStringOr, std::optional /* wasThrown */>> callFunctionOn(InjectedScript&, const Protocol::Runtime::RemoteObjectId&, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture); -+ void callFunctionOn(InjectedScript&, const Protocol::Runtime::RemoteObjectId&, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture, std::optional&& awaitPromise, Ref&&); - - InjectedScriptManager& injectedScriptManager() { return m_injectedScriptManager; } - diff --git a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp index 508eb02ec95c52408384a1e2b77648afd426dd9d..93d6757e170272cda8c346bf51578d2b5f8aafaa 100644 --- a/Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp @@ -1016,7 +836,7 @@ index 96af27ece2ac200e11c4311b3ca0d9d3b5a048da..3168f7806fcbdabec07acc5e304bae1e ], "events": [ diff --git a/Source/JavaScriptCore/inspector/protocol/Page.json b/Source/JavaScriptCore/inspector/protocol/Page.json -index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a936c10a8b 100644 +index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..7e6c8b8954ed3d5d4ac77dfe51d0e08c56a7a5fc 100644 --- a/Source/JavaScriptCore/inspector/protocol/Page.json +++ b/Source/JavaScriptCore/inspector/protocol/Page.json @@ -20,7 +20,14 @@ @@ -1048,7 +868,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 { "id": "Frame", "type": "object", -@@ -125,6 +138,51 @@ +@@ -125,6 +138,50 @@ { "name": "secure", "type": "boolean", "description": "True if cookie is secure." }, { "name": "sameSite", "$ref": "CookieSameSitePolicy", "description": "Cookie Same-Site policy." } ] @@ -1069,7 +889,6 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 + { "name": "expanded", "type": "boolean", "optional": true, "description": "Whether the node is expanded or collapsed."}, + { "name": "focused", "type": "boolean", "optional": true, "description": "Whether the node is focused."}, + { "name": "modal", "type": "boolean", "optional": true, "description": "Whether the node is modal."}, -+ { "name": "multiline", "type": "boolean", "optional": true, "description": "Whether the node text input supports multiline."}, + { "name": "multiselectable", "type": "boolean", "optional": true, "description": "Whether more than one child can be selected."}, + { "name": "readonly", "type": "boolean", "optional": true, "description": "Whether the node is read only."}, + { "name": "required", "type": "boolean", "optional": true, "description": "Whether the node is required."}, @@ -1100,7 +919,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 } ], "commands": [ -@@ -144,6 +202,14 @@ +@@ -144,6 +201,14 @@ { "name": "revalidateAllResources", "type": "boolean", "optional": true, "description": "If true, all cached subresources will be revalidated when the main resource loads. Otherwise, only expired cached subresources will be revalidated (the default behavior for most WebKit clients)." } ] }, @@ -1115,7 +934,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 { "name": "navigate", "description": "Navigates current page to the given URL.", -@@ -160,6 +226,14 @@ +@@ -160,6 +225,14 @@ { "name": "value", "type": "string", "optional": true, "description": "Value to override the user agent with. If this value is not provided, the override is removed. Overrides are removed when Web Inspector closes/disconnects." } ] }, @@ -1130,17 +949,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 { "name": "overrideSetting", "description": "Allows the frontend to override the inspected page's settings.", -@@ -226,7 +300,8 @@ - "name": "setBootstrapScript", - "targetTypes": ["page"], - "parameters": [ -- { "name": "source", "type": "string", "optional": true, "description": "If `source` is provided (and not empty), it will be injected into all future global objects as soon as they're created. Omitting `source` will stop this from happening." } -+ { "name": "source", "type": "string", "optional": true, "description": "If `source` is provided (and not empty), it will be injected into all future global objects as soon as they're created. Omitting `source` will stop this from happening." }, -+ { "name": "worldName", "type": "string", "optional": true, "description": "Isolated world name to evaluate the script in. If not specified main world will be used." } - ] - }, - { -@@ -283,6 +358,28 @@ +@@ -283,6 +356,28 @@ { "name": "media", "type": "string", "description": "Media type to emulate. Empty string disables the override." } ] }, @@ -1169,7 +978,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 { "name": "snapshotNode", "description": "Capture a snapshot of the specified node that does not include unrelated layers.", -@@ -303,7 +400,8 @@ +@@ -303,7 +398,8 @@ { "name": "y", "type": "integer", "description": "Y coordinate" }, { "name": "width", "type": "integer", "description": "Rectangle width" }, { "name": "height", "type": "integer", "description": "Rectangle height" }, @@ -1179,7 +988,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 ], "returns": [ { "name": "dataURL", "type": "string", "description": "Base64-encoded image data (PNG)." } -@@ -321,12 +419,92 @@ +@@ -321,12 +417,71 @@ { "name": "setScreenSizeOverride", "description": "Overrides screen size exposed to DOM and used in media queries for testing with provided values.", @@ -1198,17 +1007,6 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 + ] + }, + { -+ "name": "setComposition", -+ "description": "Set the current IME composition.", -+ "parameters": [ -+ { "name": "text", "type": "string" }, -+ { "name": "selectionStart", "type": "integer" }, -+ { "name": "selectionLength", "type": "integer" }, -+ { "name": "replacementStart", "type": "integer", "optional": true }, -+ { "name": "replacementLength", "type": "integer", "optional": true } -+ ] -+ }, -+ { + "name": "accessibilitySnapshot", + "description": "Serializes and returns all of the accessibility nodes of the page.", + "parameters": [ @@ -1258,22 +1056,12 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 + ] + }, + { -+ "name": "setVisibleContentRects", -+ "targetTypes": ["page"], -+ "parameters": [ -+ { "name": "unobscuredContentRect", "$ref": "DOM.Rect", "optional": true }, -+ { "name": "contentInsets", "$ref": "Insets", "optional": true }, -+ { "name": "obscuredInsets", "$ref": "Insets", "optional": true }, -+ { "name": "unobscuredInsets", "$ref": "Insets", "optional": true } -+ ] -+ }, -+ { + "name": "updateScrollingState", + "description": "Ensures that the scroll regions are up to date." } ], "events": [ -@@ -334,14 +512,16 @@ +@@ -334,14 +489,16 @@ "name": "domContentEventFired", "targetTypes": ["page"], "parameters": [ @@ -1292,7 +1080,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 ] }, { -@@ -351,6 +531,14 @@ +@@ -351,6 +508,14 @@ { "name": "frame", "$ref": "Frame", "description": "Frame object." } ] }, @@ -1307,7 +1095,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 { "name": "frameDetached", "description": "Fired when frame has been detached from its parent.", -@@ -379,7 +567,8 @@ +@@ -379,7 +544,8 @@ "targetTypes": ["page"], "parameters": [ { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has scheduled a navigation." }, @@ -1317,7 +1105,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 ] }, { -@@ -390,6 +579,22 @@ +@@ -390,6 +556,22 @@ { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame that has cleared its scheduled navigation." } ] }, @@ -1340,7 +1128,7 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 { "name": "defaultUserPreferencesDidChange", "description": "Fired when the default value of a user preference changes at the system level.", -@@ -397,6 +602,42 @@ +@@ -397,6 +579,42 @@ "parameters": [ { "name": "preferences", "type": "array", "items": { "$ref": "UserPreference" }, "description": "List of user preferences that can be overriden and their new system (default) values." } ] @@ -1385,10 +1173,10 @@ index b5e2bb2eb58765ec20392b36bf5ef1ac35857a69..83ac8c3cbc4a57a27e99a48323fe61a9 } diff --git a/Source/JavaScriptCore/inspector/protocol/Playwright.json b/Source/JavaScriptCore/inspector/protocol/Playwright.json new file mode 100644 -index 0000000000000000000000000000000000000000..8434303f2aad60557f049d33e50245ddebb07599 +index 0000000000000000000000000000000000000000..978d6f92b18498633c982969299f068332eb2884 --- /dev/null +++ b/Source/JavaScriptCore/inspector/protocol/Playwright.json -@@ -0,0 +1,300 @@ +@@ -0,0 +1,307 @@ +{ + "domain": "Playwright", + "availability": ["web"], @@ -1479,6 +1267,12 @@ index 0000000000000000000000000000000000000000..8434303f2aad60557f049d33e50245dd + "name": "disable" + }, + { ++ "name": "getInfo", ++ "returns": [ ++ { "name": "os", "type": "string", "description": "Name of the operating system where the browser is running (macOS, Linux or Windows)." } ++ ] ++ }, ++ { + "name": "close", + "async": true, + "description": "Close browser." @@ -1536,6 +1330,7 @@ index 0000000000000000000000000000000000000000..8434303f2aad60557f049d33e50245dd + { + "name": "takePageScreenshot", + "description": "Capture a snapshot of the page.", ++ "async": true, + "parameters": [ + { "name": "pageProxyId", "$ref": "PageProxyID", "description": "Unique identifier of the page proxy." }, + { "name": "x", "type": "integer", "description": "X coordinate" }, @@ -1690,34 +1485,24 @@ index 0000000000000000000000000000000000000000..8434303f2aad60557f049d33e50245dd + ] +} diff --git a/Source/JavaScriptCore/inspector/protocol/Runtime.json b/Source/JavaScriptCore/inspector/protocol/Runtime.json -index dfbe4eece1af3748408b5fd968331799aa9e1d30..0e2ae5d96b3cdcc20ecc95ddc7b49538dcb3c302 100644 +index 301b88eb1607b0975c3fa81d91045eb5403378ec..0e2ae5d96b3cdcc20ecc95ddc7b49538dcb3c302 100644 --- a/Source/JavaScriptCore/inspector/protocol/Runtime.json +++ b/Source/JavaScriptCore/inspector/protocol/Runtime.json -@@ -263,12 +263,21 @@ - { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether function call should stop on exceptions and mute console. Overrides setPauseOnException state." }, - { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." }, - { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }, -- { "name": "emulateUserGesture", "type": "boolean", "optional": true, "description": "Whether the expression should be considered to be in a user gesture or not." } -+ { "name": "emulateUserGesture", "type": "boolean", "optional": true, "description": "Whether the expression should be considered to be in a user gesture or not." }, -+ { "name": "awaitPromise", "type": "boolean", "optional": true, "description": "Whether to automatically await returned promise." } +@@ -272,6 +272,13 @@ ], - "returns": [ - { "name": "result", "$ref": "RemoteObject", "description": "Call result." }, - { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } -- ] -+ ], -+ "async": true -+ }, + "async": true + }, + { + "name": "addBinding", + "description": "Adds binding with the given name on the global objects of all inspected contexts. Each binding function call produces Runtime.bindingCalled event.", + "parameters": [ + { "name": "name", "type": "string", "description": "Name of the bound function." } + ] - }, ++ }, { "name": "getPreview", -@@ -406,6 +415,15 @@ + "description": "Returns a preview for the given object.", +@@ -408,6 +415,15 @@ "parameters": [ { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution context." } ] @@ -1849,31 +1634,8 @@ index 52920cded24a9c6b0ef6fb4e518664955db4f9fa..bbbabc4e7259088b9404e8cc07eecd6f ] }, { -diff --git a/Source/JavaScriptCore/inspector/protocol/Worker.json b/Source/JavaScriptCore/inspector/protocol/Worker.json -index 638612413466efc87b737e8a81042ed07ca12703..6f9e518ff0bfa2a6228675d25b6b785f1ed3022a 100644 ---- a/Source/JavaScriptCore/inspector/protocol/Worker.json -+++ b/Source/JavaScriptCore/inspector/protocol/Worker.json -@@ -16,7 +16,7 @@ - "description": "Sent after the frontend has sent all initialization messages and can resume this worker. This command is required to allow execution in the worker.", - "parameters": [ - { "name": "workerId", "type": "string" } -- ] -+ ] - }, - { - "name": "sendMessageToWorker", -@@ -33,7 +33,8 @@ - "parameters": [ - { "name": "workerId", "type": "string" }, - { "name": "url", "type": "string" }, -- { "name": "name", "type": "string" } -+ { "name": "name", "type": "string" }, -+ { "name": "frameId", "$ref": "Network.FrameId", "description": "Id of the frame this worker belongs to." } - ] - }, - { diff --git a/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp b/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp -index 4fccf72d231285ff2c3f250990b86506303c9ec8..8472ba00fcada5c80fa0356c15b6683c4c6ceb5d 100644 +index e91e5ed0b72d5a3a4c8455ce1da31647f63b2011..7ebd9a28c78ad4c2296ed3c603ff81723719fdbd 100644 --- a/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp +++ b/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp @@ -28,7 +28,6 @@ @@ -1897,7 +1659,7 @@ index 72c81757450ad5ebacd5fd20d2a16095514802ec..b7d8ab1e04d3850180079870468b28ef private: enum ArgumentRequirement { ArgumentRequired, ArgumentNotRequired }; diff --git a/Source/ThirdParty/libwebrtc/CMakeLists.txt b/Source/ThirdParty/libwebrtc/CMakeLists.txt -index 133380fe13fcd59d324d5b1c53bfebf855a04750..5f3fad8408d75dc1b5fb6725569badca6617cf49 100644 +index 0c300bedc697024ca511e43d480f3b7205df3ed6..e54875b46c558903a6b6157833b82ec8ce0ac1f1 100644 --- a/Source/ThirdParty/libwebrtc/CMakeLists.txt +++ b/Source/ThirdParty/libwebrtc/CMakeLists.txt @@ -529,6 +529,11 @@ set(webrtc_SOURCES @@ -1912,7 +1674,7 @@ index 133380fe13fcd59d324d5b1c53bfebf855a04750..5f3fad8408d75dc1b5fb6725569badca Source/third_party/libyuv/source/compare.cc Source/third_party/libyuv/source/compare_common.cc Source/third_party/libyuv/source/compare_gcc.cc -@@ -2124,6 +2129,10 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE +@@ -2126,6 +2131,10 @@ set(webrtc_INCLUDE_DIRECTORIES PRIVATE Source/third_party/libsrtp/config Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include @@ -1923,11 +1685,24 @@ index 133380fe13fcd59d324d5b1c53bfebf855a04750..5f3fad8408d75dc1b5fb6725569badca Source/third_party/libyuv/include Source/third_party/opus/src/celt Source/third_party/opus/src/include +diff --git a/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig b/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig +index 8f79bffda497f6144e9e82c23397a182a6745cf3..d22f4fd1b54d535288994c44a5bd61405a1791cb 100644 +--- a/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig ++++ b/Source/ThirdParty/libwebrtc/Configurations/Base-libwebrtc.xcconfig +@@ -21,7 +21,7 @@ + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-HEADER_SEARCH_PATHS = Source Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/webrtc/sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/webrtc/modules/audio_device/ios Source/webrtc Source/webrtc/sdk/objc Source/webrtc/sdk/objc/base Source/webrtc/sdk/objc/Framework/Classes Source/third_party/libsrtp/config Source/webrtc/sdk/objc/Framework/Classes/Common Source/webrtc/sdk/objc/Framework/Classes/Video Source/webrtc/sdk/objc/Framework/Classes/PeerConnection Source/third_party/abseil-cpp Source/third_party/libvpx/source/libvpx Source/third_party/libwebm/webm_parser/include Source/third_party/crc32c/config Source/third_party/crc32c/include Source/third_party/crc32c/src/include Source/third_party/libaom/source/libaom; ++HEADER_SEARCH_PATHS = Source Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/webrtc/sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/webrtc/modules/audio_device/ios Source/webrtc Source/webrtc/sdk/objc Source/webrtc/sdk/objc/base Source/webrtc/sdk/objc/Framework/Classes Source/third_party/libsrtp/config Source/webrtc/sdk/objc/Framework/Classes/Common Source/webrtc/sdk/objc/Framework/Classes/Video Source/webrtc/sdk/objc/Framework/Classes/PeerConnection Source/third_party/abseil-cpp Source/third_party/libvpx/source/libvpx Source/third_party/libwebm/webm_parser/include Source/third_party/crc32c/config Source/third_party/crc32c/include Source/third_party/crc32c/src/include Source/third_party/libaom/source/libaom Source/third_party/libwebm/mkvmuxer Source/third_party/libvpx/source/libvpx/third_party/libwebm; + USE_HEADERMAP = NO; + + WARNING_CFLAGS = -Wno-deprecated-declarations $(inherited); diff --git a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp -index c3ba9e19caff72011010471c8c46c91b53a22498..d47a93e1f7fe9f4d52376dcc4dcc924231fdd108 100644 +index eed4780db5dd82c4946ef9662f91ec259150b598..1cdfac1540b8dc06a5ad0dbc40b63087520c6f70 100644 --- a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp +++ b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp -@@ -389,3 +389,24 @@ __ZN3rtc7NetworkC1ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_RKNS_9I +@@ -386,3 +386,24 @@ __ZN3rtc7NetworkC1ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_RKNS_9I __ZN6webrtc18callback_list_impl21CallbackListReceiversC1Ev __ZNK6webrtc32webrtc_sequence_checker_internal19SequenceCheckerImpl19ExpectationToStringEv __ZN3rtc16InterfaceAddressaSERKS0_ @@ -1952,19 +1727,6 @@ index c3ba9e19caff72011010471c8c46c91b53a22498..d47a93e1f7fe9f4d52376dcc4dcc9242 +_vpx_codec_iface_name +_vpx_codec_version_str +_vpx_codec_vp8_cx -diff --git a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig -index 39ddbe721ba57835c45a4e590726c7a7c99022c4..4020e136c002c0b768f266d87f656585e748d498 100644 ---- a/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig -+++ b/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig -@@ -37,7 +37,7 @@ DYLIB_INSTALL_NAME_BASE_WK_RELOCATABLE_FRAMEWORKS_ = $(NORMAL_UMBRELLA_FRAMEWORK - DYLIB_INSTALL_NAME_BASE_WK_RELOCATABLE_FRAMEWORKS_YES = @loader_path/../../../; - - GCC_WARN_64_TO_32_BIT_CONVERSION = NO; --HEADER_SEARCH_PATHS = Source Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/webrtc/sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/webrtc/modules/audio_device/ios Source/webrtc Source/webrtc/sdk/objc Source/webrtc/sdk/objc/base Source/webrtc/sdk/objc/Framework/Classes Source/third_party/libsrtp/config Source/webrtc/sdk/objc/Framework/Classes/Common Source/webrtc/sdk/objc/Framework/Classes/Video Source/webrtc/sdk/objc/Framework/Classes/PeerConnection Source/third_party/abseil-cpp Source/third_party/libvpx/source/libvpx Source/third_party/libwebm/webm_parser/include Source/third_party/crc32c/config Source/third_party/crc32c/include Source/third_party/crc32c/src/include Source/third_party/libaom/source/libaom; -+HEADER_SEARCH_PATHS = Source Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/webrtc/sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/webrtc/modules/audio_device/ios Source/webrtc Source/webrtc/sdk/objc Source/webrtc/sdk/objc/base Source/webrtc/sdk/objc/Framework/Classes Source/third_party/libsrtp/config Source/webrtc/sdk/objc/Framework/Classes/Common Source/webrtc/sdk/objc/Framework/Classes/Video Source/webrtc/sdk/objc/Framework/Classes/PeerConnection Source/third_party/abseil-cpp Source/third_party/libvpx/source/libvpx Source/third_party/libwebm/webm_parser/include Source/third_party/crc32c/config Source/third_party/crc32c/include Source/third_party/crc32c/src/include Source/third_party/libaom/source/libaom Source/third_party/libwebm/mkvmuxer Source/third_party/libvpx/source/libvpx/third_party/libwebm; - - PUBLIC_HEADERS_FOLDER_PREFIX = $(WK_LIBRARY_HEADERS_FOLDER_PATH); - INSTALL_PUBLIC_HEADER_PREFIX = $(INSTALL_PATH_PREFIX)$(PUBLIC_HEADERS_FOLDER_PREFIX); diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/modules/rtp_rtcp/source/rtcp_transceiver_impl.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/modules/rtp_rtcp/source/rtcp_transceiver_impl.cc index bcd9e02bc019e17799fe812d7d9a4c7c316b3456..909bbac68574129ea60af831f30de59edf3c28b8 100644 --- a/Source/ThirdParty/libwebrtc/Source/webrtc/modules/rtp_rtcp/source/rtcp_transceiver_impl.cc @@ -1987,12 +1749,12 @@ index bcd9e02bc019e17799fe812d7d9a4c7c316b3456..909bbac68574129ea60af831f30de59e rtt = CompactNtpRttToTimeDelta( receive_time_ntp - block.delay_since_last_sr() - block.last_sr()); diff --git a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj -index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350ae90615de 100644 +index e05e49446506e8e7adff5854798471b6c9a72a76..b61126bd44324aecd9295affe1d02b9b08fafe98 100644 --- a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj +++ b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj -@@ -6,6 +6,20 @@ - objectVersion = 54; - objects = { +@@ -28,6 +28,20 @@ + }; + /* End PBXAggregateTarget section */ +/* Begin PBXAggregateTarget section */ + F31720AC27FE215900EEE407 /* Copy libvpx headers */ = { @@ -2011,7 +1773,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a /* 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, ); }; }; -@@ -4947,6 +4961,9 @@ +@@ -5028,6 +5042,9 @@ DDF30D9127C5C725006A526F /* receive_side_congestion_controller.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF30D9027C5C725006A526F /* receive_side_congestion_controller.h */; }; DDF30D9527C5C756006A526F /* bwe_defines.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF30D9327C5C756006A526F /* bwe_defines.h */; }; DDF30D9627C5C756006A526F /* remote_bitrate_estimator.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF30D9427C5C756006A526F /* remote_bitrate_estimator.h */; }; @@ -2021,7 +1783,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a /* End PBXBuildFile section */ /* Begin PBXBuildRule section */ -@@ -5211,6 +5228,13 @@ +@@ -5418,6 +5435,13 @@ remoteGlobalIDString = DDF30D0527C5C003006A526F; remoteInfo = absl; }; @@ -2035,7 +1797,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ -@@ -10562,6 +10586,9 @@ +@@ -10837,6 +10861,9 @@ DDF30D9027C5C725006A526F /* receive_side_congestion_controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = receive_side_congestion_controller.h; sourceTree = ""; }; DDF30D9327C5C756006A526F /* bwe_defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bwe_defines.h; sourceTree = ""; }; DDF30D9427C5C756006A526F /* remote_bitrate_estimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = remote_bitrate_estimator.h; sourceTree = ""; }; @@ -2045,7 +1807,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a FB39D0D11200F0E300088E69 /* libwebrtc.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libwebrtc.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ -@@ -18854,6 +18881,7 @@ +@@ -19415,6 +19442,7 @@ isa = PBXGroup; children = ( CDFD2F9224C4B2F90048DAC3 /* common */, @@ -2053,7 +1815,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a CDEBB19224C0191800ADBD44 /* webm_parser */, ); path = libwebm; -@@ -19295,6 +19323,16 @@ +@@ -19849,6 +19877,16 @@ path = include; sourceTree = ""; }; @@ -2070,7 +1832,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a FB39D06E1200ED9200088E69 = { isa = PBXGroup; children = ( -@@ -22185,6 +22223,7 @@ +@@ -22941,6 +22979,7 @@ ); dependencies = ( 410B3827292B73E90003E515 /* PBXTargetDependency */, @@ -2078,15 +1840,15 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a DD2E76E827C6B69A00F2A74C /* PBXTargetDependency */, CDEBB4CC24C01AB400ADBD44 /* PBXTargetDependency */, 411ED040212E0811004320BA /* PBXTargetDependency */, -@@ -22244,6 +22283,7 @@ - CDEBB11824C0187400ADBD44 /* webm */, - DDEBB11824C0187400ADBD44 /* aom */, - DDF30D0527C5C003006A526F /* absl */, +@@ -23016,6 +23055,7 @@ + 446359B62AEA108C00551EEE /* vp8_replay_fuzzer */, + 44C20E892AB39FA80046C6A8 /* vp9_dec_fuzzer */, + 444A6EF02AEADFC9005FE121 /* vp9_replay_fuzzer */, + F31720AC27FE215900EEE407 /* Copy libvpx headers */, ); }; /* End PBXProject section */ -@@ -22326,6 +22366,23 @@ +@@ -23098,6 +23138,23 @@ shellPath = /bin/sh; shellScript = "\"${SRCROOT}/Scripts/create-symlink-to-altroot.sh\"\n"; }; @@ -2110,7 +1872,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ -@@ -24077,6 +24134,9 @@ +@@ -24956,6 +25013,9 @@ 5CDD865E1E43B8B500621E92 /* min_max_operations.c in Sources */, 4189395B242A71F5007FDC41 /* min_video_bitrate_experiment.cc in Sources */, 41B8D8FB28CB85CB00E5FA37 /* missing_mandatory_parameter_cause.cc in Sources */, @@ -2120,7 +1882,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a 4131C387234B957D0028A615 /* moving_average.cc in Sources */, 41FCBB1521B1F7AA00A5DF27 /* moving_average.cc in Sources */, 5CD286101E6A64C90094FDC8 /* moving_max.cc in Sources */, -@@ -24786,6 +24846,11 @@ +@@ -25755,6 +25815,11 @@ target = DDF30D0527C5C003006A526F /* absl */; targetProxy = DD2E76E727C6B69A00F2A74C /* PBXContainerItemProxy */; }; @@ -2132,7 +1894,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ -@@ -25013,6 +25078,27 @@ +@@ -26204,6 +26269,27 @@ }; name = Production; }; @@ -2160,7 +1922,7 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a FB39D0711200ED9200088E69 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D7C59C71208C68B001C873E /* DebugRelease.xcconfig */; -@@ -25145,6 +25231,16 @@ +@@ -26436,6 +26522,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; @@ -2178,18 +1940,18 @@ index 6550be991328f094d74b7c5aa709fe8c5d399f54..5810c4fd8a1257aaad612f67ab5a350a isa = XCConfigurationList; buildConfigurations = ( diff --git a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc596a64a950 100644 +index bd465484eab340e7b8ef01030fdc245cae2f48b6..950a84ad3a0ad06bb4206f9e9a73f7c69224c99c 100644 --- a/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml +++ b/Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml -@@ -590,6 +590,7 @@ AspectRatioOfImgFromWidthAndHeightEnabled: - default: true +@@ -553,6 +553,7 @@ AriaTextRoleEnabled: + default: false # FIXME: This is on by default in WebKit2 PLATFORM(COCOA). Perhaps we should consider turning it on for WebKitLegacy as well. +# Playwright: enable on all platforms to align with Safari. AsyncClipboardAPIEnabled: type: bool status: mature -@@ -600,7 +601,7 @@ AsyncClipboardAPIEnabled: +@@ -563,7 +564,7 @@ AsyncClipboardAPIEnabled: default: false WebKit: "PLATFORM(COCOA) || PLATFORM(GTK)" : true @@ -2198,15 +1960,19 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 WebCore: default: false -@@ -1863,6 +1864,7 @@ CrossOriginEmbedderPolicyEnabled: +@@ -1887,9 +1888,10 @@ CrossOriginEmbedderPolicyEnabled: WebCore: default: false +# Playwright: disable setting. CrossOriginOpenerPolicyEnabled: type: bool - status: stable -@@ -1873,7 +1875,7 @@ CrossOriginOpenerPolicyEnabled: +- status: stable ++ status: preview + category: security + humanReadableName: "Cross-Origin-Opener-Policy (COOP) header" + humanReadableDescription: "Support for Cross-Origin-Opener-Policy (COOP) header" +@@ -1897,7 +1899,7 @@ CrossOriginOpenerPolicyEnabled: WebKitLegacy: default: false WebKit: @@ -2215,7 +1981,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 WebCore: default: false -@@ -1903,7 +1905,7 @@ CustomPasteboardDataEnabled: +@@ -1927,7 +1929,7 @@ CustomPasteboardDataEnabled: WebKitLegacy: default: false WebKit: @@ -2224,7 +1990,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 default: false DNSPrefetchingEnabled: -@@ -1948,6 +1950,7 @@ DOMAudioSessionFullEnabled: +@@ -1972,6 +1974,7 @@ DOMAudioSessionFullEnabled: WebCore: default: false @@ -2232,7 +1998,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 DOMPasteAccessRequestsEnabled: type: bool status: internal -@@ -1959,7 +1962,7 @@ DOMPasteAccessRequestsEnabled: +@@ -1983,7 +1986,7 @@ DOMPasteAccessRequestsEnabled: default: false WebKit: "PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(VISION)": true @@ -2241,7 +2007,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 WebCore: default: false -@@ -3380,6 +3383,7 @@ InspectorAttachmentSide: +@@ -3339,6 +3342,7 @@ InspectorAttachmentSide: WebKit: default: 0 @@ -2249,7 +2015,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 InspectorStartsAttached: type: bool status: embedder -@@ -3387,7 +3391,7 @@ InspectorStartsAttached: +@@ -3346,7 +3350,7 @@ InspectorStartsAttached: exposed: [ WebKit ] defaultValue: WebKit: @@ -2258,15 +2024,19 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 InspectorWindowFrame: type: String -@@ -3755,6 +3759,7 @@ LayoutViewportHeightExpansionFactor: +@@ -3701,9 +3705,10 @@ LayoutViewportHeightExpansionFactor: WebCore: default: 0 +# Playwright: disable setting. LazyIframeLoadingEnabled: type: bool - status: stable -@@ -3765,9 +3770,9 @@ LazyIframeLoadingEnabled: +- status: stable ++ status: preview + category: html + humanReadableName: "Lazy iframe loading" + humanReadableDescription: "Enable lazy iframe loading support" +@@ -3711,9 +3716,9 @@ LazyIframeLoadingEnabled: WebKitLegacy: default: true WebKit: @@ -2278,7 +2048,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 LazyImageLoadingEnabled: type: bool -@@ -5113,6 +5118,19 @@ PluginsEnabled: +@@ -5049,6 +5054,19 @@ PluginsEnabled: WebCore: default: false @@ -2298,7 +2068,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 PopoverAttributeEnabled: type: bool status: stable -@@ -6796,6 +6814,7 @@ UseCGDisplayListsForDOMRendering: +@@ -6715,6 +6733,7 @@ UseCGDisplayListsForDOMRendering: WebKit: default: true @@ -2306,7 +2076,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 UseGPUProcessForCanvasRenderingEnabled: type: bool status: stable -@@ -6808,7 +6827,7 @@ UseGPUProcessForCanvasRenderingEnabled: +@@ -6727,7 +6746,7 @@ UseGPUProcessForCanvasRenderingEnabled: defaultValue: WebKit: "ENABLE(GPU_PROCESS_BY_DEFAULT)": true @@ -2315,7 +2085,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 default: false UseGPUProcessForDOMRenderingEnabled: -@@ -6850,6 +6869,7 @@ UseGPUProcessForMediaEnabled: +@@ -6769,6 +6788,7 @@ UseGPUProcessForMediaEnabled: "ENABLE(GPU_PROCESS_BY_DEFAULT)": true default: false @@ -2323,7 +2093,7 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 UseGPUProcessForWebGLEnabled: type: bool status: internal -@@ -6861,7 +6881,7 @@ UseGPUProcessForWebGLEnabled: +@@ -6780,7 +6800,7 @@ UseGPUProcessForWebGLEnabled: default: false WebKit: "ENABLE(GPU_PROCESS_BY_DEFAULT) && ENABLE(GPU_PROCESS_WEBGL_BY_DEFAULT)": true @@ -2333,10 +2103,10 @@ index b9d4024573d25cdd97c8e45e1cf7629cb3a643c7..706e0334ffd49735aa5473777228bc59 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 eea248ca9ab06ddbc55a1ed17bdd334e2ea848ec..f0686b9c4f0a489d78e63c35a612379cdfb01f8a 100644 +index 672f34c1d4a9b6af9453a91427c6a5fd311e3c8a..4861aeb7e723dbd2cfcbb2c55625fe61762d8dd9 100644 --- a/Source/WTF/wtf/PlatformEnable.h +++ b/Source/WTF/wtf/PlatformEnable.h -@@ -408,7 +408,7 @@ +@@ -459,7 +459,7 @@ // ORIENTATION_EVENTS should never get enabled on Desktop, only Mobile. #if !defined(ENABLE_ORIENTATION_EVENTS) @@ -2344,8 +2114,8 @@ index eea248ca9ab06ddbc55a1ed17bdd334e2ea848ec..f0686b9c4f0a489d78e63c35a612379c +#define ENABLE_ORIENTATION_EVENTS 1 #endif - #if OS(WINDOWS) -@@ -473,7 +473,7 @@ + #if !defined(ENABLE_OVERFLOW_SCROLLING_TOUCH) +@@ -576,7 +576,7 @@ #endif #if !defined(ENABLE_TOUCH_EVENTS) @@ -2355,10 +2125,10 @@ index eea248ca9ab06ddbc55a1ed17bdd334e2ea848ec..f0686b9c4f0a489d78e63c35a612379c #if !defined(ENABLE_TOUCH_ACTION_REGIONS) diff --git a/Source/WTF/wtf/PlatformHave.h b/Source/WTF/wtf/PlatformHave.h -index e14052bc7205ea751e71044e0237c7fb44e92d05..ae8d883861e823aef73181f642e0eb0702c65702 100644 +index e30d25bd8505fcf6ba86dbb3e87761286a068e51..ccd89e82ccd96f386fd03140e441731a18c8dbc8 100644 --- a/Source/WTF/wtf/PlatformHave.h +++ b/Source/WTF/wtf/PlatformHave.h -@@ -411,7 +411,7 @@ +@@ -415,7 +415,7 @@ #define HAVE_FOUNDATION_WITH_SAME_SITE_COOKIE_SUPPORT 1 #endif @@ -2367,7 +2137,7 @@ index e14052bc7205ea751e71044e0237c7fb44e92d05..ae8d883861e823aef73181f642e0eb07 #define HAVE_OS_DARK_MODE_SUPPORT 1 #endif -@@ -1238,7 +1238,8 @@ +@@ -1257,7 +1257,8 @@ #endif #if PLATFORM(MAC) @@ -2378,10 +2148,10 @@ index e14052bc7205ea751e71044e0237c7fb44e92d05..ae8d883861e823aef73181f642e0eb07 #if !defined(HAVE_LOCKDOWN_MODE_PDF_ADDITIONS) && \ diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make -index 8e7c95a1f4884ba9a13275df672c98dfc233705a..6bfa17b518b342e637a3569b20f01636ee7e18f3 100644 +index 043742495941e4cc10c811bbaa225357a9aaa9ea..7b30d5e2539c05408873ae700aa2df4fb59c196e 100644 --- a/Source/WebCore/DerivedSources.make +++ b/Source/WebCore/DerivedSources.make -@@ -1104,6 +1104,10 @@ JS_BINDING_IDLS := \ +@@ -1130,6 +1130,10 @@ JS_BINDING_IDLS := \ $(WebCore)/dom/Slotable.idl \ $(WebCore)/dom/StaticRange.idl \ $(WebCore)/dom/StringCallback.idl \ @@ -2392,7 +2162,7 @@ index 8e7c95a1f4884ba9a13275df672c98dfc233705a..6bfa17b518b342e637a3569b20f01636 $(WebCore)/dom/Text.idl \ $(WebCore)/dom/TextDecoder.idl \ $(WebCore)/dom/TextDecoderStream.idl \ -@@ -1677,9 +1681,6 @@ ADDITIONAL_BINDING_IDLS = \ +@@ -1710,9 +1714,6 @@ ADDITIONAL_BINDING_IDLS = \ GestureEvent.idl \ Internals+Additions.idl \ InternalsAdditions.idl \ @@ -2418,7 +2188,7 @@ index 9dfd25d4160011d576e9c636e4c805bfd486fd26..573edcb686440ea8426e3a59540250a5 } diff --git a/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm b/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm -index 316aa5b17c5346b2d3e420e7262e7e76e254f427..c2beed6bd1e83257095252146ee3506ce5c92b07 100644 +index 506ebb25fa290f27a75674a6fe5506fc311910d6..07d34c567b42aca08b188243c3f036f64a8da0c4 100644 --- a/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm +++ b/Source/WebCore/Modules/speech/cocoa/WebSpeechRecognizerTask.mm @@ -195,6 +195,7 @@ - (void)sendEndIfNeeded @@ -2466,10 +2236,10 @@ index 99db9b2a0693bddab0b783b47746460cd0b7ffd9..74cbf2811a6f8dbcf631c8a218ad4a13 set(CSS_VALUE_PLATFORM_DEFINES "HAVE_OS_DARK_MODE_SUPPORT=1") diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt -index 09bbf7edb87d2423485238eb265bb73076848e4f..3c0ff4658e612b4fca148937ff07d6337451f33b 100644 +index 2b1def2b2a7bc1083fd2611eb6fc180f39dcca0a..1724fc2550d0ce4690ceb7674f92999f1d9ff007 100644 --- a/Source/WebCore/SourcesCocoa.txt +++ b/Source/WebCore/SourcesCocoa.txt -@@ -688,3 +688,9 @@ platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify +@@ -700,3 +700,9 @@ platform/graphics/angle/GraphicsContextGLANGLE.cpp @no-unify platform/graphics/cocoa/ANGLEUtilitiesCocoa.cpp @no-unify platform/graphics/cocoa/GraphicsContextGLCocoa.mm @no-unify platform/graphics/cv/GraphicsContextGLCVCocoa.cpp @no-unify @@ -2480,10 +2250,10 @@ index 09bbf7edb87d2423485238eb265bb73076848e4f..3c0ff4658e612b4fca148937ff07d633 +JSTouchList.cpp +// Playwright end diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt -index e00e78af085a767842d2b08ca40e71fad7741569..1d7b32818538e08dd308a2b3f4967256a88cc9a2 100644 +index 4f3db3c7900ed6873487be379cb9cde693d536e1..9cb0f67b8bd5b5d98bbb595dcf60b950fe140be9 100644 --- a/Source/WebCore/SourcesGTK.txt +++ b/Source/WebCore/SourcesGTK.txt -@@ -124,3 +124,10 @@ platform/text/hyphen/HyphenationLibHyphen.cpp +@@ -122,3 +122,10 @@ platform/text/hyphen/HyphenationLibHyphen.cpp platform/unix/LoggingUnix.cpp platform/xdg/MIMETypeRegistryXdg.cpp @@ -2495,7 +2265,7 @@ index e00e78af085a767842d2b08ca40e71fad7741569..1d7b32818538e08dd308a2b3f4967256 +JSSpeechSynthesisEventInit.cpp +// Playwright: end. diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt -index b22d8835c52f1f5584c96d68c70cd62164ee39d4..adcf594fc399b93772c1c962b283bef16d253186 100644 +index 06c923a3227befac7680faf2cdb44abd657d6e5f..adcf594fc399b93772c1c962b283bef16d253186 100644 --- a/Source/WebCore/SourcesWPE.txt +++ b/Source/WebCore/SourcesWPE.txt @@ -45,6 +45,8 @@ editing/libwpe/EditorLibWPE.cpp @@ -2507,17 +2277,6 @@ index b22d8835c52f1f5584c96d68c70cd62164ee39d4..adcf594fc399b93772c1c962b283bef1 page/linux/ResourceUsageOverlayLinux.cpp page/linux/ResourceUsageThreadLinux.cpp -@@ -70,8 +72,8 @@ platform/graphics/angle/PlatformDisplayANGLE.cpp @no-unify - - platform/graphics/wpe/SystemFontDatabaseWPE.cpp - --platform/graphics/egl/GLContext.cpp --platform/graphics/egl/GLContextLibWPE.cpp -+platform/graphics/egl/GLContext.cpp @no-unify -+platform/graphics/egl/GLContextLibWPE.cpp @no-unify - - platform/graphics/gbm/GBMBufferSwapchain.cpp - platform/graphics/gbm/GBMDevice.cpp @@ -91,6 +93,17 @@ platform/text/LocaleICU.cpp platform/unix/LoggingUnix.cpp @@ -2537,10 +2296,10 @@ index b22d8835c52f1f5584c96d68c70cd62164ee39d4..adcf594fc399b93772c1c962b283bef1 +JSSpeechSynthesisEventInit.cpp +// Playwright: end. diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22b403b697 100644 +index 4fcc73780444062e38182cbeb43b8d41bb423b94..4034be971d8c0dd868521d38dd33ac43c9d03747 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj -@@ -6077,6 +6077,13 @@ +@@ -6144,6 +6144,13 @@ EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; }; EFCC6C8F20FE914400A2321B /* CanvasActivityRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -2554,7 +2313,7 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F12171F416A8BC63000053CA /* WebVTTElement.h */; }; F32BDCD92363AACA0073B6AE /* UserGestureEmulationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = F32BDCD72363AACA0073B6AE /* UserGestureEmulationScope.h */; }; F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; -@@ -19588,6 +19595,14 @@ +@@ -19848,6 +19855,14 @@ EDEC98020AED7E170059137F /* WebCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCorePrefix.h; sourceTree = ""; tabWidth = 4; usesTabs = 0; }; EFB7287B2124C73D005C2558 /* CanvasActivityRecord.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasActivityRecord.cpp; sourceTree = ""; }; EFCC6C8D20FE914000A2321B /* CanvasActivityRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasActivityRecord.h; sourceTree = ""; }; @@ -2569,7 +2328,7 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 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 = ""; }; -@@ -27016,6 +27031,11 @@ +@@ -27408,6 +27423,11 @@ BC4A5324256055590028C592 /* TextDirectionSubmenuInclusionBehavior.h */, 2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */, 2D4F96F21A1ECC240098BF88 /* TextIndicator.h */, @@ -2581,7 +2340,7 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 F48570A42644C76D00C05F71 /* TranslationContextMenuInfo.h */, F4E1965F21F26E4E00285078 /* UndoItem.cpp */, 2ECDBAD521D8906300F00ECD /* UndoItem.h */, -@@ -33199,6 +33219,8 @@ +@@ -33646,6 +33666,8 @@ 29E4D8DF16B0940F00C84704 /* PlatformSpeechSynthesizer.h */, 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */, 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */, @@ -2589,8 +2348,8 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 + F050E17623AD70C40011CE47 /* PlatformTouchPoint.h */, 0FD7C21D23CE41E30096D102 /* PlatformWheelEvent.cpp */, 935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */, - BCBB8AB513F1AFB000734DF0 /* PODInterval.h */, -@@ -35747,6 +35769,7 @@ + F491A66A2A9FEFA300F96146 /* PlatformWheelEvent.serialization.in */, +@@ -36243,6 +36265,7 @@ AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */, 6BDB5DC1227BD3B800919770 /* DocumentStorageAccess.cpp */, 6BDB5DC0227BD3B800919770 /* DocumentStorageAccess.h */, @@ -2598,7 +2357,7 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 7CE7FA5B1EF882300060C9D6 /* DocumentTouch.cpp */, 7CE7FA591EF882300060C9D6 /* DocumentTouch.h */, A8185F3209765765005826D9 /* DocumentType.cpp */, -@@ -40349,6 +40372,8 @@ +@@ -40909,6 +40932,8 @@ 1AD8F81B11CAB9E900E93E54 /* PlatformStrategies.h in Headers */, 0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */, 074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */, @@ -2607,7 +2366,7 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 CDD08ABD277E542600EA3755 /* PlatformTrackConfiguration.h in Headers */, CD1F9B022700323D00617EB6 /* PlatformVideoColorPrimaries.h in Headers */, CD1F9B01270020B700617EB6 /* PlatformVideoColorSpace.h in Headers */, -@@ -41583,6 +41608,7 @@ +@@ -42160,6 +42185,7 @@ 0F54DD081881D5F5003EEDBB /* Touch.h in Headers */, 71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */, 0F54DD091881D5F5003EEDBB /* TouchEvent.h in Headers */, @@ -2615,7 +2374,7 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 0F54DD0A1881D5F5003EEDBB /* TouchList.h in Headers */, 070334D71459FFD5008D8D45 /* TrackBase.h in Headers */, BE88E0C21715CE2600658D98 /* TrackListBase.h in Headers */, -@@ -42685,6 +42711,8 @@ +@@ -43275,6 +43301,8 @@ 2D22830323A8470700364B7E /* CursorMac.mm in Sources */, 5CBD59592280E926002B22AA /* CustomHeaderFields.cpp in Sources */, 07E4BDBF2A3A5FAB000D5509 /* DictationCaretAnimator.cpp in Sources */, @@ -2624,7 +2383,7 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 7CE6CBFD187F394900D46BF5 /* FormatConverter.cpp in Sources */, 4667EA3E2968D9DA00BAB1E2 /* GameControllerHapticEffect.mm in Sources */, 46FE73D32968E52000B8064C /* GameControllerHapticEngines.mm in Sources */, -@@ -42764,6 +42792,9 @@ +@@ -43358,6 +43386,9 @@ CE88EE262414467B007F29C2 /* TextAlternativeWithRange.mm in Sources */, BE39137129B267F500FA5D4F /* TextTransformCocoa.cpp in Sources */, 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */, @@ -2635,10 +2394,10 @@ index edaf3a605d842164841fd5f951b0536069e1d007..f2eb66689071b3918cc6dbb892e00f22 538EC8021F96AF81004D22A8 /* UnifiedSource1.cpp in Sources */, 538EC8051F96AF81004D22A8 /* UnifiedSource2-mm.mm in Sources */, diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp -index f42fb0d0074f63e81aebbd24f899cc71a94deb62..454de188434a84c87bdcd298b72970ef8565822c 100644 +index 92f1fc9f5f2fb42795b3e07c325711685d9587c8..bf0fb33e0002aae3c86af4228f1d386c75222384 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityObject.cpp -@@ -64,6 +64,7 @@ +@@ -65,6 +65,7 @@ #include "HTMLParserIdioms.h" #include "HTMLTextAreaElement.h" #include "HitTestResult.h" @@ -2646,7 +2405,7 @@ index f42fb0d0074f63e81aebbd24f899cc71a94deb62..454de188434a84c87bdcd298b72970ef #include "LocalFrame.h" #include "LocalizedStrings.h" #include "MathMLNames.h" -@@ -3950,9 +3951,14 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const +@@ -3989,9 +3990,14 @@ AccessibilityObjectInclusion AccessibilityObject::defaultObjectInclusion() const if (roleValue() == AccessibilityRole::ApplicationDialog) return AccessibilityObjectInclusion::IncludeObject; @@ -2664,10 +2423,10 @@ index f42fb0d0074f63e81aebbd24f899cc71a94deb62..454de188434a84c87bdcd298b72970ef { AXComputedObjectAttributeCache* attributeCache = nullptr; diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h -index 6bdd79fc280b5c58f041e4a5cc9179cb2e2788d9..db4e4a028e3631b9230d69d8c5287db1143fb013 100644 +index 5c48a13f02c1489923abf2c57e495ff22a0d56fe..4c6fbfc670c65d4aca7f7f3bf688e8dbbb1f6fd5 100644 --- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h +++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h -@@ -175,6 +175,8 @@ namespace WebCore { +@@ -177,6 +177,8 @@ namespace WebCore { macro(DecompressionStreamTransform) \ macro(DelayNode) \ macro(DeprecationReportBody) \ @@ -2677,7 +2436,7 @@ index 6bdd79fc280b5c58f041e4a5cc9179cb2e2788d9..db4e4a028e3631b9230d69d8c5287db1 macro(DynamicsCompressorNode) \ macro(ElementInternals) \ diff --git a/Source/WebCore/css/query/MediaQueryFeatures.cpp b/Source/WebCore/css/query/MediaQueryFeatures.cpp -index 2be61c75b61bc0ef524f2f32c149921dec7e8de1..86ef8f70cbe268f455353be85a0c1259b2a41301 100644 +index 98d40553e12efe44330ddc755636e535dc2e2cf7..103d80febe931e688f8c020e8a58d8aec467a66b 100644 --- a/Source/WebCore/css/query/MediaQueryFeatures.cpp +++ b/Source/WebCore/css/query/MediaQueryFeatures.cpp @@ -370,7 +370,11 @@ const FeatureSchema& forcedColors() @@ -2693,7 +2452,7 @@ index 2be61c75b61bc0ef524f2f32c149921dec7e8de1..86ef8f70cbe268f455353be85a0c1259 return MatchingIdentifiers { CSSValueNone }; } }; -@@ -553,6 +557,9 @@ const FeatureSchema& prefersReducedMotion() +@@ -549,6 +553,9 @@ const FeatureSchema& prefersReducedMotion() [](auto& context) { bool userPrefersReducedMotion = [&] { auto& frame = *context.document.frame(); @@ -2704,7 +2463,7 @@ index 2be61c75b61bc0ef524f2f32c149921dec7e8de1..86ef8f70cbe268f455353be85a0c1259 case ForcedAccessibilityValue::On: return true; diff --git a/Source/WebCore/dom/DataTransfer.cpp b/Source/WebCore/dom/DataTransfer.cpp -index b14fe9d1ba75d1f6aee2b5fbe60552e0eefd9875..5a22c89dc468511d6ab7862e9025ea16b142ed72 100644 +index f002bd12fd70e17ebc9a2136096b274ff0cf893d..11f39bacb91643c489663bf003aff52177f00020 100644 --- a/Source/WebCore/dom/DataTransfer.cpp +++ b/Source/WebCore/dom/DataTransfer.cpp @@ -510,6 +510,14 @@ Ref DataTransfer::createForDrag(const Document& document) @@ -2723,10 +2482,10 @@ index b14fe9d1ba75d1f6aee2b5fbe60552e0eefd9875..5a22c89dc468511d6ab7862e9025ea16 { 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 fb2decfc7dfc6c8a4e5a7dd79c0e23798f6d83b8..ba5f16cf2b443167b8307510f06e985698353319 100644 +index a6d2e7f3152e48028fff00c8090527ba68a9802c..2b99ebd3b1d5fd26f72edd8602e29953c2227a8d 100644 --- a/Source/WebCore/dom/DataTransfer.h +++ b/Source/WebCore/dom/DataTransfer.h -@@ -90,6 +90,9 @@ public: +@@ -91,6 +91,9 @@ public: #if ENABLE(DRAG_SUPPORT) static Ref createForDrag(const Document&); @@ -2797,20 +2556,22 @@ index f27718c1e2b8cd0a8075e556d4cdba7d9ae8fc54..2b61721594e5435845f3151e0de345e9 ] partial interface Element { undefined requestPointerLock(); diff --git a/Source/WebCore/dom/PointerEvent.cpp b/Source/WebCore/dom/PointerEvent.cpp -index 37ef194cdc90fecbf8733161ff7b538fc566dece..835e442a762d570b48037c1c9190e6d296f4b266 100644 +index 69b66eae141ec206b8c51382e709230034d3bfb7..4a2ce3dd0b527e391de06635b083b4f69dc9722f 100644 --- a/Source/WebCore/dom/PointerEvent.cpp +++ b/Source/WebCore/dom/PointerEvent.cpp -@@ -27,7 +27,9 @@ +@@ -27,9 +27,11 @@ #include "PointerEvent.h" #include "EventNames.h" +#include "MouseEvent.h" #include "Node.h" + #include "PlatformMouseEvent.h" + #include "PointerEventTypeNames.h" +#include "PlatformTouchEvent.h" #include namespace WebCore { -@@ -116,4 +118,63 @@ EventInterface PointerEvent::eventInterface() const +@@ -124,4 +126,51 @@ EventInterface PointerEvent::eventInterface() const return PointerEventInterfaceType; } @@ -2836,18 +2597,6 @@ index 37ef194cdc90fecbf8733161ff7b538fc566dece..835e442a762d570b48037c1c9190e6d2 + return nullAtom(); +} + -+static short buttonForType(const AtomString& type) -+{ -+ return type == eventNames().pointermoveEvent ? -1 : 0; -+} -+ -+static unsigned short buttonsForType(const AtomString& type) -+{ -+ // We have contact with the touch surface for most events except when we've released the touch or canceled it. -+ auto& eventNames = WebCore::eventNames(); -+ return (type == eventNames.pointerupEvent || type == eventNames.pointeroutEvent || type == eventNames.pointerleaveEvent || type == eventNames.pointercancelEvent) ? 0 : 1; -+} -+ +Ref PointerEvent::create(const PlatformTouchEvent& event, unsigned index, bool isPrimary, Ref&& view, const IntPoint& touchDelta) +{ + const auto& type = pointerEventType(event.touchPoints().at(index).state()); @@ -2875,7 +2624,7 @@ index 37ef194cdc90fecbf8733161ff7b538fc566dece..835e442a762d570b48037c1c9190e6d2 + } // namespace WebCore diff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h -index 17784dfc482c3033ea0e3ce7fdcf75b2eb4fc9d7..956c05246b5c1368e2c5257b347848d1dab4b969 100644 +index e56223a885097ff60f8db1eef5cca4aa4ad0511d..60c5ad6b8795b2985249833a8d1143ebab64b700 100644 --- a/Source/WebCore/dom/PointerEvent.h +++ b/Source/WebCore/dom/PointerEvent.h @@ -33,6 +33,8 @@ @@ -2888,7 +2637,7 @@ index 17784dfc482c3033ea0e3ce7fdcf75b2eb4fc9d7..956c05246b5c1368e2c5257b347848d1 #if ENABLE(TOUCH_EVENTS) && PLATFORM(WPE) @@ -85,7 +87,7 @@ public: - static Ref create(const AtomString& type, short button, const MouseEvent&, PointerID, const String& pointerType); + static Ref create(const AtomString& type, MouseButton, const MouseEvent&, PointerID, const String& pointerType); static Ref create(const AtomString& type, PointerID, const String& pointerType, IsPrimary = IsPrimary::No); -#if ENABLE(TOUCH_EVENTS) && (PLATFORM(IOS_FAMILY) || PLATFORM(WPE)) @@ -2896,9 +2645,9 @@ index 17784dfc482c3033ea0e3ce7fdcf75b2eb4fc9d7..956c05246b5c1368e2c5257b347848d1 static Ref create(const PlatformTouchEvent&, unsigned touchIndex, bool isPrimary, Ref&&, const IntPoint& touchDelta = { }); static Ref create(const AtomString& type, const PlatformTouchEvent&, unsigned touchIndex, bool isPrimary, Ref&&, const IntPoint& touchDelta = { }); #endif -@@ -134,7 +136,7 @@ private: +@@ -140,7 +142,7 @@ private: PointerEvent(const AtomString&, Init&&); - PointerEvent(const AtomString& type, short button, const MouseEvent&, PointerID, const String& pointerType); + PointerEvent(const AtomString& type, MouseButton, const MouseEvent&, PointerID, const String& pointerType); PointerEvent(const AtomString& type, PointerID, const String& pointerType, IsPrimary); -#if ENABLE(TOUCH_EVENTS) && (PLATFORM(IOS_FAMILY) || PLATFORM(WPE)) +#if ENABLE(TOUCH_EVENTS) @@ -2906,7 +2655,7 @@ index 17784dfc482c3033ea0e3ce7fdcf75b2eb4fc9d7..956c05246b5c1368e2c5257b347848d1 #endif diff --git a/Source/WebCore/editing/libwpe/EditorLibWPE.cpp b/Source/WebCore/editing/libwpe/EditorLibWPE.cpp -index 52ee00ea5df1b7eabedc3e9c344bd6d715d462fa..e311d17d5f18c9bf239e9fab3c1090c3578fc96c 100644 +index 7813532cc52d582c42aebc979a1ecd1137765f08..c01cbd53ad2430a6ffab9a80fc73e74a8523800a 100644 --- a/Source/WebCore/editing/libwpe/EditorLibWPE.cpp +++ b/Source/WebCore/editing/libwpe/EditorLibWPE.cpp @@ -34,6 +34,7 @@ @@ -2923,17 +2672,17 @@ index 52ee00ea5df1b7eabedc3e9c344bd6d715d462fa..e311d17d5f18c9bf239e9fab3c1090c3 +RefPtr Editor::webContentFromPasteboard(Pasteboard& pasteboard, const SimpleRange& context, bool allowPlainText, bool& chosePlainText) +{ -+ WebContentReader reader(*m_document.frame(), context, allowPlainText); ++ WebContentReader reader(*document().frame(), context, allowPlainText); + pasteboard.read(reader); -+ chosePlainText = reader.madeFragmentFromPlainText; -+ return WTFMove(reader.fragment); ++ chosePlainText = reader.madeFragmentFromPlainText(); ++ return reader.takeFragment(); +} + } // namespace WebCore #endif // USE(LIBWPE) diff --git a/Source/WebCore/html/FileInputType.cpp b/Source/WebCore/html/FileInputType.cpp -index 161a668d55aa0d3de7d7acb9ea752119c06130de..80d9a99b4346cbbbc23d7647fe6ebef071681230 100644 +index 823c70952937214681611e01421d0f1791aaa79f..84873071ca3226d9372de4e7c5363110fb393ec1 100644 --- a/Source/WebCore/html/FileInputType.cpp +++ b/Source/WebCore/html/FileInputType.cpp @@ -37,6 +37,7 @@ @@ -2944,7 +2693,7 @@ index 161a668d55aa0d3de7d7acb9ea752119c06130de..80d9a99b4346cbbbc23d7647fe6ebef0 #include "LocalFrame.h" #include "LocalizedStrings.h" #include "MIMETypeRegistry.h" -@@ -205,6 +206,11 @@ void FileInputType::handleDOMActivateEvent(Event& event) +@@ -209,6 +210,11 @@ void FileInputType::handleDOMActivateEvent(Event& event) if (input.isDisabledFormControl()) return; @@ -2956,7 +2705,7 @@ index 161a668d55aa0d3de7d7acb9ea752119c06130de..80d9a99b4346cbbbc23d7647fe6ebef0 if (!UserGestureIndicator::processingUserGesture()) return; -@@ -378,7 +384,9 @@ void FileInputType::setFiles(RefPtr&& files, RequestIcon shouldRequest +@@ -387,7 +393,9 @@ void FileInputType::setFiles(RefPtr&& files, RequestIcon shouldRequest pathsChanged = true; else { for (unsigned i = 0; i < length; ++i) { @@ -2968,7 +2717,7 @@ index 161a668d55aa0d3de7d7acb9ea752119c06130de..80d9a99b4346cbbbc23d7647fe6ebef0 break; } diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp -index c2dabfbc86e46d14048134545031159757e7c2e4..d3833a407a9e47c8809620ef5cf97346891dd29c 100644 +index 284787f7db1051968ccaf7852bf0e71228ef2e99..d1977ec28b264e964264fe26155d84005e8099aa 100644 --- a/Source/WebCore/inspector/InspectorController.cpp +++ b/Source/WebCore/inspector/InspectorController.cpp @@ -288,6 +288,8 @@ void InspectorController::disconnectFrontend(FrontendChannel& frontendChannel) @@ -3049,10 +2798,10 @@ index 3a981b5bf5ca0bbf4d1c9f0b125564742cd8cad9..f8fc2ca6700461627933f149c5837075 } // namespace WebCore diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp -index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee707d074d93 100644 +index 51cc7097811a72232a9415e64efda2b103e392cf..c622d7e4baf7c0c30b667fdef6a3c05445e6e8ad 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.cpp +++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp -@@ -598,6 +598,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i +@@ -599,6 +599,12 @@ void InspectorInstrumentation::applyUserAgentOverrideImpl(InstrumentingAgents& i pageAgent->applyUserAgentOverride(userAgent); } @@ -3065,7 +2814,7 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 void InspectorInstrumentation::applyEmulatedMediaImpl(InstrumentingAgents& instrumentingAgents, AtomString& media) { if (auto* pageAgent = instrumentingAgents.enabledPageAgent()) -@@ -681,6 +687,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen +@@ -682,6 +688,12 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this. } @@ -3078,7 +2827,7 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 void InspectorInstrumentation::willLoadXHRSynchronouslyImpl(InstrumentingAgents& instrumentingAgents) { if (auto* networkAgent = instrumentingAgents.enabledNetworkAgent()) -@@ -713,20 +725,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& +@@ -714,20 +726,17 @@ void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents& void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { @@ -3102,7 +2851,7 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 } void InspectorInstrumentation::frameDetachedFromParentImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) -@@ -809,12 +818,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins +@@ -810,12 +819,6 @@ void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& ins pageDOMDebuggerAgent->frameDocumentUpdated(frame); } @@ -3115,7 +2864,7 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 void InspectorInstrumentation::frameStartedLoadingImpl(InstrumentingAgents& instrumentingAgents, LocalFrame& frame) { if (frame.isMainFrame()) { -@@ -845,10 +848,10 @@ void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& inst +@@ -846,10 +849,10 @@ void InspectorInstrumentation::frameStoppedLoadingImpl(InstrumentingAgents& inst inspectorPageAgent->frameStoppedLoading(frame); } @@ -3128,7 +2877,7 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 } void InspectorInstrumentation::frameClearedScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame) -@@ -863,6 +866,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA +@@ -864,6 +867,12 @@ void InspectorInstrumentation::accessibilitySettingsDidChangeImpl(InstrumentingA inspectorPageAgent->accessibilitySettingsDidChange(); } @@ -3141,7 +2890,7 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) void InspectorInstrumentation::defaultAppearanceDidChangeImpl(InstrumentingAgents& instrumentingAgents) { -@@ -1051,6 +1060,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent +@@ -1052,6 +1061,12 @@ void InspectorInstrumentation::consoleStopRecordingCanvasImpl(InstrumentingAgent canvasAgent->consoleStopRecordingCanvas(context); } @@ -3154,7 +2903,7 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 void InspectorInstrumentation::didOpenDatabaseImpl(InstrumentingAgents& instrumentingAgents, Database& database) { if (auto* databaseAgent = instrumentingAgents.enabledDatabaseAgent()) -@@ -1351,6 +1366,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins +@@ -1358,6 +1373,36 @@ void InspectorInstrumentation::renderLayerDestroyedImpl(InstrumentingAgents& ins layerTreeAgent->renderLayerDestroyed(renderLayer); } @@ -3191,7 +2940,7 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(WorkerOrWorkletGlobalScope& globalScope) { return globalScope.inspectorController().m_instrumentingAgents; -@@ -1362,6 +1407,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(Page& page) +@@ -1369,6 +1414,13 @@ InstrumentingAgents& InspectorInstrumentation::instrumentingAgents(Page& page) return page.inspectorController().m_instrumentingAgents.get(); } @@ -3206,14 +2955,14 @@ index 55e1d3bbe88f38a730fae0ab6e4c513508b1c8a6..727f8143f1a07c6e7e605a2c0147ee70 { if (is(context)) diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h -index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c866956df9 100644 +index f032b90453a44b40c03786f660f105d94ccfab65..51aebd842948754785c25e99980594d45658df48 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.h +++ b/Source/WebCore/inspector/InspectorInstrumentation.h @@ -31,6 +31,7 @@ #pragma once -+#include "AccessibilityObjectInterface.h" ++#include "AXCoreObject.h" #include "CSSSelector.h" #include "CanvasBase.h" #include "CanvasRenderingContext.h" @@ -3273,7 +3022,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 static void performanceMark(ScriptExecutionContext&, const String&, std::optional, LocalFrame*); -@@ -325,6 +331,12 @@ public: +@@ -326,6 +332,12 @@ public: static void layerTreeDidChange(Page*); static void renderLayerDestroyed(Page*, const RenderLayer&); @@ -3286,7 +3035,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 static void frontendCreated(); static void frontendDeleted(); static bool hasFrontends() { return InspectorInstrumentationPublic::hasFrontends(); } -@@ -341,6 +353,8 @@ public: +@@ -342,6 +354,8 @@ public: static void registerInstrumentingAgents(InstrumentingAgents&); static void unregisterInstrumentingAgents(InstrumentingAgents&); @@ -3295,7 +3044,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 private: static void didClearWindowObjectInWorldImpl(InstrumentingAgents&, LocalFrame&, DOMWrapperWorld&); static bool isDebuggerPausedImpl(InstrumentingAgents&); -@@ -420,6 +434,7 @@ private: +@@ -421,6 +435,7 @@ private: static void didRecalculateStyleImpl(InstrumentingAgents&); static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&); static void applyUserAgentOverrideImpl(InstrumentingAgents&, String&); @@ -3303,7 +3052,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 static void applyEmulatedMediaImpl(InstrumentingAgents&, AtomString&); static void flexibleBoxRendererBeganLayoutImpl(InstrumentingAgents&, const RenderObject&); -@@ -434,6 +449,7 @@ private: +@@ -435,6 +450,7 @@ private: static void didReceiveDataImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const SharedBuffer*, int encodedDataLength); static void didFinishLoadingImpl(InstrumentingAgents&, ResourceLoaderIdentifier, DocumentLoader*, const NetworkLoadMetrics&, ResourceLoader*); static void didFailLoadingImpl(InstrumentingAgents&, ResourceLoaderIdentifier, DocumentLoader*, const ResourceError&); @@ -3311,7 +3060,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&); static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&); static void scriptImportedImpl(InstrumentingAgents&, ResourceLoaderIdentifier, const String& sourceString); -@@ -444,13 +460,13 @@ private: +@@ -445,13 +461,13 @@ private: static void frameDetachedFromParentImpl(InstrumentingAgents&, LocalFrame&); static void didCommitLoadImpl(InstrumentingAgents&, LocalFrame&, DocumentLoader*); static void frameDocumentUpdatedImpl(InstrumentingAgents&, LocalFrame&); @@ -3327,7 +3076,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) static void defaultAppearanceDidChangeImpl(InstrumentingAgents&); #endif -@@ -477,6 +493,7 @@ private: +@@ -478,6 +494,7 @@ private: static void stopProfilingImpl(InstrumentingAgents&, JSC::JSGlobalObject*, const String& title); static void consoleStartRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&, JSC::JSGlobalObject&, JSC::JSObject* options); static void consoleStopRecordingCanvasImpl(InstrumentingAgents&, CanvasRenderingContext&); @@ -3335,7 +3084,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 static void performanceMarkImpl(InstrumentingAgents&, const String& label, std::optional, LocalFrame*); -@@ -534,6 +551,12 @@ private: +@@ -536,6 +553,12 @@ private: static void layerTreeDidChangeImpl(InstrumentingAgents&); static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&); @@ -3348,7 +3097,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 static InstrumentingAgents& instrumentingAgents(Page&); static InstrumentingAgents& instrumentingAgents(WorkerOrWorkletGlobalScope&); -@@ -1066,6 +1089,13 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame, +@@ -1068,6 +1091,13 @@ inline void InspectorInstrumentation::applyUserAgentOverride(LocalFrame& frame, applyUserAgentOverrideImpl(*agents, userAgent); } @@ -3362,7 +3111,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 inline void InspectorInstrumentation::applyEmulatedMedia(LocalFrame& frame, AtomString& media) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1168,6 +1198,13 @@ inline void InspectorInstrumentation::didFailLoading(WorkerOrWorkletGlobalScope& +@@ -1170,6 +1200,13 @@ inline void InspectorInstrumentation::didFailLoading(WorkerOrWorkletGlobalScope& didFailLoadingImpl(instrumentingAgents(globalScope), identifier, nullptr, error); } @@ -3376,7 +3125,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(LocalFrame& frame, ResourceLoaderIdentifier identifier, DocumentLoader& loader, const ResourceResponse& response) { // Treat the same as didReceiveResponse. -@@ -1258,13 +1295,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame) +@@ -1260,13 +1297,6 @@ inline void InspectorInstrumentation::frameDocumentUpdated(LocalFrame& frame) frameDocumentUpdatedImpl(*agents, frame); } @@ -3390,7 +3139,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 inline void InspectorInstrumentation::frameStartedLoading(LocalFrame& frame) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1286,11 +1316,11 @@ inline void InspectorInstrumentation::frameStoppedLoading(LocalFrame& frame) +@@ -1288,11 +1318,11 @@ inline void InspectorInstrumentation::frameStoppedLoading(LocalFrame& frame) frameStoppedLoadingImpl(*agents, frame); } @@ -3404,7 +3153,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 } inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& frame) -@@ -1306,6 +1336,13 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page) +@@ -1308,6 +1338,13 @@ inline void InspectorInstrumentation::accessibilitySettingsDidChange(Page& page) accessibilitySettingsDidChangeImpl(instrumentingAgents(page)); } @@ -3418,7 +3167,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) inline void InspectorInstrumentation::defaultAppearanceDidChange(Page& page) { -@@ -1687,6 +1724,11 @@ inline void InspectorInstrumentation::performanceMark(ScriptExecutionContext& co +@@ -1696,6 +1733,11 @@ inline void InspectorInstrumentation::performanceMark(ScriptExecutionContext& co performanceMarkImpl(*agents, label, WTFMove(startTime), frame); } @@ -3430,7 +3179,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 inline void InspectorInstrumentation::didRequestAnimationFrame(Document& document, int callbackId) { FAST_RETURN_IF_NO_FRONTENDS(void()); -@@ -1743,6 +1785,42 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren +@@ -1752,6 +1794,42 @@ inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const Ren renderLayerDestroyedImpl(*agents, renderLayer); } @@ -3474,7 +3223,7 @@ index e1c01081c9f6ad3683b1510bda02b9c27d8d0db3..fadc5a9f33aa1aeabe6fe88ad7bff7c8 { return context ? instrumentingAgents(*context) : nullptr; diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp -index 30dee14fcf9001418a453f54a4b0bf85976a48ed..d2567ba1fe2baa21ef47b5561781dbcdaf89032d 100644 +index b4056c49e3b3362c5117213fc660e49cb2517431..29eef538962e724361bd1467f5ff8ad3fc3113b3 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp @@ -61,10 +61,14 @@ @@ -3908,7 +3657,7 @@ index 1a37f64d732d700f38a5d5b51c2ca2645ad30eeb..ab544156dc0d711074b86f51e3c7e63a void discardBindings(); diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp -index 8b5f6a837b71d877d5c6e0c0e128169859716c63..ef1d8212902787f8933ae8a8a34578521431e591 100644 +index 30e72aa5670d45e97332f647ebddc1677ffc6b9e..18986563d46d1261c2684ffac320f70276cc9d6b 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp @@ -59,6 +59,7 @@ @@ -3997,7 +3746,7 @@ index 8b5f6a837b71d877d5c6e0c0e128169859716c63..ef1d8212902787f8933ae8a8a3457852 { return startsWithLettersIgnoringASCIICase(mimeType, "text/"_s) diff --git a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h -index c6ebcc9d7e399a35f71350c9374df0f2107c518b..3bfa03ae7f27d9128fe207c1de1bfea9dbf5e44f 100644 +index dc7e574ee6e9256a1f75ea838d20ca7f5e9190de..5dd4464256e0f5d652fa51fd611286ddc1da6f5c 100644 --- a/Source/WebCore/inspector/agents/InspectorNetworkAgent.h +++ b/Source/WebCore/inspector/agents/InspectorNetworkAgent.h @@ -34,6 +34,8 @@ @@ -4018,10 +3767,10 @@ index c6ebcc9d7e399a35f71350c9374df0f2107c518b..3bfa03ae7f27d9128fe207c1de1bfea9 // InspectorInstrumentation void willRecalculateStyle(); diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp -index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e2814361393c 100644 +index 1cb48a48ae6ab976e8938d7e03ddc7e3cf58be4c..dbf78f734691588907f047011c164993cda588d5 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.cpp -@@ -32,19 +32,27 @@ +@@ -32,19 +32,26 @@ #include "config.h" #include "InspectorPageAgent.h" @@ -4029,7 +3778,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 +#include "BackForwardController.h" #include "CachedResource.h" #include "CachedResourceLoader.h" -+#include "CompositionHighlight.h" #include "Cookie.h" #include "CookieJar.h" +#include "CustomHeaderFields.h" @@ -4049,7 +3797,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 #include "HTMLNames.h" #include "ImageBuffer.h" #include "InspectorClient.h" -@@ -55,10 +63,13 @@ +@@ -55,10 +62,13 @@ #include "LocalFrame.h" #include "LocalFrameView.h" #include "MIMETypeRegistry.h" @@ -4064,7 +3812,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 #include "ScriptController.h" #include "ScriptSourceCode.h" #include "SecurityOrigin.h" -@@ -66,11 +77,18 @@ +@@ -66,11 +76,18 @@ #include "StyleScope.h" #include "Theme.h" #include @@ -4083,7 +3831,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 #include #include #include -@@ -83,11 +101,15 @@ +@@ -83,11 +100,15 @@ #include "LegacyWebArchive.h" #endif @@ -4100,7 +3848,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 static bool decodeBuffer(const uint8_t* buffer, unsigned size, const String& textEncodingName, String* result) { if (buffer) { -@@ -334,6 +356,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien +@@ -334,6 +355,7 @@ InspectorPageAgent::InspectorPageAgent(PageAgentContext& context, InspectorClien , m_frontendDispatcher(makeUnique(context.frontendRouter)) , m_backendDispatcher(Inspector::PageBackendDispatcher::create(context.backendDispatcher, this)) , m_inspectedPage(context.inspectedPage) @@ -4108,7 +3856,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 , m_client(client) , m_overlay(overlay) { -@@ -363,12 +386,20 @@ Protocol::ErrorStringOr InspectorPageAgent::enable() +@@ -363,12 +385,20 @@ Protocol::ErrorStringOr InspectorPageAgent::enable() defaultUserPreferencesDidChange(); @@ -4129,7 +3877,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 setShowPaintRects(false); #if !PLATFORM(IOS_FAMILY) -@@ -420,6 +451,22 @@ Protocol::ErrorStringOr InspectorPageAgent::reload(std::optional&& i +@@ -420,6 +450,22 @@ Protocol::ErrorStringOr InspectorPageAgent::reload(std::optional&& i return { }; } @@ -4152,7 +3900,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 Protocol::ErrorStringOr InspectorPageAgent::navigate(const String& url) { auto* localMainFrame = dynamicDowncast(m_inspectedPage.mainFrame()); -@@ -443,6 +490,13 @@ Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(const String +@@ -443,6 +489,13 @@ Protocol::ErrorStringOr InspectorPageAgent::overrideUserAgent(const String return { }; } @@ -4166,7 +3914,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Protocol::Page::Setting setting, std::optional&& value) { auto& inspectedPageSettings = m_inspectedPage.settings(); -@@ -456,6 +510,12 @@ Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Protocol::Page +@@ -456,6 +509,12 @@ Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Protocol::Page inspectedPageSettings.setAuthorAndUserStylesEnabledInspectorOverride(value); return { }; @@ -4179,7 +3927,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 case Protocol::Page::Setting::ICECandidateFilteringEnabled: inspectedPageSettings.setICECandidateFilteringEnabledInspectorOverride(value); return { }; -@@ -481,6 +541,38 @@ Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Protocol::Page +@@ -481,6 +540,38 @@ Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Protocol::Page inspectedPageSettings.setNeedsSiteSpecificQuirksInspectorOverride(value); return { }; @@ -4218,7 +3966,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 case Protocol::Page::Setting::ScriptEnabled: inspectedPageSettings.setScriptEnabledInspectorOverride(value); return { }; -@@ -493,6 +585,12 @@ Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Protocol::Page +@@ -493,6 +584,12 @@ Protocol::ErrorStringOr InspectorPageAgent::overrideSetting(Protocol::Page inspectedPageSettings.setShowRepaintCounterInspectorOverride(value); return { }; @@ -4231,23 +3979,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 case Protocol::Page::Setting::WebSecurityEnabled: inspectedPageSettings.setWebSecurityEnabledInspectorOverride(value); return { }; -@@ -785,9 +883,13 @@ Protocol::ErrorStringOr> InspectorP - return { { content, base64Encoded } }; - } - --Protocol::ErrorStringOr InspectorPageAgent::setBootstrapScript(const String& source) -+Protocol::ErrorStringOr InspectorPageAgent::setBootstrapScript(const String& source, const String& worldName) - { -- m_bootstrapScript = source; -+ String key = worldName.isNull() ? emptyString() : worldName; -+ if (source.isEmpty()) -+ m_worldNameToBootstrapScript.remove(key); -+ else -+ m_worldNameToBootstrapScript.set(key, source); - - return { }; - } -@@ -893,15 +995,16 @@ Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(bool show) +@@ -893,15 +990,16 @@ Protocol::ErrorStringOr InspectorPageAgent::setShowPaintRects(bool show) return { }; } @@ -4269,7 +4001,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 } void InspectorPageAgent::frameNavigated(LocalFrame& frame) -@@ -909,13 +1012,25 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) +@@ -909,13 +1007,25 @@ void InspectorPageAgent::frameNavigated(LocalFrame& frame) m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame)); } @@ -4298,7 +4030,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 } Frame* InspectorPageAgent::frameForId(const Protocol::Network::FrameId& frameId) -@@ -927,20 +1042,17 @@ String InspectorPageAgent::frameId(Frame* frame) +@@ -927,20 +1037,17 @@ String InspectorPageAgent::frameId(Frame* frame) { if (!frame) return emptyString(); @@ -4324,7 +4056,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 } LocalFrame* InspectorPageAgent::assertFrame(Protocol::ErrorString& errorString, const Protocol::Network::FrameId& frameId) -@@ -951,11 +1063,6 @@ LocalFrame* InspectorPageAgent::assertFrame(Protocol::ErrorString& errorString, +@@ -951,11 +1058,6 @@ LocalFrame* InspectorPageAgent::assertFrame(Protocol::ErrorString& errorString, return frame; } @@ -4336,7 +4068,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 void InspectorPageAgent::frameStartedLoading(LocalFrame& frame) { m_frontendDispatcher->frameStartedLoading(frameId(&frame)); -@@ -966,9 +1073,9 @@ void InspectorPageAgent::frameStoppedLoading(LocalFrame& frame) +@@ -966,9 +1068,9 @@ void InspectorPageAgent::frameStoppedLoading(LocalFrame& frame) m_frontendDispatcher->frameStoppedLoading(frameId(&frame)); } @@ -4348,7 +4080,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 } void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame) -@@ -1023,6 +1130,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() +@@ -1015,6 +1117,12 @@ void InspectorPageAgent::defaultUserPreferencesDidChange() m_frontendDispatcher->defaultUserPreferencesDidChange(WTFMove(defaultUserPreferences)); } @@ -4361,33 +4093,17 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 #if ENABLE(DARK_MODE_CSS) || HAVE(OS_DARK_MODE_SUPPORT) void InspectorPageAgent::defaultAppearanceDidChange() { -@@ -1032,13 +1145,22 @@ void InspectorPageAgent::defaultAppearanceDidChange() - - void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapperWorld& world) - { -- if (&world != &mainThreadNormalWorld()) -+ if (m_worldNameToBootstrapScript.isEmpty()) +@@ -1028,6 +1136,9 @@ void InspectorPageAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapp return; -- if (m_bootstrapScript.isEmpty()) -+ if (world.name().isEmpty() && &world != &mainThreadNormalWorld()) + if (m_bootstrapScript.isEmpty()) + return; + -+ String worldName = world.name(); -+ // Null string cannot be used as a key. -+ if (worldName.isNull()) -+ worldName = emptyString(); -+ -+ if (!m_worldNameToBootstrapScript.contains(worldName)) ++ if (m_ignoreDidClearWindowObject) return; -- frame.script().evaluateIgnoringException(ScriptSourceCode(m_bootstrapScript, URL { "web-inspector://bootstrap.js"_str })); -+ String bootstrapScript = m_worldNameToBootstrapScript.get(worldName); -+ frame.script().evaluateInWorldIgnoringException(ScriptSourceCode(bootstrapScript, URL { "web-inspector://bootstrap.js"_str }), world); - } - - void InspectorPageAgent::didPaint(RenderObject& renderer, const LayoutRect& rect) -@@ -1086,6 +1208,51 @@ void InspectorPageAgent::didRecalculateStyle() + frame.script().evaluateIgnoringException(ScriptSourceCode(m_bootstrapScript, JSC::SourceTaintedOrigin::Untainted, URL { "web-inspector://bootstrap.js"_str })); +@@ -1078,6 +1189,51 @@ void InspectorPageAgent::didRecalculateStyle() m_overlay->update(); } @@ -4439,7 +4155,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 Ref InspectorPageAgent::buildObjectForFrame(LocalFrame* frame) { ASSERT_ARG(frame, frame); -@@ -1183,6 +1350,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) +@@ -1175,6 +1331,12 @@ void InspectorPageAgent::applyUserAgentOverride(String& userAgent) userAgent = m_userAgentOverride; } @@ -4452,7 +4168,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 void InspectorPageAgent::applyEmulatedMedia(AtomString& media) { if (!m_emulatedMedia.isEmpty()) -@@ -1210,11 +1383,13 @@ Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Protocol::DOM:: +@@ -1202,11 +1364,13 @@ Protocol::ErrorStringOr InspectorPageAgent::snapshotNode(Protocol::DOM:: return snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); } @@ -4467,7 +4183,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 IntRect rectangle(x, y, width, height); auto* localMainFrame = dynamicDowncast(m_inspectedPage.mainFrame()); -@@ -1228,6 +1403,43 @@ Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int x, int y, i +@@ -1220,6 +1384,43 @@ Protocol::ErrorStringOr InspectorPageAgent::snapshotRect(int x, int y, i return snapshot->toDataURL("image/png"_s, std::nullopt, PreserveResolution::Yes); } @@ -4511,7 +4227,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 #if ENABLE(WEB_ARCHIVE) && USE(CF) Protocol::ErrorStringOr InspectorPageAgent::archive() { -@@ -1244,7 +1456,6 @@ Protocol::ErrorStringOr InspectorPageAgent::archive() +@@ -1236,7 +1437,6 @@ Protocol::ErrorStringOr InspectorPageAgent::archive() } #endif @@ -4519,14 +4235,14 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverride(std::optional&& width, std::optional&& height) { if (width.has_value() != height.has_value()) -@@ -1262,6 +1473,629 @@ Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverride(std::opt +@@ -1254,6 +1454,511 @@ Protocol::ErrorStringOr InspectorPageAgent::setScreenSizeOverride(std::opt localMainFrame->setOverrideScreenSize(FloatSize(width.value_or(0), height.value_or(0))); return { }; } + +Protocol::ErrorStringOr InspectorPageAgent::insertText(const String& text) +{ -+ UserGestureIndicator indicator { ProcessingUserGesture }; ++ UserGestureIndicator indicator { IsProcessingUserGesture::Yes }; + LocalFrame& frame = m_inspectedPage.focusController().focusedOrMainFrame(); + + if (frame.editor().hasComposition()) { @@ -4538,24 +4254,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return { }; +} + -+Protocol::ErrorStringOr InspectorPageAgent::setComposition(const String& text, int selectionStart, int selectionLength, std::optional&& replacementStart, std::optional&& replacementLength) -+{ -+ LocalFrame& frame = m_inspectedPage.focusController().focusedOrMainFrame(); -+ -+ UserGestureIndicator indicator { ProcessingUserGesture }; -+ -+ if (!frame.selection().selection().isContentEditable()) -+ return { }; -+ if (replacementStart) { -+ WebCore::CharacterRange range { static_cast(*replacementStart), replacementLength ? static_cast(*replacementLength) : 0 }; -+ auto* element = frame.selection().rootEditableElementOrDocumentElement(); -+ if (element) -+ frame.selection().setSelection(VisibleSelection(resolveCharacterRange(makeRangeSelectingNodeContents(*element), range))); -+ } -+ frame.editor().setComposition(text, { }, { }, { }, static_cast(selectionStart), selectionStart + selectionLength); -+ return { }; -+} -+ +static String roleFromObject(RefPtr axObject) +{ + String computedRoleString = axObject->computedRoleString(); @@ -4563,8 +4261,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return computedRoleString; + AccessibilityRole role = axObject->roleValue(); + switch(role) { -+ case AccessibilityRole::Annotation: -+ return "Annotation"_s; + case AccessibilityRole::Application: + return "Application"_s; + case AccessibilityRole::ApplicationAlert: @@ -4589,10 +4285,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "Audio"_s; + case AccessibilityRole::Blockquote: + return "Blockquote"_s; -+ case AccessibilityRole::Browser: -+ return "Browser"_s; -+ case AccessibilityRole::BusyIndicator: -+ return "BusyIndicator"_s; + case AccessibilityRole::Button: + return "Button"_s; + case AccessibilityRole::Canvas: @@ -4601,7 +4293,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "Caption"_s; + case AccessibilityRole::Cell: + return "Cell"_s; -+ case AccessibilityRole::CheckBox: ++ case AccessibilityRole::Checkbox: + return "CheckBox"_s; + case AccessibilityRole::Code: + return "Code"_s; @@ -4627,8 +4319,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "Details"_s; + case AccessibilityRole::Directory: + return "Directory"_s; -+ case AccessibilityRole::DisclosureTriangle: -+ return "DisclosureTriangle"_s; + case AccessibilityRole::Document: + return "Document"_s; + case AccessibilityRole::DocumentArticle: @@ -4637,10 +4327,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "DocumentMath"_s; + case AccessibilityRole::DocumentNote: + return "DocumentNote"_s; -+ case AccessibilityRole::Drawer: -+ return "Drawer"_s; -+ case AccessibilityRole::EditableText: -+ return "EditableText"_s; + case AccessibilityRole::Feed: + return "Feed"_s; + case AccessibilityRole::Figure: @@ -4665,12 +4351,8 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "GridCell"_s; + case AccessibilityRole::Group: + return "Group"_s; -+ case AccessibilityRole::GrowArea: -+ return "GrowArea"_s; + case AccessibilityRole::Heading: + return "Heading"_s; -+ case AccessibilityRole::HelpTag: -+ return "HelpTag"_s; + case AccessibilityRole::HorizontalRule: + return "HorizontalRule"_s; + case AccessibilityRole::Ignored: @@ -4723,8 +4405,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "Mark"_s; + case AccessibilityRole::MathElement: + return "MathElement"_s; -+ case AccessibilityRole::Matte: -+ return "Matte"_s; + case AccessibilityRole::Menu: + return "Menu"_s; + case AccessibilityRole::MenuBar: @@ -4745,8 +4425,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "Meter"_s; + case AccessibilityRole::Model: + return "Model"_s; -+ case AccessibilityRole::Outline: -+ return "Outline"_s; + case AccessibilityRole::Paragraph: + return "Paragraph"_s; + case AccessibilityRole::PopUpButton: @@ -4777,18 +4455,12 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "RubyRun"_s; + case AccessibilityRole::RubyText: + return "RubyText"_s; -+ case AccessibilityRole::Ruler: -+ return "Ruler"_s; -+ case AccessibilityRole::RulerMarker: -+ return "RulerMarker"_s; + case AccessibilityRole::ScrollArea: + return "ScrollArea"_s; + case AccessibilityRole::ScrollBar: + return "ScrollBar"_s; + case AccessibilityRole::SearchField: + return "SearchField"_s; -+ case AccessibilityRole::Sheet: -+ return "Sheet"_s; + case AccessibilityRole::Slider: + return "Slider"_s; + case AccessibilityRole::SliderThumb: @@ -4797,8 +4469,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "SpinButton"_s; + case AccessibilityRole::SpinButtonPart: + return "SpinButtonPart"_s; -+ case AccessibilityRole::SplitGroup: -+ return "SplitGroup"_s; + case AccessibilityRole::Splitter: + return "Splitter"_s; + case AccessibilityRole::StaticText: @@ -4813,8 +4483,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "Superscript"_s; + case AccessibilityRole::Switch: + return "Switch"_s; -+ case AccessibilityRole::SystemWide: -+ return "SystemWide"_s; + case AccessibilityRole::SVGRoot: + return "SVGRoot"_s; + case AccessibilityRole::SVGText: @@ -4859,8 +4527,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "Unknown"_s; + case AccessibilityRole::UserInterfaceTooltip: + return "UserInterfaceTooltip"_s; -+ case AccessibilityRole::ValueIndicator: -+ return "ValueIndicator"_s; + case AccessibilityRole::Video: + return "Video"_s; + case AccessibilityRole::WebApplication: @@ -4869,8 +4535,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + return "WebArea"_s; + case AccessibilityRole::WebCoreLink: + return "WebCoreLink"_s; -+ case AccessibilityRole::Window: -+ return "Window"_s; + }; + return "Unknown"_s; +} @@ -4902,9 +4566,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 + axNode->setFocused(axObject->isFocused()); + if (axObject->isModalNode()) + axNode->setModal(axObject->isModalNode()); -+ bool multiline = axObject->ariaIsMultiline() || axObject->roleValue() == AccessibilityRole::TextArea; -+ if (multiline) -+ axNode->setMultiline(multiline); + if (axObject->isMultiSelectable()) + axNode->setMultiselectable(axObject->isMultiSelectable()); + if (liveObject && liveObject->supportsReadOnly() && !axObject->canSetValueAttribute() && axObject->isEnabled()) @@ -5076,69 +4737,6 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 #endif +} + -+static std::optional parseInsets(RefPtr&& insets) -+{ -+ std::optional top = insets->getDouble("top"_s); -+ std::optional right = insets->getDouble("right"_s); -+ std::optional bottom = insets->getDouble("bottom"_s); -+ std::optional left = insets->getDouble("left"_s); -+ if (top && right && bottom && left) -+ return FloatBoxExtent(static_cast(*top), static_cast(*right), static_cast(*bottom), static_cast(*left)); -+ return std::optional(); -+} -+ -+static std::optional parseRect(RefPtr&& insets) -+{ -+ std::optional x = insets->getDouble("x"_s); -+ std::optional y = insets->getDouble("y"_s); -+ std::optional width = insets->getDouble("width"_s); -+ std::optional height = insets->getDouble("height"_s); -+ if (x && y && width && height) -+ return FloatRect(static_cast(*x), static_cast(*y), static_cast(*width), static_cast(*height)); -+ return std::optional(); -+} -+ -+Protocol::ErrorStringOr InspectorPageAgent::setVisibleContentRects(RefPtr&& unobscuredContentRect, RefPtr&& contentInsets, RefPtr&& obscuredInsets, RefPtr&& unobscuredInsets) -+{ -+ auto* localFrame = dynamicDowncast(m_inspectedPage.mainFrame()); -+ LocalFrameView* view = localFrame ? localFrame->view() : nullptr; -+ if (!view) -+ return makeUnexpected("Internal error: No frame view to set content rects for"_s); -+ -+ if (unobscuredContentRect) { -+ std::optional ucr = parseRect(WTFMove(unobscuredContentRect)); -+ if (!ucr) -+ return makeUnexpected("Invalid unobscured content rect"_s); -+ -+ view->setUnobscuredContentSize(FloatSize(ucr->width(), ucr->height())); -+ } -+ -+ if (contentInsets) { -+ std::optional ci = parseInsets(WTFMove(contentInsets)); -+ if (!ci) -+ return makeUnexpected("Invalid content insets"_s); -+ -+ m_inspectedPage.setContentInsets(*ci); -+ } -+ -+ if (obscuredInsets) { -+ std::optional oi = parseInsets(WTFMove(obscuredInsets)); -+ if (!oi) -+ return makeUnexpected("Invalid obscured insets"_s); -+ -+ m_inspectedPage.setObscuredInsets(*oi); -+ } -+ -+ if (unobscuredInsets) { -+ std::optional ui = parseInsets(WTFMove(unobscuredInsets)); -+ if (!ui) -+ return makeUnexpected("Invalid unobscured insets"_s); -+ -+ m_inspectedPage.setUnobscuredSafeAreaInsets(*ui); -+ } -+ return {}; -+} -+ +Protocol::ErrorStringOr InspectorPageAgent::updateScrollingState() +{ + auto* scrollingCoordinator = m_inspectedPage.scrollingCoordinator(); @@ -5150,7 +4748,7 @@ index 0a015134788986e4b829b887377c976ee2673b6b..e2924cf0d8863281f2a5102e7998e281 } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/InspectorPageAgent.h b/Source/WebCore/inspector/agents/InspectorPageAgent.h -index f270cb7c3bcc1b5d7d646d9c6e6bda7063cf82e3..5f80d34d6476250a2495ccd4871aed1c2ef13ccc 100644 +index f270cb7c3bcc1b5d7d646d9c6e6bda7063cf82e3..83d793622a71b441afe5962bd7c94ad85a12263f 100644 --- a/Source/WebCore/inspector/agents/InspectorPageAgent.h +++ b/Source/WebCore/inspector/agents/InspectorPageAgent.h @@ -32,8 +32,10 @@ @@ -5201,16 +4799,7 @@ index f270cb7c3bcc1b5d7d646d9c6e6bda7063cf82e3..5f80d34d6476250a2495ccd4871aed1c 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(); -@@ -107,7 +118,7 @@ public: - Inspector::Protocol::ErrorStringOr deleteCookie(const String& cookieName, const String& url); - Inspector::Protocol::ErrorStringOr> getResourceTree(); - Inspector::Protocol::ErrorStringOr> getResourceContent(const Inspector::Protocol::Network::FrameId&, const String& url); -- Inspector::Protocol::ErrorStringOr setBootstrapScript(const String& source); -+ Inspector::Protocol::ErrorStringOr setBootstrapScript(const String& source, const String& worldName); - Inspector::Protocol::ErrorStringOr>> searchInResource(const Inspector::Protocol::Network::FrameId&, const String& url, const String& query, std::optional&& caseSensitive, std::optional&& isRegex, const Inspector::Protocol::Network::RequestId&); - Inspector::Protocol::ErrorStringOr>> searchInResources(const String&, std::optional&& caseSensitive, std::optional&& isRegex); - #if !PLATFORM(IOS_FAMILY) -@@ -115,37 +126,57 @@ public: +@@ -115,45 +126,66 @@ public: #endif Inspector::Protocol::ErrorStringOr setShowPaintRects(bool); Inspector::Protocol::ErrorStringOr setEmulatedMedia(const String&); @@ -5228,7 +4817,6 @@ index f270cb7c3bcc1b5d7d646d9c6e6bda7063cf82e3..5f80d34d6476250a2495ccd4871aed1c -#endif + + Inspector::Protocol::ErrorStringOr insertText(const String& text); -+ Inspector::Protocol::ErrorStringOr setComposition(const String& text, int selectionStart, int selectionLength, std::optional&& replacementStart, std::optional&& replacementLength); + Inspector::Protocol::ErrorStringOr> accessibilitySnapshot(const String& objectId); + Inspector::Protocol::ErrorStringOr setInterceptFileChooserDialog(bool enabled); + Inspector::Protocol::ErrorStringOr setDefaultBackgroundColorOverride(RefPtr&&); @@ -5236,7 +4824,6 @@ index f270cb7c3bcc1b5d7d646d9c6e6bda7063cf82e3..5f80d34d6476250a2495ccd4871aed1c + Inspector::Protocol::ErrorStringOr setBypassCSP(bool); + Inspector::Protocol::ErrorStringOr crash(); + Inspector::Protocol::ErrorStringOr setOrientationOverride(std::optional&& angle); -+ Inspector::Protocol::ErrorStringOr setVisibleContentRects(RefPtr&& unobscuredContentRect, RefPtr&& contentInsets, RefPtr&& obscuredInsets, RefPtr&& unobscuredInsets); + Inspector::Protocol::ErrorStringOr updateScrollingState(); // InspectorInstrumentation @@ -5275,7 +4862,10 @@ index f270cb7c3bcc1b5d7d646d9c6e6bda7063cf82e3..5f80d34d6476250a2495ccd4871aed1c Frame* frameForId(const Inspector::Protocol::Network::FrameId&); WEBCORE_EXPORT String frameId(Frame*); -@@ -154,6 +185,7 @@ public: + String loaderId(DocumentLoader*); + LocalFrame* assertFrame(Inspector::Protocol::ErrorString&, const Inspector::Protocol::Network::FrameId&); ++ void setIgnoreDidClearWindowObject(bool ignore) { m_ignoreDidClearWindowObject = ignore; } ++ bool ignoreDidClearWindowObject() const { return m_ignoreDidClearWindowObject; } private: double timestamp(); @@ -5294,7 +4884,6 @@ index f270cb7c3bcc1b5d7d646d9c6e6bda7063cf82e3..5f80d34d6476250a2495ccd4871aed1c - WeakHashMap m_frameToIdentifier; MemoryCompactRobinHoodHashMap> m_identifierToFrame; - HashMap m_loaderToIdentifier; -+ HashMap m_worldNameToBootstrapScript; String m_userAgentOverride; + String m_platformOverride; AtomString m_emulatedMedia; @@ -5304,61 +4893,12 @@ index f270cb7c3bcc1b5d7d646d9c6e6bda7063cf82e3..5f80d34d6476250a2495ccd4871aed1c + bool m_interceptFileChooserDialog { false }; + bool m_bypassCSP { false }; + bool m_doingAccessibilitySnapshot { false }; ++ bool m_ignoreDidClearWindowObject { false }; }; } // namespace WebCore -diff --git a/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp b/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp -index bbed7e5e9aeab664743b7751ae6c4f1367cc6deb..88153c5a5e493e086245f0a48988ac7a2d6a43b8 100644 ---- a/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp -+++ b/Source/WebCore/inspector/agents/InspectorWorkerAgent.cpp -@@ -27,7 +27,9 @@ - #include "InspectorWorkerAgent.h" - - #include "Document.h" -+#include "FrameDestructionObserverInlines.h" - #include "InstrumentingAgents.h" -+#include "InspectorPageAgent.h" - #include "Page.h" - #include - #include -@@ -168,7 +170,11 @@ void InspectorWorkerAgent::connectToWorkerInspectorProxy(WorkerInspectorProxy& p - - m_connectedProxies.set(proxy.identifier(), proxy); - -- m_frontendDispatcher->workerCreated(proxy.identifier(), proxy.url().string(), proxy.name()); -+ ASSERT(is(proxy.scriptExecutionContext())); -+ Document& document = downcast(*proxy.scriptExecutionContext()); -+ auto* pageAgent = m_instrumentingAgents.enabledPageAgent(); -+ m_frontendDispatcher->workerCreated(proxy.identifier(), proxy.url().string(), proxy.name(), -+ pageAgent ? pageAgent->frameId(document.frame()) : emptyString()); - } - - void InspectorWorkerAgent::disconnectFromWorkerInspectorProxy(WorkerInspectorProxy& proxy) -diff --git a/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp b/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp -index 242aea89da38d22a2c2b314f337e6aa4f3becdb8..51f978caae1a6a76fb1833fbfef76837a79406ea 100644 ---- a/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp -+++ b/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp -@@ -37,6 +37,7 @@ - #include "Document.h" - #include "InspectorPageAgent.h" - #include "InstrumentingAgents.h" -+#include "JSDOMWindowBase.h" - #include "JSExecState.h" - #include "JSLocalDOMWindowCustom.h" - #include "LocalFrame.h" -@@ -74,7 +75,9 @@ Protocol::ErrorStringOr, std::op - if (injectedScript.hasNoValue()) - return makeUnexpected("Missing injected script for given callFrameId"_s); - -- UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture.value_or(false), dynamicDowncast(executionContext(injectedScript.globalObject()))); -+ JSC::JSGlobalObject* globalObject = injectedScript.globalObject(); -+ Document* document = globalObject ? activeDOMWindow(*globalObject).document() : nullptr; -+ UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture.value_or(false), document); - return WebDebuggerAgent::evaluateOnCallFrame(injectedScript, callFrameId, expression, objectGroup, WTFMove(includeCommandLineAPI), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(saveResult), WTFMove(emulateUserGesture)); - } - diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp -index 77b093ba149993094dc059d6cf8348095500bcb7..dc0a611a9da1ae4ffb54f1b57bba6ea290a57f48 100644 +index 8452f240f0a95a8b8e8b94876cc1e4486fd1b756..e1595905b04fb6e4525afada87d203b71eb0bb54 100644 --- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp +++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.cpp @@ -34,6 +34,7 @@ @@ -5377,7 +4917,7 @@ index 77b093ba149993094dc059d6cf8348095500bcb7..dc0a611a9da1ae4ffb54f1b57bba6ea2 #include "SecurityOrigin.h" #include "UserGestureEmulationScope.h" #include -@@ -85,6 +87,8 @@ Protocol::ErrorStringOr PageRuntimeAgent::disable() +@@ -85,13 +87,73 @@ Protocol::ErrorStringOr PageRuntimeAgent::disable() { m_instrumentingAgents.setEnabledPageRuntimeAgent(nullptr); @@ -5386,10 +4926,17 @@ index 77b093ba149993094dc059d6cf8348095500bcb7..dc0a611a9da1ae4ffb54f1b57bba6ea2 return InspectorRuntimeAgent::disable(); } -@@ -94,8 +98,66 @@ void PageRuntimeAgent::frameNavigated(LocalFrame& frame) + void PageRuntimeAgent::frameNavigated(LocalFrame& frame) + { ++ auto* pageAgent = m_instrumentingAgents.enabledPageAgent(); ++ if (pageAgent) ++ pageAgent->setIgnoreDidClearWindowObject(true); + // Ensure execution context is created for the frame even if it doesn't have scripts. mainWorldGlobalObject(frame); - } - ++ if (pageAgent) ++ pageAgent->setIgnoreDidClearWindowObject(false); ++} ++ +static JSC_DECLARE_HOST_FUNCTION(bindingCallback); + +JSC_DEFINE_HOST_FUNCTION(bindingCallback, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) @@ -5425,7 +4972,7 @@ index 77b093ba149993094dc059d6cf8348095500bcb7..dc0a611a9da1ae4ffb54f1b57bba6ea2 + if (!m_bindingNames.add(name).isNewEntry) + return {}; + -+ m_inspectedPage.forEachFrame([&](LocalFrame& frame) { ++ m_inspectedPage.forEachLocalFrame([&](LocalFrame& frame) { + if (!frame.script().canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript)) + return; + @@ -5441,22 +4988,26 @@ index 77b093ba149993094dc059d6cf8348095500bcb7..dc0a611a9da1ae4ffb54f1b57bba6ea2 + if (injectedScript.hasNoValue()) + return; + m_frontendDispatcher->bindingCalled(injectedScriptManager().injectedScriptIdFor(globalObject), name, arg); -+} -+ + } + void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapperWorld& world) - { +@@ -100,7 +162,26 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapper + if (!pageAgent) + return; + ++ if (pageAgent->ignoreDidClearWindowObject()) ++ return; ++ + if (world.isNormal()) { + for (const auto& name : m_bindingNames) + addBindingToFrame(frame, name); + } + - auto* pageAgent = m_instrumentingAgents.enabledPageAgent(); - if (!pageAgent) - return; -@@ -103,6 +165,15 @@ void PageRuntimeAgent::didClearWindowObjectInWorld(LocalFrame& frame, DOMWrapper ++ pageAgent->setIgnoreDidClearWindowObject(true); notifyContextCreated(pageAgent->frameId(&frame), frame.script().globalObject(world), world); - } - ++ pageAgent->setIgnoreDidClearWindowObject(false); ++} ++ +void PageRuntimeAgent::didReceiveMainResourceError(LocalFrame& frame) +{ + if (frame.loader().stateMachine().isDisplayingInitialEmptyDocument()) { @@ -5464,54 +5015,21 @@ index 77b093ba149993094dc059d6cf8348095500bcb7..dc0a611a9da1ae4ffb54f1b57bba6ea2 + // it usable in case loading failed. + mainWorldGlobalObject(frame); + } -+} -+ + } + InjectedScript PageRuntimeAgent::injectedScriptForEval(Protocol::ErrorString& errorString, std::optional&& executionContextId) - { - if (!executionContextId) { -@@ -139,9 +210,6 @@ void PageRuntimeAgent::reportExecutionContextCreation() +@@ -139,9 +220,6 @@ void PageRuntimeAgent::reportExecutionContextCreation() return; - m_inspectedPage.forEachFrame([&](LocalFrame& frame) { + m_inspectedPage.forEachLocalFrame([&](LocalFrame& frame) { - if (!frame.script().canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript)) - return; - auto frameId = pageAgent->frameId(&frame); // Always send the main world first. -@@ -200,18 +268,24 @@ Protocol::ErrorStringOr, std::op - if (injectedScript.hasNoValue()) - return makeUnexpected(errorString); - -- UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture.value_or(false), dynamicDowncast(executionContext(injectedScript.globalObject()))); -+ JSC::JSGlobalObject* globalObject = injectedScript.globalObject(); -+ Document* document = globalObject ? activeDOMWindow(*globalObject).document() : nullptr; -+ UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture.value_or(false), document); - return InspectorRuntimeAgent::evaluate(injectedScript, expression, objectGroup, WTFMove(includeCommandLineAPI), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(saveResult), WTFMove(emulateUserGesture)); - } - --Protocol::ErrorStringOr, std::optional /* wasThrown */>> PageRuntimeAgent::callFunctionOn(const Protocol::Runtime::RemoteObjectId& objectId, const String& expression, RefPtr&& optionalArguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture) -+void PageRuntimeAgent::callFunctionOn(const Protocol::Runtime::RemoteObjectId& objectId, const String& expression, RefPtr&& optionalArguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture, std::optional&& awaitPromise, Ref&& callback) - { - auto injectedScript = injectedScriptManager().injectedScriptForObjectId(objectId); -- if (injectedScript.hasNoValue()) -- return makeUnexpected("Missing injected script for given objectId"_s); -+ if (injectedScript.hasNoValue()) { -+ callback->sendFailure("Missing injected script for given objectId"_s); -+ return; -+ } - -- UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture.value_or(false), dynamicDowncast(executionContext(injectedScript.globalObject()))); -- return InspectorRuntimeAgent::callFunctionOn(injectedScript, objectId, expression, WTFMove(optionalArguments), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(emulateUserGesture)); -+ JSC::JSGlobalObject* globalObject = injectedScript.globalObject(); -+ Document* document = globalObject ? activeDOMWindow(*globalObject).document() : nullptr; -+ UserGestureEmulationScope userGestureScope(m_inspectedPage, emulateUserGesture.value_or(false), document); -+ return InspectorRuntimeAgent::callFunctionOn(objectId, expression, WTFMove(optionalArguments), WTFMove(doNotPauseOnExceptionsAndMuteConsole), WTFMove(returnByValue), WTFMove(generatePreview), WTFMove(emulateUserGesture), WTFMove(awaitPromise), WTFMove(callback)); - } - - } // namespace WebCore diff --git a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h -index fe3de3ee1ff4b61f66cc92bc0b9c2136c05769a3..3206e3ae64611c02abcfd6cc2e2a7b6f939eb560 100644 +index 9501fc840e35f3badc701e7622555dba394cae9b..1391c73d9b3ba250ad3a831bfe7c92c98de0c93c 100644 --- a/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h +++ b/Source/WebCore/inspector/agents/page/PageRuntimeAgent.h @@ -37,6 +37,7 @@ @@ -5522,19 +5040,11 @@ index fe3de3ee1ff4b61f66cc92bc0b9c2136c05769a3..3206e3ae64611c02abcfd6cc2e2a7b6f } namespace WebCore { -@@ -54,28 +55,31 @@ public: - ~PageRuntimeAgent(); - - // RuntimeBackendDispatcherHandler -- Inspector::Protocol::ErrorStringOr enable(); -- Inspector::Protocol::ErrorStringOr disable(); -- Inspector::Protocol::ErrorStringOr, std::optional /* wasThrown */, std::optional /* savedResultIndex */>> evaluate(const String& expression, const String& objectGroup, std::optional&& includeCommandLineAPI, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&&, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& saveResult, std::optional&& emulateUserGesture); -- Inspector::Protocol::ErrorStringOr, std::optional /* wasThrown */>> callFunctionOn(const Inspector::Protocol::Runtime::RemoteObjectId&, const String& expression, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture); -+ Inspector::Protocol::ErrorStringOr enable() override; -+ Inspector::Protocol::ErrorStringOr disable() override; -+ Inspector::Protocol::ErrorStringOr, std::optional /* wasThrown */, std::optional /* savedResultIndex */>> evaluate(const String& expression, const String& objectGroup, std::optional&& includeCommandLineAPI, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&&, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& saveResult, std::optional&& emulateUserGesture) override; -+ void callFunctionOn(const Inspector::Protocol::Runtime::RemoteObjectId&, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture, std::optional&& awaitPromise, Ref&&) override; -+ Inspector::Protocol::ErrorStringOr addBinding(const String& name) final; +@@ -58,10 +59,13 @@ public: + Inspector::Protocol::ErrorStringOr disable(); + Inspector::Protocol::ErrorStringOr, std::optional /* wasThrown */, std::optional /* savedResultIndex */>> evaluate(const String& expression, const String& objectGroup, std::optional&& includeCommandLineAPI, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&&, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& saveResult, std::optional&& emulateUserGesture); + void callFunctionOn(const Inspector::Protocol::Runtime::RemoteObjectId&, const String& functionDeclaration, RefPtr&& arguments, std::optional&& doNotPauseOnExceptionsAndMuteConsole, std::optional&& returnByValue, std::optional&& generatePreview, std::optional&& emulateUserGesture, std::optional&& awaitPromise, Ref&&); ++ Inspector::Protocol::ErrorStringOr addBinding(const String& name); // InspectorInstrumentation void frameNavigated(LocalFrame&); @@ -5543,18 +5053,8 @@ index fe3de3ee1ff4b61f66cc92bc0b9c2136c05769a3..3206e3ae64611c02abcfd6cc2e2a7b6f + void bindingCalled(JSC::JSGlobalObject* globalObject, const String& name, const String& arg); private: -- Inspector::InjectedScript injectedScriptForEval(Inspector::Protocol::ErrorString&, std::optional&&); -- void muteConsole(); -- void unmuteConsole(); -+ Inspector::InjectedScript injectedScriptForEval(Inspector::Protocol::ErrorString&, std::optional&&) override; -+ void muteConsole() override; -+ void unmuteConsole() override; - void reportExecutionContextCreation(); - void notifyContextCreated(const Inspector::Protocol::Network::FrameId&, JSC::JSGlobalObject*, const DOMWrapperWorld&, SecurityOrigin* = nullptr); - - std::unique_ptr m_frontendDispatcher; - RefPtr m_backendDispatcher; -- + Inspector::InjectedScript injectedScriptForEval(Inspector::Protocol::ErrorString&, std::optional&&); +@@ -76,6 +80,7 @@ private: InstrumentingAgents& m_instrumentingAgents; Page& m_inspectedPage; @@ -5585,10 +5085,10 @@ index 7efc7c39d4ea689063c3371c9d9f5d25e433b3ae..c18f0b38ef9a22b594b60287d6c205b1 protected: static SameSiteInfo sameSiteInfo(const Document&, IsForDOMCookieAccess = IsForDOMCookieAccess::No); diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp -index 5442846cef667a81cf7c08b1d653ee46d66812bb..d4390a1518dae85d067f7808ef0b06a54451c4c5 100644 +index 4e0baece02ae7ec1c6860d94678b840824d8409f..e6cfe18c89c3efbcec174e64a594d9cc38534cef 100644 --- a/Source/WebCore/loader/DocumentLoader.cpp +++ b/Source/WebCore/loader/DocumentLoader.cpp -@@ -765,8 +765,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc +@@ -764,8 +764,10 @@ void DocumentLoader::willSendRequest(ResourceRequest&& newRequest, const Resourc if (!didReceiveRedirectResponse) return completionHandler(WTFMove(newRequest)); @@ -5599,7 +5099,7 @@ index 5442846cef667a81cf7c08b1d653ee46d66812bb..d4390a1518dae85d067f7808ef0b06a5 switch (navigationPolicyDecision) { case NavigationPolicyDecision::IgnoreLoad: case NavigationPolicyDecision::LoadWillContinueInAnotherProcess: -@@ -1549,8 +1551,6 @@ void DocumentLoader::detachFromFrame() +@@ -1546,8 +1548,6 @@ void DocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess) if (!m_frame) return; @@ -5609,12 +5109,12 @@ index 5442846cef667a81cf7c08b1d653ee46d66812bb..d4390a1518dae85d067f7808ef0b06a5 } diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h -index 4c9176db0a582a075fb3d68c921dcd960c271e86..3363380982c54cea74bd853e2682068b5e8ea95a 100644 +index 68970ca45127aa96a96a1bb224a6a8b2f34e5724..6c3187aab3ec6cf6cdf21d8f3562783f2ae7ffdd 100644 --- a/Source/WebCore/loader/DocumentLoader.h +++ b/Source/WebCore/loader/DocumentLoader.h -@@ -187,9 +187,13 @@ public: +@@ -188,9 +188,13 @@ public: - WEBCORE_EXPORT virtual void detachFromFrame(); + WEBCORE_EXPORT virtual void detachFromFrame(LoadWillContinueInAnotherProcess); + virtual void replacedByFragmentNavigation(LocalFrame&) { } + @@ -5627,44 +5127,44 @@ index 4c9176db0a582a075fb3d68c921dcd960c271e86..3363380982c54cea74bd853e2682068b DocumentWriter& writer() const { return m_writer; } diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp -index e97907da3295916577044fc2d4503bc39e5359b3..22d43a8a2814486dea3e7ac3af4348d3d812bfe9 100644 +index 7bfcb7b610c7b61250bb342ad654e634976c0cda..cc2d93e2e3cea8964eb4e4572b926d58f9f7a10c 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp -@@ -1219,6 +1219,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat +@@ -1238,6 +1238,7 @@ void FrameLoader::loadInSameDocument(URL url, RefPtr stat } m_client->dispatchDidNavigateWithinPage(); + InspectorInstrumentation::didNavigateWithinPage(m_frame); - m_frame.document()->statePopped(stateObject ? stateObject.releaseNonNull() : SerializedScriptValue::nullValue()); + document->statePopped(stateObject ? stateObject.releaseNonNull() : SerializedScriptValue::nullValue()); m_client->dispatchDidPopStateWithinPage(); -@@ -1675,6 +1676,8 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1689,6 +1690,8 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t const String& httpMethod = loader->request().httpMethod(); if (shouldPerformFragmentNavigation(isFormSubmission, httpMethod, policyChecker().loadType(), newURL)) { + loader->replacedByFragmentNavigation(m_frame); + - RefPtr oldDocumentLoader = m_documentLoader; - NavigationAction action { *m_frame.document(), loader->request(), InitiatedByMainFrame::Unknown, policyChecker().loadType(), isFormSubmission }; + RefPtr oldDocumentLoader = m_documentLoader; + NavigationAction action { frame->protectedDocument().releaseNonNull(), loader->request(), InitiatedByMainFrame::Unknown, policyChecker().loadType(), isFormSubmission }; action.setIsRequestFromClientOrUserInput(loader->isRequestFromClientOrUserInput()); -@@ -1707,7 +1710,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t +@@ -1721,7 +1724,9 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t } RELEASE_ASSERT(!isBackForwardLoadType(policyChecker().loadType()) || history().provisionalItem()); + InspectorInstrumentation::willCheckNavigationPolicy(m_frame); - policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTFMove(formState), [this, protectedFrame = Ref { m_frame }, allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr&& formState, NavigationPolicyDecision navigationPolicyDecision) mutable { + policyChecker().checkNavigationPolicy(ResourceRequest(loader->request()), ResourceResponse { } /* redirectResponse */, loader, WTFMove(formState), [this, frame, allowNavigationToInvalidURL, completionHandler = completionHandlerCaller.release()] (const ResourceRequest& request, WeakPtr&& formState, NavigationPolicyDecision navigationPolicyDecision) mutable { + InspectorInstrumentation::didCheckNavigationPolicy(m_frame, navigationPolicyDecision != NavigationPolicyDecision::ContinueLoad); continueLoadAfterNavigationPolicy(request, formState.get(), navigationPolicyDecision, allowNavigationToInvalidURL); completionHandler(); }, PolicyDecisionMode::Asynchronous); -@@ -2967,14 +2972,19 @@ String FrameLoader::userAgent(const URL& url) const +@@ -2960,14 +2965,19 @@ String FrameLoader::userAgent(const URL& url) const String FrameLoader::navigatorPlatform() const { + String platform; + - if (auto* localFrame = dynamicDowncast(m_frame.mainFrame())) { - if (auto* documentLoader = localFrame->loader().activeDocumentLoader()) { + if (RefPtr localFrame = dynamicDowncast(m_frame->mainFrame())) { + if (RefPtr documentLoader = localFrame->loader().activeDocumentLoader()) { auto& customNavigatorPlatform = documentLoader->customNavigatorPlatform(); if (!customNavigatorPlatform.isEmpty()) - return customNavigatorPlatform; @@ -5679,44 +5179,44 @@ index e97907da3295916577044fc2d4503bc39e5359b3..22d43a8a2814486dea3e7ac3af4348d3 } void FrameLoader::dispatchOnloadEvents() -@@ -3401,6 +3411,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error) +@@ -3397,6 +3407,8 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error) checkCompleted(); - if (m_frame.page()) + if (frame->page()) checkLoadComplete(); + + InspectorInstrumentation::didReceiveMainResourceError(m_frame, error); } void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, const SecurityOrigin* requesterOrigin, bool shouldContinue) -@@ -4236,9 +4248,6 @@ String FrameLoader::referrer() const +@@ -4233,9 +4245,6 @@ String FrameLoader::referrer() const void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() { -- if (!m_frame.script().canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript)) +- if (!protectedFrame()->checkedScript()->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript)) - return; - Vector> worlds; ScriptController::getAllWorlds(worlds); for (auto& world : worlds) -@@ -4247,13 +4256,13 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() - +@@ -4245,13 +4254,12 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world) { -- if (!m_frame.script().canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript) || !m_frame.windowProxy().existingJSWindowProxy(world)) + Ref frame = m_frame.get(); +- if (!frame->checkedScript()->canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript) || !frame->windowProxy().existingJSWindowProxy(world)) - return; -+ if (m_frame.windowProxy().existingJSWindowProxy(world)) { -+ if (m_frame.script().canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript)) -+ m_client->dispatchDidClearWindowObjectInWorld(world); - +- - m_client->dispatchDidClearWindowObjectInWorld(world); - -- if (Page* page = m_frame.page()) -- page->inspectorController().didClearWindowObjectInWorld(m_frame, world); -+ if (Page* page = m_frame.page()) +- if (CheckedPtr page = frame->page()) +- page->inspectorController().didClearWindowObjectInWorld(frame, world); ++ if (frame->windowProxy().existingJSWindowProxy(world)) { ++ if (frame->script().canExecuteScripts(ReasonForCallingCanExecuteScripts::NotAboutToExecuteScript)) ++ m_client->dispatchDidClearWindowObjectInWorld(world); ++ if (Page* page = frame->page()) + page->inspectorController().didClearWindowObjectInWorld(m_frame, world); + } - InspectorInstrumentation::didClearWindowObjectInWorld(m_frame, world); + InspectorInstrumentation::didClearWindowObjectInWorld(frame, world); } diff --git a/Source/WebCore/loader/LoaderStrategy.h b/Source/WebCore/loader/LoaderStrategy.h index 91340dc21042f545592b442bc42dbceed06219b2..f3591fe333761b10a25ddaf4a4f8d72170dfe336 100644 @@ -5731,10 +5231,10 @@ index 91340dc21042f545592b442bc42dbceed06219b2..f3591fe333761b10a25ddaf4a4f8d721 virtual bool shouldPerformSecurityChecks() const { return false; } virtual bool havePerformedSecurityChecks(const ResourceResponse&) const { return false; } diff --git a/Source/WebCore/loader/NavigationScheduler.cpp b/Source/WebCore/loader/NavigationScheduler.cpp -index f2fd6e524daa7ec31bddf7b692777dccd1f62585..8252ebf7fdf96b44db3ea6f9c47a9ce8180ea3bd 100644 +index f356dd377950801b95ec0b9a6b4c93624fc0dcda..95e86435868b4e2937aa0dd799f9c23403c4f114 100644 --- a/Source/WebCore/loader/NavigationScheduler.cpp +++ b/Source/WebCore/loader/NavigationScheduler.cpp -@@ -682,7 +682,7 @@ void NavigationScheduler::startTimer() +@@ -684,7 +684,7 @@ void NavigationScheduler::startTimer() Seconds delay = 1_s * m_redirect->delay(); m_timer.startOneShot(delay); @@ -5744,10 +5244,10 @@ index f2fd6e524daa7ec31bddf7b692777dccd1f62585..8252ebf7fdf96b44db3ea6f9c47a9ce8 } diff --git a/Source/WebCore/loader/PolicyChecker.cpp b/Source/WebCore/loader/PolicyChecker.cpp -index 900ac50c29df6cfdbb9d66edee57eb2e213a2b92..fc8ed6120a4f7a030af0c3d55706f582ef7144dd 100644 +index a0898687ef06dc03fd085e1913c0eeb6f9825a99..9c8d10a43a87b5b8d1d18ca8c0a01d1fd883a719 100644 --- a/Source/WebCore/loader/PolicyChecker.cpp +++ b/Source/WebCore/loader/PolicyChecker.cpp -@@ -43,6 +43,7 @@ +@@ -44,6 +44,7 @@ #include "HTMLFormElement.h" #include "HTMLFrameOwnerElement.h" #include "HTMLPlugInElement.h" @@ -5778,10 +5278,10 @@ index 273f7815c6fd1553b78a117c78eaa460085d1272..ccf6e96daebad01d5bfabe5062d29c3a void ProgressTracker::incrementProgress(ResourceLoaderIdentifier identifier, const ResourceResponse& response) diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -index cc2916050d7bff5290dd8079d5b77c68c6dd4649..94622e922f4624a4d07896a9983901e4c91d1a79 100644 +index 572b79810788c792af10b5e51cce7a5ff88bf401..2fc289c5af45e5d8ec55c93c7f1938a31fecb703 100644 --- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp +++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp -@@ -1025,8 +1025,11 @@ ResourceErrorOr> CachedResourceLoader::requ +@@ -1021,8 +1021,11 @@ ResourceErrorOr> CachedResourceLoader::requ request.updateReferrerPolicy(document() ? document()->referrerPolicy() : ReferrerPolicy::Default); @@ -5795,7 +5295,7 @@ index cc2916050d7bff5290dd8079d5b77c68c6dd4649..94622e922f4624a4d07896a9983901e4 auto& page = *frame.page(); -@@ -1678,8 +1681,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const +@@ -1629,8 +1632,9 @@ Vector> CachedResourceLoader::allCachedSVGImages() const ResourceErrorOr> CachedResourceLoader::preload(CachedResource::Type type, CachedResourceRequest&& request) { @@ -5808,10 +5308,10 @@ index cc2916050d7bff5290dd8079d5b77c68c6dd4649..94622e922f4624a4d07896a9983901e4 ASSERT(m_document); if (request.charset().isEmpty() && m_document && (type == CachedResource::Type::Script || type == CachedResource::Type::CSSStyleSheet)) diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h -index de70dc20b757150c82c5327fc151742331f1f305..e7eba51632049fe0264faf10837491873bd78286 100644 +index 4b2ec877f96a384b80709ee24d204cc12f59b178..33b94b530772de73d269a40055744d773a4b2087 100644 --- a/Source/WebCore/page/ChromeClient.h +++ b/Source/WebCore/page/ChromeClient.h -@@ -325,7 +325,7 @@ public: +@@ -328,7 +328,7 @@ public: #endif #if ENABLE(ORIENTATION_EVENTS) @@ -5821,202 +5321,51 @@ index de70dc20b757150c82c5327fc151742331f1f305..e7eba51632049fe0264faf1083749187 #if ENABLE(INPUT_TYPE_COLOR) diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp -index f34a453825002e7e176ab07f83d38cee4fe312d9..5bf4e02dfe2f77593199615afb5ff4777d44fb73 100644 +index 9a5b33498e58e12cd2702c6baa44276e5cb2cc52..f60bfa86739a58d87243f882ee7dbba280832542 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp -@@ -145,6 +145,7 @@ - - #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) - #include "PlatformTouchEvent.h" -+#include "PointerCaptureController.h" - #endif - - #if ENABLE(MAC_GESTURE_EVENTS) -@@ -856,9 +857,7 @@ bool EventHandler::handleMousePressEvent(const MouseEventWithHitTestResults& eve - m_mousePressNode = event.targetNode(); - m_frame.document()->setFocusNavigationStartingNode(event.targetNode()); - --#if ENABLE(DRAG_SUPPORT) - m_dragStartPosition = event.event().position(); --#endif - - m_mousePressed = true; - m_selectionInitiationState = HaveNotStartedSelection; -@@ -898,8 +897,6 @@ VisiblePosition EventHandler::selectionExtentRespectingEditingBoundary(const Vis - return adjustedTarget->renderer()->positionForPoint(LayoutPoint(selectionEndPoint), nullptr); - } - --#if ENABLE(DRAG_SUPPORT) -- - #if !PLATFORM(IOS_FAMILY) - - bool EventHandler::supportsSelectionUpdatesOnMouseDrag() const -@@ -921,8 +918,10 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e - - Ref protectedFrame(m_frame); - -+#if ENABLE(DRAG_SUPPORT) - if (handleDrag(event, checkDragHysteresis)) - return true; -+#endif - - RefPtr targetNode = event.targetNode(); - if (event.event().button() != LeftButton || !targetNode) -@@ -943,7 +942,9 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e - ASSERT(mouseDownMayStartSelect() || m_mouseDownMayStartAutoscroll); - #endif - -+#if ENABLE(DRAG_SUPPORT) - m_mouseDownMayStartDrag = false; -+#endif - - if (m_mouseDownMayStartAutoscroll && !panScrollInProgress()) { - m_autoscrollController->startAutoscrollForSelection(renderer); -@@ -960,6 +961,8 @@ bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& e - return true; - } - -+#if ENABLE(DRAG_SUPPORT) -+ - bool EventHandler::eventMayStartDrag(const PlatformMouseEvent& event) const - { - // This is a pre-flight check of whether the event might lead to a drag being started. Be careful -@@ -991,6 +994,8 @@ bool EventHandler::eventMayStartDrag(const PlatformMouseEvent& event) const - return targetElement && page->dragController().draggableElement(&m_frame, targetElement.get(), result.roundedPointInInnerNodeFrame(), state); - } - -+#endif // ENABLE(DRAG_SUPPORT) -+ - void EventHandler::updateSelectionForMouseDrag() - { - if (!supportsSelectionUpdatesOnMouseDrag()) -@@ -1099,7 +1104,6 @@ void EventHandler::updateSelectionForMouseDrag(const HitTestResult& hitTestResul - if (oldSelection != newSelection && ImageOverlay::isOverlayText(newSelection.start().containerNode()) && ImageOverlay::isOverlayText(newSelection.end().containerNode())) - invalidateClick(); - } --#endif // ENABLE(DRAG_SUPPORT) - - void EventHandler::lostMouseCapture() - { -@@ -1147,9 +1151,7 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e - // on the selection, the selection goes away. However, if we are - // editing, place the caret. - if (m_mouseDownWasSingleClickInSelection && m_selectionInitiationState != ExtendedSelection --#if ENABLE(DRAG_SUPPORT) - && m_dragStartPosition == event.event().position() --#endif - && m_frame.selection().isRange() - && event.event().button() != RightButton) { - VisibleSelection newSelection; -@@ -2148,10 +2150,8 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& platformMouseE - - swallowEvent = !dispatchMouseEvent(eventNames().mousemoveEvent, mouseEvent.targetNode(), 0, platformMouseEvent, FireMouseOverOut::Yes); - --#if ENABLE(DRAG_SUPPORT) - if (!swallowEvent) - swallowEvent = handleMouseDraggedEvent(mouseEvent); --#endif - - return swallowEvent; - } -@@ -4246,7 +4246,14 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr - if (!m_frame.document()) +@@ -4313,6 +4313,12 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event, CheckDr + if (!document) return false; -- dragState().dataTransfer = DataTransfer::createForDrag(*m_frame.document()); +#if PLATFORM(MAC) -+ auto* page = m_frame.page(); ++ auto* page = m_frame->page(); + if (page && !page->overrideDragPasteboardName().isEmpty()) -+ dragState().dataTransfer = DataTransfer::createForDrag(*m_frame.document(), page->overrideDragPasteboardName()); ++ dragState().dataTransfer = DataTransfer::createForDrag(*document, page->overrideDragPasteboardName()); + else +#endif -+ dragState().dataTransfer = DataTransfer::createForDrag(*m_frame.document()); -+ + dragState().dataTransfer = DataTransfer::createForDrag(*document); auto hasNonDefaultPasteboardData = HasNonDefaultPasteboardData::No; - if (dragState().shouldDispatchEvents) { -@@ -4931,11 +4938,6 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) - document.page()->pointerCaptureController().dispatchEventForTouchAtIndex( - *touchTarget, cancelEvent, index, !index, *document.windowProxy(), { 0, 0 }); - } -- -- // FIXME: Pass the touch delta for pointermove events by remembering the position per pointerID similar to -- // Apple's m_touchLastGlobalPositionAndDeltaMap -- document.page()->pointerCaptureController().dispatchEventForTouchAtIndex( -- *pointerTarget, event, index, !index, *document.windowProxy(), { 0, 0 }); +@@ -4914,7 +4920,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve + + // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap. + unsigned touchPointTargetKey = point.id() + 1; +-#if PLATFORM(WPE) ++#if !ENABLE(IOS_TOUCH_EVENTS) + bool pointerCancelled = false; #endif + RefPtr touchTarget; +@@ -4961,7 +4967,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve + // we also remove it from the map. + touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey); - if (&m_frame != targetFrame) { -@@ -4977,6 +4979,9 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) - changedTouches[pointState].m_touches->append(WTFMove(touch)); - changedTouches[pointState].m_targets.add(touchTarget); - } -+ document.page()->pointerCaptureController().dispatchEventForTouchAtIndex( -+ *touchTarget, event, index, index == 0, *document.windowProxy(), IntPoint::zero()); -+ - } - m_touchPressed = touches->length() > 0; - if (allTouchReleased) -diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h -index 13dd8153250bb5c4a26fe8ed5411b6ff8b8694b2..46ae6da891196750275b2eff404117712a190903 100644 ---- a/Source/WebCore/page/EventHandler.h -+++ b/Source/WebCore/page/EventHandler.h -@@ -138,9 +138,7 @@ public: +-#if PLATFORM(WPE) ++#if !ENABLE(IOS_TOUCH_EVENTS) + HitTestResult result = hitTestResultAtPoint(pagePoint, hitType | HitTestRequest::Type::AllowChildFrameContent); + pointerTarget = result.targetElement(); + pointerCancelled = (pointerTarget != touchTarget); +@@ -4983,7 +4989,7 @@ HandleUserInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEve + if (!targetFrame) + continue; - WEBCORE_EXPORT VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection&, const LayoutPoint&, Node*); - --#if ENABLE(DRAG_SUPPORT) - void updateSelectionForMouseDrag(); --#endif - - #if ENABLE(PAN_SCROLLING) - void didPanScrollStart(); -@@ -405,10 +403,8 @@ private: - bool startKeyboardScrollAnimationOnRenderBoxAndItsAncestors(ScrollDirection, ScrollGranularity, RenderBox*, bool isKeyRepeat); - bool startKeyboardScrollAnimationOnEnclosingScrollableContainer(ScrollDirection, ScrollGranularity, Node*, bool isKeyRepeat); - --#if ENABLE(DRAG_SUPPORT) - bool handleMouseDraggedEvent(const MouseEventWithHitTestResults&, CheckDragHysteresis = ShouldCheckDragHysteresis); - bool shouldAllowMouseDownToStartDrag() const; --#endif - - WEBCORE_EXPORT bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&); - -@@ -510,10 +506,8 @@ private: - void defaultTabEventHandler(KeyboardEvent&); - void defaultArrowEventHandler(FocusDirection, KeyboardEvent&); - --#if ENABLE(DRAG_SUPPORT) - OptionSet updateDragSourceActionsAllowed() const; - bool supportsSelectionUpdatesOnMouseDrag() const; --#endif - - // The following are called at the beginning of handleMouseUp and handleDrag. - // If they return true it indicates that they have consumed the event. -@@ -521,9 +515,10 @@ private: - - #if ENABLE(DRAG_SUPPORT) - bool eventLoopHandleMouseDragged(const MouseEventWithHitTestResults&); -- void updateSelectionForMouseDrag(const HitTestResult&); - #endif - -+ void updateSelectionForMouseDrag(const HitTestResult&); -+ - enum class SetOrClearLastScrollbar { Clear, Set }; - void updateLastScrollbarUnderMouse(Scrollbar*, SetOrClearLastScrollbar); - -@@ -616,8 +611,8 @@ private: - Timer m_autoHideCursorTimer; - #endif - --#if ENABLE(DRAG_SUPPORT) - LayoutPoint m_dragStartPosition; -+#if ENABLE(DRAG_SUPPORT) - std::optional m_dragStartSelection; - RefPtr m_dragTarget; - bool m_mouseDownMayStartDrag { false }; +-#if PLATFORM(WPE) ++#if !ENABLE(IOS_TOUCH_EVENTS) + // 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) { diff --git a/Source/WebCore/page/FrameSnapshotting.cpp b/Source/WebCore/page/FrameSnapshotting.cpp -index d62d41b79f148cee977447f740bd6a768b159b0c..2d16d7243788ef876487d741caddc4a71cb5425f 100644 +index 7ee2659df6aca0f84b61cb0de78ba9518b65b61e..0f09634cc4e679742b64a29506e2bd65e73c6fe9 100644 --- a/Source/WebCore/page/FrameSnapshotting.cpp +++ b/Source/WebCore/page/FrameSnapshotting.cpp @@ -109,7 +109,7 @@ RefPtr snapshotFrameRectWithClip(LocalFrame& frame, const IntRect& @@ -6076,7 +5425,7 @@ index 5f85bb24166b1c1805323fcbb34144be3191643b..09d2782e3961d70b9483a77e0c12923b struct SnapshotOptions { diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp -index a6537109eeecdeb6d541fff3469c3c8f3a061ca2..d8fa86589e6d0ddcb3f84f2d6afed722c7454fd0 100644 +index 9be81a19a86aa3ae53aa975cbad81d928f97fa34..56b513e3e0cba167c6e52559f95f7ba4edf5a0d9 100644 --- a/Source/WebCore/page/History.cpp +++ b/Source/WebCore/page/History.cpp @@ -31,6 +31,7 @@ @@ -6096,7 +5445,7 @@ index a6537109eeecdeb6d541fff3469c3c8f3a061ca2..d8fa86589e6d0ddcb3f84f2d6afed722 if (stateObjectType == StateObjectType::Push) { frame->loader().history().pushState(WTFMove(data), title, fullURL.string()); diff --git a/Source/WebCore/page/LocalFrame.cpp b/Source/WebCore/page/LocalFrame.cpp -index 0efefdcb28dd9083c99b16e719ea100fb1352dcf..8400b6cf505342727cca716330f87807d5be9e30 100644 +index d5e55947c84cce0f08b9b2973ad164cd0d04792b..bc4886923eb9a978b7059764647585ef61162aeb 100644 --- a/Source/WebCore/page/LocalFrame.cpp +++ b/Source/WebCore/page/LocalFrame.cpp @@ -40,6 +40,7 @@ @@ -6112,10 +5461,10 @@ index 0efefdcb28dd9083c99b16e719ea100fb1352dcf..8400b6cf505342727cca716330f87807 #include "GraphicsContext.h" #include "GraphicsLayer.h" +#include "HTMLAreaElement.h" + #include "HTMLAttachmentElement.h" #include "HTMLFormControlElement.h" #include "HTMLFormElement.h" - #include "HTMLFrameElementBase.h" -@@ -74,6 +76,7 @@ +@@ -75,6 +77,7 @@ #include "Logging.h" #include "Navigator.h" #include "NodeList.h" @@ -6123,26 +5472,26 @@ index 0efefdcb28dd9083c99b16e719ea100fb1352dcf..8400b6cf505342727cca716330f87807 #include "NodeTraversal.h" #include "Page.h" #include "ProcessWarming.h" -@@ -173,6 +176,7 @@ LocalFrame::LocalFrame(Page& page, UniqueRef&& frameLoad +@@ -178,6 +181,7 @@ LocalFrame::LocalFrame(Page& page, UniqueRef&& frameLoad void LocalFrame::init() { + InspectorInstrumentation::frameAttached(this); - m_loader->init(); + checkedLoader()->init(); } -@@ -381,7 +385,7 @@ void LocalFrame::orientationChanged() +@@ -406,7 +410,7 @@ void LocalFrame::orientationChanged() IntDegrees LocalFrame::orientation() const { - if (auto* page = this->page()) + if (CheckedPtr page = this->page()) - return page->chrome().client().deviceOrientation(); + return page->orientation(); return 0; } #endif // ENABLE(ORIENTATION_EVENTS) -@@ -1182,6 +1186,362 @@ DataDetectionResultsStorage& LocalFrame::dataDetectionResults() - - #endif +@@ -1281,6 +1285,362 @@ void LocalFrame::frameWasDisconnectedFromOwner() const + protectedDocument()->detachFromFrame(); + } +#if !PLATFORM(IOS_FAMILY) + @@ -6477,7 +5826,7 @@ index 0efefdcb28dd9083c99b16e719ea100fb1352dcf..8400b6cf505342727cca716330f87807 + if (!renderer) + continue; + -+ if ((renderer->isTextField() || renderer->isTextArea()) && downcast(*renderer).canScroll()) { ++ if ((renderer->isRenderTextControlSingleLine() || renderer->isRenderTextControlMultiLine()) && downcast(*renderer).canScroll()) { + scrollingAncestor = node; + continue; + } @@ -6504,7 +5853,7 @@ index 0efefdcb28dd9083c99b16e719ea100fb1352dcf..8400b6cf505342727cca716330f87807 #undef FRAME_RELEASE_LOG_ERROR diff --git a/Source/WebCore/page/LocalFrame.h b/Source/WebCore/page/LocalFrame.h -index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e54f621bc 100644 +index f69e87d269b6451a5767d9c8edb09488aec61569..c71dacc6ba37e45dac568d714b4dfc70c713d637 100644 --- a/Source/WebCore/page/LocalFrame.h +++ b/Source/WebCore/page/LocalFrame.h @@ -28,8 +28,10 @@ @@ -6517,8 +5866,8 @@ index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e +#include "IntDegrees.h" #include "ScrollTypes.h" #include "UserScriptTypes.h" - #include -@@ -69,7 +71,6 @@ namespace WebCore { + #include +@@ -70,7 +72,6 @@ namespace WebCore { class Color; class LocalDOMWindow; class DataDetectionResultsStorage; @@ -6526,7 +5875,7 @@ index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e class Editor; class Element; class EventHandler; -@@ -108,8 +109,8 @@ enum { +@@ -109,8 +110,8 @@ enum { }; enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll }; @@ -6536,7 +5885,7 @@ index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e class LocalFrame final : public Frame { public: -@@ -201,10 +202,6 @@ public: +@@ -217,10 +218,6 @@ public: WEBCORE_EXPORT DataDetectionResultsStorage& dataDetectionResults(); #endif @@ -6547,7 +5896,7 @@ index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e 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); -@@ -212,6 +209,10 @@ public: +@@ -228,6 +225,10 @@ public: WEBCORE_EXPORT Node* nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation); WEBCORE_EXPORT Node* approximateNodeAtViewportLocationLegacy(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation); @@ -6558,7 +5907,7 @@ index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e WEBCORE_EXPORT NSArray *wordsInCurrentParagraph() const; WEBCORE_EXPORT CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const; -@@ -279,6 +280,7 @@ public: +@@ -295,6 +296,7 @@ public: WEBCORE_EXPORT FloatSize screenSize() const; void setOverrideScreenSize(FloatSize&&); @@ -6566,7 +5915,7 @@ index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e void selfOnlyRef(); void selfOnlyDeref(); -@@ -315,7 +317,6 @@ private: +@@ -340,7 +342,6 @@ private: #if ENABLE(DATA_DETECTION) std::unique_ptr m_dataDetectionResults; #endif @@ -6574,7 +5923,7 @@ index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e 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); -@@ -323,6 +324,7 @@ private: +@@ -348,6 +349,7 @@ private: enum class ShouldFindRootEditableElement : bool { No, Yes }; Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, const NodeQualifier&, ShouldApproximate, ShouldFindRootEditableElement = ShouldFindRootEditableElement::Yes); @@ -6583,10 +5932,10 @@ index 95458a16c7d0fd5e30ef8db0b84f8ff951a95e0b..292763c72ebf7f41b0447ba09117c28e ViewportArguments m_viewportArguments; diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp -index 39ffd9497dc9ef93f770f3eb8d2a492b59f76af1..fce232374cc127be90a273563f4838a56f8e85c7 100644 +index 3dcdd8d49ae63683286b1277775edc8819bcc4ca..3a1315ab496cb6370223ce0cae8dc3e6d063c847 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp -@@ -526,6 +526,45 @@ void Page::setOverrideViewportArguments(const std::optional& +@@ -542,6 +542,45 @@ void Page::setOverrideViewportArguments(const std::optional& document->updateViewportArguments(); } @@ -6632,7 +5981,7 @@ index 39ffd9497dc9ef93f770f3eb8d2a492b59f76af1..fce232374cc127be90a273563f4838a5 ScrollingCoordinator* Page::scrollingCoordinator() { if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled()) { -@@ -3753,6 +3792,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) +@@ -3795,6 +3834,26 @@ void Page::setUseDarkAppearanceOverride(std::optional valueOverride) #endif } @@ -6660,7 +6009,7 @@ index 39ffd9497dc9ef93f770f3eb8d2a492b59f76af1..fce232374cc127be90a273563f4838a5 { if (insets == m_fullscreenInsets) diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h -index 0941d8324e74a84b140441863c13bcabdc411c0e..eb91d294bacdb9e9078f8c5d53ff76db6165e9d4 100644 +index 4b71175319210a81fefba2112be1c068a923aade..0eb7a3d575c0d77a4e9ef95e9f8b05b10d33fe77 100644 --- a/Source/WebCore/page/Page.h +++ b/Source/WebCore/page/Page.h @@ -309,6 +309,9 @@ public: @@ -6673,7 +6022,7 @@ index 0941d8324e74a84b140441863c13bcabdc411c0e..eb91d294bacdb9e9078f8c5d53ff76db static void refreshPlugins(bool reload); WEBCORE_EXPORT PluginData& pluginData(); void clearPluginData(); -@@ -370,6 +373,10 @@ public: +@@ -372,6 +375,10 @@ public: #if ENABLE(DRAG_SUPPORT) DragController& dragController() { return m_dragController.get(); } const DragController& dragController() const { return m_dragController.get(); } @@ -6684,7 +6033,7 @@ index 0941d8324e74a84b140441863c13bcabdc411c0e..eb91d294bacdb9e9078f8c5d53ff76db #endif FocusController& focusController() const { return *m_focusController; } #if ENABLE(CONTEXT_MENUS) -@@ -539,6 +546,10 @@ public: +@@ -547,6 +554,10 @@ public: WEBCORE_EXPORT void effectiveAppearanceDidChange(bool useDarkAppearance, bool useElevatedUserInterfaceLevel); bool defaultUseDarkAppearance() const { return m_useDarkAppearance; } void setUseDarkAppearanceOverride(std::optional); @@ -6695,7 +6044,7 @@ index 0941d8324e74a84b140441863c13bcabdc411c0e..eb91d294bacdb9e9078f8c5d53ff76db #if ENABLE(TEXT_AUTOSIZING) float textAutosizingWidth() const { return m_textAutosizingWidth; } -@@ -976,6 +987,11 @@ public: +@@ -990,6 +1001,11 @@ public: WEBCORE_EXPORT void setInteractionRegionsEnabled(bool); #endif @@ -6707,7 +6056,7 @@ index 0941d8324e74a84b140441863c13bcabdc411c0e..eb91d294bacdb9e9078f8c5d53ff76db #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY) DeviceOrientationUpdateProvider* deviceOrientationUpdateProvider() const { return m_deviceOrientationUpdateProvider.get(); } #endif -@@ -1115,6 +1131,9 @@ private: +@@ -1140,6 +1156,9 @@ private: #if ENABLE(DRAG_SUPPORT) UniqueRef m_dragController; @@ -6717,7 +6066,7 @@ index 0941d8324e74a84b140441863c13bcabdc411c0e..eb91d294bacdb9e9078f8c5d53ff76db #endif std::unique_ptr m_focusController; #if ENABLE(CONTEXT_MENUS) -@@ -1195,6 +1214,8 @@ private: +@@ -1217,6 +1236,8 @@ private: bool m_useElevatedUserInterfaceLevel { false }; bool m_useDarkAppearance { false }; std::optional m_useDarkAppearanceOverride; @@ -6726,7 +6075,7 @@ index 0941d8324e74a84b140441863c13bcabdc411c0e..eb91d294bacdb9e9078f8c5d53ff76db #if ENABLE(TEXT_AUTOSIZING) float m_textAutosizingWidth { 0 }; -@@ -1370,6 +1391,11 @@ private: +@@ -1393,6 +1414,11 @@ private: #endif std::optional m_overrideViewportArguments; @@ -6754,10 +6103,10 @@ index 6fe30e064c50097f90b06ac7facbd0717d6a873b..81e3e8c19771fc6e0fbed5d55303517b + } // namespace WebCore diff --git a/Source/WebCore/page/PageConsoleClient.h b/Source/WebCore/page/PageConsoleClient.h -index 9a6549a792bf95f6d5671289bc58be259ec73732..03a6ceb14a18b3b74e8544a98fb858416b645e71 100644 +index 78e95133279568ae6fefe8a127acd9a600cc1a69..27acfbe94471bfae33e689a965a3f14ddee26b0a 100644 --- a/Source/WebCore/page/PageConsoleClient.h +++ b/Source/WebCore/page/PageConsoleClient.h -@@ -81,6 +81,7 @@ private: +@@ -82,6 +82,7 @@ private: void record(JSC::JSGlobalObject*, Ref&&) override; void recordEnd(JSC::JSGlobalObject*, Ref&&) override; void screenshot(JSC::JSGlobalObject*, Ref&&) override; @@ -6766,7 +6115,7 @@ index 9a6549a792bf95f6d5671289bc58be259ec73732..03a6ceb14a18b3b74e8544a98fb85841 Page& m_page; }; diff --git a/Source/WebCore/page/PointerCaptureController.cpp b/Source/WebCore/page/PointerCaptureController.cpp -index bd147a1fee46d2f228c115230f8d071dc303756c..b06dce53e787d95c6b89c01511084f95175764b7 100644 +index 7adcd916dad40b21aea036b02c79ab615b8bf90a..228c0081a4a73ae4ba6feea5cd734ceacfebb824 100644 --- a/Source/WebCore/page/PointerCaptureController.cpp +++ b/Source/WebCore/page/PointerCaptureController.cpp @@ -195,7 +195,7 @@ bool PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(Poi @@ -6778,7 +6127,7 @@ index bd147a1fee46d2f228c115230f8d071dc303756c..b06dce53e787d95c6b89c01511084f95 static bool hierarchyHasCapturingEventListeners(Element* target, const AtomString& eventName) { for (RefPtr currentNode = target; currentNode; currentNode = currentNode->parentInComposedTree()) { -@@ -474,7 +474,7 @@ void PointerCaptureController::cancelPointer(PointerID pointerId, const IntPoint +@@ -499,7 +499,7 @@ void PointerCaptureController::cancelPointer(PointerID pointerId, const IntPoint capturingData->pendingTargetOverride = nullptr; capturingData->state = CapturingData::State::Cancelled; @@ -6788,10 +6137,10 @@ index bd147a1fee46d2f228c115230f8d071dc303756c..b06dce53e787d95c6b89c01511084f95 #endif diff --git a/Source/WebCore/page/PointerCaptureController.h b/Source/WebCore/page/PointerCaptureController.h -index 9ec307bf796452e21c695116d1f678e1d9916709..b47ed65e85cf9cbb0d32d6199a9b1c1c0681dfcb 100644 +index 91a9847a4083393e225f42e71c2dd590a88c0289..b0838c84e4ba24378db42f40a68856afe95fb9a7 100644 --- a/Source/WebCore/page/PointerCaptureController.h +++ b/Source/WebCore/page/PointerCaptureController.h -@@ -57,7 +57,7 @@ public: +@@ -58,7 +58,7 @@ public: RefPtr pointerEventForMouseEvent(const MouseEvent&, PointerID, const String& pointerType); @@ -6800,7 +6149,7 @@ index 9ec307bf796452e21c695116d1f678e1d9916709..b47ed65e85cf9cbb0d32d6199a9b1c1c void dispatchEventForTouchAtIndex(EventTarget&, const PlatformTouchEvent&, unsigned, bool isPrimary, WindowProxy&, const IntPoint&); #endif -@@ -77,12 +77,12 @@ private: +@@ -78,12 +78,12 @@ private: RefPtr pendingTargetOverride; RefPtr targetOverride; @@ -6816,7 +6165,7 @@ index 9ec307bf796452e21c695116d1f678e1d9916709..b47ed65e85cf9cbb0d32d6199a9b1c1c #endif ; diff --git a/Source/WebCore/page/Screen.cpp b/Source/WebCore/page/Screen.cpp -index 11af362d3018851cb8258419f3e0d3e01ea369c0..9ec64d3c88bf37ad423aa613bae557d7a65c06fa 100644 +index d70607f79cd3e975f834e680c0540e558553c483..cbcaf6b64dff68713594cbd3d9d607a23ef6b900 100644 --- a/Source/WebCore/page/Screen.cpp +++ b/Source/WebCore/page/Screen.cpp @@ -110,6 +110,9 @@ int Screen::availLeft() const @@ -6860,14 +6209,14 @@ index 11af362d3018851cb8258419f3e0d3e01ea369c0..9ec64d3c88bf37ad423aa613bae557d7 } diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp -index cce7a25b8c69999670a38a05a7ce4fbf94132634..0ad60e920e5bdb6c5de7518bfd4d3076d5a70e38 100644 +index ca9c9582365de350649a0ab9e5e88bacc63d26de..da48770a91b0b391505444433c495ae4ae7dce37 100644 --- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp +++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp @@ -336,6 +336,8 @@ bool ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtoc template typename std::enable_if::value, bool>::type ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, Predicate&& predicate, Args&&... args) const { -+ if (InspectorInstrumentation::shouldBypassCSP(m_scriptExecutionContext)) ++ if (InspectorInstrumentation::shouldBypassCSP(m_scriptExecutionContext.get())) + return true; bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; for (auto& policy : m_policies) { @@ -6876,7 +6225,7 @@ index cce7a25b8c69999670a38a05a7ce4fbf94132634..0ad60e920e5bdb6c5de7518bfd4d3076 template bool ContentSecurityPolicy::allPoliciesWithDispositionAllow(Disposition disposition, ViolatedDirectiveCallback&& callback, Predicate&& predicate, Args&&... args) const { -+ if (InspectorInstrumentation::shouldBypassCSP(m_scriptExecutionContext)) ++ if (InspectorInstrumentation::shouldBypassCSP(m_scriptExecutionContext.get())) + return true; bool isReportOnly = disposition == ContentSecurityPolicy::Disposition::ReportOnly; bool isAllowed = true; @@ -6885,7 +6234,7 @@ index cce7a25b8c69999670a38a05a7ce4fbf94132634..0ad60e920e5bdb6c5de7518bfd4d3076 template bool ContentSecurityPolicy::allPoliciesAllow(ViolatedDirectiveCallback&& callback, Predicate&& predicate, Args&&... args) const { -+ if (InspectorInstrumentation::shouldBypassCSP(m_scriptExecutionContext)) ++ if (InspectorInstrumentation::shouldBypassCSP(m_scriptExecutionContext.get())) + return true; bool isAllowed = true; for (auto& policy : m_policies) { @@ -6989,7 +6338,7 @@ index e5f739288d77ed77c32fc538371637aea8370b7f..bc4c3cb723f733b8fd9683e15c91e13c ) diff --git a/Source/WebCore/platform/DragData.h b/Source/WebCore/platform/DragData.h -index c77ddd17643628a87c0245ee2ea3ba417d40bc23..c5179ff48e57cdcfbe709a10bae517ff2b9bdc17 100644 +index 35cce31f0f77478754a7859c16f42b6a7ec6edda..03660bd492fad8863aeb21d73a54e7b914147f09 100644 --- a/Source/WebCore/platform/DragData.h +++ b/Source/WebCore/platform/DragData.h @@ -47,7 +47,7 @@ typedef void* DragDataRef; @@ -7012,7 +6361,7 @@ index c77ddd17643628a87c0245ee2ea3ba417d40bc23..c5179ff48e57cdcfbe709a10bae517ff void getDragFileDescriptorData(int& size, String& pathname); void getDragFileContentData(int size, void* dataBlob); #endif -@@ -140,7 +140,7 @@ private: +@@ -141,7 +141,7 @@ private: String m_pasteboardName; #endif #if PLATFORM(WIN) @@ -7022,10 +6371,10 @@ index c77ddd17643628a87c0245ee2ea3ba417d40bc23..c5179ff48e57cdcfbe709a10bae517ff bool m_disallowFileAccess { false }; }; diff --git a/Source/WebCore/platform/DragImage.cpp b/Source/WebCore/platform/DragImage.cpp -index 550600c6f370af1b71a896d4fa3ef5a871a48c19..35d125361b7fa892cf863352bf0bd7131325ff38 100644 +index 9b613ca69af779a1e52b6a66216b0905809262dc..cd48a3551ae8da7702154798fcc6ab4df00f7f7f 100644 --- a/Source/WebCore/platform/DragImage.cpp +++ b/Source/WebCore/platform/DragImage.cpp -@@ -279,7 +279,7 @@ DragImage::~DragImage() +@@ -280,7 +280,7 @@ DragImage::~DragImage() deleteDragImage(m_dragImageRef); } @@ -7035,7 +6384,7 @@ index 550600c6f370af1b71a896d4fa3ef5a871a48c19..35d125361b7fa892cf863352bf0bd713 IntSize dragImageSize(DragImageRef) { diff --git a/Source/WebCore/platform/Pasteboard.h b/Source/WebCore/platform/Pasteboard.h -index 39f37fc92f9be35cd3164b8a10b063fe270610ea..13523a3ca41e8ae264ba4b0d823a72208f2fc077 100644 +index ac1b5e50c8f22dfb41862cfc4e94130f5238de39..589bec3a70f3fedd42ffca6428b17e186e0e38a9 100644 --- a/Source/WebCore/platform/Pasteboard.h +++ b/Source/WebCore/platform/Pasteboard.h @@ -44,7 +44,7 @@ OBJC_CLASS NSString; @@ -7056,7 +6405,7 @@ index 39f37fc92f9be35cd3164b8a10b063fe270610ea..13523a3ca41e8ae264ba4b0d823a7220 String markup; #endif }; -@@ -193,6 +193,11 @@ public: +@@ -197,6 +197,11 @@ public: #endif #endif @@ -7068,7 +6417,7 @@ index 39f37fc92f9be35cd3164b8a10b063fe270610ea..13523a3ca41e8ae264ba4b0d823a7220 #if PLATFORM(WIN) explicit Pasteboard(std::unique_ptr&&, IDataObject*); explicit Pasteboard(std::unique_ptr&&, WCDataObject*); -@@ -260,6 +265,12 @@ public: +@@ -264,6 +269,12 @@ public: int64_t changeCount() const; #endif @@ -7081,7 +6430,7 @@ index 39f37fc92f9be35cd3164b8a10b063fe270610ea..13523a3ca41e8ae264ba4b0d823a7220 #if PLATFORM(IOS_FAMILY) explicit Pasteboard(std::unique_ptr&&, int64_t changeCount); explicit Pasteboard(std::unique_ptr&&, const String& pasteboardName); -@@ -296,6 +307,7 @@ public: +@@ -300,6 +311,7 @@ public: COMPtr dataObject() const { return m_dataObject; } WEBCORE_EXPORT void setExternalDataObject(IDataObject*); const DragDataMap& dragDataMap() const { return m_dragDataMap; } @@ -7089,7 +6438,7 @@ index 39f37fc92f9be35cd3164b8a10b063fe270610ea..13523a3ca41e8ae264ba4b0d823a7220 void writeURLToWritableDataObject(const URL&, const String&); COMPtr writableDataObject() const { return m_writableDataObject; } void writeImageToDataObject(Element&, const URL&); // FIXME: Layering violation. -@@ -348,6 +360,10 @@ private: +@@ -352,6 +364,10 @@ private: int64_t m_changeCount { 0 }; #endif @@ -7100,7 +6449,7 @@ index 39f37fc92f9be35cd3164b8a10b063fe270610ea..13523a3ca41e8ae264ba4b0d823a7220 #if PLATFORM(COCOA) String m_pasteboardName; int64_t m_changeCount; -@@ -363,6 +379,7 @@ private: +@@ -367,6 +383,7 @@ private: COMPtr m_dataObject; COMPtr m_writableDataObject; DragDataMap m_dragDataMap; @@ -7129,7 +6478,7 @@ index 4aa768e1c2a8da63004f34ccbf0d347b2484c37b..515c99ed21cde6c157bb9a1378a78372 #endif diff --git a/Source/WebCore/platform/PlatformScreen.cpp b/Source/WebCore/platform/PlatformScreen.cpp -index 8c8bc5f6060e10b59cacc92765542c85407f3c1b..fad09775881af6d15e16256a90e3c89d2b968d16 100644 +index 39fbdb1be924da33344ac10293798b2abde2e468..caa6421a1c1b616e2eac7cc8645cffd9f27d54bb 100644 --- a/Source/WebCore/platform/PlatformScreen.cpp +++ b/Source/WebCore/platform/PlatformScreen.cpp @@ -25,6 +25,7 @@ @@ -7140,7 +6489,7 @@ index 8c8bc5f6060e10b59cacc92765542c85407f3c1b..fad09775881af6d15e16256a90e3c89d #if PLATFORM(COCOA) || PLATFORM(GTK) -@@ -72,3 +73,25 @@ const ScreenData* screenData(PlatformDisplayID screenDisplayID) +@@ -73,3 +74,25 @@ const ScreenData* screenData(PlatformDisplayID screenDisplayID) } // namespace WebCore #endif // PLATFORM(COCOA) || PLATFORM(GTK) @@ -7192,8 +6541,34 @@ index efa9c30953573d88c18e28110e5f86be339656fb..d6cc2afe8026ceebf80d2b0acac478cb + } // namespace WebCore +diff --git a/Source/WebCore/platform/PlatformTouchEvent.h b/Source/WebCore/platform/PlatformTouchEvent.h +index 27b46407faf6ae9d245856fd0ed664984e8729f8..2b8912789dcda373ceffa8f23996566ff07df2dd 100644 +--- a/Source/WebCore/platform/PlatformTouchEvent.h ++++ b/Source/WebCore/platform/PlatformTouchEvent.h +@@ -38,7 +38,7 @@ public: + + const Vector& touchPoints() const { return m_touchPoints; } + +-#if PLATFORM(WPE) ++#if !ENABLE(IOS_TOUCH_EVENTS) + // FIXME: since WPE currently does not send touch stationary events, we need to be able to set + // 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 +--- a/Source/WebCore/platform/PlatformTouchPoint.h ++++ b/Source/WebCore/platform/PlatformTouchPoint.h +@@ -49,7 +49,7 @@ public: + { + } + +-#if PLATFORM(WPE) ++#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) diff --git a/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp b/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp -index 62df6fb981bd1543adff14632408979a804217f3..b78a9effdcf473d7af71684a2039ef3e7141b9b9 100644 +index a2310a15ba9e9703a1d8ec4691b3f626cbfab640..63a7d6027fb35a3ac60bb41a51df2f1c70fef56d 100644 --- a/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp +++ b/Source/WebCore/platform/adwaita/ScrollbarThemeAdwaita.cpp @@ -43,7 +43,7 @@ @@ -7326,7 +6701,7 @@ index b60f9a64bacc8282860da6de299b75aeb295b9b5..55bd017c03c6478ca334bd5ef164160f namespace WebCore { diff --git a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp -index b6849ae2de8f035240920a3575d79b03d23f5ea9..6b62177a2789bc0e9cdb0f8421e0fb28e17e9a6f 100644 +index 7b9d3c85fa1f76e2b53efc712f98866e6d892d4f..40e21fe75fd53d40e388a31eb10a1941347b7776 100644 --- a/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp +++ b/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp @@ -169,6 +169,33 @@ static Vector stringIndicesFromClusters(const Vector& clusters, @@ -8259,10 +7634,10 @@ index 35ade40b37f0c476815535541118f9246ed199cd..2bd1444f9a5e9a14ab3d6acbc020434e m_commonHeaders.append(CommonHeader { name, value }); } diff --git a/Source/WebCore/platform/network/NetworkStorageSession.h b/Source/WebCore/platform/network/NetworkStorageSession.h -index ba0203910f4fa63f5424f121d5ed9b77d5788565..3d9fb4367c482f3d15e18dfb70c3f477bb2b9232 100644 +index b4d2ca129612ba14c6afc92572fe58c2e0e033b4..a31433c497d14d565f1f4fe92e2c88df3d971347 100644 --- a/Source/WebCore/platform/network/NetworkStorageSession.h +++ b/Source/WebCore/platform/network/NetworkStorageSession.h -@@ -158,6 +158,8 @@ public: +@@ -159,6 +159,8 @@ public: NetworkingContext* context() const; #endif @@ -8272,38 +7647,50 @@ index ba0203910f4fa63f5424f121d5ed9b77d5788565..3d9fb4367c482f3d15e18dfb70c3f477 WEBCORE_EXPORT void setCookie(const Cookie&); WEBCORE_EXPORT void setCookies(const Vector&, const URL&, const URL& mainDocumentURL); diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp -index c5e76b6cbb06657e033af97f2d96cf80731bb499..564dd39db77cf22624996c46ea6ae96c67670e7f 100644 +index ab7536de6a0555f2592177e5d6c0148958d7f078..2d1b6d667dbd1843d6cab2c18ae86220d49c600e 100644 --- a/Source/WebCore/platform/network/ResourceResponseBase.cpp +++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp -@@ -74,6 +74,7 @@ ResourceResponseBase::ResourceResponseBase(std::optionalm_httpStatusText : AtomString { }) - , m_httpVersion(data ? data->m_httpVersion : AtomString { }) - , m_httpHeaderFields(data ? data->m_httpHeaderFields : HTTPHeaderMap { }) -+ , m_httpRequestHeaderFields(data ? data->m_httpRequestHeaderFields : HTTPHeaderMap { }) - , m_networkLoadMetrics(data ? data->m_networkLoadMetrics : Box { }) - , m_certificateInfo(data ? data->m_certificateInfo : std::nullopt) - , m_httpStatusCode(data ? data->m_httpStatusCode : 0) -@@ -890,6 +891,7 @@ std::optional ResourceResponseBase::getRespo - m_httpStatusText, - m_httpVersion, - m_httpHeaderFields, -+ m_httpRequestHeaderFields, - m_networkLoadMetrics, - - m_httpStatusCode, +@@ -74,6 +74,7 @@ ResourceResponseBase::ResourceResponseBase(std::optional d + , m_httpStatusText(data ? data->httpStatusText : AtomString { }) + , m_httpVersion(data ? data->httpVersion : AtomString { }) + , m_httpHeaderFields(data ? data->httpHeaderFields : HTTPHeaderMap { }) ++ , m_httpRequestHeaderFields(data ? data->httpRequestHeaderFields : HTTPHeaderMap { }) + , m_networkLoadMetrics(data && data->networkLoadMetrics ? Box::create(*data->networkLoadMetrics) : Box { }) + , m_certificateInfo(data ? data->certificateInfo : std::nullopt) + , m_httpStatusCode(data ? data->httpStatusCode : 0) +@@ -891,6 +892,7 @@ std::optional ResourceResponseBase::getResponseData() cons + String { m_httpStatusText.string() }, + String { m_httpVersion.string() }, + HTTPHeaderMap { m_httpHeaderFields }, ++ HTTPHeaderMap { m_httpRequestHeaderFields }, + m_networkLoadMetrics ? std::optional(*m_networkLoadMetrics) : std::nullopt, + m_source, + m_type, +@@ -964,6 +966,11 @@ std::optional Coder httpRequestHeaderFields; ++ decoder >> httpRequestHeaderFields; ++ if (!httpRequestHeaderFields) ++ return std::nullopt; ++ + std::optional httpStatusCode; + decoder >> httpStatusCode; + if (!httpStatusCode) +@@ -1018,6 +1025,7 @@ std::optional Coder m_networkLoadMetrics; - - short m_httpStatusCode; -@@ -320,6 +321,11 @@ protected: +@@ -251,6 +251,11 @@ protected: AtomString m_httpStatusText; AtomString m_httpVersion; HTTPHeaderMap m_httpHeaderFields; @@ -8315,32 +7702,36 @@ index a2a0e57218fc14c7ead18bfe93330e9ddc260f36..ecfbd8538223ad08e64bb99fe976d2a1 Box m_networkLoadMetrics; mutable std::optional m_certificateInfo; -@@ -368,6 +374,7 @@ void ResourceResponseBase::encode(Encoder& encoder) const - encoder << m_httpStatusText; - encoder << m_httpVersion; - encoder << m_httpHeaderFields; -+ encoder << m_httpRequestHeaderFields; - - encoder << m_httpStatusCode; - encoder << m_certificateInfo; -@@ -437,6 +444,12 @@ bool ResourceResponseBase::decode(Decoder& decoder, ResourceResponseBase& respon - return false; - response.m_httpHeaderFields = WTFMove(*httpHeaderFields); - -+ std::optional httpRequestHeaderFields; -+ decoder >> httpRequestHeaderFields; -+ if (!httpRequestHeaderFields) -+ return false; -+ response.m_httpRequestHeaderFields = WTFMove(*httpRequestHeaderFields); -+ - std::optional httpStatusCode; - decoder >> httpStatusCode; - if (!httpStatusCode) +@@ -291,7 +296,7 @@ struct ResourceResponseData { + ResourceResponseData() = default; + ResourceResponseData(ResourceResponseData&&) = default; + ResourceResponseData& operator=(ResourceResponseData&&) = default; +- ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseBaseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, bool isRangeRequested, std::optional certificateInfo) ++ ResourceResponseData(URL&& url, String&& mimeType, long long expectedContentLength, String&& textEncodingName, int httpStatusCode, String&& httpStatusText, String&& httpVersion, HTTPHeaderMap&& httpHeaderFields, HTTPHeaderMap&& httpRequestHeaderFields, std::optional&& networkLoadMetrics, ResourceResponseBaseSource source, ResourceResponseBaseType type, ResourceResponseBaseTainting tainting, bool isRedirected, UsedLegacyTLS usedLegacyTLS, WasPrivateRelayed wasPrivateRelayed, bool isRangeRequested, std::optional certificateInfo) + : url(WTFMove(url)) + , mimeType(WTFMove(mimeType)) + , expectedContentLength(expectedContentLength) +@@ -300,6 +305,7 @@ struct ResourceResponseData { + , httpStatusText(WTFMove(httpStatusText)) + , httpVersion(WTFMove(httpVersion)) + , httpHeaderFields(WTFMove(httpHeaderFields)) ++ , httpRequestHeaderFields(WTFMove(httpRequestHeaderFields)) + , networkLoadMetrics(WTFMove(networkLoadMetrics)) + , source(source) + , type(type) +@@ -322,6 +328,7 @@ struct ResourceResponseData { + String httpStatusText; + String httpVersion; + HTTPHeaderMap httpHeaderFields; ++ HTTPHeaderMap httpRequestHeaderFields; + std::optional networkLoadMetrics; + 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 fa98150c2de166d8637a931dba34218ea40fe582..dcfc225a2b224ca873e2ee4fcf334c0b3dc59e2c 100644 +index 96d8b81ce13d95bce35865d63d0300e12efcfd0d..8a9f66b44a3a460e93dd7f2ecc2f89821deaf253 100644 --- a/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm +++ b/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm -@@ -539,6 +539,22 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSi +@@ -518,6 +518,22 @@ bool NetworkStorageSession::setCookieFromDOM(const URL& firstParty, const SameSi return false; } @@ -8377,20 +7768,20 @@ index 7788bfea8bb631c51fe858b29cc33e43347cbfab..ad9f347ce55cbea4374a45d3c65f8e11 bool m_detectedDatabaseCorruption { false }; diff --git a/Source/WebCore/platform/network/curl/CurlStream.cpp b/Source/WebCore/platform/network/curl/CurlStream.cpp -index 7a7aa8371394ab6a66a66392cef306daeafe6811..44dd345cb40cc887343ce36ff29fb5ffc5a1ed9e 100644 +index 75cf989294835ce9ab0408d0893af591812bbee9..ea8737d190d40ed4fb511ec27ba4fd313587a027 100644 --- a/Source/WebCore/platform/network/curl/CurlStream.cpp +++ b/Source/WebCore/platform/network/curl/CurlStream.cpp @@ -34,7 +34,7 @@ namespace WebCore { --CurlStream::CurlStream(CurlStreamScheduler& scheduler, CurlStreamID streamID, URL&& url) -+CurlStream::CurlStream(CurlStreamScheduler& scheduler, CurlStreamID streamID, bool ignoreCertificateErrors, URL&& url) +-CurlStream::CurlStream(CurlStreamScheduler& scheduler, CurlStreamID streamID, URL&& url, ServerTrustEvaluation serverTrustEvaluation) ++CurlStream::CurlStream(CurlStreamScheduler& scheduler, CurlStreamID streamID, bool ignoreCertificateErrors, URL&& url, ServerTrustEvaluation serverTrustEvaluation) : m_scheduler(scheduler) , m_streamID(streamID) { -@@ -46,6 +46,9 @@ CurlStream::CurlStream(CurlStreamScheduler& scheduler, CurlStreamID streamID, UR - m_curlHandle->setUrl(WTFMove(url)); +@@ -49,6 +49,9 @@ CurlStream::CurlStream(CurlStreamScheduler& scheduler, CurlStreamID streamID, UR + m_curlHandle->disableServerTrustEvaluation(); m_curlHandle->enableConnectionOnly(); + if (ignoreCertificateErrors) @@ -8400,35 +7791,35 @@ index 7a7aa8371394ab6a66a66392cef306daeafe6811..44dd345cb40cc887343ce36ff29fb5ff auto errorCode = m_curlHandle->perform(); if (errorCode != CURLE_OK) { diff --git a/Source/WebCore/platform/network/curl/CurlStream.h b/Source/WebCore/platform/network/curl/CurlStream.h -index e8a32c26461b4308ea227c6df8c972439905d0bc..5da1a95615b04fca8402f53ecd7f05a006640372 100644 +index 7a2941730bbf90ddc77a13fe2ce35491fab65597..6dc64dff7e7f3dff5004465225cc307f5599cfba 100644 --- a/Source/WebCore/platform/network/curl/CurlStream.h +++ b/Source/WebCore/platform/network/curl/CurlStream.h -@@ -51,12 +51,12 @@ public: - virtual void didFail(CurlStreamID, CURLcode) = 0; +@@ -53,12 +53,12 @@ public: + virtual void didFail(CurlStreamID, CURLcode, CertificateInfo&&) = 0; }; -- static std::unique_ptr create(CurlStreamScheduler& scheduler, CurlStreamID streamID, URL&& url) -+ static std::unique_ptr create(CurlStreamScheduler& scheduler, CurlStreamID streamID, bool ignoreCertificateErrors, URL&& url) +- static std::unique_ptr create(CurlStreamScheduler& scheduler, CurlStreamID streamID, URL&& url, ServerTrustEvaluation serverTrustEvaluation) ++ static std::unique_ptr create(CurlStreamScheduler& scheduler, CurlStreamID streamID, bool ignoreCertificateErrors, URL&& url, ServerTrustEvaluation serverTrustEvaluation) { -- return makeUnique(scheduler, streamID, WTFMove(url)); -+ return makeUnique(scheduler, streamID, ignoreCertificateErrors, WTFMove(url)); +- return makeUnique(scheduler, streamID, WTFMove(url), serverTrustEvaluation); ++ return makeUnique(scheduler, streamID, ignoreCertificateErrors, WTFMove(url), serverTrustEvaluation); } -- CurlStream(CurlStreamScheduler&, CurlStreamID, URL&&); -+ CurlStream(CurlStreamScheduler&, CurlStreamID, bool ignoreCertificateErrors, URL&&); +- CurlStream(CurlStreamScheduler&, CurlStreamID, URL&&, ServerTrustEvaluation); ++ CurlStream(CurlStreamScheduler&, CurlStreamID, bool ignoreCertificateErrors, URL&&, ServerTrustEvaluation); virtual ~CurlStream(); void send(UniqueArray&&, size_t); diff --git a/Source/WebCore/platform/network/curl/CurlStreamScheduler.cpp b/Source/WebCore/platform/network/curl/CurlStreamScheduler.cpp -index d94ff4f9169a6c0b5adb9719f5506d0fb80e6f89..3f955607764d028807d150619bf7f49e08bc3e7e 100644 +index e798f286cc1d12ebdfc657bb16ebdb173b51b597..f21ee9733d4ce9355401fe01218da03ffefd159b 100644 --- a/Source/WebCore/platform/network/curl/CurlStreamScheduler.cpp +++ b/Source/WebCore/platform/network/curl/CurlStreamScheduler.cpp @@ -40,7 +40,7 @@ CurlStreamScheduler::~CurlStreamScheduler() ASSERT(isMainThread()); } --CurlStreamID CurlStreamScheduler::createStream(const URL& url, CurlStream::Client& client) -+CurlStreamID CurlStreamScheduler::createStream(const URL& url, bool ignoreCertificateErrors, CurlStream::Client& client) +-CurlStreamID CurlStreamScheduler::createStream(const URL& url, CurlStream::Client& client, CurlStream::ServerTrustEvaluation serverTrustEvaluation) ++CurlStreamID CurlStreamScheduler::createStream(const URL& url, bool ignoreCertificateErrors, CurlStream::Client& client, CurlStream::ServerTrustEvaluation serverTrustEvaluation) { ASSERT(isMainThread()); @@ -8436,31 +7827,31 @@ index d94ff4f9169a6c0b5adb9719f5506d0fb80e6f89..3f955607764d028807d150619bf7f49e auto streamID = m_currentStreamID; m_clientList.add(streamID, &client); -- callOnWorkerThread([this, streamID, url = url.isolatedCopy()]() mutable { -- m_streamList.add(streamID, CurlStream::create(*this, streamID, WTFMove(url))); -+ callOnWorkerThread([this, streamID, ignoreCertificateErrors, url = url.isolatedCopy()]() mutable { -+ m_streamList.add(streamID, CurlStream::create(*this, streamID, ignoreCertificateErrors, WTFMove(url))); +- callOnWorkerThread([this, streamID, url = url.isolatedCopy(), serverTrustEvaluation]() mutable { +- m_streamList.add(streamID, CurlStream::create(*this, streamID, WTFMove(url), serverTrustEvaluation)); ++ callOnWorkerThread([this, streamID, ignoreCertificateErrors, url = url.isolatedCopy(), serverTrustEvaluation]() mutable { ++ m_streamList.add(streamID, CurlStream::create(*this, streamID, ignoreCertificateErrors, WTFMove(url), serverTrustEvaluation)); }); return streamID; diff --git a/Source/WebCore/platform/network/curl/CurlStreamScheduler.h b/Source/WebCore/platform/network/curl/CurlStreamScheduler.h -index 423a2f825e7c3090fbdab8d2963ad1b45b71af9a..dfa43d953dda13ba9ab6a928bc6c7b2758267d7f 100644 +index ad1c5d0f6e9ef938636fff0c8de172de381f4a2e..e0a67aad31143eef5398261e5a20bab2cd6a430d 100644 --- a/Source/WebCore/platform/network/curl/CurlStreamScheduler.h +++ b/Source/WebCore/platform/network/curl/CurlStreamScheduler.h @@ -38,7 +38,7 @@ public: CurlStreamScheduler(); virtual ~CurlStreamScheduler(); -- WEBCORE_EXPORT CurlStreamID createStream(const URL&, CurlStream::Client&); -+ WEBCORE_EXPORT CurlStreamID createStream(const URL&, bool ignoreCertificateErrors, CurlStream::Client&); +- WEBCORE_EXPORT CurlStreamID createStream(const URL&, CurlStream::Client&, CurlStream::ServerTrustEvaluation = CurlStream::ServerTrustEvaluation::Enable); ++ WEBCORE_EXPORT CurlStreamID createStream(const URL&, bool ignoreCertificateErrors, CurlStream::Client&, CurlStream::ServerTrustEvaluation = CurlStream::ServerTrustEvaluation::Enable); WEBCORE_EXPORT void destroyStream(CurlStreamID); WEBCORE_EXPORT void send(CurlStreamID, UniqueArray&&, size_t); diff --git a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp -index 2d71778577d753be47359c7daf4a72d897914024..8f024d481bdbf9c8c870321a4528e110bef7f5b1 100644 +index f46f26a553e0634fd6a4d383c0821aadd504a399..738327163771952be91bc024e92070c015de2dd3 100644 --- a/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp +++ b/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp -@@ -141,6 +141,12 @@ void NetworkStorageSession::setCookieAcceptPolicy(CookieAcceptPolicy policy) con +@@ -136,6 +136,12 @@ void NetworkStorageSession::setCookieAcceptPolicy(CookieAcceptPolicy policy) con cookieDatabase().setAcceptPolicy(policy); } @@ -8474,10 +7865,10 @@ index 2d71778577d753be47359c7daf4a72d897914024..8f024d481bdbf9c8c870321a4528e110 { switch (cookieDatabase().acceptPolicy()) { diff --git a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp -index 7464b0fcd35df363dda1ade33d519cb3d5f17e46..442c65151fa3581e9f216af4a93cd8a88e078478 100644 +index e5e324e7e616f16ca13e41cd0b618eb946063995..0827159dea1d162aa9e5db36ac252b475081312c 100644 --- a/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp +++ b/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp -@@ -438,6 +438,30 @@ void NetworkStorageSession::replaceCookies(const Vector& cookies) +@@ -424,6 +424,30 @@ void NetworkStorageSession::replaceCookies(const Vector& cookies) g_signal_emit(jar, signalId, 0); } @@ -8509,7 +7900,7 @@ index 7464b0fcd35df363dda1ade33d519cb3d5f17e46..442c65151fa3581e9f216af4a93cd8a8 { GUniquePtr targetCookie(cookie.toSoupCookie()); diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp -index 141fc2762f9ea1b56f706542dbc319d331fb23e4..59ac2caad62cac585d5f59f799db770fcb63de85 100644 +index 79648fbd61bff20a1496c3247219796fe713daed..fc4ca92aab0bd6fdf234a09d1d8b21c68bcea794 100644 --- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp +++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp @@ -39,6 +39,7 @@ @@ -8599,7 +7990,7 @@ index f997a64f68deca632435450869c1abc9c3c35ac2..79da1d419799e359c60f2346e1d3ac8a OptionSet PlatformKeyboardEvent::currentStateOfModifierKeys() diff --git a/Source/WebCore/platform/win/PasteboardWin.cpp b/Source/WebCore/platform/win/PasteboardWin.cpp -index 9cfe7fe6a51ab15834082822f523fb92204531a5..dd1c2153b865a9dd558df20462884422fe2ad84e 100644 +index eed85c96b3d8292856e030691ce9c29199dbd3f0..0c2642562d5fec67977b2896433bf75331796616 100644 --- a/Source/WebCore/platform/win/PasteboardWin.cpp +++ b/Source/WebCore/platform/win/PasteboardWin.cpp @@ -1129,7 +1129,21 @@ void Pasteboard::writeCustomData(const Vector& data) @@ -9070,10 +8461,10 @@ index 0000000000000000000000000000000000000000..cf2b51f6f02837a1106f4d999f2f130e + +} // namespace WebCore diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp -index 9928b9733fb7152b3fdcb357b086950f15bd39e2..8a54795f463a9f3c746bcf5f2d7966f40f37f48f 100644 +index 06932aaafe53227c12c680f479f18de2ef943dc2..2817b2915640cf0ffc4f79e90729805082caefb2 100644 --- a/Source/WebCore/rendering/RenderTextControl.cpp +++ b/Source/WebCore/rendering/RenderTextControl.cpp -@@ -209,13 +209,13 @@ void RenderTextControl::layoutExcludedChildren(bool relayoutChildren) +@@ -210,13 +210,13 @@ void RenderTextControl::layoutExcludedChildren(bool relayoutChildren) } } @@ -9089,7 +8480,7 @@ index 9928b9733fb7152b3fdcb357b086950f15bd39e2..8a54795f463a9f3c746bcf5f2d7966f4 { auto innerText = innerTextElement(); diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h -index 1497fa9cf6222fe02f84b9b13ce60cc51f301206..a4095a4d6f0b49e0a3a105597d69184380df9e42 100644 +index e064a7a15a416e593b68de15133c5528b1ce2ae0..2860c13fad04ea32e28142848e0583701263f45d 100644 --- a/Source/WebCore/rendering/RenderTextControl.h +++ b/Source/WebCore/rendering/RenderTextControl.h @@ -36,9 +36,9 @@ public: @@ -9104,11 +8495,11 @@ index 1497fa9cf6222fe02f84b9b13ce60cc51f301206..a4095a4d6f0b49e0a3a105597d691843 int innerLineHeight() const override; #endif diff --git a/Source/WebCore/workers/WorkerConsoleClient.cpp b/Source/WebCore/workers/WorkerConsoleClient.cpp -index 7b429300affcb05189d4816059f405d6686c4f51..a2a160ea608c719ce2b714cd32510248ef404390 100644 +index 3a0f87d60e42971d841b9eb5c8f1b36b4cb9649e..f2da6be1c58b89adc458c9e2c86c9ab6d613ff2a 100644 --- a/Source/WebCore/workers/WorkerConsoleClient.cpp +++ b/Source/WebCore/workers/WorkerConsoleClient.cpp -@@ -99,4 +99,6 @@ void WorkerConsoleClient::recordEnd(JSC::JSGlobalObject*, Ref&& - +@@ -101,4 +101,6 @@ void WorkerConsoleClient::recordEnd(JSC::JSGlobalObject*, Ref&& + // FIXME: Web Inspector: support console screenshots in a Worker void WorkerConsoleClient::screenshot(JSC::JSGlobalObject*, Ref&&) { } +void WorkerConsoleClient::bindingCalled(JSC::JSGlobalObject*, const String&, const String&) { } @@ -9127,10 +8518,10 @@ index 1d8488e0d36288e09cd5662bd7f770ade95dfee3..dee07f87b47d62d4ef8ede45824bdb2f WorkerOrWorkletGlobalScope& m_globalScope; }; diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp -index 4206bd668f41c059cf20ec5513274418a573740b..cc6b604eff4c3b73b6b8ff9075014b8ca2fc6b30 100644 +index 4b1ad56a8545bf97a0dd4e8d3cdec60525df0fc8..3c50334f1033183de466956d4e6e305f031195fb 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp -@@ -95,6 +95,8 @@ +@@ -97,6 +97,8 @@ #if PLATFORM(COCOA) #include @@ -9139,8 +8530,8 @@ index 4206bd668f41c059cf20ec5513274418a573740b..cc6b604eff4c3b73b6b8ff9075014b8c #endif #if ENABLE(APPLE_PAY_REMOTE_UI) -@@ -1076,6 +1078,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) - #endif +@@ -1067,6 +1069,14 @@ void NetworkConnectionToWebProcess::clearPageSpecificData(PageIdentifier pageID) + storageSession->clearPageSpecificDataForResourceLoadStatistics(pageID); } +void NetworkConnectionToWebProcess::setCookieFromResponse(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, const String& setCookieValue) @@ -9151,24 +8542,24 @@ index 4206bd668f41c059cf20ec5513274418a573740b..cc6b604eff4c3b73b6b8ff9075014b8c + networkStorageSession->setCookiesFromResponse(firstParty, sameSiteInfo, url, setCookieValue); +} + - #if ENABLE(TRACKING_PREVENTION) void NetworkConnectionToWebProcess::removeStorageAccessForFrame(FrameIdentifier frameID, PageIdentifier pageID) { + if (auto* storageSession = networkProcess().storageSession(m_sessionID)) diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h -index 2bf91f53c3775f8c961cf7f14e000681231cbe5e..2f5ed58455deda2d55a198eb7d7bc204c3857153 100644 +index b4bc09699705059954d2c6f9e867d10ea390d519..9949d08f3233615641af9b8b8ed0836082d2df35 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h -@@ -328,6 +328,8 @@ private: +@@ -339,6 +339,8 @@ private: void clearPageSpecificData(WebCore::PageIdentifier); + void setCookieFromResponse(const URL& firstParty, const WebCore::SameSiteInfo&, const URL& url, const String& setCookieValue); + - #if ENABLE(TRACKING_PREVENTION) void removeStorageAccessForFrame(WebCore::FrameIdentifier, WebCore::PageIdentifier); + void logUserInteraction(RegistrableDomain&&); diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in -index 2367ada0de191766c89ef2855a4f30a66ebe328a..b0e7951d30cc087c3bfb307c707779a5bb550e32 100644 +index 869d0f0f0bbe73364efe9022508fab74053a5afd..52c963bfc2f810d2cfca1a1a01c466a0cb479fbc 100644 --- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in +++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in @@ -71,6 +71,8 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver { @@ -9177,14 +8568,14 @@ index 2367ada0de191766c89ef2855a4f30a66ebe328a..b0e7951d30cc087c3bfb307c707779a5 + SetCookieFromResponse(URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, String setCookieValue); + - #if ENABLE(TRACKING_PREVENTION) RemoveStorageAccessForFrame(WebCore::FrameIdentifier frameID, WebCore::PageIdentifier pageID); LogUserInteraction(WebCore::RegistrableDomain domain) + ResourceLoadStatisticsUpdated(Vector statistics) -> () diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp -index 172177e7cd3749a446a9143c1566363f932b7a49..a632fc51d7e28e2f9bd8545f4e26f0a06eb8d035 100644 +index 646d36119c6bf082f2cf7cedba71d2bc8961cf5a..b23b3db6f6b0954e8be1f8ffedcce54a8e69ec08 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp +++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp -@@ -625,6 +625,12 @@ void NetworkProcess::registrableDomainsExemptFromWebsiteDataDeletion(PAL::Sessio +@@ -622,6 +622,12 @@ void NetworkProcess::registrableDomainsExemptFromWebsiteDataDeletion(PAL::Sessio completionHandler({ }); } @@ -9194,11 +8585,11 @@ index 172177e7cd3749a446a9143c1566363f932b7a49..a632fc51d7e28e2f9bd8545f4e26f0a0 + networkSession->setIgnoreCertificateErrors(ignore); +} + - #if ENABLE(TRACKING_PREVENTION) void NetworkProcess::dumpResourceLoadStatistics(PAL::SessionID sessionID, CompletionHandler&& completionHandler) { + if (auto* session = networkSession(sessionID)) { diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h -index a072b511e5ce431d443a423a509497558ef26b18..bc5f4f3e9a5fff415ff89272907d4111205e9e0c 100644 +index 93288ab85429a458b4a7158531265a639f46cdcf..4a8517c9102803d9004b7558146289b8befeba6f 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.h +++ b/Source/WebKit/NetworkProcess/NetworkProcess.h @@ -33,6 +33,7 @@ @@ -9209,7 +8600,7 @@ index a072b511e5ce431d443a423a509497558ef26b18..bc5f4f3e9a5fff415ff89272907d4111 #include "WebPageProxyIdentifier.h" #include "WebResourceLoadStatisticsStore.h" #include "WebsiteData.h" -@@ -80,6 +81,7 @@ class SessionID; +@@ -81,6 +82,7 @@ class SessionID; namespace WebCore { class CertificateInfo; @@ -9217,34 +8608,34 @@ index a072b511e5ce431d443a423a509497558ef26b18..bc5f4f3e9a5fff415ff89272907d4111 class CurlProxySettings; class ProtectionSpace; class NetworkStorageSession; -@@ -209,6 +211,9 @@ public: +@@ -217,6 +219,9 @@ public: void registrableDomainsWithLastAccessedTime(PAL::SessionID, CompletionHandler>)>&&); void registrableDomainsExemptFromWebsiteDataDeletion(PAL::SessionID, CompletionHandler)>&&); + + void setIgnoreCertificateErrors(PAL::SessionID, bool); + - #if ENABLE(TRACKING_PREVENTION) void clearPrevalentResource(PAL::SessionID, RegistrableDomain&&, CompletionHandler&&); void clearUserInteraction(PAL::SessionID, RegistrableDomain&&, CompletionHandler&&); + void deleteAndRestrictWebsiteDataForRegistrableDomains(PAL::SessionID, OptionSet, RegistrableDomainsToDeleteOrRestrictWebsiteDataFor&&, bool shouldNotifyPage, CompletionHandler&&)>&&); diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in -index 20d7d32baf524e43a11a86ef208c404696d8ace7..2e6fa5ca2266d9868b6683540a5ba999819005ba 100644 +index f25091cbaa770577d91587dade186ed48b6cdd85..b041386dd2ad05a1bb015b6ac2c92490aafbcc15 100644 --- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in +++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in -@@ -85,6 +85,8 @@ messages -> NetworkProcess LegacyReceiver { +@@ -83,6 +83,8 @@ messages -> NetworkProcess LegacyReceiver { SetInspectionForServiceWorkersAllowed(PAL::SessionID sessionID, bool inspectable) #endif + SetIgnoreCertificateErrors(PAL::SessionID sessionID, bool ignoreTLSErrors) + - #if ENABLE(TRACKING_PREVENTION) ClearPrevalentResource(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain) -> () ClearUserInteraction(PAL::SessionID sessionID, WebCore::RegistrableDomain resourceDomain) -> () + DumpResourceLoadStatistics(PAL::SessionID sessionID) -> (String dumpedStatistics) diff --git a/Source/WebKit/NetworkProcess/NetworkSession.h b/Source/WebKit/NetworkProcess/NetworkSession.h -index 986309ce9567147c5b0b0d047de82d26ee230ba3..36f67b7bf663d7398de33d7e361b0dd4d4574cc4 100644 +index 9d3bea122c7ccd7279efd5a8929105c172728f55..ee2ffae0df4b4f667e67fae42939c265a3425781 100644 --- a/Source/WebKit/NetworkProcess/NetworkSession.h +++ b/Source/WebKit/NetworkProcess/NetworkSession.h -@@ -205,6 +205,9 @@ public: +@@ -204,6 +204,9 @@ public: void lowMemoryHandler(WTF::Critical); @@ -9254,7 +8645,7 @@ index 986309ce9567147c5b0b0d047de82d26ee230ba3..36f67b7bf663d7398de33d7e361b0dd4 #if ENABLE(SERVICE_WORKER) void removeSoftUpdateLoader(ServiceWorkerSoftUpdateLoader* loader) { m_softUpdateLoaders.remove(loader); } void addNavigationPreloaderTask(ServiceWorkerFetchTask&); -@@ -327,6 +330,7 @@ protected: +@@ -317,6 +320,7 @@ protected: bool m_privateClickMeasurementDebugModeEnabled { false }; std::optional m_ephemeralMeasurement; bool m_isRunningEphemeralMeasurementTest { false }; @@ -9263,10 +8654,10 @@ index 986309ce9567147c5b0b0d047de82d26ee230ba3..36f67b7bf663d7398de33d7e361b0dd4 HashSet> m_keptAliveLoads; diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -index 6fab2cc458410ed58d263c3162014fca9cb9501c..f51327e9691d4f716891848ca9f06314d8572b21 100644 +index b503a62c1763d89def8e3d223ebae8e06d2691c2..222c0efa62a4b5f3fcad8a9915a1d7a6b3ae5c49 100644 --- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm +++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm -@@ -766,6 +766,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didRece +@@ -752,6 +752,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didRece if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { sessionCocoa->setClientAuditToken(challenge); @@ -9275,7 +8666,7 @@ index 6fab2cc458410ed58d263c3162014fca9cb9501c..f51327e9691d4f716891848ca9f06314 NSURLSessionTaskTransactionMetrics *metrics = task._incompleteTaskMetrics.transactionMetrics.lastObject; auto tlsVersion = (tls_protocol_version_t)metrics.negotiatedTLSProtocolVersion.unsignedShortValue; -@@ -1105,6 +1107,13 @@ ALLOW_DEPRECATED_DECLARATIONS_END +@@ -1091,6 +1093,13 @@ ALLOW_DEPRECATED_DECLARATIONS_END resourceResponse.setDeprecatedNetworkLoadMetrics(WebCore::copyTimingData(taskMetrics, networkDataTask->networkLoadMetrics())); @@ -9290,11 +8681,11 @@ index 6fab2cc458410ed58d263c3162014fca9cb9501c..f51327e9691d4f716891848ca9f06314 #if !LOG_DISABLED LOG(NetworkSession, "%llu didReceiveResponse completionHandler (%d)", taskIdentifier, policyAction); diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp -index 8ef8c83a4b1cc6bca6167214c3a1ee9cec8fa235..e0b40605da9adb8b81240838189d9559fb882c3e 100644 +index 576f93777989c0203c5c0f47ac3fcdddd880f12d..44d20997cc6f5e147adaf2c8235fad929f2e3b04 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp +++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp -@@ -82,10 +82,18 @@ NetworkDataTaskCurl::NetworkDataTaskCurl(NetworkSession& session, NetworkDataTas - #endif +@@ -80,10 +80,18 @@ NetworkDataTaskCurl::NetworkDataTaskCurl(NetworkSession& session, NetworkDataTas + blockCookies(); restrictRequestReferrerToOriginIfNeeded(request); - m_curlRequest = createCurlRequest(WTFMove(request)); @@ -9302,7 +8693,7 @@ index 8ef8c83a4b1cc6bca6167214c3a1ee9cec8fa235..e0b40605da9adb8b81240838189d9559 - m_curlRequest->setUserPass(m_initialCredential.user(), m_initialCredential.password()); - m_curlRequest->setAuthenticationScheme(ProtectionSpace::AuthenticationScheme::HTTPBasic); + if (request.url().protocolIsData()) { -+ DataURLDecoder::decode(request.url(), { }, [this, protectedThis = Ref { *this }](auto decodeResult) mutable { ++ DataURLDecoder::decode(request.url(), { }, DataURLDecoder::ShouldValidatePadding::Yes, [this, protectedThis = Ref { *this }](auto decodeResult) mutable { + didReadDataURL(WTFMove(decodeResult)); + }); + } else { @@ -9316,7 +8707,7 @@ index 8ef8c83a4b1cc6bca6167214c3a1ee9cec8fa235..e0b40605da9adb8b81240838189d9559 } } -@@ -163,6 +171,7 @@ void NetworkDataTaskCurl::curlDidReceiveResponse(CurlRequest& request, CurlRespo +@@ -161,6 +169,7 @@ void NetworkDataTaskCurl::curlDidReceiveResponse(CurlRequest& request, CurlRespo updateNetworkLoadMetrics(receivedResponse.networkLoadMetrics); m_response.setDeprecatedNetworkLoadMetrics(Box::create(WTFMove(receivedResponse.networkLoadMetrics))); @@ -9324,7 +8715,7 @@ index 8ef8c83a4b1cc6bca6167214c3a1ee9cec8fa235..e0b40605da9adb8b81240838189d9559 handleCookieHeaders(request.resourceRequest(), receivedResponse); -@@ -287,6 +296,36 @@ bool NetworkDataTaskCurl::shouldRedirectAsGET(const ResourceRequest& request, bo +@@ -285,6 +294,36 @@ bool NetworkDataTaskCurl::shouldRedirectAsGET(const ResourceRequest& request, bo return false; } @@ -9361,7 +8752,7 @@ index 8ef8c83a4b1cc6bca6167214c3a1ee9cec8fa235..e0b40605da9adb8b81240838189d9559 void NetworkDataTaskCurl::invokeDidReceiveResponse() { didReceiveResponse(ResourceResponse(m_response), NegotiatedLegacyTLS::No, PrivateRelayed::No, [this, protectedThis = Ref { *this }](PolicyAction policyAction) { -@@ -317,6 +356,8 @@ void NetworkDataTaskCurl::invokeDidReceiveResponse() +@@ -315,6 +354,8 @@ void NetworkDataTaskCurl::invokeDidReceiveResponse() downloadPtr->didCreateDestination(m_pendingDownloadLocation); if (m_curlRequest) m_curlRequest->completeDidReceiveResponse(); @@ -9370,7 +8761,7 @@ index 8ef8c83a4b1cc6bca6167214c3a1ee9cec8fa235..e0b40605da9adb8b81240838189d9559 break; } default: -@@ -405,6 +446,8 @@ void NetworkDataTaskCurl::willPerformHTTPRedirection() +@@ -401,6 +442,8 @@ void NetworkDataTaskCurl::willPerformHTTPRedirection() m_curlRequest->setUserPass(m_initialCredential.user(), m_initialCredential.password()); m_curlRequest->setAuthenticationScheme(ProtectionSpace::AuthenticationScheme::HTTPBasic); } @@ -9380,7 +8771,7 @@ index 8ef8c83a4b1cc6bca6167214c3a1ee9cec8fa235..e0b40605da9adb8b81240838189d9559 if (m_state != State::Suspended) { m_state = State::Suspended; diff --git a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h -index 04680300ab3122646a861b3f23276339e2fba170..27a3b0d27a2700fabbf36bac4972774baf069d92 100644 +index bfff08efb10d4d6cd1a27755403ed53ed58ce919..1a59755f684229bd47fd70369e4a9d4282950ef7 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h +++ b/Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h @@ -28,6 +28,7 @@ @@ -9421,58 +8812,80 @@ index 04680300ab3122646a861b3f23276339e2fba170..27a3b0d27a2700fabbf36bac4972774b bool m_blockingCookies { false }; diff --git a/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp b/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp -index 6fb944af81e2af05e231b1d0ec0700cc59e532e9..ac862e21506d6250cb621e1e8ccc9b14612c8d0c 100644 +index 8dc0bcdb1cdfa86d04fc7e4e3718f1fe2c457c80..21180451b653bdd3596164a9b60d34d73d1eebfc 100644 --- a/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp +++ b/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp -@@ -66,7 +66,7 @@ void NetworkSessionCurl::clearAlternativeServices(WallTime) +@@ -65,7 +65,7 @@ void NetworkSessionCurl::clearAlternativeServices(WallTime) - std::unique_ptr NetworkSessionCurl::createWebSocketTask(WebPageProxyIdentifier, std::optional, std::optional, NetworkSocketChannel& channel, const WebCore::ResourceRequest& request, const String& protocol, const WebCore::ClientOrigin&, bool, bool, OptionSet, ShouldRelaxThirdPartyCookieBlocking, StoredCredentialsPolicy) + std::unique_ptr NetworkSessionCurl::createWebSocketTask(WebPageProxyIdentifier webPageProxyID, std::optional, std::optional, NetworkSocketChannel& channel, const WebCore::ResourceRequest& request, const String& protocol, const WebCore::ClientOrigin& clientOrigin, bool, bool, OptionSet, ShouldRelaxThirdPartyCookieBlocking, StoredCredentialsPolicy) { -- return makeUnique(channel, request, protocol); -+ return makeUnique(channel, request, protocol, ignoreCertificateErrors()); +- return makeUnique(channel, webPageProxyID, request, protocol, clientOrigin); ++ return makeUnique(channel, webPageProxyID, request, protocol, ignoreCertificateErrors(), clientOrigin); } - } // namespace WebKit + void NetworkSessionCurl::didReceiveChallenge(WebSocketTask& webSocketTask, WebCore::AuthenticationChallenge&& challenge, CompletionHandler&& challengeCompletionHandler) diff --git a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp -index 40e466a49926c304695e0e86c57fbfeef80ceec1..3210765c6a8327b17849530cf13808c187b667ea 100644 +index 16f8fa0df719a97fb7c37af8d1e8dd2543f9db2c..9ebbb2c206e5223d70b60f5819aafc9189018e7a 100644 --- a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp +++ b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp -@@ -34,7 +34,7 @@ +@@ -35,11 +35,12 @@ namespace WebKit { --WebSocketTask::WebSocketTask(NetworkSocketChannel& channel, const WebCore::ResourceRequest& request, const String& protocol) -+WebSocketTask::WebSocketTask(NetworkSocketChannel& channel, const WebCore::ResourceRequest& request, const String& protocol, bool ignoreCertificateErrors) +-WebSocketTask::WebSocketTask(NetworkSocketChannel& channel, WebPageProxyIdentifier webProxyPageID, const WebCore::ResourceRequest& request, const String& protocol, const WebCore::ClientOrigin& clientOrigin) ++WebSocketTask::WebSocketTask(NetworkSocketChannel& channel, WebPageProxyIdentifier webProxyPageID, const WebCore::ResourceRequest& request, const String& protocol, bool ignoreCertificateErrors, const WebCore::ClientOrigin& clientOrigin) : m_channel(channel) + , m_webProxyPageID(webProxyPageID) , m_request(request.isolatedCopy()) , m_protocol(protocol) -@@ -43,7 +43,7 @@ WebSocketTask::WebSocketTask(NetworkSocketChannel& channel, const WebCore::Resou - if (request.url().protocolIs("wss"_s) && WebCore::DeprecatedGlobalSettings::allowsAnySSLCertificate()) - WebCore::CurlContext::singleton().sslHandle().setIgnoreSSLErrors(true); ++ , m_ignoreCertificateErrors(ignoreCertificateErrors) + , m_scheduler(WebCore::CurlContext::singleton().streamScheduler()) + { + // We use topOrigin in case of service worker websocket connections, for which pageID does not link to a real page. +@@ -47,7 +48,7 @@ WebSocketTask::WebSocketTask(NetworkSocketChannel& channel, WebPageProxyIdentifi + if (clientOrigin.topOrigin == clientOrigin.clientOrigin) + m_topOrigin = clientOrigin.topOrigin; - m_streamID = m_scheduler.createStream(request.url(), *this); + m_streamID = m_scheduler.createStream(request.url(), ignoreCertificateErrors, *this); m_channel.didSendHandshakeRequest(WebCore::ResourceRequest(m_request)); } +@@ -246,7 +247,7 @@ void WebSocketTask::tryServerTrustEvaluation(WebCore::AuthenticationChallenge&& + { + networkSession()->didReceiveChallenge(*this, WTFMove(challenge), [this, errorReason = WTFMove(errorReason)](WebKit::AuthenticationChallengeDisposition disposition, const WebCore::Credential& credential) mutable { + if (disposition == AuthenticationChallengeDisposition::UseCredential && !credential.isEmpty()) +- m_streamID = m_scheduler.createStream(m_request.url(), *this, WebCore::CurlStream::ServerTrustEvaluation::Disable); ++ m_streamID = m_scheduler.createStream(m_request.url(), m_ignoreCertificateErrors, *this, WebCore::CurlStream::ServerTrustEvaluation::Disable); + else + didFail(WTFMove(errorReason)); + }); diff --git a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h -index c74bf9aec3de138ca91699b822e09a6243e3f229..df1a8367585e3f43c490880ebe08b95c892a3006 100644 +index 973e36ff935507522ae3e9243094ee1f0398e7aa..a6025da80f44d82c1459d468ca3ab4f97f298dd4 100644 --- a/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h +++ b/Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h -@@ -47,7 +47,7 @@ struct SessionSet; +@@ -50,7 +50,7 @@ struct SessionSet; class WebSocketTask : public CanMakeWeakPtr, public WebCore::CurlStream::Client { WTF_MAKE_FAST_ALLOCATED; public: -- WebSocketTask(NetworkSocketChannel&, const WebCore::ResourceRequest&, const String& protocol); -+ WebSocketTask(NetworkSocketChannel&, const WebCore::ResourceRequest&, const String& protocol, bool ignoreCertificateErrors); +- WebSocketTask(NetworkSocketChannel&, WebPageProxyIdentifier, const WebCore::ResourceRequest&, const String& protocol, const WebCore::ClientOrigin&); ++ WebSocketTask(NetworkSocketChannel&, WebPageProxyIdentifier, const WebCore::ResourceRequest&, const String& protocol, bool ignoreCertificateErrors, const WebCore::ClientOrigin&); virtual ~WebSocketTask(); void sendString(const IPC::DataReference&, CompletionHandler&&); +@@ -103,6 +103,7 @@ private: + WebPageProxyIdentifier m_webProxyPageID; + WebCore::ResourceRequest m_request; + String m_protocol; ++ bool m_ignoreCertificateErrors { false }; + WebCore::SecurityOriginData m_topOrigin; + + WebCore::CurlStreamScheduler& m_scheduler; diff --git a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp -index 04fd5ee23155aa792821b7da717bbb2fb09409c1..76a314a450c7d933c8e86de9915044300028954d 100644 +index e3bcfbf4553ebe624984805d01ed52f0039ef654..45142c1dadf65aeaeb5a20b3e0a31eae6ea3cf18 100644 --- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp +++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp -@@ -469,6 +469,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr&& inputStream) +@@ -467,6 +467,8 @@ void NetworkDataTaskSoup::didSendRequest(GRefPtr&& inputStream) m_networkLoadMetrics.failsTAOCheck = !passesTimingAllowOriginCheck(m_response, *origin); } @@ -9481,7 +8894,7 @@ index 04fd5ee23155aa792821b7da717bbb2fb09409c1..76a314a450c7d933c8e86de991504430 dispatchDidReceiveResponse(); } -@@ -566,6 +568,8 @@ bool NetworkDataTaskSoup::acceptCertificate(GTlsCertificate* certificate, GTlsCe +@@ -564,6 +566,8 @@ bool NetworkDataTaskSoup::acceptCertificate(GTlsCertificate* certificate, GTlsCe { ASSERT(m_soupMessage); URL url = soupURIToURL(soup_message_get_uri(m_soupMessage.get())); @@ -9491,7 +8904,7 @@ index 04fd5ee23155aa792821b7da717bbb2fb09409c1..76a314a450c7d933c8e86de991504430 if (!error) return true; diff --git a/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp -index 13e557214edc7f060dd01ef10c2ab97fe0e9c41e..6ec6ea5328eab0cc9f5247ee14e15c560a406d1b 100644 +index 3fa6072886e6d34d53c63fffb131d51a197540fd..72d919c0043fb524109aed043897195a78563198 100644 --- a/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp +++ b/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp @@ -99,6 +99,11 @@ void NetworkSessionSoup::clearCredentials(WallTime) @@ -9552,10 +8965,10 @@ index 13e557214edc7f060dd01ef10c2ab97fe0e9c41e..6ec6ea5328eab0cc9f5247ee14e15c56 } diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake -index 229843e90a0d3e66762221e60c9e25b77ceccd6e..c39b8b8b5675cf03704ad88b9bc1c9fbc20fc4ad 100644 +index a66d97107bcd82080d0abdd1388812bc78e92b8a..b95453016bee222330e91c9dc6c35f001b602e00 100644 --- a/Source/WebKit/PlatformGTK.cmake +++ b/Source/WebKit/PlatformGTK.cmake -@@ -306,6 +306,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES +@@ -316,6 +316,9 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES ${GSTREAMER_PBUTILS_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${LIBSOUP_INCLUDE_DIRS} @@ -9565,7 +8978,7 @@ index 229843e90a0d3e66762221e60c9e25b77ceccd6e..c39b8b8b5675cf03704ad88b9bc1c9fb ) list(APPEND WebKit_INTERFACE_INCLUDE_DIRECTORIES -@@ -352,6 +355,9 @@ if (USE_LIBWEBRTC) +@@ -371,6 +374,9 @@ if (USE_LIBWEBRTC) list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES "${THIRDPARTY_DIR}/libwebrtc/Source/" "${THIRDPARTY_DIR}/libwebrtc/Source/webrtc" @@ -9575,7 +8988,7 @@ index 229843e90a0d3e66762221e60c9e25b77ceccd6e..c39b8b8b5675cf03704ad88b9bc1c9fb ) endif () -@@ -395,6 +401,12 @@ else () +@@ -414,6 +420,12 @@ else () set(WebKitGTK_ENUM_HEADER_TEMPLATE ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitEnumTypesGtk3.h.in) endif () @@ -9589,10 +9002,10 @@ index 229843e90a0d3e66762221e60c9e25b77ceccd6e..c39b8b8b5675cf03704ad88b9bc1c9fb 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 9a80143b3e079290c646340b932b7029845a2e05..3b31af45d209851d568eab5868b6d80ef1cf9723 100644 +index 960995e2b58396ad9aab82576a01600453c13241..1376224cadb398b84c305a319b4b71919cc152f5 100644 --- a/Source/WebKit/PlatformWPE.cmake +++ b/Source/WebKit/PlatformWPE.cmake -@@ -191,6 +191,7 @@ set(WPE_API_HEADER_TEMPLATES +@@ -198,6 +198,7 @@ set(WPE_API_HEADER_TEMPLATES ${WEBKIT_DIR}/UIProcess/API/glib/WebKitWindowProperties.h.in ${WEBKIT_DIR}/UIProcess/API/glib/WebKitWebsitePolicies.h.in ${WEBKIT_DIR}/UIProcess/API/glib/webkit.h.in @@ -9600,15 +9013,7 @@ index 9a80143b3e079290c646340b932b7029845a2e05..3b31af45d209851d568eab5868b6d80e ) if (ENABLE_2022_GLIB_API) -@@ -368,6 +369,7 @@ list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES - "${WEBKIT_DIR}/UIProcess/Launcher/libwpe" - "${WEBKIT_DIR}/UIProcess/Notifications/glib/" - "${WEBKIT_DIR}/UIProcess/geoclue" -+ "${WEBKIT_DIR}/UIProcess/glib" - "${WEBKIT_DIR}/UIProcess/gstreamer" - "${WEBKIT_DIR}/UIProcess/linux" - "${WEBKIT_DIR}/UIProcess/soup" -@@ -391,8 +393,17 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES +@@ -399,8 +400,17 @@ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES ${GIO_UNIX_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS} ${LIBSOUP_INCLUDE_DIRS} @@ -9797,10 +9202,18 @@ index 7164af8d347828ba80bcb52fd6ca814401157f2b..9ba0e32717d9b4cb01f3f43898aa402a #if USE(APPKIT) diff --git a/Source/WebKit/Shared/NativeWebMouseEvent.h b/Source/WebKit/Shared/NativeWebMouseEvent.h -index c586d2775021a9e164dc36b1732e1a2dadc986a0..ffb79428fe2de5af626bf3a9ad49545380a8e85d 100644 +index c586d2775021a9e164dc36b1732e1a2dadc986a0..189a9bec7af066fee5d84fa3ce1ed145de01080f 100644 --- a/Source/WebKit/Shared/NativeWebMouseEvent.h +++ b/Source/WebKit/Shared/NativeWebMouseEvent.h -@@ -79,6 +79,11 @@ public: +@@ -31,6 +31,7 @@ + #if USE(APPKIT) + #include + OBJC_CLASS NSView; ++OBJC_CLASS NSEvent; + #endif + + #if PLATFORM(GTK) +@@ -79,6 +80,11 @@ public: NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool); #endif @@ -9840,10 +9253,10 @@ index 72ad2880160a374e8fa663e561d59becf9d2f36d..372ae6953199245fe4fc55a49813c7ca #endif }; diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp -index 33d83803d0284b3471cfe848aa8b0ae86735ce28..cf76a4b330469bba86fb2c72ee82c2ead0c34b77 100644 +index 08ff2201710e5544ebbd02f4d9cb9d25208ebe11..e15d79e4c87f4956f7276d03edfeffbac43da0f8 100644 --- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp +++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp -@@ -193,6 +193,10 @@ +@@ -192,6 +192,10 @@ #include #endif @@ -9855,10 +9268,10 @@ index 33d83803d0284b3471cfe848aa8b0ae86735ce28..cf76a4b330469bba86fb2c72ee82c2ea namespace IPC { diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -index b106303da85a8226327a6f9e986c4646d39b4bbc..56c69d19af821e0ebdfa77c6873ca0c5d165dc7f 100644 +index e9e076535ccc3ab4b4c1a6ed491d167fa66b0f87..7beddce3b119cd7c4e4520afd6fc5bf8e4112485 100644 --- a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in +++ b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in -@@ -2338,6 +2338,9 @@ class WebCore::AuthenticationChallenge { +@@ -2484,6 +2484,9 @@ class WebCore::AuthenticationChallenge { class WebCore::DragData { #if PLATFORM(COCOA) String pasteboardName(); @@ -9868,27 +9281,19 @@ index b106303da85a8226327a6f9e986c4646d39b4bbc..56c69d19af821e0ebdfa77c6873ca0c5 #endif WebCore::IntPoint clientPosition(); WebCore::IntPoint globalPosition(); -@@ -2860,6 +2863,7 @@ enum class WebCore::ResourceLoadPriority : uint8_t { - AtomString m_httpStatusText; - AtomString m_httpVersion; - WebCore::HTTPHeaderMap m_httpHeaderFields; -+ WebCore::HTTPHeaderMap m_httpRequestHeaderFields; - Box m_networkLoadMetrics; - - short m_httpStatusCode; +@@ -3040,6 +3043,7 @@ header: + String httpStatusText; + String httpVersion; + WebCore::HTTPHeaderMap httpHeaderFields; ++ WebCore::HTTPHeaderMap httpRequestHeaderFields; + std::optional networkLoadMetrics; + WebCore::ResourceResponseBase::Source source; + WebCore::ResourceResponseBase::Type type; diff --git a/Source/WebKit/Shared/WebKeyboardEvent.cpp b/Source/WebKit/Shared/WebKeyboardEvent.cpp -index a80efd294086ea1bd3b1e9dc805491ff5230962f..17d9d5461ae47a122160f10b7fdcb662f06bea7a 100644 +index b80bcb39473ecec86be5671f38698130bd9acbf3..d886cbac5f4c073e14e12f257fa920419ea0cf39 100644 --- a/Source/WebKit/Shared/WebKeyboardEvent.cpp +++ b/Source/WebKit/Shared/WebKeyboardEvent.cpp -@@ -35,6 +35,7 @@ WebKeyboardEvent::WebKeyboardEvent() - { - } - -+ - #if USE(APPKIT) - - WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, 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& commands, bool isAutoRepeat, bool isKeypad, bool isSystemKey) -@@ -56,6 +57,24 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S +@@ -52,6 +52,24 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S ASSERT(isKeyboardEventType(type())); } @@ -9913,7 +9318,7 @@ index a80efd294086ea1bd3b1e9dc805491ff5230962f..17d9d5461ae47a122160f10b7fdcb662 #elif PLATFORM(GTK) WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool handledByInputMethod, std::optional>&& preeditUnderlines, std::optional&& preeditSelectionRange, Vector&& commands, bool isAutoRepeat, bool isKeypad) -@@ -79,6 +98,24 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S +@@ -75,6 +93,24 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S ASSERT(isKeyboardEventType(type())); } @@ -9938,7 +9343,7 @@ index a80efd294086ea1bd3b1e9dc805491ff5230962f..17d9d5461ae47a122160f10b7fdcb662 #elif PLATFORM(IOS_FAMILY) WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, 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) -@@ -142,6 +179,27 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S +@@ -138,6 +174,27 @@ WebKeyboardEvent::WebKeyboardEvent(WebEvent&& event, const String& text, const S #endif @@ -9967,10 +9372,10 @@ index a80efd294086ea1bd3b1e9dc805491ff5230962f..17d9d5461ae47a122160f10b7fdcb662 { } diff --git a/Source/WebKit/Shared/WebKeyboardEvent.h b/Source/WebKit/Shared/WebKeyboardEvent.h -index 7840e34e303873e771150f242f57e621ebbb78a3..c3cea2e0506bcf5c25815b06d35dbdb5dc58edb7 100644 +index 976edc95bef9fde10d1e875fce2e00d3732c0456..f2f49d9badd67317c5c1f9aa248e8a1cb6a2f66d 100644 --- a/Source/WebKit/Shared/WebKeyboardEvent.h +++ b/Source/WebKit/Shared/WebKeyboardEvent.h -@@ -43,14 +43,18 @@ public: +@@ -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); @@ -9990,22 +9395,22 @@ index 7840e34e303873e771150f242f57e621ebbb78a3..c3cea2e0506bcf5c25815b06d35dbdb5 const String& text() const { return m_text; } diff --git a/Source/WebKit/Shared/WebMouseEvent.h b/Source/WebKit/Shared/WebMouseEvent.h -index d5f411e74ca6db9cdd9fcb6712f9ef7294dfde0e..a002b61520e52afb88bc3d2340e2010196860406 100644 +index a38fc7fde1d5f1a1fd04ae1f84eb59c1501deec5..d3669c3d3bad91468fbbeeaa328c361082ecd408 100644 --- a/Source/WebKit/Shared/WebMouseEvent.h +++ b/Source/WebKit/Shared/WebMouseEvent.h -@@ -73,6 +73,7 @@ public: +@@ -70,6 +70,7 @@ public: - WebMouseEventButton button() const { return static_cast(m_button); } + 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; } - float deltaX() const { return m_deltaX; } diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h -index 843ab2240d8d6718e9d542854f82e85eac528594..fed43c932c5d87ce60eb010f2498ba4d25fd4f8d 100644 +index b71d3c999fb3e7875e5b1e287b5b87f1b97e85f0..aedde190cc609a48a9f1051cd7cf2b570b22a4b3 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.h +++ b/Source/WebKit/Shared/WebPageCreationParameters.h -@@ -271,6 +271,8 @@ struct WebPageCreationParameters { +@@ -280,6 +280,8 @@ struct WebPageCreationParameters { bool httpsUpgradeEnabled { true }; @@ -10015,10 +9420,10 @@ index 843ab2240d8d6718e9d542854f82e85eac528594..fed43c932c5d87ce60eb010f2498ba4d bool allowsDeprecatedSynchronousXMLHttpRequestDuringUnload { false }; #endif diff --git a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -index 40622df2440f79bb53d8dce8d454f781c52a4140..224797f7e758a989b7128f1e751dbe13f579171a 100644 +index 4e87205e89a1fba4e8b2fefb254c4fc77552644a..de7076e0970f6c24ab388c59635ff70f5b6b2ac8 100644 --- a/Source/WebKit/Shared/WebPageCreationParameters.serialization.in +++ b/Source/WebKit/Shared/WebPageCreationParameters.serialization.in -@@ -214,6 +214,8 @@ struct WebKit::WebPageCreationParameters { +@@ -218,6 +218,8 @@ headers: "ArgumentCoders.h" bool httpsUpgradeEnabled; @@ -10283,17 +9688,32 @@ index 0000000000000000000000000000000000000000..789a0d7cf69704c8f665a9ed79348fbc +}; + +} // namespace IPC +diff --git a/Source/WebKit/Shared/win/WebEventFactory.cpp b/Source/WebKit/Shared/win/WebEventFactory.cpp +index 665b9d6a9de903ee9ad6dc53e15ab421b6cb769f..2b129963074d2ceec1c05f3a637c5e1c9e652008 100644 +--- a/Source/WebKit/Shared/win/WebEventFactory.cpp ++++ b/Source/WebKit/Shared/win/WebEventFactory.cpp +@@ -476,7 +476,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(HWND hwnd, UINT message + #if ENABLE(TOUCH_EVENTS) + WebTouchEvent WebEventFactory::createWebTouchEvent() + { +- return WebTouchEvent(); ++ return WebTouchEvent({ WebEventType::TouchMove, OptionSet { }, WallTime::now()}, { }); + } + #endif // ENABLE(TOUCH_EVENTS) + diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt -index d38b9735d6f7730b4fc97863274805d44081516a..43f9cd8ceae182313451753507ad15c2ee7701ff 100644 +index 1790ef11dd6466bcdae4bf577fcc2403e2d5e8f6..b67201a17f528823345db0d8b0a835218e80daef 100644 --- a/Source/WebKit/Sources.txt +++ b/Source/WebKit/Sources.txt -@@ -384,21 +384,26 @@ Shared/XR/XRDeviceProxy.cpp - +@@ -376,6 +376,7 @@ Shared/XR/XRDeviceProxy.cpp UIProcess/AuxiliaryProcessProxy.cpp UIProcess/BackgroundProcessResponsivenessTimer.cpp + UIProcess/BrowsingContextGroup.cpp +UIProcess/BrowserInspectorPipe.cpp UIProcess/DeviceIdHashSaltStorage.cpp - UIProcess/DrawingAreaProxy.cpp + UIProcess/DisplayLink.cpp + UIProcess/DisplayLinkProcessProxyClient.cpp +@@ -383,16 +384,20 @@ UIProcess/DrawingAreaProxy.cpp UIProcess/FrameLoadState.cpp UIProcess/GeolocationPermissionRequestManagerProxy.cpp UIProcess/GeolocationPermissionRequestProxy.cpp @@ -10314,7 +9734,7 @@ index d38b9735d6f7730b4fc97863274805d44081516a..43f9cd8ceae182313451753507ad15c2 UIProcess/RemotePageDrawingAreaProxy.cpp UIProcess/RemotePageProxy.cpp UIProcess/ResponsivenessTimer.cpp -@@ -442,6 +447,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp +@@ -436,6 +441,8 @@ UIProcess/WebOpenPanelResultListenerProxy.cpp UIProcess/WebPageDiagnosticLoggingClient.cpp UIProcess/WebPageGroup.cpp UIProcess/WebPageInjectedBundleClient.cpp @@ -10323,7 +9743,7 @@ index d38b9735d6f7730b4fc97863274805d44081516a..43f9cd8ceae182313451753507ad15c2 UIProcess/WebPageProxy.cpp UIProcess/WebPageProxyMessageReceiverRegistration.cpp UIProcess/WebPasteboardProxy.cpp -@@ -573,7 +580,11 @@ UIProcess/Inspector/WebInspectorUtilities.cpp +@@ -567,7 +574,11 @@ UIProcess/Inspector/WebInspectorUtilities.cpp UIProcess/Inspector/WebPageDebuggable.cpp UIProcess/Inspector/WebPageInspectorController.cpp @@ -10336,10 +9756,10 @@ index d38b9735d6f7730b4fc97863274805d44081516a..43f9cd8ceae182313451753507ad15c2 UIProcess/Media/AudioSessionRoutingArbitratorProxy.cpp UIProcess/Media/MediaUsageManager.cpp diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt -index 58047624cd374a6e074e1e6bee1d891829d8ff43..f8670e9474dff752e03dab613b62c42f191262df 100644 +index 65a44447eae5a192a74ae4a05be7da2d68d99d28..ac0eb6d33feb5e601a4c58cc36243b1b9f8b56ca 100644 --- a/Source/WebKit/SourcesCocoa.txt +++ b/Source/WebKit/SourcesCocoa.txt -@@ -258,6 +258,7 @@ UIProcess/API/Cocoa/_WKApplicationManifest.mm +@@ -261,6 +261,7 @@ UIProcess/API/Cocoa/_WKArchiveExclusionRule.mm UIProcess/API/Cocoa/_WKAttachment.mm UIProcess/API/Cocoa/_WKAutomationSession.mm UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm @@ -10347,7 +9767,7 @@ index 58047624cd374a6e074e1e6bee1d891829d8ff43..f8670e9474dff752e03dab613b62c42f UIProcess/API/Cocoa/_WKContentRuleListAction.mm UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm UIProcess/API/Cocoa/_WKCustomHeaderFields.mm @no-unify -@@ -433,6 +434,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm +@@ -437,6 +438,7 @@ UIProcess/Inspector/ios/WKInspectorHighlightView.mm UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.mm UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm @@ -10356,10 +9776,10 @@ index 58047624cd374a6e074e1e6bee1d891829d8ff43..f8670e9474dff752e03dab613b62c42f UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm UIProcess/Inspector/mac/WKInspectorViewController.mm diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt -index 2a57e2ade1be21cc7603fd246702db002f5f1d9c..d552d6fc58a650ff17283ba2661b69a8ef7ddf93 100644 +index 37f7f79dfbdb9913fe96b0393f6a2547501f5c6e..f34cf6031976d89f73f872ba4029b79349e119de 100644 --- a/Source/WebKit/SourcesGTK.txt +++ b/Source/WebKit/SourcesGTK.txt -@@ -137,6 +137,7 @@ UIProcess/API/glib/WebKitAutomationSession.cpp @no-unify +@@ -136,6 +136,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 @@ -10367,15 +9787,15 @@ index 2a57e2ade1be21cc7603fd246702db002f5f1d9c..d552d6fc58a650ff17283ba2661b69a8 UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify UIProcess/API/glib/WebKitCookieManager.cpp @no-unify UIProcess/API/glib/WebKitCredential.cpp @no-unify -@@ -260,6 +261,7 @@ UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp - - UIProcess/cairo/BackingStoreCairo.cpp @no-unify - +@@ -264,6 +265,7 @@ UIProcess/glib/DisplayLinkGLib.cpp + UIProcess/glib/DisplayVBlankMonitor.cpp + UIProcess/glib/DisplayVBlankMonitorDRM.cpp + UIProcess/glib/DisplayVBlankMonitorTimer.cpp +UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp UIProcess/glib/WebPageProxyGLib.cpp UIProcess/glib/WebProcessPoolGLib.cpp UIProcess/glib/WebProcessProxyGLib.cpp -@@ -276,6 +278,7 @@ UIProcess/gtk/ClipboardGtk4.cpp @no-unify +@@ -280,6 +282,7 @@ UIProcess/gtk/ClipboardGtk4.cpp @no-unify UIProcess/gtk/WebDateTimePickerGtk.cpp UIProcess/gtk/GtkSettingsManager.cpp UIProcess/gtk/HardwareAccelerationManager.cpp @@ -10383,7 +9803,7 @@ index 2a57e2ade1be21cc7603fd246702db002f5f1d9c..d552d6fc58a650ff17283ba2661b69a8 UIProcess/gtk/KeyBindingTranslator.cpp UIProcess/gtk/PointerLockManager.cpp @no-unify UIProcess/gtk/PointerLockManagerWayland.cpp @no-unify -@@ -288,6 +291,8 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp +@@ -292,6 +295,8 @@ UIProcess/gtk/ViewGestureControllerGtk.cpp UIProcess/gtk/WebColorPickerGtk.cpp UIProcess/gtk/WebContextMenuProxyGtk.cpp UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp @@ -10393,10 +9813,10 @@ index 2a57e2ade1be21cc7603fd246702db002f5f1d9c..d552d6fc58a650ff17283ba2661b69a8 UIProcess/gtk/WebPasteboardProxyGtk.cpp UIProcess/gtk/WebPopupMenuProxyGtk.cpp diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt -index dff682afe7c62277b2a93fca6d42a33faf104d43..78035018705d3a0e7ece7691561fb39d874c1ec1 100644 +index 92cad8cba5e36ffac473217f9120319bd7c839e7..fb42fe7eafe2c49891e31e1d456fef186b247064 100644 --- a/Source/WebKit/SourcesWPE.txt +++ b/Source/WebKit/SourcesWPE.txt -@@ -92,6 +92,7 @@ Shared/glib/ProcessExecutablePathGLib.cpp +@@ -91,6 +91,7 @@ Shared/glib/ProcessExecutablePathGLib.cpp Shared/glib/UserMessage.cpp Shared/glib/WebContextMenuItemGlib.cpp @@ -10404,7 +9824,7 @@ index dff682afe7c62277b2a93fca6d42a33faf104d43..78035018705d3a0e7ece7691561fb39d Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp Shared/libwpe/NativeWebMouseEventLibWPE.cpp Shared/libwpe/NativeWebTouchEventLibWPE.cpp -@@ -131,6 +132,7 @@ UIProcess/API/glib/WebKitAuthenticationRequest.cpp @no-unify +@@ -130,6 +131,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 @@ -10412,7 +9832,7 @@ index dff682afe7c62277b2a93fca6d42a33faf104d43..78035018705d3a0e7ece7691561fb39d UIProcess/API/glib/WebKitContextMenuClient.cpp @no-unify UIProcess/API/glib/WebKitCookieManager.cpp @no-unify UIProcess/API/glib/WebKitCredential.cpp @no-unify -@@ -164,6 +166,7 @@ UIProcess/API/glib/WebKitOptionMenu.cpp @no-unify +@@ -163,6 +165,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 @@ -10420,7 +9840,7 @@ index dff682afe7c62277b2a93fca6d42a33faf104d43..78035018705d3a0e7ece7691561fb39d UIProcess/API/glib/WebKitPolicyDecision.cpp @no-unify UIProcess/API/glib/WebKitPrivate.cpp @no-unify UIProcess/API/glib/WebKitProtocolHandler.cpp @no-unify -@@ -200,6 +203,7 @@ UIProcess/API/soup/HTTPCookieStoreSoup.cpp +@@ -199,6 +202,7 @@ UIProcess/API/soup/HTTPCookieStoreSoup.cpp UIProcess/API/wpe/InputMethodFilterWPE.cpp @no-unify UIProcess/API/wpe/PageClientImpl.cpp @no-unify UIProcess/API/wpe/WebKitColor.cpp @no-unify @@ -10428,15 +9848,15 @@ index dff682afe7c62277b2a93fca6d42a33faf104d43..78035018705d3a0e7ece7691561fb39d UIProcess/API/wpe/WebKitInputMethodContextWPE.cpp @no-unify UIProcess/API/wpe/WebKitPopupMenu.cpp @no-unify UIProcess/API/wpe/WebKitRectangle.cpp @no-unify -@@ -220,6 +224,7 @@ UIProcess/Gamepad/libwpe/UIGamepadProviderLibWPE.cpp - - UIProcess/geoclue/GeoclueGeolocationProvider.cpp - +@@ -223,6 +227,7 @@ UIProcess/glib/DisplayLinkGLib.cpp + UIProcess/glib/DisplayVBlankMonitor.cpp + UIProcess/glib/DisplayVBlankMonitorDRM.cpp + UIProcess/glib/DisplayVBlankMonitorTimer.cpp +UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp UIProcess/glib/WebPageProxyGLib.cpp UIProcess/glib/WebProcessPoolGLib.cpp UIProcess/glib/WebProcessProxyGLib.cpp -@@ -248,6 +253,11 @@ UIProcess/linux/MemoryPressureMonitor.cpp +@@ -251,6 +256,11 @@ UIProcess/linux/MemoryPressureMonitor.cpp UIProcess/soup/WebProcessPoolSoup.cpp @@ -10448,7 +9868,7 @@ index dff682afe7c62277b2a93fca6d42a33faf104d43..78035018705d3a0e7ece7691561fb39d UIProcess/wpe/WebPageProxyWPE.cpp WebProcess/GPU/graphics/gbm/RemoteGraphicsContextGLProxyGBM.cpp -@@ -270,6 +280,8 @@ WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp +@@ -273,6 +283,8 @@ WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp @@ -10505,7 +9925,7 @@ index dbbfea6be4b6f1ae3bd2070dc9b8e79fdbf28ff3..b7dd65cb00d64f67805597ba7a66f1a6 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 f3e3b7ef340958b5a46c9252ff63a140afc24e2c..4b516ac0840608638209705250d8bf7ed6509f09 100644 +index 92813cde60765506eb09eb76831c8f194720cf03..eb2076c9cbbd2c113691598af5e548dcd96c1502 100644 --- a/Source/WebKit/UIProcess/API/APIUIClient.h +++ b/Source/WebKit/UIProcess/API/APIUIClient.h @@ -112,6 +112,7 @@ public: @@ -10517,7 +9937,7 @@ index f3e3b7ef340958b5a46c9252ff63a140afc24e2c..4b516ac0840608638209705250d8bf7e virtual void setStatusText(WebKit::WebPageProxy*, const WTF::String&) { } virtual void mouseDidMoveOverElement(WebKit::WebPageProxy&, const WebKit::WebHitTestResultData&, OptionSet, Object*) { } diff --git a/Source/WebKit/UIProcess/API/C/WKInspector.cpp b/Source/WebKit/UIProcess/API/C/WKInspector.cpp -index 988637e3347397ae751691f6356d090e1e5a9dbf..474c27a0849324c915e304d61b73ba4f98fdf365 100644 +index 990b0e5ebad19fdaf1b0036585be2ed88bc125d2..9f1931dbdd8c70d3637a2d71406b5968896037f2 100644 --- a/Source/WebKit/UIProcess/API/C/WKInspector.cpp +++ b/Source/WebKit/UIProcess/API/C/WKInspector.cpp @@ -28,6 +28,11 @@ @@ -10560,7 +9980,7 @@ index 026121d114c5fcad84c1396be8d692625beaa3bd..edd6e5cae033124c589959a42522fde0 } #endif diff --git a/Source/WebKit/UIProcess/API/C/WKPage.cpp b/Source/WebKit/UIProcess/API/C/WKPage.cpp -index f008969cf4d83c58d2c2b94642dc7f5d7a08bc4a..ec827835cfdb8c9fb4b872c41d0b9e5d6197a363 100644 +index 8a6927f9f665f2d9fa7b9d0a813dd945a329d724..5c5610e1157bb654b9226dc7013ca1cc806d3005 100644 --- a/Source/WebKit/UIProcess/API/C/WKPage.cpp +++ b/Source/WebKit/UIProcess/API/C/WKPage.cpp @@ -1784,6 +1784,13 @@ void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient @@ -10647,10 +10067,10 @@ index 65d8ab73430840b02682ce879d1db18b9597d6b0..ea89752f4b90018ea1f008e0d89f9a2a // Version 15. WKPageDecidePolicyForSpeechRecognitionPermissionRequestCallback decidePolicyForSpeechRecognitionPermissionRequest; diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm b/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm -index fd1619cf0f9c3bea676e90ae81a84fa023f4b209..ad224273f275e697676ab4586da96dcda0807a68 100644 +index 039731566b16ebdf9ae4db1b2f64d809075adda8..bf09734942cea6caa5faa6ddf3d8036d2df55ccd 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm -@@ -716,6 +716,16 @@ - (void)_setMediaCaptureRequiresSecureConnection:(BOOL)requiresSecureConnection +@@ -706,6 +706,16 @@ - (void)_setMediaCaptureRequiresSecureConnection:(BOOL)requiresSecureConnection _preferences->setMediaCaptureRequiresSecureConnection(requiresSecureConnection); } @@ -10668,10 +10088,10 @@ index fd1619cf0f9c3bea676e90ae81a84fa023f4b209..ad224273f275e697676ab4586da96dcd { return _preferences->inactiveMediaCaptureSteamRepromptIntervalInMinutes(); diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h -index 6b22ff70ebf73b69fb2ad02eed21d0dc016fb5e1..1df25b413da2e5b358597b8b500bc2ea921e9c6f 100644 +index 00dae895eda9db80aac60bd927bac1f68756e9d5..11131d66ff21266ac52bc873d497a8625082be35 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h +++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h -@@ -122,6 +122,7 @@ typedef NS_ENUM(NSInteger, _WKPitchCorrectionAlgorithm) { +@@ -121,6 +121,7 @@ typedef NS_ENUM(NSInteger, _WKPitchCorrectionAlgorithm) { @property (nonatomic, setter=_setMockCaptureDevicesEnabled:) BOOL _mockCaptureDevicesEnabled WK_API_AVAILABLE(macos(10.13), ios(11.0)); @property (nonatomic, setter=_setMockCaptureDevicesPromptEnabled:) BOOL _mockCaptureDevicesPromptEnabled WK_API_AVAILABLE(macos(10.13.4), ios(11.3)); @property (nonatomic, setter=_setMediaCaptureRequiresSecureConnection:) BOOL _mediaCaptureRequiresSecureConnection WK_API_AVAILABLE(macos(10.13), ios(11.0)); @@ -10697,7 +10117,7 @@ index 24b33cf16d46efce11a30032925600b97e64c65d..422355368191b9189b6283338bea2244 /*! @abstract A delegate to request permission for microphone audio and camera video access. @param webView The web view invoking the delegate method. diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h -index fe711453fd4ef346ff7d88bfec878642b6eb32d6..c3e4fcf0b51e827b6945c89613f22b17ab55f5fb 100644 +index 4f5956098f0e83c2e9c421c97056b6718b124a3c..1eb51dd70dc6ef1b7e95a09118aa816b4f77e2d7 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h @@ -24,7 +24,6 @@ @@ -10708,8 +10128,8 @@ index fe711453fd4ef346ff7d88bfec878642b6eb32d6..c3e4fcf0b51e827b6945c89613f22b17 #import #if __has_include() -@@ -120,6 +119,8 @@ WK_CLASS_AVAILABLE(macos(10.11), ios(9.0)) - @property (nullable, nonatomic, copy) NSArray *proxyConfigurations NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.0), ios(17.0)); +@@ -124,6 +123,8 @@ WK_CLASS_AVAILABLE(macos(10.11), ios(9.0)) + #endif #endif +- (uint64_t)sessionID; @@ -10718,7 +10138,7 @@ index fe711453fd4ef346ff7d88bfec878642b6eb32d6..c3e4fcf0b51e827b6945c89613f22b17 NS_ASSUME_NONNULL_END diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm -index d19ba0dec9f449f10ca00d7aa86e4aef760c6044..19f6b7c82cc9fc5b3db708f428563ac5a888955d 100644 +index 2e52c12e36fde4dc6eb16dea399c4a201ba522e3..52a262a9da3fd7c9ea67f2ee8830e469f487a11d 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm @@ -50,6 +50,7 @@ @@ -10729,7 +10149,7 @@ index d19ba0dec9f449f10ca00d7aa86e4aef760c6044..19f6b7c82cc9fc5b3db708f428563ac5 #import #import #import -@@ -371,6 +372,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple +@@ -382,6 +383,11 @@ - (void)removeDataOfTypes:(NSSet *)dataTypes modifiedSince:(NSDate *)date comple }); } @@ -10881,7 +10301,7 @@ index f3ace77b4d203c03dc28b31711245dd42d339f67..9006770a34b95b48c346066dc5e447ed @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 5dbdde074da5226c4a76ec5a4fcf54b3fb717849..f2aa93846c6d22c20e0584d90afc46e947ffebf8 100644 +index 2827f2dbaac2a478c4e4e44f00d8d31f923d609f..abed07fed192f34d7636c53b6ce38856bf51e088 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm @@ -241,6 +241,16 @@ - (BOOL)processSwapsOnNavigation @@ -10902,7 +10322,7 @@ index 5dbdde074da5226c4a76ec5a4fcf54b3fb717849..f2aa93846c6d22c20e0584d90afc46e9 { _processPoolConfiguration->setIsAutomaticProcessWarmingEnabled(prewarms); diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm -index 96d3ce10e76c3d24a452d6d22c7c7dc5bc141958..38ef5226464059584db57f8497eb7a4f470ccea2 100644 +index e5209134d490c226db6a122f4f0f3f38d26e20eb..47a41b11999d7927fbfbe033e3630eac86d61e99 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm @@ -24,6 +24,7 @@ @@ -10926,7 +10346,7 @@ index 4974e14214e2bb3e982325b885bab33e54f83998..cacdf8c71fab248d38d2faf03f7affdc typedef NS_ENUM(NSInteger, _WKUserStyleLevel) { _WKUserStyleUserLevel, diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm -index 1e827013c603ae8bd43d798170deb98fc3153852..2075bc78069bde530ec237c0b761773c10013948 100644 +index 705a8483a04c8abe863bd788f5a4ea6a09414f27..c0e69429369155aa3974c508e755292c81c89e19 100644 --- a/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm +++ b/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheet.mm @@ -35,6 +35,7 @@ @@ -11155,7 +10575,7 @@ index d75c5ee48b2cedc8df984841fd52478b0620078c..d9cd7bf5749ff192eb938b12b4c2d82b 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 e7f316fcd23487da0a356b36c467024503d491b3..b2a3717793e262d2c6a4338fef059cc02df062b5 100644 +index d897f14bbc9cc9743072759b54905776813aaf72..3c0e61fb6e54071deeb978cd16ad2eff959e5343 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp @@ -413,10 +413,19 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa @@ -11224,7 +10644,7 @@ index e994309b097c1b140abfa4373fd2fafee46c05ec..6e0cc677a3bf33683ae8c89d12a48191 #endif +int webkitWebContextExistingCount(); diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -index f7b6b9edc676320c8e557e20551411eaa07aad0f..1881ca72d1b6adf15d3c7e9148615c0fa47f6e4f 100644 +index e88f6bcb93750dc47e616758d91eb8c5ae7de85a..ffbe6424d8433ee617ed63f37f8f6f09f9ad9eef 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp @@ -34,6 +34,7 @@ @@ -11290,7 +10710,7 @@ index f7b6b9edc676320c8e557e20551411eaa07aad0f..1881ca72d1b6adf15d3c7e9148615c0f if (WEBKIT_IS_POINTER_LOCK_PERMISSION_REQUEST(request)) { webkit_permission_request_allow(request); return TRUE; -@@ -1849,6 +1859,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) +@@ -1851,6 +1861,15 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_SCRIPT_DIALOG); @@ -11306,7 +10726,7 @@ index f7b6b9edc676320c8e557e20551411eaa07aad0f..1881ca72d1b6adf15d3c7e9148615c0f /** * WebKitWebView::decide-policy: * @web_view: the #WebKitWebView on which the signal is emitted -@@ -2647,6 +2666,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const +@@ -2649,6 +2668,23 @@ void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView* webView, const webkit_script_dialog_unref(webView->priv->currentScriptDialog); } @@ -11331,7 +10751,7 @@ index f7b6b9edc676320c8e557e20551411eaa07aad0f..1881ca72d1b6adf15d3c7e9148615c0f { if (!webView->priv->currentScriptDialog) diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h -index c2c3aaa89344742b3e53e2e7afc004828e02b46e..7863882532a6cf4cb592a475ff165a264c3c1913 100644 +index 8b5eb1ce720c9ad09b9de9e9f3d6b15564a86b54..89642048bad844aabdf1eec8486679bfc75e20c0 100644 --- a/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h @@ -65,6 +65,7 @@ void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message, Fun @@ -11355,7 +10775,7 @@ index 805f9f638c1630b5e9310494ae2970262de001cc..add3e80896c2e82bdd12cee15c8014bf #include <@API_INCLUDE_PREFIX@/WebKitClipboardPermissionRequest.h> #include <@API_INCLUDE_PREFIX@/WebKitColorChooserRequest.h> diff --git a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp -index 8abaceabaa129b7d2ae369c8840bdfc41699f580..51f8e259b424a7416f1613f4d7e40a5f4cd8b8e8 100644 +index 0c0dda4c205cf57f6468226d26f10b7524d7637c..319c2ffe8bdd94fb9a618e05f5619147589e3a84 100644 --- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp +++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp @@ -257,6 +257,8 @@ void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool @@ -11367,7 +10787,7 @@ index 8abaceabaa129b7d2ae369c8840bdfc41699f580..51f8e259b424a7416f1613f4d7e40a5f // Always consider arrow keys as handled, otherwise the GtkWindow key bindings will move the focus. guint keyval; -@@ -351,9 +353,9 @@ void PageClientImpl::selectionDidChange() +@@ -355,9 +357,9 @@ void PageClientImpl::selectionDidChange() webkitWebViewSelectionDidChange(WEBKIT_WEB_VIEW(m_viewWidget)); } @@ -11380,10 +10800,10 @@ index 8abaceabaa129b7d2ae369c8840bdfc41699f580..51f8e259b424a7416f1613f4d7e40a5f 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 4f76c28957f07642dc1b0002368c722f40797900..b31bfdd45e6a7fb959143f5c8979d117f2766646 100644 +index 588447de7e900946c4ab47664bf9fc86809cb641..45858ff872378b288b1173a300cd11a5858ddd77 100644 --- a/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h +++ b/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h -@@ -103,7 +103,7 @@ private: +@@ -105,7 +105,7 @@ private: #endif Ref createValidationBubble(const String& message, const WebCore::ValidationBubble::Settings&) final; void selectionDidChange() override; @@ -11493,10 +10913,10 @@ index 496079da90993ac37689b060b69ecd4a67c2b6a8..af30181ca922f16c0f6e245c70e5ce7d G_BEGIN_DECLS diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp -index 6eb11ae3ae2cd7667d10d165de33342713306cd7..41c420b6e395a67218b9942e7ef879c7958515fb 100644 +index 86d4fd3a8ce403cdd71b286f82debe7d134f0763..8e2b155018d12a3be84b00585e4607dc71af56af 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp -@@ -2823,6 +2823,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase) +@@ -2853,6 +2853,11 @@ void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase) #endif } @@ -11508,7 +10928,7 @@ index 6eb11ae3ae2cd7667d10d165de33342713306cd7..41c420b6e395a67218b9942e7ef879c7 void webkitWebViewBaseEnterAcceleratedCompositingMode(WebKitWebViewBase* webkitWebViewBase, const LayerTreeContext& layerTreeContext) { ASSERT(webkitWebViewBase->priv->acceleratedBackingStore); -@@ -2883,12 +2888,12 @@ void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase) +@@ -2909,12 +2914,12 @@ void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase) webkitWebViewBase->priv->acceleratedBackingStore->update({ }); } @@ -11524,7 +10944,7 @@ index 6eb11ae3ae2cd7667d10d165de33342713306cd7..41c420b6e395a67218b9942e7ef879c7 #if !USE(GTK4) diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h -index 1204b4342c1cf8d38d215c1c8628bd7eb1fbd415..43265c737ecaa3ee24513ad50ca3c3650ebeb698 100644 +index fec76e55f1680da5b248552db6c96134742bdcba..dfb0b07c2e2447b9b4ee3841b90726b245cfbdd3 100644 --- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h +++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h @@ -27,6 +27,7 @@ @@ -11535,7 +10955,7 @@ index 1204b4342c1cf8d38d215c1c8628bd7eb1fbd415..43265c737ecaa3ee24513ad50ca3c365 #include "APIPageConfiguration.h" #include "InputMethodState.h" #include "SameDocumentNavigationType.h" -@@ -97,7 +98,7 @@ void webkitWebViewBaseStartDrag(WebKitWebViewBase*, WebCore::SelectionData&&, Op +@@ -102,7 +103,7 @@ void webkitWebViewBaseStartDrag(WebKitWebViewBase*, WebCore::SelectionData&&, Op void webkitWebViewBaseDidPerformDragControllerAction(WebKitWebViewBase*); #endif @@ -11544,10 +10964,10 @@ index 1204b4342c1cf8d38d215c1c8628bd7eb1fbd415..43265c737ecaa3ee24513ad50ca3c365 void webkitWebViewBaseSetEnableBackForwardNavigationGesture(WebKitWebViewBase*, bool enabled); WebKit::ViewGestureController* webkitWebViewBaseViewGestureController(WebKitWebViewBase*); -@@ -130,3 +131,5 @@ void webkitWebViewBaseSynthesizeWheelEvent(WebKitWebViewBase*, const GdkEvent*, - void webkitWebViewBaseMakeBlank(WebKitWebViewBase*, bool); - void webkitWebViewBasePageGrabbedTouch(WebKitWebViewBase*); - void webkitWebViewBaseSetShouldNotifyFocusEvents(WebKitWebViewBase*, bool); +@@ -141,3 +142,5 @@ void webkitWebViewBaseToplevelWindowStateChanged(WebKitWebViewBase*, uint32_t, u + void webkitWebViewBaseToplevelWindowMonitorChanged(WebKitWebViewBase*, GdkMonitor*); + + void webkitWebViewBaseCallAfterNextPresentationUpdate(WebKitWebViewBase*, CompletionHandler&&); + +WebKit::AcceleratedBackingStore* webkitWebViewBaseGetAcceleratedBackingStore(WebKitWebViewBase*); diff --git a/Source/WebKit/UIProcess/API/wpe/APIViewClient.h b/Source/WebKit/UIProcess/API/wpe/APIViewClient.h @@ -11573,13 +10993,13 @@ index 5506eb798d7df211e975b88f293428d7a00e8f65..41b4a0169a4479a0f2131227aadc7350 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 7a1548fcbe2667f71602bfa69cdd0b25fc7a6056..24e1db8e7b9f65fa0c064b8a741adb4c6bbba45e 100644 +index f927aeea12d50643000bcce90ce2d31ab5c17072..9fd3b35bb6d6831c0e9e7ec8e12d99ace3c40062 100644 --- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp +++ b/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp @@ -33,8 +33,11 @@ #include "NativeWebWheelEvent.h" #include "TouchGestureController.h" - #include "WPEView.h" + #include "WPEWebView.h" +#include "WebColorPickerWPE.h" +#include "WebDateTimePickerWPE.h" #include "WebContextMenuProxy.h" @@ -11679,10 +11099,10 @@ index d14abff9ca046b2c3a1423c4a47341210b7198d1..f717239df9de9097bfa31193b817e26b WKWPE::View& m_view; }; -diff --git a/Source/WebKit/UIProcess/API/wpe/WPEView.cpp b/Source/WebKit/UIProcess/API/wpe/WPEView.cpp -index d6f4b65c9dd7249d89d0ee56c556c8bd26b5a55a..e77f1530c94584fa260670e99b33cf91fc25bfa0 100644 ---- a/Source/WebKit/UIProcess/API/wpe/WPEView.cpp -+++ b/Source/WebKit/UIProcess/API/wpe/WPEView.cpp +diff --git a/Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp b/Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp +index 762e771e09ca5f40afbd32bd35930c6217272ddc..97698110ac1652e902135427552eaf6cfb03cb3e 100644 +--- a/Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp ++++ b/Source/WebKit/UIProcess/API/wpe/WPEWebView.cpp @@ -76,7 +76,9 @@ View::View(struct wpe_view_backend* backend, const API::PageConfiguration& baseC if (preferences) { preferences->setAcceleratedCompositingEnabled(true); @@ -11691,9 +11111,9 @@ index d6f4b65c9dd7249d89d0ee56c556c8bd26b5a55a..e77f1530c94584fa260670e99b33cf91 + // Playwright override begin + preferences->setThreadedScrollingEnabled(false); + // Playwright override end - preferences->setWebGLEnabled(true); } + auto* pool = configuration->processPool(); 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 @@ -11988,10 +11408,10 @@ index 8a8356b94e0632118a24bb9adf5a1fe72f10fb8d..f332ffe5e633dce8e8a7f0f2a411ca29 void didChangePageID(WKWPE::View&) override; void didReceiveUserMessage(WKWPE::View&, WebKit::UserMessage&&, CompletionHandler&&) override; diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp -index f297d86285bcc3f975638be9b7750ae7ce11f05f..85b07321c8b155bcf6433f0d7c7807224039e342 100644 +index de794bd3c1e9a598ae76b326d6171cebf4289fa9..5db786bccc7db3be4ce82fac3e3d2f5ccd5a07a6 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp -@@ -127,7 +127,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau +@@ -144,7 +144,11 @@ void AuxiliaryProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& lau launchOptions.processCmdPrefix = String::fromUTF8(processCmdPrefix); #endif // ENABLE(DEVELOPER_MODE) && (PLATFORM(GTK) || PLATFORM(WPE)) @@ -12004,10 +11424,10 @@ index f297d86285bcc3f975638be9b7750ae7ce11f05f..85b07321c8b155bcf6433f0d7c780722 platformGetLaunchOptions(launchOptions); } diff --git a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h -index 90e6a8f4292c8fbcbd0cc36fa3618f8b7d2d62cc..14ac561735f2de4ccd0b2ef74e7e7a1f41c1d983 100644 +index c951a2baaf6819908b2d18e276b048f2aa69c86c..12ac9e139ee9aad1e4e6502e01b03e5d16888113 100644 --- a/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h +++ b/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h -@@ -208,13 +208,16 @@ protected: +@@ -221,13 +221,16 @@ protected: static RefPtr fetchAudioComponentServerRegistrations(); #endif @@ -12170,7 +11590,7 @@ index 957f7f088087169668a9b4f1ba65d9f206a2a836..15e44c8d5b6a3eafb7f1148707366b0c class PopUpSOAuthorizationSession final : public SOAuthorizationSession { public: diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h -index 7b4841ee8a15252d24fa7378a2005efb2db96f6f..d3eb7886316c7c1b45fb4673df15b7438249c65c 100644 +index ca367804b622de941ab3792edcf79d17f3a19193..6249e19713f3b13cca3e1081a3469ef5eef2f698 100644 --- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.h +++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.h @@ -95,6 +95,7 @@ private: @@ -12181,7 +11601,7 @@ index 7b4841ee8a15252d24fa7378a2005efb2db96f6f..d3eb7886316c7c1b45fb4673df15b743 void presentStorageAccessConfirmDialog(const WTF::String& requestingDomain, const WTF::String& currentDomain, CompletionHandler&&); void requestStorageAccessConfirm(WebPageProxy&, WebFrameProxy*, const WebCore::RegistrableDomain& requestingDomain, const WebCore::RegistrableDomain& currentDomain, CompletionHandler&&) final; void decidePolicyForGeolocationPermissionRequest(WebPageProxy&, WebFrameProxy&, const FrameInfoData&, Function&) final; -@@ -203,6 +204,7 @@ private: +@@ -205,6 +206,7 @@ private: bool webViewRunJavaScriptAlertPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler : 1; @@ -12190,7 +11610,7 @@ index 7b4841ee8a15252d24fa7378a2005efb2db96f6f..d3eb7886316c7c1b45fb4673df15b743 bool webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; bool webViewRequestGeolocationPermissionForFrameDecisionHandler : 1; diff --git a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm -index 17e89992472d58c617b5c9c0bd0d478b7c1e9123..aea3be250928924fd68910e0309c835a0dac2446 100644 +index be7f2e3a3dcdf9f22ff1a950b07f03488cbc1c3f..8148730b798729df7be190673f84a3c6e98c08bd 100644 --- a/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm +++ b/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm @@ -117,6 +117,7 @@ void UIDelegate::setDelegate(id delegate) @@ -12201,7 +11621,7 @@ index 17e89992472d58c617b5c9c0bd0d478b7c1e9123..aea3be250928924fd68910e0309c835a m_delegateMethods.webViewRequestStorageAccessPanelUnderFirstPartyCompletionHandler = [delegate respondsToSelector:@selector(_webView:requestStorageAccessPanelForDomain:underCurrentDomain:completionHandler:)]; m_delegateMethods.webViewRunBeforeUnloadConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:)]; m_delegateMethods.webViewRequestGeolocationPermissionForOriginDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestGeolocationPermissionForOrigin:initiatedByFrame:decisionHandler:)]; -@@ -427,6 +428,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St +@@ -437,6 +438,15 @@ void UIDelegate::UIClient::runJavaScriptPrompt(WebPageProxy& page, const WTF::St }).get()]; } @@ -12218,10 +11638,10 @@ index 17e89992472d58c617b5c9c0bd0d478b7c1e9123..aea3be250928924fd68910e0309c835a { if (!m_uiDelegate) diff --git a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm -index 361bf358f4a63482d7cc1a2358ce93e6965b5289..c9545d1937f5526741bba0d7558c8cde2dc083c0 100644 +index 3c58aeaad9a258806eb6979bd40eb59f298ac190..05c638cdbad087fe8bbdd0ed9fe84b13e27feea1 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm -@@ -37,6 +37,7 @@ +@@ -38,6 +38,7 @@ #import "LoadParameters.h" #import "MessageSenderInlines.h" #import "PageClient.h" @@ -12229,7 +11649,7 @@ index 361bf358f4a63482d7cc1a2358ce93e6965b5289..c9545d1937f5526741bba0d7558c8cde #import "PlaybackSessionManagerProxy.h" #import "QuickLookThumbnailLoader.h" #import "RemoteLayerTreeTransaction.h" -@@ -278,10 +279,87 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() +@@ -279,10 +280,87 @@ bool WebPageProxy::scrollingUpdatesDisabledForTesting() void WebPageProxy::startDrag(const DragItem& dragItem, ShareableBitmap::Handle&& dragImageHandle) { @@ -12319,10 +11739,10 @@ index 361bf358f4a63482d7cc1a2358ce93e6965b5289..c9545d1937f5526741bba0d7558c8cde #if ENABLE(ATTACHMENT_ELEMENT) diff --git a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -index f064a1cfe684ce89caa2c45ccae4cd673b0d526d..65e866b3a6b9ab535c0cddcfef19c9db10c75103 100644 +index fa8a3ce8b0585f9e81308dcea0a9f6721b82e31d..2fc423491020f88ff19f4934699568f33150f141 100644 --- a/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm +++ b/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm -@@ -457,7 +457,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END +@@ -404,7 +404,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END auto screenProperties = WebCore::collectScreenProperties(); parameters.screenProperties = WTFMove(screenProperties); #if PLATFORM(MAC) @@ -12343,18 +11763,20 @@ index f064a1cfe684ce89caa2c45ccae4cd673b0d526d..65e866b3a6b9ab535c0cddcfef19c9db m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidBecomeActiveNotification object:NSApp queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) { diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp -index bf1ede749837580db8c5e487e5bacaf916d9c270..c1d38acabec8c59bc460dab264088abc377976d0 100644 +index ff5329fb9b917a9bc53e8b017516099a10b6925e..8f57d208a81c81d255a68ca7130059e956d5b3db 100644 --- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp +++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp -@@ -33,12 +33,15 @@ +@@ -33,14 +33,17 @@ #include "LayerTreeContext.h" #include "MessageSenderInlines.h" #include "UpdateInfo.h" +#include "WebPageInspectorController.h" #include "WebPageProxy.h" #include "WebPreferences.h" + #include "WebProcessPool.h" #include "WebProcessProxy.h" #include + #include +#include #if PLATFORM(GTK) @@ -12362,7 +11784,7 @@ index bf1ede749837580db8c5e487e5bacaf916d9c270..c1d38acabec8c59bc460dab264088abc #include #endif -@@ -46,6 +49,13 @@ +@@ -48,6 +51,13 @@ #include #endif @@ -12376,8 +11798,8 @@ index bf1ede749837580db8c5e487e5bacaf916d9c270..c1d38acabec8c59bc460dab264088abc namespace WebKit { using namespace WebCore; -@@ -149,6 +159,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange() - m_webPageProxy.send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy.deviceScaleFactor()), m_identifier); +@@ -161,6 +171,11 @@ void DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange() + protectedWebPageProxy()->send(Messages::DrawingArea::SetDeviceScaleFactor(m_webPageProxy->deviceScaleFactor()), m_identifier); } +void DrawingAreaProxyCoordinatedGraphics::waitForSizeUpdate(Function&& callback) @@ -12388,8 +11810,8 @@ index bf1ede749837580db8c5e487e5bacaf916d9c270..c1d38acabec8c59bc460dab264088abc void DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable) { #if !PLATFORM(WPE) -@@ -215,6 +230,45 @@ void DrawingAreaProxyCoordinatedGraphics::targetRefreshRateDidChange(unsigned ra - m_webPageProxy.send(Messages::DrawingArea::TargetRefreshRateDidChange(rate), m_identifier); +@@ -222,6 +237,45 @@ void DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode(uint6 + updateAcceleratedCompositingMode(layerTreeContext); } +#if PLATFORM(WIN) @@ -12406,12 +11828,12 @@ index bf1ede749837580db8c5e487e5bacaf916d9c270..c1d38acabec8c59bc460dab264088abc +#if PLATFORM(WIN) + HWndDC dc; + if (m_isInAcceleratedCompositingMode) { -+ dc.setHWnd(reinterpret_cast(m_webPageProxy.viewWidget())); ++ dc.setHWnd(reinterpret_cast(protectedWebPageProxy()->viewWidget())); + surface = adoptRef(cairo_win32_surface_create(dc)); +#else + if (isInAcceleratedCompositingMode()) { +# if PLATFORM(GTK) -+ AcceleratedBackingStore* backingStore = webkitWebViewBaseGetAcceleratedBackingStore(WEBKIT_WEB_VIEW_BASE(m_webPageProxy.viewWidget())); ++ AcceleratedBackingStore* backingStore = webkitWebViewBaseGetAcceleratedBackingStore(WEBKIT_WEB_VIEW_BASE(protectedWebPageProxy()->viewWidget())); + if (!backingStore) + return; + @@ -12427,14 +11849,14 @@ index bf1ede749837580db8c5e487e5bacaf916d9c270..c1d38acabec8c59bc460dab264088abc + if (!surface) + return; + -+ m_webPageProxy.inspectorController().didPaint(surface.get()); ++ protectedWebPageProxy()->inspectorController().didPaint(surface.get()); +} +#endif + bool DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing() const { - return m_webPageProxy.preferences().acceleratedCompositingEnabled() && m_webPageProxy.preferences().forceCompositingMode(); -@@ -269,6 +323,11 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() + return m_webPageProxy->preferences().acceleratedCompositingEnabled() && m_webPageProxy->preferences().forceCompositingMode(); +@@ -276,6 +330,11 @@ void DrawingAreaProxyCoordinatedGraphics::didUpdateGeometry() // we need to resend the new size here. if (m_lastSentSize != m_size) sendUpdateGeometry(); @@ -12447,7 +11869,7 @@ index bf1ede749837580db8c5e487e5bacaf916d9c270..c1d38acabec8c59bc460dab264088abc #if !PLATFORM(WPE) diff --git a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h -index 482795eb9d23e54d3e0dca1f7fb38aaab58818db..3c20d84970d6304392a760db1726baa3acf62e7f 100644 +index 16ce79d7f60b4f8df74ed74ad11502d269462a44..301e74438fd199c2021dd3108d17c56b5cb18d09 100644 --- a/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h +++ b/Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h @@ -30,6 +30,7 @@ @@ -12469,17 +11891,17 @@ index 482795eb9d23e54d3e0dca1f7fb38aaab58818db..3c20d84970d6304392a760db1726baa3 void dispatchAfterEnsuringDrawing(CompletionHandler&&); -@@ -69,6 +74,9 @@ private: +@@ -72,6 +77,9 @@ private: + void enterAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override; void exitAcceleratedCompositingMode(uint64_t backingStoreStateID, UpdateInfo&&) override; void updateAcceleratedCompositingMode(uint64_t backingStoreStateID, const LayerTreeContext&) override; - void targetRefreshRateDidChange(unsigned) override; +#if PLATFORM(WIN) + void didChangeAcceleratedCompositingMode(bool enabled) override; +#endif bool shouldSendWheelEventsToEventDispatcher() const override { return true; } -@@ -118,6 +126,7 @@ private: +@@ -114,6 +122,7 @@ private: // The last size we sent to the web process. WebCore::IntSize m_lastSentSize; @@ -12487,7 +11909,7 @@ index 482795eb9d23e54d3e0dca1f7fb38aaab58818db..3c20d84970d6304392a760db1726baa3 #if !PLATFORM(WPE) bool m_isBackingStoreDiscardable { true }; -@@ -126,6 +135,10 @@ private: +@@ -122,6 +131,10 @@ private: RunLoop::Timer m_discardBackingStoreTimer; #endif std::unique_ptr m_drawingMonitor; @@ -12499,7 +11921,7 @@ index 482795eb9d23e54d3e0dca1f7fb38aaab58818db..3c20d84970d6304392a760db1726baa3 } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp -index 3778bb4b451fb4e61dba05293fef541c39022e02..689e54828a1cf2536169feb0d30971908fb81137 100644 +index c6eeb8dca2ad5eb2b8a385cea8bf33795b15fd3a..14c9ef83023b1303d1c05fa73aaa67618e0502f8 100644 --- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp +++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp @@ -41,8 +41,10 @@ @@ -12591,18 +12013,18 @@ index 9b69cad753b5b2e3844caac57b44c067507e68e7..1e898d7311a2cb8cb6d9a4042f91f41c } // namespace WebKit diff --git a/Source/WebKit/UIProcess/DrawingAreaProxy.h b/Source/WebKit/UIProcess/DrawingAreaProxy.h -index 6df5f84736de1e30958171ee39cbc91ff786798d..4c084b4c223580487a4f90f59e416a6c1c0f4854 100644 +index f740edbcc1e243089bb9ad48b03d58cf1587bd8d..24c271c24298bcd6145ddd5efba9fbb792753bd4 100644 --- a/Source/WebKit/UIProcess/DrawingAreaProxy.h +++ b/Source/WebKit/UIProcess/DrawingAreaProxy.h -@@ -86,6 +86,7 @@ public: +@@ -87,6 +87,7 @@ public: const WebCore::IntSize& size() const { return m_size; } bool setSize(const WebCore::IntSize&, const WebCore::IntSize& scrollOffset = { }); + void waitForSizeUpdate(Function&&); - #if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER) - virtual void targetRefreshRateDidChange(unsigned) { } -@@ -163,6 +164,10 @@ private: + virtual void minimumSizeForAutoLayoutDidChange() { } + virtual void sizeToContentAutoSizeMaximumSizeDidChange() { } +@@ -162,6 +163,10 @@ private: virtual void update(uint64_t /* backingStoreStateID */, UpdateInfo&&) { } virtual void exitAcceleratedCompositingMode(uint64_t /* backingStoreStateID */, UpdateInfo&&) { } #endif @@ -12915,10 +12337,10 @@ index 0000000000000000000000000000000000000000..4ec8b96bbbddf8a7b042f53a8068754a +cairo_status_t cairo_image_surface_write_to_jpeg_mem(cairo_surface_t *sfc, unsigned char **data, size_t *len, int quality); diff --git a/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..9e726eaeab1d547b6a0dc4885868a15cc42c4862 +index 0000000000000000000000000000000000000000..844f559af924de3fddce8cfcea8550261a8da95b --- /dev/null +++ b/Source/WebKit/UIProcess/Inspector/Agents/InspectorScreencastAgent.cpp -@@ -0,0 +1,303 @@ +@@ -0,0 +1,305 @@ +/* + * Copyright (C) 2020 Microsoft Corporation. + * @@ -13159,6 +12581,8 @@ index 0000000000000000000000000000000000000000..9e726eaeab1d547b6a0dc4885868a15c + RunLoop::main().dispatchAfter(Seconds(1.0 / ScreencastEncoder::fps), [agent = WeakPtr { this }]() mutable { + if (!agent) + return; ++ if (!agent->m_page.hasPageClient()) ++ return; + + agent->encodeFrame(); + agent->scheduleFrameEncoding(); @@ -13943,7 +13367,7 @@ index 0000000000000000000000000000000000000000..e2ce910f3fd7f587add552275b7e7176 + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp -index 4a945dd8063cd7cd90174f6d4cd4197bcb98a101..16e73d6a724dd80487b7b140aaaccfec253eb7aa 100644 +index fedef553cec70feb6c6475a5f752fbc6833dbb38..16e73d6a724dd80487b7b140aaaccfec253eb7aa 100644 --- a/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp +++ b/Source/WebKit/UIProcess/Inspector/InspectorTargetProxy.cpp @@ -28,11 +28,10 @@ @@ -13959,7 +13383,7 @@ index 4a945dd8063cd7cd90174f6d4cd4197bcb98a101..16e73d6a724dd80487b7b140aaaccfec namespace WebKit { -@@ -40,18 +39,17 @@ using namespace Inspector; +@@ -40,19 +39,17 @@ using namespace Inspector; std::unique_ptr InspectorTargetProxy::create(WebPageProxy& page, const String& targetId, Inspector::InspectorTargetType type) { @@ -13970,7 +13394,8 @@ index 4a945dd8063cd7cd90174f6d4cd4197bcb98a101..16e73d6a724dd80487b7b140aaaccfec -std::unique_ptr InspectorTargetProxy::create(ProvisionalPageProxy& provisionalPage, const String& targetId, Inspector::InspectorTargetType type) +std::unique_ptr InspectorTargetProxy::create(ProvisionalPageProxy& provisionalPage, const String& targetId) { -- auto target = InspectorTargetProxy::create(provisionalPage.page(), targetId, type); +- Ref page = provisionalPage.page(); +- auto target = InspectorTargetProxy::create(page, targetId, type); - target->m_provisionalPage = provisionalPage; - return target; + return makeUnique(provisionalPage.page(), &provisionalPage, targetId, Inspector::InspectorTargetType::Page); @@ -13983,7 +13408,7 @@ index 4a945dd8063cd7cd90174f6d4cd4197bcb98a101..16e73d6a724dd80487b7b140aaaccfec , m_identifier(targetId) , m_type(type) { -@@ -98,6 +96,31 @@ void InspectorTargetProxy::didCommitProvisionalTarget() +@@ -99,6 +96,31 @@ void InspectorTargetProxy::didCommitProvisionalTarget() m_provisionalPage = nullptr; } @@ -14056,7 +13481,7 @@ index a2239cec8e18850f35f7f88a9c4ebadc62bf4023..79f3ff84327dc075ec96983e04db4b10 } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp -index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01201a5dba 100644 +index 6d229b943fe69cd258b32b1e38c5716715a4cd4b..77a7bacae6c09488b2c44dd1fd758679532c1a24 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.cpp @@ -26,13 +26,21 @@ @@ -14081,7 +13506,7 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 #include #include #include -@@ -49,27 +57,114 @@ static String getTargetID(const ProvisionalPageProxy& provisionalPage) +@@ -49,32 +57,119 @@ static String getTargetID(const ProvisionalPageProxy& provisionalPage) return WebPageInspectorTarget::toTargetID(provisionalPage.webPageID()); } @@ -14106,6 +13531,13 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 - m_agents.append(WTFMove(targetAgent)); } +-Ref WebPageInspectorController::protectedInspectedPage() ++CheckedRef WebPageInspectorController::protectedInspectedPage() + { +- return m_inspectedPage.get(); ++ return m_inspectedPage; + } + void WebPageInspectorController::init() { + auto targetAgent = makeUnique(m_frontendRouter.get(), m_backendDispatcher.get()); @@ -14125,15 +13557,15 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 + s_observer->didCreateInspectorController(m_inspectedPage); + + // window.open will create page with already running process. -+ if (!m_inspectedPage.hasRunningProcess()) ++ if (!m_inspectedPage->hasRunningProcess()) + return; - String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage.webPageID()); + String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID()); createInspectorTarget(pageTargetId, Inspector::InspectorTargetType::Page); } +void WebPageInspectorController::didFinishAttachingToWebProcess() +{ -+ String pageTargetID = WebPageInspectorTarget::toTargetID(m_inspectedPage.webPageID()); ++ String pageTargetID = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID()); + // Create target only after attaching to a Web Process first time. Before that + // we cannot event establish frontend connection. + if (m_targets.contains(pageTargetID)) @@ -14143,7 +13575,7 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 + void WebPageInspectorController::pageClosed() { -+ String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage.webPageID()); ++ String pageTargetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID()); + destroyInspectorTarget(pageTargetId); + disconnectAllFrontends(); @@ -14158,7 +13590,7 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 +{ + if (reason != ProcessTerminationReason::Crash) + return false; -+ String targetId = WebPageInspectorTarget::toTargetID(m_inspectedPage.webPageID()); ++ String targetId = WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID()); + auto it = m_targets.find(targetId); + if (it == m_targets.end()) + return false; @@ -14199,7 +13631,7 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 } bool WebPageInspectorController::hasLocalFrontend() const -@@ -83,6 +178,17 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro +@@ -88,6 +183,17 @@ void WebPageInspectorController::connectFrontend(Inspector::FrontendChannel& fro bool connectingFirstFrontend = !m_frontendRouter->hasFrontends(); @@ -14217,7 +13649,7 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 m_frontendRouter->connectFrontend(frontendChannel); if (connectingFirstFrontend) -@@ -101,8 +207,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha +@@ -107,8 +213,10 @@ void WebPageInspectorController::disconnectFrontend(FrontendChannel& frontendCha m_frontendRouter->disconnectFrontend(frontendChannel); bool disconnectingLastFrontend = !m_frontendRouter->hasFrontends(); @@ -14227,18 +13659,18 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 + m_pendingNavigations.clear(); + } - m_inspectedPage.didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); - -@@ -125,6 +233,8 @@ void WebPageInspectorController::disconnectAllFrontends() + auto inspectedPage = protectedInspectedPage(); + inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); +@@ -132,6 +240,8 @@ void WebPageInspectorController::disconnectAllFrontends() // Disconnect any remaining remote frontends. m_frontendRouter->disconnectAllFrontends(); + m_pendingNavigations.clear(); + - m_inspectedPage.didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); + auto inspectedPage = protectedInspectedPage(); + inspectedPage->didChangeInspectorFrontendCount(m_frontendRouter->frontendCount()); - #if ENABLE(REMOTE_INSPECTOR) -@@ -151,6 +261,66 @@ void WebPageInspectorController::setIndicating(bool indicating) +@@ -160,6 +270,66 @@ void WebPageInspectorController::setIndicating(bool indicating) } #endif @@ -14255,7 +13687,7 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 + +void WebPageInspectorController::navigate(WebCore::ResourceRequest&& request, WebFrameProxy* frame, NavigationHandler&& completionHandler) +{ -+ auto navigation = m_inspectedPage.loadRequestForInspector(WTFMove(request), frame); ++ auto navigation = m_inspectedPage->loadRequestForInspector(WTFMove(request), frame); + if (!navigation) { + completionHandler("Failed to navigate"_s, 0); + return; @@ -14304,8 +13736,8 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 + void WebPageInspectorController::createInspectorTarget(const String& targetId, Inspector::InspectorTargetType type) { - addTarget(InspectorTargetProxy::create(m_inspectedPage, targetId, type)); -@@ -170,6 +340,32 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta + addTarget(InspectorTargetProxy::create(protectedInspectedPage(), targetId, type)); +@@ -179,6 +349,32 @@ void WebPageInspectorController::sendMessageToInspectorFrontend(const String& ta m_targetAgent->sendMessageFromTargetToFrontend(targetId, message); } @@ -14320,17 +13752,17 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 + if (!m_frontendRouter->hasFrontends()) + return false; + -+ if (!m_inspectedPage.isPageOpenedByDOMShowingInitialEmptyDocument()) ++ if (!m_inspectedPage->isPageOpenedByDOMShowingInitialEmptyDocument()) + return false; + -+ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage.webPageID())); ++ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID())); + ASSERT(target); + return target->isPaused(); +} + +void WebPageInspectorController::setContinueLoadingCallback(WTF::Function&& callback) +{ -+ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage.webPageID())); ++ auto* target = m_targets.get(WebPageInspectorTarget::toTargetID(m_inspectedPage->webPageID())); + ASSERT(target); + target->setResumeCallback(WTFMove(callback)); +} @@ -14338,7 +13770,7 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 bool WebPageInspectorController::shouldPauseLoading(const ProvisionalPageProxy& provisionalPage) const { if (!m_frontendRouter->hasFrontends()) -@@ -189,7 +385,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag +@@ -198,7 +394,7 @@ void WebPageInspectorController::setContinueLoadingCallback(const ProvisionalPag void WebPageInspectorController::didCreateProvisionalPage(ProvisionalPageProxy& provisionalPage) { @@ -14347,7 +13779,7 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 } void WebPageInspectorController::willDestroyProvisionalPage(const ProvisionalPageProxy& provisionalPage) -@@ -267,4 +463,27 @@ void WebPageInspectorController::browserExtensionsDisabled(HashSet&& ext +@@ -277,4 +473,27 @@ void WebPageInspectorController::browserExtensionsDisabled(HashSet&& ext m_enabledBrowserAgent->extensionsDisabled(WTFMove(extensionIDs)); } @@ -14356,30 +13788,30 @@ index ed4e6f30b8c35966075573dccee801daceec865e..81e10124a8a745727fc25316345cda01 + // 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); ++ 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); ++ 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); ++ m_inspectedPage->preferences().setJavaScriptCanOpenWindowsAutomatically(true); + + // Enable media stream. -+ if (!m_inspectedPage.preferences().mediaStreamEnabled()) { -+ m_inspectedPage.preferences().setMediaDevicesEnabled(true); -+ m_inspectedPage.preferences().setMediaStreamEnabled(true); -+ m_inspectedPage.preferences().setPeerConnectionEnabled(true); ++ if (!m_inspectedPage->preferences().mediaStreamEnabled()) { ++ m_inspectedPage->preferences().setMediaDevicesEnabled(true); ++ m_inspectedPage->preferences().setMediaStreamEnabled(true); ++ m_inspectedPage->preferences().setPeerConnectionEnabled(true); + } +} + } // namespace WebKit diff --git a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h -index 90619b09c986a6791eec834668ac38ba1581ba93..5ef7f3e25ae95cfbe5564d3456953b9abcd23db4 100644 +index 0a44e45c3d208942ba1bbf0624ae241ca7bbd973..7e891a1fe3e2588e0aa286c4cbb2064967379fcb 100644 --- a/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h +++ b/Source/WebKit/UIProcess/Inspector/WebPageInspectorController.h -@@ -26,17 +26,35 @@ +@@ -26,6 +26,7 @@ #pragma once #include "InspectorTargetProxy.h" @@ -14387,6 +13819,7 @@ index 90619b09c986a6791eec834668ac38ba1581ba93..5ef7f3e25ae95cfbe5564d3456953b9a #include #include #include +@@ -33,11 +34,28 @@ #include #include #include @@ -14415,7 +13848,7 @@ index 90619b09c986a6791eec834668ac38ba1581ba93..5ef7f3e25ae95cfbe5564d3456953b9a } namespace WebKit { -@@ -44,6 +62,23 @@ namespace WebKit { +@@ -45,6 +63,23 @@ namespace WebKit { class InspectorBrowserAgent; struct WebPageAgentContext; @@ -14439,7 +13872,7 @@ index 90619b09c986a6791eec834668ac38ba1581ba93..5ef7f3e25ae95cfbe5564d3456953b9a class WebPageInspectorController { WTF_MAKE_NONCOPYABLE(WebPageInspectorController); WTF_MAKE_FAST_ALLOCATED; -@@ -51,7 +86,21 @@ public: +@@ -52,7 +87,21 @@ public: WebPageInspectorController(WebPageProxy&); void init(); @@ -14461,7 +13894,7 @@ index 90619b09c986a6791eec834668ac38ba1581ba93..5ef7f3e25ae95cfbe5564d3456953b9a bool hasLocalFrontend() const; -@@ -64,11 +113,25 @@ public: +@@ -65,11 +114,25 @@ public: #if ENABLE(REMOTE_INSPECTOR) void setIndicating(bool); #endif @@ -14487,7 +13920,13 @@ index 90619b09c986a6791eec834668ac38ba1581ba93..5ef7f3e25ae95cfbe5564d3456953b9a bool shouldPauseLoading(const ProvisionalPageProxy&) const; void setContinueLoadingCallback(const ProvisionalPageProxy&, WTF::Function&&); -@@ -87,6 +150,7 @@ private: +@@ -84,11 +147,12 @@ public: + void browserExtensionsDisabled(HashSet&&); + + private: +- Ref protectedInspectedPage(); ++ CheckedRef protectedInspectedPage(); + WebPageAgentContext webPageAgentContext(); void createLazyAgents(); void addTarget(std::unique_ptr&&); @@ -14495,8 +13934,8 @@ index 90619b09c986a6791eec834668ac38ba1581ba93..5ef7f3e25ae95cfbe5564d3456953b9a Ref m_frontendRouter; Ref m_backendDispatcher; -@@ -95,11 +159,17 @@ private: - WebPageProxy& m_inspectedPage; +@@ -97,11 +161,17 @@ private: + CheckedRef m_inspectedPage; Inspector::InspectorTargetAgent* m_targetAgent { nullptr }; + WebPageInspectorEmulationAgent* m_emulationAgent { nullptr }; @@ -14746,10 +14185,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..5a3010759c8ed1934e105ebda0a7c9b508a3c824 +index 0000000000000000000000000000000000000000..a494ee1006f70d398149753f8953515d434cbcd4 --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp -@@ -0,0 +1,1003 @@ +@@ -0,0 +1,1019 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -15237,10 +14676,10 @@ index 0000000000000000000000000000000000000000..5a3010759c8ed1934e105ebda0a7c9b5 + WebsiteDataStore::forEachWebsiteDataStore([this] (WebsiteDataStore& dataStore) { + dataStore.setDownloadInstrumentation(this); + }); -+ for (auto& pool : WebProcessPool::allProcessPools()) { -+ for (auto& process : pool->processes()) { -+ for (auto& page : process->pages()) -+ didCreateInspectorController(*page.get()); ++ for (Ref pool : WebProcessPool::allProcessPools()) { ++ for (Ref process : pool->processes()) { ++ for (Ref page : process->pages()) ++ didCreateInspectorController(WTFMove(page)); + } + } + return { }; @@ -15269,6 +14708,19 @@ index 0000000000000000000000000000000000000000..5a3010759c8ed1934e105ebda0a7c9b5 + return { }; +} + ++Inspector::Protocol::ErrorStringOr InspectorPlaywrightAgent::getInfo() ++{ ++#if PLATFORM(MAC) ++ return { "macOS"_s }; ++#elif PLATFORM(GTK) || PLATFORM(WPE) ++ return { "Linux"_s }; ++#elif PLATFORM(WIN) ++ return { "Windows"_s }; ++#else ++#error "Unsupported platform." ++#endif ++} ++ +void InspectorPlaywrightAgent::close(Ref&& callback) +{ + closeImpl([callback = WTFMove(callback)] (String error) { @@ -15283,16 +14735,16 @@ index 0000000000000000000000000000000000000000..5a3010759c8ed1934e105ebda0a7c9b5 + +void InspectorPlaywrightAgent::closeImpl(Function&& callback) +{ -+ Vector pages; ++ Vector> pages; + // If Web Process crashed it will be disconnected from its pool until + // the page reloads. So we cannot discover such processes and the pages + // by traversing all process pools and their processes. Instead we look at + // all existing Web Processes wether in a pool or not. -+ for (auto& process : WebProcessProxy::allProcessesForInspector()) { -+ for (auto& page : process->pages()) -+ pages.append(page.get()); ++ for (Ref process : WebProcessProxy::allProcessesForInspector()) { ++ for (Ref page : process->pages()) ++ pages.append(WTFMove(page)); + } -+ for (auto* page : pages) ++ for (Ref page : pages) + page->closePage(); + + if (!m_defaultContext) { @@ -15475,22 +14927,25 @@ index 0000000000000000000000000000000000000000..5a3010759c8ed1934e105ebda0a7c9b5 + return { }; +} + -+Inspector::Protocol::ErrorStringOr InspectorPlaywrightAgent::takePageScreenshot(const String& pageProxyID, int x, int y, int width, int height, std::optional&& omitDeviceScaleFactor) ++void InspectorPlaywrightAgent::takePageScreenshot(const String& pageProxyID, int x, int y, int width, int height, std::optional&& omitDeviceScaleFactor, Ref&& callback) +{ -+#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) ++#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WPE) + auto* pageProxyChannel = m_pageProxyChannels.get(pageProxyID); -+ if (!pageProxyChannel) -+ return makeUnexpected("Unknown pageProxyID"_s); ++ if (!pageProxyChannel) { ++ callback->sendFailure("Unknown pageProxyID"_s); ++ return; ++ } + + bool nominalResolution = omitDeviceScaleFactor.has_value() && *omitDeviceScaleFactor; + WebCore::IntRect clip(x, y, width, height); -+ String error; -+ String screenshot = m_client->takePageScreenshot(error, pageProxyChannel->page(), WTFMove(clip), nominalResolution); -+ if (!error.isEmpty()) -+ return makeUnexpected(error); -+ return screenshot; ++ m_client->takePageScreenshot(pageProxyChannel->page(), WTFMove(clip), nominalResolution, [callback = WTFMove(callback)](const String& error, const String& data) { ++ if (error.isEmpty()) ++ callback->sendSuccess(data); ++ else ++ callback->sendFailure(error); ++ }); +#else -+ return makeUnexpected("This method is only supported on macOS."_s); ++ return callback->sendFailure("This method is not supported on this platform."_s); +#endif +} + @@ -15755,10 +15210,10 @@ index 0000000000000000000000000000000000000000..5a3010759c8ed1934e105ebda0a7c9b5 +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h new file mode 100644 -index 0000000000000000000000000000000000000000..5e370940b08031fb552bc8b419874deb1ce59233 +index 0000000000000000000000000000000000000000..36b7f12b5d9fce000715b42ee2980c20e0e91ef7 --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.h -@@ -0,0 +1,129 @@ +@@ -0,0 +1,130 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -15842,13 +15297,14 @@ index 0000000000000000000000000000000000000000..5e370940b08031fb552bc8b419874deb + // PlaywrightDispatcherHandler + Inspector::Protocol::ErrorStringOr enable() override; + 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; + 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; + Inspector::Protocol::ErrorStringOr grantFileReadAccess(const String& pageProxyID, Ref&& paths) override; -+ Inspector::Protocol::ErrorStringOr takePageScreenshot(const String& pageProxyID, int x, int y, int width, int height, std::optional&& omitDeviceScaleFactor) override; ++ void takePageScreenshot(const String& pageProxyID, int x, int y, int width, int height, std::optional&& omitDeviceScaleFactor, Ref&&) override; + Inspector::Protocol::ErrorStringOr setIgnoreCertificateErrors(const String& browserContextID, bool ignore) override; + + void getAllCookies(const String& browserContextID, Ref&&) override; @@ -15890,7 +15346,7 @@ index 0000000000000000000000000000000000000000..5e370940b08031fb552bc8b419874deb +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgentClient.h b/Source/WebKit/UIProcess/InspectorPlaywrightAgentClient.h new file mode 100644 -index 0000000000000000000000000000000000000000..6815001186506b5926ef089d03f6fce46b9f249d +index 0000000000000000000000000000000000000000..e7a3dcc533294bb6e12f65d79b5b716bd3c12236 --- /dev/null +++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgentClient.h @@ -0,0 +1,73 @@ @@ -15960,7 +15416,7 @@ index 0000000000000000000000000000000000000000..6815001186506b5926ef089d03f6fce4 + virtual std::unique_ptr createBrowserContext(WTF::String& error, const WTF::String& proxyServer, const WTF::String& proxyBypassList) = 0; + virtual void deleteBrowserContext(WTF::String& error, PAL::SessionID) = 0; +#if PLATFORM(COCOA) || PLATFORM(GTK) || PLATFORM(WPE) -+ virtual String takePageScreenshot(WTF::String& error, WebPageProxy&, WebCore::IntRect&& clip, bool nominalResolution) = 0; ++ virtual void takePageScreenshot(WebPageProxy&, WebCore::IntRect&& clip, bool nominalResolution, CompletionHandler&& completionHandler) = 0; +#endif +}; + @@ -15968,7 +15424,7 @@ index 0000000000000000000000000000000000000000..6815001186506b5926ef089d03f6fce4 + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp -index e81f64cb2b4fdc6a44e31d52ff912a4f6818182d..86a7cab139bf883eb047b45260ce246849e2319a 100644 +index 1a26781907e71c9cc3e99aff38d8060c4387abd7..b4e6e7edec5a716da63c74a6be5d08b6e1981f52 100644 --- a/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp +++ b/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp @@ -97,8 +97,11 @@ void ProcessLauncher::launchProcess() @@ -15997,7 +15453,7 @@ index 3fe0abcfe36bef7ca45bed5661a737ed2bfe56d0..510656948af01ec65d4543c805e9667a #include "RemoteMediaSessionCoordinatorProxyMessages.h" #include "WebPageProxy.h" diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h -index 290c016a047960d38fe60f78d4a0fc1c64ac5d38..82e01ed83f9159ba7f2af3f5bd5082f162a778b9 100644 +index f906572268a24f05062d0a844b783a3ed00e1679..4467af8a12f62b8f69e50c90570935be01d003b8 100644 --- a/Source/WebKit/UIProcess/PageClient.h +++ b/Source/WebKit/UIProcess/PageClient.h @@ -84,6 +84,10 @@ OBJC_CLASS WKView; @@ -16155,7 +15611,7 @@ index 0000000000000000000000000000000000000000..3c8fd0549f1847515d35092f0f49b060 + +#endif // ENABLE(FULLSCREEN_API) diff --git a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp -index d37c0fdab3545ea166e1f062e7bd40107180c056..9e3f20f9f709786ff7093c746c0ae20022ee134c 100644 +index c3252ba8c21e33c4c6d1ebd98570b0e2aec811c8..51ba95e41f175b703f8e29822218340dc178b760 100644 --- a/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp +++ b/Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp @@ -25,6 +25,7 @@ @@ -16485,19 +15941,19 @@ index f8c06bc779b6be310018840147a044b7c34fed3c..0c35907c6d0e0d2c3bba1f40b2ef59fb namespace WebCore { class PlatformWheelEvent; diff --git a/Source/WebKit/UIProcess/RemotePageProxy.cpp b/Source/WebKit/UIProcess/RemotePageProxy.cpp -index 962ee6cae7dc76a19243f77f4c01b90163a2e8ba..2aebb41f50dcd87f738daafe0b5aa244844df227 100644 +index 58e3200ece686308bb282f913aa074ed2d18df92..4e29489d67e3c5486b669f291d36e82138fe970b 100644 --- a/Source/WebKit/UIProcess/RemotePageProxy.cpp +++ b/Source/WebKit/UIProcess/RemotePageProxy.cpp -@@ -39,6 +39,7 @@ +@@ -41,6 +41,7 @@ #include "WebPageProxyMessages.h" #include "WebProcessMessages.h" #include "WebProcessProxy.h" +#include "WebProcessMessages.h" + #include namespace WebKit { - diff --git a/Source/WebKit/UIProcess/WebContextMenuProxy.cpp b/Source/WebKit/UIProcess/WebContextMenuProxy.cpp -index 2c36e80c79519b09f1969701dbd8c712b50089de..b6a2e3dd03496a57238e7381880ad2f78d8f4b72 100644 +index d9dea84804e03c1fe6ff17d095ba78d68124a583..a6d8b4ef0c477f9bea172b1f408094fb60c6d9a1 100644 --- a/Source/WebKit/UIProcess/WebContextMenuProxy.cpp +++ b/Source/WebKit/UIProcess/WebContextMenuProxy.cpp @@ -33,6 +33,7 @@ @@ -16509,7 +15965,7 @@ index 2c36e80c79519b09f1969701dbd8c712b50089de..b6a2e3dd03496a57238e7381880ad2f7 namespace WebKit { diff --git a/Source/WebKit/UIProcess/WebContextMenuProxy.h b/Source/WebKit/UIProcess/WebContextMenuProxy.h -index 2071f653d6fd7413dd5336b85d02c6a92cab68b2..af9409c0adfc97a60d4ed789999310a7745a26be 100644 +index e7d6621532fcc73212cc9130a7cafbb13f458d1d..ec931c8f19d2a61c0fa7d78b52df7f3f94bdd2c5 100644 --- a/Source/WebKit/UIProcess/WebContextMenuProxy.h +++ b/Source/WebKit/UIProcess/WebContextMenuProxy.h @@ -46,6 +46,7 @@ public: @@ -16521,7 +15977,7 @@ index 2071f653d6fd7413dd5336b85d02c6a92cab68b2..af9409c0adfc97a60d4ed789999310a7 WebPageProxy* page() const { return m_page.get(); } diff --git a/Source/WebKit/UIProcess/WebFrameProxy.cpp b/Source/WebKit/UIProcess/WebFrameProxy.cpp -index 0f2875d0465b3267f210e065a9e5ce0830353abb..837b65eeacd48b75fef7d3bb274eddb3a0393639 100644 +index 582a8a4e432af9b896b4c1b8885de8dcb717252a..930b5ff816a60ba3db82ad3dc0d0c3f0e17a8b5c 100644 --- a/Source/WebKit/UIProcess/WebFrameProxy.cpp +++ b/Source/WebKit/UIProcess/WebFrameProxy.cpp @@ -30,6 +30,7 @@ @@ -16541,7 +15997,7 @@ index 0f2875d0465b3267f210e065a9e5ce0830353abb..837b65eeacd48b75fef7d3bb274eddb3 #include "WebPageProxy.h" #include "WebPageProxyMessages.h" diff --git a/Source/WebKit/UIProcess/WebNavigationState.h b/Source/WebKit/UIProcess/WebNavigationState.h -index 74fd2c3075956a4c05ae4c3c4b7c1c2505b27c19..5a7009ad97c1694b9129c21f9086d4c937b422fa 100644 +index f68592e910d61293346fbc251afd9bcbd28cd3a5..2f92c407fa357031a1d054aa39a65a20cbe30751 100644 --- a/Source/WebKit/UIProcess/WebNavigationState.h +++ b/Source/WebKit/UIProcess/WebNavigationState.h @@ -29,6 +29,7 @@ @@ -16562,7 +16018,7 @@ index 74fd2c3075956a4c05ae4c3c4b7c1c2505b27c19..5a7009ad97c1694b9129c21f9086d4c9 class WebNavigationState : public CanMakeWeakPtr { diff --git a/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..e83fdca27ddeeb90df68f96a23f992d7d7602dff +index 0000000000000000000000000000000000000000..fef34b5cf77742521c679a46f38111c1e198b9bf --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorEmulationAgent.cpp @@ -0,0 +1,147 @@ @@ -16671,7 +16127,7 @@ index 0000000000000000000000000000000000000000..e83fdca27ddeeb90df68f96a23f992d7 +Inspector::Protocol::ErrorStringOr WebPageInspectorEmulationAgent::setAuthCredentials(const String& username, const String& password, const String& origin) +{ + if (!!username && !!password) -+ m_page.setAuthCredentialsForAutomation(WebCore::Credential(username, password, WebCore::CredentialPersistencePermanent), URL(origin)); ++ m_page.setAuthCredentialsForAutomation(WebCore::Credential(username, password, WebCore::CredentialPersistence::Permanent), URL(origin)); + else + m_page.setAuthCredentialsForAutomation(std::optional(), std::optional()); + return { }; @@ -16796,7 +16252,7 @@ index 0000000000000000000000000000000000000000..12657f8e7c4b2596707680d299dc8084 +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..0b33e978d46982cee8ed5b39c331502770694478 +index 0000000000000000000000000000000000000000..f4519d0655e1e92e6d47a9e59cf01b0fd07ababf --- /dev/null +++ b/Source/WebKit/UIProcess/WebPageInspectorInputAgent.cpp @@ -0,0 +1,334 @@ @@ -17018,7 +16474,7 @@ index 0000000000000000000000000000000000000000..0b33e978d46982cee8ed5b39c3315027 + +void WebPageInspectorInputAgent::dispatchMouseEvent(const String& type, int x, int y, std::optional&& modifiers, const String& button, std::optional&& buttons, std::optional&& clickCount, std::optional&& deltaX, std::optional&& deltaY, Ref&& callback) +{ -+ WebEventType eventType = WebEventType::NoType; ++ WebEventType eventType = WebEventType::MouseMove; + if (type == "down"_s) + eventType = WebEventType::MouseDown; + else if (type == "up"_s) @@ -17034,16 +16490,16 @@ index 0000000000000000000000000000000000000000..0b33e978d46982cee8ed5b39c3315027 + if (modifiers) + eventModifiers = eventModifiers.fromRaw(*modifiers); + -+ WebMouseEventButton eventButton = WebMouseEventButton::NoButton; ++ WebMouseEventButton eventButton = WebMouseEventButton::None; + if (!!button) { + if (button == "left"_s) -+ eventButton = WebMouseEventButton::LeftButton; ++ eventButton = WebMouseEventButton::Left; + else if (button == "middle"_s) -+ eventButton = WebMouseEventButton::MiddleButton; ++ eventButton = WebMouseEventButton::Middle; + else if (button == "right"_s) -+ eventButton = WebMouseEventButton::RightButton; ++ eventButton = WebMouseEventButton::Right; + else if (button == "none"_s) -+ eventButton = WebMouseEventButton::NoButton; ++ eventButton = WebMouseEventButton::None; + else { + callback->sendFailure("Unsupported eventButton"_s); + return; @@ -17077,9 +16533,9 @@ index 0000000000000000000000000000000000000000..0b33e978d46982cee8ed5b39c3315027 + // operating system. This is turned off in the callback. + m_page.setInterceptDrags(true); +#if PLATFORM(MAC) -+ ASSERT_UNUSED(eventType, 1); -+ ASSERT_UNUSED(eventButton, 1); -+ ASSERT_UNUSED(eventClickCount, 1); ++ UNUSED_VARIABLE(eventType); ++ UNUSED_VARIABLE(eventButton); ++ UNUSED_VARIABLE(eventClickCount); + platformDispatchMouseEvent(type, x, y, WTFMove(modifiers), button, WTFMove(clickCount), eventButtons); +#elif PLATFORM(GTK) || PLATFORM(WPE) || PLATFORM(WIN) + WallTime timestamp = WallTime::now(); @@ -17227,12 +16683,12 @@ index 0000000000000000000000000000000000000000..3e87bf40ced2301f4fb145c6cb31f2cf + +} // namespace WebKit diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp -index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bbd24752a6 100644 +index 8455defdbbcf688a5da2ba2b06ce04288c6e9849..553e7b446c1c332d5e9703db0e286f5254d5537a 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit/UIProcess/WebPageProxy.cpp -@@ -171,12 +171,14 @@ - #include +@@ -175,12 +175,14 @@ #include + #include #include +#include #include @@ -17245,7 +16701,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb #include #include #include -@@ -195,16 +197,19 @@ +@@ -199,17 +201,20 @@ #include #include #include @@ -17257,6 +16713,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb #include #include +#include + #include #include #include #include @@ -17265,9 +16722,9 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb #include #include #include -@@ -272,6 +277,9 @@ - - #if PLATFORM(GTK) +@@ -281,6 +286,9 @@ + #include "AcceleratedBackingStoreDMABuf.h" + #endif #include "GtkSettingsManager.h" +#endif + @@ -17275,7 +16732,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb #include #endif -@@ -381,6 +389,8 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; +@@ -390,6 +398,8 @@ static constexpr Seconds tryCloseTimeoutDelay = 50_ms; static constexpr Seconds audibleActivityClearDelay = 10_s; #endif @@ -17283,11 +16740,11 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb + DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, webPageProxyCounter, ("WebPageProxy")); - class StorageRequests { -@@ -747,6 +757,10 @@ WebPageProxy::~WebPageProxy() - - internals().remotePageProxyInOpenerProcess = nullptr; - internals().openedRemotePageProxies.clear(); + #if PLATFORM(COCOA) +@@ -761,6 +771,10 @@ WebPageProxy::~WebPageProxy() + if (preferences->mediaSessionCoordinatorEnabled()) + GroupActivitiesSessionNotifier::sharedNotifier().removeWebPage(*this); + #endif + +#if PLATFORM(COCOA) + releaseInspectorDragPasteboard(); @@ -17295,7 +16752,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb } void WebPageProxy::addAllMessageReceivers() -@@ -1204,6 +1218,7 @@ void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason) +@@ -1247,6 +1261,7 @@ void WebPageProxy::finishAttachingToWebProcess(ProcessLaunchReason reason) pageClient().didRelaunchProcess(); internals().pageLoadState.didSwapWebProcesses(); @@ -17303,7 +16760,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb } void WebPageProxy::didAttachToRunningProcess() -@@ -1212,7 +1227,7 @@ void WebPageProxy::didAttachToRunningProcess() +@@ -1255,7 +1270,7 @@ void WebPageProxy::didAttachToRunningProcess() #if ENABLE(FULLSCREEN_API) ASSERT(!m_fullScreenManager); @@ -17312,7 +16769,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb #endif #if ENABLE(VIDEO_PRESENTATION_MODE) ASSERT(!m_playbackSessionManager); -@@ -1600,6 +1615,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess() +@@ -1656,6 +1671,21 @@ WebProcessProxy& WebPageProxy::ensureRunningProcess() return m_process; } @@ -17327,15 +16784,15 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb + loadParameters.request = WTFMove(request); + loadParameters.shouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow; + loadParameters.shouldTreatAsContinuingLoad = ShouldTreatAsContinuingLoad::No; -+ m_process->send(Messages::WebPage::LoadRequestInFrameForInspector(loadParameters, frame->frameID()), internals().webPageID); ++ m_process->send(Messages::WebPage::LoadRequestInFrameForInspector(WTFMove(loadParameters), frame->frameID()), internals().webPageID); + return navigation; +} + RefPtr WebPageProxy::loadRequest(ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData) { if (m_isClosed) -@@ -2160,6 +2190,32 @@ void WebPageProxy::setControlledByAutomation(bool controlled) - websiteDataStore().networkProcess().send(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation), 0); +@@ -2218,6 +2248,42 @@ void WebPageProxy::setControlledByAutomation(bool controlled) + websiteDataStore().protectedNetworkProcess()->send(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation), 0); } +void WebPageProxy::setAuthCredentialsForAutomation(std::optional&& credentials, std::optional&& origin) @@ -17349,6 +16806,16 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb + m_permissionsForAutomation = permissions; +} + ++std::optional WebPageProxy::permissionForAutomation(const String& origin, const String& permission) const ++{ ++ auto permissions = m_permissionsForAutomation.find(origin); ++ if (permissions == m_permissionsForAutomation.end()) ++ permissions = m_permissionsForAutomation.find("*"_s); ++ if (permissions == m_permissionsForAutomation.end()) ++ return std::nullopt; ++ return permissions->value.contains(permission); ++} ++ +void WebPageProxy::setActiveForAutomation(std::optional active) { + m_activeForAutomation = active; + OptionSet state; @@ -17367,7 +16834,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb void WebPageProxy::createInspectorTarget(const String& targetId, Inspector::InspectorTargetType type) { MESSAGE_CHECK(m_process, !targetId.isEmpty()); -@@ -2402,6 +2458,25 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) +@@ -2460,6 +2526,25 @@ void WebPageProxy::updateActivityState(OptionSet flagsToUpdate) { bool wasVisible = isViewVisible(); internals().activityState.remove(flagsToUpdate); @@ -17393,25 +16860,34 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb if (flagsToUpdate & ActivityState::IsFocused && pageClient().isViewFocused()) internals().activityState.add(ActivityState::IsFocused); if (flagsToUpdate & ActivityState::WindowIsActive && pageClient().isViewWindowActive()) -@@ -3087,6 +3162,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag - { +@@ -3146,7 +3231,7 @@ void WebPageProxy::performDragOperation(DragData& dragData, const String& dragSt + grantAccessToCurrentPasteboardData(dragStorageName); + #endif + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) || PLATFORM(WPE) + performDragControllerAction(DragControllerAction::PerformDragOperation, dragData); + #else + if (!hasRunningProcess()) +@@ -3163,6 +3248,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag if (!hasRunningProcess()) return; -+ if (action == DragControllerAction::Entered || action == DragControllerAction::Updated) -+ m_dragEventsQueued++; - #if PLATFORM(GTK) - UNUSED_PARAM(dragStorageName); - UNUSED_PARAM(sandboxExtensionHandle); -@@ -3097,6 +3174,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag - m_process->assumeReadAccessToBaseURL(*this, url); + ++ m_dragEventsQueued++; ++ + auto completionHandler = [this, protectedThis = Ref { *this }, action, dragData] (std::optional dragOperation, WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const IntRect& insertionRect, const IntRect& editableElementRect, std::optional remoteUserInputEventData) mutable { + if (!remoteUserInputEventData) { + didPerformDragControllerAction(dragOperation, dragHandlingMethod, mouseIsOverFileInput, numberOfItemsToBeAccepted, insertionRect, editableElementRect); +@@ -3179,6 +3266,8 @@ void WebPageProxy::performDragControllerAction(DragControllerAction action, Drag + protectedProcess()->assumeReadAccessToBaseURL(*this, url); ASSERT(dragData.platformData()); +#endif +#if PLATFORM(GTK) || PLATFORM(WPE) - send(Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags())); + sendWithAsyncReply(Messages::WebPage::PerformDragControllerAction(action, dragData.clientPosition(), dragData.globalPosition(), dragData.draggingSourceOperationMask(), *dragData.platformData(), dragData.flags()), WTFMove(completionHandler)); #else - send(Messages::WebPage::PerformDragControllerAction(action, dragData, sandboxExtensionHandle, sandboxExtensionsForUpload)); -@@ -3112,18 +3191,41 @@ void WebPageProxy::didPerformDragControllerAction(std::optional dragOperationMask, ShareableBitmap::Handle&& dragImageHandle, IntPoint&& dragImageHotspot) + void WebPageProxy::startDrag(SelectionData&& selectionData, OptionSet dragOperationMask, std::optional&& dragImageHandle, IntPoint&& dragImageHotspot) { -- RefPtr dragImage = !dragImageHandle.isNull() ? ShareableBitmap::create(WTFMove(dragImageHandle)) : nullptr; +- 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) -+ RefPtr dragImage = !dragImageHandle.isNull() ? ShareableBitmap::create(WTFMove(dragImageHandle)) : nullptr; ++ RefPtr dragImage = dragImageHandle ? ShareableBitmap::create(WTFMove(*dragImageHandle)) : nullptr; + pageClient().startDrag(WTFMove(selectionData), dragOperationMask, WTFMove(dragImage), WTFMove(dragImageHotspot)); +#endif + } - - didStartDrag(); - } - #endif ++ ++ didStartDrag(); ++} ++#endif +#if PLATFORM(WIN) && ENABLE(DRAG_SUPPORT) +void WebPageProxy::startDrag(WebCore::DragDataMap&& dragDataMap) @@ -17448,15 +16924,10 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb + m_dragSelectionData = WTFMove(dragDataMap); + m_dragSourceOperationMask = WebCore::anyDragOperation(); + } -+ didStartDrag(); -+} -+#endif -+ -+ - void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& globalPosition, OptionSet dragOperationMask) - { - if (!hasRunningProcess()) -@@ -3132,6 +3234,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo + didStartDrag(); + } + #endif +@@ -3222,6 +3333,24 @@ void WebPageProxy::dragEnded(const IntPoint& clientPosition, const IntPoint& glo setDragCaretRect({ }); } @@ -17478,10 +16949,10 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb +} +#endif + - void WebPageProxy::didPerformDragOperation(bool handled) + void WebPageProxy::didStartDrag() { - pageClient().didPerformDragOperation(handled); -@@ -3144,6 +3264,16 @@ void WebPageProxy::didStartDrag() + if (!hasRunningProcess()) +@@ -3229,6 +3358,16 @@ void WebPageProxy::didStartDrag() discardQueuedMouseEvents(); send(Messages::WebPage::DidStartDrag()); @@ -17498,8 +16969,8 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb } void WebPageProxy::dragCancelled() -@@ -3267,17 +3397,37 @@ void WebPageProxy::processNextQueuedMouseEvent() - m_process->startResponsivenessTimer(); +@@ -3373,17 +3512,38 @@ void WebPageProxy::processNextQueuedMouseEvent() + process->startResponsivenessTimer(); } - std::optional> sandboxExtensions; @@ -17508,20 +16979,20 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb + std::optional> sandboxExtensions; #if PLATFORM(MAC) -- bool eventMayStartDrag = !m_currentDragOperation && eventType == WebEventType::MouseMove && event.button() != WebMouseEventButton::NoButton; +- bool eventMayStartDrag = !m_currentDragOperation && eventType == WebEventType::MouseMove && event.button() != WebMouseEventButton::None; - if (eventMayStartDrag) -- sandboxExtensions = SandboxExtension::createHandlesForMachLookup({ "com.apple.iconservices"_s, "com.apple.iconservices.store"_s }, process().auditToken(), SandboxExtension::MachBootstrapOptions::EnableMachBootstrap); -+ bool eventMayStartDrag = !m_currentDragOperation && eventType == WebEventType::MouseMove && event.button() != WebMouseEventButton::NoButton; +- sandboxExtensions = SandboxExtension::createHandlesForMachLookup({ "com.apple.iconservices"_s, "com.apple.iconservices.store"_s }, process->auditToken(), SandboxExtension::MachBootstrapOptions::EnableMachBootstrap); ++ bool eventMayStartDrag = !m_currentDragOperation && eventType == WebEventType::MouseMove && event.button() != WebMouseEventButton::None; + if (eventMayStartDrag) -+ sandboxExtensions = SandboxExtension::createHandlesForMachLookup({ "com.apple.iconservices"_s, "com.apple.iconservices.store"_s }, process().auditToken(), SandboxExtension::MachBootstrapOptions::EnableMachBootstrap); ++ sandboxExtensions = SandboxExtension::createHandlesForMachLookup({ "com.apple.iconservices"_s, "com.apple.iconservices.store"_s }, process->auditToken(), SandboxExtension::MachBootstrapOptions::EnableMachBootstrap); #endif -- + - LOG_WITH_STREAM(MouseHandling, stream << "UIProcess: sent mouse event " << eventType << " (queue size " << internals().mouseEventQueue.size() << ")"); -- m_process->recordUserGestureAuthorizationToken(event.authorizationToken()); -- send(Messages::WebPage::MouseEvent(m_mainFrame->frameID(), event, sandboxExtensions)); +- process->recordUserGestureAuthorizationToken(event.authorizationToken()); +- sendMouseEvent(m_mainFrame->frameID(), event, WTFMove(sandboxExtensions)); + LOG_WITH_STREAM(MouseHandling, stream << "UIProcess: sent mouse event " << eventType << " (queue size " << internals().mouseEventQueue.size() << ")"); -+ m_process->recordUserGestureAuthorizationToken(event.authorizationToken()); -+ send(Messages::WebPage::MouseEvent(m_mainFrame->frameID(), event, sandboxExtensions)); ++ process->recordUserGestureAuthorizationToken(event.authorizationToken()); ++ sendMouseEvent(m_mainFrame->frameID(), event, WTFMove(sandboxExtensions)); + } else { +#if PLATFORM(WIN) || PLATFORM(COCOA) + DragData dragData(*m_dragSelectionData, event.position(), event.globalPosition(), m_dragSourceOperationMask); @@ -17544,16 +17015,16 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb } void WebPageProxy::doAfterProcessingAllPendingMouseEvents(WTF::Function&& action) -@@ -3437,6 +3587,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) +@@ -3543,6 +3703,8 @@ void WebPageProxy::wheelEventHandlingCompleted(bool wasHandled) - if (auto* automationSession = process().processPool().automationSession()) + if (RefPtr automationSession = process().processPool().automationSession()) automationSession->wheelEventsFlushedForPage(*this); + + m_inspectorController->didProcessAllPendingWheelEvents(); } void WebPageProxy::cacheWheelEventScrollingAccelerationCurve(const NativeWebWheelEvent& nativeWheelEvent) -@@ -3565,7 +3717,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) +@@ -3690,7 +3852,7 @@ static TrackingType mergeTrackingTypes(TrackingType a, TrackingType b) void WebPageProxy::updateTouchEventTracking(const WebTouchEvent& touchStartEvent) { @@ -17562,16 +17033,16 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb for (auto& touchPoint : touchStartEvent.touchPoints()) { auto location = touchPoint.location(); auto update = [this, location](TrackingType& trackingType, EventTrackingRegions::EventType eventType) { -@@ -3981,6 +4133,8 @@ void WebPageProxy::receivedNavigationPolicyDecision(WebProcessProxy& processNavi +@@ -4161,6 +4323,8 @@ void WebPageProxy::receivedNavigationPolicyDecision(WebProcessProxy& processNavi if (policyAction != PolicyAction::Use || (!preferences().siteIsolationEnabled() && !frame.isMainFrame()) || !navigation) { + if (policyAction == PolicyAction::Download && navigation) + internals().decidePolicyForResponseRequest = navigation->currentRequest(); auto previousPendingNavigationID = internals().pageLoadState.pendingAPIRequest().navigationID; - receivedPolicyDecision(policyAction, navigation, navigation->websitePolicies(), WTFMove(navigationAction), WTFMove(sender), WillContinueLoadInNewProcess::No, std::nullopt); + receivedPolicyDecision(policyAction, navigation, navigation->protectedWebsitePolicies().get(), WTFMove(navigationAction), WTFMove(sender), WillContinueLoadInNewProcess::No, std::nullopt); #if HAVE(APP_SSO) -@@ -4087,6 +4241,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(WebProcessProxy& processNavi +@@ -4268,6 +4432,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(WebProcessProxy& processNavi void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, RefPtr&& websitePolicies, std::variant, Ref>&& navigationActionOrResponse, Ref&& sender, WillContinueLoadInNewProcess willContinueLoadInNewProcess, std::optional sandboxExtensionHandle) { @@ -17579,7 +17050,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb if (!hasRunningProcess()) { sender->send(PolicyDecision { isNavigatingToAppBoundDomain() }); return; -@@ -4939,6 +5094,11 @@ void WebPageProxy::pageScaleFactorDidChange(double scaleFactor) +@@ -5131,6 +5296,11 @@ void WebPageProxy::pageScaleFactorDidChange(double scaleFactor) m_pageScaleFactor = scaleFactor; } @@ -17591,7 +17062,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb void WebPageProxy::pluginScaleFactorDidChange(double pluginScaleFactor) { MESSAGE_CHECK(m_process, scaleFactorIsValid(pluginScaleFactor)); -@@ -5419,6 +5579,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, ui +@@ -5644,6 +5814,7 @@ void WebPageProxy::didDestroyNavigationShared(Ref&& process, ui PageClientProtector protector(pageClient()); m_navigationState->didDestroyNavigation(process->coreProcessIdentifier(), navigationID); @@ -17599,7 +17070,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb } void WebPageProxy::didStartProvisionalLoadForFrame(FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, uint64_t navigationID, URL&& url, URL&& unreachableURL, const UserData& userData) -@@ -5665,6 +5826,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p +@@ -5898,6 +6069,8 @@ void WebPageProxy::didFailProvisionalLoadForFrameShared(Ref&& p m_failingProvisionalLoadURL = { }; @@ -17608,32 +17079,32 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb // If the provisional page's load fails then we destroy the provisional page. if (m_provisionalPage && m_provisionalPage->mainFrame() == &frame && willContinueLoading == WillContinueLoading::No) m_provisionalPage = nullptr; -@@ -6274,7 +6437,15 @@ void WebPageProxy::beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListen +@@ -6517,7 +6690,15 @@ void WebPageProxy::beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListen void WebPageProxy::decidePolicyForNavigationActionAsync(FrameInfoData&& frameInfo, uint64_t navigationID, NavigationActionData&& navigationActionData, FrameInfoData&& originatingFrameInfo, std::optional originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&& request, IPC::FormDataReference&& requestBody, CompletionHandler&& completionHandler) { -- decidePolicyForNavigationActionAsyncShared(Ref { process() }, internals().webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler)); +- decidePolicyForNavigationActionAsyncShared(protectedProcess(), internals().webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler)); + if (m_inspectorController->shouldPauseLoading()) { -+ decidePolicyForNavigationActionAsyncShared(Ref { process() }, internals().webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler)); ++ decidePolicyForNavigationActionAsyncShared(protectedProcess(), internals().webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler)); + m_inspectorController->setContinueLoadingCallback([this, protectedThis = Ref { *this }, frameInfo = WTFMove(frameInfo), navigationID, navigationActionData = WTFMove(navigationActionData), + originatingFrameInfo = WTFMove(originatingFrameInfo), originatingPageID, originalRequest, request = WTFMove(request), requestBody = WTFMove(requestBody), completionHandler = WTFMove(completionHandler)] () mutable { -+ decidePolicyForNavigationActionAsyncShared(Ref { process() }, internals().webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler)); ++ decidePolicyForNavigationActionAsyncShared(protectedProcess(), internals().webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler)); + }); + } else { -+ decidePolicyForNavigationActionAsyncShared(Ref { process() }, internals().webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler)); ++ decidePolicyForNavigationActionAsyncShared(protectedProcess(), internals().webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler)); + } } void WebPageProxy::decidePolicyForNavigationActionAsyncShared(Ref&& process, PageIdentifier webPageID, FrameInfoData&& frameInfo, uint64_t navigationID, NavigationActionData&& navigationActionData, FrameInfoData&& originatingFrameInfo, std::optional originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&& request, IPC::FormDataReference&& requestBody, CompletionHandler&& completionHandler) -@@ -6856,6 +7027,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa - if (auto* page = originatingFrameInfo->page()) +@@ -7102,6 +7283,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa + if (RefPtr page = originatingFrameInfo->page()) openerAppInitiatedState = page->lastNavigationWasAppInitiated(); + m_inspectorController->willCreateNewPage(windowFeatures, request.url()); auto completionHandler = [this, protectedThis = Ref { *this }, mainFrameURL, request, reply = WTFMove(reply), privateClickMeasurement = navigationActionData.privateClickMeasurement, openerAppInitiatedState = WTFMove(openerAppInitiatedState), openerFrameID = originatingFrameInfoData.frameID] (RefPtr newPage) mutable { if (!newPage) { reply(std::nullopt, std::nullopt); -@@ -6903,6 +7075,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa +@@ -7150,6 +7332,7 @@ void WebPageProxy::createNewPage(FrameInfoData&& originatingFrameInfoData, WebPa void WebPageProxy::showPage() { m_uiClient->showPage(this); @@ -17641,7 +17112,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb } bool WebPageProxy::hasOpenedPage() const -@@ -6982,6 +7155,10 @@ void WebPageProxy::closePage() +@@ -7229,6 +7412,10 @@ void WebPageProxy::closePage() if (isClosed()) return; @@ -17652,7 +17123,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb WEBPAGEPROXY_RELEASE_LOG(Process, "closePage:"); pageClient().clearAllEditCommands(); m_uiClient->close(this); -@@ -7018,6 +7195,8 @@ void WebPageProxy::runJavaScriptAlert(FrameIdentifier frameID, FrameInfoData&& f +@@ -7265,6 +7452,8 @@ void WebPageProxy::runJavaScriptAlert(FrameIdentifier frameID, FrameInfoData&& f } runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), message, [reply = WTFMove(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, const String& message, CompletionHandler&& completion) mutable { @@ -17661,8 +17132,8 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb page.m_uiClient->runJavaScriptAlert(page, message, frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)]() mutable { reply(); completion(); -@@ -7039,6 +7218,8 @@ void WebPageProxy::runJavaScriptConfirm(FrameIdentifier frameID, FrameInfoData&& - if (auto* automationSession = process().processPool().automationSession()) +@@ -7286,6 +7475,8 @@ void WebPageProxy::runJavaScriptConfirm(FrameIdentifier frameID, FrameInfoData&& + if (RefPtr automationSession = process().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this); } + if (m_inspectorDialogAgent) @@ -17670,8 +17141,8 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), message, [reply = WTFMove(reply)](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, const String& message, CompletionHandler&& completion) mutable { page.m_uiClient->runJavaScriptConfirm(page, message, frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)](bool result) mutable { -@@ -7062,6 +7243,8 @@ void WebPageProxy::runJavaScriptPrompt(FrameIdentifier frameID, FrameInfoData&& - if (auto* automationSession = process().processPool().automationSession()) +@@ -7309,6 +7500,8 @@ void WebPageProxy::runJavaScriptPrompt(FrameIdentifier frameID, FrameInfoData&& + if (RefPtr automationSession = process().processPool().automationSession()) automationSession->willShowJavaScriptDialog(*this); } + if (m_inspectorDialogAgent) @@ -17679,7 +17150,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb runModalJavaScriptDialog(WTFMove(frame), WTFMove(frameInfo), message, [reply = WTFMove(reply), defaultValue](WebPageProxy& page, WebFrameProxy* frame, FrameInfoData&& frameInfo, const String& message, CompletionHandler&& completion) mutable { page.m_uiClient->runJavaScriptPrompt(page, message, defaultValue, frame, WTFMove(frameInfo), [reply = WTFMove(reply), completion = WTFMove(completion)](auto& result) mutable { -@@ -7176,6 +7359,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(FrameIdentifier frameID, FrameInf +@@ -7425,6 +7618,8 @@ void WebPageProxy::runBeforeUnloadConfirmPanel(FrameIdentifier frameID, FrameInf return; } } @@ -17687,8 +17158,8 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb + m_inspectorDialogAgent->javascriptDialogOpening("beforeunload"_s, message); // Since runBeforeUnloadConfirmPanel() can spin a nested run loop we need to turn off the responsiveness timer and the tryClose timer. - m_process->stopResponsivenessTimer(); -@@ -7626,6 +7811,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, + protectedProcess()->stopResponsivenessTimer(); +@@ -7883,6 +8078,11 @@ void WebPageProxy::resourceLoadDidCompleteWithError(ResourceLoadInfo&& loadInfo, } #if ENABLE(FULLSCREEN_API) @@ -17700,32 +17171,42 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb WebFullScreenManagerProxy* WebPageProxy::fullScreenManager() { return m_fullScreenManager.get(); -@@ -8546,6 +8736,8 @@ void WebPageProxy::didReceiveEvent(WebEventType eventType, bool handled) - if (auto* automationSession = process().processPool().automationSession()) - automationSession->mouseEventsFlushedForPage(*this); - didFinishProcessingAllPendingMouseEvents(); -+ if (m_dragEventsQueued == 0) -+ m_inspectorController->didProcessAllPendingMouseEvents(); - } - break; +@@ -7959,6 +8159,17 @@ void WebPageProxy::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAc + { + MESSAGE_CHECK_COMPLETION(m_process, !originIdentifier.isEmpty(), completionHandler(DOMPasteAccessResponse::DeniedForGesture)); + ++ if (isControlledByAutomation()) { ++ DOMPasteAccessResponse response = DOMPasteAccessResponse::DeniedForGesture; ++ if (permissionForAutomation(originIdentifier, "clipboard-read"_s).value_or(false)) { ++ response = DOMPasteAccessResponse::GrantedForGesture; ++ // Grant access to general pasteboard. ++ willPerformPasteCommand(DOMPasteAccessCategory::General); ++ } ++ completionHandler(response); ++ return; ++ } ++ + m_pageClient->requestDOMPasteAccess(pasteAccessCategory, elementRect, originIdentifier, WTFMove(completionHandler)); + } + +@@ -8762,6 +8973,8 @@ void WebPageProxy::mouseEventHandlingCompleted(std::optional event + if (RefPtr automationSession = process().processPool().automationSession()) + automationSession->mouseEventsFlushedForPage(*this); + didFinishProcessingAllPendingMouseEvents(); ++ if (m_dragEventsQueued == 0) ++ m_inspectorController->didProcessAllPendingMouseEvents(); } -@@ -8584,7 +8776,6 @@ void WebPageProxy::didReceiveEvent(WebEventType eventType, bool handled) - // The call to doneWithKeyEvent may close this WebPage. - // Protect against this being destroyed. - Ref protect(*this); -- - pageClient().doneWithKeyEvent(event, handled); - if (!handled) - m_uiClient->didNotHandleKeyEvent(this, event); -@@ -8593,6 +8784,7 @@ void WebPageProxy::didReceiveEvent(WebEventType eventType, bool handled) - if (!canProcessMoreKeyEvents) { - if (auto* automationSession = process().processPool().automationSession()) - automationSession->keyboardEventsFlushedForPage(*this); -+ m_inspectorController->didProcessAllPendingKeyboardEvents(); - } - break; + } + +@@ -8796,6 +9009,7 @@ void WebPageProxy::keyEventHandlingCompleted(std::optional eventTy + if (!canProcessMoreKeyEvents) { + if (RefPtr automationSession = process().processPool().automationSession()) + automationSession->keyboardEventsFlushedForPage(*this); ++ m_inspectorController->didProcessAllPendingKeyboardEvents(); } -@@ -8946,7 +9138,10 @@ void WebPageProxy::dispatchProcessDidTerminate(ProcessTerminationReason reason) + } + +@@ -9201,7 +9415,10 @@ void WebPageProxy::dispatchProcessDidTerminate(ProcessTerminationReason reason) { WEBPAGEPROXY_RELEASE_LOG_ERROR(Loading, "dispatchProcessDidTerminate: reason=%" PUBLIC_LOG_STRING, processTerminationReasonToString(reason)); @@ -17737,7 +17218,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb if (m_loaderClient) handledByClient = reason != ProcessTerminationReason::RequestedByClient && m_loaderClient->processDidCrash(*this); else -@@ -9319,6 +9514,7 @@ bool WebPageProxy::useGPUProcessForDOMRenderingEnabled() const +@@ -9564,6 +9781,7 @@ bool WebPageProxy::useGPUProcessForDOMRenderingEnabled() const WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& process, DrawingAreaProxy& drawingArea, RefPtr&& websitePolicies) { @@ -17745,7 +17226,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb WebPageCreationParameters parameters; parameters.processDisplayName = configuration().processDisplayName(); -@@ -9520,6 +9716,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc +@@ -9770,6 +9988,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc parameters.httpsUpgradeEnabled = preferences().upgradeKnownHostsToHTTPSEnabled() ? m_configuration->httpsUpgradeEnabled() : false; @@ -17754,7 +17235,7 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb #if PLATFORM(IOS) || PLATFORM(VISION) // FIXME: This is also being passed over the to WebProcess via the PreferencesStore. parameters.allowsDeprecatedSynchronousXMLHttpRequestDuringUnload = allowsDeprecatedSynchronousXMLHttpRequestDuringUnload(); -@@ -9604,8 +9802,42 @@ void WebPageProxy::gamepadActivity(const Vector>& gam +@@ -9858,8 +10078,42 @@ void WebPageProxy::gamepadActivity(const Vector>& gam #endif @@ -17797,24 +17278,47 @@ index 279ab83cbd781b921d30055998baad70faa8156a..186553172243117291f9773dc8db54bb if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes) { m_navigationClient->shouldAllowLegacyTLS(*this, authenticationChallenge.get(), [this, protectedThis = Ref { *this }, authenticationChallenge] (bool shouldAllowLegacyTLS) { if (shouldAllowLegacyTLS) -@@ -9709,6 +9941,15 @@ void WebPageProxy::requestGeolocationPermissionForFrame(GeolocationIdentifier ge +@@ -9963,6 +10217,12 @@ void WebPageProxy::requestGeolocationPermissionForFrame(GeolocationIdentifier ge request->deny(); }; -+ auto securityOrigin = frameInfo.securityOrigin.securityOrigin(); -+ auto permissions = m_permissionsForAutomation.find(securityOrigin->toString()); -+ if (permissions == m_permissionsForAutomation.end()) -+ permissions = m_permissionsForAutomation.find("*"_s); -+ if (permissions != m_permissionsForAutomation.end()) { -+ completionHandler(permissions->value.contains("geolocation"_s)); ++ if (isControlledByAutomation()) { ++ auto securityOrigin = frameInfo.securityOrigin.securityOrigin(); ++ completionHandler(permissionForAutomation(securityOrigin->toString(), "geolocation"_s).value_or(false)); + return; + } + // 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 +@@ -10017,6 +10277,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi + shouldChangeDeniedToPrompt = false; + + if (sessionID().isEphemeral()) { ++ auto permission = permissionForAutomation(clientOrigin.topOrigin.toString(), name); ++ if (permission.has_value()) { ++ completionHandler(permission.value() ? PermissionState::Granted : PermissionState::Denied); ++ return; ++ } ++ + completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); + return; + } +@@ -10031,6 +10297,12 @@ void WebPageProxy::queryPermission(const ClientOrigin& clientOrigin, const Permi + return; + } + ++ auto permission = permissionForAutomation(clientOrigin.topOrigin.toString(), name); ++ if (permission.has_value()) { ++ completionHandler(permission.value() ? PermissionState::Granted : PermissionState::Denied); ++ return; ++ } ++ + if (!canAPISucceed) { + completionHandler(shouldChangeDeniedToPrompt ? PermissionState::Prompt : PermissionState::Denied); + return; diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h -index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e476dad44 100644 +index 81e3d314c82e29d9c6f157ed1764e6b26b34f1e9..303b0c6a886e56f70d7e155a1758ebd41bbdc880 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.h +++ b/Source/WebKit/UIProcess/WebPageProxy.h @@ -26,6 +26,7 @@ @@ -17824,11 +17328,11 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e +#include "APIWebsitePolicies.h" #include "MessageReceiver.h" #include "MessageSender.h" - #include -@@ -33,6 +34,24 @@ - #include + #include +@@ -35,6 +36,24 @@ #include #include + #include +#include "InspectorDialogAgent.h" +#include "WebProtectionSpace.h" +#include @@ -17850,7 +17354,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e namespace API { class Attachment; -@@ -93,6 +112,7 @@ class DestinationColorSpace; +@@ -95,6 +114,7 @@ class DestinationColorSpace; class DragData; class FloatPoint; class FloatQuad; @@ -17858,7 +17362,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e class FloatRect; class FloatSize; class FontAttributeChanges; -@@ -381,6 +401,7 @@ class WebExtensionController; +@@ -385,6 +405,7 @@ class WebExtensionController; class WebFramePolicyListenerProxy; class WebFrameProxy; class WebFullScreenManagerProxy; @@ -17866,7 +17370,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e class WebInspectorUIProxy; class WebKeyboardEvent; class WebMouseEvent; -@@ -576,6 +597,8 @@ public: +@@ -595,6 +616,8 @@ public: void setControlledByAutomation(bool); WebPageInspectorController& inspectorController() { return *m_inspectorController; } @@ -17875,7 +17379,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e #if PLATFORM(IOS_FAMILY) void showInspectorIndication(); -@@ -606,6 +629,7 @@ public: +@@ -628,6 +651,7 @@ public: bool hasSleepDisabler() const; #if ENABLE(FULLSCREEN_API) @@ -17883,7 +17387,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e WebFullScreenManagerProxy* fullScreenManager(); API::FullscreenClient& fullscreenClient() const { return *m_fullscreenClient; } -@@ -694,6 +718,11 @@ public: +@@ -716,6 +740,11 @@ public: void setPageLoadStateObserver(std::unique_ptr&&); @@ -17895,7 +17399,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e void initializeWebPage(); void setDrawingArea(std::unique_ptr&&); -@@ -720,6 +749,7 @@ public: +@@ -739,6 +768,7 @@ public: void addPlatformLoadParameters(WebProcessProxy&, LoadParameters&); RefPtr loadRequest(WebCore::ResourceRequest&&); RefPtr loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object* userData = nullptr); @@ -17903,7 +17407,15 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e RefPtr loadFile(const String& fileURL, const String& resourceDirectoryURL, bool isAppInitiated = true, API::Object* userData = nullptr); RefPtr loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr); RefPtr loadData(const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, WebCore::ShouldOpenExternalURLsPolicy); -@@ -1288,6 +1318,7 @@ public: +@@ -802,6 +832,7 @@ public: + void restoreSelectionInFocusedEditableElement(); + + PageClient& pageClient() const; ++ bool hasPageClient() const { return !!m_pageClient; } + + void setViewNeedsDisplay(const WebCore::Region&); + void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, WebCore::ScrollIsAnimated); +@@ -1309,6 +1340,7 @@ public: #endif void pageScaleFactorDidChange(double); @@ -17911,7 +17423,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e void pluginScaleFactorDidChange(double); void pluginZoomFactorDidChange(double); -@@ -1377,14 +1408,20 @@ public: +@@ -1398,14 +1430,20 @@ public: void didStartDrag(); void dragCancelled(); void setDragCaretRect(const WebCore::IntRect&); @@ -17925,7 +17437,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e #endif -#if PLATFORM(GTK) +#if PLATFORM(GTK) || PLATFORM(WPE) - void startDrag(WebCore::SelectionData&&, OptionSet, ShareableBitmapHandle&& dragImage, WebCore::IntPoint&& dragImageHotspot); + void startDrag(WebCore::SelectionData&&, OptionSet, std::optional&& dragImage, WebCore::IntPoint&& dragImageHotspot); #endif +#if PLATFORM(WIN) + void startDrag(WebCore::DragDataMap&& dragDataMap); @@ -17933,7 +17445,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e #endif void processDidBecomeUnresponsive(); -@@ -1601,6 +1638,7 @@ public: +@@ -1625,6 +1663,7 @@ public: void setViewportSizeForCSSViewportUnits(const WebCore::FloatSize&); WebCore::FloatSize viewportSizeForCSSViewportUnits() const; @@ -17941,7 +17453,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e void didReceiveAuthenticationChallengeProxy(Ref&&, NegotiatedLegacyTLS); void negotiatedLegacyTLS(); void didNegotiateModernTLS(const URL&); -@@ -1635,6 +1673,8 @@ public: +@@ -1659,6 +1698,8 @@ public: #if PLATFORM(COCOA) || PLATFORM(GTK) RefPtr takeViewSnapshot(std::optional&&); @@ -17950,7 +17462,15 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e #endif #if ENABLE(WEB_CRYPTO) -@@ -2907,8 +2947,10 @@ private: +@@ -2484,6 +2525,7 @@ private: + RefPtr launchProcessForReload(); + + void requestNotificationPermission(const String& originString, CompletionHandler&&); ++ std::optional permissionForAutomation(const String& origin, const String& permission) const; + + void didChangeContentSize(const WebCore::IntSize&); + void didChangeIntrinsicContentSize(const WebCore::IntSize&); +@@ -2953,8 +2995,10 @@ private: String m_overrideContentSecurityPolicy; RefPtr m_inspector; @@ -17961,7 +17481,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e std::unique_ptr m_fullScreenManager; std::unique_ptr m_fullscreenClient; #endif -@@ -3090,6 +3132,22 @@ private: +@@ -3138,6 +3182,22 @@ private: std::optional m_currentDragOperation; bool m_currentDragIsOverFileInput { false }; unsigned m_currentDragNumberOfFilesToBeAccepted { 0 }; @@ -17984,7 +17504,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e #endif bool m_mainFrameHasHorizontalScrollbar { false }; -@@ -3257,6 +3315,10 @@ private: +@@ -3307,6 +3367,10 @@ private: RefPtr messageBody; }; Vector m_pendingInjectedBundleMessages; @@ -17996,7 +17516,7 @@ index 41b18adc02933918be11cbff5569b13f9f8f8cc1..6769f624d2f67e1442722b759a10693e #if PLATFORM(IOS_FAMILY) && ENABLE(DEVICE_ORIENTATION) std::unique_ptr m_webDeviceOrientationUpdateProviderProxy; diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in -index 3501a297012db004b25d91c8a92d149b47a5c98d..845a929a0aa4b1af1047a0c7234feedecdaf4403 100644 +index e6184097085ccafc1aa7d012314c84eee090300a..7be7efca7dd8cf4092d5be39c9ee59856275b998 100644 --- a/Source/WebKit/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in @@ -29,6 +29,7 @@ messages -> WebPageProxy { @@ -18006,8 +17526,8 @@ index 3501a297012db004b25d91c8a92d149b47a5c98d..845a929a0aa4b1af1047a0c7234feede + LogToStderr(String text) DidChangeViewportProperties(struct WebCore::ViewportAttributes attributes) - DidReceiveEvent(enum:int8_t WebKit::WebEventType eventType, bool handled) -@@ -179,6 +180,7 @@ messages -> WebPageProxy { + DidReceiveEvent(enum:uint8_t WebKit::WebEventType eventType, bool handled) +@@ -182,6 +183,7 @@ messages -> WebPageProxy { #endif PageScaleFactorDidChange(double scaleFactor) @@ -18015,26 +17535,27 @@ index 3501a297012db004b25d91c8a92d149b47a5c98d..845a929a0aa4b1af1047a0c7234feede PluginScaleFactorDidChange(double zoomFactor) PluginZoomFactorDidChange(double zoomFactor) -@@ -308,10 +310,12 @@ messages -> WebPageProxy { +@@ -307,10 +309,14 @@ messages -> WebPageProxy { StartDrag(struct WebCore::DragItem dragItem, WebKit::ShareableBitmap::Handle dragImage) SetPromisedDataForImage(String pasteboardName, WebKit::SharedMemory::Handle imageHandle, String filename, String extension, String title, String url, String visibleURL, WebKit::SharedMemory::Handle archiveHandle, String originIdentifier) #endif -#if PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) +#if (PLATFORM(GTK) || PLATFORM(WPE)) && ENABLE(DRAG_SUPPORT) - StartDrag(WebCore::SelectionData selectionData, OptionSet dragOperationMask, WebKit::ShareableBitmap::Handle dragImage, WebCore::IntPoint dragImageHotspot) + StartDrag(WebCore::SelectionData selectionData, OptionSet dragOperationMask, std::optional dragImage, WebCore::IntPoint dragImageHotspot) #endif -- + +#if PLATFORM(WIN) && ENABLE(DRAG_SUPPORT) + StartDrag(HashMap> dragDataMap) +#endif - #if ENABLE(DRAG_SUPPORT) - DidPerformDragOperation(bool handled) - #endif ++ + #if PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT) + DidHandleDragStartRequest(bool started) + DidHandleAdditionalDragItemsRequest(bool added) diff --git a/Source/WebKit/UIProcess/WebProcessCache.cpp b/Source/WebKit/UIProcess/WebProcessCache.cpp -index 58e39fd6df029efb3801ad914dfc96f4e6a8d8dc..7b47e3f1e08d6f974889def778fcee35b3b8ee09 100644 +index 1329e19aa1f93077c7d2f5fe98838731b79692a5..8e697f27ef47f0b66f1de6197ab1ce2503f2ed0f 100644 --- a/Source/WebKit/UIProcess/WebProcessCache.cpp +++ b/Source/WebKit/UIProcess/WebProcessCache.cpp -@@ -81,6 +81,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const +@@ -82,6 +82,10 @@ bool WebProcessCache::canCacheProcess(WebProcessProxy& process) const return false; } @@ -18046,10 +17567,10 @@ index 58e39fd6df029efb3801ad914dfc96f4e6a8d8dc..7b47e3f1e08d6f974889def778fcee35 } diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp -index b5b404aeacee13c1d1f08cf2be9ccd19eeae8175..ba574e9613171e0591dd6ec70ee310965a33e2c5 100644 +index 9fa1ce31e9dfd76e51588fa287989a43bfb1075a..50dcd16e303bebeb0f6f1a31e2c4df544827b2c4 100644 --- a/Source/WebKit/UIProcess/WebProcessPool.cpp +++ b/Source/WebKit/UIProcess/WebProcessPool.cpp -@@ -384,10 +384,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& +@@ -376,10 +376,10 @@ void WebProcessPool::setAutomationClient(std::unique_ptr& void WebProcessPool::setOverrideLanguages(Vector&& languages) { @@ -18061,11 +17582,11 @@ index b5b404aeacee13c1d1f08cf2be9ccd19eeae8175..ba574e9613171e0591dd6ec70ee31096 + sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(m_configuration->overrideLanguages())); #if ENABLE(GPU_PROCESS) - if (auto* gpuProcess = GPUProcessProxy::singletonIfCreated()) -@@ -395,9 +395,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) + if (RefPtr gpuProcess = GPUProcessProxy::singletonIfCreated()) +@@ -387,9 +387,10 @@ void WebProcessPool::setOverrideLanguages(Vector&& languages) #endif #if USE(SOUP) - for (auto networkProcess : NetworkProcessProxy::allNetworkProcesses()) + for (Ref networkProcess : NetworkProcessProxy::allNetworkProcesses()) - networkProcess->send(Messages::NetworkProcess::UserPreferredLanguagesChanged(overrideLanguages()), 0); + networkProcess->send(Messages::NetworkProcess::UserPreferredLanguagesChanged(m_configuration->overrideLanguages()), 0); #endif @@ -18074,22 +17595,7 @@ index b5b404aeacee13c1d1f08cf2be9ccd19eeae8175..ba574e9613171e0591dd6ec70ee31096 void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled) { -@@ -542,6 +543,14 @@ void WebProcessPool::establishRemoteWorkerContextConnectionToNetworkProcess(Remo - - RefPtr requestingProcess = requestingProcessIdentifier ? WebProcessProxy::processForIdentifier(*requestingProcessIdentifier) : nullptr; - WebProcessPool* processPool = requestingProcess ? &requestingProcess->processPool() : processPools()[0]; -+ // Playwright begin -+ for (auto& process : websiteDataStore->processes()) { -+ if (process.processPoolIfExists()) { -+ processPool = process.processPoolIfExists(); -+ break; -+ } -+ } -+ // Playwright end - ASSERT(processPool); - - WebProcessProxy* remoteWorkerProcessProxy { nullptr }; -@@ -850,7 +859,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa +@@ -829,7 +830,7 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa #endif parameters.cacheModel = LegacyGlobalSettings::singleton().cacheModel(); @@ -18099,22 +17605,22 @@ index b5b404aeacee13c1d1f08cf2be9ccd19eeae8175..ba574e9613171e0591dd6ec70ee31096 parameters.urlSchemesRegisteredAsEmptyDocument = copyToVector(m_schemesToRegisterAsEmptyDocument); diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp -index e25e43bc48460a221afc2594dcda553942def734..05033d41747ea2def5b591e156c1d98e086e8d29 100644 +index 8e19e14a7dec67b23ed4570523f4e8f53e2cf57a..ca634c57e08ffc346abd22852d9923c4165f0e9f 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.cpp +++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp -@@ -170,6 +170,11 @@ Vector> WebProcessProxy::allProcesses() +@@ -173,6 +173,11 @@ Vector> WebProcessProxy::allProcesses() }); } -+Vector> WebProcessProxy::allProcessesForInspector() ++Vector> WebProcessProxy::allProcessesForInspector() +{ + return copyToVector(allProcesses()); +} + RefPtr WebProcessProxy::processForIdentifier(ProcessIdentifier identifier) { - return allProcessMap().get(identifier).get(); -@@ -502,6 +507,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt + return allProcessMap().get(identifier); +@@ -513,6 +518,26 @@ void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOpt if (WebKit::isInspectorProcessPool(processPool())) launchOptions.extraInitializationData.add("inspector-process"_s, "1"_s); @@ -18142,22 +17648,22 @@ index e25e43bc48460a221afc2594dcda553942def734..05033d41747ea2def5b591e156c1d98e if (isPrewarmed()) diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h -index f88872f19589ef5c40b4b6c40937ff280a580503..949588f6f8cf7c7f010e1f8f811bbbf6cb6c1fea 100644 +index 17944648b6baf0adec20f6756e65f192fa82cd1d..66aee2da889d85cba8462c9a7a6f36ff32346713 100644 --- a/Source/WebKit/UIProcess/WebProcessProxy.h +++ b/Source/WebKit/UIProcess/WebProcessProxy.h -@@ -163,6 +163,7 @@ public: +@@ -161,6 +161,7 @@ public: static void forWebPagesWithOrigin(PAL::SessionID, const WebCore::SecurityOriginData&, const Function&); static Vector> allowedFirstPartiesForCookies(); -+ static Vector> allProcessesForInspector(); ++ static Vector> allProcessesForInspector(); WebConnection* webConnection() const { return m_webConnection.get(); } - + RefPtr protectedWebConnection() const { return m_webConnection; } diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -index 3fc97e96b47acf364b0fcb17bf9150567cf4f1dc..2ab6808401a9b975d48f7bd30a5215ff2b0f0551 100644 +index 6bed35d7964b9ccb1d510cab1203fa6b99db45ea..fde4f063f52bcae25b0788f33c64d02e951b407b 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp -@@ -293,7 +293,8 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W +@@ -298,7 +298,8 @@ SOAuthorizationCoordinator& WebsiteDataStore::soAuthorizationCoordinator(const W static Ref networkProcessForSession(PAL::SessionID sessionID) { @@ -18166,8 +17672,8 @@ index 3fc97e96b47acf364b0fcb17bf9150567cf4f1dc..2ab6808401a9b975d48f7bd30a5215ff +#if ((PLATFORM(GTK) || PLATFORM(WPE))) if (sessionID.isEphemeral()) { // Reuse a previous persistent session network process for ephemeral sessions. - for (auto* dataStore : allDataStores().values()) { -@@ -2211,6 +2212,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin, + for (auto& dataStore : allDataStores().values()) { +@@ -2147,6 +2148,12 @@ void WebsiteDataStore::originDirectoryForTesting(WebCore::ClientOrigin&& origin, protectedNetworkProcess()->websiteDataOriginDirectoryForTesting(m_sessionID, WTFMove(origin), type, WTFMove(completionHandler)); } @@ -18181,10 +17687,10 @@ index 3fc97e96b47acf364b0fcb17bf9150567cf4f1dc..2ab6808401a9b975d48f7bd30a5215ff void WebsiteDataStore::hasAppBoundSession(CompletionHandler&& completionHandler) const { diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h -index 8b2b390229d48baaadf725b6e4cf3e1313e2d2d8..7bbb2d6ad89d8dfcef6fb48c03fb951dee98f8f6 100644 +index 5f316ed41917644063eb06e1ee1dcf7985580723..8305c0187811d936390d30d6481bc901e51794fc 100644 --- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h +++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h -@@ -95,6 +95,7 @@ class DeviceIdHashSaltStorage; +@@ -97,6 +97,7 @@ class DeviceIdHashSaltStorage; class DownloadProxy; class NetworkProcessProxy; class SOAuthorizationCoordinator; @@ -18192,17 +17698,16 @@ index 8b2b390229d48baaadf725b6e4cf3e1313e2d2d8..7bbb2d6ad89d8dfcef6fb48c03fb951d class VirtualAuthenticatorManager; class WebPageProxy; class WebProcessPool; -@@ -106,6 +107,7 @@ enum class UnifiedOriginStorageLevel : uint8_t; +@@ -111,12 +112,21 @@ enum class UnifiedOriginStorageLevel : uint8_t; enum class WebsiteDataFetchOption : uint8_t; enum class WebsiteDataType : uint32_t; +struct FrameInfoData; + struct ITPThirdPartyData; struct NetworkProcessConnectionInfo; + struct WebPushMessage; struct WebsiteDataRecord; struct WebsiteDataStoreParameters; -@@ -116,6 +118,14 @@ enum class StorageAccessStatus : uint8_t; - enum class StorageAccessPromptStatus; - #endif +class DownloadInstrumentation { +public: @@ -18212,10 +17717,10 @@ index 8b2b390229d48baaadf725b6e4cf3e1313e2d2d8..7bbb2d6ad89d8dfcef6fb48c03fb951d + virtual ~DownloadInstrumentation() = default; +}; + - class WebsiteDataStore : public API::ObjectImpl, public Identified, public CanMakeWeakPtr { + class WebsiteDataStore : public API::ObjectImpl, public Identified, public CanMakeWeakPtr, public CanMakeCheckedPtr { public: static Ref defaultDataStore(); -@@ -316,11 +326,13 @@ public: +@@ -314,11 +324,13 @@ public: const WebCore::CurlProxySettings& networkProxySettings() const { return m_proxySettings; } #endif @@ -18230,7 +17735,7 @@ index 8b2b390229d48baaadf725b6e4cf3e1313e2d2d8..7bbb2d6ad89d8dfcef6fb48c03fb951d void setNetworkProxySettings(WebCore::SoupNetworkProxySettings&&); const WebCore::SoupNetworkProxySettings& networkProxySettings() const { return m_networkProxySettings; } void setCookiePersistentStorage(const String&, SoupCookiePersistentStorageType); -@@ -405,6 +417,12 @@ public: +@@ -403,6 +415,12 @@ public: static const String& defaultBaseDataDirectory(); #endif @@ -18243,7 +17748,7 @@ index 8b2b390229d48baaadf725b6e4cf3e1313e2d2d8..7bbb2d6ad89d8dfcef6fb48c03fb951d void resetQuota(CompletionHandler&&); void resetStoragePersistedState(CompletionHandler&&); #if PLATFORM(IOS_FAMILY) -@@ -560,9 +578,11 @@ private: +@@ -565,9 +583,11 @@ private: WebCore::CurlProxySettings m_proxySettings; #endif @@ -18256,7 +17761,7 @@ index 8b2b390229d48baaadf725b6e4cf3e1313e2d2d8..7bbb2d6ad89d8dfcef6fb48c03fb951d WebCore::SoupNetworkProxySettings m_networkProxySettings; String m_cookiePersistentStoragePath; SoupCookiePersistentStorageType m_cookiePersistentStorageType { SoupCookiePersistentStorageType::SQLite }; -@@ -591,6 +611,10 @@ private: +@@ -596,6 +616,10 @@ private: RefPtr m_cookieStore; RefPtr m_networkProcess; @@ -18348,10 +17853,10 @@ index db15435ed4581388a631547cdc92c092362ff84a..de45cfe0b737a0450455bafbda91887d }; diff --git a/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..da579b964f8ff0c4b4f79283a6661d7a8672c4d9 +index 0000000000000000000000000000000000000000..93de9be341045a616b0219a965af2447ecbfc926 --- /dev/null +++ b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.cpp -@@ -0,0 +1,181 @@ +@@ -0,0 +1,184 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -18511,23 +18016,26 @@ index 0000000000000000000000000000000000000000..da579b964f8ff0c4b4f79283a6661d7a + m_idToContext.remove(sessionID); +} + -+String InspectorPlaywrightAgentClientGlib::takePageScreenshot(WTF::String& error, WebPageProxy& page, WebCore::IntRect&& clip, bool nominalResolution) ++void InspectorPlaywrightAgentClientGlib::takePageScreenshot(WebPageProxy& page, WebCore::IntRect&& clip, bool nominalResolution, CompletionHandler&& completionHandler) +{ -+ cairo_surface_t* surface = nullptr; ++ page.callAfterNextPresentationUpdate([protectedPage = Ref{ page }, clip = WTFMove(clip), nominalResolution, completionHandler = WTFMove(completionHandler)]() mutable { ++ cairo_surface_t* surface = nullptr; +#if PLATFORM(GTK) -+ RefPtr viewSnapshot = page.pageClient().takeViewSnapshot(WTFMove(clip), nominalResolution); -+ if (viewSnapshot) -+ surface = viewSnapshot->surface(); ++ RefPtr viewSnapshot = protectedPage->pageClient().takeViewSnapshot(WTFMove(clip), nominalResolution); ++ if (viewSnapshot) ++ surface = viewSnapshot->surface(); +#elif PLATFORM(WPE) -+ RefPtr protectPtr = page.pageClient().takeViewSnapshot(WTFMove(clip), nominalResolution); -+ surface = protectPtr.get(); ++ RefPtr protectPtr = protectedPage->pageClient().takeViewSnapshot(WTFMove(clip), nominalResolution); ++ surface = protectPtr.get(); +#endif -+ if (surface) { -+ Vector encodeData = WebCore::encodeData(surface, "image/png"_s, std::nullopt); -+ return makeString("data:image/png;base64,"_s, base64Encoded(encodeData)); -+ } -+ error = "Failed to take screenshot"_s; -+ return String(); ++ if (surface) { ++ Vector encodeData = WebCore::encodeData(surface, "image/png"_s, std::nullopt); ++ completionHandler(emptyString(), makeString("data:image/png;base64,"_s, base64Encoded(encodeData))); ++ return; ++ } ++ ++ completionHandler("Failed to take screenshot"_s, emptyString()); ++ }); +} + +} // namespace WebKit @@ -18535,7 +18043,7 @@ index 0000000000000000000000000000000000000000..da579b964f8ff0c4b4f79283a6661d7a +#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..7280da5ef80c76bb34fc0a905efe70bbe5dcc3c8 +index 0000000000000000000000000000000000000000..394f07e1754be52b7d503d5720cba5d3724c5f4d --- /dev/null +++ b/Source/WebKit/UIProcess/glib/InspectorPlaywrightAgentClientGLib.h @@ -0,0 +1,61 @@ @@ -18588,7 +18096,7 @@ index 0000000000000000000000000000000000000000..7280da5ef80c76bb34fc0a905efe70bb + void closeBrowser() override; + std::unique_ptr createBrowserContext(WTF::String& error, const WTF::String& proxyServer, const WTF::String& proxyBypassList) override; + void deleteBrowserContext(WTF::String& error, PAL::SessionID) override; -+ String takePageScreenshot(WTF::String& error, WebPageProxy&, WebCore::IntRect&& clip, bool nominalResolution) override; ++ void takePageScreenshot(WebPageProxy&, WebCore::IntRect&& clip, bool nominalResolution, CompletionHandler&& completionHandler) override; + +private: + WebKitWebContext* findContext(WTF::String& error, PAL::SessionID); @@ -18601,7 +18109,7 @@ index 0000000000000000000000000000000000000000..7280da5ef80c76bb34fc0a905efe70bb + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h -index 39aeff71fe05354cf63d3b3701d363642d63aca4..32e96cdd0bdbd8c5dcde43fdf60052ac13a226f7 100644 +index 71fb4cbd4338bcbda3a61019cbf4a914bf74953e..6f56e4afb345c23b4d8b91ee77f1991c72e58383 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h +++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.h @@ -28,6 +28,7 @@ @@ -18620,16 +18128,16 @@ index 39aeff71fe05354cf63d3b3701d363642d63aca4..32e96cdd0bdbd8c5dcde43fdf60052ac + virtual void realize() { }; virtual void unrealize() { }; - virtual bool makeContextCurrent() { return false; } + virtual int renderHostFileDescriptor() { return -1; } diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -index 63b699e8944ee87f8546496aca281cf4efd78869..a1ecfb5f4467555ad3a370d23f4005678fb2f443 100644 +index 1d19978e9d898171ba74bdb526f7db67840e25d1..c2c4118782744c01c67153d46284fcae70dd0291 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp +++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp -@@ -386,6 +386,25 @@ void AcceleratedBackingStoreDMABuf::Surface::paint(GtkWidget*, cairo_t* cr, cons +@@ -413,6 +413,25 @@ void AcceleratedBackingStoreDMABuf::RendererCairo::paint(GtkWidget* widget, cair } #endif -+cairo_surface_t* AcceleratedBackingStoreDMABuf::Surface::surfaceForScreencast() ++cairo_surface_t* AcceleratedBackingStoreDMABuf::RendererCairo::surfaceForScreencast() +{ + if (!m_surface) + return nullptr; @@ -18648,67 +18156,64 @@ index 63b699e8944ee87f8546496aca281cf4efd78869..a1ecfb5f4467555ad3a370d23f400567 + return m_flippedSurface.get(); +} + - void AcceleratedBackingStoreDMABuf::configure(UnixFileDescriptor&& backFD, UnixFileDescriptor&& frontFD, UnixFileDescriptor&& displayFD, const WebCore::IntSize& size, uint32_t format, uint32_t offset, uint32_t stride, uint64_t modifier) + void AcceleratedBackingStoreDMABuf::didCreateBuffer(uint64_t id, const WebCore::IntSize& size, uint32_t format, Vector&& fds, Vector&& offsets, Vector&& strides, uint64_t modifier) { - m_isSoftwareRast = false; -@@ -571,4 +590,13 @@ bool AcceleratedBackingStoreDMABuf::paint(cairo_t* cr, const WebCore::IntRect& c + #if USE(GBM) +@@ -576,6 +595,15 @@ bool AcceleratedBackingStoreDMABuf::paint(cairo_t* cr, const WebCore::IntRect& c } #endif +cairo_surface_t* AcceleratedBackingStoreDMABuf::surface() +{ -+ if (m_committedSource) -+ return m_committedSource->surfaceForScreencast(); ++ if (!m_renderer) ++ return nullptr; + -+ return nullptr; ++ return m_renderer->surfaceForScreencast(); +} + + } // namespace WebKit + + #endif // USE(EGL) diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h -index 1bc769ada3135a19f13851c8099ad008fcac8a04..1604833f958746b993dea0b50f16758b867ed071 100644 +index b73a9be34afe38a37e06eca0c8bfd78dfab88e99..b3bf1185fddaa7f61da0845a05869301689709e4 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h +++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.h -@@ -82,6 +82,7 @@ private: +@@ -89,6 +89,7 @@ private: #else bool paint(cairo_t*, const WebCore::IntRect&) override; #endif + cairo_surface_t* surface() override; - void realize() override; void unrealize() override; - bool makeContextCurrent() override; -@@ -99,6 +100,7 @@ private: + void update(const LayerTreeContext&) override; + +@@ -178,6 +179,7 @@ private: #else virtual void paint(GtkWidget*, cairo_t*, const WebCore::IntRect&) const = 0; #endif + virtual cairo_surface_t* surfaceForScreencast() = 0; - const WebCore::IntSize size() const { return m_size; } + Buffer* buffer() const { return m_buffer.get(); } -@@ -125,6 +127,7 @@ private: +@@ -202,6 +204,7 @@ private: #else void paint(GtkWidget*, cairo_t*, const WebCore::IntRect&) const override; #endif + cairo_surface_t* surfaceForScreencast() override { return nullptr; } - GRefPtr m_context; unsigned m_textureID { 0 }; -@@ -156,6 +159,7 @@ private: + #if USE(GTK4) +@@ -223,8 +226,10 @@ private: #else void paint(GtkWidget*, cairo_t*, const WebCore::IntRect&) const override; #endif + cairo_surface_t* surfaceForScreencast() override; - #if USE(GBM) - RefPtr map(struct gbm_bo*) const; -@@ -173,6 +177,7 @@ private: RefPtr m_surface; - RefPtr m_backSurface; - RefPtr m_displaySurface; + RefPtr m_flippedSurface; }; - std::unique_ptr createSource(); + GRefPtr m_gdkGLContext; diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.h b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.h index 054e80bd900cf16d69801e8102ca989ff0563e1d..8245d7ed58008dbb6152e55e619e4331d30ae674 100644 --- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.h @@ -18970,11 +18475,28 @@ index 0000000000000000000000000000000000000000..6a204c5bba8fb95ddb2d1c14cae7a3a7 +} + +} // namespace WebKit +diff --git a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp +index d18b3e777203ef5d0f33884f909bc598d3526831..aef80b47359d7a2e4805a006dc59cd60d499a60e 100644 +--- a/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp ++++ b/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp +@@ -77,8 +77,10 @@ void WebPasteboardProxy::setPrimarySelectionOwner(WebFrameProxy* frame) + if (m_primarySelectionOwner == frame) + return; + +- if (m_primarySelectionOwner) +- m_primarySelectionOwner->collapseSelection(); ++// Playwright begin: do not change selection in another page! ++ // if (m_primarySelectionOwner) ++ // m_primarySelectionOwner->collapseSelection(); ++// Playwright end + + m_primarySelectionOwner = frame; + } diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm -index a5d22fb2ded1af0b22d3633e2c0f27390883679f..3a5672f959161ed6c8c6e159bb0373791d6963a2 100644 +index 347b40907e576ab0ba78d65bb91f12de70437a95..58307d07baca9d00c2318074e2a8610d0f09e1c6 100644 --- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm +++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm -@@ -465,6 +465,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) +@@ -472,6 +472,8 @@ IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) { @@ -18983,22 +18505,9 @@ index a5d22fb2ded1af0b22d3633e2c0f27390883679f..3a5672f959161ed6c8c6e159bb037379 [contentView() _didHandleKeyEvent:event.nativeEvent() eventWasHandled:eventWasHandled]; } -diff --git a/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm b/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm -index b966690dded104d2d3debd5a25fa4a7ba3e5539b..ec12c90073fc3498a1fe8d78e943c57441e1c607 100644 ---- a/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm -+++ b/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm -@@ -245,7 +245,7 @@ void DisplayCaptureSessionManager::promptForGetDisplayMedia(UserMediaPermissionR - #elif PLATFORM(MAC) - - // There is no picker on systems without ScreenCaptureKit, so share the main screen. -- completionHandler(CGDisplayStreamScreenCaptureSource::screenCaptureDeviceForMainDisplay()); -+ completionHandler(WebCore::CGDisplayStreamScreenCaptureSource::screenCaptureDeviceForMainDisplay()); - - #endif - } diff --git a/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.h b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.h new file mode 100644 -index 0000000000000000000000000000000000000000..a56c14a89afef09890174e72895733a6499543a1 +index 0000000000000000000000000000000000000000..2aabc02a4b5432f68a6e85fd9689775608f05a67 --- /dev/null +++ b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.h @@ -0,0 +1,53 @@ @@ -19046,7 +18555,7 @@ index 0000000000000000000000000000000000000000..a56c14a89afef09890174e72895733a6 + void closeBrowser() override; + std::unique_ptr createBrowserContext(WTF::String& error, const WTF::String& proxyServer, const WTF::String& proxyBypassList) override; + void deleteBrowserContext(WTF::String& error, PAL::SessionID) override; -+ String takePageScreenshot(WTF::String& error, WebPageProxy&, WebCore::IntRect&& clip, bool nominalResolution) override; ++ void takePageScreenshot(WebPageProxy&, WebCore::IntRect&& clip, bool nominalResolution, CompletionHandler&& completionHandler) override; + +private: + _WKBrowserInspectorDelegate* delegate_; @@ -19057,10 +18566,10 @@ index 0000000000000000000000000000000000000000..a56c14a89afef09890174e72895733a6 +} // namespace API diff --git a/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mm b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mm new file mode 100644 -index 0000000000000000000000000000000000000000..a30d408d97c383929036626691020923f9dbfbd7 +index 0000000000000000000000000000000000000000..0de68ad69c87f9d5b0a5f0d24fb358a50b59b4a2 --- /dev/null +++ b/Source/WebKit/UIProcess/mac/InspectorPlaywrightAgentClientMac.mm -@@ -0,0 +1,94 @@ +@@ -0,0 +1,96 @@ +/* + * Copyright (C) 2019 Microsoft Corporation. + * @@ -19140,18 +18649,20 @@ index 0000000000000000000000000000000000000000..a30d408d97c383929036626691020923 + [delegate_ deleteBrowserContext:sessionID.toUInt64()]; +} + -+String InspectorPlaywrightAgentClientMac::takePageScreenshot(WTF::String& error, WebPageProxy& page, WebCore::IntRect&& clipRect, bool) ++void InspectorPlaywrightAgentClientMac::takePageScreenshot(WebPageProxy& page, WebCore::IntRect&& clipRect, bool, CompletionHandler&& completionHandler) +{ -+ RetainPtr imageRef = page.pageClient().takeSnapshotForAutomation(); -+ if (!imageRef) { -+ error = "Could not take view snapshot"_s; -+ return String(); -+ } -+ + int toolbarHeight = headless_ ? 0 : 59; -+ clipRect.move(0, toolbarHeight); -+ RetainPtr transformedImageRef = adoptCF(CGImageCreateWithImageInRect(imageRef.get(), clipRect)); -+ return WebCore::dataURL(transformedImageRef.get(), "image/png"_s, std::nullopt); ++ page.callAfterNextPresentationUpdate([protectedPage = Ref { page }, toolbarHeight, clipRect = WTFMove(clipRect), completionHandler = WTFMove(completionHandler)]() mutable { ++ RetainPtr imageRef = protectedPage->pageClient().takeSnapshotForAutomation(); ++ if (!imageRef) { ++ completionHandler("Could not take view snapshot"_s, emptyString()); ++ return; ++ } ++ ++ clipRect.move(0, toolbarHeight); ++ RetainPtr transformedImageRef = adoptCF(CGImageCreateWithImageInRect(imageRef.get(), clipRect)); ++ completionHandler(emptyString(), WebCore::dataURL(transformedImageRef.get(), "image/png"_s, std::nullopt)); ++ }); +} + +} // namespace WebKit @@ -19204,7 +18715,7 @@ index 0000000000000000000000000000000000000000..721826c8c98fc85b68a4f45deaee69c1 + +#endif diff --git a/Source/WebKit/UIProcess/mac/PageClientImplMac.h b/Source/WebKit/UIProcess/mac/PageClientImplMac.h -index 8b42f45a887fe7605c043f794432785da5c7a2f3..be6283c27e3e15d76cb766355c0c4e4320697295 100644 +index fc5dd0e2a5f27081287e7e438f3a2104c693ac6b..00748ae080a91519c24804b7857fcdf33961a346 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.h +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.h @@ -54,6 +54,8 @@ class PageClientImpl final : public PageClientImplCocoa @@ -19238,7 +18749,7 @@ index 8b42f45a887fe7605c043f794432785da5c7a2f3..be6283c27e3e15d76cb766355c0c4e43 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 f57fbfcb950259723f5d7672198ec811491003a2..30eb73f44f4b8d2dc8888f86128b22155c0abf34 100644 +index 8ec513d0904d5c3a34971254f3da4e6773cda603..ccac6f3f492ea5ea0d96cffde215264691d2aade 100644 --- a/Source/WebKit/UIProcess/mac/PageClientImplMac.mm +++ b/Source/WebKit/UIProcess/mac/PageClientImplMac.mm @@ -81,6 +81,7 @@ @@ -19358,20 +18869,8 @@ index f57fbfcb950259723f5d7672198ec811491003a2..30eb73f44f4b8d2dc8888f86128b2215 return m_impl->windowIsFrontWindowUnderMouse(event.nativeEvent()); } -diff --git a/Source/WebKit/UIProcess/mac/WKImmediateActionController.h b/Source/WebKit/UIProcess/mac/WKImmediateActionController.h -index 74db97569f5179f3065f0a48dbb228777ddc6925..853d6ed84648ccb60f63ed464dddfeedfe374178 100644 ---- a/Source/WebKit/UIProcess/mac/WKImmediateActionController.h -+++ b/Source/WebKit/UIProcess/mac/WKImmediateActionController.h -@@ -31,6 +31,7 @@ - #import "WKImmediateActionTypes.h" - #import "WebHitTestResultData.h" - #import -+#import - #import - #import - #import diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h -index 46aaf12accb35a2e7685d61887e76f0fe14d76c5..37f418197dcc3f6c74fac258ba77d00df0effeb2 100644 +index 6ab7aacaebfda818e3010bb06db72c8552ac598a..3e19cba50d73084392f62f176ad4c3153803e579 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h +++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h @@ -68,6 +68,7 @@ private: @@ -19383,10 +18882,10 @@ index 46aaf12accb35a2e7685d61887e76f0fe14d76c5..37f418197dcc3f6c74fac258ba77d00d bool showAfterPostProcessingContextData(); diff --git a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -index a38ea69b1ad0d77f4736b3de5e0e81741c0b9a98..86ce1429522e5f76fc432e3e903e72d920fc5791 100644 +index 57b1c6f4ecdbae5d8ffdcccfd60e1c083387c00d..f4961b46b3c348a62f31ca13c40be04aae76e02d 100644 --- a/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm +++ b/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm -@@ -480,6 +480,12 @@ void WebContextMenuProxyMac::getShareMenuItem(CompletionHandler - #import - #import -+#import - #import - #import - #import -@@ -104,6 +105,7 @@ - #import - #import - #import -+#import - #import - #import - #import -@@ -2340,6 +2342,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace() +@@ -2342,6 +2342,11 @@ WebCore::DestinationColorSpace WebViewImpl::colorSpace() if (!m_colorSpace) m_colorSpace = [NSColorSpace sRGBColorSpace]; } @@ -19631,7 +19114,7 @@ index b2ae8d81e2f7a92ffb317614a31052a119888b22..b0fcdf6b5cb584c6746c40cc2733b6b7 ASSERT(m_colorSpace); return WebCore::DestinationColorSpace { [m_colorSpace CGColorSpace] }; -@@ -4406,6 +4413,18 @@ ALLOW_DEPRECATED_DECLARATIONS_BEGIN +@@ -4408,6 +4413,18 @@ ALLOW_DEPRECATED_DECLARATIONS_BEGIN ALLOW_DEPRECATED_DECLARATIONS_END } @@ -19650,65 +19133,6 @@ index b2ae8d81e2f7a92ffb317614a31052a119888b22..b0fcdf6b5cb584c6746c40cc2733b6b7 RefPtr WebViewImpl::takeViewSnapshot() { NSWindow *window = [m_view window]; -@@ -5002,11 +5021,11 @@ static Vector compositionHighlights(NSAttributedS - Vector highlights; - [string enumerateAttributesInRange:NSMakeRange(0, string.length) options:0 usingBlock:[&highlights](NSDictionary *attributes, NSRange range, BOOL *) { - std::optional backgroundHighlightColor; -- if (CocoaColor *backgroundColor = attributes[NSBackgroundColorAttributeName]) -+ if (WebCore::CocoaColor *backgroundColor = attributes[NSBackgroundColorAttributeName]) - backgroundHighlightColor = WebCore::colorFromCocoaColor(backgroundColor); - - std::optional foregroundHighlightColor; -- if (CocoaColor *foregroundColor = attributes[NSForegroundColorAttributeName]) -+ if (WebCore::CocoaColor *foregroundColor = attributes[NSForegroundColorAttributeName]) - foregroundHighlightColor = WebCore::colorFromCocoaColor(foregroundColor); - - highlights.append({ static_cast(range.location), static_cast(NSMaxRange(range)), backgroundHighlightColor, foregroundHighlightColor }); -@@ -5098,7 +5117,7 @@ static Vector compositionUnderlines(NSAttributedS - return mergedUnderlines; - } - --static HashMap> compositionAnnotations(NSAttributedString *string) -+static HashMap> compositionAnnotations(NSAttributedString *string) - { - if (!string.length) - return { }; -@@ -5111,7 +5130,7 @@ static HashMap> compositionAnnotations(NSAttribut - }); - #endif - -- HashMap> annotations; -+ HashMap> annotations; - [string enumerateAttributesInRange:NSMakeRange(0, string.length) options:0 usingBlock:[&annotations](NSDictionary *attributes, NSRange range, BOOL *) { - [attributes enumerateKeysAndObjectsUsingBlock:[&annotations, &range](NSAttributedStringKey key, id value, BOOL *) { - -@@ -5120,7 +5139,7 @@ static HashMap> compositionAnnotations(NSAttribut - - auto it = annotations.find(key); - if (it == annotations.end()) -- it = annotations.add(key, Vector { }).iterator; -+ it = annotations.add(key, Vector { }).iterator; - auto& vector = it->value; - - // Coalesce this range into the previous one if possible -@@ -5147,7 +5166,7 @@ void WebViewImpl::setMarkedText(id string, NSRange selectedRange, NSRange replac - - Vector underlines; - Vector highlights; -- HashMap> annotations; -+ HashMap> annotations; - NSString *text; - - if (isAttributedString) { -@@ -6011,7 +6030,7 @@ void WebViewImpl::updateMediaPlaybackControlsManager() - [m_playbackControlsManager setCanTogglePictureInPicture:NO]; - } - -- if (PlatformPlaybackSessionInterface* interface = m_page->playbackSessionManager()->controlsManagerInterface()) { -+ if (WebCore::PlatformPlaybackSessionInterface* interface = m_page->playbackSessionManager()->controlsManagerInterface()) { - [m_playbackControlsManager setPlaybackSessionInterfaceMac:interface]; - interface->updatePlaybackControlsManagerCanTogglePictureInPicture(); - } diff --git a/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.cpp b/Source/WebKit/UIProcess/win/InspectorPlaywrightAgentClientWin.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dd7fe0604188bb025f361f1c44685e38bbf935ca @@ -20469,10 +19893,10 @@ index 0000000000000000000000000000000000000000..a7d88f8c745f95af21db71dcfce368ba + +} // namespace WebKit diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj -index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852cf7f5457 100644 +index 98b6f9373612c42f72a78bf9e116b784ee75040e..51774e0340fa3453a29fd28d09b02011e4093169 100644 --- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj -@@ -1350,6 +1350,7 @@ +@@ -1439,6 +1439,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 */; }; @@ -20480,7 +19904,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 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 */; }; -@@ -2109,6 +2110,18 @@ +@@ -2217,6 +2218,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 */; }; @@ -20499,7 +19923,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 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, ); }; }; -@@ -2174,6 +2187,8 @@ +@@ -2293,6 +2306,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 */; }; @@ -20508,7 +19932,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 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 */; }; -@@ -2192,6 +2207,9 @@ +@@ -2311,6 +2326,9 @@ EBA8D3B627A5E33F00CB7900 /* MockPushServiceConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = EBA8D3B027A5E33F00CB7900 /* MockPushServiceConnection.mm */; }; EBA8D3B727A5E33F00CB7900 /* PushServiceConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = EBA8D3B127A5E33F00CB7900 /* PushServiceConnection.mm */; }; ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -20516,9 +19940,9 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 + F33C7AC7249AD79C0018BE41 /* libwebrtc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F33C7AC6249AD79C0018BE41 /* libwebrtc.dylib */; }; + F3867F0A24607D4E008F0F31 /* InspectorScreencastAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3867F0424607D2B008F0F31 /* InspectorScreencastAgent.h */; }; F409BA181E6E64BC009DA28E /* WKDragDestinationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */; settings = {ATTRIBUTES = (Private, ); }; }; - F4299507270E234D0032298B /* StreamMessageReceiver.h in Headers */ = {isa = PBXBuildFile; fileRef = F4299506270E234C0032298B /* StreamMessageReceiver.h */; }; - F42D634122A0EFDF00D2FB3A /* WebAutocorrectionData.h in Headers */ = {isa = PBXBuildFile; fileRef = F42D633F22A0EFD300D2FB3A /* WebAutocorrectionData.h */; }; -@@ -5459,6 +5477,7 @@ + F40C3B712AB401C5007A3567 /* WKDatePickerPopoverController.h in Headers */ = {isa = PBXBuildFile; fileRef = F40C3B6F2AB40167007A3567 /* WKDatePickerPopoverController.h */; }; + F41795A62AC61B78007F5F12 /* CompactContextMenuPresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = F41795A42AC619A2007F5F12 /* CompactContextMenuPresenter.h */; }; +@@ -5769,6 +5787,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 = ""; }; @@ -20526,7 +19950,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 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 = ""; }; -@@ -7058,6 +7077,19 @@ +@@ -7397,6 +7416,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 = ""; }; @@ -20546,7 +19970,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 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 = ""; }; -@@ -7193,6 +7225,8 @@ +@@ -7536,6 +7568,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 = ""; }; @@ -20555,7 +19979,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 E5DEFA6726F8F42600AB68DB /* PhotosUISPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotosUISPI.h; sourceTree = ""; }; EB0D312D275AE13300863D8F /* com.apple.webkit.webpushd.mac.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.webkit.webpushd.mac.plist; sourceTree = ""; }; EB0D312E275AE13300863D8F /* com.apple.webkit.webpushd.ios.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.webkit.webpushd.ios.plist; sourceTree = ""; }; -@@ -7216,6 +7250,14 @@ +@@ -7558,6 +7592,14 @@ ECA680D31E6904B500731D20 /* ExtraPrivateSymbolsForTAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtraPrivateSymbolsForTAPI.h; sourceTree = ""; }; ECBFC1DB1E6A4D66000300C7 /* ExtraPublicSymbolsForTAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExtraPublicSymbolsForTAPI.h; sourceTree = ""; }; F036978715F4BF0500C3A80E /* WebColorPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebColorPicker.cpp; sourceTree = ""; }; @@ -20568,9 +19992,9 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 + F3867F0424607D2B008F0F31 /* InspectorScreencastAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorScreencastAgent.h; sourceTree = ""; }; + F3970344249BD4CE003E1A22 /* ScreencastEncoderMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScreencastEncoderMac.mm; sourceTree = ""; }; F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDragDestinationAction.h; sourceTree = ""; }; - F40D1B68220BDC0F00B49A01 /* WebAutocorrectionContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebAutocorrectionContext.h; path = ios/WebAutocorrectionContext.h; sourceTree = ""; }; - F41056612130699A0092281D /* APIAttachmentCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = APIAttachmentCocoa.mm; sourceTree = ""; }; -@@ -7390,6 +7432,7 @@ + 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 = ""; }; +@@ -7806,6 +7848,7 @@ 3766F9EE189A1241003CF19B /* JavaScriptCore.framework in Frameworks */, 3766F9F1189A1254003CF19B /* libicucore.dylib in Frameworks */, 7B9FC5BB28A5233B007570E7 /* libWebKitPlatform.a in Frameworks */, @@ -20578,7 +20002,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 3766F9EF189A1244003CF19B /* QuartzCore.framework in Frameworks */, 37694525184FC6B600CDE21F /* Security.framework in Frameworks */, 37BEC4DD1948FC6A008B4286 /* WebCore.framework in Frameworks */, -@@ -9911,6 +9954,7 @@ +@@ -10442,6 +10485,7 @@ 99788ACA1F421DCA00C08000 /* _WKAutomationSessionConfiguration.mm */, 990D28A81C6404B000986977 /* _WKAutomationSessionDelegate.h */, 990D28AF1C65203900986977 /* _WKAutomationSessionInternal.h */, @@ -20586,7 +20010,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 5C4609E222430E4C009943C2 /* _WKContentRuleListAction.h */, 5C4609E322430E4D009943C2 /* _WKContentRuleListAction.mm */, 5C4609E422430E4D009943C2 /* _WKContentRuleListActionInternal.h */, -@@ -11062,6 +11106,7 @@ +@@ -11663,6 +11707,7 @@ E34B110C27C46BC6006D2F2E /* libWebCoreTestShim.dylib */, E34B110F27C46D09006D2F2E /* libWebCoreTestSupport.dylib */, DDE992F4278D06D900F60D26 /* libWebKitAdditions.a */, @@ -20594,7 +20018,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 57A9FF15252C6AEF006A2040 /* libWTF.a */, 5750F32A2032D4E500389347 /* LocalAuthentication.framework */, 570DAAB0230273D200E8FC04 /* NearField.framework */, -@@ -11601,6 +11646,12 @@ +@@ -12230,6 +12275,12 @@ children = ( 9197940423DBC4BB00257892 /* InspectorBrowserAgent.cpp */, 9197940323DBC4BB00257892 /* InspectorBrowserAgent.h */, @@ -20607,7 +20031,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 ); path = Agents; sourceTree = ""; -@@ -11609,6 +11660,7 @@ +@@ -12238,6 +12289,7 @@ isa = PBXGroup; children = ( A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorUIProxyMac.mm */, @@ -20615,24 +20039,24 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 1CA8B935127C774E00576C2B /* WebInspectorUIProxyMac.mm */, 99A7ACE326012919006D57FD /* WKInspectorResourceURLSchemeHandler.h */, 99A7ACE42601291A006D57FD /* WKInspectorResourceURLSchemeHandler.mm */, -@@ -12214,6 +12266,7 @@ +@@ -12867,6 +12919,7 @@ E1513C65166EABB200149FCB /* AuxiliaryProcessProxy.h */, 46A2B6061E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.cpp */, 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */, + D71A944B237239FB002C4D9E /* BrowserInspectorPipe.h */, + 5C6D69352AC3935D0099BDAF /* BrowsingContextGroup.cpp */, + 5C6D69362AC3935D0099BDAF /* BrowsingContextGroup.h */, 07297F9C1C1711EA003F0735 /* DeviceIdHashSaltStorage.cpp */, - 07297F9D1C17BBEA223F0735 /* DeviceIdHashSaltStorage.h */, - BC2652121182608100243E12 /* DrawingAreaProxy.cpp */, -@@ -12229,6 +12282,8 @@ +@@ -12886,6 +12939,8 @@ + BC06F43912DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp */, + BC06F43812DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h */, 2DD5A72A1EBF09A7009BA597 /* HiddenPageThrottlingAutoIncreasesCounter.h */, - 839A2F2F1E2067390039057E /* HighPerformanceGraphicsUsageSampler.cpp */, - 839A2F301E2067390039057E /* HighPerformanceGraphicsUsageSampler.h */, + D76D6887238DBD80008D314B /* InspectorDialogAgent.h */, + D71A94332370E07A002C4D9E /* InspectorPlaywrightAgentClient.h */, 5CEABA2B2333251400797797 /* LegacyGlobalSettings.cpp */, 5CEABA2A2333247700797797 /* LegacyGlobalSettings.h */, 31607F3819627002009B87DA /* LegacySessionStateCoding.h */, -@@ -12263,6 +12318,7 @@ +@@ -12920,6 +12975,7 @@ 1A0C227D2451130A00ED614D /* QuickLookThumbnailingSoftLink.mm */, 1AEE57232409F142002005D6 /* QuickLookThumbnailLoader.h */, 1AEE57242409F142002005D6 /* QuickLookThumbnailLoader.mm */, @@ -20640,7 +20064,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 5CCB54DC2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.cpp */, 5CCB54DB2A4FEA6A0005FAA8 /* RemotePageDrawingAreaProxy.h */, 5C907E9A294D507100B3402D /* RemotePageProxy.cpp */, -@@ -12368,6 +12424,8 @@ +@@ -13025,6 +13081,8 @@ BC7B6204129A0A6700D174A4 /* WebPageGroup.h */, 2D9EA3101A96D9EB002D2807 /* WebPageInjectedBundleClient.cpp */, 2D9EA30E1A96CBFF002D2807 /* WebPageInjectedBundleClient.h */, @@ -20649,7 +20073,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 BC111B0B112F5E4F00337BAB /* WebPageProxy.cpp */, BC032DCB10F4389F0058C15A /* WebPageProxy.h */, BCBD38FA125BAB9A00D2C29F /* WebPageProxy.messages.in */, -@@ -12530,6 +12588,7 @@ +@@ -13187,6 +13245,7 @@ BC646C1911DD399F006455B0 /* WKBackForwardListItemRef.h */, BC646C1611DD399F006455B0 /* WKBackForwardListRef.cpp */, BC646C1711DD399F006455B0 /* WKBackForwardListRef.h */, @@ -20657,8 +20081,8 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 BCB9E24A1120E15C00A137E0 /* WKContext.cpp */, BCB9E2491120E15C00A137E0 /* WKContext.h */, 1AE52F9319201F6B00A1FA37 /* WKContextConfigurationRef.cpp */, -@@ -13109,6 +13168,9 @@ - 0F49294628FF0F4B00AF8509 /* DisplayLinkProcessProxyClient.h */, +@@ -13763,6 +13822,9 @@ + 7AFA6F682A9F57C50055322A /* DisplayLinkMac.cpp */, 31ABA79C215AF9E000C90E31 /* HighPerformanceGPUManager.h */, 31ABA79D215AF9E000C90E31 /* HighPerformanceGPUManager.mm */, + D71A94302370E025002C4D9E /* InspectorPlaywrightAgentClientMac.h */, @@ -20667,7 +20091,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 1AFDE65B1954E8D500C48FFA /* LegacySessionStateCoding.cpp */, 0FCB4E5818BBE3D9000FCFC9 /* PageClientImplMac.h */, 0FCB4E5918BBE3D9000FCFC9 /* PageClientImplMac.mm */, -@@ -13132,6 +13194,8 @@ +@@ -13786,6 +13848,8 @@ E568B92120A3AC6A00E3C856 /* WebDataListSuggestionsDropdownMac.mm */, E55CD20124D09F1F0042DB9C /* WebDateTimePickerMac.h */, E55CD20224D09F1F0042DB9C /* WebDateTimePickerMac.mm */, @@ -20676,7 +20100,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 BC857E8512B71EBB00EDEB2E /* WebPageProxyMac.mm */, BC5750951268F3C6006F0F12 /* WebPopupMenuProxyMac.h */, BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */, -@@ -14055,6 +14119,7 @@ +@@ -14741,6 +14805,7 @@ 99788ACB1F421DDA00C08000 /* _WKAutomationSessionConfiguration.h in Headers */, 990D28AC1C6420CF00986977 /* _WKAutomationSessionDelegate.h in Headers */, 990D28B11C65208D00986977 /* _WKAutomationSessionInternal.h in Headers */, @@ -20684,15 +20108,15 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 5C4609E7224317B4009943C2 /* _WKContentRuleListAction.h in Headers */, 5C4609E8224317BB009943C2 /* _WKContentRuleListActionInternal.h in Headers */, 1A5704F81BE01FF400874AF1 /* _WKContextMenuElementInfo.h in Headers */, -@@ -14330,6 +14395,7 @@ +@@ -15027,6 +15092,7 @@ E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */, 4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */, 1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */, + D71A944C237239FB002C4D9E /* BrowserInspectorPipe.h in Headers */, + 463A074B2AFD8C7200CA8DBE /* BufferAndBackendInfo.h in Headers */, BC3065FA1259344E00E71278 /* CacheModel.h in Headers */, 935BF7FC2936BF1A00B41326 /* CacheStorageCache.h in Headers */, - 934CF817294B884C00304F7D /* CacheStorageDiskStore.h in Headers */, -@@ -14465,7 +14531,11 @@ +@@ -15182,7 +15248,11 @@ BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */, CE550E152283752200D28791 /* InsertTextOptions.h in Headers */, 9197940523DBC4BB00257892 /* InspectorBrowserAgent.h in Headers */, @@ -20704,7 +20128,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */, C5BCE5DF1C50766A00CDE3FA /* InteractionInformationAtPosition.h in Headers */, 2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */, -@@ -14693,6 +14763,7 @@ +@@ -15420,6 +15490,7 @@ CDAC20CA23FC2F750021DEE3 /* RemoteCDMInstanceSession.h in Headers */, CDAC20C923FC2F750021DEE3 /* RemoteCDMInstanceSessionIdentifier.h in Headers */, F451C0FE2703B263002BA03B /* RemoteDisplayListRecorderProxy.h in Headers */, @@ -20712,7 +20136,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */, 2DDF731518E95060004F5A66 /* RemoteLayerBackingStoreCollection.h in Headers */, 1AB16AEA164B3A8800290D62 /* RemoteLayerTreeContext.h in Headers */, -@@ -14744,6 +14815,7 @@ +@@ -15472,6 +15543,7 @@ E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */, E36FF00327F36FBD004BE21A /* SandboxStateVariables.h in Headers */, 7BAB111025DD02B3008FC479 /* ScopedActiveMessageReceiveQueue.h in Headers */, @@ -20720,7 +20144,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 E4D54D0421F1D72D007E3C36 /* ScrollingTreeFrameScrollingNodeRemoteIOS.h in Headers */, 0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */, 0F931C1C18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h in Headers */, -@@ -15041,6 +15113,8 @@ +@@ -15793,6 +15865,8 @@ 939EF87029D112EE00F23AEE /* WebPageInlines.h in Headers */, 9197940823DBC4CB00257892 /* WebPageInspectorAgentBase.h in Headers */, A513F5402154A5D700662841 /* WebPageInspectorController.h in Headers */, @@ -20729,16 +20153,16 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 A543E30C215C8A8D00279CD9 /* WebPageInspectorTarget.h in Headers */, A543E30D215C8A9000279CD9 /* WebPageInspectorTargetController.h in Headers */, A543E307215AD13700279CD9 /* WebPageInspectorTargetFrontendChannel.h in Headers */, -@@ -17095,6 +17169,8 @@ +@@ -17975,6 +18049,8 @@ 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 */, + 1CC94E532AC92F190045F269 /* JSWebExtensionAPIAction.mm in Sources */, 1C2B4D4B2A819D0D00C528A1 /* JSWebExtensionAPIAlarms.mm in Sources */, - B6114A7F29394A1600380B1B /* JSWebExtensionAPIEvent.mm in Sources */, - 1C5DC471290B33A20061EC62 /* JSWebExtensionAPIExtension.mm in Sources */, -@@ -17473,6 +17549,8 @@ + 1C8ECFEA2AFC7DCB007BAA62 /* JSWebExtensionAPICommands.mm in Sources */, +@@ -18378,6 +18454,8 @@ E3816B3D27E2463A005EAFC0 /* WebMockContentFilterManager.cpp in Sources */, 31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */, 2DF6FE52212E110900469030 /* WebPage.cpp in Sources */, @@ -20748,7 +20172,7 @@ index 4d2b0f95ee9155c2609dde955b557a9ab470ff24..b577c3453e36f94e9b7919db453b7852 BCBD3914125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp in Sources */, 7CE9CE101FA0767A000177DE /* WebPageUpdatePreferences.cpp in Sources */, diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp -index 96ca9aa77753f7ca5684185cfe0c6c61b4fa778d..93a415117af807fa7048a7a6e2e602839176af3b 100644 +index 8d0b53b4b42552d750d3e094f58709b868ac39e4..70be1bb2fade88c7b622ef7057ddac59ebde3103 100644 --- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp +++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp @@ -237,6 +237,11 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou @@ -20842,7 +20266,7 @@ index 96ca9aa77753f7ca5684185cfe0c6c61b4fa778d..93a415117af807fa7048a7a6e2e60283 } void WebLoaderStrategy::scheduleInternallyFailedLoad(WebCore::ResourceLoader& resourceLoader) -@@ -959,7 +973,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier +@@ -954,7 +968,7 @@ void WebLoaderStrategy::didFinishPreconnection(WebCore::ResourceLoaderIdentifier bool WebLoaderStrategy::isOnLine() const { @@ -20851,7 +20275,7 @@ index 96ca9aa77753f7ca5684185cfe0c6c61b4fa778d..93a415117af807fa7048a7a6e2e60283 } void WebLoaderStrategy::addOnlineStateChangeListener(Function&& listener) -@@ -986,6 +1000,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet +@@ -981,6 +995,11 @@ void WebLoaderStrategy::isResourceLoadFinished(CachedResource& resource, Complet void WebLoaderStrategy::setOnLineState(bool isOnLine) { @@ -20863,7 +20287,7 @@ index 96ca9aa77753f7ca5684185cfe0c6c61b4fa778d..93a415117af807fa7048a7a6e2e60283 if (m_isOnLine == isOnLine) return; -@@ -994,6 +1013,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) +@@ -989,6 +1008,12 @@ void WebLoaderStrategy::setOnLineState(bool isOnLine) listener(isOnLine); } @@ -20877,10 +20301,10 @@ index 96ca9aa77753f7ca5684185cfe0c6c61b4fa778d..93a415117af807fa7048a7a6e2e60283 { 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 3a3e596fa167fadaf36cfafdf8fd91dd0d7c8a8e..a6a305585706f9a407375fd2e365c52bcb1b8a43 100644 +index c934b96510c03ed6301d3695edbb30710331d7f6..ee2e7ba36e50c14aee91e9f09d70b80026aeb8d5 100644 --- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h +++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h -@@ -41,6 +41,7 @@ struct FetchOptions; +@@ -42,6 +42,7 @@ struct FetchOptions; namespace WebKit { class NetworkProcessConnection; @@ -20888,7 +20312,7 @@ index 3a3e596fa167fadaf36cfafdf8fd91dd0d7c8a8e..a6a305585706f9a407375fd2e365c52b class WebFrame; class WebPage; class WebURLSchemeTaskProxy; -@@ -88,6 +89,9 @@ public: +@@ -89,6 +90,9 @@ public: bool isOnLine() const final; void addOnlineStateChangeListener(Function&&) final; void setOnLineState(bool); @@ -20898,7 +20322,7 @@ index 3a3e596fa167fadaf36cfafdf8fd91dd0d7c8a8e..a6a305585706f9a407375fd2e365c52b void setExistingNetworkResourceLoadIdentifierToResume(std::optional existingNetworkResourceLoadIdentifierToResume) { m_existingNetworkResourceLoadIdentifierToResume = existingNetworkResourceLoadIdentifierToResume; } -@@ -140,6 +144,7 @@ private: +@@ -141,6 +145,7 @@ private: Vector> m_onlineStateChangeListeners; std::optional m_existingNetworkResourceLoadIdentifierToResume; bool m_isOnLine { true }; @@ -20943,20 +20367,20 @@ index ee9c3c4f48c328daaa015e2122235e51349bd999..5b3a4d3e742147195e0ff9e88176759d auto permissionHandlers = m_requestsPerOrigin.take(securityOrigin); diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -index 888dc9b6f2edb6347901611bc9cd4622b4b0a08a..3bf71068c4a17cf8fb165f32cb39b6b324a407b2 100644 +index f7e7166c5905b7de9225d54447ff392c70996c35..37f543662f58af9ff4b5846c0d6b9ed60f0ed83a 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp -@@ -425,6 +425,8 @@ void WebChromeClient::setResizable(bool resizable) - - void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, unsigned columnNumber, const String& sourceID) +@@ -455,6 +455,8 @@ void WebChromeClient::addMessageToConsole(MessageSource source, MessageLevel lev { -+ if (level == MessageLevel::Error) -+ m_page.send(Messages::WebPageProxy::LogToStderr(message)); // Notify the bundle client. - m_page.injectedBundleUIClient().willAddMessageToConsole(&m_page, source, level, message, lineNumber, columnNumber, sourceID); + auto page = protectedPage(); ++ if (level == MessageLevel::Error) ++ page->send(Messages::WebPageProxy::LogToStderr(message)); + page->injectedBundleUIClient().willAddMessageToConsole(page.ptr(), source, level, message, lineNumber, columnNumber, sourceID); } + diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp -index 87121e8b57e5ad7ef74857685f0db65e164a5bf8..580dca6ca0709a2d620d3999beb69856981a54e8 100644 +index 2eb0886f13ed035a53b8eaa60605de4dfe53fbe3..c46393209cb4f80704bbc9268fad4371347d5b30 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.cpp @@ -29,6 +29,13 @@ @@ -20979,14 +20403,14 @@ index 87121e8b57e5ad7ef74857685f0db65e164a5bf8..580dca6ca0709a2d620d3999beb69856 -#if !PLATFORM(COCOA) && !PLATFORM(GTK) +#if !PLATFORM(COCOA) && !PLATFORM(GTK) && !PLATFORM(WPE) && !PLATFORM(WIN) - void WebDragClient::startDrag(DragItem, DataTransfer&, LocalFrame&) + void WebDragClient::startDrag(DragItem, DataTransfer&, Frame&) { } diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp -index 38d6259743caae4f32be376a8f54194d80571885..8a221e35850842113070ebf8da570ba6cdcdea1b 100644 +index 11640a4a126ac8f2b04f427687f1d3a4ec521bfc..e03eac20cabd7f0eb2c2e841b40844de24d8c2e1 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp +++ b/Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp -@@ -1548,14 +1548,6 @@ void WebLocalFrameLoaderClient::transitionToCommittedForNewPage() +@@ -1533,14 +1533,6 @@ void WebLocalFrameLoaderClient::transitionToCommittedForNewPage() if (webPage->scrollPinningBehavior() != ScrollPinningBehavior::DoNotPin) view->setScrollPinningBehavior(webPage->scrollPinningBehavior()); @@ -21002,10 +20426,10 @@ index 38d6259743caae4f32be376a8f54194d80571885..8a221e35850842113070ebf8da570ba6 void WebLocalFrameLoaderClient::didRestoreFromBackForwardCache() diff --git a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm -index d54cfeeab7d873196f6ee7cebe42dce8d349d565..523c5496a669dcd3a3a5c4d6041ab30f5eda2fd2 100644 +index de80b6dd7b7b441d4f74f9f0504a76fec54a04be..26917ef68184952cb18186979ff9e5d41d3c390f 100644 --- a/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm +++ b/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm -@@ -133,7 +133,8 @@ static WebCore::CachedImage* cachedImage(Element& element) +@@ -129,7 +129,8 @@ static WebCore::CachedImage* cachedImage(Element& element) void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Element& element, const URL& url, const String& label, LocalFrame*) { @@ -21017,10 +20441,10 @@ index d54cfeeab7d873196f6ee7cebe42dce8d349d565..523c5496a669dcd3a3a5c4d6041ab30f diff --git a/Source/WebKit/WebProcess/WebCoreSupport/win/WebDragClientWin.cpp b/Source/WebKit/WebProcess/WebCoreSupport/win/WebDragClientWin.cpp new file mode 100644 -index 0000000000000000000000000000000000000000..ba14bf43794ef03a4b090135631a8f7f880a2f02 +index 0000000000000000000000000000000000000000..af697fb9921aefa18da1d1148c5e93c3970960db --- /dev/null +++ b/Source/WebKit/WebProcess/WebCoreSupport/win/WebDragClientWin.cpp -@@ -0,0 +1,59 @@ +@@ -0,0 +1,58 @@ +/* + * Copyright (C) 2011 Igalia S.L. + * @@ -21060,7 +20484,6 @@ index 0000000000000000000000000000000000000000..ba14bf43794ef03a4b090135631a8f7f +#include +#include +#include -+#include + +//#include + @@ -21071,7 +20494,7 @@ index 0000000000000000000000000000000000000000..ba14bf43794ef03a4b090135631a8f7f +{ +} + -+void WebDragClient::startDrag(DragItem, DataTransfer& dataTransfer, LocalFrame& frame) ++void WebDragClient::startDrag(DragItem, DataTransfer& dataTransfer, Frame& frame) +{ + m_page->willStartDrag(); + m_page->send(Messages::WebPageProxy::StartDrag(dataTransfer.pasteboard().createDragDataMap())); @@ -21082,7 +20505,7 @@ index 0000000000000000000000000000000000000000..ba14bf43794ef03a4b090135631a8f7f +#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..ddc4b5e736252135a63d5787065c20fa35a764a6 +index 0000000000000000000000000000000000000000..af21b0d1dd4e9b1f74387a8f8a928244ae47bae6 --- /dev/null +++ b/Source/WebKit/WebProcess/WebCoreSupport/wpe/WebDragClientWPE.cpp @@ -0,0 +1,58 @@ @@ -21118,11 +20541,11 @@ index 0000000000000000000000000000000000000000..ddc4b5e736252135a63d5787065c20fa + +#include "ArgumentCodersWPE.h" +#include "ShareableBitmap.h" ++#include "ShareableBitmapHandle.h" +#include "WebPage.h" +#include "WebPageProxyMessages.h" +#include +#include -+#include +#include +#include + @@ -21133,11 +20556,11 @@ index 0000000000000000000000000000000000000000..ddc4b5e736252135a63d5787065c20fa +{ +} + -+void WebDragClient::startDrag(DragItem, DataTransfer& dataTransfer, LocalFrame&) ++void WebDragClient::startDrag(DragItem, DataTransfer& dataTransfer, Frame&) +{ + m_page->willStartDrag(); + -+ ShareableBitmapHandle handle; ++ std::optional handle; + m_page->send(Messages::WebPageProxy::StartDrag(dataTransfer.pasteboard().selectionData(), dataTransfer.sourceOperationMask(), WTFMove(handle), dataTransfer.dragLocation())); +} + @@ -21145,10 +20568,10 @@ index 0000000000000000000000000000000000000000..ddc4b5e736252135a63d5787065c20fa + +#endif // ENABLE(DRAG_SUPPORT) diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp -index 703e35bdff1dd1ac1c603fb17ba161b23f258225..eb04eff245fbfab332b6b720feb7e04e43ec53e2 100644 +index 488473aad91d0f79265bcb56e3ce9b411d079122..58802769990c6d0a134e831e5454281de46f9c1a 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp -@@ -39,6 +39,7 @@ +@@ -40,6 +40,7 @@ #include "WebPreferencesKeys.h" #include "WebProcess.h" #include @@ -21156,7 +20579,7 @@ index 703e35bdff1dd1ac1c603fb17ba161b23f258225..eb04eff245fbfab332b6b720feb7e04e #include #include #include -@@ -114,6 +115,16 @@ void DrawingAreaCoordinatedGraphics::scroll(const IntRect& scrollRect, const Int +@@ -105,6 +106,16 @@ void DrawingAreaCoordinatedGraphics::scroll(const IntRect& scrollRect, const Int ASSERT(m_scrollRect.isEmpty()); ASSERT(m_scrollOffset.isEmpty()); ASSERT(m_dirtyRegion.isEmpty()); @@ -21173,7 +20596,7 @@ index 703e35bdff1dd1ac1c603fb17ba161b23f258225..eb04eff245fbfab332b6b720feb7e04e m_layerTreeHost->scrollNonCompositedContents(scrollRect); return; } -@@ -241,6 +252,7 @@ void DrawingAreaCoordinatedGraphics::updatePreferences(const WebPreferencesStore +@@ -218,6 +229,7 @@ void DrawingAreaCoordinatedGraphics::updatePreferences(const WebPreferencesStore settings.setAcceleratedCompositingEnabled(false); } #endif @@ -21181,7 +20604,7 @@ index 703e35bdff1dd1ac1c603fb17ba161b23f258225..eb04eff245fbfab332b6b720feb7e04e settings.setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey())); // Fixed position elements need to be composited and create stacking contexts // in order to be scrolled by the ScrollingCoordinator. -@@ -618,6 +630,11 @@ void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLay +@@ -573,6 +585,11 @@ void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLay m_scrollOffset = IntSize(); m_displayTimer.stop(); m_isWaitingForDidUpdate = false; @@ -21193,7 +20616,7 @@ index 703e35bdff1dd1ac1c603fb17ba161b23f258225..eb04eff245fbfab332b6b720feb7e04e } void DrawingAreaCoordinatedGraphics::sendEnterAcceleratedCompositingModeIfNeeded() -@@ -677,6 +694,11 @@ void DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode() +@@ -630,6 +647,11 @@ void DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode() // UI process, we still need to let it know about the new contents, so send an Update message. send(Messages::DrawingAreaProxy::Update(0, WTFMove(updateInfo))); } @@ -21206,10 +20629,10 @@ index 703e35bdff1dd1ac1c603fb17ba161b23f258225..eb04eff245fbfab332b6b720feb7e04e void DrawingAreaCoordinatedGraphics::scheduleDisplay() diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp -index 063deca3282a25c46dda53769673aeab501390e1..e6c462d6b21340bd7992e168e09f5fdbcea34c88 100644 +index 0bd870f9c0f2ff5cbb638701dab0dca3595bbc4a..fd09e59c2a94324a2ebb4266196e910d53b54686 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp -@@ -187,8 +187,16 @@ void LayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer) +@@ -198,8 +198,16 @@ void LayerTreeHost::setViewOverlayRootLayer(GraphicsLayer* viewOverlayRootLayer) void LayerTreeHost::scrollNonCompositedContents(const IntRect& rect) { auto* frameView = m_webPage.localMainFrameView(); @@ -21225,8 +20648,8 @@ index 063deca3282a25c46dda53769673aeab501390e1..e6c462d6b21340bd7992e168e09f5fdb +// Playwright end m_viewportController.didScroll(rect.location()); - if (m_isDiscardable) -@@ -325,6 +333,10 @@ void LayerTreeHost::didChangeViewport() + didChangeViewport(); +@@ -324,6 +332,10 @@ void LayerTreeHost::didChangeViewport() if (!view->useFixedLayout()) view->notifyScrollPositionChanged(m_lastScrollPosition); @@ -21238,10 +20661,10 @@ index 063deca3282a25c46dda53769673aeab501390e1..e6c462d6b21340bd7992e168e09f5fdb if (m_lastPageScaleFactor != pageScale) { diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h -index 6749e66ac5f8cc7968595365beff19cfdee7861f..7a222444342eb1255bd2744d6647993ad3345e5c 100644 +index d8f40210a6e2dfbaeec672e0871a6cb5aaab24af..9053ecf0d9736c02581c14a5af140f39d01b191e 100644 --- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h +++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h -@@ -103,6 +103,13 @@ public: +@@ -112,6 +112,13 @@ public: void adjustTransientZoom(double, WebCore::FloatPoint); void commitTransientZoom(double, WebCore::FloatPoint); #endif @@ -21282,12 +20705,12 @@ index 30c1f55828df6bf4e48543cc3347dde1ee41e10f..e71997ca8292530c5c01ce141443ad42 { if (m_hasRemovedMessageReceiver) diff --git a/Source/WebKit/WebProcess/WebPage/DrawingArea.h b/Source/WebKit/WebProcess/WebPage/DrawingArea.h -index 0a7b4194c982a5ce21c1f3e7da2a6c174bbf2954..6c8dc22966ed0d457622698f1c2f4079f183025f 100644 +index 6ba3b77dc8eaa403ab2ca1a4f25f85eed228af5f..190d9c223c1a99aaa7f5de43b094087875f3fe4e 100644 --- a/Source/WebKit/WebProcess/WebPage/DrawingArea.h +++ b/Source/WebKit/WebProcess/WebPage/DrawingArea.h -@@ -169,6 +169,9 @@ public: - virtual void didChangeViewportAttributes(WebCore::ViewportAttributes&&) = 0; +@@ -163,6 +163,9 @@ public: virtual void deviceOrPageScaleFactorChanged() = 0; + virtual bool enterAcceleratedCompositingModeIfNeeded() = 0; #endif +#if PLATFORM(WIN) + void didChangeAcceleratedCompositingMode(bool enabled); @@ -21296,10 +20719,10 @@ index 0a7b4194c982a5ce21c1f3e7da2a6c174bbf2954..6c8dc22966ed0d457622698f1c2f4079 virtual void adoptLayersFromDrawingArea(DrawingArea&) { } virtual void adoptDisplayRefreshMonitorsFromDrawingArea(DrawingArea&) { } diff --git a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp -index a920f9ced33557bc3aac077f7c81574f77ced97b..0badffab778609cf5636594caeac4c03e3a446d1 100644 +index 35586a9dfccfe82ec7e6d38c4aa2c624b6d05597..58912fc3e33887e5ccfe8ac05c706f473c709566 100644 --- a/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp -@@ -41,6 +41,7 @@ +@@ -43,6 +43,7 @@ #include #include #include @@ -21307,7 +20730,7 @@ index a920f9ced33557bc3aac077f7c81574f77ced97b..0badffab778609cf5636594caeac4c03 #include #include #include -@@ -349,4 +350,10 @@ void WebCookieJar::removeChangeListener(const String& host, const WebCore::Cooki +@@ -351,4 +352,10 @@ void WebCookieJar::removeChangeListener(const String& host, const WebCore::Cooki } #endif @@ -21332,11 +20755,11 @@ index 2aebbbd13594712f8cb3cd1de16da6818bbf4706..125d77abfafe41c2a49568f02a7cde6e WebCookieJar(); diff --git a/Source/WebKit/WebProcess/WebPage/WebDocumentLoader.cpp b/Source/WebKit/WebProcess/WebPage/WebDocumentLoader.cpp -index 7fbf65c821f3c4fddea9ca7dc88f5968fdd7a744..ebd73ea59effe391210552c3d5e0e769043e9dc0 100644 +index 3d55eaca35e4e6642d0ee65ab2cbfec2f45e68f4..606cb422287fe2a1975be381424a5de6a3e5d352 100644 --- a/Source/WebKit/WebProcess/WebPage/WebDocumentLoader.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebDocumentLoader.cpp -@@ -46,6 +46,14 @@ void WebDocumentLoader::detachFromFrame() - DocumentLoader::detachFromFrame(); +@@ -46,6 +46,14 @@ void WebDocumentLoader::detachFromFrame(LoadWillContinueInAnotherProcess loadWil + DocumentLoader::detachFromFrame(loadWillContinueInAnotherProcess); } +void WebDocumentLoader::replacedByFragmentNavigation(LocalFrame& frame) @@ -21344,14 +20767,14 @@ index 7fbf65c821f3c4fddea9ca7dc88f5968fdd7a744..ebd73ea59effe391210552c3d5e0e769 + ASSERT(!this->frame()); + // Notify WebPageProxy that the navigation has been converted into same page navigation. + if (m_navigationID) -+ WebFrame::fromCoreFrame(frame)->documentLoaderDetached(m_navigationID); ++ WebFrame::fromCoreFrame(frame)->documentLoaderDetached(m_navigationID, false); +} + void WebDocumentLoader::setNavigationID(uint64_t navigationID) { ASSERT(navigationID); diff --git a/Source/WebKit/WebProcess/WebPage/WebDocumentLoader.h b/Source/WebKit/WebProcess/WebPage/WebDocumentLoader.h -index 04efd703491f1c32009c066a84647d7dda3d79ce..473fa1b3a7b7ccf375bfe26f528417d4e5b8ef6d 100644 +index 22a2194e393c7bfcc6a6635b6fdb7e95994db3e9..a060b7aff37549c79c63cde23fa66938988e1dd0 100644 --- a/Source/WebKit/WebProcess/WebPage/WebDocumentLoader.h +++ b/Source/WebKit/WebProcess/WebPage/WebDocumentLoader.h @@ -27,6 +27,7 @@ @@ -21368,16 +20791,16 @@ index 04efd703491f1c32009c066a84647d7dda3d79ce..473fa1b3a7b7ccf375bfe26f528417d4 + uint64_t loaderIDForInspector() override { return navigationID(); } + - void detachFromFrame() override; + void detachFromFrame(WebCore::LoadWillContinueInAnotherProcess) override; + void replacedByFragmentNavigation(WebCore::LocalFrame&) override; uint64_t m_navigationID { 0 }; }; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a101d65ebc9 100644 +index 5dc0f3459c55b5ac6d13ae939dd7221b4649da65..c4387bf9fe6e0f1959e5757f39bc92c20dffef20 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp -@@ -1039,6 +1039,9 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) +@@ -1041,6 +1041,9 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) #endif #endif // HAVE(SANDBOX_STATE_FLAGS) @@ -21387,7 +20810,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 updateThrottleState(); #if ENABLE(ACCESSIBILITY_ANIMATION_CONTROL) updateImageAnimationEnabled(); -@@ -1884,6 +1887,22 @@ void WebPage::transitionFrameToLocal(LocalFrameCreationParameters&& creationPara +@@ -1915,6 +1918,22 @@ void WebPage::transitionFrameToLocal(LocalFrameCreationParameters&& creationPara frame->transitionToLocal(creationParameters.layerHostingContextIdentifier); } @@ -21410,7 +20833,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 void WebPage::loadRequest(LoadParameters&& loadParameters) { WEBPAGE_RELEASE_LOG(Loading, "loadRequest: navigationID=%" PRIu64 ", shouldTreatAsContinuingLoad=%u, lastNavigationWasAppInitiated=%d, existingNetworkResourceLoadIdentifierToResume=%" PRIu64, loadParameters.navigationID, static_cast(loadParameters.shouldTreatAsContinuingLoad), loadParameters.request.isAppInitiated(), valueOrDefault(loadParameters.existingNetworkResourceLoadIdentifierToResume).toUInt64()); -@@ -2168,17 +2187,14 @@ void WebPage::setSize(const WebCore::IntSize& viewSize) +@@ -2200,17 +2219,14 @@ void WebPage::setSize(const WebCore::IntSize& viewSize) view->resize(viewSize); m_drawingArea->setNeedsDisplay(); @@ -21428,7 +20851,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArguments) { RefPtr localMainFrame = dynamicDowncast(m_page->mainFrame()); -@@ -2203,20 +2219,18 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg +@@ -2235,20 +2251,18 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg ViewportAttributes attr = computeViewportAttributes(viewportArguments, minimumLayoutFallbackWidth, deviceWidth, deviceHeight, 1, m_viewSize); @@ -21456,7 +20879,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 #if USE(COORDINATED_GRAPHICS) m_drawingArea->didChangeViewportAttributes(WTFMove(attr)); -@@ -2224,7 +2238,6 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg +@@ -2256,7 +2270,6 @@ void WebPage::sendViewportAttributesChanged(const ViewportArguments& viewportArg send(Messages::WebPageProxy::DidChangeViewportProperties(attr)); #endif } @@ -21464,7 +20887,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 void WebPage::scrollMainFrameIfNotAtMaxScrollPosition(const IntSize& scrollOffset) { -@@ -2520,6 +2533,7 @@ void WebPage::scaleView(double scale) +@@ -2552,6 +2565,7 @@ void WebPage::scaleView(double scale) } m_page->setViewScaleFactor(scale); @@ -21472,7 +20895,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 scalePage(pageScale, scrollPositionAtNewScale); } -@@ -2699,18 +2713,14 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum +@@ -2731,18 +2745,14 @@ void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArgum viewportConfigurationChanged(); #endif @@ -21492,9 +20915,9 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 } #if !PLATFORM(IOS_FAMILY) -@@ -3671,6 +3681,97 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent) +@@ -3714,6 +3724,97 @@ void WebPage::touchEvent(const WebTouchEvent& touchEvent, CompletionHandler&& completionHandler) @@ -21521,7 +20944,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 + WebTouchEvent touchEvent({WebEventType::TouchStart, eventModifiers, WallTime::now()}, WTFMove(touchPoints)); + + CurrentEvent currentEvent(touchEvent); -+ handled = handleTouchEvent(touchEvent, m_page.get()); ++ handled = handleTouchEvent(m_page->mainFrame().frameID(), touchEvent, m_page.get()).wasHandled(); + } + { + Vector touchPoints; @@ -21531,7 +20954,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 + WebTouchEvent touchEvent({WebEventType::TouchEnd, eventModifiers, WallTime::now()}, WTFMove(touchPoints)); + + CurrentEvent currentEvent(touchEvent); -+ handled = handleTouchEvent(touchEvent, m_page.get()) || handled; ++ handled = handleTouchEvent(m_page->mainFrame().frameID(), touchEvent, m_page.get()).wasHandled() || handled; + } + if (!handled) { + FloatPoint adjustedPoint; @@ -21554,7 +20977,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 + localMainFrame->eventHandler().mouseMoved(PlatformMouseEvent( + adjustedIntPoint, + adjustedIntPoint, -+ MouseButton::NoButton, ++ MouseButton::None, + PlatformEvent::Type::MouseMoved, + 0, + modifiers, @@ -21565,7 +20988,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 + localMainFrame->eventHandler().handleMousePressEvent(PlatformMouseEvent( + adjustedIntPoint, + adjustedIntPoint, -+ MouseButton::LeftButton, ++ MouseButton::Left, + PlatformEvent::Type::MousePressed, + 1, + modifiers, @@ -21576,7 +20999,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 + localMainFrame->eventHandler().handleMouseReleaseEvent(PlatformMouseEvent( + adjustedIntPoint, + adjustedIntPoint, -+ MouseButton::LeftButton, ++ MouseButton::Left, + PlatformEvent::Type::MouseReleased, + 1, + modifiers, @@ -21590,7 +21013,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 #endif void WebPage::cancelPointer(WebCore::PointerID pointerId, const WebCore::IntPoint& documentPoint) -@@ -3748,6 +3849,11 @@ void WebPage::sendMessageToTargetBackend(const String& targetId, const String& m +@@ -3791,6 +3892,11 @@ void WebPage::sendMessageToTargetBackend(const String& targetId, const String& m m_inspectorTargetController->sendMessageToTargetBackend(targetId, message); } @@ -21602,7 +21025,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 void WebPage::insertNewlineInQuotedContent() { Ref frame = CheckedRef(m_page->focusController())->focusedOrMainFrame(); -@@ -3959,6 +4065,7 @@ void WebPage::didCompletePageTransition() +@@ -4002,6 +4108,7 @@ void WebPage::didCompletePageTransition() void WebPage::show() { send(Messages::WebPageProxy::ShowPage()); @@ -21610,16 +21033,27 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 } void WebPage::setIsTakingSnapshotsForApplicationSuspension(bool isTakingSnapshotsForApplicationSuspension) -@@ -4964,7 +5071,7 @@ NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana +@@ -5031,7 +5138,7 @@ NotificationPermissionRequestManager* WebPage::notificationPermissionRequestMana #if ENABLE(DRAG_SUPPORT) -#if PLATFORM(GTK) +#if PLATFORM(GTK) || PLATFORM(WPE) - void WebPage::performDragControllerAction(DragControllerAction action, const IntPoint& clientPosition, const IntPoint& globalPosition, OptionSet draggingSourceOperationMask, SelectionData&& selectionData, OptionSet flags) + 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) { -@@ -7449,6 +7556,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, const Resou + if (!m_page) +@@ -7297,6 +7404,10 @@ void WebPage::didCommitLoad(WebFrame* frame) + #endif + + flushDeferredDidReceiveMouseEvent(); ++// Playwright begin ++ if (frame->isMainFrame()) ++ send(Messages::WebPageProxy::ViewScaleFactorDidChange(viewScaleFactor())); ++// Playwright end + } + + void WebPage::didFinishDocumentLoad(WebFrame& frame) +@@ -7526,6 +7637,9 @@ Ref WebPage::createDocumentLoader(LocalFrame& frame, const Resou WebsitePoliciesData::applyToDocumentLoader(WTFMove(*m_pendingWebsitePolicies), documentLoader); m_pendingWebsitePolicies = std::nullopt; } @@ -21630,7 +21064,7 @@ index df07dd55ff15dfd26d47b6aa6bc768256cb01038..b9f174a31f93b938a34c13bb35f43a10 return documentLoader; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h -index 8953b900362dba8d3e83c8a61a87bc33d47c4c84..4df44385d11d65778da2090807153577b6e51bc2 100644 +index fa5a03b9faeced1c3f428507ee458f34fc0f5553..760d3f6cdcfc2a72eb1f25b411c359b545250dd8 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit/WebProcess/WebPage/WebPage.h @@ -69,6 +69,7 @@ @@ -21652,21 +21086,21 @@ index 8953b900362dba8d3e83c8a61a87bc33d47c4c84..4df44385d11d65778da2090807153577 #if PLATFORM(GTK) || PLATFORM(WPE) #include "InputMethodState.h" #endif -@@ -1085,11 +1090,11 @@ public: +@@ -1099,11 +1104,11 @@ public: void clearSelection(); void restoreSelectionInFocusedEditableElement(); -#if ENABLE(DRAG_SUPPORT) && PLATFORM(GTK) -+#if ENABLE(DRAG_SUPPORT) && (PLATFORM(GTK) || PLATFORM(WPE)) - void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, OptionSet draggingSourceOperationMask, WebCore::SelectionData&&, OptionSet); ++#if ENABLE(DRAG_SUPPORT) && (PLATFORM(GTK) || PLATFORM(WPE)) + void performDragControllerAction(DragControllerAction, const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, OptionSet draggingSourceOperationMask, WebCore::SelectionData&&, OptionSet, CompletionHandler, WebCore::DragHandlingMethod, bool, unsigned, WebCore::IntRect, WebCore::IntRect, std::optional)>&&); #endif -#if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK) +#if ENABLE(DRAG_SUPPORT) && !PLATFORM(GTK) && !PLATFORM(WPE) - void performDragControllerAction(DragControllerAction, WebCore::DragData&&, SandboxExtension::Handle&&, Vector&&); + void performDragControllerAction(std::optional, DragControllerAction, WebCore::DragData&&, CompletionHandler, WebCore::DragHandlingMethod, bool, unsigned, WebCore::IntRect, WebCore::IntRect, std::optional)>&&); + void performDragOperation(WebCore::DragData&&, SandboxExtension::Handle&&, Vector&&, CompletionHandler&&); #endif - -@@ -1103,6 +1108,9 @@ public: +@@ -1118,6 +1123,9 @@ public: void didStartDrag(); void dragCancelled(); OptionSet allowedDragSourceActions() const { return m_allowedDragSourceActions; } @@ -21676,7 +21110,7 @@ index 8953b900362dba8d3e83c8a61a87bc33d47c4c84..4df44385d11d65778da2090807153577 #endif void beginPrinting(WebCore::FrameIdentifier, const PrintInfo&); -@@ -1337,6 +1345,7 @@ public: +@@ -1345,6 +1353,7 @@ public: void connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType); void disconnectInspector(const String& targetId); void sendMessageToTargetBackend(const String& targetId, const String& message); @@ -21684,7 +21118,7 @@ index 8953b900362dba8d3e83c8a61a87bc33d47c4c84..4df44385d11d65778da2090807153577 void insertNewlineInQuotedContent(); -@@ -1766,6 +1775,7 @@ private: +@@ -1778,6 +1787,7 @@ private: void tryClose(CompletionHandler&&); void platformDidReceiveLoadParameters(const LoadParameters&); void transitionFrameToLocal(LocalFrameCreationParameters&&, WebCore::FrameIdentifier); @@ -21692,15 +21126,15 @@ index 8953b900362dba8d3e83c8a61a87bc33d47c4c84..4df44385d11d65778da2090807153577 void loadRequest(LoadParameters&&); [[noreturn]] void loadRequestWaitingForProcessLaunch(LoadParameters&&, URL&&, WebPageProxyIdentifier, bool); void loadData(LoadParameters&&); -@@ -1804,6 +1814,7 @@ private: +@@ -1816,6 +1826,7 @@ private: void updatePotentialTapSecurityOrigin(const WebTouchEvent&, bool wasHandled); #elif ENABLE(TOUCH_EVENTS) - void touchEvent(const WebTouchEvent&); + void touchEvent(const WebTouchEvent&, CompletionHandler, bool)>&&); + void fakeTouchTap(const WebCore::IntPoint& position, uint8_t modifiers, CompletionHandler&& completionHandler); #endif void cancelPointer(WebCore::PointerID, const WebCore::IntPoint&); -@@ -1943,9 +1954,7 @@ private: +@@ -1960,9 +1971,7 @@ private: void addLayerForFindOverlay(CompletionHandler&&); void removeLayerForFindOverlay(CompletionHandler&&); @@ -21710,7 +21144,7 @@ index 8953b900362dba8d3e83c8a61a87bc33d47c4c84..4df44385d11d65778da2090807153577 void didChangeSelectedIndexForActivePopupMenu(int32_t newIndex); void setTextForActivePopupMenu(int32_t index); -@@ -2493,6 +2502,7 @@ private: +@@ -2514,6 +2523,7 @@ private: UserActivity m_userActivity; uint64_t m_pendingNavigationID { 0 }; @@ -21719,7 +21153,7 @@ index 8953b900362dba8d3e83c8a61a87bc33d47c4c84..4df44385d11d65778da2090807153577 bool m_mainFrameProgressCompleted { false }; diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in -index a5e984aa25e5ba55138267c09d481f859ce0525f..97a548233aea66f34fcb57e4eaffde208383d7b3 100644 +index 0a070bebea8468979e5a8b9d4d57a768930aab70..1c092d5d6860ab0fb9ef37c38d4c01140e87eef6 100644 --- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in @@ -149,6 +149,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType @@ -21733,7 +21167,7 @@ index a5e984aa25e5ba55138267c09d481f859ce0525f..97a548233aea66f34fcb57e4eaffde20 @@ -159,6 +160,7 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType #endif #if !ENABLE(IOS_TOUCH_EVENTS) && ENABLE(TOUCH_EVENTS) - TouchEvent(WebKit::WebTouchEvent event) + TouchEvent(WebKit::WebTouchEvent event) -> (std::optional eventType, bool handled) + FakeTouchTap(WebCore::IntPoint position, uint8_t modifiers) -> () Async #endif @@ -21746,20 +21180,20 @@ index a5e984aa25e5ba55138267c09d481f859ce0525f..97a548233aea66f34fcb57e4eaffde20 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) -@@ -351,10 +354,10 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType +@@ -353,10 +356,10 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType AddMIMETypeWithCustomContentProvider(String mimeType) # Drag and drop. -#if PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) +#if (PLATFORM(GTK) || PLATFORM(WPE)) && ENABLE(DRAG_SUPPORT) - PerformDragControllerAction(enum:uint8_t WebKit::DragControllerAction action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet draggingSourceOperationMask, WebCore::SelectionData selection, OptionSet flags) + PerformDragControllerAction(enum:uint8_t WebKit::DragControllerAction action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet draggingSourceOperationMask, WebCore::SelectionData selection, OptionSet flags) -> (std::optional dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional remoteUserInputEventData) #endif -#if !PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) +#if !PLATFORM(GTK) && !PLATFORM(WPE) && ENABLE(DRAG_SUPPORT) - PerformDragControllerAction(enum:uint8_t WebKit::DragControllerAction action, WebCore::DragData dragData, WebKit::SandboxExtension::Handle sandboxExtensionHandle, Vector sandboxExtensionsForUpload) + PerformDragControllerAction(std::optional frameID, enum:uint8_t WebKit::DragControllerAction action, WebCore::DragData dragData) -> (std::optional dragOperation, enum:uint8_t WebCore::DragHandlingMethod dragHandlingMethod, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect, WebCore::IntRect editableElementRect, struct std::optional remoteUserInputEventData) + PerformDragOperation(WebCore::DragData dragData, WebKit::SandboxExtension::Handle sandboxExtensionHandle, Vector sandboxExtensionsForUpload) -> (bool handled) #endif - #if ENABLE(DRAG_SUPPORT) -@@ -363,6 +366,10 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType +@@ -366,6 +369,10 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType DragCancelled() #endif @@ -21771,10 +21205,10 @@ index a5e984aa25e5ba55138267c09d481f859ce0525f..97a548233aea66f34fcb57e4eaffde20 RequestDragStart(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet allowedActionsMask) RequestAdditionalItemsForDragSession(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, OptionSet allowedActionsMask) diff --git a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -index c751d39c0abb0640be6428cb7d943b9a7441d430..ad8d59e8ab375e45116620c2499064481528c234 100644 +index e2a6c27fabb4304c344f467c877aff40ee3226e3..29e7cfcc6c7e1066dbb9e35ec4477bd49aa045bb 100644 --- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm +++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm -@@ -825,21 +825,37 @@ String WebPage::platformUserAgent(const URL&) const +@@ -813,21 +813,37 @@ String WebPage::platformUserAgent(const URL&) const bool WebPage::hoverSupportedByPrimaryPointingDevice() const { @@ -21863,10 +21297,10 @@ index f17f5d719d892309ed9c7093384945866b5117b9..1dba47bbf0dbd0362548423a74b38034 } diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp -index 63302a57fe4dbf666bbf79333df6f3a046ea2005..acdf07c37d6fd1d9641c6f9ee59ceb5ef646d8be 100644 +index e4d40bb685e7784d7952002227cc61b0151b0dfd..ddfb3c382d38a2a58e042d5be233d63dfcf8108f 100644 --- a/Source/WebKit/WebProcess/WebProcess.cpp +++ b/Source/WebKit/WebProcess/WebProcess.cpp -@@ -94,6 +94,7 @@ +@@ -87,6 +87,7 @@ #include "WebsiteData.h" #include "WebsiteDataStoreParameters.h" #include "WebsiteDataType.h" @@ -21874,7 +21308,7 @@ index 63302a57fe4dbf666bbf79333df6f3a046ea2005..acdf07c37d6fd1d9641c6f9ee59ceb5e #include #include #include -@@ -374,6 +375,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter +@@ -360,6 +361,8 @@ void WebProcess::initializeProcess(const AuxiliaryProcessInitializationParameter platformInitializeProcess(parameters); updateCPULimit(); @@ -21884,10 +21318,10 @@ index 63302a57fe4dbf666bbf79333df6f3a046ea2005..acdf07c37d6fd1d9641c6f9ee59ceb5e void WebProcess::initializeConnection(IPC::Connection* connection) diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h -index 4d1c197aaa4d77e763674d6b02f5e35f5613dc1e..54d8ed73743dfd46aff1efaf35302d4202c54f94 100644 +index 6c0e1aa6282c404614ef7a76ec8df7556f146906..5e54a06e574845cf2bd5acd3ca8adc8bd94403a8 100644 --- a/Source/WebKit/WebProcess/WebProcess.h +++ b/Source/WebKit/WebProcess/WebProcess.h -@@ -745,7 +745,7 @@ private: +@@ -775,7 +775,7 @@ private: WeakHashMap m_userGestureTokens; @@ -21912,7 +21346,7 @@ index 8987c3964a9308f2454759de7f8972215a3ae416..bcac0afeb94ed8123d1f9fb0b932c849 SetProcessDPIAware(); return true; diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm -index 22c698f09790446fb2c80400b55ba6b4ead49658..885104f89f84c7d82490c7c1ca646e74d55b4ee3 100644 +index 08ab3227d2bb9ec7375cce834522ecfa59df226b..0dc27f05f5bf07169ca80706dc2b755e6200a610 100644 --- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm @@ -4210,7 +4210,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END @@ -21925,10 +21359,10 @@ index 22c698f09790446fb2c80400b55ba6b4ead49658..885104f89f84c7d82490c7c1ca646e74 - (void)touch:(WebEvent *)event { diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm -index b2da18013c630a85d5739361c7e2a946bd50d36c..65884693855ccb25e4e0ca191e3b43055202931a 100644 +index 76c630c56615e95bee5767099ad3af417e56c9d3..10769addcd4eeef5dc497daacbbb0bfad122d0ba 100644 --- a/Source/WebKitLegacy/mac/WebView/WebView.mm +++ b/Source/WebKitLegacy/mac/WebView/WebView.mm -@@ -3962,7 +3962,7 @@ + (void)_doNotStartObservingNetworkReachability +@@ -3976,7 +3976,7 @@ + (void)_doNotStartObservingNetworkReachability } #endif // PLATFORM(IOS_FAMILY) @@ -21937,7 +21371,7 @@ index b2da18013c630a85d5739361c7e2a946bd50d36c..65884693855ccb25e4e0ca191e3b4305 - (NSArray *)_touchEventRegions { -@@ -4004,7 +4004,7 @@ - (NSArray *)_touchEventRegions +@@ -4018,7 +4018,7 @@ - (NSArray *)_touchEventRegions }).autorelease(); } @@ -21978,7 +21412,7 @@ index 0000000000000000000000000000000000000000..dd6a53e2d57318489b7e49dd7373706d + LIBVPX_LIBRARIES +) diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake -index ffd106fe4ad44ef1610c5341e7d16c18bdbd102e..73732f416b5f25a2c79816fb33e5526d9d6be976 100644 +index 26e4e4d9a16897e3685fd9cf5aacb7fce24390b6..ae01866884bc6cbde28425f66847521a14c4f3ae 100644 --- a/Source/cmake/OptionsGTK.cmake +++ b/Source/cmake/OptionsGTK.cmake @@ -11,8 +11,13 @@ if (${CMAKE_VERSION} VERSION_LESS "3.20" AND NOT ${CMAKE_GENERATOR} STREQUAL "Ni @@ -22006,16 +21440,7 @@ index ffd106fe4ad44ef1610c5341e7d16c18bdbd102e..73732f416b5f25a2c79816fb33e5526d include(GStreamerDefinitions) SET_AND_EXPOSE_TO_BUILD(USE_CAIRO TRUE) -@@ -59,7 +68,7 @@ WEBKIT_OPTION_DEFINE(USE_LIBHYPHEN "Whether to enable the default automatic hyph - WEBKIT_OPTION_DEFINE(USE_LIBSECRET "Whether to enable the persistent credential storage using libsecret." PUBLIC ON) - WEBKIT_OPTION_DEFINE(USE_OPENGL_OR_ES "Whether to use OpenGL or ES." PUBLIC ON) - WEBKIT_OPTION_DEFINE(USE_OPENJPEG "Whether to enable support for JPEG2000 images." PUBLIC ON) --WEBKIT_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC OFF) -+WEBKIT_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC ON) - WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON) - - WEBKIT_OPTION_DEPEND(ENABLE_DOCUMENTATION ENABLE_INTROSPECTION) -@@ -97,15 +106,15 @@ endif () +@@ -98,15 +107,15 @@ endif () # without approval from a GTK reviewer. There must be strong reason to support # changing the value of the option. WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT PUBLIC ON) @@ -22034,9 +21459,9 @@ index ffd106fe4ad44ef1610c5341e7d16c18bdbd102e..73732f416b5f25a2c79816fb33e5526d WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_JPEGXL PUBLIC ON) # Private options shared with other WebKit ports. Add options here when -@@ -132,7 +141,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_TIME PRIVATE ON) +@@ -132,7 +141,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_MONTH PRIVATE ON) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_TIME PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INPUT_TYPE_WEEK PRIVATE ON) - WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TRACKING_PREVENTION PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LAYER_BASED_SVG_ENGINE PRIVATE ON) -WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_RECORDER PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_RECORDER PRIVATE OFF) @@ -22077,7 +21502,7 @@ index ffd106fe4ad44ef1610c5341e7d16c18bdbd102e..73732f416b5f25a2c79816fb33e5526d SET_AND_EXPOSE_TO_BUILD(HAVE_OS_DARK_MODE_SUPPORT 1) diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake -index 003934385b37e49bb34f5767f6cfd11d5a0abafb..e97930ad9eab516cb7ee06e51cff16969c72cb25 100644 +index cf6f8972fa4e26cb4a31331da27ac22c77804cbe..55b822bfb9167d81fe855cd2cc3e9951a2fe98f9 100644 --- a/Source/cmake/OptionsWPE.cmake +++ b/Source/cmake/OptionsWPE.cmake @@ -9,8 +9,13 @@ if (${CMAKE_VERSION} VERSION_LESS "3.20" AND NOT ${CMAKE_GENERATOR} STREQUAL "Ni @@ -22109,8 +21534,8 @@ index 003934385b37e49bb34f5767f6cfd11d5a0abafb..e97930ad9eab516cb7ee06e51cff1696 WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_JPEGXL PUBLIC ON) # Private options shared with other WebKit ports. Add options here only if -@@ -62,7 +67,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GPU_PROCESS PRIVATE OFF) - WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TRACKING_PREVENTION PRIVATE ON) +@@ -61,7 +66,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) + WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GPU_PROCESS PRIVATE OFF) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LAYER_BASED_SVG_ENGINE PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CONTROLS_CONTEXT_MENUS PRIVATE ON) -WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_RECORDER PRIVATE ON) @@ -22118,7 +21543,7 @@ index 003934385b37e49bb34f5767f6cfd11d5a0abafb..e97930ad9eab516cb7ee06e51cff1696 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_SESSION PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_SESSION_PLAYLIST PRIVATE OFF) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_STREAM PRIVATE ON) -@@ -77,7 +82,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PERIODIC_MEMORY_MONITOR PRIVATE ON) +@@ -76,7 +81,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PERIODIC_MEMORY_MONITOR PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SERVICE_WORKER PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHAREABLE_RESOURCE PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPEECH_SYNTHESIS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) @@ -22127,7 +21552,7 @@ index 003934385b37e49bb34f5767f6cfd11d5a0abafb..e97930ad9eab516cb7ee06e51cff1696 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CODECS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) -@@ -88,19 +93,36 @@ if (WPE_VERSION VERSION_GREATER_EQUAL 1.13.90) +@@ -87,13 +92,30 @@ if (WPE_VERSION VERSION_GREATER_EQUAL 1.13.90) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GAMEPAD PUBLIC ON) endif () @@ -22159,15 +21584,8 @@ index 003934385b37e49bb34f5767f6cfd11d5a0abafb..e97930ad9eab516cb7ee06e51cff1696 WEBKIT_OPTION_DEFINE(ENABLE_WPE_1_1_API "Whether to build WPE 1.1 instead of WPE 2.0" PUBLIC OFF) WEBKIT_OPTION_DEFINE(USE_GBM "Whether to enable usage of GBM." PUBLIC ON) WEBKIT_OPTION_DEFINE(USE_LCMS "Whether to enable support for image color management using libcms2." PUBLIC ON) - WEBKIT_OPTION_DEFINE(USE_LIBDRM "Whether to enable usage of libdrm." PUBLIC ON) - WEBKIT_OPTION_DEFINE(USE_OPENJPEG "Whether to enable support for JPEG2000 images." PUBLIC ON) --WEBKIT_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC OFF) -+WEBKIT_OPTION_DEFINE(USE_SOUP2 "Whether to enable usage of Soup 2 instead of Soup 3." PUBLIC ON) - WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." PUBLIC ON) - - # Private options specific to the WPE port. diff --git a/Source/cmake/OptionsWin.cmake b/Source/cmake/OptionsWin.cmake -index 1d358332016df580af0c125bdc6c909967acb11d..649afb06efc04b17c9333ced2308820b1f1ae2e7 100644 +index afe74b5ddfbae35ccb449cd83e25d55f1c1ed568..3df741316d7603d52c20aa36bc887937820d7016 100644 --- a/Source/cmake/OptionsWin.cmake +++ b/Source/cmake/OptionsWin.cmake @@ -97,16 +97,37 @@ if (OpenJPEG_FOUND) @@ -22212,7 +21630,7 @@ index 1d358332016df580af0c125bdc6c909967acb11d..649afb06efc04b17c9333ced2308820b WEBKIT_OPTION_BEGIN() # FIXME: Most of these options should not be public. -@@ -186,6 +207,17 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CRYPTO PRIVATE ${ENABLE_EXPERIMENTAL +@@ -184,6 +205,16 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CRYPTO PRIVATE ${ENABLE_EXPERIMENTAL # No support planned WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_FTPDIR PRIVATE OFF) @@ -22221,7 +21639,6 @@ index 1d358332016df580af0c125bdc6c909967acb11d..649afb06efc04b17c9333ced2308820b +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DARK_MODE_CSS PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DEVICE_ORIENTATION PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DOWNLOAD_ATTRIBUTE PRIVATE ON) -+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GAMEPAD PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_POINTER_LOCK PRIVATE ON) +WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PRIVATE ON) @@ -22231,7 +21648,7 @@ index 1d358332016df580af0c125bdc6c909967acb11d..649afb06efc04b17c9333ced2308820b WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API PRIVATE OFF) diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake -index 9b2fecf9a0d367baf910bd241eca9e010f09a0a1..eaa55cd39113ada3d4a7589dac0199797da89123 100644 +index df8464ed9d2227db3e801e01e63fafab581e625e..a2fa79209908a6d072faace91e0c5b102843aae7 100644 --- a/Source/cmake/WebKitCompilerFlags.cmake +++ b/Source/cmake/WebKitCompilerFlags.cmake @@ -87,7 +87,7 @@ macro(WEBKIT_ADD_TARGET_CXX_FLAGS _target) @@ -22243,6 +21660,20 @@ index 9b2fecf9a0d367baf910bd241eca9e010f09a0a1..eaa55cd39113ada3d4a7589dac019979 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 57aae19f1a16d08ba1579562eeff264c8768af4d..6ce36f40cc954bd02b86f84bd9a0bd2928459938 100644 +--- a/Tools/DumpRenderTree/DerivedSources.make ++++ b/Tools/DumpRenderTree/DerivedSources.make +@@ -73,8 +73,8 @@ $(IDL_FILE_NAMES_LIST) : $(UICONTEXT_INTERFACES:%=%.idl) + JS%.h JS%.cpp : %.idl $(SCRIPTS) $(IDL_ATTRIBUTES_FILE) $(IDL_FILE_NAMES_LIST) $(FEATURE_AND_PLATFORM_DEFINE_DEPENDENCIES) + @echo Generating bindings for $*... + $(PERL) -I $(WebCoreScripts) -I $(UISCRIPTCONTEXT_DIR) -I $(DumpRenderTree)/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "$(FEATURE_AND_PLATFORM_DEFINES)" --idlFileNamesList $(IDL_FILE_NAMES_LIST) --outputDir . --generator DumpRenderTree --idlAttributesFile $(IDL_ATTRIBUTES_FILE) $< +-# + ++# + + WEB_PREFERENCES_GENERATED_FILES = \ + TestOptionsGeneratedWebKitLegacyKeyMapping.cpp \ diff --git a/Tools/MiniBrowser/gtk/BrowserTab.c b/Tools/MiniBrowser/gtk/BrowserTab.c index 61616b96e2f4e21aa6d098445e0f1a933e512a9c..33732da18013679a869ff8eb2b44543413f7cf0f 100644 --- a/Tools/MiniBrowser/gtk/BrowserTab.c @@ -22299,7 +21730,7 @@ index 61616b96e2f4e21aa6d098445e0f1a933e512a9c..33732da18013679a869ff8eb2b445434 } diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.c b/Tools/MiniBrowser/gtk/BrowserWindow.c -index 626ce2207e845c40439643d2494e9497b1222810..d741e74c463a59aed2d04acad8635edcfbea664e 100644 +index 87ec298a5863a4147b8ee2a000af3f696cc5d615..fe081059e18163d4274c7b4087b3f8fec9981b77 100644 --- a/Tools/MiniBrowser/gtk/BrowserWindow.c +++ b/Tools/MiniBrowser/gtk/BrowserWindow.c @@ -73,7 +73,7 @@ struct _BrowserWindowClass { @@ -22332,7 +21763,7 @@ index 626ce2207e845c40439643d2494e9497b1222810..d741e74c463a59aed2d04acad8635edc gtk_window_set_title(GTK_WINDOW(window), privateTitle ? privateTitle : title); g_free(privateTitle); } -@@ -508,8 +502,12 @@ static gboolean webViewDecidePolicy(WebKitWebView *webView, WebKitPolicyDecision +@@ -522,8 +516,12 @@ static gboolean webViewDecidePolicy(WebKitWebView *webView, WebKitPolicyDecision return FALSE; WebKitNavigationAction *navigationAction = webkit_navigation_policy_decision_get_navigation_action(WEBKIT_NAVIGATION_POLICY_DECISION(decision)); @@ -22347,7 +21778,7 @@ index 626ce2207e845c40439643d2494e9497b1222810..d741e74c463a59aed2d04acad8635edc return FALSE; /* Multiple tabs are not allowed in editor mode. */ -@@ -1491,6 +1489,12 @@ static gboolean browserWindowDeleteEvent(GtkWidget *widget, GdkEventAny* event) +@@ -1500,6 +1498,12 @@ static gboolean browserWindowDeleteEvent(GtkWidget *widget, GdkEventAny* event) } #endif @@ -22360,7 +21791,7 @@ index 626ce2207e845c40439643d2494e9497b1222810..d741e74c463a59aed2d04acad8635edc static void browser_window_class_init(BrowserWindowClass *klass) { GObjectClass *gobjectClass = G_OBJECT_CLASS(klass); -@@ -1504,6 +1508,14 @@ static void browser_window_class_init(BrowserWindowClass *klass) +@@ -1513,6 +1517,14 @@ static void browser_window_class_init(BrowserWindowClass *klass) GtkWidgetClass *widgetClass = GTK_WIDGET_CLASS(klass); widgetClass->delete_event = browserWindowDeleteEvent; #endif @@ -22376,7 +21807,7 @@ index 626ce2207e845c40439643d2494e9497b1222810..d741e74c463a59aed2d04acad8635edc /* Public API. */ diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.h b/Tools/MiniBrowser/gtk/BrowserWindow.h -index c58ebc2beec7e722e8b65b3358b278400e9a1232..526ab90cce49d94f263ab48bbb87e99710f220c9 100644 +index 1fd07efb828b85b6d8def6c6cd92a0c11debfe1b..da9fac7975d477857ead2adb1d67108d51716d15 100644 --- a/Tools/MiniBrowser/gtk/BrowserWindow.h +++ b/Tools/MiniBrowser/gtk/BrowserWindow.h @@ -42,7 +42,7 @@ G_BEGIN_DECLS @@ -22389,7 +21820,7 @@ index c58ebc2beec7e722e8b65b3358b278400e9a1232..526ab90cce49d94f263ab48bbb87e997 typedef struct _BrowserWindow BrowserWindow; diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c -index 8be643a541511ba58255eaea7fd27dee12fbaa87..fd823c12ec853a7ae70cc343195546b47f08e0b2 100644 +index 451e0333dd4e8f5d6313fa80c5027ef2661a61ac..7398af4772ed9a479b1632e38af2d4ee6c664754 100644 --- a/Tools/MiniBrowser/gtk/main.c +++ b/Tools/MiniBrowser/gtk/main.c @@ -75,7 +75,12 @@ static char* timeZone; @@ -22545,7 +21976,7 @@ index 8be643a541511ba58255eaea7fd27dee12fbaa87..fd823c12ec853a7ae70cc343195546b4 return exitAfterLoad && webProcessCrashed ? 1 : 0; diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp -index 1d3cb1aeb14068a69cee73a60ce82cfb059322ba..fb282a323701a45ee98396b0b40e4de7de261e57 100644 +index 1d3cb1aeb14068a69cee73a60ce82cfb059322ba..62d47a408869ec476a3c46b5af9fd850860f3268 100644 --- a/Tools/MiniBrowser/wpe/main.cpp +++ b/Tools/MiniBrowser/wpe/main.cpp @@ -45,6 +45,9 @@ static gboolean headlessMode; @@ -22568,7 +21999,7 @@ index 1d3cb1aeb14068a69cee73a60ce82cfb059322ba..fb282a323701a45ee98396b0b40e4de7 { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" }, { nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr } }; -@@ -156,6 +162,11 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul +@@ -156,15 +162,38 @@ static void filterSavedCallback(WebKitUserContentFilterStore *store, GAsyncResul g_main_loop_quit(data->mainLoop); } @@ -22580,7 +22011,9 @@ index 1d3cb1aeb14068a69cee73a60ce82cfb059322ba..fb282a323701a45ee98396b0b40e4de7 static void webViewClose(WebKitWebView* webView, gpointer user_data) { // Hash table key delete func takes care of unref'ing the view -@@ -164,7 +175,25 @@ static void webViewClose(WebKitWebView* webView, gpointer user_data) + g_hash_table_remove(openViews, webView); +- if (!g_hash_table_size(openViews)) ++ if (!g_hash_table_size(openViews) && user_data) g_application_quit(G_APPLICATION(user_data)); } @@ -22844,7 +22277,7 @@ index 1067b31bc989748dfcc5502209d36d001b9b239e..7629263fb8bc93dca6dfc01c75eed8d2 + add_subdirectory(Playwright/win) +endif () diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit -index d9f1afca539b01fcd9e32e4a5182a9b8101e5a92..4c6022fcd7fde326000dade4788f869167707912 100755 +index e4cc9fe0cb259211f8fd297885b76539425f7193..8d962dc3c07494a98606aaf07eaacf199cf00fc5 100755 --- a/Tools/Scripts/build-webkit +++ b/Tools/Scripts/build-webkit @@ -272,7 +272,7 @@ if (isAppleCocoaWebKit()) { @@ -22857,7 +22290,7 @@ index d9f1afca539b01fcd9e32e4a5182a9b8101e5a92..4c6022fcd7fde326000dade4788f8691 # WebInspectorUI must come after JavaScriptCore and WebCore but before WebKit and WebKit2 my $webKitIndex = first { $projects[$_] eq "Source/WebKitLegacy" } 0..$#projects; diff --git a/Tools/WebKitTestRunner/CMakeLists.txt b/Tools/WebKitTestRunner/CMakeLists.txt -index b8056910b6cde5610c3e8e4c2992723f8cf80cd0..44367cb186bff1fb85e76cf8f0530170c68fc1ed 100644 +index 9e53f459e444b9c10fc5248f0e8059df6c1e0041..c17c875a7dd3ca05c4489578ab32378bca45a7c9 100644 --- a/Tools/WebKitTestRunner/CMakeLists.txt +++ b/Tools/WebKitTestRunner/CMakeLists.txt @@ -95,6 +95,10 @@ set(TestRunnerInjectedBundle_PRIVATE_LIBRARIES @@ -22872,10 +22305,10 @@ index b8056910b6cde5610c3e8e4c2992723f8cf80cd0..44367cb186bff1fb85e76cf8f0530170 "${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 c59538891446072875ce019bbc95079227765a30..a943e94b2e8710aa8bab87170f14a0d58fe0bfc5 100644 +index 6b905b186bba5d23a6e968404a4d26d475b087af..a712c4631bc185754862f58dd6941b338144bf01 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp -@@ -962,6 +962,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) +@@ -959,6 +959,7 @@ void TestController::createWebViewWithOptions(const TestOptions& options) 0, // requestStorageAccessConfirm shouldAllowDeviceOrientationAndMotionAccess, runWebAuthenticationPanel, @@ -22884,10 +22317,10 @@ index c59538891446072875ce019bbc95079227765a30..a943e94b2e8710aa8bab87170f14a0d5 decidePolicyForMediaKeySystemPermissionRequest, nullptr, // requestWebAuthenticationNoGesture diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm -index fd94bd470a356591a88212836717113864184127..2a04ca6026fd23222fdf00517e564576fb250f79 100644 +index 397cacf02ea61a9463050870216251f5a2ef7b06..6d1b612e25ecf4bf4a80878d265844f668aa2ca3 100644 --- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm +++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm -@@ -906,4 +906,51 @@ void EventSenderProxy::scaleGestureEnd(double scale) +@@ -907,4 +907,51 @@ void EventSenderProxy::scaleGestureEnd(double scale) #endif // ENABLE(MAC_GESTURE_EVENTS) @@ -22940,7 +22373,7 @@ index fd94bd470a356591a88212836717113864184127..2a04ca6026fd23222fdf00517e564576 + } // namespace WTR diff --git a/Tools/glib/dependencies/apt b/Tools/glib/dependencies/apt -index 77b192427f149554081d94fa074cc19ee8768cc9..159ccf2836e56b512a221e7b9825f870995627f6 100644 +index 9f05f879dbd29d93dd189ee05925d1686c6fcaa4..b4c013d0267b77b2bdbcf4d70eb6522168a2969e 100644 --- a/Tools/glib/dependencies/apt +++ b/Tools/glib/dependencies/apt @@ -1,11 +1,11 @@ @@ -22957,7 +22390,7 @@ index 77b192427f149554081d94fa074cc19ee8768cc9..159ccf2836e56b512a221e7b9825f870 echo $2 fi } -@@ -69,10 +69,12 @@ PACKAGES=( +@@ -71,10 +71,12 @@ PACKAGES=( $(aptIfExists libwpe-1.0-dev) $(aptIfExists libwpebackend-fdo-1.0-dev) libxml2-utils @@ -22971,7 +22404,7 @@ index 77b192427f149554081d94fa074cc19ee8768cc9..159ccf2836e56b512a221e7b9825f870 # These are dependencies necessary for running tests. diff --git a/Tools/gtk/dependencies/apt b/Tools/gtk/dependencies/apt -index 6af7a5608ff76205702e659d1c2393897c56eaad..401436dddf714e2616b44f61ed1b333071459a79 100644 +index 30d4fb51cbf8d2c1e18132209ffaf6256ed7019d..7df5fe173e3f2d96864245a61ec6d8748b10d976 100644 --- a/Tools/gtk/dependencies/apt +++ b/Tools/gtk/dependencies/apt @@ -37,6 +37,9 @@ PACKAGES+=( @@ -22985,10 +22418,10 @@ index 6af7a5608ff76205702e659d1c2393897c56eaad..401436dddf714e2616b44f61ed1b3330 # These are dependencies necessary for running tests. cups-daemon diff --git a/Tools/jhbuild/jhbuild-minimal.modules b/Tools/jhbuild/jhbuild-minimal.modules -index 4e3ec374e700c3459bcec321f9711ae2b61a1412..f6eff2f5b667469d4abe574355360c5f8071b96c 100644 +index 411cda9ffd07e5c58477afcdfb2637d4c9bb3392..e762744314b5982c20e9626878d728d748b3cd2d 100644 --- a/Tools/jhbuild/jhbuild-minimal.modules +++ b/Tools/jhbuild/jhbuild-minimal.modules -@@ -26,7 +26,6 @@ +@@ -24,7 +24,6 @@ @@ -22996,19 +22429,6 @@ index 4e3ec374e700c3459bcec321f9711ae2b61a1412..f6eff2f5b667469d4abe574355360c5f -@@ -247,9 +246,9 @@ - -DJPEGXL_ENABLE_SKCMS=ON"> - libjxl.pc - - - diff --git a/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp b/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp index 4b3d262528d33800ac46e4e9fc342b11f2744979..39d72bd2c04e79b94a5c7634b6abc9b227d5c148 100644 --- a/Tools/wpe/backends/fdo/HeadlessViewBackendFdo.cpp @@ -23079,7 +22499,7 @@ index a0f02e61be7e667c6ba164ca578109af36ac28d9..8f5af2e82c167ba6798fb7fde24a9f64 location = "group:Source/bmalloc/bmalloc.xcodeproj"> diff --git a/WebKit.xcworkspace/xcshareddata/xcschemes/Everything up to WebKit + Tools.xcscheme b/WebKit.xcworkspace/xcshareddata/xcschemes/Everything up to WebKit + Tools.xcscheme -index 4e712c4128ced91a4f7b93c543e4b231ec23e348..853d3d2f6b311c0fe009bf3ef5ab4d1d3c1d331e 100644 +index ded307890926eaf0ca169aaef39ea08bd982a47a..2db0c0abdda702fdff9314ba341b63c5d09289bc 100644 --- a/WebKit.xcworkspace/xcshareddata/xcschemes/Everything up to WebKit + Tools.xcscheme +++ b/WebKit.xcworkspace/xcshareddata/xcschemes/Everything up to WebKit + Tools.xcscheme @@ -188,6 +188,20 @@ diff --git a/browser_patches/webkit/pw_run.sh b/browser_patches/webkit/pw_run.sh index 1d2d6e516b..f4f0f4ce94 100755 --- a/browser_patches/webkit/pw_run.sh +++ b/browser_patches/webkit/pw_run.sh @@ -1,11 +1,14 @@ #!/usr/bin/env bash +function getWebkitCheckoutPath() { + echo ${WK_CHECKOUT_PATH:-"$HOME/webkit"} +} + function runOSX() { # if script is run as-is - if [[ -f "${SCRIPT_PATH}/EXPECTED_BUILDS" && -n "$WK_CHECKOUT_PATH" && -d "$WK_CHECKOUT_PATH/WebKitBuild/Release/Playwright.app" ]]; then + WK_CHECKOUT_PATH=$(getWebkitCheckoutPath) + if [[ -f "${SCRIPT_PATH}/EXPECTED_BUILDS" && -d "$WK_CHECKOUT_PATH/WebKitBuild/Release/Playwright.app" ]]; then DYLIB_PATH="$WK_CHECKOUT_PATH/WebKitBuild/Release" - elif [[ -f "${SCRIPT_PATH}/EXPECTED_BUILDS" && -d "$HOME/webkit/WebKitBuild/Release/Playwright.app" ]]; then - DYLIB_PATH="$HOME/webkit/WebKitBuild/Release" elif [[ -d $SCRIPT_PATH/Playwright.app ]]; then DYLIB_PATH="$SCRIPT_PATH" elif [[ -d $SCRIPT_PATH/WebKitBuild/Release/Playwright.app ]]; then @@ -23,29 +26,30 @@ function runLinux() { GIO_DIR=""; LD_PATH=""; BUNDLE_DIR=""; - DEPENDENCIES_FOLDER="DependenciesGTK"; + DEPENDENCIES_FOLDER="WebKitBuild/DependenciesGTK"; MINIBROWSER_FOLDER="minibrowser-gtk"; BUILD_FOLDER="WebKitBuild/GTK"; if [[ "$*" == *--headless* ]]; then - DEPENDENCIES_FOLDER="DependenciesWPE"; + DEPENDENCIES_FOLDER="WebKitBuild/DependenciesWPE"; MINIBROWSER_FOLDER="minibrowser-wpe"; BUILD_FOLDER="WebKitBuild/WPE"; fi # Setting extra environment variables like LD_LIBRARY_PATH or WEBKIT_INJECTED_BUNDLE_PATH # is only needed when calling MiniBrowser from the build folder. The MiniBrowser from # the zip bundle wrapper already sets itself the needed env variables. + WK_CHECKOUT_PATH=$(getWebkitCheckoutPath) if [[ -d $SCRIPT_PATH/$MINIBROWSER_FOLDER ]]; then MINIBROWSER="$SCRIPT_PATH/$MINIBROWSER_FOLDER/MiniBrowser" - elif [[ -d $HOME/webkit/$BUILD_FOLDER ]]; then - LD_PATH="$HOME/webkit/$BUILD_FOLDER/$DEPENDENCIES_FOLDER/Root/lib:$SCRIPT_PATH/checkout/$BUILD_FOLDER/Release/bin" - GIO_DIR="$HOME/webkit/$BUILD_FOLDER/$DEPENDENCIES_FOLDER/Root/lib/gio/modules" - BUNDLE_DIR="$HOME/webkit/$BUILD_FOLDER/Release/lib" - MINIBROWSER="$HOME/webkit/$BUILD_FOLDER/Release/bin/MiniBrowser" + elif [[ -d $WK_CHECKOUT_PATH/$BUILD_FOLDER ]]; then + LD_PATH="$WK_CHECKOUT_PATH/$DEPENDENCIES_FOLDER/Root/lib:$SCRIPT_PATH/checkout/$BUILD_FOLDER/Release/bin" + GIO_DIR="$WK_CHECKOUT_PATH/$DEPENDENCIES_FOLDER/Root/lib/gio/modules" + BUNDLE_DIR="$WK_CHECKOUT_PATH/$BUILD_FOLDER/Release/lib" + MINIBROWSER="$WK_CHECKOUT_PATH/$BUILD_FOLDER/Release/bin/MiniBrowser" elif [[ -f $SCRIPT_PATH/MiniBrowser ]]; then MINIBROWSER="$SCRIPT_PATH/MiniBrowser" elif [[ -d $SCRIPT_PATH/$BUILD_FOLDER ]]; then - LD_PATH="$SCRIPT_PATH/$BUILD_FOLDER/$DEPENDENCIES_FOLDER/Root/lib:$SCRIPT_PATH/$BUILD_FOLDER/Release/bin" - GIO_DIR="$SCRIPT_PATH/$BUILD_FOLDER/$DEPENDENCIES_FOLDER/Root/lib/gio/modules" + LD_PATH="$SCRIPT_PATH/$DEPENDENCIES_FOLDER/Root/lib:$SCRIPT_PATH/$BUILD_FOLDER/Release/bin" + GIO_DIR="$SCRIPT_PATH/$DEPENDENCIES_FOLDER/Root/lib/gio/modules" BUNDLE_DIR="$SCRIPT_PATH/$BUILD_FOLDER/Release/lib" MINIBROWSER="$SCRIPT_PATH/$BUILD_FOLDER/Release/bin/MiniBrowser" else diff --git a/docs/src/actionability.md b/docs/src/actionability.md index a9484ba053..337e5fd344 100644 --- a/docs/src/actionability.md +++ b/docs/src/actionability.md @@ -8,8 +8,8 @@ title: "Auto-waiting" Playwright performs a range of actionability checks on the elements before making actions to ensure these actions behave as expected. It auto-waits for all the relevant checks to pass and only then performs the requested action. If the required checks do not pass within the given `timeout`, action fails with the `TimeoutError`. -For example, for [`method: Page.click`], Playwright will ensure that: -- element is [Attached] to the DOM +For example, for [`method: Locator.click`], Playwright will ensure that: +- locator resolves to an exactly one element - element is [Visible] - element is [Stable], as in not animating or completed animation - element [Receives Events], as in not obscured by other elements @@ -17,72 +17,75 @@ For example, for [`method: Page.click`], Playwright will ensure that: Here is the complete list of actionability checks performed for each action: -| Action | [Attached] | [Visible] | [Stable] | [Receives Events] | [Enabled] | [Editable] | -| :- | :-: | :-: | :-: | :-: | :-: | :-: | -| check | Yes | Yes | Yes | Yes | Yes | - | -| click | Yes | Yes | Yes | Yes | Yes | - | -| dblclick | Yes | Yes | Yes | Yes | Yes | - | -| setChecked | Yes | Yes | Yes | Yes | Yes | - | -| tap | Yes | Yes | Yes | Yes | Yes | - | -| uncheck | Yes | Yes | Yes | Yes | Yes | - | -| hover | Yes | Yes | Yes | Yes | - | - | -| scrollIntoViewIfNeeded | Yes | - | Yes | - | - | - | -| screenshot | Yes | Yes | Yes | - | - | - | -| fill | Yes | Yes | - | - | Yes | Yes | -| selectText | Yes | Yes | - | - | - | - | -| dispatchEvent | Yes | - | - | - | - | - | -| focus | Yes | - | - | - | - | - | -| getAttribute | Yes | - | - | - | - | - | -| innerText | Yes | - | - | - | - | - | -| innerHTML | Yes | - | - | - | - | - | -| press | Yes | - | - | - | - | - | -| setInputFiles | Yes | - | - | - | - | - | -| selectOption | Yes | Yes | - | - | Yes | - | -| textContent | Yes | - | - | - | - | - | -| type | Yes | - | - | - | - | - | - -
+| Action | [Visible] | [Stable] | [Receives Events] | [Enabled] | [Editable] | +| :- | :-: | :-: | :-: | :-: | :-: | +| [`method: Locator.check`] | Yes | Yes | Yes | Yes | - | +| [`method: Locator.click`] | Yes | Yes | Yes | Yes | - | +| [`method: Locator.dblclick`] | Yes | Yes | Yes | Yes | - | +| [`method: Locator.setChecked`] | Yes | Yes | Yes | Yes | - | +| [`method: Locator.tap`] | Yes | Yes | Yes | Yes | - | +| [`method: Locator.uncheck`] | Yes | Yes | Yes | Yes | - | +| [`method: Locator.hover`] | Yes | Yes | Yes | - | - | +| [`method: Locator.dragTo`] | Yes | Yes | Yes | - | - | +| [`method: Locator.screenshot`] | Yes | Yes | - | - | - | +| [`method: Locator.fill`] | Yes | - | - | Yes | Yes | +| [`method: Locator.clear`] | Yes | - | - | Yes | Yes | +| [`method: Locator.selectOption`] | Yes | - | - | Yes | - | +| [`method: Locator.selectText`] | Yes | - | - | - | - | +| [`method: Locator.scrollIntoViewIfNeeded`] | - | Yes | - | - | - | +| [`method: Locator.blur`] | - | - | - | - | - | +| [`method: Locator.dispatchEvent`] | - | - | - | - | - | +| [`method: Locator.focus`] | - | - | - | - | - | +| [`method: Locator.press`] | - | - | - | - | - | +| [`method: Locator.pressSequentially`] | - | - | - | - | - | +| [`method: Locator.setInputFiles`] | - | - | - | - | - | ## Forcing actions -Some actions like [`method: Page.click`] support `force` option that disables non-essential actionability checks, -for example passing truthy `force` to [`method: Page.click`] method will not check that the target element actually +Some actions like [`method: Locator.click`] support `force` option that disables non-essential actionability checks, +for example passing truthy `force` to [`method: Locator.click`] method will not check that the target element actually receives click events. ## Assertions -You can check the actionability state of the element using one of the following methods as well. This is typically -not necessary, but it helps writing assertive tests that ensure that after certain actions, elements reach -actionable state: +Playwright includes auto-retrying assertions that remove flakiness by waiting until the condition is met, similarly to auto-waiting before actions. -- [`method: ElementHandle.isChecked`] -- [`method: ElementHandle.isDisabled`] -- [`method: ElementHandle.isEditable`] -- [`method: ElementHandle.isEnabled`] -- [`method: ElementHandle.isHidden`] -- [`method: ElementHandle.isVisible`] -- [`method: Page.isChecked`] -- [`method: Page.isDisabled`] -- [`method: Page.isEditable`] -- [`method: Page.isEnabled`] -- [`method: Page.isHidden`] -- [`method: Page.isVisible`] -- [`method: Locator.isChecked`] -- [`method: Locator.isDisabled`] -- [`method: Locator.isEditable`] -- [`method: Locator.isEnabled`] -- [`method: Locator.isHidden`] -- [`method: Locator.isVisible`] +| Assertion | Description | +| :- | :- | +| [`method: LocatorAssertions.toBeAttached`] | Element is attached | +| [`method: LocatorAssertions.toBeChecked`] | Checkbox is checked | +| [`method: LocatorAssertions.toBeDisabled`] | Element is disabled | +| [`method: LocatorAssertions.toBeEditable`] | Element is editable | +| [`method: LocatorAssertions.toBeEmpty`] | Container is empty | +| [`method: LocatorAssertions.toBeEnabled`] | Element is enabled | +| [`method: LocatorAssertions.toBeFocused`] | Element is focused | +| [`method: LocatorAssertions.toBeHidden`] | Element is not visible | +| [`method: LocatorAssertions.toBeInViewport`] | Element intersects viewport | +| [`method: LocatorAssertions.toBeVisible`] | Element is visible | +| [`method: LocatorAssertions.toContainText`] | Element contains text | +| [`method: LocatorAssertions.toHaveAttribute`] | Element has a DOM attribute | +| [`method: LocatorAssertions.toHaveClass`] | Element has a class property | +| [`method: LocatorAssertions.toHaveCount`] | List has exact number of children | +| [`method: LocatorAssertions.toHaveCSS`] | Element has CSS property | +| [`method: LocatorAssertions.toHaveId`] | Element has an ID | +| [`method: LocatorAssertions.toHaveJSProperty`] | Element has a JavaScript property | +| [`method: LocatorAssertions.toHaveText`] | Element matches text | +| [`method: LocatorAssertions.toHaveValue`] | Input has a value | +| [`method: LocatorAssertions.toHaveValues`] | Select has options selected | +| [`method: PageAssertions.toHaveTitle`] | Page has a title | +| [`method: PageAssertions.toHaveURL`] | Page has a URL | +| [`method: APIResponseAssertions.toBeOK`] | Response has an OK status | -
- -## Attached - -Element is considered attached when it is [connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot. +Learn more in the [assertions guide](./test-assertions.md). ## Visible -Element is considered visible when it has non-empty bounding box and does not have `visibility:hidden` computed style. Note that elements of zero size or with `display:none` are not considered visible. +Element is considered visible when it has non-empty bounding box and does not have `visibility:hidden` computed style. + +Note that according to this definition: +* Elements of zero size **are not** considered visible. +* Elements with `display:none` **are not** considered visible. +* Elements with `opacity:0` **are** considered visible. ## Stable @@ -101,7 +104,7 @@ Element is considered editable when it is [enabled] and does not have `readonly` Element is considered receiving pointer events when it is the hit target of the pointer event at the action point. For example, when clicking at the point `(10;10)`, Playwright checks whether some other element (usually an overlay) will instead capture the click at `(10;10)`. -For example, consider a scenario where Playwright will click `Sign Up` button regardless of when the [`method: Page.click`] call was made: +For example, consider a scenario where Playwright will click `Sign Up` button regardless of when the [`method: Locator.click`] call was made: - page is checking that user name is unique and `Sign Up` button is disabled; - after checking with the server, the disabled `Sign Up` button is replaced with another one that is now enabled. @@ -110,4 +113,3 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [Enabled]: #enabled "Enabled" [Editable]: #editable "Editable" [Receives Events]: #receives-events "Receives Events" -[Attached]: #attached "Attached" diff --git a/docs/src/api-testing-js.md b/docs/src/api-testing-js.md index 341a14e0e6..680b085a3c 100644 --- a/docs/src/api-testing-js.md +++ b/docs/src/api-testing-js.md @@ -48,6 +48,24 @@ export default defineConfig({ }); ``` +**Proxy configuration** + +If your tests need to run behind a proxy, you can specify this in the config and the `request` fixture +will pick it up automatically: + +```js title="playwright.config.ts" +import { defineConfig } from '@playwright/test'; +export default defineConfig({ + use: { + proxy: { + server: 'http://my-proxy:8080', + username: 'user', + password: 'secret' + }, + } +}); +``` + ### Writing tests Playwright Test comes with the built-in `request` fixture that respects configuration options like `baseURL` or `extraHTTPHeaders` we specified and is ready to send some requests. @@ -313,7 +331,7 @@ test('context request will share cookie storage with its browser context', async [name, value]) )).toEqual(responseCookies); - route.fulfill({ + await route.fulfill({ response, headers: { ...responseHeaders, foo: 'bar' }, }); @@ -357,7 +375,7 @@ test('global context request has isolated cookie storage', async ({ new Map(contextCookies2.map(({ name, value }) => [name, value])) ).toEqual(responseCookies); - route.fulfill({ + await route.fulfill({ response, headers: { ...responseHeaders, foo: 'bar' }, }); diff --git a/docs/src/api/class-android.md b/docs/src/api/class-android.md index 6f6d4c7ed1..c889ee5d0b 100644 --- a/docs/src/api/class-android.md +++ b/docs/src/api/class-android.md @@ -74,12 +74,6 @@ const { _android: android } = require('playwright'); })(); ``` -Note that since you don't need Playwright to install web browsers when testing Android, you can omit browser download via setting the following environment variable when installing Playwright: - -```bash js -PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright -``` - ## async method: Android.connect * since: v1.28 - returns: <[AndroidDevice]> diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index ffe0c54560..87f6369b5c 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -106,7 +106,7 @@ The reason to be reported to the operations interrupted by the context closure. - alias-java: consoleMessage - argument: <[ConsoleMessage]> -Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also emitted if the page throws an error or a warning. +Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. The arguments passed into `console.log` and the page are available on the [ConsoleMessage] event handler argument. @@ -1120,11 +1120,11 @@ await browser.CloseAsync(); It is possible to examine the request to decide the route action. For example, mocking all requests that contain some post data, and leaving all other requests as is: ```js -await context.route('/api/**', route => { +await context.route('/api/**', async route => { if (route.request().postData().includes('my-string')) - route.fulfill({ body: 'mocked-data' }); + await route.fulfill({ body: 'mocked-data' }); else - route.continue(); + await route.continue(); }); ``` @@ -1138,16 +1138,16 @@ context.route("/api/**", route -> { ``` ```python async -def handle_route(route): +async def handle_route(route: Route): if ("my-string" in route.request.post_data): - route.fulfill(body="mocked-data") + await route.fulfill(body="mocked-data") else: - route.continue_() + await route.continue_() await context.route("/api/**", handle_route) ``` ```python sync -def handle_route(route): +def handle_route(route: Route): if ("my-string" in route.request.post_data): route.fulfill(body="mocked-data") else: @@ -1408,6 +1408,14 @@ Returns storage state for this browser context, contains current cookies and loc * since: v1.12 - type: <[Tracing]> +## async method: BrowserContext.unrouteAll +* since: v1.41 + +Removes all routes created with [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`]. + +### option: BrowserContext.unrouteAll.behavior = %%-unroute-all-options-behavior-%% +* since: v1.41 + ## async method: BrowserContext.unroute * since: v1.8 diff --git a/docs/src/api/class-download.md b/docs/src/api/class-download.md index 8f54048c9f..3333d36996 100644 --- a/docs/src/api/class-download.md +++ b/docs/src/api/class-download.md @@ -72,7 +72,7 @@ Upon successful cancellations, `download.failure()` would resolve to `'canceled' * langs: java, js, csharp - returns: <[Readable]> -Returns readable stream for current download or `null` if download failed. +Returns a readable stream for a successful download, or throws for a failed/canceled download. ## async method: Download.delete * since: v1.8 @@ -95,8 +95,7 @@ Get the page that the download belongs to. * since: v1.8 - returns: <[path]> -Returns path to the downloaded file in case of successful download. The method will -wait for the download to finish if necessary. The method throws when connected remotely. +Returns path to the downloaded file for a successful download, or throws for a failed/canceled download. The method will wait for the download to finish if necessary. The method throws when connected remotely. Note that the download's file name is a random GUID, use [`method: Download.suggestedFilename`] to get suggested file name. diff --git a/docs/src/api/class-electron.md b/docs/src/api/class-electron.md index b21d8573b0..d9d32f2c08 100644 --- a/docs/src/api/class-electron.md +++ b/docs/src/api/class-electron.md @@ -40,12 +40,6 @@ const { _electron: electron } = require('playwright'); })(); ``` -Note that since you don't need Playwright to install web browsers when testing Electron, you can omit browser download via setting the following environment variable when installing Playwright: - -```bash js -PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright -``` - **Supported Electron versions are:** * v12.2.0+ * v13.4.0+ diff --git a/docs/src/api/class-electronapplication.md b/docs/src/api/class-electronapplication.md index 06de31dce4..87e7975b35 100644 --- a/docs/src/api/class-electronapplication.md +++ b/docs/src/api/class-electronapplication.md @@ -39,7 +39,27 @@ const { _electron: electron } = require('playwright'); ## event: ElectronApplication.close * since: v1.9 -This event is issued when the application closes. +This event is issued when the application process has been terminated. + +## event: ElectronApplication.console +* since: v1.42 +- argument: <[ConsoleMessage]> + +Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or `console.dir`. + +The arguments passed into `console.log` are available on the [ConsoleMessage] event handler argument. + +**Usage** + +```js +electronApp.on('console', async msg => { + const values = []; + for (const arg of msg.args()) + values.push(await arg.jsonValue()); + console.log(...values); +}); +await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' })); +``` ## event: ElectronApplication.window * since: v1.9 diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md index 62a61e808e..6d727f675a 100644 --- a/docs/src/api/class-elementhandle.md +++ b/docs/src/api/class-elementhandle.md @@ -156,6 +156,7 @@ await page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2); ## async method: ElementHandle.check * since: v1.8 +* discouraged: Use locator-based [`method: Locator.check`] instead. Read more about [locators](../locators.md). This method checks the element by performing the following steps: 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already @@ -191,6 +192,7 @@ When all steps combined have not finished during the specified [`option: timeout ## async method: ElementHandle.click * since: v1.8 +* discouraged: Use locator-based [`method: Locator.click`] instead. Read more about [locators](../locators.md). This method clicks the element by performing the following steps: 1. Wait for [actionability](../actionability.md) checks on the element, unless [`option: force`] option is set. @@ -241,6 +243,7 @@ Returns the content frame for element handles referencing iframe nodes, or `null ## async method: ElementHandle.dblclick * since: v1.8 +* discouraged: Use locator-based [`method: Locator.dblclick`] instead. Read more about [locators](../locators.md). * langs: - alias-csharp: DblClickAsync @@ -289,6 +292,7 @@ When all steps combined have not finished during the specified [`option: timeout ## async method: ElementHandle.dispatchEvent * since: v1.8 +* discouraged: Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md). The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click` is dispatched. This is equivalent to calling @@ -322,13 +326,16 @@ default. Since [`param: eventInit`] is event-specific, please refer to the events documentation for the lists of initial properties: +* [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent) +* [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent) * [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent) +* [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event) * [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent) * [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent) * [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent) * [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent) * [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent) -* [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event) +* [WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent) You can also specify `JSHandle` as the property value if you want live objects to be passed into the event: @@ -380,6 +387,9 @@ Optional event-specific initialization properties. ## async method: ElementHandle.evalOnSelector * since: v1.9 +* discouraged: This method does not wait for the element to pass actionability + checks and therefore can lead to the flaky tests. Use [`method: Locator.evaluate`], + other [Locator] helper methods or web-first assertions instead. * langs: - alias-python: eval_on_selector - alias-js: $eval @@ -442,6 +452,8 @@ Optional argument to pass to [`param: expression`]. ## async method: ElementHandle.evalOnSelectorAll * since: v1.9 +* discouraged: In most cases, [`method: Locator.evaluateAll`], + other [Locator] helper methods and web-first assertions do a better job. * langs: - alias-python: eval_on_selector_all - alias-js: $$eval @@ -508,6 +520,7 @@ Optional argument to pass to [`param: expression`]. ## async method: ElementHandle.fill * since: v1.8 +* discouraged: Use locator-based [`method: Locator.fill`] instead. Read more about [locators](../locators.md). This method waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field. @@ -535,11 +548,13 @@ Value to set for the ``, ` '); }); +it('should have a nice preview for non-ascii attributes/children', async ({ page, server }) => { + await page.goto(server.EMPTY_PAGE); + await page.setContent(`
${'😛'.repeat(100)}`); + const handle = await page.$('div'); + await expect.poll(() => String(handle)).toBe(`JSHandle@
😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛😛…
`); +}); + it('getAttribute should work', async ({ page, server }) => { await page.goto(`${server.PREFIX}/dom.html`); const handle = await page.$('#outer'); diff --git a/tests/page/elementhandle-scroll-into-view.spec.ts b/tests/page/elementhandle-scroll-into-view.spec.ts index 70705b05da..5fe53d0722 100644 --- a/tests/page/elementhandle-scroll-into-view.spec.ts +++ b/tests/page/elementhandle-scroll-into-view.spec.ts @@ -120,5 +120,6 @@ it('should timeout waiting for visible', async ({ page, server }) => { await page.setContent('
Hello
'); const div = await page.$('div'); const error = await div.scrollIntoViewIfNeeded({ timeout: 3000 }).catch(e => e); - expect(error.message).toContain('element is not displayed, retrying in 100ms'); + expect(error.message).toContain('element is not visible'); + expect(error.message).toContain('retrying scroll into view action'); }); diff --git a/tests/page/expect-timeout.spec.ts b/tests/page/expect-timeout.spec.ts index 1dd83daca4..16b3210caa 100644 --- a/tests/page/expect-timeout.spec.ts +++ b/tests/page/expect-timeout.spec.ts @@ -50,3 +50,8 @@ test('should not print timed out error message when page closes', async ({ page expect(stripAnsi(error.message)).toContain('expect.toHaveText with timeout 100000ms'); expect(stripAnsi(error.message)).not.toContain('Timed out'); }); + +test('should have timeout error name', async ({ page }) => { + const error = await page.waitForSelector('#not-found', { timeout: 1 }).catch(e => e); + expect(error.name).toBe('TimeoutError'); +}); diff --git a/tests/page/interception.spec.ts b/tests/page/interception.spec.ts index 140346de69..c381e9f6e3 100644 --- a/tests/page/interception.spec.ts +++ b/tests/page/interception.spec.ts @@ -172,3 +172,21 @@ it('should not break remote worker importScripts', async ({ page, server, browse await page.goto(server.PREFIX + '/worker/worker-http-import.html'); await page.waitForSelector("#status:has-text('finished')"); }); + +it('should disable memory cache when intercepting', async ({ page, server }) => { + let interceted = 0; + await page.route('**/page.html', route => { + ++interceted; + void route.fulfill({ + body: 'success' + }); + }); + await page.goto(server.PREFIX + '/page.html'); + expect(await page.locator('body').textContent()).toContain('success'); + await page.goto(server.EMPTY_PAGE); + await expect(page).toHaveURL(server.EMPTY_PAGE); + expect(interceted).toBe(1); + await page.goBack(); + await expect(page).toHaveURL(server.PREFIX + '/page.html'); + expect(interceted).toBe(2); +}); diff --git a/tests/page/locator-frame.spec.ts b/tests/page/locator-frame.spec.ts index 50151a4257..08da3dff0a 100644 --- a/tests/page/locator-frame.spec.ts +++ b/tests/page/locator-frame.spec.ts @@ -268,3 +268,33 @@ it('wait for hidden should succeed when frame is not in dom', async ({ page }) = const error = await button.waitFor({ state: 'attached', timeout: 1000 }).catch(e => e); expect(error.message).toContain('Timeout 1000ms exceeded'); }); + +it('should work with COEP/COOP/CORP isolated iframe', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28082' }); + it.fixme(browserName === 'firefox'); + await page.route('**/empty.html', route => { + return route.fulfill({ + body: ``, + contentType: 'text/html', + headers: { + 'cross-origin-embedder-policy': 'require-corp', + 'cross-origin-opener-policy': 'same-origin', + 'cross-origin-resource-policy': 'cross-origin', + } + }); + }); + await page.route('**/btn.html', route => { + return route.fulfill({ + body: '', + contentType: 'text/html', + headers: { + 'cross-origin-embedder-policy': 'require-corp', + 'cross-origin-opener-policy': 'same-origin', + 'cross-origin-resource-policy': 'cross-origin', + } + }); + }); + await page.goto(server.EMPTY_PAGE); + await page.frameLocator('iframe').getByRole('button').click(); + expect(await page.frames()[1].evaluate(() => window['__clicked'])).toBe(true); +}); diff --git a/tests/page/page-accessibility.spec.ts b/tests/page/page-accessibility.spec.ts index 3c71479e17..e6717c5e20 100644 --- a/tests/page/page-accessibility.spec.ts +++ b/tests/page/page-accessibility.spec.ts @@ -143,9 +143,8 @@ it('should not report text nodes inside controls', async function({ page, browse expect(await page.accessibility.snapshot()).toEqual(golden); }); -it('rich text editable fields should have children', async function({ page, browserName, browserVersion, channel, isWebView2 }) { +it('rich text editable fields should have children', async function({ page, browserName, browserVersion, isWebView2 }) { it.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy'); - it.skip(channel && channel.startsWith('msedge'), 'Edge is missing a Chromium fix'); it.skip(isWebView2, 'WebView2 is missing a Chromium fix'); await page.setContent(` @@ -178,9 +177,8 @@ it('rich text editable fields should have children', async function({ page, brow expect(snapshot.children[0]).toEqual(golden); }); -it('rich text editable fields with role should have children', async function({ page, browserName, browserMajorVersion, browserVersion, channel, isWebView2 }) { +it('rich text editable fields with role should have children', async function({ page, browserName, browserMajorVersion, browserVersion, isWebView2 }) { it.skip(browserName === 'webkit', 'WebKit rich text accessibility is iffy'); - it.skip(channel && channel.startsWith('msedge'), 'Edge is missing a Chromium fix'); it.skip(isWebView2, 'WebView2 is missing a Chromium fix'); await page.setContent(` @@ -350,3 +348,20 @@ it('should work when there is a title ', async ({ page }) => { expect(snapshot.name).toBe('This is the title'); expect(snapshot.children[0].name).toBe('This is the content'); }); + +it('should work with aria-invalid accessibility tree', async ({ page, browserName, server }) => { + await page.goto(server.EMPTY_PAGE); + await page.setContent(`WHO WE ARE`); + expect(await page.accessibility.snapshot()).toEqual({ + 'role': browserName === 'firefox' ? 'document' : 'WebArea', + 'name': '', + 'children': [ + { + 'role': 'link', + 'name': 'WHO WE ARE', + 'invalid': 'true', + 'value': browserName === 'firefox' ? `${server.PREFIX}/hi` : undefined + } + ] + }); +}); diff --git a/tests/page/page-add-locator-handler.spec.ts b/tests/page/page-add-locator-handler.spec.ts new file mode 100644 index 0000000000..7f75a86ffc --- /dev/null +++ b/tests/page/page-add-locator-handler.spec.ts @@ -0,0 +1,206 @@ +/** + * 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 { test, expect } from './pageTest'; +import { kTargetClosedErrorMessage } from '../config/errors'; + +test('should work', async ({ page, server }) => { + await page.goto(server.PREFIX + '/input/handle-locator.html'); + + let beforeCount = 0; + let afterCount = 0; + await page.addLocatorHandler(page.getByText('This interstitial covers the button'), async () => { + ++beforeCount; + await page.locator('#close').click(); + ++afterCount; + }); + + for (const args of [ + ['mouseover', 1], + ['mouseover', 1, 'capture'], + ['mouseover', 2], + ['mouseover', 2, 'capture'], + ['pointerover', 1], + ['pointerover', 1, 'capture'], + ['none', 1], + ['remove', 1], + ['hide', 1], + ]) { + await test.step(`${args[0]}${args[2] === 'capture' ? ' with capture' : ''} ${args[1]} times`, async () => { + await page.locator('#aside').hover(); + beforeCount = 0; + afterCount = 0; + await page.evaluate(args => { + (window as any).clicked = 0; + (window as any).setupAnnoyingInterstitial(...args); + }, args); + expect(beforeCount).toBe(0); + expect(afterCount).toBe(0); + await page.locator('#target').click(); + expect(beforeCount).toBe(args[1]); + expect(afterCount).toBe(args[1]); + expect(await page.evaluate('window.clicked')).toBe(1); + await expect(page.locator('#interstitial')).not.toBeVisible(); + }); + } +}); + +test('should work with a custom check', async ({ page, server }) => { + await page.goto(server.PREFIX + '/input/handle-locator.html'); + + await page.addLocatorHandler(page.locator('body'), async () => { + if (await page.getByText('This interstitial covers the button').isVisible()) + await page.locator('#close').click(); + }); + + for (const args of [ + ['mouseover', 2], + ['none', 1], + ['remove', 1], + ['hide', 1], + ]) { + await test.step(`${args[0]}${args[2] === 'capture' ? ' with capture' : ''} ${args[1]} times`, async () => { + await page.locator('#aside').hover(); + await page.evaluate(args => { + (window as any).clicked = 0; + (window as any).setupAnnoyingInterstitial(...args); + }, args); + await page.locator('#target').click(); + expect(await page.evaluate('window.clicked')).toBe(1); + await expect(page.locator('#interstitial')).not.toBeVisible(); + }); + } +}); + +test('should work with locator.hover()', async ({ page, server }) => { + await page.goto(server.PREFIX + '/input/handle-locator.html'); + + await page.addLocatorHandler(page.getByText('This interstitial covers the button'), async () => { + await page.locator('#close').click(); + }); + + await page.locator('#aside').hover(); + await page.evaluate(() => { + (window as any).setupAnnoyingInterstitial('pointerover', 1, 'capture'); + }); + await page.locator('#target').hover(); + await expect(page.locator('#interstitial')).not.toBeVisible(); + expect(await page.$eval('#target', e => window.getComputedStyle(e).backgroundColor)).toBe('rgb(255, 255, 0)'); +}); + +test('should not work with force:true', async ({ page, server }) => { + await page.goto(server.PREFIX + '/input/handle-locator.html'); + + await page.addLocatorHandler(page.getByText('This interstitial covers the button'), async () => { + await page.locator('#close').click(); + }); + + await page.locator('#aside').hover(); + await page.evaluate(() => { + (window as any).setupAnnoyingInterstitial('none', 1); + }); + await page.locator('#target').click({ force: true, timeout: 2000 }); + expect(await page.locator('#interstitial').isVisible()).toBe(true); + expect(await page.evaluate('window.clicked')).toBe(undefined); +}); + +test('should throw when page closes', async ({ page, server, isAndroid }) => { + test.fixme(isAndroid, 'GPU process crash: https://issues.chromium.org/issues/324909825'); + await page.goto(server.PREFIX + '/input/handle-locator.html'); + + await page.addLocatorHandler(page.getByText('This interstitial covers the button'), async () => { + await page.close(); + }); + + await page.locator('#aside').hover(); + await page.evaluate(() => { + (window as any).clicked = 0; + (window as any).setupAnnoyingInterstitial('mouseover', 1); + }); + const error = await page.locator('#target').click().catch(e => e); + expect(error.message).toContain(kTargetClosedErrorMessage); +}); + +test('should throw when handler times out', async ({ page, server }) => { + await page.goto(server.PREFIX + '/input/handle-locator.html'); + + let called = 0; + await page.addLocatorHandler(page.getByText('This interstitial covers the button'), async () => { + ++called; + // Deliberately timeout. + await new Promise(() => {}); + }); + + await page.locator('#aside').hover(); + await page.evaluate(() => { + (window as any).clicked = 0; + (window as any).setupAnnoyingInterstitial('mouseover', 1); + }); + const error = await page.locator('#target').click({ timeout: 3000 }).catch(e => e); + expect(error.message).toContain('Timeout 3000ms exceeded'); + + const error2 = await page.locator('#target').click({ timeout: 3000 }).catch(e => e); + expect(error2.message).toContain('Timeout 3000ms exceeded'); + + // Should not enter the same handler while it is still running. + expect(called).toBe(1); +}); + +test('should work with toBeVisible', async ({ page, server }) => { + await page.goto(server.PREFIX + '/input/handle-locator.html'); + + let called = 0; + await page.addLocatorHandler(page.getByText('This interstitial covers the button'), async () => { + ++called; + await page.locator('#close').click(); + }); + + await page.evaluate(() => { + (window as any).clicked = 0; + (window as any).setupAnnoyingInterstitial('remove', 1); + }); + await expect(page.locator('#target')).toBeVisible(); + await expect(page.locator('#interstitial')).not.toBeVisible(); + expect(called).toBe(1); +}); + +test('should work with toHaveScreenshot', async ({ page, server, isAndroid }) => { + test.fixme(isAndroid, 'Screenshots are cut off on Android'); + await page.setViewportSize({ width: 500, height: 500 }); + await page.goto(server.PREFIX + '/grid.html'); + + await page.evaluate(() => { + const overlay = document.createElement('div'); + document.body.append(overlay); + overlay.style.position = 'absolute'; + overlay.style.left = '0'; + overlay.style.right = '0'; + overlay.style.top = '0'; + overlay.style.bottom = '0'; + overlay.style.backgroundColor = 'red'; + + const closeButton = document.createElement('button'); + overlay.appendChild(closeButton); + closeButton.textContent = 'close'; + closeButton.addEventListener('click', () => overlay.remove()); + }); + + await page.addLocatorHandler(page.getByRole('button', { name: 'close' }), async () => { + await page.getByRole('button', { name: 'close' }).click(); + }); + + await expect(page).toHaveScreenshot('screenshot-grid.png'); +}); diff --git a/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-chromium.png b/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-chromium.png new file mode 100644 index 0000000000..122a4f0ae0 Binary files /dev/null and b/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-chromium.png differ diff --git a/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-firefox.png b/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-firefox.png new file mode 100644 index 0000000000..7b16493355 Binary files /dev/null and b/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-firefox.png differ diff --git a/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-webkit.png b/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-webkit.png new file mode 100644 index 0000000000..af070c52a8 Binary files /dev/null and b/tests/page/page-add-locator-handler.spec.ts-snapshots/screenshot-grid-webkit.png differ diff --git a/tests/page/page-click-scroll.spec.ts b/tests/page/page-click-scroll.spec.ts index 464801afdd..758a8d0eb9 100644 --- a/tests/page/page-click-scroll.spec.ts +++ b/tests/page/page-click-scroll.spec.ts @@ -78,9 +78,9 @@ it('should scroll into view display:contents with position', async ({ page, brow expect(await page.evaluate('window._clicked')).toBe(true); }); -it('should not crash when force-clicking hidden input', async ({ page, browserName, channel, browserMajorVersion }) => { +it('should not crash when force-clicking hidden input', async ({ page, isWebView2 }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/18183' }); - it.skip(browserName === 'chromium' && browserMajorVersion < 109 || channel && channel.startsWith('msedge') && browserMajorVersion < 110); + it.fixme(isWebView2); await page.setContent(``); const error = await page.locator('input').click({ force: true, timeout: 2000 }).catch(e => e); diff --git a/tests/page/page-click-timeout-1.spec.ts b/tests/page/page-click-timeout-1.spec.ts index 6856cead27..ad6b1fec77 100644 --- a/tests/page/page-click-timeout-1.spec.ts +++ b/tests/page/page-click-timeout-1.spec.ts @@ -32,5 +32,6 @@ it('should timeout waiting for button to be enabled', async ({ page }) => { const error = await page.click('text=Click target', { timeout: 3000 }).catch(e => e); expect(await page.evaluate('window.__CLICKED')).toBe(undefined); expect(error.message).toContain('page.click: Timeout 3000ms exceeded.'); - expect(error.message).toContain('element is not enabled - waiting'); + expect(error.message).toContain('element is not enabled'); + expect(error.message).toContain('retrying click action'); }); diff --git a/tests/page/page-click-timeout-2.spec.ts b/tests/page/page-click-timeout-2.spec.ts index 7a2f30eaa9..b3e4f12974 100644 --- a/tests/page/page-click-timeout-2.spec.ts +++ b/tests/page/page-click-timeout-2.spec.ts @@ -23,7 +23,8 @@ it('should timeout waiting for display:none to be gone', async ({ page, server } const error = await page.click('button', { timeout: 5000 }).catch(e => e); expect(error.message).toContain('page.click: Timeout 5000ms exceeded.'); expect(error.message).toContain('waiting for element to be visible, enabled and stable'); - expect(error.message).toContain('element is not visible - waiting'); + expect(error.message).toContain('element is not visible'); + expect(error.message).toContain('retrying click action'); }); it('should timeout waiting for visibility:hidden to be gone', async ({ page, server }) => { @@ -32,5 +33,6 @@ it('should timeout waiting for visibility:hidden to be gone', async ({ page, ser const error = await page.click('button', { timeout: 5000 }).catch(e => e); expect(error.message).toContain('page.click: Timeout 5000ms exceeded.'); expect(error.message).toContain('waiting for element to be visible, enabled and stable'); - expect(error.message).toContain('element is not visible - waiting'); + expect(error.message).toContain('element is not visible'); + expect(error.message).toContain('retrying click action'); }); diff --git a/tests/page/page-click-timeout-4.spec.ts b/tests/page/page-click-timeout-4.spec.ts index dcd490ab45..0b167a6344 100644 --- a/tests/page/page-click-timeout-4.spec.ts +++ b/tests/page/page-click-timeout-4.spec.ts @@ -27,7 +27,8 @@ it('should timeout waiting for stable position', async ({ page, server }) => { const error = await button.click({ timeout: 3000 }).catch(e => e); expect(error.message).toContain('elementHandle.click: Timeout 3000ms exceeded.'); expect(error.message).toContain('waiting for element to be visible, enabled and stable'); - expect(error.message).toContain('element is not stable - waiting'); + expect(error.message).toContain('element is not stable'); + expect(error.message).toContain('retrying click action'); }); it('should click for the second time after first timeout', async ({ page, server, mode }) => { diff --git a/tests/page/page-click.spec.ts b/tests/page/page-click.spec.ts index 2c8a32b40d..9059303ba5 100644 --- a/tests/page/page-click.spec.ts +++ b/tests/page/page-click.spec.ts @@ -860,9 +860,12 @@ it('should not hang when frame is detached', async ({ page, server, mode }) => { let resolveDetachPromise; const detachPromise = new Promise(resolve => resolveDetachPromise = resolve); + let firstTime = true; const __testHookBeforeStable = () => { // Detach the frame after "waiting for stable" has started. - + if (!firstTime) + return; + firstTime = false; setTimeout(async () => { await detachFrame(page, 'frame1'); resolveDetachPromise(); diff --git a/tests/page/page-dispatchevent.spec.ts b/tests/page/page-dispatchevent.spec.ts index 85b928862b..3486eb3b1e 100644 --- a/tests/page/page-dispatchevent.spec.ts +++ b/tests/page/page-dispatchevent.spec.ts @@ -171,3 +171,61 @@ it('should dispatch wheel event', async ({ page, server }) => { expect(await eventsHandle.evaluate(e => e[0] instanceof WheelEvent)).toBeTruthy(); expect(await eventsHandle.evaluate(e => ({ deltaX: e[0].deltaX, deltaY: e[0].deltaY }))).toEqual({ deltaX: 100, deltaY: 200 }); }); + +it('should dispatch device orientation event', async ({ page, server, isAndroid }) => { + it.skip(isAndroid, 'DeviceOrientationEvent is only available in a secure context. While Androids loopback is not treated as secure.'); + await page.goto(server.PREFIX + '/device-orientation.html'); + await page.locator('html').dispatchEvent('deviceorientation', { alpha: 10, beta: 20, gamma: 30 }); + expect(await page.evaluate('result')).toBe('Oriented'); + expect(await page.evaluate('alpha')).toBe(10); + expect(await page.evaluate('beta')).toBe(20); + expect(await page.evaluate('gamma')).toBe(30); + expect(await page.evaluate('absolute')).toBeFalsy(); +}); + +it('should dispatch absolute device orientation event', async ({ page, server, isAndroid }) => { + it.skip(isAndroid, 'DeviceOrientationEvent is only available in a secure context. While Androids loopback is not treated as secure.'); + await page.goto(server.PREFIX + '/device-orientation.html'); + await page.locator('html').dispatchEvent('deviceorientationabsolute', { alpha: 10, beta: 20, gamma: 30, absolute: true }); + expect(await page.evaluate('result')).toBe('Oriented'); + expect(await page.evaluate('alpha')).toBe(10); + expect(await page.evaluate('beta')).toBe(20); + expect(await page.evaluate('gamma')).toBe(30); + expect(await page.evaluate('absolute')).toBeTruthy(); +}); + +it('should dispatch device motion event', async ({ page, server, isAndroid }) => { + it.skip(isAndroid, 'DeviceOrientationEvent is only available in a secure context. While Androids loopback is not treated as secure.'); + await page.goto(server.PREFIX + '/device-motion.html'); + await page.locator('html').dispatchEvent('devicemotion', { + acceleration: { x: 10, y: 20, z: 30 }, + accelerationIncludingGravity: { x: 15, y: 25, z: 35 }, + rotationRate: { alpha: 5, beta: 10, gamma: 15 }, + interval: 16, + }); + expect(await page.evaluate('result')).toBe('Moved'); + expect(await page.evaluate('acceleration.x')).toBe(10); + expect(await page.evaluate('acceleration.y')).toBe(20); + expect(await page.evaluate('acceleration.z')).toBe(30); + expect(await page.evaluate('accelerationIncludingGravity.x')).toBe(15); + expect(await page.evaluate('accelerationIncludingGravity.y')).toBe(25); + expect(await page.evaluate('accelerationIncludingGravity.z')).toBe(35); + expect(await page.evaluate('rotationRate.alpha')).toBe(5); + expect(await page.evaluate('rotationRate.beta')).toBe(10); + expect(await page.evaluate('rotationRate.gamma')).toBe(15); + expect(await page.evaluate('interval')).toBe(16); +}); + +it('should throw if argument is from different frame', async ({ page, server }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28690' }); + await page.goto(server.PREFIX + '/frames/one-frame.html'); + { + const dataTransfer = await page.frames()[1].evaluateHandle(() => new DataTransfer()); + await page.frameLocator('iframe').locator('div').dispatchEvent('drop', { dataTransfer }); + } + { + const dataTransfer = await page.evaluateHandle(() => new DataTransfer()); + await expect(page.frameLocator('iframe').locator('div').dispatchEvent('drop', { dataTransfer })) + .rejects.toThrow('JSHandles can be evaluated only in the context they were created!'); + } +}); diff --git a/tests/page/page-evaluate.spec.ts b/tests/page/page-evaluate.spec.ts index 37aa0a6c8f..5e101f1b7a 100644 --- a/tests/page/page-evaluate.spec.ts +++ b/tests/page/page-evaluate.spec.ts @@ -769,3 +769,11 @@ it('should expose utilityScript', async ({ page }) => { utils: true, }); }); + +it('should work with Array.from/map', async ({ page }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28520' }); + expect(await page.evaluate(() => { + const r = (str, amount) => Array.from(Array(amount)).map(() => str).join(''); + return r('([a-f0-9]{2})', 3); + })).toBe('([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})'); +}); diff --git a/tests/page/page-event-request.spec.ts b/tests/page/page-event-request.spec.ts index 2b947c4639..07c1fcc3ce 100644 --- a/tests/page/page-event-request.spec.ts +++ b/tests/page/page-event-request.spec.ts @@ -69,12 +69,16 @@ it('should report requests and responses handled by service worker', async ({ pa expect(await failedRequest.response()).toBe(null); }); -it('should report requests and responses handled by service worker with routing', async ({ page, server, isAndroid, isElectron, mode, platform }) => { +it('should report requests and responses handled by service worker with routing', async ({ page, server, isAndroid, isElectron, mode, browserName, platform }) => { it.fixme(isAndroid); it.fixme(isElectron); it.fixme(mode.startsWith('service') && platform === 'linux', 'Times out for no clear reason'); - await page.route('**/*', route => route.continue()); + const interceptedUrls = []; + await page.route('**/*', route => { + interceptedUrls.push(route.request().url()); + void route.continue(); + }); await page.goto(server.PREFIX + '/serviceworkers/fetchdummy/sw.html'); await page.evaluate(() => window['activationPromise']); const [swResponse, request] = await Promise.all([ @@ -96,6 +100,11 @@ it('should report requests and responses handled by service worker with routing' expect(failedRequest.failure()).not.toBe(null); expect(failedRequest.serviceWorker()).toBe(null); expect(await failedRequest.response()).toBe(null); + + const expectedUrls = [server.PREFIX + '/serviceworkers/fetchdummy/sw.html']; + if (browserName === 'webkit') + expectedUrls.push(server.PREFIX + '/serviceworkers/fetchdummy/sw.js'); + expect(interceptedUrls).toEqual(expectedUrls); }); it('should report navigation requests and responses handled by service worker', async ({ page, server, isAndroid, isElectron, browserName }) => { diff --git a/tests/page/page-fill.spec.ts b/tests/page/page-fill.spec.ts index 1e1585bea3..0704de327a 100644 --- a/tests/page/page-fill.spec.ts +++ b/tests/page/page-fill.spec.ts @@ -89,6 +89,50 @@ it('should fill date input after clicking', async ({ page, server }) => { expect(await page.$eval('input', input => input.value)).toBe('2020-03-02'); }); +for (const [type, value] of Object.entries({ + 'color': '#aaaaaa', + 'date': '2020-03-02', + 'time': '13:15', + 'datetime-local': '2020-03-02T13:15:30', + 'month': '2020-03', + 'range': '42', + 'week': '2020-W50' +})) { + it(`input event.composed should be true and cross shadow dom boundary - ${type}`, async ({ page, server, browserName, isWindows }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28726' }); + it.skip(browserName !== 'chromium' && ['month', 'week'].includes(type), 'Some browser/platforms do not implement certain input types'); + it.skip(browserName === 'webkit' && isWindows && ['color', 'date', 'time', 'datetime-local'].includes(type), 'Some browser/platforms do not implement certain input types'); + await page.goto(server.EMPTY_PAGE); + await page.setContent(``); + await page.locator('body').evaluate(select => { + (window as any).firedBodyEvents = []; + for (const event of ['input', 'change']) { + select.addEventListener(event, e => { + (window as any).firedBodyEvents.push(e.type + ':' + e.composed); + }, false); + } + }); + + await page.locator('input').evaluate(select => { + (window as any).firedEvents = []; + for (const event of ['input', 'change']) { + select.addEventListener(event, e => { + (window as any).firedEvents.push(e.type + ':' + e.composed); + }, false); + } + }); + await page.locator('input').fill(value); + + expect(await page.evaluate(() => window['firedEvents'])).toEqual(['input:true', 'change:false']); + expect(await page.evaluate(() => window['firedBodyEvents'])).toEqual(['input:true']); + }); +} + it('should throw on incorrect date', async ({ page, browserName }) => { it.skip(browserName === 'webkit', 'WebKit does not support date inputs'); diff --git a/tests/page/page-keyboard.spec.ts b/tests/page/page-keyboard.spec.ts index d0a0fd1ff3..94a7c23c90 100644 --- a/tests/page/page-keyboard.spec.ts +++ b/tests/page/page-keyboard.spec.ts @@ -326,6 +326,16 @@ it('should handle selectAll', async ({ page, server, isMac }) => { expect(await page.$eval('textarea', textarea => textarea.value)).toBe(''); }); +it('pressing Meta should not result in any text insertion on any platform', async ({ page, server, isMac }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28495' }); + await page.setContent(''); + const input = page.locator('input'); + await expect(input).toHaveValue('hello world'); + await input.focus(); + await page.keyboard.press('Meta'); + await expect(input).toHaveValue('hello world'); +}); + it('should be able to prevent selectAll', async ({ page, server, isMac }) => { await page.goto(server.PREFIX + '/input/textarea.html'); const textarea = await page.$('textarea'); @@ -358,25 +368,13 @@ it('should support MacOS shortcuts', async ({ page, server, platform, browserNam expect(await page.$eval('textarea', textarea => textarea.value)).toBe('some '); }); -it('should press the meta key', async ({ page, browserName, isMac, browserMajorVersion }) => { +it('should press the meta key', async ({ page }) => { const lastEvent = await captureLastKeydown(page); await page.keyboard.press('Meta'); const { key, code, metaKey } = await lastEvent.jsonValue(); - if (browserName === 'firefox' && !isMac) - expect(key).toBe('OS'); - else - expect(key).toBe('Meta'); - - if (browserName === 'firefox' && browserMajorVersion <= 117) - expect(code).toBe('OSLeft'); - else - expect(code).toBe('MetaLeft'); - - if (browserName === 'firefox' && !isMac) - expect(metaKey).toBe(false); - else - expect(metaKey).toBe(true); - + expect(key).toBe('Meta'); + expect(code).toBe('MetaLeft'); + expect(metaKey).toBe(true); }); it('should work with keyboard events with empty.html', async ({ page, server }) => { diff --git a/tests/page/page-network-request.spec.ts b/tests/page/page-network-request.spec.ts index 0636370923..70fc77b61f 100644 --- a/tests/page/page-network-request.spec.ts +++ b/tests/page/page-network-request.spec.ts @@ -448,3 +448,37 @@ it('should not allow to access frame on popup main request', async ({ page, serv await popupPromise; await clicked; }); + +it('page.reload return 304 status code', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28779' }); + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/29441' }); + it.fixme(browserName === 'firefox', 'Does not send second request'); + let requestNumber = 0; + server.setRoute('/test.html', (req, res) => { + ++requestNumber; + const headers = { + 'cf-cache-status': 'DYNAMIC', + 'Content-Type': 'text/html;charset=UTF-8', + 'Last-Modified': 'Fri, 05 Jan 2024 01:56:20 GMT', + 'Vary': 'Access-Control-Request-Headers', + }; + if (requestNumber === 1) + res.writeHead(200, headers); + else + res.writeHead(304, 'Not Modified', headers); + res.write(`
Test
`); + res.end(); + }); + const response1 = await page.goto(server.PREFIX + '/test.html'); + expect(response1.status()).toBe(200); + const response2 = await page.reload(); + expect(requestNumber).toBe(2); + if (browserName === 'chromium') { + expect(response2.status()).toBe(200); + expect(response2.statusText()).toBe('OK'); + expect(await response2.text()).toBe('
Test
'); + } else { + expect(response2.status()).toBe(304); + expect(response2.statusText()).toBe('Not Modified'); + } +}); diff --git a/tests/page/page-request-continue.spec.ts b/tests/page/page-request-continue.spec.ts index d36bc8575b..1b7f78e40d 100644 --- a/tests/page/page-request-continue.spec.ts +++ b/tests/page/page-request-continue.spec.ts @@ -16,6 +16,7 @@ */ import { test as it, expect } from './pageTest'; +import type { Route } from 'playwright-core'; it('should work', async ({ page, server }) => { await page.route('**/*', route => route.continue()); @@ -142,6 +143,24 @@ it('should not throw when continuing after page is closed', async ({ page, serve expect(error).toBeInstanceOf(Error); }); +it('should not throw if request was cancelled by the page', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28490' }); + let interceptCallback; + const interceptPromise = new Promise(f => interceptCallback = f); + await page.route('**/data.json', route => interceptCallback(route)); + await page.goto(server.EMPTY_PAGE); + page.evaluate(url => { + globalThis.controller = new AbortController(); + return fetch(url, { signal: globalThis.controller.signal }); + }, server.PREFIX + '/data.json').catch(() => {}); + const route = await interceptPromise; + const failurePromise = page.waitForEvent('requestfailed'); + await page.evaluate(() => globalThis.controller.abort()); + const cancelledRequest = await failurePromise; + expect(cancelledRequest.failure().errorText).toMatch(/cancelled|aborted/i); + await route.continue(); // Should not throw. +}); + it('should override method along with url', async ({ page, server }) => { const request = server.waitForRequest('/empty.html'); await page.route('**/foo', route => { @@ -374,6 +393,57 @@ it('should continue preload link requests', async ({ page, server, browserName } expect(color).toBe('rgb(255, 192, 203)'); }); +it('continue should propagate headers to redirects', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28758' }); + it.fixme(browserName === 'firefox'); + await server.setRedirect('/redirect', '/empty.html'); + await page.route('**/redirect', route => { + void route.continue({ + headers: { + ...route.request().headers(), + custom: 'value' + } + }); + }); + const [serverRequest] = await Promise.all([ + server.waitForRequest('/empty.html'), + page.goto(server.PREFIX + '/redirect') + ]); + expect(serverRequest.headers['custom']).toBe('value'); +}); + +it('continue should delete headers on redirects', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/13106' }); + it.fixme(browserName === 'firefox'); + await page.goto(server.PREFIX + '/empty.html'); + server.setRoute('/something', (request, response) => { + response.writeHead(200, { 'Access-Control-Allow-Origin': '*' }); + response.end('done'); + }); + await server.setRedirect('/redirect', '/something'); + await page.route('**/redirect', route => { + void route.continue({ + headers: { + ...route.request().headers(), + foo: undefined + } + }); + }); + const [text, serverRequest] = await Promise.all([ + page.evaluate(async url => { + const data = await fetch(url, { + headers: { + foo: 'a', + } + }); + return data.text(); + }, server.PREFIX + '/redirect'), + server.waitForRequest('/something') + ]); + expect(text).toBe('done'); + expect(serverRequest.headers.foo).toBeFalsy(); +}); + it('should intercept css variable with background url', async ({ page, server }) => { it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/19158' }); diff --git a/tests/page/page-request-fulfill.spec.ts b/tests/page/page-request-fulfill.spec.ts index 376b03d69c..c76fbd2ab7 100644 --- a/tests/page/page-request-fulfill.spec.ts +++ b/tests/page/page-request-fulfill.spec.ts @@ -18,6 +18,7 @@ import { test as base, expect } from './pageTest'; import fs from 'fs'; import type * as har from '../../packages/trace/src/har'; +import type { Route } from 'playwright-core'; const it = base.extend<{ // We access test servers at 10.0.2.2 from inside the browser on Android, @@ -77,6 +78,46 @@ it('should work with status code 422', async ({ page, server }) => { expect(await page.evaluate(() => document.body.textContent)).toBe('Yo, page!'); }); +it('should throw exception if status code is not supported', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28490' }); + let fulfillPromiseCallback; + const fulfillPromise = new Promise(f => fulfillPromiseCallback = f); + await page.route('**/data.json', route => { + fulfillPromiseCallback(route.fulfill({ + status: 430, + body: 'Yo, page!' + }).catch(e => e)); + }); + await page.goto(server.EMPTY_PAGE); + page.evaluate(url => fetch(url), server.PREFIX + '/data.json').catch(() => {}); + const error = await fulfillPromise; + if (browserName === 'chromium') { + expect(error).toBeTruthy(); + expect(error.message).toContain(' Invalid http status code or phrase'); + } else { + expect(error).toBe(undefined); + } +}); + +it('should not throw if request was cancelled by the page', async ({ page, server }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28490' }); + let interceptCallback; + const interceptPromise = new Promise(f => interceptCallback = f); + await page.route('**/data.json', route => interceptCallback(route)); + await page.goto(server.EMPTY_PAGE); + page.evaluate(url => { + globalThis.controller = new AbortController(); + return fetch(url, { signal: globalThis.controller.signal }); + }, server.PREFIX + '/data.json').catch(() => {}); + const route = await interceptPromise; + const failurePromise = page.waitForEvent('requestfailed'); + await page.evaluate(() => globalThis.controller.abort()); + const cancelledRequest = await failurePromise; + expect(cancelledRequest.failure()).toBeTruthy(); + expect(cancelledRequest.failure().errorText).toMatch(/cancelled|aborted/i); + await route.fulfill({ status: 200 }); // Should not throw. +}); + it('should allow mocking binary responses', async ({ page, server, browserName, headless, asset, isAndroid, mode }) => { it.skip(browserName === 'firefox' && !headless, 'Firefox headed produces a different image.'); it.skip(isAndroid); diff --git a/tests/page/page-route.spec.ts b/tests/page/page-route.spec.ts index 8c0a1bc80c..828bd4a9e2 100644 --- a/tests/page/page-route.spec.ts +++ b/tests/page/page-route.spec.ts @@ -201,10 +201,15 @@ it('should show custom HTTP headers', async ({ page, server }) => { }); // @see https://github.com/GoogleChrome/puppeteer/issues/4337 -it('should work with redirect inside sync XHR', async ({ page, server }) => { +it('should work with redirect inside sync XHR', async ({ page, server, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28461' }); + it.fixme(browserName === 'webkit', 'No Network.requestIntercepted for the request'); await page.goto(server.EMPTY_PAGE); server.setRedirect('/logo.png', '/pptr.png'); - await page.route('**/*', route => route.continue()); + let continuePromise; + await page.route('**/*', route => { + continuePromise = route.continue(); + }); const status = await page.evaluate(async () => { const request = new XMLHttpRequest(); request.open('GET', '/logo.png', false); // `false` makes the request synchronous @@ -212,6 +217,8 @@ it('should work with redirect inside sync XHR', async ({ page, server }) => { return request.status; }); expect(status).toBe(200); + expect(continuePromise).toBeTruthy(); + await continuePromise; }); it('should pause intercepted XHR until continue', async ({ page, server, browserName }) => { @@ -308,6 +315,24 @@ it('should be abortable with custom error codes', async ({ page, server, browser expect(failedRequest.failure().errorText).toBe('net::ERR_INTERNET_DISCONNECTED'); }); +it('should not throw if request was cancelled by the page', async ({ page, server }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28490' }); + let interceptCallback; + const interceptPromise = new Promise(f => interceptCallback = f); + await page.route('**/data.json', route => interceptCallback(route)); + await page.goto(server.EMPTY_PAGE); + page.evaluate(url => { + globalThis.controller = new AbortController(); + return fetch(url, { signal: globalThis.controller.signal }); + }, server.PREFIX + '/data.json').catch(() => {}); + const route = await interceptPromise; + const failurePromise = page.waitForEvent('requestfailed'); + await page.evaluate(() => globalThis.controller.abort()); + const cancelledRequest = await failurePromise; + expect(cancelledRequest.failure().errorText).toMatch(/cancelled|aborted/i); + await route.abort(); // Should not throw. +}); + it('should send referer', async ({ page, server }) => { await page.setExtraHTTPHeaders({ referer: 'http://google.com/' @@ -902,6 +927,25 @@ it('should support the times parameter with route matching', async ({ page, serv expect(intercepted).toHaveLength(1); }); +it('should work if handler with times parameter was removed from another handler', async ({ page, server }) => { + const intercepted = []; + const handler = async route => { + intercepted.push('first'); + void route.continue(); + }; + await page.route('**/*', handler, { times: 1 }); + await page.route('**/*', async route => { + intercepted.push('second'); + await page.unroute('**/*', handler); + await route.fallback(); + }); + await page.goto(server.EMPTY_PAGE); + expect(intercepted).toEqual(['second']); + intercepted.length = 0; + await page.goto(server.EMPTY_PAGE); + expect(intercepted).toEqual(['second']); +}); + it('should support async handler w/ times', async ({ page, server }) => { await page.route('**/empty.html', async route => { await new Promise(f => setTimeout(f, 100)); diff --git a/tests/page/page-screenshot.spec.ts b/tests/page/page-screenshot.spec.ts index 1b4bb17169..47188f52a4 100644 --- a/tests/page/page-screenshot.spec.ts +++ b/tests/page/page-screenshot.spec.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import os from 'os'; import { test as it, expect } from './pageTest'; import { verifyViewport, attachFrame } from '../config/utils'; import type { Route } from 'playwright-core'; @@ -308,8 +309,9 @@ it.describe('page screenshot', () => { } }); - it('should work for webgl', async ({ page, server, browserName, channel, browserMajorVersion }) => { + it('should work for webgl', async ({ page, server, browserName, platform }) => { it.fixme(browserName === 'firefox'); + it.fixme(browserName === 'chromium' && platform === 'darwin' && os.arch() === 'arm64', 'SwiftShader is not available on macOS-arm64 - https://github.com/microsoft/playwright/issues/28216'); await page.setViewportSize({ width: 640, height: 480 }); await page.goto(server.PREFIX + '/screenshots/webgl.html'); @@ -543,6 +545,36 @@ it.describe('page screenshot', () => { maskColor: '#00FF00', })).toMatchSnapshot('mask-color-should-work.png'); }); + + it('should hide elements based on attr', async ({ page, server }) => { + await page.setViewportSize({ width: 500, height: 500 }); + await page.goto(server.PREFIX + '/grid.html'); + await page.locator('div').nth(5).evaluate(element => { + element.setAttribute('data-test-screenshot', 'hide'); + }); + expect(await page.screenshot({ + style: `[data-test-screenshot="hide"] { + visibility: hidden; + }` + })).toMatchSnapshot('hide-should-work.png'); + const visibility = await page.locator('div').nth(5).evaluate(element => element.style.visibility); + expect(visibility).toBe(''); + }); + + it('should remove elements based on attr', async ({ page, server }) => { + await page.setViewportSize({ width: 500, height: 500 }); + await page.goto(server.PREFIX + '/grid.html'); + await page.locator('div').nth(5).evaluate(element => { + element.setAttribute('data-test-screenshot', 'remove'); + }); + expect(await page.screenshot({ + style: `[data-test-screenshot="remove"] { + display: none; + }` + })).toMatchSnapshot('remove-should-work.png'); + const display = await page.locator('div').nth(5).evaluate(element => element.style.display); + expect(display).toBe(''); + }); }); }); @@ -658,7 +690,7 @@ it.describe('page screenshot animations', () => { expect(comparePNGs(buffer1, buffer2, { maxDiffPixels: 50 })).not.toBe(null); }); - it('should fire transitionend for finite transitions', async ({ page, server }) => { + it('should fire transitionend for finite transitions', async ({ page, server, browserName, platform }) => { await page.goto(server.PREFIX + '/css-transition.html'); const div = page.locator('div'); await div.evaluate(el => { @@ -684,7 +716,7 @@ it.describe('page screenshot animations', () => { expect(await page.evaluate(() => window['__TRANSITION_END'])).toBe(true); }); - it('should capture screenshots after layoutchanges in transitionend event', async ({ page, server }) => { + it('should capture screenshots after layoutchanges in transitionend event', async ({ page, server, browserName, platform }) => { await page.goto(server.PREFIX + '/css-transition.html'); const div = page.locator('div'); await div.evaluate(el => { @@ -824,6 +856,33 @@ it.describe('page screenshot animations', () => { 'onfinish', 'animationend' ]); }); + + it('should wait for fonts to load', async ({ page, server, isWindows, isAndroid }) => { + it.fixme(isWindows, 'This requires a windows-specific test expectations. https://github.com/microsoft/playwright/issues/12707'); + it.skip(isAndroid, 'Different viewport'); + await page.setViewportSize({ width: 500, height: 500 }); + const fontRequestPromise = new Promise(resolve => { + // Stall font loading. + server.setRoute('/webfont/iconfont.woff2', (request, response) => { + resolve({ request, response }); + }); + }); + await page.goto(server.PREFIX + '/webfont/webfont.html', { + waitUntil: 'domcontentloaded', // 'load' will not happen if webfont is pending + }); + + // Make sure screenshot times out while webfont is stalled. + const error = await page.screenshot({ timeout: 200, }).catch(e => e); + expect(error.message).toContain('waiting for fonts to load...'); + expect(error.message).toContain('Timeout 200ms exceeded'); + + const fontRequest = await fontRequestPromise; + server.serveFile(fontRequest.request, fontRequest.response); + const iconsScreenshot = await page.screenshot(); + expect(iconsScreenshot).toMatchSnapshot('screenshot-web-font.png', { + maxDiffPixels: 50, + }); + }); }); it('should throw if screenshot size is too large', async ({ page, browserName, isMac }) => { diff --git a/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-chromium.png b/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-chromium.png new file mode 100644 index 0000000000..dd0549a411 Binary files /dev/null and b/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-chromium.png differ diff --git a/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-firefox.png b/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-firefox.png new file mode 100644 index 0000000000..7af4f1af70 Binary files /dev/null and b/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-firefox.png differ diff --git a/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-webkit.png b/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-webkit.png new file mode 100644 index 0000000000..b3d74594d4 Binary files /dev/null and b/tests/page/page-screenshot.spec.ts-snapshots/hide-should-work-webkit.png differ diff --git a/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-chromium.png b/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-chromium.png new file mode 100644 index 0000000000..d35ddd4289 Binary files /dev/null and b/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-chromium.png differ diff --git a/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-firefox.png b/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-firefox.png new file mode 100644 index 0000000000..cbae7f34d0 Binary files /dev/null and b/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-firefox.png differ diff --git a/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-webkit.png b/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-webkit.png new file mode 100644 index 0000000000..88699136c1 Binary files /dev/null and b/tests/page/page-screenshot.spec.ts-snapshots/remove-should-work-webkit.png differ diff --git a/tests/page/page-select-option.spec.ts b/tests/page/page-select-option.spec.ts index 43778b766a..522c6270ff 100644 --- a/tests/page/page-select-option.spec.ts +++ b/tests/page/page-select-option.spec.ts @@ -287,3 +287,37 @@ it('should wait for multiple options to be present', async ({ page, server }) => const items = await selectPromise; expect(items).toStrictEqual(['green', 'scarlet']); }); + +it('input event.composed should be true and cross shadow dom boundary', async ({ page, server }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28726' }); + await page.goto(server.EMPTY_PAGE); + await page.setContent(``); + await page.locator('body').evaluate(select => { + (window as any).firedBodyEvents = []; + for (const event of ['input', 'change']) { + select.addEventListener(event, e => { + (window as any).firedBodyEvents.push(e.type + ':' + e.composed); + }, false); + } + }); + + await page.locator('select').evaluate(select => { + (window as any).firedEvents = []; + for (const event of ['input', 'change']) { + select.addEventListener(event, e => { + (window as any).firedEvents.push(e.type + ':' + e.composed); + }, false); + } + }); + await page.selectOption('select', 'blue'); + expect(await page.evaluate(() => window['firedEvents'])).toEqual(['input:true', 'change:false']); + expect(await page.evaluate(() => window['firedBodyEvents'])).toEqual(['input:true']); +}); diff --git a/tests/page/page-set-input-files.spec.ts b/tests/page/page-set-input-files.spec.ts index 93d223a88c..966459a2c9 100644 --- a/tests/page/page-set-input-files.spec.ts +++ b/tests/page/page-set-input-files.spec.ts @@ -37,9 +37,10 @@ it('should upload the file', async ({ page, server, asset }) => { }, input)).toBe('contents of the file'); }); -it('should upload large file', async ({ page, server, browserName, isMac, isAndroid, mode }, testInfo) => { +it('should upload large file', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode }, testInfo) => { it.skip(browserName === 'webkit' && isMac && parseInt(os.release(), 10) < 20, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.'); it.skip(isAndroid); + it.skip(isWebView2); it.skip(mode.startsWith('service')); it.slow(); @@ -87,9 +88,10 @@ it('should upload large file', async ({ page, server, browserName, isMac, isAndr await Promise.all([uploadFile, file1.filepath].map(fs.promises.unlink)); }); -it('should upload multiple large files', async ({ page, server, browserName, isMac, isAndroid, mode }, testInfo) => { +it('should upload multiple large files', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode }, testInfo) => { it.skip(browserName === 'webkit' && isMac && parseInt(os.release(), 10) < 20, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.'); it.skip(isAndroid); + it.skip(isWebView2); it.skip(mode.startsWith('service')); it.slow(); @@ -127,9 +129,10 @@ it('should upload multiple large files', async ({ page, server, browserName, isM await Promise.all(uploadFiles.map(path => fs.promises.unlink(path))); }); -it('should upload large file with relative path', async ({ page, server, browserName, isMac, isAndroid, mode }, testInfo) => { +it('should upload large file with relative path', async ({ page, server, browserName, isMac, isAndroid, isWebView2, mode }, testInfo) => { it.skip(browserName === 'webkit' && isMac && parseInt(os.release(), 10) < 20, 'WebKit for macOS 10.15 is frozen and does not have corresponding protocol features.'); it.skip(isAndroid); + it.skip(isWebView2); it.skip(mode.startsWith('service')); it.slow(); @@ -530,6 +533,41 @@ it('should emit input and change events', async ({ page, asset }) => { expect(events[1].type).toBe('change'); }); +it('input event.composed should be true and cross shadow dom boundary', async ({ page, server, asset }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28726' }); + await page.goto(server.EMPTY_PAGE); + await page.setContent(``); + await page.locator('body').evaluate(select => { + (window as any).firedBodyEvents = []; + for (const event of ['input', 'change']) { + select.addEventListener(event, e => { + (window as any).firedBodyEvents.push(e.type + ':' + e.composed); + }, false); + } + }); + + await page.locator('input').evaluate(select => { + (window as any).firedEvents = []; + for (const event of ['input', 'change']) { + select.addEventListener(event, e => { + (window as any).firedEvents.push(e.type + ':' + e.composed); + }, false); + } + }); + await page.locator('input').setInputFiles({ + name: 'test.txt', + mimeType: 'text/plain', + buffer: Buffer.from('this is a test') + }); + expect(await page.evaluate(() => window['firedEvents'])).toEqual(['input:true', 'change:false']); + expect(await page.evaluate(() => window['firedBodyEvents'])).toEqual(['input:true']); +}); + it('should work for single file pick', async ({ page, server }) => { await page.setContent(``); const [fileChooser] = await Promise.all([ diff --git a/tests/page/page-wait-for-request.spec.ts b/tests/page/page-wait-for-request.spec.ts index 555ace31ad..3ba6e9304f 100644 --- a/tests/page/page-wait-for-request.spec.ts +++ b/tests/page/page-wait-for-request.spec.ts @@ -63,7 +63,7 @@ it('should respect default timeout', async ({ page, playwright }) => { it('should log the url', async ({ page }) => { const error = await page.waitForRequest('long-long-long-long-long-long-long-long-long-long-long-long-long-long.css', { timeout: 1000 }).catch(e => e); - expect(error.message).toContain('waiting for request "long-long-long-long-long-long-long-long-long-long-…"'); + expect(error.message).toContain('waiting for request "long-long-long-long-long-long-long-long-long-long…"'); }); it('should work with no timeout', async ({ page, server }) => { diff --git a/tests/page/selectors-css.spec.ts b/tests/page/selectors-css.spec.ts index 5ce11f11ba..172493dbea 100644 --- a/tests/page/selectors-css.spec.ts +++ b/tests/page/selectors-css.spec.ts @@ -274,8 +274,9 @@ it('should work with :nth-child', async ({ page, server }) => { expect(await page.$$eval(`css=span:nth-child(23n+2)`, els => els.length)).toBe(1); }); -it('should work with :nth-child(of) notation with nested functions', async ({ page, browserName }) => { +it('should work with :nth-child(of) notation with nested functions', async ({ page, browserName, browserMajorVersion }) => { it.fixme(browserName === 'firefox', 'Should enable once Firefox supports this syntax'); + it.skip(browserName === 'chromium' && browserMajorVersion < 111, 'https://caniuse.com/css-nth-child-of'); await page.setContent(`
diff --git a/tests/playwright-test/basic.spec.ts b/tests/playwright-test/basic.spec.ts index 3b47603c25..4c4b28ceeb 100644 --- a/tests/playwright-test/basic.spec.ts +++ b/tests/playwright-test/basic.spec.ts @@ -550,3 +550,22 @@ test('should support describe.fixme', async ({ runInlineTest }) => { expect(result.skipped).toBe(3); expect(result.output).toContain('heytest4'); }); + +test('should not allow mixing test types', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'mixed.spec.ts': ` + import { test } from '@playwright/test'; + + export const test2 = test.extend({ + value: 42, + }); + + test.describe("test1 suite", () => { + test2("test 2", async () => {}); + }); + ` + }); + expect(result.exitCode).toBe(1); + expect(result.output).toContain(`Can't call test() inside a describe() suite of a different test type.`); + expect(result.output).toContain('> 9 | test2('); +}); diff --git a/tests/playwright-test/config.spec.ts b/tests/playwright-test/config.spec.ts index bddbde5f57..38fef69915 100644 --- a/tests/playwright-test/config.spec.ts +++ b/tests/playwright-test/config.spec.ts @@ -223,7 +223,7 @@ test('should throw when test() is called in config file', async ({ runInlineTest }); test('should filter by project, case-insensitive', async ({ runInlineTest }) => { - const { passed, failed, output, skipped } = await runInlineTest({ + const { passed, failed, outputLines, skipped } = await runInlineTest({ 'playwright.config.ts': ` module.exports = { projects: [ { name: 'suite1' }, @@ -231,20 +231,44 @@ test('should filter by project, case-insensitive', async ({ runInlineTest }) => ] }; `, 'a.test.ts': ` - import { test, expect } from '@playwright/test'; + import { test } from '@playwright/test'; test('pass', async ({}, testInfo) => { - console.log(testInfo.project.name); + console.log('%%' + test.info().project.name); }); ` }, { project: 'SUite2' }); expect(passed).toBe(1); expect(failed).toBe(0); expect(skipped).toBe(0); - expect(output).toContain('suite2'); - expect(output).not.toContain('suite1'); + expect(new Set(outputLines)).toEqual(new Set([ + 'suite2', + ])); }); -test('should print nice error when project is unknown', async ({ runInlineTest }) => { +test('should filter by project wildcard', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'playwright.config.js': ` + module.exports = { + projects: [ + { name: 'project-name' }, + { name: 'foobar' } + ] + }; + `, + 'a.test.js': ` + const { test } = require('@playwright/test'); + test('one', async ({}) => { + console.log('%%' + test.info().project.name); + }); ` + }, { '--project': '*oj*t-Na*e' }); + expect(result.exitCode).toBe(0); + expect(result.output).toContain('Running 1 test using 1 worker'); + expect(new Set(result.outputLines)).toEqual(new Set([ + 'project-name', + ])); +}); + +test('should print nice error when the project wildcard does not match anything', async ({ runInlineTest }) => { const { output, exitCode } = await runInlineTest({ 'playwright.config.ts': ` module.exports = { projects: [ @@ -258,13 +282,53 @@ test('should print nice error when project is unknown', async ({ runInlineTest } console.log(testInfo.project.name); }); ` + }, { '--project': ['not*found'] }); + expect(exitCode).toBe(1); + expect(output).toContain('Error: No projects matched. Available projects: "suite1", "suite2"'); +}); + +test('should filter by project wildcard and exact name', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'playwright.config.js': ` + module.exports = { + projects: [ + { name: 'first' }, + { name: 'fooBar' }, + { name: 'foobarBaz' }, + { name: 'prefix' }, + { name: 'prefixEnd' }, + ] + }; + `, + 'a.test.js': ` + const { test } = require('@playwright/test'); + test('one', async ({}) => { + console.log('%%' + test.info().project.name); + }); ` + }, { '--project': ['first', '*bar', 'pref*x'] }); + expect(result.exitCode).toBe(0); + expect(new Set(result.outputLines)).toEqual(new Set(['first', 'fooBar', 'prefix'])); +}); + +test('should print nice error when project is unknown', async ({ runInlineTest }) => { + const { output, exitCode } = await runInlineTest({ + 'playwright.config.ts': ` + module.exports = { projects: [ + { name: 'suite1' }, + { name: 'suite2' }, + ] }; + `, + 'a.test.ts': ` + import { test, expect } from '@playwright/test'; + test('pass', async ({}, testInfo) => {}); + ` }, { project: 'suite3' }); expect(exitCode).toBe(1); - expect(output).toContain('Project(s) "suite3" not found. Available named projects: "suite1", "suite2"'); + expect(output).toContain('Project(s) "suite3" not found. Available projects: "suite1", "suite2"'); }); test('should filter by project list, case-insensitive', async ({ runInlineTest }) => { - const { passed, failed, output, skipped } = await runInlineTest({ + const { passed, failed, outputLines, skipped } = await runInlineTest({ 'playwright.config.ts': ` module.exports = { projects: [ { name: 'suite1' }, @@ -276,21 +340,18 @@ test('should filter by project list, case-insensitive', async ({ runInlineTest } 'a.test.ts': ` import { test, expect } from '@playwright/test'; test('pass', async ({}, testInfo) => { - console.log(testInfo.project.name); + console.log('%%' + test.info().project.name); }); ` }, { project: ['SUite2', 'Suite3'] }); expect(passed).toBe(2); expect(failed).toBe(0); expect(skipped).toBe(0); - expect(output).toContain('suite2'); - expect(output).toContain('suite3'); - expect(output).not.toContain('suite1'); - expect(output).not.toContain('suite4'); + expect(new Set(outputLines)).toEqual(new Set(['suite3', 'suite2'])); }); test('should filter when duplicate project names exist', async ({ runInlineTest }) => { - const { passed, failed, output, skipped } = await runInlineTest({ + const { passed, failed, outputLines, skipped } = await runInlineTest({ 'playwright.config.ts': ` module.exports = { projects: [ { name: 'suite1' }, @@ -302,16 +363,14 @@ test('should filter when duplicate project names exist', async ({ runInlineTest 'a.test.ts': ` import { test, expect } from '@playwright/test'; test('pass', async ({}, testInfo) => { - console.log(testInfo.project.name); + console.log('%%' + test.info().project.name); }); ` }, { project: ['suite1', 'sUIte4'] }); expect(passed).toBe(3); expect(failed).toBe(0); expect(skipped).toBe(0); - expect(output).toContain('suite1'); - expect(output).toContain('suite4'); - expect(output).not.toContain('suite2'); + expect(new Set(outputLines)).toEqual(new Set(['suite1', 'suite1', 'suite4'])); }); test('should print nice error when some of the projects are unknown', async ({ runInlineTest }) => { @@ -330,7 +389,7 @@ test('should print nice error when some of the projects are unknown', async ({ r ` }, { project: ['suitE1', 'suIte3', 'SUite4'] }); expect(exitCode).toBe(1); - expect(output).toContain('Project(s) "suIte3", "SUite4" not found. Available named projects: "suite1", "suite2"'); + expect(output).toContain('Project(s) "suIte3", "SUite4" not found. Available projects: "suite1", "suite2"'); }); test('should work without config file', async ({ runInlineTest }) => { @@ -546,6 +605,9 @@ test('should merge configs', async ({ runInlineTest }) => { command: 'echo 123', }] })); + + // Should not add an empty project list. + expect(defineConfig({}, {}).projects).toBeUndefined(); `, 'a.test.ts': ` import { test } from '@playwright/test'; @@ -554,3 +616,41 @@ test('should merge configs', async ({ runInlineTest }) => { }); expect(result.exitCode).toBe(0); }); + +test('should merge ct configs', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'playwright.config.ts': ` + import { defineConfig, expect } from '@playwright/experimental-ct-react'; + const baseConfig = defineConfig({ + timeout: 10, + use: { + foo: 1, + }, + }); + const derivedConfig = defineConfig(baseConfig, { + grep: 'hi', + use: { + bar: 2, + }, + }); + + // Make sure ct-specific properties are preserved + // and config properties are merged. + expect(derivedConfig).toEqual(expect.objectContaining({ + use: { foo: 1, bar: 2 }, + grep: 'hi', + '@playwright/test': expect.objectContaining({ + babelPlugins: [[expect.stringContaining('tsxTransform.js')]] + }), + '@playwright/experimental-ct-core': expect.objectContaining({ + registerSourceFile: expect.stringContaining('registerSource'), + }), + })); + `, + 'a.test.ts': ` + import { test } from '@playwright/experimental-ct-react'; + test('pass', async ({}) => {}); + ` + }); + expect(result.exitCode).toBe(0); +}); diff --git a/tests/playwright-test/esm.spec.ts b/tests/playwright-test/esm.spec.ts index 0a32e35956..7097659d0d 100644 --- a/tests/playwright-test/esm.spec.ts +++ b/tests/playwright-test/esm.spec.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { test, expect } from './playwright-test-fixtures'; +import { test, expect, playwrightCtConfigText } from './playwright-test-fixtures'; test('should load nested as esm when package.json has type module', async ({ runInlineTest }) => { const result = await runInlineTest({ @@ -157,6 +157,32 @@ test('should use source maps', async ({ runInlineTest }) => { expect(output).toContain('[foo] › a.test.ts:4:7 › check project name'); }); +test('should use source maps when importing a file throws an error', async ({ runInlineTest }) => { + test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/29418' }); + + const result = await runInlineTest({ + 'package.json': `{ "type": "module" }`, + 'playwright.config.ts': ` + export default {}; + `, + 'a.test.ts': ` + import { test, expect } from '@playwright/test'; + + throw new Error('Oh my!'); + ` + }); + expect(result.exitCode).toBe(1); + expect(result.output).toContain(`Error: Oh my! + + at a.test.ts:4 + + 2 | import { test, expect } from '@playwright/test'; + 3 | +> 4 | throw new Error('Oh my!'); + | ^ + `); +}); + test('should show the codeframe in errors', async ({ runInlineTest }) => { const result = await runInlineTest({ 'package.json': `{ "type": "module" }`, @@ -481,10 +507,7 @@ test('should resolve no-extension import to .jsx file in ESM mode', async ({ run test('should resolve .js import to .tsx file in ESM mode for components', async ({ runInlineTest }) => { const result = await runInlineTest({ 'package.json': `{ "type": "module" }`, - 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; - export default defineConfig({ projects: [{name: 'foo'}] }); - `, + 'playwright.config.ts': playwrightCtConfigText, 'playwright/index.html': ``, 'playwright/index.ts': ``, @@ -672,3 +695,20 @@ test('should be able to use mergeTests/mergeExpect', async ({ runInlineTest }) = expect(result.outputLines).toContain('myFixture1: 1'); expect(result.outputLines).toContain('myFixture2: 2'); }); + +test('should exit after merge-reports', async ({ runInlineTest, mergeReports }) => { + test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28699' }); + const result = await runInlineTest({ + 'merge.config.ts': ` + export default { reporter: 'line' }; + `, + 'package.json': JSON.stringify({ type: 'module' }), + 'nested/folder/a.esm.test.js': ` + import { test, expect } from '@playwright/test'; + test('test 1', ({}, testInfo) => {}); + ` + }, undefined, undefined, { additionalArgs: ['--reporter', 'blob'] }); + expect(result.exitCode).toBe(0); + const { exitCode } = await mergeReports(test.info().outputPath('blob-report'), undefined, { additionalArgs: ['-c', 'merge.config.ts'] }); + expect(exitCode).toBe(0); +}); diff --git a/tests/playwright-test/expect-soft.spec.ts b/tests/playwright-test/expect-soft.spec.ts index ffb0252dab..c47d594e0e 100644 --- a/tests/playwright-test/expect-soft.spec.ts +++ b/tests/playwright-test/expect-soft.spec.ts @@ -22,8 +22,8 @@ test('soft expects should compile', async ({ runTSC }) => { import { test, expect } from '@playwright/test'; test('should work', () => { test.expect.soft(1+1).toBe(3); - test.expect.soft(1+1, 'custom error message').toBe(3); - test.expect.soft(1+1, { message: 'custom error message' }).toBe(3); + test.expect.soft(1+1, 'custom expect message').toBe(3); + test.expect.soft(1+1, { message: 'custom expect message' }).toBe(3); }); ` }); diff --git a/tests/playwright-test/expect-to-pass.spec.ts b/tests/playwright-test/expect-to-pass.spec.ts index 2c73283930..2ad00e0ce7 100644 --- a/tests/playwright-test/expect-to-pass.spec.ts +++ b/tests/playwright-test/expect-to-pass.spec.ts @@ -220,3 +220,43 @@ test('should show intermediate result for toPass that spills over test time', as expect(result.output).toContain('Expected: 2'); expect(result.output).toContain('Received: 3'); }); + +test('should respect timeout in config file when timeout parameter is not passed', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'playwright.config.js': `module.exports = { expect: { toPass: { timeout: 100 } } }`, + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + test('should fail', async () => { + await test.expect(() => { + expect(1).toBe(2); + }).toPass(); + }); + ` + }); + expect(result.exitCode).toBe(1); + expect(result.output).toContain('Timeout 100ms exceeded while waiting on the predicate'); + expect(result.output).toContain('Received: 1'); + expect(result.output).toContain(` + 4 | await test.expect(() => { + `.trim()); +}); + +test('should give priority to timeout parameter over timeout in config file', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'playwright.config.js': `module.exports = { expect: { toPass: { timeout: 100 } } }`, + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + test('should fail', async () => { + await test.expect(() => { + expect(1).toBe(2); + }).toPass({ timeout: 200 }); + }); + ` + }); + expect(result.exitCode).toBe(1); + expect(result.output).toContain('Timeout 200ms exceeded while waiting on the predicate'); + expect(result.output).toContain('Received: 1'); + expect(result.output).toContain(` + 4 | await test.expect(() => { + `.trim()); +}); diff --git a/tests/playwright-test/expect.spec.ts b/tests/playwright-test/expect.spec.ts index 0167dd0e50..9a564532ef 100644 --- a/tests/playwright-test/expect.spec.ts +++ b/tests/playwright-test/expect.spec.ts @@ -16,6 +16,7 @@ import path from 'path'; import { test, expect, parseTestRunnerOutput, stripAnsi } from './playwright-test-fixtures'; +const { spawnAsync } = require('../../packages/playwright-core/lib/utils'); test('should be able to call expect.extend in config', async ({ runInlineTest }) => { const result = await runInlineTest({ @@ -69,26 +70,26 @@ test('should not expand huge arrays', async ({ runInlineTest }) => { expect(result.output.length).toBeLessThan(100000); }); -test('should include custom error message', async ({ runInlineTest }) => { +test('should include custom expect message', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` import { test, expect } from '@playwright/test'; test('custom expect message', () => { - test.expect(1+1, 'one plus one is two!').toEqual(3); + test.expect(1+1, 'one plus one should be two!').toEqual(3); }); ` }); expect(result.exitCode).toBe(1); expect(result.passed).toBe(0); expect(result.output).toContain([ - ` Error: one plus one is two!\n`, + ` Error: one plus one should be two!\n`, ` expect(received).toEqual(expected) // deep equality\n`, ` Expected: 3`, ` Received: 2`, ].join('\n')); }); -test('should include custom error message with web-first assertions', async ({ runInlineTest }) => { +test('should include custom expect message with web-first assertions', async ({ runInlineTest }) => { const result = await runInlineTest({ 'expect-test.spec.ts': ` import { test, expect } from '@playwright/test'; @@ -223,6 +224,20 @@ test('should compile generic matchers', async ({ runTSC }) => { expect(result.exitCode).toBe(0); }); +test('should work when passing a ReadonlyArray', async ({ runTSC }) => { + const result = await runTSC({ + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + test('example', async ({ page }) => { + const readonlyArray: ReadonlyArray = ['1', '2', '3']; + expect(page.locator('.foo')).toHaveText(readonlyArray); + await page.locator('.foo').setInputFiles(readonlyArray); + }); + ` + }); + expect(result.exitCode).toBe(0); +}); + test('should work with expect message', async ({ runTSC }) => { const result = await runTSC({ 'a.spec.ts': ` @@ -713,7 +728,7 @@ test('should chain expect matchers and expose matcher utils (TSC)', async ({ run const result = await runTSC({ 'a.spec.ts': ` import { test, expect as baseExpect } from '@playwright/test'; - import type { Page, Locator } from '@playwright/test'; + import type { Page, Locator, ExpectMatcherState, Expect } from '@playwright/test'; function callLogText(log: string[] | undefined): string { if (!log) @@ -721,8 +736,15 @@ test('should chain expect matchers and expose matcher utils (TSC)', async ({ run return log.join('\\n'); } + const dummy: Expect = baseExpect; + const dummy2: Expect<{}> = baseExpect; + const expect = baseExpect.extend({ async toHaveAmount(locator: Locator, expected: string, options?: { timeout?: number }) { + // Make sure "this" is inferred as ExpectMatcherState. + const self: ExpectMatcherState = this; + const self2: ReturnType = self; + const baseAmount = locator.locator('.base-amount'); let pass: boolean; @@ -943,3 +965,38 @@ test('should support mergeExpects', async ({ runInlineTest }) => { expect(result.passed).toBe(1); expect(result.exitCode).toBe(0); }); + +test('should respect timeout from configured expect when used outside of the test runner', async ({ runInlineTest, writeFiles, runTSC }) => { + + const files = { + 'script.mjs': ` + import { test, expect as baseExpect, chromium } from '@playwright/test'; + + const configuredExpect = baseExpect.configure({ + timeout: 10, + }); + + let browser; + try { + browser = await chromium.launch(); + const context = await browser.newContext(); + const page = await context.newPage(); + await configuredExpect(page.getByTestId("does-not-exist")).toBeAttached(); + } catch(e) { + console.error(e); + process.exit(1); + } + finally { + await browser?.close(); + } + + ` + }; + const baseDir = await writeFiles(files); + const { code, stdout, stderr } = await spawnAsync('node', ['script.mjs'], { stdio: 'pipe', cwd: baseDir }); + + + expect(code).toBe(1); + expect(stdout).toBe(''); + expect(stripAnsi(stderr)).toContain('Timed out 10ms waiting for expect(locator).toBeAttached()'); +}); diff --git a/tests/playwright-test/find-related-tests.spec.ts b/tests/playwright-test/find-related-tests.spec.ts new file mode 100644 index 0000000000..981395ade1 --- /dev/null +++ b/tests/playwright-test/find-related-tests.spec.ts @@ -0,0 +1,88 @@ +/** + * Copyright 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-test-fixtures'; +import path from 'path'; + +export const ctReactCliEntrypoint = path.join(__dirname, '../../packages/playwright-ct-react/cli.js'); + +test('should list related tests', async ({ runCLICommand }) => { + const result = await runCLICommand({ + 'playwright.config.ts': ` + import { defineConfig } from '@playwright/test'; + export default defineConfig({}); + `, + 'helper.ts': ` + export const value = 42; + `, + 'helper2.ts': ` + export { value } from './helper'; + `, + 'a.spec.ts': ` + import { test } from '@playwright/test'; + import { value } from './helper2'; + if (value) {} + test('', () => {}); + `, + 'b.spec.ts': ` + import { test } from '@playwright/test'; + import { value } from './helper'; + if (value) {} + test('', () => {}); + `, + }, 'find-related-test-files', ['helper.ts']); + expect(result.exitCode).toBe(0); + expect(result.stderr).toBeFalsy(); + const data = JSON.parse(result.stdout); + expect(data).toEqual({ + testFiles: [ + expect.stringContaining('a.spec.ts'), + expect.stringContaining('b.spec.ts'), + ] + }); +}); + +test('should list related tests for ct', async ({ runCLICommand }) => { + const result = await runCLICommand({ + 'playwright.config.ts': ` + import { defineConfig } from '@playwright/experimental-ct-react'; + export default defineConfig({}); + `, + 'playwright/index.html': ``, + 'playwright/index.js': ``, + 'helper.tsx': ` + export const HelperButton = () => ; + `, + 'button.tsx': ` + import { HelperButton } from './helper'; + export const Button = () => Click me; + `, + 'button.spec.tsx': ` + import { test } from '@playwright/experimental-ct-react'; + import { Button } from './button'; + test('foo', async ({ mount }) => { + await mount(; `, @@ -311,7 +265,7 @@ test('should grow cache', async ({ runInlineTest }, testInfo) => { await test.step('original test', async () => { const result = await runInlineTest({ - 'playwright.config.ts': playwrightConfig, + 'playwright.config.ts': playwrightCtConfigText, 'playwright/index.html': ``, 'playwright/index.ts': ``, 'src/button1.tsx': ` @@ -346,7 +300,7 @@ test('should grow cache', async ({ runInlineTest }, testInfo) => { await test.step('run second test', async () => { const result = await runInlineTest({ - 'playwright.config.ts': playwrightConfig, + 'playwright.config.ts': playwrightCtConfigText, }, { workers: 1 }, undefined, { additionalArgs: ['button2'] }); expect(result.exitCode).toBe(0); expect(result.passed).toBe(1); @@ -356,7 +310,7 @@ test('should grow cache', async ({ runInlineTest }, testInfo) => { await test.step('run first test again', async () => { const result = await runInlineTest({ - 'playwright.config.ts': playwrightConfig, + 'playwright.config.ts': playwrightCtConfigText, }, { workers: 1 }, undefined, { additionalArgs: ['button2'] }); expect(result.exitCode).toBe(0); expect(result.passed).toBe(1); @@ -367,7 +321,7 @@ test('should grow cache', async ({ runInlineTest }, testInfo) => { test('should not use global config for preview', async ({ runInlineTest }) => { const result1 = await runInlineTest({ - 'playwright.config.ts': playwrightConfig, + 'playwright.config.ts': playwrightCtConfigText, 'playwright/index.html': ``, 'playwright/index.js': ``, 'vite.config.js': ` @@ -388,7 +342,7 @@ test('should not use global config for preview', async ({ runInlineTest }) => { expect(result1.passed).toBe(1); const result2 = await runInlineTest({ - 'playwright.config.ts': playwrightConfig, + 'playwright.config.ts': playwrightCtConfigText, }, { workers: 1 }); expect(result2.exitCode).toBe(0); expect(result2.passed).toBe(1); @@ -427,7 +381,7 @@ test('should work with https enabled', async ({ runInlineTest }) => { test('list compilation cache should not clash with the run one', async ({ runInlineTest }) => { const listResult = await runInlineTest({ - 'playwright.config.ts': playwrightConfig, + 'playwright.config.ts': playwrightCtConfigText, 'playwright/index.html': ``, 'playwright/index.ts': ``, 'src/button.tsx': ` @@ -455,7 +409,7 @@ test('should retain deps when test changes', async ({ runInlineTest }, testInfo) await test.step('original test', async () => { const result = await runInlineTest({ - 'playwright.config.ts': playwrightConfig, + 'playwright.config.ts': playwrightCtConfigText, 'playwright/index.html': ``, 'playwright/index.ts': ``, 'src/button.tsx': ` @@ -497,26 +451,160 @@ test('should retain deps when test changes', async ({ runInlineTest }, testInfo) const metainfo = JSON.parse(fs.readFileSync(testInfo.outputPath('playwright/.cache/metainfo.json'), 'utf-8')); expect(metainfo.components).toEqual([{ - fullName: expect.stringContaining('playwright_test_src_button_tsx_Button'), - importedName: 'Button', - importedNameProperty: '', - importPath: expect.stringContaining('button.tsx'), - isModuleOrAlias: false, - deps: [ - expect.stringContaining('button.tsx'), - expect.stringContaining('jsx-runtime.js'), - ] + id: expect.stringContaining('button_tsx_Button'), + remoteName: 'Button', + importSource: expect.stringContaining('button.tsx'), + filename: expect.stringContaining('button.test.tsx'), }]); - expect(Object.entries(metainfo.tests)).toEqual([ + for (const [, value] of Object.entries(metainfo.deps)) + (value as string[]).sort(); + + expect(Object.entries(metainfo.deps)).toEqual([ [ - expect.stringContaining('button.test.tsx'), - { - components: [ - expect.stringContaining('src_button_tsx_Button'), - ], - timestamp: expect.any(Number) - } + expect.stringContaining('button.tsx'), + [ + expect.stringContaining('jsx-runtime.js'), + expect.stringContaining('button.tsx'), + ], ] ]); }); + +test('should render component via re-export', async ({ runInlineTest }, testInfo) => { + const result = await runInlineTest({ + 'playwright.config.ts': playwrightCtConfigText, + 'playwright/index.html': ``, + 'playwright/index.ts': ``, + 'src/button.tsx': ` + export const Button = () => ; + `, + 'src/buttonHelper.ts': ` + import { Button } from './button.tsx'; + export { Button }; + `, + 'src/button.test.tsx': ` + import { test, expect } from '@playwright/experimental-ct-react'; + import { Button } from './buttonHelper'; + test('pass', async ({ mount }) => { + const component = await mount(); + await expect(component).toHaveText('Button'); + }); + `, + }, { workers: 1 }); + + expect(result.exitCode).toBe(0); + expect(result.passed).toBe(1); +}); + +test('should render component exported via fixture', async ({ runInlineTest }, testInfo) => { + const result = await runInlineTest({ + 'playwright.config.ts': playwrightCtConfigText, + 'playwright/index.html': ``, + 'playwright/index.ts': ``, + 'src/button.tsx': ` + export const Button = () => ; + `, + 'src/buttonFixture.tsx': ` + import { Button } from './button'; + import { test as baseTest } from '@playwright/experimental-ct-react'; + export { expect } from '@playwright/experimental-ct-react'; + export const test = baseTest.extend({ + button: async ({ mount }, use) => { + await use(await mount()); + } + }); + `, + 'src/button.test.tsx': ` + import { test, expect } from './buttonFixture'; + test('pass', async ({ button }) => { + await expect(button).toHaveText('Button'); + }); + `, + }, { workers: 1 }); + + expect(result.exitCode).toBe(0); + expect(result.passed).toBe(1); +}); + +test('should pass imported images from test to component', async ({ runInlineTest }, testInfo) => { + const result = await runInlineTest({ + 'playwright.config.ts': playwrightCtConfigText, + 'playwright/index.html': ``, + 'playwright/index.ts': ``, + 'src/image.png': Buffer.from('iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAACMElEQVRYw+1XT0tCQRD/9Qci0Cw7mp1C6BMYnt5niMhPEEFCh07evNk54XnuGkhFehA/QxHkqYMEFWXpscMTipri7fqeu+vbfY+EoBkQ3Zn5zTo7MzsL/NNfoClkUUQNN3jCJ/ETfavRSpYkkSmFQzz8wMr4gaSp8OBJ2HCU4Iwd0kqGgd9GPxCccZ+0jWgWVW1wxlWy0qR51I3hv7lOllq7b4SC/+aGzr+QBadjEKgAykvzJGXwr/Lj4JfRk5hUSLKIa00HPUJRki0xeMWSWxVXmi5sddXKymqTyxdwquXAUVV3WREeLx3gTcNFWQY/jXtB8QIzgt4qTvAR4OCe0ATKCmrnmFMEM0Pp2BvrIisaFUdUjgKKZgYWSjjDLR5J+x13lATHuHSti6JBzQP+gq2QHXjfRaiJojbPgYqbmGFow0VpiyIW0/VIF9QKLzeBWA2MHmwCu8QJQV++Ps/joHQQH4HpuO0uobUeVztgIcr4Vnf4we9orWfUIWKHbEVyYKkPmaVpIVKICuo0ZYXWjHTITXWhsVYxkIDpUoKsla1i2Oz2QjvYG9fshu36GbFQ8DGyHNOuvRdOKZSDUtCFM7wyHeSM4XN8e7bOpd9F2gg+TRYal753bGkbuEjzMg0YW/yDV1czUDm+e43Byz86OnRwsYDMKXlmkYbeAOwffrtU/nGpXpwkXfPhVza+D9AiMAtrtOMYfVr0q8Wr1nh8n8ADZCJPqAk8AifyjP2n36cvkA6/Wln9MokAAAAASUVORK5CYII=', 'base64'), + 'src/image.test.tsx': ` + import { test, expect } from '@playwright/experimental-ct-react'; + import imageSrc from './image.png'; + test('pass', async ({ mount }) => { + const component = await mount(); + await expect(component).toHaveJSProperty('naturalWidth', 48); + }); + `, + }, { workers: 1 }); + + expect(result.exitCode).toBe(0); + expect(result.passed).toBe(1); +}); + +test('should pass dates, regex, urls and bigints', async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'playwright.config.ts': playwrightCtConfigText, + 'playwright/index.html': ``, + 'playwright/index.ts': ``, + 'src/button.tsx': ` + export const Button = ({ props }: any) => { + const { date, url, bigint, regex } = props; + const types = [ + date instanceof Date, + url instanceof URL, + typeof bigint === 'bigint', + regex instanceof RegExp, + ]; + return
{types.join(' ')}
; + }; + `, + 'src/component.spec.tsx': ` + import { test, expect } from '@playwright/experimental-ct-react'; + import { Button } from './button'; + + test('renders props with builtin types', async ({ mount, page }) => { + const component = await mount(; + `, + }); + await expect.poll(dumpTestTree(page)).toBe(` + ▼ ◯ button.test.tsx + ◯ pass + `); + + await page.getByTitle('Watch all').click(); + await page.getByTitle('Run all').click(); + + await expect.poll(dumpTestTree(page)).toBe(` + ▼ ✅ button.test.tsx + ✅ pass + `); + + await writeFiles({ + 'src/buttonComponent.tsx': ` + export const Button = () => ; + ` + }); + + await expect.poll(dumpTestTree(page)).toBe(` + ▼ ❌ button.test.tsx + ❌ pass <= + `); +}); + +test('should watch component when editing util', async ({ runUITest, writeFiles }) => { + const { page } = await runUITest({ + ...basicTestTree, + 'src/button.tsx': undefined, + 'src/button.ts': ` + import { Button } from './buttonComponent'; + export { Button }; + `, + 'src/buttonComponent.tsx': ` + export const Button = () => ; + `, + 'src/buttonComponent2.tsx': ` + export const Button = () => ; + `, + }); + await expect.poll(dumpTestTree(page)).toBe(` + ▼ ◯ button.test.tsx + ◯ pass + `); + + await page.getByTitle('Watch all').click(); + await page.getByTitle('Run all').click(); + + await expect.poll(dumpTestTree(page)).toBe(` + ▼ ✅ button.test.tsx + ✅ pass + `); + + await writeFiles({ + 'src/button.ts': ` + import { Button } from './buttonComponent2'; + export { Button }; + `, + }); + + await expect.poll(dumpTestTree(page)).toBe(` + ▼ ❌ button.test.tsx + ❌ pass <= + `); +}); diff --git a/tests/playwright-test/ui-mode-test-progress.spec.ts b/tests/playwright-test/ui-mode-test-progress.spec.ts index 38091dcd93..f87eaa8fbc 100644 --- a/tests/playwright-test/ui-mode-test-progress.spec.ts +++ b/tests/playwright-test/ui-mode-test-progress.spec.ts @@ -288,3 +288,63 @@ test('should show live trace for serial', async ({ runUITest, server, createLatc /expect.not.toBeCheckedlocator\('input'\)[\d.]/, ]); }); + +test('should show live trace from hooks', async ({ runUITest, createLatch }) => { + const latch1 = createLatch(); + const latch2 = createLatch(); + + const { page } = await runUITest({ + 'a.test.ts': ` + import { test, expect } from '@playwright/test'; + test.beforeAll(async ({ browser }) => { + const page = await browser.newPage(); + ${latch1.blockingCode} + await page.close(); + }); + test.beforeEach(async ({ browser }) => { + const page = await browser.newPage(); + ${latch2.blockingCode} + await page.close(); + }); + test('test one', async ({ page }) => { + await page.setContent('Page content'); + }); + `, + }); + + await expect.poll(dumpTestTree(page)).toBe(` + ▼ ◯ a.test.ts + ◯ test one + `); + await page.getByText('test one').dblclick(); + + const listItem = page.getByTestId('actions-tree').getByRole('listitem'); + await expect( + listItem, + 'action list' + ).toHaveText([ + /Before Hooks/, + /beforeAll hook/, + /fixture: browser/, + /browser.newPage/, + ]); + latch1.open(); + await expect( + listItem, + 'action list' + ).toHaveText([ + /Before Hooks/, + /beforeAll hook/, + /beforeEach hook/, + /browser.newPage/, + ]); + latch2.open(); + await expect( + listItem, + 'action list' + ).toHaveText([ + /Before Hooks/, + /page.setContent/, + /After Hooks/, + ]); +}); diff --git a/tests/playwright-test/ui-mode-test-source.spec.ts b/tests/playwright-test/ui-mode-test-source.spec.ts index 8e7a35f5db..5d2973a8cf 100644 --- a/tests/playwright-test/ui-mode-test-source.spec.ts +++ b/tests/playwright-test/ui-mode-test-source.spec.ts @@ -97,7 +97,7 @@ test('should show top-level errors in file', async ({ runUITest }) => { page.locator('.CodeMirror-linewidget') ).toHaveText([ '            ', - 'Assignment to constant variable.' + 'TypeError: Assignment to constant variable.' ]); }); diff --git a/tests/playwright-test/ui-mode-trace.spec.ts b/tests/playwright-test/ui-mode-trace.spec.ts index 68b1bd1d97..215afe1d2b 100644 --- a/tests/playwright-test/ui-mode-trace.spec.ts +++ b/tests/playwright-test/ui-mode-trace.spec.ts @@ -19,7 +19,7 @@ import { test, expect, retries } from './ui-mode-fixtures'; test.describe.configure({ mode: 'parallel', retries }); -test('should merge trace events', async ({ runUITest, server }) => { +test('should merge trace events', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` import { test, expect } from '@playwright/test'; @@ -99,7 +99,7 @@ test('should merge screenshot assertions', async ({ runUITest }, testInfo) => { ]); }); -test('should locate sync assertions in source', async ({ runUITest, server }) => { +test('should locate sync assertions in source', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` import { test, expect } from '@playwright/test'; @@ -118,7 +118,7 @@ test('should locate sync assertions in source', async ({ runUITest, server }) => ).toHaveText('4 expect(1).toBe(1);'); }); -test('should show snapshots for sync assertions', async ({ runUITest, server }) => { +test('should show snapshots for sync assertions', async ({ runUITest }) => { const { page } = await runUITest({ 'a.test.ts': ` import { test, expect } from '@playwright/test'; @@ -150,7 +150,7 @@ test('should show snapshots for sync assertions', async ({ runUITest, server }) ).toHaveText('Submit'); }); -test('should show image diff', async ({ runUITest, server }) => { +test('should show image diff', async ({ runUITest }) => { const { page } = await runUITest({ 'playwright.config.js': ` module.exports = { @@ -172,10 +172,10 @@ test('should show image diff', async ({ runUITest, server }) => { await expect(page.getByText('Diff', { exact: true })).toBeVisible(); await expect(page.getByText('Actual', { exact: true })).toBeVisible(); await expect(page.getByText('Expected', { exact: true })).toBeVisible(); - await expect(page.locator('.image-diff-view .image-wrapper img')).toBeVisible(); + await expect(page.getByTestId('test-result-image-mismatch').locator('img')).toBeVisible(); }); -test('should show screenshot', async ({ runUITest, server }) => { +test('should show screenshot', async ({ runUITest }) => { const { page } = await runUITest({ 'playwright.config.js': ` module.exports = { @@ -197,3 +197,90 @@ test('should show screenshot', async ({ runUITest, server }) => { await expect(page.getByText('Screenshots', { exact: true })).toBeVisible(); await expect(page.locator('.attachment-item img')).toHaveCount(1); }); + +test('should not fail on internal page logs', async ({ runUITest, server }) => { + const { page } = await runUITest({ + 'a.test.ts': ` + import { test, expect } from '@playwright/test'; + test('pass', async ({ browser }, testInfo) => { + const context = await browser.newContext({ storageState: { cookies: [], origins: [] } }); + const page = await context.newPage(); + await page.goto("${server.EMPTY_PAGE}"); + await page.context().storageState({ path: testInfo.outputPath('storage.json') }); + }); + `, + }); + + await page.getByText('pass').dblclick(); + const listItem = page.getByTestId('actions-tree').getByRole('listitem'); + + await expect( + listItem, + 'action list' + ).toHaveText([ + /Before Hooks[\d.]+m?s/, + /browser.newContext[\d.]+m?s/, + /browserContext.newPage[\d.]+m?s/, + /page.goto/, + /browserContext.storageState[\d.]+m?s/, + /After Hooks/, + ]); +}); + +test('should not show caught errors in the errors tab', async ({ runUITest }, testInfo) => { + const { page } = await runUITest({ + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + test('pass', async ({ page }, testInfo) => { + await page.setContent(""); + await expect(page.locator('input')).toBeChecked({ timeout: 1 }).catch(() => {}); + }); + `, + }); + + await page.getByText('pass').dblclick(); + const listItem = page.getByTestId('actions-tree').getByRole('listitem'); + + await expect( + listItem, + 'action list' + ).toHaveText([ + /Before Hooks[\d.]+m?s/, + /page.setContent/, + /expect.toBeCheckedlocator.*[\d.]+m?s/, + /After Hooks/, + ]); + + await page.getByText('Source', { exact: true }).click(); + await expect(page.locator('.source-line-running')).toContainText('toBeChecked'); + await expect(page.locator('.CodeMirror-linewidget')).toHaveCount(0); + + await page.getByText('Errors', { exact: true }).click(); + await expect(page.locator('.tab-errors')).toHaveText('No errors'); +}); + +test('should reveal errors in the sourcetab', async ({ runUITest }) => { + const { page } = await runUITest({ + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + test('pass', async ({ page }) => { + throw new Error('Oh my'); + }); + `, + }); + + await page.getByText('pass').dblclick(); + const listItem = page.getByTestId('actions-tree').getByRole('listitem'); + + await expect( + listItem, + 'action list' + ).toContainText([ + /Before Hooks/, + /After Hooks/, + ]); + + await page.getByText('Errors', { exact: true }).click(); + await page.getByText('a.spec.ts:4', { exact: true }).click(); + await expect(page.locator('.source-line-running')).toContainText(`throw new Error('Oh my');`); +}); diff --git a/tests/playwright-test/watch.spec.ts b/tests/playwright-test/watch.spec.ts index 5239d9fd97..c4b978819f 100644 --- a/tests/playwright-test/watch.spec.ts +++ b/tests/playwright-test/watch.spec.ts @@ -15,7 +15,7 @@ */ import path from 'path'; -import { test, expect } from './playwright-test-fixtures'; +import { test, expect, playwrightCtConfigText } from './playwright-test-fixtures'; test.describe.configure({ mode: 'parallel' }); @@ -563,10 +563,7 @@ test('should not watch unfiltered files', async ({ runWatchTest, writeFiles }) = test('should run CT on changed deps', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ - 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; - export default defineConfig({ projects: [{name: 'default'}] }); - `, + 'playwright.config.ts': playwrightCtConfigText, 'playwright/index.html': ``, 'playwright/index.ts': ``, 'src/button.tsx': ` @@ -606,10 +603,7 @@ test('should run CT on changed deps', async ({ runWatchTest, writeFiles }) => { test('should run CT on indirect deps change', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ - 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; - export default defineConfig({ projects: [{name: 'default'}] }); - `, + 'playwright.config.ts': playwrightCtConfigText, 'playwright/index.html': ``, 'playwright/index.ts': ``, 'src/button.css': ` @@ -652,10 +646,7 @@ test('should run CT on indirect deps change', async ({ runWatchTest, writeFiles test('should run CT on indirect deps change ESM mode', async ({ runWatchTest, writeFiles }) => { const testProcess = await runWatchTest({ - 'playwright.config.ts': ` - import { defineConfig } from '@playwright/experimental-ct-react'; - export default defineConfig({ projects: [{name: 'default'}] }); - `, + 'playwright.config.ts': playwrightCtConfigText, 'package.json': `{ "type": "module" }`, 'playwright/index.html': ``, 'playwright/index.ts': ``, diff --git a/tests/playwright-test/web-server.spec.ts b/tests/playwright-test/web-server.spec.ts index 5fac838dac..0cadbddad8 100644 --- a/tests/playwright-test/web-server.spec.ts +++ b/tests/playwright-test/web-server.spec.ts @@ -661,7 +661,7 @@ test('should check ipv4 and ipv6 with happy eyeballs when URL is passed', async expect(result.exitCode).toBe(0); expect(result.passed).toBe(1); expect(result.output).toContain('Process started'); - expect(result.output).toContain(`HTTP GET: http://localhost:${port}/`); + expect(result.output).toContain(`HTTP HEAD: http://localhost:${port}/`); expect(result.output).toContain('WebServer available'); }); diff --git a/tests/stress/frames.spec.ts b/tests/stress/frames.spec.ts new file mode 100644 index 0000000000..a438ec689f --- /dev/null +++ b/tests/stress/frames.spec.ts @@ -0,0 +1,60 @@ +/** + * 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 { contextTest as test, expect } from '../config/browserTest'; + +test.slow(); + +test('cycle frames', async ({ page, server }) => { + require('../../packages/playwright-core/lib/server/dispatchers/dispatcher').setMaxDispatchersForTest(100); + + const kFrameCount = 310; + + await page.goto(server.EMPTY_PAGE); + let cb; + const promise = new Promise(f => cb = f); + let counter = 0; + page.on('frameattached', async () => { + // Make sure we can access page. + await page.title(); + if (++counter === kFrameCount) + cb(); + }); + + page.evaluate(async ({ url, count }) => { + for (let i = 0; i < count; i++) { + const frame = document.createElement('iframe'); + frame.src = url; + document.body.appendChild(frame); + await new Promise(f => setTimeout(f, 10)); + frame.remove(); + } + }, { url: server.PREFIX + '/one-style.html', count: kFrameCount }).catch(() => {}); + await promise; + await page.waitForTimeout(500); + + require('../../packages/playwright-core/lib/server/dispatchers/dispatcher').setMaxDispatchersForTest(null); +}); + +test('cycle handles', async ({ page, server }) => { + await page.goto(server.EMPTY_PAGE); + await page.setContent(`
hi
`.repeat(2000)); + const divs = await page.$$('div'); + for (const div of divs) { + const span = await div.$('span'); + expect(await span.textContent()).toBe('hi'); + } +}); diff --git a/tests/third_party/proxy/LICENSE b/tests/third_party/proxy/LICENSE new file mode 100644 index 0000000000..008728cb51 --- /dev/null +++ b/tests/third_party/proxy/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/third_party/proxy/README.md b/tests/third_party/proxy/README.md new file mode 100644 index 0000000000..56e3febfab --- /dev/null +++ b/tests/third_party/proxy/README.md @@ -0,0 +1,4 @@ +This folder contains the [proxy](https://github.com/TooTallNate/proxy-agents) +library vendored at commit `c881a1804197b89580320b87082971c3c6a61746` with the following modifications: + +- https://github.com/TooTallNate/proxy-agents/pull/270 \ No newline at end of file diff --git a/tests/third_party/proxy/index.ts b/tests/third_party/proxy/index.ts new file mode 100644 index 0000000000..2fc842fa2e --- /dev/null +++ b/tests/third_party/proxy/index.ts @@ -0,0 +1,468 @@ +import assert from 'assert'; +import * as net from 'net'; +import * as url from 'url'; +import * as http from 'http'; +import * as os from 'os'; + +const pkg = { version: '1.0.0' } + +import createDebug from 'debug'; + +// log levels +const debug = { + request: createDebug('proxy ← ← ←'), + response: createDebug('proxy → → →'), + proxyRequest: createDebug('proxy ↑ ↑ ↑'), + proxyResponse: createDebug('proxy ↓ ↓ ↓'), +}; + +// hostname +const hostname = os.hostname(); + +export interface ProxyServer extends http.Server { + authenticate?: (req: http.IncomingMessage) => boolean | Promise; + localAddress?: string; +} + +/** + * Sets up an `http.Server` or `https.Server` instance with the necessary + * "request" and "connect" event listeners in order to make the server act + * as an HTTP proxy. + */ +export function createProxy(server?: http.Server): ProxyServer { + if (!server) server = http.createServer(); + server.on('request', onrequest); + server.on('connect', onconnect); + return server; +} + +/** + * 13.5.1 End-to-end and Hop-by-hop Headers + * + * Hop-by-hop headers must be removed by the proxy before passing it on to the + * next endpoint. Per-request basis hop-by-hop headers MUST be listed in a + * Connection header, (section 14.10) to be introduced into HTTP/1.1 (or later). + */ +const hopByHopHeaders = [ + 'Connection', + 'Keep-Alive', + 'Proxy-Authenticate', + 'Proxy-Authorization', + 'TE', + 'Trailers', + 'Transfer-Encoding', + 'Upgrade', +]; + +// create a case-insensitive RegExp to match "hop by hop" headers +const isHopByHop = new RegExp('^(' + hopByHopHeaders.join('|') + ')$', 'i'); + +/** + * Iterator function for the request/response's "headers". + */ +function* eachHeader(obj: http.IncomingMessage) { + // every even entry is a "key", every odd entry is a "value" + let key: string | null = null; + for (const v of obj.rawHeaders) { + if (key === null) { + key = v; + } else { + yield [key, v]; + key = null; + } + } +} + +/** + * HTTP GET/POST/DELETE/PUT, etc. proxy requests. + */ +async function onrequest( + this: ProxyServer, + req: http.IncomingMessage, + res: http.ServerResponse +) { + debug.request('%s %s HTTP/%s ', req.method, req.url, req.httpVersion); + const socket = req.socket; + + // pause the socket during authentication so no data is lost + socket.pause(); + + try { + const success = await authenticate(this, req); + if (!success) return requestAuthorization(req, res); + } catch (_err: unknown) { + const err = _err as Error; + // an error occured during login! + res.writeHead(500); + res.end((err.stack || err.message || err) + '\n'); + return; + } + + socket.resume(); + const parsed = url.parse(req.url || '/'); + + // setup outbound proxy request HTTP headers + const headers: http.OutgoingHttpHeaders = {}; + let hasXForwardedFor = false; + let hasVia = false; + const via = '1.1 ' + hostname + ' (proxy/' + pkg.version + ')'; + + for (const header of eachHeader(req)) { + debug.request('Request Header: %o', header); + const key = header[0]; + let value = header[1]; + const keyLower = key.toLowerCase(); + + if (!hasXForwardedFor && 'x-forwarded-for' === keyLower) { + // append to existing "X-Forwarded-For" header + // http://en.wikipedia.org/wiki/X-Forwarded-For + hasXForwardedFor = true; + if (typeof socket.remoteAddress === 'string') { + value += ', ' + socket.remoteAddress; + debug.proxyRequest( + 'appending to existing "%s" header: "%s"', + key, + value + ); + } + } + + if (!hasVia && 'via' === keyLower) { + // append to existing "Via" header + hasVia = true; + value += ', ' + via; + debug.proxyRequest( + 'appending to existing "%s" header: "%s"', + key, + value + ); + } + + if (isHopByHop.test(key)) { + debug.proxyRequest('ignoring hop-by-hop header "%s"', key); + } else { + const v = headers[key] as string; + if (Array.isArray(v)) { + v.push(value); + } else if (null != v) { + headers[key] = [v, value]; + } else { + headers[key] = value; + } + } + } + + // add "X-Forwarded-For" header if it's still not here by now + // http://en.wikipedia.org/wiki/X-Forwarded-For + if (!hasXForwardedFor && typeof socket.remoteAddress === 'string') { + headers['X-Forwarded-For'] = socket.remoteAddress; + debug.proxyRequest( + 'adding new "X-Forwarded-For" header: "%s"', + headers['X-Forwarded-For'] + ); + } + + // add "Via" header if still not set by now + if (!hasVia) { + headers.Via = via; + debug.proxyRequest('adding new "Via" header: "%s"', headers.Via); + } + + // custom `http.Agent` support, set `server.agent` + //let agent = server.agent; + //if (null != agent) { + // debug.proxyRequest( + // 'setting custom `http.Agent` option for proxy request: %s', + // agent + // ); + // parsed.agent = agent; + // agent = null; + //} + + //if (!parsed.port) { + // // default the port number if not specified, for >= node v0.11.6... + // // https://github.com/joyent/node/issues/6199 + // parsed.port = 80; + //} + + if (parsed.protocol !== 'http:') { + // only "http://" is supported, "https://" should use CONNECT method + res.writeHead(400); + res.end( + `Only "http:" protocol prefix is supported (got: "${parsed.protocol}")\n` + ); + return; + } + + let gotResponse = false; + const proxyReq = http.request({ + ...parsed, + method: req.method, + headers, + localAddress: this.localAddress, + }); + debug.proxyRequest('%s %s HTTP/1.1 ', proxyReq.method, proxyReq.path); + + proxyReq.on('response', function (proxyRes) { + debug.proxyResponse('HTTP/1.1 %s', proxyRes.statusCode); + gotResponse = true; + + const headers: http.OutgoingHttpHeaders = {}; + for (const [key, value] of eachHeader(proxyRes)) { + debug.proxyResponse('Proxy Response Header: "%s: %s"', key, value); + if (isHopByHop.test(key)) { + debug.response('ignoring hop-by-hop header "%s"', key); + } else { + const v = headers[key] as string; + if (Array.isArray(v)) { + v.push(value); + } else if (null != v) { + headers[key] = [v, value]; + } else { + headers[key] = value; + } + } + } + + debug.response('HTTP/1.1 %s', proxyRes.statusCode); + res.writeHead(proxyRes.statusCode || 200, headers); + proxyRes.pipe(res); + res.on('finish', onfinish); + }); + + proxyReq.on('error', function (err: NodeJS.ErrnoException) { + debug.proxyResponse( + 'proxy HTTP request "error" event\n%s', + err.stack || err + ); + cleanup(); + if (gotResponse) { + debug.response( + 'already sent a response, just destroying the socket...' + ); + socket.destroy(); + } else if ('ENOTFOUND' == err.code) { + debug.response('HTTP/1.1 404 Not Found'); + res.writeHead(404); + res.end(); + } else { + debug.response('HTTP/1.1 500 Internal Server Error'); + res.writeHead(500); + res.end(); + } + }); + + // if the client closes the connection prematurely, + // then close the upstream socket + function onclose() { + debug.request( + 'client socket "close" event, aborting HTTP request to "%s"', + req.url + ); + proxyReq.abort(); + cleanup(); + } + socket.on('close', onclose); + + function onfinish() { + debug.response('"finish" event'); + cleanup(); + } + + function cleanup() { + debug.response('cleanup'); + socket.removeListener('close', onclose); + res.removeListener('finish', onfinish); + } + + req.pipe(proxyReq); +} + +/** + * HTTP CONNECT proxy requests. + */ +async function onconnect( + this: ProxyServer, + req: http.IncomingMessage, + socket: net.Socket, + head: Buffer +) { + debug.request('%s %s HTTP/%s ', req.method, req.url, req.httpVersion); + assert( + !head || 0 == head.length, + '"head" should be empty for proxy requests' + ); + + let res: http.ServerResponse | null; + let gotResponse = false; + + // define request socket event listeners + socket.on('close', function onclientclose() { + debug.request('HTTP request %s socket "close" event', req.url); + }); + + socket.on('end', function onclientend() { + debug.request('HTTP request %s socket "end" event', req.url); + }); + + socket.on('error', function onclienterror(err) { + debug.request( + 'HTTP request %s socket "error" event:\n%s', + req.url, + err.stack || err + ); + }); + + // define target socket event listeners + function ontargetclose() { + debug.proxyResponse('proxy target %s "close" event', req.url); + socket.destroy(); + } + + function ontargetend() { + debug.proxyResponse('proxy target %s "end" event', req.url); + } + + function ontargeterror(err: NodeJS.ErrnoException) { + debug.proxyResponse( + 'proxy target %s "error" event:\n%s', + req.url, + err.stack || err + ); + if (gotResponse) { + debug.response( + 'already sent a response, just destroying the socket...' + ); + socket.destroy(); + } else if (err.code === 'ENOTFOUND') { + debug.response('HTTP/1.1 404 Not Found'); + if (res) { + res.writeHead(404); + res.end(); + } + } else { + debug.response('HTTP/1.1 500 Internal Server Error'); + if (res) { + res.writeHead(500); + res.end(); + } + } + } + + function ontargetconnect() { + debug.proxyResponse('proxy target %s "connect" event', req.url); + debug.response('HTTP/1.1 200 Connection established'); + gotResponse = true; + + if (res) { + res.removeListener('finish', onfinish); + + res.writeHead(200, 'Connection established'); + res.flushHeaders(); + + // relinquish control of the `socket` from the ServerResponse instance + res.detachSocket(socket); + + // nullify the ServerResponse object, so that it can be cleaned + // up before this socket proxying is completed + res = null; + } + + socket.on('end', () => target.destroy()); + socket.pipe(target); + target.pipe(socket); + } + + // create the `res` instance for this request since Node.js + // doesn't provide us with one :( + res = new http.ServerResponse(req); + res.shouldKeepAlive = false; + res.chunkedEncoding = false; + res.useChunkedEncodingByDefault = false; + res.assignSocket(socket); + + // called for the ServerResponse's "finish" event + // XXX: normally, node's "http" module has a "finish" event listener that would + // take care of closing the socket once the HTTP response has completed, but + // since we're making this ServerResponse instance manually, that event handler + // never gets hooked up, so we must manually close the socket... + function onfinish() { + debug.response('response "finish" event'); + if (res) { + res.detachSocket(socket); + } + socket.end(); + } + res.once('finish', onfinish); + + // pause the socket during authentication so no data is lost + socket.pause(); + + try { + const success = await authenticate(this, req); + if (!success) return requestAuthorization(req, res); + } catch (_err) { + const err = _err as Error; + // an error occured during login! + res.writeHead(500); + res.end((err.stack || err.message || err) + '\n'); + return; + } + + socket.resume(); + + if (!req.url) { + throw new TypeError('No "url" provided'); + } + + // `req.url` should look like "example.com:443" + const lastColon = req.url.lastIndexOf(':'); + const host = req.url.substring(0, lastColon); + const port = parseInt(req.url.substring(lastColon + 1), 10); + const localAddress = this.localAddress; + const opts = { host: host.replace(/^\[|\]$/g, ''), port, localAddress }; + + debug.proxyRequest('connecting to proxy target %o', opts); + const target = net.connect(opts); + target.on('connect', ontargetconnect); + target.on('close', ontargetclose); + target.on('error', ontargeterror); + target.on('end', ontargetend); +} + +/** + * Checks `Proxy-Authorization` request headers. Same logic applied to CONNECT + * requests as well as regular HTTP requests. + */ +async function authenticate(server: ProxyServer, req: http.IncomingMessage) { + if (typeof server.authenticate === 'function') { + debug.request('authenticating request "%s %s"', req.method, req.url); + return server.authenticate(req); + } + // no `server.authenticate()` function, so just allow the request + return true; +} + +/** + * Sends a "407 Proxy Authentication Required" HTTP response to the `socket`. + */ +function requestAuthorization( + req: http.IncomingMessage, + res: http.ServerResponse +) { + // request Basic proxy authorization + debug.response( + 'requesting proxy authorization for "%s %s"', + req.method, + req.url + ); + + // TODO: make "realm" and "type" (Basic) be configurable... + const realm = 'proxy'; + + const headers = { + 'Proxy-Authenticate': 'Basic realm="' + realm + '"', + }; + res.writeHead(407, headers); + res.end('Proxy authorization required'); +} \ No newline at end of file diff --git a/tests/webview2/globalSetup.ts b/tests/webview2/globalSetup.ts index 4ac3b9e0ba..7d8a340d9c 100644 --- a/tests/webview2/globalSetup.ts +++ b/tests/webview2/globalSetup.ts @@ -19,7 +19,7 @@ import playwright from 'playwright'; export default async () => { const cdpPort = 9876; - const spawnedProcess = childProcess.spawn(path.join(__dirname, 'webview2-app/bin/Debug/net6.0-windows/webview2.exe'), { + const spawnedProcess = childProcess.spawn(path.join(__dirname, 'webview2-app/bin/Debug/net8.0-windows/webview2.exe'), { shell: true, env: { ...process.env, diff --git a/tests/webview2/webView2Test.ts b/tests/webview2/webView2Test.ts index 38a6c4ca1e..b72f57ce93 100644 --- a/tests/webview2/webView2Test.ts +++ b/tests/webview2/webView2Test.ts @@ -35,7 +35,7 @@ export const webView2Test = baseTest.extend(traceViewerFixt browser: [async ({ playwright }, use, testInfo) => { const cdpPort = 10000 + testInfo.workerIndex; const spawnedProcess = new TestChildProcess({ - command: [path.join(__dirname, 'webview2-app/bin/Debug/net6.0-windows/webview2.exe')], + command: [path.join(__dirname, 'webview2-app/bin/Debug/net8.0-windows/webview2.exe')], shell: true, env: { ...process.env, diff --git a/tests/webview2/webview2-app/webview2.csproj b/tests/webview2/webview2-app/webview2.csproj index ef2fc1b782..84849567c4 100644 --- a/tests/webview2/webview2-app/webview2.csproj +++ b/tests/webview2/webview2-app/webview2.csproj @@ -2,14 +2,14 @@ WinExe - net6.0-windows + net8.0-windows enable true enable - + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 913e039570..733973760a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,6 +29,7 @@ "noEmit": true, "noImplicitOverride": true, "useUnknownInCatchVariables": false, + "skipLibCheck": true, }, "compileOnSave": true, "include": ["packages"], diff --git a/utils/avd_install.sh b/utils/avd_install.sh index d677689d55..6beb8bf43f 100755 --- a/utils/avd_install.sh +++ b/utils/avd_install.sh @@ -2,29 +2,29 @@ set -e -SDKDIR=$PWD/.android-sdk -export ANDROID_SDK_ROOT=${SDKDIR} -export ANDROID_HOME=${SDKDIR} -export ANDROID_AVD_HOME=${SDKDIR}/avd +if [[ -n "${ANDROID_HOME}" ]]; then + echo "ANDROID_HOME is already set. This script is only for a local installation of the Android SDK." + exit 1 +fi -mkdir ${SDKDIR} -mkdir ${SDKDIR}/cmdline-tools +export ANDROID_HOME="$PWD/.android-sdk" + +mkdir -p ${ANDROID_HOME}/cmdline-tools echo Downloading Android SDK... -cd ${SDKDIR}/cmdline-tools -COMMAND_LINE_TOOLS_ZIP=${SDKDIR}/commandlinetools.zip -# https://developer.android.com/studio#command-tools -curl https://dl.google.com/android/repository/commandlinetools-mac-8512546_latest.zip -o ${COMMAND_LINE_TOOLS_ZIP} -unzip ${COMMAND_LINE_TOOLS_ZIP} +cd ${ANDROID_HOME}/cmdline-tools +COMMAND_LINE_TOOLS_ZIP=${ANDROID_HOME}/commandlinetools.zip +# https://developer.android.com/studio +curl https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip -o ${COMMAND_LINE_TOOLS_ZIP} +unzip ${COMMAND_LINE_TOOLS_ZIP} rm ${COMMAND_LINE_TOOLS_ZIP} mv cmdline-tools latest -ln -s ${SDKDIR}/cmdline-tools/latest ${SDKDIR}/tools echo Installing emulator... -yes | ${ANDROID_HOME}/tools/bin/sdkmanager --install platform-tools emulator +yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install platform-tools emulator echo Installing platform SDK... -yes | ${ANDROID_HOME}/tools/bin/sdkmanager --install "platforms;android-33" +yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-33" echo Starting ADB... ${ANDROID_HOME}/platform-tools/adb devices diff --git a/utils/avd_recreate.sh b/utils/avd_recreate.sh index e16cf408f0..0877e76ed1 100755 --- a/utils/avd_recreate.sh +++ b/utils/avd_recreate.sh @@ -3,9 +3,7 @@ set -e if [[ -z "${ANDROID_HOME}" ]]; then - export SDKDIR=$PWD/.android-sdk - export ANDROID_HOME=${SDKDIR} - export ANDROID_SDK_ROOT=${SDKDIR} + export ANDROID_HOME="$PWD/.android-sdk" fi ANDROID_ARCH="x86_64" @@ -15,7 +13,7 @@ if [[ "$(uname -m)" == "arm64" ]]; then ANDROID_ARCH="arm64-v8a" fi -${ANDROID_HOME}/tools/bin/avdmanager delete avd --name android33 || true -echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager --install "system-images;android-33;google_apis;$ANDROID_ARCH" -echo "no" | ${ANDROID_HOME}/tools/bin/avdmanager create avd --force --name android33 --device "Nexus 5X" --package "system-images;android-33;google_apis;$ANDROID_ARCH" +${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager delete avd --name android33 || true +yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "system-images;android-33;google_apis;$ANDROID_ARCH" platform-tools emulator +echo "no" | ${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager create avd --force --name android33 --device "Nexus 5X" --package "system-images;android-33;google_apis;$ANDROID_ARCH" ${ANDROID_HOME}/emulator/emulator -list-avds diff --git a/utils/avd_start.sh b/utils/avd_start.sh index 85788bbeb5..67acb1c63e 100755 --- a/utils/avd_start.sh +++ b/utils/avd_start.sh @@ -3,9 +3,7 @@ set -e if [[ -z "${ANDROID_HOME}" ]]; then - SDKDIR=$PWD/.android-sdk - export ANDROID_HOME=${SDKDIR} - export ANDROID_SDK_ROOT=${SDKDIR} + export ANDROID_HOME="$PWD/.android-sdk" fi bash $PWD/utils/avd_stop.sh diff --git a/utils/avd_stop.sh b/utils/avd_stop.sh index 71110c1b8d..eabc557ac5 100755 --- a/utils/avd_stop.sh +++ b/utils/avd_stop.sh @@ -3,9 +3,7 @@ set -e if [[ -z "${ANDROID_HOME}" ]]; then - SDKDIR=$PWD/.android-sdk - export ANDROID_HOME=${SDKDIR} - export ANDROID_SDK_ROOT=${SDKDIR} + export ANDROID_HOME="$PWD/.android-sdk" fi echo "Killing previous emulators" diff --git a/utils/build/build-playwright-driver.sh b/utils/build/build-playwright-driver.sh index a22a7e0e6a..471d7505f5 100755 --- a/utils/build/build-playwright-driver.sh +++ b/utils/build/build-playwright-driver.sh @@ -4,7 +4,7 @@ set -x trap "cd $(pwd -P)" EXIT SCRIPT_PATH="$(cd "$(dirname "$0")" ; pwd -P)" -NODE_VERSION="20.9.0" # autogenerated via ./update-playwright-driver-version.mjs +NODE_VERSION="20.11.0" # autogenerated via ./update-playwright-driver-version.mjs cd "$(dirname "$0")" PACKAGE_VERSION=$(node -p "require('../../package.json').version") diff --git a/utils/build/build.js b/utils/build/build.js index 60524770d1..ff8c94764f 100644 --- a/utils/build/build.js +++ b/utils/build/build.js @@ -304,6 +304,7 @@ steps.push({ onChanges.push({ inputs: [ 'packages/playwright-core/src/server/injected/**', + 'packages/playwright-ct-core/src/injected/**', 'packages/playwright-core/src/utils/isomorphic/**', 'utils/generate_injected.js', ], diff --git a/utils/build/run-driver-posix.sh b/utils/build/run-driver-posix.sh index d00a15ba42..af4ed059c5 100755 --- a/utils/build/run-driver-posix.sh +++ b/utils/build/run-driver-posix.sh @@ -3,4 +3,4 @@ SCRIPT_PATH="$(cd "$(dirname "$0")" ; pwd -P)" if [ -z "$PLAYWRIGHT_NODEJS_PATH" ]; then PLAYWRIGHT_NODEJS_PATH="$SCRIPT_PATH/node" fi -"$PLAYWRIGHT_NODEJS_PATH" "$SCRIPT_PATH/package/lib/cli/cli.js" "$@" +"$PLAYWRIGHT_NODEJS_PATH" "$SCRIPT_PATH/package/cli.js" "$@" diff --git a/utils/build/run-driver-win.cmd b/utils/build/run-driver-win.cmd index 4ea002a667..69e98709a0 100755 --- a/utils/build/run-driver-win.cmd +++ b/utils/build/run-driver-win.cmd @@ -1,4 +1,4 @@ @echo off setlocal if not defined PLAYWRIGHT_NODEJS_PATH set PLAYWRIGHT_NODEJS_PATH=%~dp0node.exe -"%PLAYWRIGHT_NODEJS_PATH%" "%~dp0package\lib\cli\cli.js" %* \ No newline at end of file +"%PLAYWRIGHT_NODEJS_PATH%" "%~dp0package\cli.js" %* \ No newline at end of file diff --git a/utils/build/update_canary_version.js b/utils/build/update_canary_version.js index b9289c00d1..7a92860905 100755 --- a/utils/build/update_canary_version.js +++ b/utils/build/update_canary_version.js @@ -34,11 +34,8 @@ if (process.argv[2] === '--alpha') { let newVersion; if (process.argv[3] === '--today-date') { - const date = new Date(); - const month = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'][date.getMonth()]; - const day = date.getDate(); - const year = date.getFullYear(); - newVersion = `${baseVersion}-${prefix}-${month}-${day}-${year}`; + const isoDate = new Date().toISOString().split('T')[0]; + newVersion = `${baseVersion}-${prefix}-${isoDate}`; } else if (process.argv[3] === '--commit-timestamp') { const timestamp = execSync('git show -s --format=%ct HEAD', { stdio: ['ignore', 'pipe', 'ignore'] diff --git a/utils/check_deps.js b/utils/check_deps.js index ab1ed12072..fcfb278a18 100644 --- a/utils/check_deps.js +++ b/utils/check_deps.js @@ -79,7 +79,7 @@ async function innerCheckDeps(root) { }); const sourceFiles = program.getSourceFiles(); const errors = []; - sourceFiles.filter(x => !x.fileName.includes('node_modules')).map(x => visit(x, x.fileName)); + sourceFiles.filter(x => !x.fileName.includes('node_modules')).map(x => visit(x, x.fileName, x.getFullText())); if (errors.length) { for (const error of errors) @@ -112,7 +112,7 @@ async function innerCheckDeps(root) { return packageJSON; - function visit(node, fileName) { + function visit(node, fileName, text) { if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) { if (node.importClause) { if (node.importClause.isTypeOnly) @@ -151,6 +151,14 @@ async function innerCheckDeps(root) { return; } + const fullStart = node.getFullStart(); + const commentRanges = ts.getLeadingCommentRanges(text, fullStart); + for (const range of commentRanges || []) { + const comment = text.substring(range.pos, range.end); + if (comment.includes('@no-check-deps')) + return; + } + if (importName.startsWith('@')) deps.add(importName.split('/').slice(0, 2).join('/')); else @@ -159,7 +167,7 @@ async function innerCheckDeps(root) { if (!allowExternalImport(importName, packageJSON)) errors.push(`Disallowed external dependency ${importName} from ${path.relative(root, fileName)}`); } - ts.forEachChild(node, x => visit(x, fileName)); + ts.forEachChild(node, x => visit(x, fileName, text)); } function calculateDeps(from) { diff --git a/utils/docker/Dockerfile.jammy b/utils/docker/Dockerfile.jammy index fc0364de5c..d7c70a729c 100644 --- a/utils/docker/Dockerfile.jammy +++ b/utils/docker/Dockerfile.jammy @@ -40,6 +40,15 @@ RUN mkdir /ms-playwright && \ npm i /tmp/playwright-core.tar.gz && \ npm exec --no -- playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \ npm exec --no -- playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \ + # Workaround for https://github.com/microsoft/playwright/issues/27313 + # While the gstreamer plugin load process can be in-process, it ended up throwing + # an error that it can't have libsoup2 and libsoup3 in the same process because + # libgstwebrtc is linked against libsoup2. So we just remove the plugin. + if [ "$(uname -m)" = "aarch64" ]; then \ + rm /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstwebrtc.so; \ + else \ + rm /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstwebrtc.so; \ + fi && \ rm /tmp/playwright-core.tar.gz && \ rm -rf /ms-playwright-agent && \ rm -rf ~/.npm/ && \ diff --git a/utils/docker/publish_docker.sh b/utils/docker/publish_docker.sh index dcb77e943e..8f2d1910fd 100755 --- a/utils/docker/publish_docker.sh +++ b/utils/docker/publish_docker.sh @@ -26,14 +26,8 @@ else exit 1 fi -if [[ -z "${GITHUB_SHA}" ]]; then - echo "ERROR: GITHUB_SHA env variable must be specified" - exit 1 -fi - FOCAL_TAGS=( "next" - "sha-${GITHUB_SHA}" "next-focal" "v${PW_VERSION}-focal" ) diff --git a/utils/doclint/cli.js b/utils/doclint/cli.js index ada19fab09..7bc4dccee6 100755 --- a/utils/doclint/cli.js +++ b/utils/doclint/cli.js @@ -181,6 +181,7 @@ async function run() { const allowedCodeLangs = new Set([ 'csharp', 'java', + 'css', 'js', 'ts', 'python', @@ -199,6 +200,7 @@ async function run() { 'html', 'bash', 'sh', + 'Dockerfile', ]); if (!allowedCodeLangs.has(node.codeLang.split(' ')[0])) throw new Error(`${path.relative(PROJECT_DIR, filePath)} contains code block with invalid code block language ${node.codeLang}`); diff --git a/utils/eslint-plugin-internal-playwright/index.js b/utils/eslint-plugin-internal-playwright/index.js new file mode 100644 index 0000000000..20deef8cc4 --- /dev/null +++ b/utils/eslint-plugin-internal-playwright/index.js @@ -0,0 +1,20 @@ +/** + * 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. + */ +module.exports = { + rules: { + 'await-promise-in-class-returns': require('./rules/await-promise-in-class-returns'), + } +}; diff --git a/utils/eslint-plugin-internal-playwright/package.json b/utils/eslint-plugin-internal-playwright/package.json new file mode 100644 index 0000000000..c6de47abf7 --- /dev/null +++ b/utils/eslint-plugin-internal-playwright/package.json @@ -0,0 +1,5 @@ +{ + "name": "eslint-plugin-internal-playwright", + "version": "0.0.1", + "main": "index.js" +} diff --git a/utils/eslint-plugin-internal-playwright/rules/await-promise-in-class-returns.js b/utils/eslint-plugin-internal-playwright/rules/await-promise-in-class-returns.js new file mode 100644 index 0000000000..a71412c617 --- /dev/null +++ b/utils/eslint-plugin-internal-playwright/rules/await-promise-in-class-returns.js @@ -0,0 +1,54 @@ +/** + * 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. + */ +const { ESLintUtils } = require('@typescript-eslint/utils'); +const tsutils = require('ts-api-utils'); + +module.exports = { + meta: { + type: 'problem', + docs: { + description: 'ensure that return statements in classes await their promises so we always have the full stack trace in channel owners/tracing apiName extraction', + category: 'Best Practices', + recommended: false, + }, + schema: [], + fixable: 'code', + }, + create(context) { + const parserServices = ESLintUtils.getParserServices(context); + return { + 'ClassDeclaration MethodDefinition ReturnStatement': function (statement) { + if (statement.type === 'ReturnStatement' && statement.argument) { + if (tsutils.isThenableType( + parserServices.program.getTypeChecker(), + statement.argument, + parserServices.getTypeAtLocation(statement.argument) + )) { + context.report({ + node: statement, + message: 'Return statement in a class should await a promise so we are able to extract the whole stack trace when reporting it to e.g. Trace Viewer', + fix(fixer) { + const sourceCode = context.getSourceCode(); + const returnKeyword = sourceCode.getFirstToken(statement); + return fixer.insertTextAfter(returnKeyword, ' await'); + } + }); + } + } + }, + }; + }, +}; diff --git a/utils/generate_injected.js b/utils/generate_injected.js index 652f59d0a3..eccd7ddcad 100644 --- a/utils/generate_injected.js +++ b/utils/generate_injected.js @@ -22,20 +22,67 @@ const path = require('path'); const ROOT = path.join(__dirname, '..'); const esbuild = require('esbuild'); +/** + * @type {[string, string, string, boolean][]} + */ const injectedScripts = [ - path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'utilityScript.ts'), - path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'injectedScript.ts'), - path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'consoleApi.ts'), - path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'recorder.ts'), + [ + path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'utilityScript.ts'), + path.join(ROOT, 'packages', 'playwright-core', 'lib', 'server', 'injected', 'packed'), + path.join(ROOT, 'packages', 'playwright-core', 'src', 'generated'), + true, + ], + [ + path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'injectedScript.ts'), + path.join(ROOT, 'packages', 'playwright-core', 'lib', 'server', 'injected', 'packed'), + path.join(ROOT, 'packages', 'playwright-core', 'src', 'generated'), + true, + ], + [ + path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'consoleApi.ts'), + path.join(ROOT, 'packages', 'playwright-core', 'lib', 'server', 'injected', 'packed'), + path.join(ROOT, 'packages', 'playwright-core', 'src', 'generated'), + true, + ], + [ + path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'recorder', 'recorder.ts'), + path.join(ROOT, 'packages', 'playwright-core', 'lib', 'server', 'injected', 'packed'), + path.join(ROOT, 'packages', 'playwright-core', 'src', 'generated'), + true, + ], + [ + path.join(ROOT, 'packages', 'playwright-ct-core', 'src', 'injected', 'index.ts'), + path.join(ROOT, 'packages', 'playwright-ct-core', 'lib', 'injected', 'packed'), + path.join(ROOT, 'packages', 'playwright-ct-core', 'src', 'generated'), + false, + ] ]; const modulePrefix = ` +var __commonJS = obj => { + let required = false; + let result; + return function __require() { + if (!required) { + required = true; + let fn; + for (const name in obj) { fn = obj[name]; break; } + const module = { exports: {} }; + fn(module.exports, module); + result = module.exports; + } + return result; + } +}; var __export = (target, all) => {for (var name in all) target[name] = all[name];}; +var __toESM = mod => ({ ...mod, 'default': mod }); var __toCommonJS = mod => ({ ...mod, __esModule: true }); `; async function replaceEsbuildHeader(content, outFileJs) { - const sourcesStart = content.indexOf('// packages/playwright-core/src/server'); + let sourcesStart = content.indexOf('__toCommonJS'); + if (sourcesStart !== -1) + sourcesStart = content.indexOf('\n', sourcesStart); if (sourcesStart === -1) throw new Error(`Did not find start of bundled code in ${outFileJs}`); @@ -49,23 +96,36 @@ async function replaceEsbuildHeader(content, outFileJs) { return content; } +const inlineCSSPlugin = { + name: 'inlineCSSPlugin', + setup(build) { + build.onLoad({ filter: /\.css$/ }, async (args) => { + const f = await fs.promises.readFile(args.path) + const css = await esbuild.transform(f, { loader: 'css', minify: true }); + return { loader: 'text', contents: css.code }; + }); + }, +}; + (async () => { - const generatedFolder = path.join(ROOT, 'packages', 'playwright-core', 'src', 'generated'); - await fs.promises.mkdir(generatedFolder, { recursive: true }); - for (const injected of injectedScripts) { - const outdir = path.join(ROOT, 'packages', 'playwright-core', 'lib', 'server', 'injected', 'packed'); - await esbuild.build({ + for (const [injected, outdir, generatedFolder, hasExports] of injectedScripts) { + await fs.promises.mkdir(generatedFolder, { recursive: true }); + const buildOutput = await esbuild.build({ entryPoints: [injected], bundle: true, outdir, format: 'cjs', platform: 'browser', - target: 'ES2019' + target: 'ES2019', + plugins: [inlineCSSPlugin], }); + for (const message of [...buildOutput.errors, ...buildOutput.warnings]) + console.log(message.text); const baseName = path.basename(injected); const outFileJs = path.join(outdir, baseName.replace('.ts', '.js')); let content = await fs.promises.readFile(outFileJs, 'utf-8'); - content = await replaceEsbuildHeader(content, outFileJs); + if (hasExports) + content = await replaceEsbuildHeader(content, outFileJs); const newContent = `export const source = ${JSON.stringify(content)};`; await fs.promises.writeFile(path.join(generatedFolder, baseName.replace('.ts', 'Source.ts')), newContent); } diff --git a/utils/generate_third_party_notice.js b/utils/generate_third_party_notice.js index 8028b4b98f..71c250cfaf 100644 --- a/utils/generate_third_party_notice.js +++ b/utils/generate_third_party_notice.js @@ -59,7 +59,7 @@ This project incorporates components from the projects listed below. The origina } } - const packages = await checkDir('node_modules/codemirror'); + const packages = await checkDir('node_modules/codemirror-shadow-1'); for (const [key, value] of Object.entries(packages)) { if (value.licenseText) allPackages[key] = value; diff --git a/utils/generate_types/index.js b/utils/generate_types/index.js index 434343c380..e16f6df772 100644 --- a/utils/generate_types/index.js +++ b/utils/generate_types/index.js @@ -98,7 +98,12 @@ class TypesGenerator { }, (className, methodName, overloadIndex) => { if (className === 'SuiteFunction' && methodName === '__call') { const cls = this.documentation.classes.get('Test'); - const method = cls.membersArray.find(m => m.alias === 'describe' && m.overloadIndex === overloadIndex); + const method = cls.membersArray.find(m => m.alias === 'describe'); + return this.memberJSDOC(method, ' ').trimLeft(); + } + if (className === 'TestFunction' && methodName === '__call') { + const cls = this.documentation.classes.get('Test'); + const method = cls.membersArray.find(m => m.alias === '(call)'); return this.memberJSDOC(method, ' ').trimLeft(); } @@ -113,7 +118,7 @@ class TypesGenerator { return ''; this.handledMethods.add(`${className}.${methodName}#${overloadIndex}`); if (!method) { - if (new Set(['on', 'addListener', 'off', 'removeListener', 'once', 'prependListener']).has(methodName)) + if (new Set(['on', 'addListener', 'off', 'removeListener', 'once', 'prependListener', 'botName']).has(methodName)) return ''; throw new Error(`Unknown override method "${className}.${methodName}"`); } @@ -246,7 +251,7 @@ class TypesGenerator { const descriptions = []; for (let [eventName, value] of classDesc.events) { eventName = eventName.toLowerCase(); - const type = this.stringifyComplexType(value && value.type, ' ', classDesc.name, eventName, 'payload'); + const type = this.stringifyComplexType(value && value.type, 'out', ' ', classDesc.name, eventName, 'payload'); const argName = this.argNameForType(type); const params = argName ? `${argName}: ${type}` : ''; descriptions.push({ @@ -300,7 +305,7 @@ class TypesGenerator { } const jsdoc = this.memberJSDOC(member, indent); const args = this.argsFromMember(member, indent, classDesc.name); - let type = this.stringifyComplexType(member.type, indent, classDesc.name, member.alias); + let type = this.stringifyComplexType(member.type, 'out', indent, classDesc.name, member.alias); if (member.async) type = `Promise<${type}>`; // do this late, because we still want object definitions for overridden types @@ -373,12 +378,12 @@ class TypesGenerator { } /** - * @param {docs.Type} type + * @param {docs.Type|null} type */ - stringifyComplexType(type, indent, ...namespace) { + stringifyComplexType(type, direction, indent, ...namespace) { if (!type) return 'void'; - return this.stringifySimpleType(type, indent, ...namespace); + return this.stringifySimpleType(type, direction, indent, ...namespace); } /** @@ -393,7 +398,7 @@ class TypesGenerator { parts.push(properties.map(member => { const comment = this.memberJSDOC(member, indent + ' '); const args = this.argsFromMember(member, indent + ' ', name); - const type = this.stringifyComplexType(member.type, indent + ' ', name, member.name); + const type = this.stringifyComplexType(member.type, 'out', indent + ' ', name, member.name); return `${comment}${this.nameForProperty(member)}${args}: ${type};`; }).join('\n\n')); parts.push(indent + '}'); @@ -401,21 +406,23 @@ class TypesGenerator { } /** - * @param {docs.Type=} type + * @param {docs.Type | null | undefined} type + * @param {'in' | 'out'} direction * @returns{string} */ - stringifySimpleType(type, indent = '', ...namespace) { + stringifySimpleType(type, direction, indent = '', ...namespace) { if (!type) return 'void'; if (type.name === 'Object' && type.templates) { - const keyType = this.stringifySimpleType(type.templates[0], indent, ...namespace); - const valueType = this.stringifySimpleType(type.templates[1], indent, ...namespace); + const keyType = this.stringifySimpleType(type.templates[0], direction, indent, ...namespace); + const valueType = this.stringifySimpleType(type.templates[1], direction, indent, ...namespace); return `{ [key: ${keyType}]: ${valueType}; }`; } let out = type.name; if (out === 'int' || out === 'float') out = 'number'; - + if (out === 'Array' && direction === 'in') + out = 'ReadonlyArray'; if (type.name === 'Object' && type.properties && type.properties.length) { const name = namespace.map(n => n[0].toUpperCase() + n.substring(1)).join(''); const shouldExport = exported[name]; @@ -431,10 +438,10 @@ class TypesGenerator { if (type.args) { const stringArgs = type.args.map(a => ({ - type: this.stringifySimpleType(a, indent, ...namespace), + type: this.stringifySimpleType(a, direction, indent, ...namespace), name: a.name.toLowerCase() })); - out = `((${stringArgs.map(({ name, type }) => `${name}: ${type}`).join(', ')}) => ${this.stringifySimpleType(type.returnType, indent, ...namespace)})`; + out = `((${stringArgs.map(({ name, type }) => `${name}: ${type}`).join(', ')}) => ${this.stringifySimpleType(type.returnType, 'out', indent, ...namespace)})`; } else if (type.name === 'function') { out = 'Function'; } @@ -443,9 +450,9 @@ class TypesGenerator { if (out === 'Any') return 'any'; if (type.templates) - out += '<' + type.templates.map(t => this.stringifySimpleType(t, indent, ...namespace)).join(', ') + '>'; + out += '<' + type.templates.map(t => this.stringifySimpleType(t, direction, indent, ...namespace)).join(', ') + '>'; if (type.union) - out = type.union.map(t => this.stringifySimpleType(t, indent, ...namespace)).join('|'); + out = type.union.map(t => this.stringifySimpleType(t, direction, indent, ...namespace)).join('|'); return out.trim(); } @@ -455,7 +462,7 @@ class TypesGenerator { argsFromMember(member, indent, ...namespace) { if (member.kind === 'property') return ''; - return '(' + member.argsArray.map(arg => `${this.nameForProperty(arg)}: ${this.stringifyComplexType(arg.type, indent, ...namespace, member.alias, arg.alias)}`).join(', ') + ')'; + return '(' + member.argsArray.map(arg => `${this.nameForProperty(arg)}: ${this.stringifyComplexType(arg.type, 'in', indent, ...namespace, member.alias, arg.alias)}`).join(', ') + ')'; } /** @@ -611,12 +618,10 @@ class TypesGenerator { const existing = fs.readFileSync(filePath, 'utf8'); if (existing === content) return; - hadChanges = true; console.error(`Writing //${path.relative(PROJECT_DIR, filePath)}`); fs.writeFileSync(filePath, content, 'utf8'); } - let hadChanges = false; const coreTypesDir = path.join(PROJECT_DIR, 'packages', 'playwright-core', 'types'); if (!fs.existsSync(coreTypesDir)) fs.mkdirSync(coreTypesDir) @@ -627,7 +632,7 @@ class TypesGenerator { writeFile(path.join(coreTypesDir, 'types.d.ts'), await generateCoreTypes(false), true); writeFile(path.join(playwrightTypesDir, 'test.d.ts'), await generateTestTypes(false), true); writeFile(path.join(playwrightTypesDir, 'testReporter.d.ts'), await generateReporterTypes(false), true); - process.exit(hadChanges && process.argv.includes('--check-clean') ? 1 : 0); + process.exit(0); })().catch(e => { console.error(e); process.exit(1); diff --git a/utils/generate_types/overrides-test.d.ts b/utils/generate_types/overrides-test.d.ts index ac89c360a4..fd88e84dca 100644 --- a/utils/generate_types/overrides-test.d.ts +++ b/utils/generate_types/overrides-test.d.ts @@ -18,7 +18,7 @@ import type { APIRequestContext, Browser, BrowserContext, BrowserContextOptions, export * from 'playwright-core'; export type ReporterDescription = - ['blob'] | ['blob', { outputDir?: string }] | + ['blob'] | ['blob', { outputDir?: string, fileName?: string }] | ['dot'] | ['line'] | ['list'] | ['list', { printSteps?: boolean }] | @@ -111,13 +111,25 @@ export interface TestInfo { project: FullProject; } +type TestDetailsAnnotation = { + type: string; + description?: string; +}; + +export type TestDetails = { + tag?: string | string[]; + annotation?: TestDetailsAnnotation | TestDetailsAnnotation[]; +} + interface SuiteFunction { (title: string, callback: () => void): void; (callback: () => void): void; + (title: string, details: TestDetails, callback: () => void): void; } interface TestFunction { - (title: string, testFunction: (args: TestArgs, testInfo: TestInfo) => Promise | void): void; + (title: string, body: (args: TestArgs, testInfo: TestInfo) => Promise | void): void; + (title: string, details: TestDetails, body: (args: TestArgs, testInfo: TestInfo) => Promise | void): void; } export interface TestType extends TestFunction { @@ -134,17 +146,21 @@ export interface TestType void; }; - skip(title: string, testFunction: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + skip(title: string, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + skip(title: string, details: TestDetails, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; skip(): void; skip(condition: boolean, description?: string): void; skip(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void; - fixme(title: string, testFunction: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + fixme(title: string, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + fixme(title: string, details: TestDetails, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; fixme(): void; fixme(condition: boolean, description?: string): void; fixme(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void; - fail(): void; + fail(title: string, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; + fail(title: string, details: TestDetails, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise | void): void; fail(condition: boolean, description?: string): void; fail(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void; + fail(): void; slow(): void; slow(condition: boolean, description?: string): void; slow(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void; @@ -370,7 +386,7 @@ export interface ExpectMatcherUtils { stringify(object: unknown, maxDepth?: number, maxWidth?: number): string; } -type State = { +export type ExpectMatcherState = { isNot: boolean; promise: 'rejects' | 'resolves' | ''; utils: ExpectMatcherUtils; @@ -402,7 +418,7 @@ type MakeMatchers = { rejects: MakeMatchers, any, ExtendedMatchers>; } & IfAny, SpecificMatchers & ToUserMatcherObject>; -export type Expect = { +export type Expect = { (actual: T, messageOrOptions?: string | { message?: string }): MakeMatchers; soft: (actual: T, messageOrOptions?: string | { message?: string }) => MakeMatchers; poll: (actual: () => T | Promise, messageOrOptions?: string | { message?: string, timeout?: number, intervals?: number[] }) => BaseMatchers, T> & { @@ -411,18 +427,13 @@ export type Expect = { */ not: BaseMatchers, T>; }; - extend MatcherReturnType | Promise>>(matchers: MoreMatchers): Expect; + extend MatcherReturnType | Promise>>(matchers: MoreMatchers): Expect; configure: (configuration: { message?: string, timeout?: number, soft?: boolean, }) => Expect; - getState(): { - expand?: boolean; - isNot?: boolean; - promise?: string; - utils: any; - }; + getState(): ExpectMatcherState; not: Omit; } & AsymmetricMatchers; diff --git a/utils/pack_package.js b/utils/pack_package.js index 5989b49867..8ef6f4cee7 100644 --- a/utils/pack_package.js +++ b/utils/pack_package.js @@ -19,6 +19,7 @@ const os = require('os'); const path = require('path'); const { spawnSync } = require('child_process'); +const SCRIPT_NAME = path.basename(__filename); // 1. Parse CLI arguments const args = process.argv.slice(2); if (args.some(arg => arg === '--help')) { diff --git a/utils/workspace.js b/utils/workspace.js index a74f27ac0d..873d1d0593 100755 --- a/utils/workspace.js +++ b/utils/workspace.js @@ -22,6 +22,7 @@ */ const fs = require('fs'); const path = require('path'); +const child_process = require('child_process'); const readJSON = async (filePath) => JSON.parse(await fs.promises.readFile(filePath, 'utf8')); const writeJSON = async (filePath, json) => { @@ -33,7 +34,6 @@ class PWPackage { this.name = descriptor.name; this.path = descriptor.path; this.files = descriptor.files; - this.noConsistent = descriptor.noConsistent; this.packageJSONPath = path.join(this.path, 'package.json'); this.packageJSON = JSON.parse(fs.readFileSync(this.packageJSONPath, 'utf8')); this.isPrivate = !!this.packageJSON.private; @@ -107,13 +107,8 @@ class Workspace { await fs.promises.copyFile(fromPath, toPath); } - // 2. Make sure package-lock and package's package.json are consistent. - // All manual package-lock management is a workaround for - // https://github.com/npm/cli/issues/3940 - const pkgLockEntry = packageLock['packages']['packages/' + path.basename(pkg.path)]; - const depLockEntry = packageLock['dependencies'][pkg.name]; + // 2. Make sure package's package.jsons are consistent. if (!pkg.isPrivate) { - pkgLockEntry.version = version; pkg.packageJSON.version = version; pkg.packageJSON.repository = workspacePackageJSON.repository; pkg.packageJSON.engines = workspacePackageJSON.engines; @@ -122,16 +117,7 @@ class Workspace { pkg.packageJSON.license = workspacePackageJSON.license; } - if (pkg.noConsistent) - continue; - for (const otherPackage of this._packages) { - if (pkgLockEntry.dependencies && pkgLockEntry.dependencies[otherPackage.name]) - pkgLockEntry.dependencies[otherPackage.name] = version; - if (pkgLockEntry.devDependencies && pkgLockEntry.devDependencies[otherPackage.name]) - pkgLockEntry.devDependencies[otherPackage.name] = version; - if (depLockEntry.requires && depLockEntry.requires[otherPackage.name]) - depLockEntry.requires[otherPackage.name] = version; if (pkg.packageJSON.dependencies && pkg.packageJSON.dependencies[otherPackage.name]) pkg.packageJSON.dependencies[otherPackage.name] = version; if (pkg.packageJSON.devDependencies && pkg.packageJSON.devDependencies[otherPackage.name]) @@ -139,7 +125,9 @@ class Workspace { } await maybeWriteJSON(pkg.packageJSONPath, pkg.packageJSON); } - await maybeWriteJSON(packageLockPath, packageLock); + + // Re-run npm i to make package-lock dirty. + child_process.execSync('npm i'); return hasChanges; } } @@ -253,6 +241,10 @@ async function parseCLI() { const hasChanges = await workspace.ensureConsistent(); if (hasChanges) die(`\n ERROR: workspace is inconsistent! Run '//utils/workspace.js --ensure-consistent' and commit changes!`); + // Ensure lockfileVersion is 3 + const packageLock = require(ROOT_PATH + '/package-lock.json'); + if (packageLock.lockfileVersion !== 3) + die(`\n ERROR: package-lock.json lockfileVersion must be 3`); }, '--list-public-package-paths': () => { for (const pkg of workspace.packages()) {