diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-11 11:32:04 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-18 13:40:17 +0000 |
commit | 31ccca0778db85c159634478b4ec7997f6704860 (patch) | |
tree | 3d33fc3afd9d5ec95541e1bbe074a9cf8da12a0e /chromium/third_party/blink/renderer/core/html/html_image_loader.cc | |
parent | 248b70b82a40964d5594eb04feca0fa36716185d (diff) | |
download | qtwebengine-chromium-31ccca0778db85c159634478b4ec7997f6704860.tar.gz |
BASELINE: Update Chromium to 80.0.3987.136
Change-Id: I98e1649aafae85ba3a83e67af00bb27ef301db7b
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/html/html_image_loader.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/html/html_image_loader.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chromium/third_party/blink/renderer/core/html/html_image_loader.cc b/chromium/third_party/blink/renderer/core/html/html_image_loader.cc index 825323c62cd..4383b9cd8bd 100644 --- a/chromium/third_party/blink/renderer/core/html/html_image_loader.cc +++ b/chromium/third_party/blink/renderer/core/html/html_image_loader.cc @@ -41,11 +41,11 @@ void HTMLImageLoader::DispatchLoadEvent() { // HTMLVideoElement uses this class to load the poster image, but it should // not fire events for loading or failure. - if (IsHTMLVideoElement(*GetElement())) + if (IsA<HTMLVideoElement>(*GetElement())) return; bool error_occurred = GetContent()->ErrorOccurred(); - if (IsHTMLObjectElement(*GetElement()) && !error_occurred) { + if (IsA<HTMLObjectElement>(*GetElement()) && !error_occurred) { // An <object> considers a 404 to be an error and should fire onerror. error_occurred = (GetContent()->GetResponse().HttpStatusCode() >= 400); } @@ -59,9 +59,9 @@ void HTMLImageLoader::NoImageResourceToLoad() { if (To<HTMLElement>(GetElement())->AltText().IsEmpty()) return; - if (auto* image = ToHTMLImageElementOrNull(GetElement())) + if (auto* image = DynamicTo<HTMLImageElement>(GetElement())) image->EnsureCollapsedOrFallbackContent(); - else if (auto* input = ToHTMLInputElementOrNull(GetElement())) + else if (auto* input = DynamicTo<HTMLInputElement>(GetElement())) input->EnsureFallbackContent(); } @@ -71,23 +71,24 @@ void HTMLImageLoader::ImageNotifyFinished(ImageResourceContent*) { ImageLoader::ImageNotifyFinished(cached_image); bool load_error = cached_image->ErrorOccurred(); - if (auto* image = ToHTMLImageElementOrNull(*element)) { + if (auto* image = DynamicTo<HTMLImageElement>(*element)) { if (load_error) image->EnsureCollapsedOrFallbackContent(); else image->EnsurePrimaryContent(); } - if (auto* input = ToHTMLInputElementOrNull(*element)) { + if (auto* input = DynamicTo<HTMLInputElement>(*element)) { if (load_error) input->EnsureFallbackContent(); else input->EnsurePrimaryContent(); } + auto* html_image_element = DynamicTo<HTMLObjectElement>(element); if ((load_error || cached_image->GetResponse().HttpStatusCode() >= 400) && - IsHTMLObjectElement(*element)) - ToHTMLObjectElement(element)->RenderFallbackContent(nullptr); + html_image_element) + html_image_element->RenderFallbackContent(nullptr); } } // namespace blink |