canvas: prevent unwrap on offscreen canvas (#37460)

Remove all unwrap usage on offscreen canvas to prevent panic.

Testing:
`tests/wpt/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen-crash.html`
Fixes: #37415

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Yu Wei Wu <yuweiwu@YunoMacBook-Air.local>
Co-authored-by: Yu Wei Wu <yuweiwu@YunoMacBook-Air.local>
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2025-06-16 14:39:56 +09:00 committed by GitHub
parent f8f7c6ebd1
commit e69962e646
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 58 additions and 26 deletions

View file

@ -7834,6 +7834,13 @@
null,
{}
]
],
"offscreencanvas.transfercontrol.to.offscreen-crash.html": [
"949f49c1065cb949cc146d2246a0159c777cc272",
[
null,
{}
]
]
}
},

View file

@ -0,0 +1,7 @@
<title>Transfer Canvas without Context</title>
<canvas id="canvas"></canvas>
<script>
canvas.transferControlToOffscreen();
canvas.toBlob(_ => {});
</script>