Bug 253821 - Offscreen Canvas does not respect size set via CSS
Summary: Offscreen Canvas does not respect size set via CSS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified macOS 13
: P2 Normal
Assignee: Matt Woodrow
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-13 06:44 PDT by Oscar
Modified: 2023-03-24 00:47 PDT (History)
4 users (show)

See Also:


Attachments
Screenshots of the bug in Safari Technology Preview and another browser side by side. (15.88 KB, image/png)
2023-03-13 06:44 PDT, Oscar
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oscar 2023-03-13 06:44:35 PDT
Created attachment 465417 [details]
Screenshots of the bug in Safari Technology Preview and another browser side by side.

Example:
Given the canvas has HTML attributes width=200 and height=200;
when the CSS rules width:100px and height:100px are applied,
the OffscreenCanvas renders at original 200x200 scale, overflowing the box of 100x100.

Please find an example in the attached screenshot, and a simple reproduction case here:
https://stackblitz.com/edit/webkit-offscreen-canvas-scaling
Comment 1 Radar WebKit Bug Importer 2023-03-20 06:45:16 PDT
<rdar://problem/106941318>
Comment 2 Matt Woodrow 2023-03-20 16:55:37 PDT
Pull request: https://github.com/WebKit/WebKit/pull/11743
Comment 3 EWS 2023-03-23 14:28:29 PDT
Committed 262039@main (2d31dae22ea7): <https://commits.webkit.org/262039@main>

Reviewed commits have been landed. Closing PR #11743 and removing active labels.
Comment 4 Fujii Hironori 2023-03-24 00:47:40 PDT
fast/canvas/offscreen-scaling.html is randomly failing.
https://results.webkit.org/?suite=layout-tests&test=fast%2Fcanvas%2Foffscreen-scaling.html