Chromium Code Reviews| Index: third_party/WebKit/Source/core/loader/ImageLoader.cpp |
| diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp |
| index 54217197d1366496b31b96266428b4b320aabf37..74f02520228e0228d8772d8930f9f31b99fff916 100644 |
| --- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp |
| +++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp |
| @@ -425,12 +425,21 @@ void ImageLoader::UpdateFromElement(UpdateFromElementBehavior update_behavior, |
| if (!failed_load_url_.IsEmpty() && image_source_url == failed_load_url_) |
| return; |
| + if (loading_image_document_ && update_behavior == kUpdateForcedReload) { |
| + // Prepares for reloading ImageDocument. |
|
kinuko
2017/05/12 08:28:33
nit: I think we generally use imperative format fo
|
| + // We turn the ImageLoader into non-ImageDocument here, and proceed to |
| + // reloading just like an ordinary <img> element below. |
| + loading_image_document_ = false; |
| + image_resource_for_image_document_ = nullptr; |
| + ClearImage(); |
| + } |
| + |
| // Prevent the creation of a ResourceLoader (and therefore a network request) |
| // for ImageDocument loads. In this case, the image contents have already been |
| // requested as a main resource and ImageDocumentParser will take care of |
| // funneling the main resource bytes into image_, so just create an |
| // ImageResource to be populated later. |
| - if (loading_image_document_ && update_behavior != kUpdateForcedReload) { |
| + if (loading_image_document_) { |
| ImageResource* image_resource = ImageResource::Create( |
| ResourceRequest(ImageSourceToKURL(element_->ImageSourceURL()))); |
| image_resource->SetStatus(ResourceStatus::kPending); |