From 58f5b77801314f0bf9a6f31063a769b87fe0e801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Thu, 19 Aug 2010 22:22:33 +0200 Subject: [PATCH] Bug 588736 - Background tabs don't scroll into view when opened from a pinned tab. r=mano --HG-- extra : rebase_source : 8a4d1132626042757cf9fa3a53a9bd0a2a443d9f --- browser/base/content/tabbrowser.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 7dccf0720e2..d93e3787024 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -2744,11 +2744,13 @@ return; if (this.mTabstrip.smoothScroll) { - let selected = this.selectedItem.getBoundingClientRect(); + let selected = !this.selectedItem.pinned && + this.selectedItem.getBoundingClientRect(); // Can we make both the new tab and the selected tab completely visible? - if (Math.max(tab.right - selected.left, selected.right - tab.left) <= - scrollRect.width) { + if (!selected || + Math.max(tab.right - selected.left, selected.right - tab.left) <= + scrollRect.width) { this.mTabstrip.ensureElementIsVisible(aTab); return; }