Bug 220903 - SVG inside <img> does not scale contents with respect to screen width or height
Summary: SVG inside <img> does not scale contents with respect to screen width or height
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari 14
Hardware: All All
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-24 14:25 PST by Jeffrey
Modified: 2021-01-27 17:43 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey 2021-01-24 14:25:35 PST
Codepen: https://codepen.io/JeffreyCA/pen/abmgBze

Open the above snippet on a Mac and then resize the Safari window width until it's less than the width of the SVG.

Observed:
Notice how the background/borders do scale properly, but the contents (text, images) are not scaled. They are instead truncated by the borders of the SVG.

Expected:
The entire SVG (including text, images, background/borders) should be scaled against the window width.

Other browsers:
Both Chrome and Firefox perform scaling as expected.
Comment 1 Smoley 2021-01-27 17:41:27 PST
Thanks for filing, I'm seeing this issue on Safari 13.1.3 and STP118.
Comment 2 Radar WebKit Bug Importer 2021-01-27 17:43:21 PST
<rdar://problem/73688284>