Status

()

6 years ago
a year ago

People

(Reporter: reuben, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Created attachment 643002 [details]
Screen recording

When closing tabs that have content allocating a lot of memory there is a large delay between clicking the close button and the tab being closed and removed from the tab strip. We should remove it from the tab strip asynchronously while content is still being destroyed.

I can reproduce this with long running Facebook, Netflix and Vimeo (with long HD videos) tabs. Chrome doesn't seem to be affected at all by content when closing tabs, and Safari has a much smaller but still noticeable delay.
OS: Mac OS X → All
Hardware: x86 → All
Any chance to profile what takes so long until the animation kicks in? Removing a tab is actually split into two steps:

1) We mark the tab as closing and call docShell.contentViewer.permitUnload(). We fire the TabClose event and kick off the animation.

2) When the transition has ended (we received the transitionend event) then we're finally destroying the whole tab and its browser.

So it's not really asynchronous but at least everything should be done *after* the animation has almost ended.
Bug 754495 supposedly fixed aspects of this.

Also, it looks like you set browser.tabs.autoHide to true, which isn't the default setting.
(Reporter)

Comment 3

6 years ago
(In reply to Tim Taubert [:ttaubert] from comment #1)
> Any chance to profile what takes so long until the animation kicks in?

Sure, is the built-in Gecko profiler capable of doing this or should I use other tools?

> Removing a tab is actually split into two steps:
> 
> 1) We mark the tab as closing and call
> docShell.contentViewer.permitUnload(). We fire the TabClose event and kick
> off the animation.
> 
> 2) When the transition has ended (we received the transitionend event) then
> we're finally destroying the whole tab and its browser.
> 
> So it's not really asynchronous but at least everything should be done
> *after* the animation has almost ended.

So event handlers for page close that take a long time to execute should only be running after the tab is gone (or transitioning) from the tab strip? If that's the case, I'm very curious to what's causing this, specially for pages that don't use plugins, like Facebook.

(In reply to Dão Gottwald [:dao] from comment #2)
> Bug 754495 supposedly fixed aspects of this.
> 
> Also, it looks like you set browser.tabs.autoHide to true, which isn't the
> default setting.

Yes, Silverlight fullscreen on Netflix causes FPS drops so I have to hide the chrome manually, but I don't think that's related to the problem, as I've reproduced it with browser.tabs.autoHide=false before.
Blocks: 593680
You need to log in before you can comment on or make changes to this bug.