Bug 1516292 - Use isSameNode() to compare mozFullScreenElement and the video host element r=edgar
authorTimothy Guan-tin Chien <timdream@gmail.com>
Mon, 07 Jan 2019 16:00:55 +0000
changeset 509824 42dc31f0985903d0c3a55d18439d52a843c21e3a
parent 509823 7f9e45f01772c640564c9e488a7ceed477c1f6d3
child 509825 d0b51a908becadca797abc743899bd7f06dafb63
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedgar
bugs1516292, 1505547
milestone66.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 1516292 - Use isSameNode() to compare mozFullScreenElement and the video host element r=edgar This does what's done in bug 1505547 but in a different way. For some reason, access shadowRoot.host in the function can trigger an assertion. this.video is a Proxy so it cannot be compared, but all its methods are proxied. Differential Revision: https://phabricator.services.mozilla.com/D15767
dom/media/tests/crashtests/1516292.html
dom/media/tests/crashtests/crashtests.list
toolkit/content/widgets/videocontrols.js
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/crashtests/1516292.html
@@ -0,0 +1,16 @@
+<script>
+function go() {
+  a.children[0].appendChild(b)
+}
+</script>
+<body onload=go()>
+<svg id="a">
+<foreignObject>
+<li>
+<video controls="" autoplay="">
+<li id="a" contenteditable="true">
+</li>
+</svg>
+<canvas id="b">
+<svg>
+<use xlink:href="#a">
--- a/dom/media/tests/crashtests/crashtests.list
+++ b/dom/media/tests/crashtests/crashtests.list
@@ -22,8 +22,9 @@ load 1367930_1.html
 load 1367930_2.html
 pref(browser.link.open_newwindow,2) load 1429507_1.html # window.open() in tab doesn't work for crashtest in e10s, this opens a new window instead
 pref(browser.link.open_newwindow,2) load 1429507_2.html # window.open() in tab doesn't work for crashtest in e10s, this opens a new window instead
 load 1453030.html
 skip-if(Android) load 1490700.html # No screenshare on Android
 load 1505957.html
 load 1511130.html
 load 1510848.html
+load 1516292.html
--- a/toolkit/content/widgets/videocontrols.js
+++ b/toolkit/content/widgets/videocontrols.js
@@ -1294,18 +1294,17 @@ this.VideoControlsImplWidget = class {
         }
 
         // We'll handle style changes in the event listener for
         // the "volumechange" event, same as if content script was
         // controlling volume.
       },
 
       get isVideoInFullScreen() {
-        let element = this.shadowRoot.host;
-        return element.getRootNode().mozFullScreenElement == element;
+        return this.video.isSameNode(this.video.getRootNode().mozFullScreenElement);
       },
 
       toggleFullscreen() {
         this.isVideoInFullScreen ?
           this.document.mozCancelFullScreen() :
           this.video.mozRequestFullScreen();
       },