Bug 138094
Summary: | width:-webkit-min-content ignores default image size | ||
---|---|---|---|
Product: | WebKit | Reporter: | Nick Manning <nickmanning214> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ahmad.saleem792, dino, hyatt, karlcow, simon.fraser, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.9 |
Nick Manning
If you have a figure like this:
<body>
<figure>
<img src="http://www.placehold.it/400x400"><!--Note: The image size is 400x400-->
<figcaption>lorem ipsum etc...</figcaption>
</figure>
</body>
With this CSS:
*{margin:0px;padding:0px}
figure{width:-webkit-min-content;width:-moz-min-content;}
everything works fine, but when you want to make it responsive (meaning, when the screen is under 400 pixels wide, the image shrinks accordingly), normally this would be done by applying max-width:100% to the image, but doing this causes -webkit-min-content to ignore the image's default size and shrink it to the longest word in the fig caption. -moz-min-content works as expected.
Here is an example:
http://jsfiddle.net/ywmsp0jy/3/
(compare with firefox's behavior)
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/18796009>
Ahmad Saleem
I changed the test to remove any prefixes and cleaned CSS a bit:
Link - https://jsfiddle.net/tnx2yvep/show
It is same across all browsers Chrome Canary 112, Firefox Nightly 112 and Safari Technology Preview 163.
Do we need to track it? Thanks!
Karl Dubost
Yes. Thanks Ahmad.