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 179366 4bb76e736c87fc96dad339d6d1733fbc0e728c1b
parent 179365 d9c61e48f276fda325e6f393fee5231bccd4fd64
child 179367 5f6b38f0b281ed6d1629097bf0ea53024310f9bf
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersbz
bugs997067
milestone31.0a1
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());