Do more check in gBrowser.moveTabTo

UNCONFIRMED
Unassigned

Status

()

UNCONFIRMED
8 years ago
5 years ago

People

(Reporter: tabutils+bugzilla, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0b8pre) Gecko/20101122 Firefox/4.0b8pre
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b8pre) Gecko/20101122 Firefox/4.0b8pre

In trunk, gBrowser.moveTabTo now checks whether aIndex == aTab._tPos before it goes. But if aIndex falls out of [0, gBrowser.mTabs.length - 1], it still goes. This will lead to improper behavior.

Reproducible: Always
(Reporter)

Updated

8 years ago
Version: unspecified → Trunk
Can you give an URL to the code in question?
(Reporter)

Comment 2

8 years ago
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#1983

1988           var oldPosition = aTab._tPos;
1989           if (oldPosition == aIndex)
1990             return;
As far as I can see we never have checked for the correct bounds in this method. Dao, could you please give a feedback on it?
(Reporter)

Comment 4

8 years ago
Fx3.6 doesn't check "oldPosition == aIndex", but Fx4 does. It should check more like gBrowser.selectTabAtIndex.
You need to log in before you can comment on or make changes to this bug.