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

Unified Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 193583002: Use new is*Element() helper functions in inspector code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorStyleSheet.cpp
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index c6f3ea6a9dee44816416a28644559aee6b039343..8bcbe9da32d59a0bfba160c2b742e5cfa2f83538 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -26,8 +26,6 @@
#include "core/inspector/InspectorStyleSheet.h"
#include "CSSPropertyNames.h"
-#include "HTMLNames.h"
-#include "SVGNames.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "bindings/v8/ScriptRegexp.h"
@@ -44,11 +42,13 @@
#include "core/dom/Document.h"
#include "core/dom/Element.h"
#include "core/frame/PageConsole.h"
+#include "core/html/HTMLStyleElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/inspector/ContentSearchUtils.h"
#include "core/inspector/InspectorCSSAgent.h"
#include "core/inspector/InspectorPageAgent.h"
#include "core/inspector/InspectorResourceAgent.h"
+#include "core/svg/SVGStyleElement.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/text/StringBuilder.h"
@@ -1515,11 +1515,11 @@ bool InspectorStyleSheet::inlineStyleSheetText(String* result) const
Node* ownerNode = m_pageStyleSheet->ownerNode();
if (!ownerNode || ownerNode->nodeType() != Node::ELEMENT_NODE)
return false;
- Element* ownerElement = toElement(ownerNode);
+ Element& ownerElement = toElement(*ownerNode);
- if (!ownerElement->hasTagName(HTMLNames::styleTag) && !ownerElement->hasTagName(SVGNames::styleTag))
+ if (!isHTMLStyleElement(ownerElement) && !isSVGStyleElement(ownerElement))
return false;
- *result = ownerElement->textContent();
+ *result = ownerElement.textContent();
return true;
}
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698