Bug 1320564 - Fix the default value logic for "selected" when creating a new tab. r=sebastian draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 27 Nov 2016 18:46:53 +0100
changeset 444200 a1d957de82a5e1ec9bf9162e1f01641e34e16ab4
parent 444181 b5047d193426ebd16ee4f9375bfa06dc2e9773a5
child 538262 5c38fd6e22817590af9b96faa27b2b981c1f25a8
push id37229
push usermozilla@buttercookie.de
push dateSun, 27 Nov 2016 18:18:11 +0000
reviewerssebastian
bugs1320564
milestone53.0a1
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
@@ -3488,17 +3488,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);