Adopt is/toHTMLImageElement for code cleanup
[WebKit-https.git] / Source / WebCore / page / PageSerializer.cpp
index 5377f7d..32facf6 100644 (file)
@@ -231,8 +231,8 @@ void PageSerializer::serializeFrame(Frame* frame)
         if (element->isStyledElement())
             retrieveResourcesForProperties(static_cast<StyledElement*>(element)->inlineStyle(), document);
 
-        if (element->hasTagName(HTMLNames::imgTag)) {
-            HTMLImageElement* imageElement = static_cast<HTMLImageElement*>(element);
+        if (isHTMLImageElement(element)) {
+            HTMLImageElement* imageElement = toHTMLImageElement(element);
             KURL url = document->completeURL(imageElement->getAttribute(HTMLNames::srcAttr));
             CachedImage* cachedImage = imageElement->cachedImage();
             addImageToResources(cachedImage, imageElement->renderer(), url);