On Tue, Sep 18, 2012 at 12:31 AM, Brion Vibber brion@pobox.com wrote:
Here's my first stab: https://bugzilla.wikimedia.org/show_bug.cgi?id=36198#c6 https://gerrit.wikimedia.org/r/#/c/24115/
I've made a couple changes in patchset 2:
* fix for images that specify width but not height (whoops! this broke on... a lot of images in my real-world test case "San Francisco" enwiki article) * apply image 'src' replacements immediately on DOM-ready instead of waiting for window.onload
This should prevent some, but not necessarily all "double loading". Modern browsers are pretty aggressive about preloading images, and at least some may start loading at 1.0x resolution before they get replaced.
Jon's suggestions of using a blank src and a <noscript> are doable but... it gets ugly fast to make it work for non-JS cases cleanly. Not sure if it's worth going down that road, but willing to try. :)
[Note that it still fails jenkins tests because test cases haven't been updated.]
-- brion