Automattic/jetpack — pull request #1339 by barzik (2014-11-28 10:17:44+00:00)
Title: Issue 1169 - Implement Picture-element and srcset support into Photon

# Adding srcset elements to Photon images

## issue 1169
See: https://github.com/Automattic/jetpack/issues/1169

## Problem
Retina images are being implemented by using devicepx-jetpack.js – in the past it was the best way to determine the user zoom level on every browser. If the user zoom in\zoom out or has a retina, Jetpack will immediately go to Photon and fetch the correct version of the image for the user’s zoom. The downsize of using this script is a function that runs every second – lead to performance issues. Users complained about it and you can find online several posts of developers about it. Google devicepx-jetpack.js for a lot of examples.

## General fix details
Original WordPress "devicepx" hosted file removed and new jetpack-retina-support added. The new file include srcset addition to supported browsers, Fallback is using the original devicepx methods.

## How to test
* Go with Chrome browser (supports srcset) to a page that use images (in the post itself or in the widgets) see that srcest attributes for zoom 1x,2x,3x,4x are being implemented by JavaScript for Photon, Wordpress.com & Gravatar.
* Go with Firefox browser (not supporting srcset), See that it is loading the appropriate image according to zoom level.

## Warning
We are losing functionality here. srcset does not reload the image dynamicly if the user is zooming in or out.