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 521447 10e9bbf2d1df
parent 521446 44d96bcc51f7
child 521448 8620e56a5f38
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [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 });
   }
 }