Adopt is/toHTMLStyleElement for minor code cleanup
https://bugs.webkit.org/show_bug.cgi?id=117917

Reviewed by Antti Koivisto.

This patch refers to http://src.chromium.org/viewvc/blink?view=revision&revision=152853

There are some usages of static_cast to HTMLStyleElement so this patch creates toHTMLStyleElement
function for code cleanup. Plus, isHTMLStyleElement is also made for same purpose.

* css/CSSStyleSheet.cpp:
(WebCore::isAcceptableCSSStyleSheetParent):
* css/StyleScopeResolver.cpp:
(WebCore::StyleScopeResolver::scopeFor):
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::getNamedItem):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
* dom/Node.cpp:
(WebCore::Node::numberOfScopedHTMLStyleChildren):
* html/HTMLStyleElement.h:
(WebCore::isHTMLStyleElement):
(WebCore::toHTMLStyleElement):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::viaInspectorStyleSheet):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::inlineStyleSheetText):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/inspector/InspectorCSSAgent.cpp b/Source/WebCore/inspector/InspectorCSSAgent.cpp
index aa6115c..9cf0c80 100644
--- a/Source/WebCore/inspector/InspectorCSSAgent.cpp
+++ b/Source/WebCore/inspector/InspectorCSSAgent.cpp
@@ -1225,7 +1225,7 @@
 
     CSSStyleSheet* cssStyleSheet = 0;
     if (styleElement->isHTMLElement())
-        cssStyleSheet = static_cast<HTMLStyleElement*>(styleElement.get())->sheet();
+        cssStyleSheet = toHTMLStyleElement(styleElement.get())->sheet();
 #if ENABLE(SVG)
     else if (styleElement->isSVGElement())
         cssStyleSheet = static_cast<SVGStyleElement*>(styleElement.get())->sheet();