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

Unified Diff: Source/core/inspector/InspectorDOMAgent.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/InspectorCanvasAgent.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDOMAgent.cpp
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index 487261abbbbde4fe66025fb89451252a8376e789..78221fb1d5ec4481aa8f09dd31f3db5b4cc9a6aa 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "core/inspector/InspectorDOMAgent.h"
-#include "HTMLNames.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/ScriptEventListener.h"
#include "core/dom/Attr.h"
@@ -363,10 +362,10 @@ void InspectorDOMAgent::unbind(Node* node, NodeToIdMap* nodesMap)
if (element->pseudoElement(AFTER))
unbind(element->pseudoElement(AFTER), nodesMap);
- if (element->hasTagName(HTMLNames::linkTag)) {
- HTMLLinkElement* linkElement = toHTMLLinkElement(element);
- if (linkElement->isImport() && linkElement->import())
- unbind(linkElement->import(), nodesMap);
+ if (isHTMLLinkElement(*element)) {
+ HTMLLinkElement& linkElement = toHTMLLinkElement(*element);
+ if (linkElement.isImport() && linkElement.import())
+ unbind(linkElement.import(), nodesMap);
}
}
@@ -1323,7 +1322,7 @@ void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId,
Node* node = assertNode(errorString, nodeId);
if (!node)
return;
- if (!node->hasTagName(inputTag) || !toHTMLInputElement(node)->isFileUpload()) {
+ if (!isHTMLInputElement(*node) || !toHTMLInputElement(*node).isFileUpload()) {
*errorString = "Node is not a file input element";
return;
}
@@ -1512,15 +1511,15 @@ PassRefPtr<TypeBuilder::DOM::Node> InspectorDOMAgent::buildObjectForNode(Node* n
forcePushChildren = true;
}
- if (element->hasTagName(linkTag)) {
- HTMLLinkElement* linkElement = toHTMLLinkElement(element);
- if (linkElement->isImport() && linkElement->import() && innerParentNode(linkElement->import()) == linkElement)
- value->setImportedDocument(buildObjectForNode(linkElement->import(), 0, nodesMap));
+ if (isHTMLLinkElement(*element)) {
+ HTMLLinkElement& linkElement = toHTMLLinkElement(*element);
+ if (linkElement.isImport() && linkElement.import() && innerParentNode(linkElement.import()) == linkElement)
+ value->setImportedDocument(buildObjectForNode(linkElement.import(), 0, nodesMap));
forcePushChildren = true;
}
- if (element->hasTagName(templateTag)) {
- value->setTemplateContent(buildObjectForNode(toHTMLTemplateElement(element)->content(), 0, nodesMap));
+ if (isHTMLTemplateElement(*element)) {
+ value->setTemplateContent(buildObjectForNode(toHTMLTemplateElement(*element).content(), 0, nodesMap));
forcePushChildren = true;
}
« no previous file with comments | « Source/core/inspector/InspectorCanvasAgent.cpp ('k') | Source/core/inspector/InspectorStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698