desandro/imagesloaded — pull request #160 by kimili (2014-09-03 14:51:01+00:00)
Title: Adding srcset without src compatibility

Hi David,

In browsers that support the `picture` element natively (currently only [Chrome Canary](http://www.google.com/intl/en/chrome/browser/canary.html) and [Firefox Aurora](https://www.mozilla.org/en-US/firefox/channel/#aurora)), imagesloaded fails in certain conditions, specifically if the `picture` element has an `img` with a `srcset` attribute set, but no `src`. For instance, the following code would never get triggered as being loaded:

```

```

In these browsers, the image element has a `currentSrc` property which gets populated, but the `src` never does, so imagesloaded never fires complete on that image.

This pull request adds a check for the `currentSrc` property, as well smooths over some of the variations of how those browsers handle the property. That code that smooths things over is definitely hacky, but we may be able to clean it up as the native picture functionality makes its way into shipping browsers over the coming months.

Thanks!
Michael