diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-04-16 17:53:41 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-04-16 17:53:41 -0400 |
commit | 2c4d69359fc76d115c62e14383c4eef21f6b1ba5 (patch) | |
tree | 27d93b7277373059e0eea05fb1339037865ebdd5 | |
parent | 1f5c67934f05d036de575c3d8172587fa6d398bc (diff) | |
download | UXP-2c4d69359fc76d115c62e14383c4eef21f6b1ba5.tar UXP-2c4d69359fc76d115c62e14383c4eef21f6b1ba5.tar.gz UXP-2c4d69359fc76d115c62e14383c4eef21f6b1ba5.tar.lz UXP-2c4d69359fc76d115c62e14383c4eef21f6b1ba5.tar.xz UXP-2c4d69359fc76d115c62e14383c4eef21f6b1ba5.zip |
Issue #1375 - Overload FromContent() to work with const
-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) \ |