Skip to content

Extend context loss/restoration test coverage to desynchronized canvas#59314

Merged
chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-export-cl-7770647
Apr 19, 2026
Merged

Extend context loss/restoration test coverage to desynchronized canvas#59314
chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-export-cl-7770647

Conversation

@chromium-wpt-export-bot
Copy link
Copy Markdown
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Apr 17, 2026

Desynchronize canvases use a resource dispatcher to push frames and
since the dispatcher is descarded on context loss [1], it's worth adding
test coverage for this.

Note that the frame dispatcher is never recreated after the context is
restored, so the canvas doesn't fully recover from the context loss. The
canvas can be read back though, so the tests still works and we can at
least validate that the context state transitions work properly.

Also note that the OffscreenCanvas doesn't do much with the
desynchronized flag, but the test coverage is still useful given that
this flag is listed as supported in MDN [1] and the specification [2].

[1] https://crsrc.org/c/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc;l=290;drc=8abea14deda089834ba142a35e8342014812df55
[2] https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/getContext
[3] https://html.spec.whatwg.org/multipage/canvas.html#canvas-setting-init-bitmap

Change-Id: I300d1f2827406120896cc7dc38794cb450ea3ed5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7770647
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Jean-Philippe Gravel <jpgravel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1617254}

Desynchronize canvases use a resource dispatcher to push frames and
since the dispatcher is descarded on context loss [1], it's worth adding
test coverage for this.

Note that the frame dispatcher is never recreated after the context is
restored, so the canvas doesn't fully recover from the context loss. The
canvas can be read back though, so the tests still works and we can at
least validate that the context state transitions work properly.

Also note that the OffscreenCanvas doesn't do much with the
`desynchronized` flag, but the test coverage is still useful given that
this flag is listed as supported in MDN [1] and the specification [2].

[1] https://crsrc.org/c/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc;l=290;drc=8abea14deda089834ba142a35e8342014812df55
[2] https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/getContext
[3] https://html.spec.whatwg.org/multipage/canvas.html#canvas-setting-init-bitmap

Change-Id: I300d1f2827406120896cc7dc38794cb450ea3ed5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7770647
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Jean-Philippe Gravel <jpgravel@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1617254}
Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit b225b38 into master Apr 19, 2026
28 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-7770647 branch April 19, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants