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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user