Bug 451680 - Use a more reliable function to compile and execute XBL. r+sr=bzbarsky a=dveditz

git-svn-id: svn://10.0.0.236/trunk@255085 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2008-11-18 02:21:42 +00:00
parent f4425ce2f5
commit bbcbc48d6e
4 changed files with 5 additions and 13 deletions

View File

@@ -64,7 +64,7 @@ nsXBLProtoImpl::InstallImplementation(nsXBLPrototypeBinding* aBinding, nsIConten
nsIDocument* document = aBoundElement->GetOwnerDoc();
if (!document) return NS_OK;
nsIScriptGlobalObject *global = document->GetScriptGlobalObject();
nsIScriptGlobalObject *global = document->GetScopeObject();
if (!global) return NS_OK;
nsCOMPtr<nsIScriptContext> context = global->GetContext();
@@ -122,9 +122,7 @@ nsXBLProtoImpl::InitTargetObjects(nsXBLPrototypeBinding* aBinding,
nsIDocument *ownerDoc = aBoundElement->GetOwnerDoc();
nsIScriptGlobalObject *sgo;
if (!ownerDoc || !(sgo = ownerDoc->GetScriptGlobalObject())) {
NS_ERROR("Can't find global object for bound content!");
if (!ownerDoc || !(sgo = ownerDoc->GetScopeObject())) {
return NS_ERROR_UNEXPECTED;
}

View File

@@ -132,9 +132,7 @@ nsXBLProtoImplMethod::InstallMember(nsIScriptContext* aContext,
nsIDocument *ownerDoc = aBoundElement->GetOwnerDoc();
nsIScriptGlobalObject *sgo;
if (!ownerDoc || !(sgo = ownerDoc->GetScriptGlobalObject())) {
NS_ERROR("Can't find global object for bound content!");
if (!ownerDoc || !(sgo = ownerDoc->GetScopeObject())) {
return NS_ERROR_UNEXPECTED;
}

View File

@@ -160,9 +160,7 @@ nsXBLProtoImplProperty::InstallMember(nsIScriptContext* aContext,
nsIDocument *ownerDoc = aBoundElement->GetOwnerDoc();
nsIScriptGlobalObject *sgo;
if (!ownerDoc || !(sgo = ownerDoc->GetScriptGlobalObject())) {
NS_ERROR("Can't find global object for bound content!");
if (!ownerDoc || !(sgo = ownerDoc->GetScopeObject())) {
return NS_ERROR_UNEXPECTED;
}

View File

@@ -302,11 +302,9 @@ nsXBLPrototypeHandler::ExecuteHandler(nsPIDOMEventTarget* aTarget,
return NS_OK;
}
boundGlobal = boundDocument->GetScriptGlobalObject();
boundGlobal = boundDocument->GetScopeObject();
}
// If we still don't have a 'boundGlobal', we're doomed. bug 95465.
NS_ASSERTION(boundGlobal, "failed to get the nsIScriptGlobalObject. bug 95465?");
if (!boundGlobal)
return NS_OK;