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

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

Issue 195813003: Use new is*Element() helper functions further more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix bad assertion 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
Index: Source/core/html/HTMLMapElement.cpp
diff --git a/Source/core/html/HTMLMapElement.cpp b/Source/core/html/HTMLMapElement.cpp
index 02c70e977a7fe086c09bb0e45555cba40f0364e2..88938ef4e3545932c1fe1de037b019ec9ec3e60d 100644
--- a/Source/core/html/HTMLMapElement.cpp
+++ b/Source/core/html/HTMLMapElement.cpp
@@ -74,15 +74,14 @@ HTMLImageElement* HTMLMapElement::imageElement()
{
RefPtr<HTMLCollection> images = document().images();
for (unsigned i = 0; Element* curr = images->item(i); i++) {
- if (!curr->hasTagName(imgTag))
- continue;
+ ASSERT(isHTMLImageElement(curr));
adamk 2014/03/13 20:20:36 I take it this is just asserting that Document::im
// The HTMLImageElement's useMap() value includes the '#' symbol at the beginning,
// which has to be stripped off.
- HTMLImageElement* imageElement = toHTMLImageElement(curr);
- String useMapName = imageElement->getAttribute(usemapAttr).string().substring(1);
+ HTMLImageElement& imageElement = toHTMLImageElement(*curr);
+ String useMapName = imageElement.getAttribute(usemapAttr).string().substring(1);
if (equalIgnoringCase(useMapName, m_name))
- return imageElement;
+ return &imageElement;
}
return 0;

Powered by Google App Engine
This is Rietveld 408576698