diff options
-rw-r--r-- | dom/base/nsIContent.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h index edb0d69f3..25b582abd 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -1028,9 +1028,17 @@ inline nsIContent* nsINode::AsContent() { \ return aContent->_check ? static_cast<_class*>(aContent) : nullptr; \ } \ + static const _class* FromContent(const nsIContent* aContent) \ + { \ + return aContent->_check ? static_cast<const _class*>(aContent) : nullptr; \ + } \ static _class* FromContentOrNull(nsIContent* aContent) \ { \ return aContent ? FromContent(aContent) : nullptr; \ + } \ + static const _class* FromContentOrNull(const nsIContent* aContent) \ + { \ + return aContent ? FromContent(aContent) : nullptr; \ } #define NS_IMPL_FROMCONTENT(_class, _nsid) \ |