From b31208c5bf9184ca77d9b5b86d531f32de039e62 Mon Sep 17 00:00:00 2001 From: "alqahira%ardisson.org" Date: Sat, 24 Jul 2010 21:31:26 +0000 Subject: [PATCH] Bug 568564. Suppress the script filename for cross-origin onerror events. Patch by Boris Zbarsky , r=jst, a1.9.0.next=dveditz git-svn-id: svn://10.0.0.236/trunk@260880 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/test/test_bug461735.html | 12 +++++++++++- mozilla/dom/src/base/nsJSEnvironment.cpp | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mozilla/content/base/test/test_bug461735.html b/mozilla/content/base/test/test_bug461735.html index 7761c7aaf0f..5c6bcc80ddc 100644 --- a/mozilla/content/base/test/test_bug461735.html +++ b/mozilla/content/base/test/test_bug461735.html @@ -17,21 +17,31 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=461735
 
 
+
 
 
+
 
diff --git a/mozilla/dom/src/base/nsJSEnvironment.cpp b/mozilla/dom/src/base/nsJSEnvironment.cpp index 9343645bf0a..91648bc2c60 100644 --- a/mozilla/dom/src/base/nsJSEnvironment.cpp +++ b/mozilla/dom/src/base/nsJSEnvironment.cpp @@ -480,6 +480,13 @@ public: NS_WARNING("Not same origin error!"); errorevent.errorMsg = xoriginMsg.get(); errorevent.lineNr = 0; + // FIXME: once the principal of the script is not tied to + // the filename, we can stop using the post-redirect + // filename if we want and remove this line. Note that + // apparently we can't handle null filenames in the error + // event dispatching code. + static PRUnichar nullFilename[] = { PRUnichar(0) }; + errorevent.fileName = nullFilename; } nsEventDispatcher::Dispatch(win, presContext, &errorevent, nsnull,