Bug 1531101 - When the PictureInPicture window closes, stop cloning immediately to update the original video UAWidget. r=Felipe
☠☠ backed out by b9b0378c5e0b ☠ ☠
authorMike Conley <mconley@mozilla.com>
Fri, 08 Mar 2019 15:48:11 +0000
changeset 524445 10e9bbf2d1df3b261a86356d3e9e15da962a9568
parent 524444 44d96bcc51f75d7a1a8c44d60dd7dc2131348c56
child 524446 8620e56a5f3858391b42f51684ff735699895049
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1531101
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531101 - When the PictureInPicture window closes, stop cloning immediately to update the original video UAWidget. r=Felipe Differential Revision: https://phabricator.services.mozilla.com/D22165
toolkit/actors/PictureInPictureChild.jsm
--- a/toolkit/actors/PictureInPictureChild.jsm
+++ b/toolkit/actors/PictureInPictureChild.jsm
@@ -101,12 +101,16 @@ class PictureInPictureChild extends Acto
     originatingVideo.cloneElementVisually(playerVideo);
 
     let originatingWindow = originatingVideo.ownerGlobal;
     originatingWindow.addEventListener("unload", (e) => {
       this.closePictureInPicture(originatingVideo);
     }, { once: true });
 
     this.content.addEventListener("unload", () => {
+      let video = gWeakVideo && gWeakVideo.get();
+      if (video) {
+        video.stopCloningElementVisually();
+      }
       gWeakVideo = null;
     }, { once: true });
   }
 }