DescriptionFix ImageLoader::m_hasPendingLoadEvent/m_imageComplete in ImageDocument
Case 1: When a image is loaded as a subresource, loading is stared by
ImageResource::fetch() in ImageLoader::doUpdateFromElement().
Case 2: When a image is loaded as a main document, the start of the loading is
emulated by setImage() in ImageLoader::updateFromElement() and
ImageDocumentParser will do the subsequent loading steps.
However in Case 2, |m_hasPendingLoadEvent| is set to false
(in setImageWithoutConsideringPendingLoadEvent()), causing |imageStillLoading|
to be false and ensureFallbackContent() to be called in
HTMLImageElement::selectSourceURL(), and thus a box indicating a broken image
is displayed during loading instead of the image displayed progressively.
This is regression since https://codereview.chromium.org/1879793003.
This CL makes the behavior of Case 1 and 2 consistent, by moving what is done
in Case 1 to setImagePending(), and makes Case 1 and 2 both to call
setImagePending().
This CL also adds a layout test to confirm that an image is displayed
progressively when loaded as a main document.
BUG=632495
Committed: https://crrev.com/576c7a048bfc30faf510eeda07f303fa9dd12898
Cr-Commit-Position: refs/heads/master@{#414008}
Patch Set 1 #Patch Set 2 : Add comments #Patch Set 3 : Add comments #Patch Set 4 : Rebase (First Commit) #Patch Set 5 : Rebase. #Patch Set 6 : Rebase #
Depends on Patchset: Messages
Total messages: 23 (11 generated)
|