Closed Bug 1912672 Opened 2 months ago Closed 25 days ago

Auto Picture-In Mode causes a page freeze after opening a new tab and moving that new tab over to another screen.

Categories

(Toolkit :: Picture-in-Picture, defect, P1)

Firefox 130
Desktop
All
defect

Tracking

()

VERIFIED FIXED
132 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox129 --- unaffected
firefox130 --- wontfix
firefox131 --- wontfix
firefox132 --- verified

People

(Reporter: masterchiefsparten9, Assigned: mconley)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-quality-foundation?])

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0

Steps to reproduce:

-Open a video
-Open a new tab
-Drag tab to another screen or separate it into a new window
-The video page source will freeze and will no longer be loaded.

Actual results:

After dragging a new tab over to another screen or using it to open a new window with Auto Picture-In mode enabled the source page of the video freezes and or bugs out resulting in the video still playing but the page no longer being loaded (See screenshot).

Expected results:

After dragging a new tab over to another screen or using the tab to open a new window, Auto Picture-In should collapse back into the page source and the page should be back to normal.

Component: Untriaged → General
OS: Unspecified → Windows 11
Hardware: Unspecified → Desktop

Specific Firefox Version is Beta 130.0b3. I am assuming on Nightly 131 this also happens but not sure.

Summary: Auto Picture-In Mode causes a page freeze after opening a new tab and move that new tab over to another screen. → Auto Picture-In Mode causes a page freeze after opening a new tab and moving that new tab over to another screen.
Component: General → Picture-in-Picture
Product: Firefox → Toolkit
Severity: -- → S3
Priority: -- → P1

We have managed to reproduce this issue in Windows 10/11, MacOS11/14 and Ubuntu 22 using these steps:

  1. Open the browser and enable PiP auto-trigger.
  2. Play a YT video (longer than 45s)
  3. Open a new tab.
  4. Drag the new tab out of the window OR Right-click the new tab and choose the context menu option "Move tab" -> "To new window"
    (Such that the tab with the source video is coming in the foreground, but it does not get focus)

Actual: The tab with the source video is frozen while still playing the sound of the video. Refreshing the frozen page does not resolve the issue, but closing the tab and restoring it resolves it.

Expected: The tab with the source video does not get frozen.

Note: A second monitor/screen is not necessary to reproduce this bug, but it is somewhat of an edge case.

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
OS: Windows 11 → All

(In reply to Daniel Bodea [:danibodea] from comment #2)

We have managed to reproduce this issue in Windows 10/11, MacOS11/14 and Ubuntu 22 using these steps:

  1. Open the browser and enable PiP auto-trigger.
  2. Play a YT video (longer than 45s)
  3. Open a new tab.
  4. Drag the new tab out of the window OR Right-click the new tab and choose the context menu option "Move tab" -> "To new window"
    (Such that the tab with the source video is coming in the foreground, but it does not get focus)

Actual: The tab with the source video is frozen while still playing the sound of the video. Refreshing the frozen page does not resolve the issue, but closing the tab and restoring it resolves it.

Expected: The tab with the source video does not get frozen.

Note: A second monitor/screen is not necessary to reproduce this bug, but it is somewhat of an edge case.

Yes and as of right now the only way to prevent this from happening is to simply just pause the video before you move a new tab to another window. Also I did mention in the full post that another screen isn't just causing it, but I should have changed the title to make that more clear.

Whiteboard: [fidefe-quality-foundation?]

Hey Daniele, have you had a chance to look at this one?

Flags: needinfo?(danieleferla1)

Hi Mike :)

I tried to see what the issue is during this weekend, but I couldn't underpin anything specific (also I'm having some problems with the Browser Toolbox).

On top of the issue, I noticed that, once the bug has been triggered, I can see that the spinner animation appears everytime I load a new page. Maybe there is something going awry not just tab-wise, but browser-wise!

Flags: needinfo?(danieleferla1)

We're hitting an edge-case / bug in AsyncTabSwitcher, where the pendingpaint attribute is incorrectly still set on the <browser>.

Flags: needinfo?(mconley)

Among other things, the postActions method in AsyncTabSwitcher attempts to do update
"auxiliary state" once the primary state (the various STATE_ flags in particular)
have been set.

Part of its job then is to loop over the current set of tabs and determine how
many we're still waiting on to do something asynchronous (like complete loading
or complete unloading).

We have a condition that is meant to skip counting any backgrounded that should
not be set to STATE_UNLOADING because they're either being used for print preview or
Picture-in-Picture (which requires that their DocShells stay active). However,
this condition didn't take into account the possibility that such a tab is
still in the STATE_LOADING state - meaning that we're still waiting for it
to finish being composited. This meant that in certain conditions, we'd
erroneously conclude that there weren't any more tabs to wait for, and
we'd "finish", preventing the STATE_LOADING tab from ever exiting the
"pendingpaint" condition.

This patch makes it so that we only skip counting those tabs if they're in the
STATE_LOADED state.

Assignee: nobody → mconley
Status: NEW → ASSIGNED
Blocks: 1918394
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f27a5c12d72a Count STATE_LOADING tabs as pending even if they are in the do-not-deactivate set. r=tabbrowser-reviewers,dao
Status: ASSIGNED → RESOLVED
Closed: 25 days ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
Flags: needinfo?(mconley)

The patch landed in nightly and beta is affected.
:mconley, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox131 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(mconley)

Since this is still an experimental opt-in feature, I'm willing to let this fix ride the trains.

Flags: needinfo?(mconley)

This fix has been verified in Windows 10, Mac OS 14 and Ubuntu 22.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: