Index: Source/core/html/HTMLDocument.h |
diff --git a/Source/core/html/HTMLDocument.h b/Source/core/html/HTMLDocument.h |
index 6990a78bdba86226742ae5106a4008a3e70f26a3..181b94203088614b3c722ffd7b684110f29fb6b4 100644 |
--- a/Source/core/html/HTMLDocument.h |
+++ b/Source/core/html/HTMLDocument.h |
@@ -112,6 +112,18 @@ inline const HTMLDocument* toHTMLDocument(const Document* document) |
return static_cast<const HTMLDocument*>(document); |
} |
+inline HTMLDocument& toHTMLDocument(Document& document) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(document.isHTMLDocument()); |
+ return static_cast<HTMLDocument&>(document); |
+} |
+ |
+inline const HTMLDocument& toHTMLDocument(const Document& document) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(document.isHTMLDocument()); |
+ return static_cast<const HTMLDocument&>(document); |
+} |
+ |
// This will catch anyone doing an unnecessary cast. |
void toHTMLDocument(const HTMLDocument*); |