Extend context loss/restoration test coverage to desynchronized canvas#59314
Merged
chromium-wpt-export-bot merged 1 commit intomasterfrom Apr 19, 2026
Merged
Extend context loss/restoration test coverage to desynchronized canvas#59314chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-wpt-export-bot merged 1 commit intomasterfrom
Conversation
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}
825703a to
0bb9469
Compare
wpt-pr-bot
approved these changes
Apr 19, 2026
Collaborator
wpt-pr-bot
left a comment
There was a problem hiding this comment.
The review process for this patch is being conducted in the Chromium project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
desynchronizedflag, but the test coverage is still useful given thatthis 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}