Open Bug 2008334 Opened 1 month ago Updated 9 days ago

[Document PiP API] When the tab is switched to the background, the animation in the PiP window becomes excessively slow

Categories

(Core :: DOM: Core & HTML, defect, P3)

Firefox 148
defect

Tracking

()

ASSIGNED

People

(Reporter: nayinain, Assigned: vhilla)

References

(Blocks 2 open bugs, )

Details

Attachments

(5 files)

Attached file testcase.html

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

Steps to reproduce:

  1. Open testcase.html.
  2. Click the Toggle PiP button.
  3. Switch to another browser tab.

Actual results:

The animation in the Picture‑in‑Picture window becomes significantly slower.

Expected results:

The animation in the Picture‑in‑Picture window should run at normal speed.

Attached video Capture.webm
Has STR: --- → yes
Depends on: 1858562
Blocks: 2006594
Severity: -- → S3
Priority: -- → P3

When switching to another tab, the opener becomes inactive and the script that controls the PiP becomes throttled. If the script ran in the PiP document, I think it should not slow down.

I looked through the code and debugged a bit. PresShell::ComputeActiveness determines isActiveTab=false, we call nsRefreshDriver::SetActivity(false) and this throttles the opener.

This doesn't happen in Chrome and I verified that in general, they throttle inactive documents too (rAF slows down / stops). So I guess PresShell::ComputeActiveness needs adjustment. (doesn't help)

Assignee: nobody → vhilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9536319 - Attachment description: Bug 2008334 - Add BrowsingContext::GetExtantDocumentPiPWindow utility. r=edgar,#dom-core → Bug 2008334 - Add BrowsingContext::GetOpenedDocumentPiPWindow utility. r=edgar,#dom-core
Attachment #9536320 - Attachment description: Bug 2008334 - Don't throttle the opener of Document PiP windows. r=edgar,#layout-reviewers,#dom-core → Bug 2008334 - Don't throttle opener of Document PiP windows. r=edgar,emilio,#layout-reviewers,#dom-core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: