Open main menu

CDOT Wiki β

Changes

Dive into Mozilla Modifying Firefox Lab

846 bytes added, 15:39, 12 March 2007
Success
This means that six lines of code become two, and with that reduction in number of lines, hopefully a reduction in new bugs I've added (NOTE: within reason, favour fewer rather than more lines of code).
 
Speaking of bugs, a closer read of '''addTab''' (see [http://lxr.mozilla.org/seamonkey/source/toolkit/content/widgets/tabbrowser.xml#1219 line 1219]) would indicate that we've introduced a few with our new positioning code:
 
// wire up a progress listener for the new browser object.
var position = this.mTabContainer.childNodes.length-1;
var tabListener = this.mTabProgressListener(t, b, blank);
...
this.mTabListeners[position] = tabListener;
this.mTabFilters[position] = filter;
...
t._tPos = position;
 
Where the assumption before was that the newly created tab was at the end of the list, the new code breaks that. Therefore, we also need to update the value of '''position'''
 
// wire up a progress listener for the new browser object.
var position = currentTabIndex + 1
No other obvious defects are visible from our changes.
=Reflections=