Adopt is/toHTMLMapElement for code cleanup
https://bugs.webkit.org/show_bug.cgi?id=118235
Reviewed by Andreas Kling.
To enhance readability, this patch adopts is/toHTMLMapElement.
This also helps out to reduce duplicated use of static_cast.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::getDocumentLinks):
(WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
* dom/DocumentOrderedMap.cpp:
(WebCore::keyMatchesMapName):
(WebCore::keyMatchesLowercasedMapName):
* dom/TreeScope.cpp:
(WebCore::TreeScope::getImageMap):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::imageElement):
* html/HTMLMapElement.h:
(WebCore::isHTMLMapElement):
(WebCore::toHTMLMapElement):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/html/HTMLAreaElement.cpp b/Source/WebCore/html/HTMLAreaElement.cpp
index ba4091f..f882e40 100644
--- a/Source/WebCore/html/HTMLAreaElement.cpp
+++ b/Source/WebCore/html/HTMLAreaElement.cpp
@@ -184,10 +184,10 @@
HTMLImageElement* HTMLAreaElement::imageElement() const
{
Node* mapElement = parentNode();
- if (!mapElement || !mapElement->hasTagName(mapTag))
+ if (!mapElement || !isHTMLMapElement(mapElement))
return 0;
- return static_cast<HTMLMapElement*>(mapElement)->imageElement();
+ return toHTMLMapElement(mapElement)->imageElement();
}
bool HTMLAreaElement::isKeyboardFocusable(KeyboardEvent*) const