RESOLVED CONFIGURATION CHANGED 138094
width:-webkit-min-content ignores default image size
https://bugs.webkit.org/show_bug.cgi?id=138094
Summary width:-webkit-min-content ignores default image size
Nick Manning
Reported 2014-10-27 09:20:00 PDT
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
Radar WebKit Bug Importer
Comment 1 2014-10-28 07:24:40 PDT
Ahmad Saleem
Comment 2 2023-02-21 13:15:11 PST
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
Comment 3 2023-03-02 22:33:28 PST
Yes. Thanks Ahmad.
Note You need to log in before you can comment on or make changes to this bug.