Closed Bug 2006838 Opened 1 month ago Closed 22 days ago

Adding a YouTube tab with Picture-in-Picture (PiP) enabled to Split View will close the PiP window

Categories

(Firefox :: Tabbed Browser: Split View, defect, P1)

Desktop
All
defect

Tracking

()

VERIFIED FIXED
149 Branch
Tracking Status
firefox146 --- disabled
firefox147 --- disabled
firefox148 --- disabled
firefox149 --- verified

People

(Reporter: atrif, Assigned: jsudiaman)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-splitview])

Attachments

(2 files)

Attached image split_yt_pip.gif

Found in

  • 148.0a1 (2025-12-17)

Affected versions

  • 148.0a1 (2025-12-17)

Tested platforms

  • Affected platforms: Ubuntu 24, Windows 11, macOS 26
  • Unaffected platforms: none

Steps to reproduce

  1. Open YouTube and enter PiP.
  2. Add the YouTube tab to a Split View.

Expected result

  • Pip stays open.

Actual result

  • Pip is closed.

Regression range

  • Not a regression. Happens with Firefox 146.

Additional notes

  • Attached a screen recording.

The severity field is not set for this bug.
:dwalker, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(dwalker)
Component: Tabbed Browser → Tabbed Browser: Split View
Flags: needinfo?(dwalker)

This should be resolved by bug 1997878. Please reopen if it isn't.

Status: NEW → RESOLVED
Closed: 1 month ago
Duplicate of bug: 1997878
Flags: needinfo?(atrif)
Resolution: --- → DUPLICATE

Hello! This issue is still reproducible with Firefox 148.0a1 (2026-01-11).

Status: RESOLVED → REOPENED
No longer duplicate of bug: 1997878
Flags: needinfo?(atrif)
Resolution: DUPLICATE → ---
QA Whiteboard: [qa-found-in-c148] [S4][QA-4411] → [qa-investig-done-c148/b147] [qa-found-in-c148] [S4][QA-4411]
Flags: needinfo?(kcochrane)

Yeah this is slightly different than bug 1997878, and I can still reproduce this.

Flags: needinfo?(kcochrane)
Priority: -- → P1
Status: REOPENED → NEW
Assignee: nobody → jsudiaman
Status: NEW → ASSIGNED
Assignee: jsudiaman → nobody
Status: ASSIGNED → NEW

I looked into this issue yesterday, and I’m not really sure if we’ll be able to work around it. Youtube has logic in place that will disrupt PiP if the page size resizes by a certain extent. In the other bug I already fixed (bug 1997878), backgrounded split view panels were going back to full width whenever inactive. I fixed that by making them remain the same width whether active or inactive. The issue in this bug is you have a regular non-split tab playing a Youtube video with PiP running, then add that tab to a split view which will resize the panel to be half width and disrupt PiP.

Assignee: nobody → jsudiaman
Status: NEW → ASSIGNED
Severity: -- → S3

When the content area is resized, frameworks often reparent the <video> element. This triggers MozStopPictureInPicture, closing the PiP window unnecessarily.

This patch introduces a "rescue" mechanism in PictureInPictureChild:

  • It yields execution to detect if the video was merely moved rather than destroyed.
  • If the video is re-connected, it re-establishes the visual clone and restores any CSS transforms (e.g., mirroring for self-view).

Additionally, this adds defensive null-checks in PictureInPictureToggleChild to prevent TypeErrors when the mouse hovers over a video that is in the middle of being reparented.

Pushed by jsudiaman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a0f249e897a6 https://hg.mozilla.org/integration/autoland/rev/7dd8cc93526c Handle video reparenting to prevent PiP closure during layout changes (Split View, window resizing) r=mconley
Status: ASSIGNED → RESOLVED
Closed: 1 month ago22 days ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch

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

For more information, please visit BugBot documentation.

Flags: needinfo?(jsudiaman)

Verified fixed with Firefox 149.0a1 (2026-01-22) on Windows 11, macOS 15 and Ubuntu 24. The PiP window is no longer closed if Split View is opened or resized while the PiP is active. Note that bug 2012104 was encountered while testing this.
Split View is nightly only, setting 148 to disabled.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-investig-done-c148/b147] [qa-found-in-c148] [S4][QA-4411] → [qa-investig-done-c148/b147] [qa-found-in-c148] [S4][QA-4411][qa-ver-done-c149/b148]
Flags: needinfo?(jsudiaman)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: