Improve image loading (height) on slow connections
Reported by
craig.fr...@gmail.com,
Jun 13 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.24 Safari/537.36 Steps to reproduce the problem: To avoid reflow while the page is loading (e.g. on a slow connection), we could improve how the image size is calculated. At the moment websites can provide the width/height of the image in the HTML. But websites will typically override the width in CSS to a percentage value, while using `height: auto` (so the aspect ratio is maintained). When this happens, the height of the image is assumed to be 0px, which is nearly always wrong. It's not until the image is downloaded does the correct height get calculated. Could we instead take the width/height (as set in the HTML) and use that to calculate the height while the page is loading. --- I've attached a simple HTML document as an example (you can use any image), and a video to show what happens at the moment. What is the expected behavior? What went wrong? N/A Did this work before? N/A Chrome version: 60.0.3112.24 Channel: beta OS Version: OS X 10.12.5 Flash Version:
,
Jun 13 2017
,
Dec 8 2017
Also requested on Firefox and Safari: https://bugzilla.mozilla.org/show_bug.cgi?id=1424247 https://bugs.webkit.org/show_bug.cgi?id=180580
,
Dec 11 2017
,
Jan 16 2018
Suggestion from fantasai on the Firefox issue log... Assuming the CSS `aspect-ratio` property is added, that would be a perfect way to introduce this: https://github.com/WICG/aspect-ratio When the width/height attributes from the <img> are copied into the CSS properties, the browser could also set a default `aspect-ratio`. So that when the websites CSS is processed (and replaces the width/height), the aspect-ratio will still be available for any missing values (e.g. height: auto).
,
Jan 16
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 16
I guess the 'intrinsicsize' attribute could be worth mentioning here: https://www.chromestatus.com/feature/4704436815396864 |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by sdy@chromium.org
, Jun 13 2017Labels: -OS-Mac