Bug 997067 - Remove the special behavior for chrome navigating non-chrome windows. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Thu, 17 Apr 2014 00:02:36 -0700
changeset 198658 4bb76e736c87fc96dad339d6d1733fbc0e728c1b
parent 198657 d9c61e48f276fda325e6f393fee5231bccd4fd64
child 198659 5f6b38f0b281ed6d1629097bf0ea53024310f9bf
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs997067
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 997067 - Remove the special behavior for chrome navigating non-chrome windows. r=bz Considering what is actually done with sourceWindow here, I don't think this check is doing anything useful in the modern world.
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -12457,19 +12457,18 @@ nsGlobalWindow::GetScrollFrame()
   }
   return nullptr;
 }
 
 nsresult
 nsGlobalWindow::SecurityCheckURL(const char *aURL)
 {
   nsCOMPtr<nsPIDOMWindow> sourceWindow;
-  nsCOMPtr<nsIDOMChromeWindow> asChrome = do_QueryObject(this);
-  JSContext *topCx = nsContentUtils::GetCurrentJSContext();
-  if (nsContentUtils::IsCallerChrome() && !asChrome && topCx) {
+  JSContext* topCx = nsContentUtils::GetCurrentJSContext();
+  if (topCx) {
     sourceWindow = do_QueryInterface(nsJSUtils::GetDynamicScriptGlobal(topCx));
   }
   if (!sourceWindow) {
     sourceWindow = this;
   }
   AutoJSContext cx;
   nsGlobalWindow* sourceWin = static_cast<nsGlobalWindow*>(sourceWindow.get());
   JSAutoCompartment ac(cx, sourceWin->GetGlobalJSObject());