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; |