Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: Source/core/html/HTMLImageLoader.cpp

Issue 198553002: Use new is*Element() helper functions even more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLFrameSetElement.cpp ('k') | Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « Source/core/html/HTMLFrameSetElement.cpp ('k') | Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698