Bug 661746 - Part of part 2: Introduce a const AsElement(). r=bzbarsky

This commit is contained in:
David Zbarsky 2012-06-23 08:57:57 +02:00
parent d91f9e40f3
commit df2d9e3aea
2 changed files with 7 additions and 0 deletions

View File

@ -265,4 +265,10 @@ inline mozilla::dom::Element* nsINode::AsElement()
return static_cast<mozilla::dom::Element*>(this);
}
inline const mozilla::dom::Element* nsINode::AsElement() const
{
MOZ_ASSERT(IsElement());
return static_cast<const mozilla::dom::Element*>(this);
}
#endif // mozilla_dom_Element_h__

View File

@ -373,6 +373,7 @@ public:
* for which IsElement() is true. This is defined inline in Element.h.
*/
mozilla::dom::Element* AsElement();
const mozilla::dom::Element* AsElement() const;
/**
* Return this node as nsIContent. Should only be used for nodes for which