Bug 1861869 - Don't re-create the UA widget when entering PiP. r=mconley,pip-reviewer...
commit0733a2143fa8937434df1e450c1c3d666f5ac6db
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 6 Mar 2024 21:25:49 +0000 (6 21:25 +0000)
committerEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 6 Mar 2024 21:25:49 +0000 (6 21:25 +0000)
tree09b13a3b88edf6cefbdcf6e0d2fad6c53aab8941
parent7287074ab974bc0fb0a9dd64ed665777884ec5d6
Bug 1861869 - Don't re-create the UA widget when entering PiP. r=mconley,pip-reviewers,reusable-components-reviewers

This is the actual fix. The issue is that, after the regressing bug, the
video element will only dispatch resized* events when:

 * The frame is recreated.
 * The video actually resizes.

And when going into PiP neither is happening, so we create a new impl,
but never update the "reflowed" dimensions.

Long term we should probably rewrite this to use ResizeObserver rather
than special code, but this should be a good perf improvement, and fix
the correctness issue, so seems worth doing.

Depends on D203496

Differential Revision: https://phabricator.services.mozilla.com/D203497
toolkit/content/widgets/videocontrols.js