mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 40868. Check to see if 'docroot == this' before recursing. r=dmose
This commit is contained in:
parent
ff88c15b4a
commit
b266e10dd6
@ -1700,7 +1700,12 @@ nsXULElement::GetContainingNameSpace(nsINameSpace*& aNameSpace) const
|
|||||||
nsCOMPtr<nsIContent> docroot
|
nsCOMPtr<nsIContent> docroot
|
||||||
= dont_AddRef( mDocument->GetRootContent() );
|
= dont_AddRef( mDocument->GetRootContent() );
|
||||||
|
|
||||||
if (docroot) {
|
// Wow! Nasty cast to get an unambiguous, non-const
|
||||||
|
// nsISupports pointer. We want to make sure that we're not
|
||||||
|
// the docroot (this would otherwise spin off into infinity).
|
||||||
|
nsISupports* me = NS_STATIC_CAST(nsIStyledContent*, NS_CONST_CAST(nsXULElement*, this));
|
||||||
|
|
||||||
|
if (docroot && !::SameCOMIdentity(docroot, me)) {
|
||||||
nsCOMPtr<nsIXMLContent> xml( do_QueryInterface(docroot) );
|
nsCOMPtr<nsIXMLContent> xml( do_QueryInterface(docroot) );
|
||||||
if (xml)
|
if (xml)
|
||||||
return xml->GetContainingNameSpace(aNameSpace);
|
return xml->GetContainingNameSpace(aNameSpace);
|
||||||
|
@ -1700,7 +1700,12 @@ nsXULElement::GetContainingNameSpace(nsINameSpace*& aNameSpace) const
|
|||||||
nsCOMPtr<nsIContent> docroot
|
nsCOMPtr<nsIContent> docroot
|
||||||
= dont_AddRef( mDocument->GetRootContent() );
|
= dont_AddRef( mDocument->GetRootContent() );
|
||||||
|
|
||||||
if (docroot) {
|
// Wow! Nasty cast to get an unambiguous, non-const
|
||||||
|
// nsISupports pointer. We want to make sure that we're not
|
||||||
|
// the docroot (this would otherwise spin off into infinity).
|
||||||
|
nsISupports* me = NS_STATIC_CAST(nsIStyledContent*, NS_CONST_CAST(nsXULElement*, this));
|
||||||
|
|
||||||
|
if (docroot && !::SameCOMIdentity(docroot, me)) {
|
||||||
nsCOMPtr<nsIXMLContent> xml( do_QueryInterface(docroot) );
|
nsCOMPtr<nsIXMLContent> xml( do_QueryInterface(docroot) );
|
||||||
if (xml)
|
if (xml)
|
||||||
return xml->GetContainingNameSpace(aNameSpace);
|
return xml->GetContainingNameSpace(aNameSpace);
|
||||||
|
Loading…
Reference in New Issue
Block a user