Index: Source/core/html/HTMLImageLoader.cpp |
diff --git a/Source/core/html/HTMLImageLoader.cpp b/Source/core/html/HTMLImageLoader.cpp |
index c884f3ccba3035b881242ccbb69c1ae7e8cd5f81..0669640623baceb83d1b053ee7b054c813817a85 100644 |
--- a/Source/core/html/HTMLImageLoader.cpp |
+++ b/Source/core/html/HTMLImageLoader.cpp |
@@ -44,12 +44,12 @@ HTMLImageLoader::~HTMLImageLoader() |
void HTMLImageLoader::dispatchLoadEvent() |
{ |
// HTMLVideoElement uses this class to load the poster image, but it should not fire events for loading or failure. |
- if (element()->hasTagName(HTMLNames::videoTag)) |
+ if (isHTMLVideoElement(*element())) |
return; |
bool errorOccurred = image()->errorOccurred(); |
if (!errorOccurred && image()->response().httpStatusCode() >= 400) |
- errorOccurred = element()->hasTagName(HTMLNames::objectTag); // An <object> considers a 404 to be an error and should fire onerror. |
+ errorOccurred = isHTMLObjectElement(*element()); // An <object> considers a 404 to be an error and should fire onerror. |
element()->dispatchEvent(Event::create(errorOccurred ? EventTypeNames::error : EventTypeNames::load)); |
} |
@@ -67,7 +67,7 @@ void HTMLImageLoader::notifyFinished(Resource*) |
bool loadError = cachedImage->errorOccurred() || cachedImage->response().httpStatusCode() >= 400; |
- if (loadError && element->hasTagName(HTMLNames::objectTag)) |
+ if (loadError && isHTMLObjectElement(*element)) |
toHTMLObjectElement(element)->renderFallbackContent(); |
} |