-
Notifications
You must be signed in to change notification settings - Fork 841
Description
When we need to scale images due to, e.g., zoom or retina display, before scrolling to an image that is lazily loaded, the width and height attributes will be set to placeholder image dimensions in http://s0.wp.com/wp-content/js/devicepx-jetpack.js. Here is a small demonstration, where in the console you can see that the width and height are set before even taking away the data-recalc-dims flag. Setting the attributes too early will result in a 1 x 1 px image instead of the expected.
The comment in photon.js Modify given image's markup so that devicepx-jetpack.js will act on the image indicates (at least in my opinion) that devicepx-jetpack.js will only act on the image after the reset_for_retina call, even though this doesn't seem to be the case currently. I think it would make sense to not scale the image (in devicepx-jetpack.js) if data-recalc-dims is still set, postponing the scaling until the image is actually loaded and photon.js has been able to set the image dimensions.