From 9e8043e23656afced86aa2377f93de93c2177764 Mon Sep 17 00:00:00 2001 From: Csoregi Natalia Date: Sat, 13 Apr 2019 06:22:47 +0300 Subject: [PATCH] Backed out 10 changesets (bug 1542756, bug 1543128, bug 1543122) for multiple media failures /test_setSinkId.html. CLOSED TREE Backed out changeset ce3a15e1b737 (bug 1543128) Backed out changeset cea8c1af70ad (bug 1543128) Backed out changeset aeb23f8f45fb (bug 1543128) Backed out changeset a2e73d143aba (bug 1543128) Backed out changeset 1692fc6491a0 (bug 1543128) Backed out changeset 9fbce4274cfd (bug 1542756) Backed out changeset 20092bcebe6a (bug 1543122) Backed out changeset 1645d577016c (bug 1543122) Backed out changeset 3fce0b7586c1 (bug 1543122) Backed out changeset aab68db4131b (bug 1543122) --- .../test/static/browser_parsable_css.js | 3 + .../downloads/content/allDownloadsView.js | 2 +- dom/base/DocumentOrShadowRoot.cpp | 4 - dom/base/DocumentOrShadowRoot.h | 2 +- dom/base/nsDOMWindowUtils.cpp | 6 +- dom/html/HTMLMediaElement.cpp | 12 + dom/html/HTMLVideoElement.cpp | 10 - dom/html/HTMLVideoElement.h | 2 - dom/interfaces/base/nsIDOMWindowUtils.idl | 5 +- dom/tests/mochitest/chrome/489127.html | 14 +- dom/webidl/HTMLVideoElement.webidl | 6 - toolkit/actors/PictureInPictureChild.jsm | 421 ++++++++++++------ toolkit/actors/UAWidgetsChild.jsm | 37 +- toolkit/content/widgets/videocontrols.js | 105 +---- .../en-US/toolkit/global/videocontrols.ftl | 13 + toolkit/themes/shared/jar.inc.mn | 1 + toolkit/themes/shared/media/videocontrols.css | 45 +- .../themes/shared/pictureinpicture/toggle.css | 83 ++++ 18 files changed, 412 insertions(+), 359 deletions(-) create mode 100644 toolkit/locales/en-US/toolkit/global/videocontrols.ftl create mode 100644 toolkit/themes/shared/pictureinpicture/toggle.css diff --git a/browser/base/content/test/static/browser_parsable_css.js b/browser/base/content/test/static/browser_parsable_css.js index 0a28bee2f1ff..0f122909d1b6 100644 --- a/browser/base/content/test/static/browser_parsable_css.js +++ b/browser/base/content/test/static/browser_parsable_css.js @@ -65,6 +65,9 @@ let whitelist = [ intermittent: true, errorMessage: /Property contained reference to invalid variable.*background/i, isFromDevTools: true}, + {sourceName: /pictureinpicture\/toggle.css$/i, + errorMessage: /Unknown pseudo-class.*moz-native-anonymous/i, + isFromDevTools: false}, ]; if (!Services.prefs.getBoolPref("layout.css.xul-box-display-values.content.enabled")) { diff --git a/browser/components/downloads/content/allDownloadsView.js b/browser/components/downloads/content/allDownloadsView.js index 01a389e13dd8..dcd04ea10012 100644 --- a/browser/components/downloads/content/allDownloadsView.js +++ b/browser/components/downloads/content/allDownloadsView.js @@ -248,7 +248,7 @@ DownloadsPlacesView.prototype = { let winUtils = window.windowUtils; let nodes = winUtils.nodesFromRect(rlbRect.left, rlbRect.top, 0, rlbRect.width, rlbRect.height, 0, - true, false, false); + true, false); // nodesFromRect returns nodes in z-index order, and for the same z-index // sorts them in inverted DOM order, thus starting from the one that would // be on top. diff --git a/dom/base/DocumentOrShadowRoot.cpp b/dom/base/DocumentOrShadowRoot.cpp index 0f9be4e6b528..0f005740c112 100644 --- a/dom/base/DocumentOrShadowRoot.cpp +++ b/dom/base/DocumentOrShadowRoot.cpp @@ -362,7 +362,6 @@ void DocumentOrShadowRoot::NodesFromRect(float aX, float aY, float aTopSize, float aLeftSize, bool aIgnoreRootScrollFrame, bool aFlushLayout, - bool aOnlyVisible, nsTArray>& aReturn) { // Following the same behavior of elementFromPoint, // we don't return anything if either coord is negative @@ -381,9 +380,6 @@ void DocumentOrShadowRoot::NodesFromRect(float aX, float aY, float aTopSize, if (aIgnoreRootScrollFrame) { options += FrameForPointOption::IgnoreRootScrollFrame; } - if (aOnlyVisible) { - options += FrameForPointOption::OnlyVisible; - } auto flush = aFlushLayout ? FlushLayout::Yes : FlushLayout::No; QueryNodesFromRect(*this, rect, options, flush, Multiple::Yes, aReturn); diff --git a/dom/base/DocumentOrShadowRoot.h b/dom/base/DocumentOrShadowRoot.h index d6a837f6511b..5980e175c262 100644 --- a/dom/base/DocumentOrShadowRoot.h +++ b/dom/base/DocumentOrShadowRoot.h @@ -120,7 +120,7 @@ class DocumentOrShadowRoot { void NodesFromRect(float aX, float aY, float aTopSize, float aRightSize, float aBottomSize, float aLeftSize, bool aIgnoreRootScrollFrame, bool aFlushLayout, - bool aOnlyVisible, nsTArray>&); + nsTArray>&); /** * This gets fired when the element that an id refers to changes. diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 503a8a227bbd..9bec53320202 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -1155,8 +1155,7 @@ NS_IMETHODIMP nsDOMWindowUtils::NodesFromRect(float aX, float aY, float aTopSize, float aRightSize, float aBottomSize, float aLeftSize, bool aIgnoreRootScrollFrame, - bool aFlushLayout, bool aOnlyVisible, - nsINodeList** aReturn) { + bool aFlushLayout, nsINodeList** aReturn) { nsCOMPtr doc = GetDocument(); NS_ENSURE_STATE(doc); @@ -1166,8 +1165,7 @@ nsDOMWindowUtils::NodesFromRect(float aX, float aY, float aTopSize, AutoTArray, 8> nodes; doc->NodesFromRect(aX, aY, aTopSize, aRightSize, aBottomSize, aLeftSize, - aIgnoreRootScrollFrame, aFlushLayout, aOnlyVisible, - nodes); + aIgnoreRootScrollFrame, aFlushLayout, nodes); list->SetCapacity(nodes.Length()); for (auto& node : nodes) { list->AppendElement(node->AsContent()); diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 08f443ff2822..2e6d570f37c8 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -4097,7 +4097,19 @@ nsresult HTMLMediaElement::BindToTree(Document* aDocument, nsIContent* aParent, if (IsInComposedDoc()) { // Construct Shadow Root so web content can be hidden in the DOM. AttachAndSetUAShadowRoot(); +#ifdef ANDROID NotifyUAWidgetSetupOrChange(); +#else + // We don't want to call into JS if the website never asks for native + // video controls. + // If controls attribute is set later, controls is constructed lazily + // with the UAWidgetAttributeChanged event. + // This only applies to Desktop because on Fennec we would need to show + // an UI if the video is blocked. + if (Controls()) { + NotifyUAWidgetSetupOrChange(); + } +#endif } mUnboundFromTree = false; diff --git a/dom/html/HTMLVideoElement.cpp b/dom/html/HTMLVideoElement.cpp index 09782dfaf6c7..6b125d0948e1 100644 --- a/dom/html/HTMLVideoElement.cpp +++ b/dom/html/HTMLVideoElement.cpp @@ -548,15 +548,5 @@ void HTMLVideoElement::EndCloningVisually() { } } -void HTMLVideoElement::TogglePictureInPicture(ErrorResult& error) { - // The MozTogglePictureInPicture event is listen for via the - // PictureInPictureChild actor, which is responsible for opening the new - // window and starting the visual clone. - nsresult rv = DispatchEvent(NS_LITERAL_STRING("MozTogglePictureInPicture")); - if (NS_FAILED(rv)) { - error.Throw(rv); - } -} - } // namespace dom } // namespace mozilla diff --git a/dom/html/HTMLVideoElement.h b/dom/html/HTMLVideoElement.h index ed2096548af4..59bcbd755ac3 100644 --- a/dom/html/HTMLVideoElement.h +++ b/dom/html/HTMLVideoElement.h @@ -145,8 +145,6 @@ class HTMLVideoElement final : public HTMLMediaElement { bool IsCloningElementVisually() const { return !!mVisualCloneTarget; } - void TogglePictureInPicture(ErrorResult& rv); - protected: virtual ~HTMLVideoElement(); diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl index 3ac933c27eb7..b5baed9c34c0 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -745,8 +745,6 @@ interface nsIDOMWindowUtils : nsISupports { * frame when retrieving the element. If false, this method returns * null for coordinates outside of the viewport. * @param aFlushLayout flushes layout if true. Otherwise, no flush occurs. - * @param aOnlyVisible Set to true if you only want nodes that pass a visibility - * hit test. */ NodeList nodesFromRect(in float aX, in float aY, @@ -755,8 +753,7 @@ interface nsIDOMWindowUtils : nsISupports { in float aBottomSize, in float aLeftSize, in boolean aIgnoreRootScrollFrame, - in boolean aFlushLayout, - in boolean aOnlyVisible); + in boolean aFlushLayout); /** diff --git a/dom/tests/mochitest/chrome/489127.html b/dom/tests/mochitest/chrome/489127.html index f32b41a96a0a..75bc926146b7 100644 --- a/dom/tests/mochitest/chrome/489127.html +++ b/dom/tests/mochitest/chrome/489127.html @@ -13,8 +13,20 @@ let dwu = window.windowUtils; + /* + NodeList nodesFromRect(in float aX, + in float aY, + in float aTopSize, + in float aRightSize, + in float aBottomSize, + in float aLeftSize, + in boolean aIgnoreRootScrollFrame, + in boolean aFlushLayout); + + */ + function check(x, y, top, right, bottom, left, list) { - let nodes = dwu.nodesFromRect(x, y, top, right, bottom, left, true, false, false); + let nodes = dwu.nodesFromRect(x, y, top, right, bottom, left, true, false); list.push(e.body); list.push(e.html); diff --git a/dom/webidl/HTMLVideoElement.webidl b/dom/webidl/HTMLVideoElement.webidl index 5d5ecc4970f5..84b372e64909 100644 --- a/dom/webidl/HTMLVideoElement.webidl +++ b/dom/webidl/HTMLVideoElement.webidl @@ -69,12 +69,6 @@ partial interface HTMLVideoElement { //