Bug 1562292: Follow-up: Fix bustage in GetWindowByName after dropping removal patch. r=bustage CLOSED TREE
authorKris Maglione <maglione.k@gmail.com>
Wed, 14 Aug 2019 12:08:05 -0700
changeset 488071 0fae715f6c26e75f825c7c6cbd694d19522ebf27
parent 488070 de2caa18324b6dab0f75b760e3abdaa96bc381cd
child 488072 4477d849b72a0cf15159b1f99a8530a250575365
push id36435
push usercbrindusan@mozilla.com
push dateThu, 15 Aug 2019 09:46:49 +0000
treeherdermozilla-central@0db07ff50ab5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1562292
milestone70.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 1562292: Follow-up: Fix bustage in GetWindowByName after dropping removal patch. r=bustage CLOSED TREE MANUAL PUSH: Bustage fix.
toolkit/components/windowwatcher/nsWindowWatcher.cpp
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -1566,18 +1566,26 @@ nsWindowWatcher::GetWindowByName(const n
   nsCOMPtr<nsIDocShellTreeItem> startItem;
   GetWindowTreeItem(currentWindow, getter_AddRefs(startItem));
   if (startItem) {
     // Note: original requestor is null here, per idl comments
     startItem->FindItemWithName(aTargetName, nullptr, nullptr,
                                 /* aSkipTabGroup = */ false,
                                 getter_AddRefs(treeItem));
   } else {
+    if (aTargetName.LowerCaseEqualsLiteral("_blank") ||
+        aTargetName.LowerCaseEqualsLiteral("_top") ||
+        aTargetName.LowerCaseEqualsLiteral("_parent") ||
+        aTargetName.LowerCaseEqualsLiteral("_self")) {
+      return NS_OK;
+    }
+
     // Note: original requestor is null here, per idl comments
-    FindItemWithName(aTargetName, nullptr, nullptr, getter_AddRefs(treeItem));
+    Unused << TabGroup::GetChromeTabGroup()->FindItemWithName(
+        aTargetName, nullptr, nullptr, getter_AddRefs(treeItem));
   }
 
   if (treeItem) {
     nsCOMPtr<nsPIDOMWindowOuter> domWindow = treeItem->GetWindow();
     domWindow.forget(aResult);
   }
 
   return NS_OK;