Bug 986730 - Add a dynamic accessor to determine whether a node is in an anonymous subtree. r=smaug

This commit is contained in:
Bobby Holley 2014-04-06 12:32:38 -07:00
parent cd810d2973
commit e0121ab8a2
2 changed files with 16 additions and 0 deletions

View File

@ -440,6 +440,10 @@ public:
* IsContent() is true. This is defined inline in nsIContent.h.
*/
nsIContent* AsContent();
const nsIContent* AsContent() const
{
return const_cast<nsINode*>(this)->AsContent();
}
virtual nsIDOMNode* AsDOMNode() = 0;
@ -1005,6 +1009,8 @@ public:
#endif
}
bool IsInAnonymousSubtree() const;
// True for native anonymous content and for XBL content if the binging
// has chromeOnlyContent="true".
bool ChromeOnlyAccess() const

View File

@ -365,6 +365,16 @@ nsINode::CheckNotNativeAnonymous() const
}
#endif
bool
nsINode::IsInAnonymousSubtree() const
{
if (!IsContent()) {
return false;
}
return AsContent()->IsInAnonymousSubtree();
}
nsresult
nsINode::GetParentNode(nsIDOMNode** aParentNode)
{