Bug 1320564 - Fix the default value logic for "selected" when creating a new tab. r=sebastian
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 27 Nov 2016 18:46:53 +0100
changeset 324589 6b4ddaf6c2762ba93489f69a28b781abd8e702eb
parent 324588 e0cb97c2a0956ae1457c4cf9026f8e520c8bb0a4
child 324590 be6f5b8a484e90088ec40f4ae18a5e009e1979ec
push id84456
push usercbook@mozilla.com
push dateTue, 29 Nov 2016 15:49:58 +0000
treeherdermozilla-inbound@00596bfe1df0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1320564
milestone53.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 1320564 - Fix the default value logic for "selected" when creating a new tab. r=sebastian The idea is that cancelling edit mode when opening a new tab implies that we want to select it as well, otherwise we wouldn't have to cancel edit mode in the first place. MozReview-Commit-ID: Gova1ymzlHn
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3490,17 +3490,18 @@ Tab.prototype = {
 
       let message = {
         type: "Tab:Added",
         tabID: this.id,
         uri: truncate(uri, MAX_URI_LENGTH),
         parentId: ("parentId" in aParams) ? aParams.parentId : -1,
         tabIndex: ("tabIndex" in aParams) ? aParams.tabIndex : -1,
         external: ("external" in aParams) ? aParams.external : false,
-        selected: ("selected" in aParams || aParams.cancelEditMode === true) ? aParams.selected : true,
+        selected: ("selected" in aParams || aParams.cancelEditMode === true)
+                  ? aParams.selected !== false || aParams.cancelEditMode === true : true,
         cancelEditMode: aParams.cancelEditMode === true,
         title: truncate(title, MAX_TITLE_LENGTH),
         delayLoad: aParams.delayLoad || false,
         desktopMode: this.desktopMode,
         isPrivate: isPrivate,
         stub: stub
       };
       Messaging.sendRequest(message);