Bug 243661
Summary: | Min-width does not respect implicit width on SVG | ||
---|---|---|---|
Product: | WebKit | Reporter: | murrayadcock+webkit |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ahmad.saleem792, bfulgham, simon.fraser, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 15 | ||
Hardware: | Mac (Apple Silicon) | ||
OS: | macOS 12 | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=257614 |
murrayadcock+webkit
If an SVG element has an implicit width set (e.g. <svg width="45px">...</svg>) then this should be considered the minimum width of the element.
Currently, setting max-width: min-content works as expected (the SVG element will be 45px wide).
But setting min-width: min-content makes the SVG a seemingly arbitrary width (302px in the test case). (this is the same for max-content and fit-content, neither of which appear to respect intrinsic sizing either)
No combination of other width settings seems to be able to override this. For example, setting a max-width or width value of 45px still results in a 302px element.
Changing the implicit width on the element doesn't seem to have any effect either (it sticks to 302px wide).
See this reproduction of the issue, which has optional code for testing in a Grid format (grid columns also ignore the actual minimum width and default to 302px wide) and which shows that min-w-idth: auto works as expected:
https://codepen.io/theadhocracy/pen/OJvEmPv
[FYI this has also been tested on iCab to rule out Safari-specific bugs and can be reproduced there, as well as on WebKit browsers on iOS devices]
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/98661480>
Ahmad Saleem
It get fixed by: https://github.com/WebKit/WebKit/pull/16084
I have above patches in local WebKit ToT and it seems to fix this test case and make us match Chrome Canary 117.
I removed above patches and then compiled local and we fail this test case.
Just wanted to add this information, if above PR stick, I will mark this as 'RESOLVED CONFIGURATION CHANGED' else it would be helpful for someone else in future while trying to fix this issue.
Ahmad Saleem
Fixed now.
*** This bug has been marked as a duplicate of bug 257614 ***