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

Unified Diff: Source/core/html/HTMLHtmlElement.h

Issue 19098002: Introduce isHTMLHtmlElement and toHTMLHtmlElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 5 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/editing/markup.cpp ('k') | Source/core/html/PluginDocument.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLHtmlElement.h
diff --git a/Source/core/html/HTMLHtmlElement.h b/Source/core/html/HTMLHtmlElement.h
index 6ac6ed49d03bc7126a401af266fa25e0e1ed0466..3dad99972c1735a801585fa8fef2c04deef20806 100644
--- a/Source/core/html/HTMLHtmlElement.h
+++ b/Source/core/html/HTMLHtmlElement.h
@@ -41,6 +41,22 @@ private:
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
};
+inline bool isHTMLHtmlElement(const Node* node)
+{
+ return node->hasTagName(HTMLNames::htmlTag);
+}
+
+inline bool isHTMLHtmlElement(const Element* element)
+{
+ return element->hasTagName(HTMLNames::htmlTag);
+}
+
+inline HTMLHtmlElement* toHTMLHtmlElement(Node* node)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLHtmlElement(node));
+ return static_cast<HTMLHtmlElement*>(node);
+}
+
} // namespace
#endif
« no previous file with comments | « Source/core/editing/markup.cpp ('k') | Source/core/html/PluginDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698