Page MenuHomePhabricator

Media Viewer detach/shutdown can be expensive
Open, Needs TriagePublic

Description

With the Event Timing API origin trial I'm currently running, I've noticed regular occurrences of the click on the X to close Media Viewer causing a long event handler (>50ms). This will result in frame drops and momentary browser lockup.

It seems like Media Viewer is doing quite a bit of work when it gets closed. It would be desirable, in order for the page to remain more responsive, to move as much of this work as possible outside of the event handler. I.e. done asynchronously after the fact, using requestIdleCallback, for example.

It would also be good to audit whether all of this work is strictly necessary, and if we couldn't leave some things "attached" until the next time Media Viewer is invoked.

Event Timeline

Gilles created this task.Jun 18 2019, 1:45 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptJun 18 2019, 1:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Gilles updated the task description. (Show Details)Jun 18 2019, 1:46 PM
Gilles updated the task description. (Show Details)