Skip to content

chore(webkit): encode jpeg screenshots natively via Page.snapshotRect#41171

Open
yury-s wants to merge 1 commit into
microsoft:mainfrom
yury-s:chore-webkit-native-jpeg
Open

chore(webkit): encode jpeg screenshots natively via Page.snapshotRect#41171
yury-s wants to merge 1 commit into
microsoft:mainfrom
yury-s:chore-webkit-native-jpeg

Conversation

@yury-s
Copy link
Copy Markdown
Member

@yury-s yury-s commented Jun 5, 2026

Summary

  • Page.snapshotRect now accepts format and quality, so WebKit encodes JPEG natively instead of returning a PNG that we re-encode with jpeg-js in Node.
  • Removes the now-unused pngjs/jpeg-js imports and the PNG→JPEG round-trip.

Page.snapshotRect now accepts format and quality, so pass them through
and let WebKit encode JPEG directly instead of fetching a PNG and
re-encoding with jpeg-js in Node. Drops the unused pngjs/jpeg-js imports.
@yury-s yury-s added the CQ1 label Jun 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Test results for "MCP"

7266 passed, 1119 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Test results for "tests 1"

1 flaky ⚠️ [chromium-library] › library/popup.spec.ts:261 › should not throw when click closes popup `@chromium-ubuntu-22.04-node22`

39520 passed, 775 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Test results for "tests others"

1 fatal errors, not part of any test
4 failed
❌ [electron-page] › page/page-screenshot.spec.ts:321 › page screenshot › should work for webgl @electron-ubuntu-latest
❌ [electron-page] › page/workers.spec.ts:190 › should attribute network activity for worker inside iframe to the iframe @electron-ubuntu-latest
❌ [electron-page] › page/workers.spec.ts:190 › should attribute network activity for worker inside iframe to the iframe @electron-macos-latest
❌ [electron-page] › page/workers.spec.ts:190 › should attribute network activity for worker inside iframe to the iframe @electron-windows-latest

7 flaky ⚠️ [electron-page] › page/page-route.spec.ts:74 › should not support ? in glob pattern `@electron-ubuntu-latest`
⚠️ [electron-api] › electron/electron-tracing.spec.ts:56 › should respect tracesDir and name `@electron-macos-latest`
⚠️ [electron-page] › page/locator-frame.spec.ts:272 › should work with COEP/COOP/CORP isolated iframe `@electron-macos-latest`
⚠️ [electron-page] › page/page-route.spec.ts:74 › should not support ? in glob pattern `@electron-macos-latest`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/inspector/recorder-api.spec.ts:120 › should type `@realtime-time-library-chromium-linux`
⚠️ [electron-page] › page/page-route.spec.ts:74 › should not support ? in glob pattern `@electron-windows-latest`

19964 passed, 664 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Test results for "tests 2"

25 failed
❌ [installation tests] › playwright-electron-should-work.spec.ts:21 › electron should work @package-installations-ubuntu-latest-node26
❌ [installation tests] › playwright-electron-should-work.spec.ts:31 › electron should work with special characters in path @package-installations-ubuntu-latest-node26
❌ [installation tests] › playwright-electron-should-work.spec.ts:44 › should work when wrapped inside @playwright/test and trace is enabled @package-installations-ubuntu-latest-node26
❌ [chromium-page] › page/workers.spec.ts:190 › should attribute network activity for worker inside iframe to the iframe @tracing-chromium
❌ [installation tests] › playwright-electron-should-work.spec.ts:21 › electron should work @package-installations-ubuntu-latest-node24
❌ [installation tests] › playwright-electron-should-work.spec.ts:31 › electron should work with special characters in path @package-installations-ubuntu-latest-node24
❌ [installation tests] › playwright-electron-should-work.spec.ts:44 › should work when wrapped inside @playwright/test and trace is enabled @package-installations-ubuntu-latest-node24
❌ [firefox-library] › library/heap.spec.ts:203 › cycle handles @tracing-firefox
❌ [firefox-library] › library/defaultbrowsercontext-2.spec.ts:252 › dialog.accept should work @firefox-macos-15-large
❌ [webkit-library] › library/heap.spec.ts:203 › cycle handles @tracing-webkit
❌ [webkit-page] › page/page-leaks.spec.ts:136 › expect should not leak @tracing-webkit
❌ [webkit-library] › library/har-websocket.spec.ts:80 › should include websocket handshake headers and status @webkit-windows-latest
❌ [webkit-library] › library/har-websocket.spec.ts:118 › should include websocket messages @webkit-windows-latest
❌ [webkit-library] › library/har-websocket.spec.ts:157 › should include larger websocket messages @webkit-windows-latest
❌ [webkit-library] › library/har-websocket.spec.ts:196 › should include gigantic websocket messages @webkit-windows-latest
❌ [webkit-library] › library/har-websocket.spec.ts:235 › should include binary websocket messages @webkit-windows-latest
❌ [webkit-library] › library/har-websocket.spec.ts:338 › should record websocket handshake failure @webkit-windows-latest
❌ [android-page] › page/page-autowaiting-basic.spec.ts:94 › should work with noWaitAfter: true
❌ [android-page] › page/page-autowaiting-basic.spec.ts:100 › should work with dblclick without noWaitAfter when navigation is stalled
❌ [android-page] › page/page-dialog.spec.ts:67 › should be able to close context with open alert
❌ [android-page] › page/page-goto.spec.ts:373 › should fail when exceeding maximum navigation timeout
❌ [android-page] › page/page-goto.spec.ts:441 › should prioritize default navigation timeout over default timeout
❌ [android-page] › page/page-request-continue.spec.ts:125 › should not allow changing protocol when overriding url
❌ [android-page] › page/page-set-content.spec.ts:153 › should handle timeout properly 2
❌ [android-page] › page/workers.spec.ts:190 › should attribute network activity for worker inside iframe to the iframe

32 flaky ⚠️ [chromium-library] › library/heap.spec.ts:203 › cycle handles `@tracing-chromium`
⚠️ [chromium-library] › library/trace-viewer.spec.ts:682 › should capture attribute mutations inside a popup window `@msedge-dev-windows-latest`
⚠️ [chromium-library] › library/trace-viewer.spec.ts:2089 › should not trip over complex urls in style tags `@msedge-dev-windows-latest`
⚠️ [chromium-library] › library/inspector/cli-codegen-python-async.spec.ts:80 › should save the codegen output to a file if specified `@chrome-ubuntu-22.04`
⚠️ [chromium-page] › page/page-keyboard.spec.ts:474 › should scroll with PageDown `@msedge-windows-latest`
⚠️ [chromium-library] › library/trace-viewer.spec.ts:682 › should capture attribute mutations inside a popup window `@chromium-windows-latest`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-windows-latest`
⚠️ [chromium-page] › page/workers.spec.ts:63 › should have timestamp on worker console messages `@chromium-windows-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:189 › launchServer › should ignore page.pause when headed `@chromium-macos-15-large`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:177 › serviceWorker(), and fromServiceWorker() work `@chromium-macos-15-large`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:434 › should produce network events, routing, and annotations for Service Worker (advanced) `@chromium-macos-15-large`
⚠️ [chromium-library] › library/heap.spec.ts:203 › cycle handles `@chromium-macos-15-large`
⚠️ [chromium-library] › library/inspector/cli-codegen-2.spec.ts:504 › cli codegen › should generate getByTestId for any of the configured testIdAttributes `@chromium-macos-15-large`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-macos-14-xlarge`
⚠️ [chromium-library] › library/screenshot.spec.ts:215 › page screenshot › should not hang when event loop is blocked `@chromium-macos-15-xlarge`
⚠️ [chromium-library] › library/video.spec.ts:682 › screencast › should capture full viewport on hidpi `@chromium-macos-15-xlarge`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-macos-15-xlarge`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:434 › should produce network events, routing, and annotations for Service Worker (advanced) `@chrome-beta-ubuntu-22.04`
⚠️ [firefox-library] › library/inspector/cli-codegen-3.spec.ts:224 › cli codegen › should generate frame locators (4) `@tracing-firefox`
⚠️ [firefox-library] › library/defaultbrowsercontext-2.spec.ts:140 › should create userDataDir if it does not exist `@firefox-macos-15-large`
⚠️ [firefox-library] › library/defaultbrowsercontext-2.spec.ts:161 › should have passed URL when launching with ignoreDefaultArgs: true `@firefox-macos-15-large`
⚠️ [firefox-library] › library/defaultbrowsercontext-2.spec.ts:183 › should handle exception `@firefox-macos-15-large`
⚠️ [firefox-library] › library/defaultbrowsercontext-2.spec.ts:267 › exposes browser `@firefox-macos-15-large`
⚠️ [firefox-library] › library/hit-target.spec.ts:319 › should detect overlay from another shadow root `@firefox-macos-15-large`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-macos-15-large`
⚠️ [firefox-library] › library/screenshot.spec.ts:215 › page screenshot › should not hang when event loop is blocked `@firefox-macos-15-xlarge`
⚠️ [webkit-library] › library/browsercontext-reuse.spec.ts:117 › reuse launch › should reset serviceworker `@tracing-webkit`
⚠️ [webkit-library] › library/browsertype-connect.spec.ts:792 › launchServer › should upload a folder `@webkit-macos-15-xlarge`
⚠️ [webkit-library] › library/browsertype-connect.spec.ts:792 › run-server › should upload a folder `@webkit-macos-15-large`
⚠️ [webkit-library] › library/video.spec.ts:371 › screencast › should scale frames down to the requested size `@webkit-macos-15-large`
⚠️ [webkit-page] › page/page-request-continue.spec.ts:182 › post data › should amend post data `@webkit-macos-15-large`
⚠️ [android-page] › page/page-route.spec.ts:317 › should not throw if request was cancelled by the page

88746 passed, 4113 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants