mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 22:27:31 +09:00
Bug 1466991 - Part 1: Factor out ShouldUseXBLScope.
This commit is contained in:
parent
44998d1f5b
commit
34f16bf61c
1 changed files with 17 additions and 1 deletions
|
|
@ -3439,13 +3439,29 @@ nsINode::OwnerDocAsNode() const
|
||||||
return OwnerDoc();
|
return OwnerDoc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ShouldUseXBLScope is defined here as a template so that we can get the faster
|
||||||
|
// version of IsInAnonymousSubtree if we're statically known to be an
|
||||||
|
// nsIContent. we could try defining ShouldUseXBLScope separately on nsINode
|
||||||
|
// and nsIContent, but then we couldn't put its nsINode implementation here
|
||||||
|
// (because this header does not include nsIContent) and we can't put it in
|
||||||
|
// nsIContent.h, because the definition of nsIContent::IsInAnonymousSubtree is
|
||||||
|
// in nsIContentInlines.h. And then we get include hell from people trying to
|
||||||
|
// call nsINode::GetParentObject but not including nsIContentInlines.h and with
|
||||||
|
// no really good way to include it.
|
||||||
|
template<typename T>
|
||||||
|
inline bool ShouldUseXBLScope(const T* aNode)
|
||||||
|
{
|
||||||
|
return aNode->IsInAnonymousSubtree() &&
|
||||||
|
!aNode->IsAnonymousContentInSVGUseSubtree();
|
||||||
|
}
|
||||||
|
|
||||||
inline mozilla::dom::ParentObject
|
inline mozilla::dom::ParentObject
|
||||||
nsINode::GetParentObject() const
|
nsINode::GetParentObject() const
|
||||||
{
|
{
|
||||||
mozilla::dom::ParentObject p(OwnerDoc());
|
mozilla::dom::ParentObject p(OwnerDoc());
|
||||||
// Note that mUseXBLScope is a no-op for chrome, and other places where we
|
// Note that mUseXBLScope is a no-op for chrome, and other places where we
|
||||||
// don't use XBL scopes.
|
// don't use XBL scopes.
|
||||||
p.mUseXBLScope = IsInAnonymousSubtree() && !IsAnonymousContentInSVGUseSubtree();
|
p.mUseXBLScope = ShouldUseXBLScope(this);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue