HomePhabricator

Add full-width URL to srcset

Tags
None
Referenced Files
None
Subscribers
None

Description

Add full-width URL to srcset

Now that we have the width (and height) of the file, add it as another
source to the srcset; without this, the full-resolution src doesn’t
always seem to be loaded. (It’s illegal to mix x and w sources in the
same srcset, so specifying just the URL on its own without a width,
which is the same as 1x, would not have been allowed.)

Note that we still use Special:FilePath instead of {{ image_url }} here,
because the srcset must contain PNG or JPEG thumbnails (compare the
comment of ensureImageCroppable() in image.js), whereas the image_url
may use more exotic formats like TIFF.

In practice, I’m not completely happy with what the desktop browsers
I’ve tested (Firefox and Chromium) do with this srcset, but it seems to
be better than before, at least.

Details

Provenance
LucasWerkmeisterAuthored on May 15 2022, 3:20 PM
Parents
R2422:ec0407e3ac02: Make the image at most as high as the viewport
Branches
Unknown
Tags
Unknown
ChangeId
None