DescriptionFire load event for an image even if it was the last image we loaded successfully.
When we updated image loading to handle alt content using the shadow dom we made
most image loads asynchronous, including loads where the src is null. src='' is a
common idiom for resetting the content of the image but if a user now does "src='';
src='www.example.com/someimage.gif;" the asynchronous image load doesn't get time
to reset the current image stored in memory before the subsequent image loads.
We have a strange rule in our image loading code that tells us not to fire a load
event if the new image we've loaded is the same as the old one.
https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element says
that we should fire load events when we load an image, even if its cached. This
means our practice of not firing load events when we already have an image loaded
is not consistent with the spec or what other browsers do, so always fire a load
event if we load an image. The only exception is if the load is in response to a
viewport resize event and we haven't chosen a new image to load from srcset.
BUG=472193, 7731
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192974
Patch Set 1 #Patch Set 2 : Updated #Patch Set 3 : Updated #
Total comments: 6
Patch Set 4 : Updated #
Total comments: 3
Patch Set 5 : Updated #Patch Set 6 : Updated #
Total comments: 8
Messages
Total messages: 17 (5 generated)
|