Last Comment Bug 669762 - TabItem has incorrect close handler after unsuccessful TabItem.close() call
: TabItem has incorrect close handler after unsuccessful TabItem.close() call
Status: RESOLVED FIXED
:
Product: Firefox Graveyard
Classification: Graveyard
Component: Panorama (show other bugs)
: Trunk
: All All
: -- normal
: Firefox 8
Assigned To: Tim Taubert [:ttaubert]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-06 15:45 PDT by Tim Taubert [:ttaubert]
Modified: 2016-04-12 14:00 PDT (History)
0 users
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch v1 (3.22 KB, patch)
2011-07-06 15:48 PDT, Tim Taubert [:ttaubert]
ehsan: review+
raymond: feedback+
Details | Diff | Splinter Review

Description Tim Taubert [:ttaubert] 2011-07-06 15:45:43 PDT
GroupItem.destroy() re-adds the following "close" event handler when a TabItem could not be closed:

>  child.addSubscriber(self, "close", function() {
>    self.remove(child);
>  });

https://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabview/groupitems.js#828

This is very different from the normal close handler:

>  item.addSubscriber(this, "close", function() {
>    let count = self._children.length;
>    let dontArrange = self.expanded || !self.shouldStack(count);
>    let dontClose = !item.closedManually && gBrowser._numPinnedTabs > 0;
>    self.remove(item, {dontArrange: dontArrange, dontClose: dontClose});
>
>    if (dontArrange)
>      self._freezeItemSize(count);
>
>    if (self._children.length > 0 && self._activeTab)
>      UI.setActive(self);
>  });

https://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabview/groupitems.js#1013

We should re-add the same close handler when a TabItem could not be closed.
Comment 1 Tim Taubert [:ttaubert] 2011-07-06 15:48:25 PDT
Created attachment 544364 [details] [diff] [review]
patch v1
Comment 2 Raymond Lee [:raymondlee] 2011-07-06 20:06:33 PDT
Comment on attachment 544364 [details] [diff] [review]
patch v1

Looks good
Comment 3 Tim Taubert [:ttaubert] 2011-07-07 17:02:16 PDT
Comment on attachment 544364 [details] [diff] [review]
patch v1

Passed try:

http://tbpl.mozilla.org/?tree=Try&pusher=tim.taubert@gmx.de&rev=3efc59543378
Comment 4 Tim Taubert [:ttaubert] 2011-07-13 10:40:33 PDT
http://hg.mozilla.org/integration/fx-team/rev/8c1f92fdd9fb
Comment 5 Tim Taubert [:ttaubert] 2011-07-13 15:30:53 PDT
http://hg.mozilla.org/mozilla-central/rev/8c1f92fdd9fb

Note You need to log in before you can comment on or make changes to this bug.