Tab that changed content process while in the background stays blank or shows the spinner forever when selected
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: rath, Assigned: dao)
References
(Blocks 3 open bugs)
Details
Attachments
(1 file, 1 external file, 3 obsolete files)
|
278.46 KB,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:155.0) Gecko/20100101 Firefox/155.0
Steps to reproduce:
- Drag a word from a web page onto the empty area of the tab strip.
- Click the new tab.
- Content not shown.
Actual results:
The content area stays grey. The page itself loaded (the Inspector shows its DOM).
Reloading and switching to another tab and back do not help. Only opening a new tab does.
State of the stuck tab (Browser Console):
- browser: pendingpaint=true, opacity 0, renderLayers=false, hasLayers=false, docShellIsActive=false
- gBrowser._switcher: still alive, getTabState(tab)=1 (STATE_LOADING), requestedTab=tab, spinnerTab=tab, loadingTab=null, loadTimer=null, windowHidden=false
Running gBrowser.selectedBrowser.docShellIsActive = true makes the content appear immediately.
Expected results:
The page should be displayed once it has loaded.
Comment 1•2 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Tabbed Browser' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 months ago
|
||
Can you give us your profile info from about:support so we can see what preferences have been modified? Instructions are here: https://support.mozilla.org/en-US/kb/use-troubleshooting-information-page-fix-firefox
| Reporter | ||
Comment 3•2 months ago
|
||
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 5•2 months ago
|
||
Reproduced on Nightly 158 (Linux, Fission). Three things line up.
-
ChromeUtils.predictRemoteTypeForURI("hello")returnswebIsolated=http://hello- the search term is read as a hostname. The dropped-text tab is therefore created in a throwaway process, and the keyword-fixed-up search URL forces a process switch. -
Hovering the new tab warms it.
AsyncTabSwitcher.setTabState's STATE_LOADING branch setsrenderLayers = truebut deliberately leavesdocShellIsActivefalse for a warming tab. -
The process switch lands on that state before the tab has presented. Tabbrowser's
WillChangeBrowserRemotenesshandler endsdidChangewithbrowser.docShellIsActive = browser.docShellIsActive, which reads false and writes false onto the new frameloader; that setter also clearsrenderLayers.onRemotenessChangerepairs only a tab in STATE_LOADED, so a tab in STATE_LOADING keeps the recorded state with neither flag set.
Nothing gets it back out. setTabState returns early when the state is unchanged, so loadRequestedTab() on selection is a no-op; unloadNonRequiredTabs only demotes STATE_LOADED tabs, so switching away and back doesn't reset it either. numPending stays at 1, finish() never runs, and updateDisplay keeps the spinner up.
Repro: a local server holding its response 900ms, a tab whose predicted remote type is wrong for what it loads, gBrowser.warmupTab(tab) fired a few ms after the response arrives, then select the tab. 2 of 10 offsets across that window reproduce the reported state exactly - getTabState 1, spinnerTab set, loadTimer and loadingTab null, pendingpaint, and renderLayers/hasLayers/docShellIsActive all false. With browser.tabs.remote.warmup.enabled=false, 0 of 10.
The fix belongs in onRemotenessChange: a tab in STATE_LOADING needs renderLayers re-applied to the new frameloader, the same way a tab in STATE_LOADED is put back into STATE_LOADING today.
The remote type prediction looks like a separate bug worth filing - every keyword drop on the tab strip launches a throwaway webIsolated=http://<term> process and guarantees a process switch.
| Assignee | ||
Comment 6•2 months ago
|
||
| Assignee | ||
Comment 7•2 months ago
|
||
The reported hang is the STATE_LOADING case; STATE_UNLOADING has the same shape and leaves the switcher unable to finish, but I have no repro for it.
| Assignee | ||
Comment 8•2 months ago
|
||
The BrowsingContext keeps its active state across the swap, but renderLayers, layer preservation and the priority hint live on the BrowserParent and were lost, and the destroyed BrowserParent skips its MozLayerTreeCleared, so AsyncTabSwitcher could wait forever on a warmed or unloading tab.
Updated•2 months ago
|
| Assignee | ||
Comment 9•2 months ago
|
||
The frameloader replacement now carries the layer state over itself; the self-assign turned rendering off again for a warmed tab.
Updated•2 months ago
|
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
Updated•2 months ago
|
Comment 10•2 months ago
|
||
Comment 11•2 months ago
|
||
| bugherder | ||
Updated•1 month ago
|
Comment 12•1 month ago
|
||
I was able to reproduce the issue on Ubuntu 24.04 using Firefox build 158.01a.
Verified as fixed on Ubuntu 24.04 using Firefox build 159.0a1 and 158.0b2.
Description
•