Bug 464174. r=sicking, sr=sicking, a=beltzner
--- a/content/xbl/src/nsXBLBinding.cpp
+++ b/content/xbl/src/nsXBLBinding.cpp
@@ -201,16 +201,17 @@ XBLResolve(JSContext *cx, JSObject *obj,
if (!context) {
return JS_TRUE;
}
// Now we either resolve or fail
PRBool didInstall;
nsresult rv = field->InstallField(context, origObj,
+ content->NodePrincipal(),
protoBinding->DocURI(),
&didInstall);
if (NS_FAILED(rv)) {
if (!::JS_IsExceptionPending(cx)) {
nsDOMClassInfo::ThrowJSException(cx, rv);
}
return JS_FALSE;
--- a/content/xbl/src/nsXBLProtoImplField.cpp
+++ b/content/xbl/src/nsXBLProtoImplField.cpp
@@ -89,16 +89,17 @@ nsXBLProtoImplField::AppendFieldText(con
mFieldText = ToNewUnicode(aText);
mFieldTextLength = aText.Length();
}
}
nsresult
nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
JSObject* aBoundNode,
+ nsIPrincipal* aPrincipal,
nsIURI* aBindingDocURI,
PRBool* aDidInstall) const
{
NS_PRECONDITION(aBoundNode,
"uh-oh, bound node should NOT be null or bad things will "
"happen");
*aDidInstall = PR_FALSE;
@@ -126,17 +127,17 @@ nsXBLProtoImplField::InstallField(nsIScr
// compile the literal string
// XXX Could we produce a better principal here? Should be able
// to, really!
PRBool undefined;
nsCOMPtr<nsIScriptContext> context = aContext;
rv = context->EvaluateStringWithValue(nsDependentString(mFieldText,
mFieldTextLength),
aBoundNode,
- nsnull, uriSpec.get(),
+ aPrincipal, uriSpec.get(),
mLineNumber, JSVERSION_LATEST,
(void*) &result, &undefined);
if (NS_FAILED(rv))
return rv;
// If EvaluateStringWithValue() threw an exception, just report it now.
// Failure to evaluate a field should stop neither the get of the field value
// nor an enumeration attempt.
--- a/content/xbl/src/nsXBLProtoImplField.h
+++ b/content/xbl/src/nsXBLProtoImplField.h
@@ -59,16 +59,17 @@ public:
mLineNumber = aLineNumber;
}
nsXBLProtoImplField* GetNext() const { return mNext; }
void SetNext(nsXBLProtoImplField* aNext) { mNext = aNext; }
nsresult InstallField(nsIScriptContext* aContext,
JSObject* aBoundNode,
+ nsIPrincipal* aPrincipal,
nsIURI* aBindingDocURI,
PRBool* aDidInstall) const;
const PRUnichar* GetName() const { return mName; }
protected:
nsXBLProtoImplField* mNext;
PRUnichar* mName;