photonstorm/phaser — pull request #1351 by pnstickne (2014-11-21 21:22:23+00:00)
Title: Loader - image loading can bypass 'onload'

An image will check the 'complete' as well as width/height when it is
created - this check will be true for cached resources in modern browser
and bypassing the intermediate 'onload' event allows less latency when
loading cached image resources. This results in a tangible difference; it
might be possible to apply a similar bypass for audio tags.

This should not cause any adverse behavior and all the normal signal
dispatching occurs - this is the same check PIXI does for loading a
BaseTexture from an image, only this implementation doesn't suffer from
PIXI's race condition..

The onload/onerror events are also pruned and guarded better.