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

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

Issue 23680013: Add const versions of some toHTMLFooElement(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/html/HTMLMetaElement.h ('k') | Source/web/WebPageSerializerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLObjectElement.h
diff --git a/Source/core/html/HTMLObjectElement.h b/Source/core/html/HTMLObjectElement.h
index 53865d0a1e225dc07e7a091766dbaea54c887ce9..99a12ba6ef979af98a5298a17c77563d786e5d17 100644
--- a/Source/core/html/HTMLObjectElement.h
+++ b/Source/core/html/HTMLObjectElement.h
@@ -119,6 +119,16 @@ inline HTMLObjectElement* toHTMLObjectElement(Node* node)
return static_cast<HTMLObjectElement*>(node);
}
+inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* element)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement());
+ const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement*>(element);
+ // We need to assert after the cast because FormAssociatedElement doesn't
+ // have hasTagName.
+ ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName(HTMLNames::objectTag));
+ return objectElement;
+}
+
}
#endif
« no previous file with comments | « Source/core/html/HTMLMetaElement.h ('k') | Source/web/WebPageSerializerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698