From aade9e1ea0916c3d751d8178d8d0d95f2aca1626 Mon Sep 17 00:00:00 2001 From: Mike Shal Date: Fri, 5 Jul 2019 20:36:48 +0000 Subject: [PATCH 01/12] Bug 1563402 - Remove GCP shippable builds; r=tomprince Differential Revision: https://phabricator.services.mozilla.com/D37108 --HG-- extra : moz-landing-system : lando --- taskcluster/ci/build/linux.yml | 81 --------------------------------- taskcluster/ci/build/macosx.yml | 44 ------------------ 2 files changed, 125 deletions(-) diff --git a/taskcluster/ci/build/linux.yml b/taskcluster/ci/build/linux.yml index b20e1643282a..c74adf9ef935 100644 --- a/taskcluster/ci/build/linux.yml +++ b/taskcluster/ci/build/linux.yml @@ -1218,47 +1218,6 @@ linux-gcp/opt: - linux64-nasm - linux64-node -linux-gcp-shippable/opt: - description: "Linux32 Shippable - built on GCP" - attributes: - shippable: true - enable-full-crashsymbols: true - shipping-phase: build - shipping-product: firefox - index: - product: firefox - job-name: linux-gcp-opt - type: shippable - treeherder: - platform: linux32-shippable/opt - symbol: Bg - tier: 3 - worker-type: gce/gecko-{level}-b-linux - worker: - docker-image: {in-tree: debian7-i386-build} - max-run-time: 7200 - env: - PERFHERDER_EXTRA_OPTIONS: gcp - run: - using: mozharness - actions: [get-secrets, build, check-test] - config: - - builds/releng_base_firefox.py - - builds/releng_base_linux_32_builds.py - - taskcluster_nightly.py - script: "mozharness/scripts/fx_desktop_build.py" - secrets: true - tooltool-downloads: public - need-xvfb: true - toolchains: - - linux64-binutils - - linux64-clang - - linux64-rust - - linux64-rust-size - - linux64-cbindgen - - linux64-nasm - - linux64-node - linux64-gcp/debug: description: "Linux64 Debug - built on GCP" index: @@ -1333,43 +1292,3 @@ linux64-gcp/opt: - linux64-sccache - linux64-nasm - linux64-node - -linux64-gcp-shippable/opt: - description: "Linux64 Shippable - built on GCP" - attributes: - shippable: true - enable-full-crashsymbols: true - shipping-phase: build - shipping-product: firefox - index: - product: firefox - job-name: linux64-gcp-opt - type: shippable - treeherder: - platform: linux64-shippable/opt - symbol: Bg - tier: 3 - worker-type: gce/gecko-{level}-b-linux - worker: - max-run-time: 7200 - env: - PERFHERDER_EXTRA_OPTIONS: gcp - run: - using: mozharness - actions: [get-secrets, build, check-test] - config: - - builds/releng_base_firefox.py - - builds/releng_base_linux_64_builds.py - - taskcluster_nightly.py - script: "mozharness/scripts/fx_desktop_build.py" - secrets: true - tooltool-downloads: public - need-xvfb: true - toolchains: - - linux64-binutils - - linux64-clang - - linux64-rust - - linux64-rust-size - - linux64-cbindgen - - linux64-nasm - - linux64-node diff --git a/taskcluster/ci/build/macosx.yml b/taskcluster/ci/build/macosx.yml index e94a42f89561..89593476ba06 100644 --- a/taskcluster/ci/build/macosx.yml +++ b/taskcluster/ci/build/macosx.yml @@ -456,47 +456,3 @@ macosx64-gcp/opt: - linux64-sccache - linux64-nasm - linux64-node - -macosx64-gcp-shippable/opt: - description: "MacOS X x64 Cross-compile - built on GCP" - attributes: - shippable: true - enable-full-crashsymbols: true - shipping-phase: build - shipping-product: firefox - index: - product: firefox - job-name: macosx64-gcp-opt - type: shippable - treeherder: - platform: osx-shippable/opt - symbol: Bg - tier: 3 - worker-type: gce/gecko-{level}-b-linux - worker: - max-run-time: 7200 - env: - TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/macosx64/cross-releng.manifest" - PERFHERDER_EXTRA_OPTIONS: gcp - run: - using: mozharness - actions: [get-secrets, build] - config: - - builds/releng_base_firefox.py - - builds/releng_base_mac_64_cross_builds.py - - taskcluster_nightly.py - script: "mozharness/scripts/fx_desktop_build.py" - secrets: true - tooltool-downloads: internal - toolchains: - - linux64-binutils - - linux64-cctools-port - - linux64-clang - - linux64-hfsplus - - linux64-libdmg - - linux64-llvm-dsymutil - - linux64-rust-macos - - linux64-rust-size - - linux64-cbindgen - - linux64-nasm - - linux64-node From 02b8c2bbc711e4bcb612662af9adfaa04037a7af Mon Sep 17 00:00:00 2001 From: Jeff Gilbert Date: Fri, 5 Jul 2019 20:40:56 +0000 Subject: [PATCH 02/12] Bug 1563443 - Remark tests after bug 1560736. Differential Revision: https://phabricator.services.mozilla.com/D37119 --HG-- extra : moz-landing-system : lando --- .../2_cues_overlapping_partially_move_down.html.ini | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html.ini b/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html.ini index 75d0f06665d8..6ec3e671d77c 100644 --- a/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html.ini +++ b/testing/web-platform/meta/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html.ini @@ -1,4 +1,2 @@ [2_cues_overlapping_partially_move_down.html] - expected: - if (os == "android") and debug: ERROR - FAIL + expected: FAIL From 7c07097b69b3f6e1b2c68a74447c6e5e38a5b3d7 Mon Sep 17 00:00:00 2001 From: Luke Crouch Date: Fri, 5 Jul 2019 20:31:06 +0000 Subject: [PATCH 03/12] Bug 1559365: UI indication of breached logins r=jaws Differential Revision: https://phabricator.services.mozilla.com/D35105 --HG-- extra : moz-landing-system : lando --- browser/components/BrowserGlue.jsm | 1 + .../aboutlogins/AboutLoginsChild.jsm | 3 ++ .../aboutlogins/AboutLoginsParent.jsm | 32 +++++++++++++++++-- .../aboutlogins/content/aboutLogins.js | 4 +++ .../content/components/login-list-item.css | 4 +++ .../content/components/login-list.js | 14 ++++++++ 6 files changed, 56 insertions(+), 2 deletions(-) diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index c87c6e06a238..f9fb463342bc 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -103,6 +103,7 @@ let LEGACY_ACTORS = { }, messages: [ "AboutLogins:AllLogins", + "AboutLogins:UpdateBreaches", "AboutLogins:LoginAdded", "AboutLogins:LoginModified", "AboutLogins:LoginRemoved", diff --git a/browser/components/aboutlogins/AboutLoginsChild.jsm b/browser/components/aboutlogins/AboutLoginsChild.jsm index c2bcbd7540b0..64f65a43e381 100644 --- a/browser/components/aboutlogins/AboutLoginsChild.jsm +++ b/browser/components/aboutlogins/AboutLoginsChild.jsm @@ -111,6 +111,9 @@ class AboutLoginsChild extends ActorChild { case "AboutLogins:AllLogins": this.sendToContent("AllLogins", message.data); break; + case "AboutLogins:UpdateBreaches": + this.sendToContent("UpdateBreaches", message.data); + break; case "AboutLogins:LoginAdded": this.sendToContent("LoginAdded", message.data); break; diff --git a/browser/components/aboutlogins/AboutLoginsParent.jsm b/browser/components/aboutlogins/AboutLoginsParent.jsm index 2c8bff98fb02..505496fc372e 100644 --- a/browser/components/aboutlogins/AboutLoginsParent.jsm +++ b/browser/components/aboutlogins/AboutLoginsParent.jsm @@ -24,6 +24,11 @@ ChromeUtils.defineModuleGetter( "MigrationUtils", "resource:///modules/MigrationUtils.jsm" ); +ChromeUtils.defineModuleGetter( + this, + "RemoteSettings", + "resource://services-settings/remote-settings.js" +); ChromeUtils.defineModuleGetter( this, "Services", @@ -175,9 +180,12 @@ var AboutLoginsParent = { this._subscribers.add(message.target); let messageManager = message.target.messageManager; + const logins = await this.getAllLogins(); + messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins); + const breachesByLoginGUID = await this.getBreachesForLogins(logins); messageManager.sendAsyncMessage( - "AboutLogins:AllLogins", - await this.getAllLogins() + "AboutLogins:UpdateBreaches", + breachesByLoginGUID ); break; } @@ -363,4 +371,24 @@ var AboutLoginsParent = { throw e; } }, + + async getBreachesForLogins(logins) { + const breaches = await RemoteSettings("fxmonitor-breaches").get(); + const breachHostMap = new Map(); + for (const breach of breaches) { + breachHostMap.set(breach.Domain, breach); + } + const breachesByLoginGUID = new Map(); + for (const login of logins) { + const loginURI = Services.io.newURI(login.origin); + const breach = breachHostMap.get(loginURI.host) || false; + if ( + breach && + login.timePasswordChanged < new Date(breach.BreachDate).getTime() + ) { + breachesByLoginGUID.set(login.guid, breach); + } + } + return breachesByLoginGUID; + }, }; diff --git a/browser/components/aboutlogins/content/aboutLogins.js b/browser/components/aboutlogins/content/aboutLogins.js index 796f578e6acf..d7c8823b7c37 100644 --- a/browser/components/aboutlogins/content/aboutLogins.js +++ b/browser/components/aboutlogins/content/aboutLogins.js @@ -39,6 +39,10 @@ window.addEventListener("AboutLoginsChromeToContent", event => { gElements.loginList.setLogins(event.detail.value); break; } + case "UpdateBreaches": { + gElements.loginList.updateBreaches(event.detail.value); + break; + } case "LoginAdded": { gElements.loginList.loginAdded(event.detail.value); gElements.loginItem.loginAdded(event.detail.value); diff --git a/browser/components/aboutlogins/content/components/login-list-item.css b/browser/components/aboutlogins/content/components/login-list-item.css index c2425e6f596c..6783daa7fade 100644 --- a/browser/components/aboutlogins/content/components/login-list-item.css +++ b/browser/components/aboutlogins/content/components/login-list-item.css @@ -29,6 +29,10 @@ background-color: var(--in-content-box-background-hover); } +:host(.breached) { + border-inline-start-color: var(--in-content-border-invalid); +} + .title { font-weight: bold; } diff --git a/browser/components/aboutlogins/content/components/login-list.js b/browser/components/aboutlogins/content/components/login-list.js index 83a96b411e57..02ec9e7c7dd6 100644 --- a/browser/components/aboutlogins/content/components/login-list.js +++ b/browser/components/aboutlogins/content/components/login-list.js @@ -79,6 +79,12 @@ export default class LoginList extends HTMLElement { listItem.setAttribute("aria-selected", "true"); this._list.setAttribute("aria-activedescendant", listItem.id); } + if ( + this._breachesByLoginGUID && + this._breachesByLoginGUID.has(login.guid) + ) { + listItem.classList.add("breached"); + } this._list.append(listItem); } @@ -162,6 +168,14 @@ export default class LoginList extends HTMLElement { } } + /** + * @param {Map} breachesByLoginGUID A Map of breaches by login GUIDs used for displaying breached login indicators. + */ + updateBreaches(breachesByLoginGUID) { + this._breachesByLoginGUID = breachesByLoginGUID; + this.render(); + } + /** * @param {login} login A login that was added to storage. */ From b5ed95c80cc0496dbbe0b92bef39486cc3435a26 Mon Sep 17 00:00:00 2001 From: Michael Kaply Date: Fri, 5 Jul 2019 20:32:36 +0000 Subject: [PATCH 04/12] Bug 1563759 - Add policy for new preference. r=baku Differential Revision: https://phabricator.services.mozilla.com/D37081 --HG-- extra : moz-landing-system : lando --- .../components/enterprisepolicies/schemas/policies-schema.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser/components/enterprisepolicies/schemas/policies-schema.json b/browser/components/enterprisepolicies/schemas/policies-schema.json index bd8693832db5..4272f27729b9 100644 --- a/browser/components/enterprisepolicies/schemas/policies-schema.json +++ b/browser/components/enterprisepolicies/schemas/policies-schema.json @@ -708,6 +708,9 @@ "places.history.enabled": { "type": "boolean" }, + "privacy.file_unique_origin": { + "type": "boolean" + }, "security.default_personal_cert": { "type": "string" }, From 8039da4d933f1f030bc8b2f4d5d6153d19e71d37 Mon Sep 17 00:00:00 2001 From: Andreea Pavel Date: Fri, 5 Jul 2019 15:03:05 +0000 Subject: [PATCH 05/12] Bug 1553657 - disabled c44-ln-box-001.xht on android debug r=jmaher Differential Revision: https://phabricator.services.mozilla.com/D37070 --HG-- extra : moz-landing-system : lando --- testing/web-platform/meta/css/CSS2/css1/c44-ln-box-001.xht.ini | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 testing/web-platform/meta/css/CSS2/css1/c44-ln-box-001.xht.ini diff --git a/testing/web-platform/meta/css/CSS2/css1/c44-ln-box-001.xht.ini b/testing/web-platform/meta/css/CSS2/css1/c44-ln-box-001.xht.ini new file mode 100644 index 000000000000..de77287695f8 --- /dev/null +++ b/testing/web-platform/meta/css/CSS2/css1/c44-ln-box-001.xht.ini @@ -0,0 +1,3 @@ +[c44-ln-box-001.xht] + disabled: + if debug and os == "android": https://bugzilla.mozilla.org/show_bug.cgi?id=1553657 From 45737ac2443b28b83ce67d11c2c24a17ca5b8ccc Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Fri, 5 Jul 2019 23:50:16 +0000 Subject: [PATCH 06/12] Bug 1563065: Use const& in mozilla::Result constructors. r=froydnj Change the `ResultImplementation` and `Result` constructors to accept success values by `const` reference. This makes it possible for `Result` to carry `MOZ_NON_PARAM` types as success values. Differential Revision: https://phabricator.services.mozilla.com/D36682 --HG-- extra : moz-landing-system : lando --- mfbt/Result.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mfbt/Result.h b/mfbt/Result.h index b4261fee2732..4f46c7ccd94b 100644 --- a/mfbt/Result.h +++ b/mfbt/Result.h @@ -47,7 +47,7 @@ class ResultImplementation { mozilla::Variant mStorage; public: - explicit ResultImplementation(V aValue) : mStorage(aValue) {} + explicit ResultImplementation(const V& aValue) : mStorage(aValue) {} explicit ResultImplementation(E aErrorValue) : mStorage(aErrorValue) {} bool isOk() const { return mStorage.template is(); } @@ -68,7 +68,7 @@ class ResultImplementation { mozilla::Variant mStorage; public: - explicit ResultImplementation(V aValue) : mStorage(aValue) {} + explicit ResultImplementation(const V& aValue) : mStorage(aValue) {} explicit ResultImplementation(E& aErrorValue) : mStorage(&aErrorValue) {} bool isOk() const { return mStorage.template is(); } @@ -300,7 +300,7 @@ class MOZ_MUST_USE_TYPE Result final { /** * Create a success result. */ - MOZ_IMPLICIT Result(V aValue) : mImpl(aValue) { MOZ_ASSERT(isOk()); } + MOZ_IMPLICIT Result(const V& aValue) : mImpl(aValue) { MOZ_ASSERT(isOk()); } /** * Create an error result. From 0a425ceb11e9dfe70114629e807313d74cf1f769 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru Michis Date: Sat, 6 Jul 2019 03:18:28 +0300 Subject: [PATCH 07/12] Backed out changeset b4f0e8b4b6fa (bug 1559365) for causing browser-chrome failures in AboutLoginsParent.jsm --- browser/components/BrowserGlue.jsm | 1 - .../aboutlogins/AboutLoginsChild.jsm | 3 -- .../aboutlogins/AboutLoginsParent.jsm | 32 ++----------------- .../aboutlogins/content/aboutLogins.js | 4 --- .../content/components/login-list-item.css | 4 --- .../content/components/login-list.js | 14 -------- 6 files changed, 2 insertions(+), 56 deletions(-) diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index f9fb463342bc..c87c6e06a238 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -103,7 +103,6 @@ let LEGACY_ACTORS = { }, messages: [ "AboutLogins:AllLogins", - "AboutLogins:UpdateBreaches", "AboutLogins:LoginAdded", "AboutLogins:LoginModified", "AboutLogins:LoginRemoved", diff --git a/browser/components/aboutlogins/AboutLoginsChild.jsm b/browser/components/aboutlogins/AboutLoginsChild.jsm index 64f65a43e381..c2bcbd7540b0 100644 --- a/browser/components/aboutlogins/AboutLoginsChild.jsm +++ b/browser/components/aboutlogins/AboutLoginsChild.jsm @@ -111,9 +111,6 @@ class AboutLoginsChild extends ActorChild { case "AboutLogins:AllLogins": this.sendToContent("AllLogins", message.data); break; - case "AboutLogins:UpdateBreaches": - this.sendToContent("UpdateBreaches", message.data); - break; case "AboutLogins:LoginAdded": this.sendToContent("LoginAdded", message.data); break; diff --git a/browser/components/aboutlogins/AboutLoginsParent.jsm b/browser/components/aboutlogins/AboutLoginsParent.jsm index 505496fc372e..2c8bff98fb02 100644 --- a/browser/components/aboutlogins/AboutLoginsParent.jsm +++ b/browser/components/aboutlogins/AboutLoginsParent.jsm @@ -24,11 +24,6 @@ ChromeUtils.defineModuleGetter( "MigrationUtils", "resource:///modules/MigrationUtils.jsm" ); -ChromeUtils.defineModuleGetter( - this, - "RemoteSettings", - "resource://services-settings/remote-settings.js" -); ChromeUtils.defineModuleGetter( this, "Services", @@ -180,12 +175,9 @@ var AboutLoginsParent = { this._subscribers.add(message.target); let messageManager = message.target.messageManager; - const logins = await this.getAllLogins(); - messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins); - const breachesByLoginGUID = await this.getBreachesForLogins(logins); messageManager.sendAsyncMessage( - "AboutLogins:UpdateBreaches", - breachesByLoginGUID + "AboutLogins:AllLogins", + await this.getAllLogins() ); break; } @@ -371,24 +363,4 @@ var AboutLoginsParent = { throw e; } }, - - async getBreachesForLogins(logins) { - const breaches = await RemoteSettings("fxmonitor-breaches").get(); - const breachHostMap = new Map(); - for (const breach of breaches) { - breachHostMap.set(breach.Domain, breach); - } - const breachesByLoginGUID = new Map(); - for (const login of logins) { - const loginURI = Services.io.newURI(login.origin); - const breach = breachHostMap.get(loginURI.host) || false; - if ( - breach && - login.timePasswordChanged < new Date(breach.BreachDate).getTime() - ) { - breachesByLoginGUID.set(login.guid, breach); - } - } - return breachesByLoginGUID; - }, }; diff --git a/browser/components/aboutlogins/content/aboutLogins.js b/browser/components/aboutlogins/content/aboutLogins.js index d7c8823b7c37..796f578e6acf 100644 --- a/browser/components/aboutlogins/content/aboutLogins.js +++ b/browser/components/aboutlogins/content/aboutLogins.js @@ -39,10 +39,6 @@ window.addEventListener("AboutLoginsChromeToContent", event => { gElements.loginList.setLogins(event.detail.value); break; } - case "UpdateBreaches": { - gElements.loginList.updateBreaches(event.detail.value); - break; - } case "LoginAdded": { gElements.loginList.loginAdded(event.detail.value); gElements.loginItem.loginAdded(event.detail.value); diff --git a/browser/components/aboutlogins/content/components/login-list-item.css b/browser/components/aboutlogins/content/components/login-list-item.css index 6783daa7fade..c2425e6f596c 100644 --- a/browser/components/aboutlogins/content/components/login-list-item.css +++ b/browser/components/aboutlogins/content/components/login-list-item.css @@ -29,10 +29,6 @@ background-color: var(--in-content-box-background-hover); } -:host(.breached) { - border-inline-start-color: var(--in-content-border-invalid); -} - .title { font-weight: bold; } diff --git a/browser/components/aboutlogins/content/components/login-list.js b/browser/components/aboutlogins/content/components/login-list.js index 02ec9e7c7dd6..83a96b411e57 100644 --- a/browser/components/aboutlogins/content/components/login-list.js +++ b/browser/components/aboutlogins/content/components/login-list.js @@ -79,12 +79,6 @@ export default class LoginList extends HTMLElement { listItem.setAttribute("aria-selected", "true"); this._list.setAttribute("aria-activedescendant", listItem.id); } - if ( - this._breachesByLoginGUID && - this._breachesByLoginGUID.has(login.guid) - ) { - listItem.classList.add("breached"); - } this._list.append(listItem); } @@ -168,14 +162,6 @@ export default class LoginList extends HTMLElement { } } - /** - * @param {Map} breachesByLoginGUID A Map of breaches by login GUIDs used for displaying breached login indicators. - */ - updateBreaches(breachesByLoginGUID) { - this._breachesByLoginGUID = breachesByLoginGUID; - this.render(); - } - /** * @param {login} login A login that was added to storage. */ From 07e34c8bbaea325b4d1d46119bd661268deaefd2 Mon Sep 17 00:00:00 2001 From: alwu Date: Sat, 6 Jul 2019 00:53:20 +0000 Subject: [PATCH 08/12] Bug 1541452 - update cue display when window is resized. r=heycam When window is resized, the cue would usually be zoomed in or out automatically with the video and keep its relative position to video. However, if video is being applied the explicit percentage value on its 'width' or 'height', we have to recompute cue's position in this situation, because the width or height of the video would be scaled again after applied the first size scaled which is caused by resizing. Differential Revision: https://phabricator.services.mozilla.com/D36138 --HG-- extra : moz-landing-system : lando --- dom/html/TextTrackManager.cpp | 16 ++++++++++++---- layout/generic/nsVideoFrame.cpp | 23 +++++++++++++---------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/dom/html/TextTrackManager.cpp b/dom/html/TextTrackManager.cpp index cab8ff701792..454d6bf68cbc 100644 --- a/dom/html/TextTrackManager.cpp +++ b/dom/html/TextTrackManager.cpp @@ -311,6 +311,8 @@ void TextTrackManager::PopulatePendingList() { void TextTrackManager::AddListeners() { if (mMediaElement) { + mMediaElement->AddEventListener(NS_LITERAL_STRING("resizecaption"), this, + false, false); mMediaElement->AddEventListener(NS_LITERAL_STRING("resizevideocontrols"), this, false, false); mMediaElement->AddEventListener(NS_LITERAL_STRING("seeked"), this, false, @@ -416,14 +418,20 @@ TextTrackManager::HandleEvent(Event* aEvent) { nsAutoString type; aEvent->GetType(type); - if (type.EqualsLiteral("resizevideocontrols") || - type.EqualsLiteral("seeked")) { + WEBVTT_LOG("Handle event %s", NS_ConvertUTF16toUTF8(type).get()); + + const bool setDirty = type.EqualsLiteral("seeked") || + type.EqualsLiteral("resizecaption") || + type.EqualsLiteral("resizevideocontrols"); + const bool updateDisplay = type.EqualsLiteral("controlbarchange") || + type.EqualsLiteral("resizecaption"); + + if (setDirty) { for (uint32_t i = 0; i < mTextTracks->Length(); i++) { ((*mTextTracks)[i])->SetCuesDirty(); } } - - if (type.EqualsLiteral("controlbarchange")) { + if (updateDisplay) { UpdateCueDisplay(); } diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp index dbfedf3cc227..43932520f622 100644 --- a/layout/generic/nsVideoFrame.cpp +++ b/layout/generic/nsVideoFrame.cpp @@ -238,18 +238,19 @@ already_AddRefed nsVideoFrame::BuildLayer( return result.forget(); } -class DispatchResizeToControls : public Runnable { +class DispatchResizeEvent : public Runnable { public: - explicit DispatchResizeToControls(nsIContent* aContent) - : mozilla::Runnable("DispatchResizeToControls"), mContent(aContent) {} + explicit DispatchResizeEvent(nsIContent* aContent, const nsString& aName) + : mozilla::Runnable("DispatchResizeEvent"), + mContent(aContent), + mName(aName) {} NS_IMETHOD Run() override { - nsContentUtils::DispatchTrustedEvent( - mContent->OwnerDoc(), mContent, - NS_LITERAL_STRING("resizevideocontrols"), CanBubble::eNo, - Cancelable::eNo); + nsContentUtils::DispatchTrustedEvent(mContent->OwnerDoc(), mContent, mName, + CanBubble::eNo, Cancelable::eNo); return NS_OK; } nsCOMPtr mContent; + nsString mName; }; void nsVideoFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics, @@ -354,10 +355,12 @@ void nsVideoFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics, FinishReflowChild(child, aPresContext, kidDesiredSize, &kidReflowInput, borderPadding.left, borderPadding.top, 0); - if (child->GetContent() == videoControlsDiv && - child->GetSize() != oldChildSize) { + if (child->GetSize() != oldChildSize) { + const nsString name = child->GetContent() == videoControlsDiv + ? NS_LITERAL_STRING("resizevideocontrols") + : NS_LITERAL_STRING("resizecaption"); RefPtr event = - new DispatchResizeToControls(child->GetContent()); + new DispatchResizeEvent(child->GetContent(), name); nsContentUtils::AddScriptRunner(event); } } else { From 315c16a82e925a4768654e3bc9e983714b0a33ba Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Fri, 5 Jul 2019 21:21:25 +0000 Subject: [PATCH 09/12] Bug 1528031 - Require [SecureContext] for navigator.mediaDevices & navigator.mozGetUserMedia(). r=pehrsons,smaug Differential Revision: https://phabricator.services.mozilla.com/D33836 --HG-- extra : moz-landing-system : lando --- modules/libpref/init/StaticPrefList.h | 2 +- testing/web-platform/meta/mediacapture-record/__dir__.ini | 2 +- testing/web-platform/meta/mediacapture-streams/__dir__.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/libpref/init/StaticPrefList.h b/modules/libpref/init/StaticPrefList.h index 8928a21b3420..37af1f98e824 100644 --- a/modules/libpref/init/StaticPrefList.h +++ b/modules/libpref/init/StaticPrefList.h @@ -6299,7 +6299,7 @@ VARCACHE_PREF( Live, "media.devices.insecure.enabled", media_devices_insecure_enabled, - bool, true + bool, false ) // If the above pref is also enabled, this pref enabled getUserMedia() support diff --git a/testing/web-platform/meta/mediacapture-record/__dir__.ini b/testing/web-platform/meta/mediacapture-record/__dir__.ini index fcfb216d298b..59942cb3eae8 100644 --- a/testing/web-platform/meta/mediacapture-record/__dir__.ini +++ b/testing/web-platform/meta/mediacapture-record/__dir__.ini @@ -1 +1 @@ -prefs: [media.navigator.permission.disabled:true, media.navigator.streams.fake:true, media.devices.insecure.enabled:false, dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true] +prefs: [media.navigator.permission.disabled:true, media.navigator.streams.fake:true, dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true] diff --git a/testing/web-platform/meta/mediacapture-streams/__dir__.ini b/testing/web-platform/meta/mediacapture-streams/__dir__.ini index fcfb216d298b..59942cb3eae8 100644 --- a/testing/web-platform/meta/mediacapture-streams/__dir__.ini +++ b/testing/web-platform/meta/mediacapture-streams/__dir__.ini @@ -1 +1 @@ -prefs: [media.navigator.permission.disabled:true, media.navigator.streams.fake:true, media.devices.insecure.enabled:false, dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true] +prefs: [media.navigator.permission.disabled:true, media.navigator.streams.fake:true, dom.security.featurePolicy.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true] From 4736d10ce8bac8b0a01770558da69fb3e4eb9c2b Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Fri, 5 Jul 2019 21:21:38 +0000 Subject: [PATCH 10/12] Bug 1528031 - Update tests to work with [SecureContext] navigator.mediaDevices. r=pehrsons,smaug Differential Revision: https://phabricator.services.mozilla.com/D35970 --HG-- extra : moz-landing-system : lando --- dom/media/test/crashtests/crashtests.list | 2 +- dom/media/tests/crashtests/crashtests.list | 2 +- .../test_getUserMedia_permission.html | 4 +- ...est_peerConnection_basicAudioNATRelay.html | 20 ++++--- ..._peerConnection_basicAudioNATRelayTCP.html | 18 ++++--- ..._peerConnection_basicAudioNATRelayTLS.html | 18 ++++--- ...est_peerConnection_basicAudioNATSrflx.html | 18 ++++--- ...st_peerConnection_stats_relayProtocol.html | 52 +++++++++++-------- .../mochitest/general/test_interfaces.js | 4 +- 9 files changed, 80 insertions(+), 58 deletions(-) diff --git a/dom/media/test/crashtests/crashtests.list b/dom/media/test/crashtests/crashtests.list index 18529eeee6cf..f5d25ececc3b 100644 --- a/dom/media/test/crashtests/crashtests.list +++ b/dom/media/test/crashtests/crashtests.list @@ -115,7 +115,7 @@ skip-if(Android&&AndroidVersion=='22') load video-replay-after-audio-end.html # # This needs to run at the end to avoid leaking busted state into other tests. skip-if(Android) load 691096-1.html # Bug 1365451 load 1236639.html -test-pref(media.navigator.permission.disabled,true) test-pref(media.getusermedia.insecure.enabled,true) test-pref(media.getusermedia.insecure.enabled,true) load 1388372.html +test-pref(media.navigator.permission.disabled,true) test-pref(media.devices.insecure.enabled,true) test-pref(media.getusermedia.insecure.enabled,true) load 1388372.html load 1494073.html skip-if(Android) load 1526044.html # Bug 1528391 skip-if(Android&&AndroidVersion<21) load encrypted-track-with-bad-sample-description-index.mp4 # Bug 1533211, unkip after bug 1550912 diff --git a/dom/media/tests/crashtests/crashtests.list b/dom/media/tests/crashtests/crashtests.list index 83479db53a19..35b1a05225d1 100644 --- a/dom/media/tests/crashtests/crashtests.list +++ b/dom/media/tests/crashtests/crashtests.list @@ -1,4 +1,4 @@ -default-preferences pref(media.peerconnection.enabled,true) pref(media.navigator.permission.disabled,true) pref(dom.disable_open_during_load,false) pref(media.getusermedia.insecure.enabled,true) pref(media.getusermedia.insecure.enabled,true) +default-preferences pref(media.peerconnection.enabled,true) pref(media.navigator.permission.disabled,true) pref(dom.disable_open_during_load,false) pref(media.devices.insecure.enabled,true) pref(media.getusermedia.insecure.enabled,true) load 780790.html load 791270.html diff --git a/dom/media/tests/mochitest/test_getUserMedia_permission.html b/dom/media/tests/mochitest/test_getUserMedia_permission.html index d0a5ce67113e..effc97b89941 100644 --- a/dom/media/tests/mochitest/test_getUserMedia_permission.html +++ b/dom/media/tests/mochitest/test_getUserMedia_permission.html @@ -86,9 +86,9 @@ runTest(async () => { src = `data:text/html;base64,${btoa(source)}`; is(await iframeGum({ src, sandbox: "allow-scripts" }), - "NotAllowedError", "gUM fails in sandboxed data iframe"); + "TypeError", "navigator.mediaDevices undefined in sandboxed data iframe"); is(await iframeGum({ src, sandbox: "allow-scripts allow-same-origin"}), - "NotAllowedError", "gUM fails in regular data iframe"); + "TypeError", "navigator.mediaDevices undefined in regular data iframe"); }); diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelay.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelay.html index 7afaba87b0f2..847e2628172e 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelay.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelay.html @@ -1,4 +1,4 @@ - + @@ -7,18 +7,21 @@
 
 
diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTCP.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTCP.html index 1076dad70b8b..402e94ef50d7 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTCP.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTCP.html @@ -6,19 +6,22 @@
 
 
diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTLS.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTLS.html index 3b839105b550..13c2c37f3b20 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTLS.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTLS.html @@ -6,20 +6,23 @@
 
 
diff --git a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATSrflx.html b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATSrflx.html index 0db12543cb36..7349464be314 100644 --- a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATSrflx.html +++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATSrflx.html @@ -7,18 +7,21 @@
 
 
diff --git a/dom/media/tests/mochitest/test_peerConnection_stats_relayProtocol.html b/dom/media/tests/mochitest/test_peerConnection_stats_relayProtocol.html index baced213c7c0..0d52cf516445 100644 --- a/dom/media/tests/mochitest/test_peerConnection_stats_relayProtocol.html +++ b/dom/media/tests/mochitest/test_peerConnection_stats_relayProtocol.html @@ -7,10 +7,35 @@
 
 
diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js index b9b71af161d4..29ca13cec053 100644 --- a/dom/tests/mochitest/general/test_interfaces.js +++ b/dom/tests/mochitest/general/test_interfaces.js @@ -634,9 +634,9 @@ var interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "MediaCapabilitiesInfo", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "MediaDeviceInfo", insecureContext: true }, + { name: "MediaDeviceInfo", insecureContext: false }, // IMPORTANT: Do not change this list without review from a DOM peer! - { name: "MediaDevices", insecureContext: true }, + { name: "MediaDevices", insecureContext: false }, // IMPORTANT: Do not change this list without review from a DOM peer! { name: "MediaElementAudioSourceNode", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! From 013054f3131ccd34d24045a34378a15fc18d0d49 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sat, 6 Jul 2019 02:36:03 +0000 Subject: [PATCH 11/12] Bug 770286: Prevent git LF-to-CRLF autoconversion r=glandium Currently git for Windows converts LF to CRLF by default, so this change prevents that to match the mercurial behavior. Differential Revision: https://phabricator.services.mozilla.com/D32001 --HG-- extra : moz-landing-system : lando --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..6cbab810c904 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Prevent line ending normalization to follow the mercurial behavior +* -text From 2487eaaf066a087786e0bcc05301863d1ae08645 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Sat, 6 Jul 2019 00:01:24 +0000 Subject: [PATCH 12/12] Bug 1560754: Remove DebuggeeFrameGeneratorScript. r=jorendorff Stop inserting DebuggeeFrameGeneratorScript keys in the cross-compartment wrapper table for the edges from Debugger.Frames for generator / async calls to the generators' scripts. The wrappers are unnecessary, and since they're not unique when multiple Debugger.Frames refer to different calls of the same generator, we can't easily tell when to remove them. Differential Revision: https://phabricator.services.mozilla.com/D35617 --HG-- extra : moz-landing-system : lando --- js/src/jit-test/tests/debug/bug1557343-2.js | 30 ++++++++++++++ js/src/vm/Compartment.h | 31 +++++--------- js/src/vm/Debugger.cpp | 45 ++++++++++----------- js/src/vm/Debugger.h | 2 +- 4 files changed, 62 insertions(+), 46 deletions(-) create mode 100644 js/src/jit-test/tests/debug/bug1557343-2.js diff --git a/js/src/jit-test/tests/debug/bug1557343-2.js b/js/src/jit-test/tests/debug/bug1557343-2.js new file mode 100644 index 000000000000..7eb340ff6d8c --- /dev/null +++ b/js/src/jit-test/tests/debug/bug1557343-2.js @@ -0,0 +1,30 @@ +// |jit-test| --no-ggc +// Don't crash when two Debugger.Frames refer to the same generator script, and +// then one returns. + +var g = newGlobal({ newCompartment: true }); +g.eval(` + function* gen() { + debugger; + yield 1; + } + + function use_gen() { + var gen1 = gen(); + var gen2 = gen(); + + gen1.next(); + gen2.next(); + + gen1.next(); + gen2.next(); + } +`); + +var dbg = new Debugger(g); +var frame; +dbg.onDebuggerStatement = f => { + frame = f; +}; + +g.use_gen(); diff --git a/js/src/vm/Compartment.h b/js/src/vm/Compartment.h index c39144d87241..05ba5825f039 100644 --- a/js/src/vm/Compartment.h +++ b/js/src/vm/Compartment.h @@ -124,18 +124,10 @@ class CrossCompartmentKey { : Debuggee(debugger, referent) {} }; - // Key under which we find debugger's Debugger.Frame for the generator call - // whose AbstractGeneratorObject is referent. - struct DebuggeeFrameGeneratorScript : Debuggee { - DebuggeeFrameGeneratorScript(NativeObject* debugger, JSScript* referent) - : Debuggee(debugger, referent) {} - }; - - using WrappedType = - mozilla::Variant; + using WrappedType = mozilla::Variant; explicit CrossCompartmentKey(JSObject* obj) : wrapped(obj) { MOZ_RELEASE_ASSERT(obj); @@ -160,8 +152,6 @@ class CrossCompartmentKey { : wrapped(std::move(key)) {} explicit CrossCompartmentKey(DebuggeeFrameGenerator&& key) : wrapped(std::move(key)) {} - explicit CrossCompartmentKey(DebuggeeFrameGeneratorScript&& key) - : wrapped(std::move(key)) {} explicit CrossCompartmentKey(NativeObject* debugger, JSScript* referent) : wrapped(DebuggeeJSScript(debugger, referent)) {} explicit CrossCompartmentKey(NativeObject* debugger, LazyScript* referent) @@ -602,23 +592,22 @@ class JS::Compartment { const js::CrossCompartmentKey& wrapped, const js::Value& wrapper); + js::WrapperMap::Ptr lookupWrapper(const js::CrossCompartmentKey& key) const { + return crossCompartmentWrappers.lookup(key); + } + js::WrapperMap::Ptr lookupWrapper(const js::Value& wrapped) const { - return crossCompartmentWrappers.lookup(js::CrossCompartmentKey(wrapped)); + return lookupWrapper(js::CrossCompartmentKey(wrapped)); } js::WrapperMap::Ptr lookupWrapper(JSObject* obj) const { - return crossCompartmentWrappers.lookup(js::CrossCompartmentKey(obj)); + return lookupWrapper(js::CrossCompartmentKey(obj)); } void removeWrapper(js::WrapperMap::Ptr p) { crossCompartmentWrappers.remove(p); } - void removeWrapper(const js::CrossCompartmentKey& key) { - js::WrapperMap::Ptr p = crossCompartmentWrappers.lookup(key); - crossCompartmentWrappers.remove(p); - } - bool hasNurseryAllocatedWrapperEntries(const js::CompartmentFilter& f) { return crossCompartmentWrappers.hasNurseryAllocatedWrapperEntries(f); } diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 4a0bc3b5da4b..b1c2c0cc9671 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -9026,6 +9026,15 @@ DebuggerFrame* DebuggerFrame::create(JSContext* cx, HandleObject proto, * * Yes, officer, I definitely knew all this in advance and designed it this way * the first time. + * + * Note that it is not necessary to have a second cross-compartment wrapper + * table entry to cover the pointer to the generator's script. The wrapper table + * entries play two roles: they help the GC put a debugger zone in the same zone + * group as its debuggee, and they serve as roots when collecting the debuggee + * zone, but not the debugger zone. Since an AbstractGeneratorObject holds a + * strong reference to its callee's script (via the callee), and the AGO and the + * script are always in the same compartment, it suffices to add a + * cross-compartment wrapper table entry for the Debugger.Frame -> AGO edge. */ class DebuggerFrame::GeneratorInfo { // An unwrapped cross-compartment reference to the generator object. @@ -9076,7 +9085,7 @@ bool DebuggerFrame::setGenerator(JSContext* cx, return true; } - // There are five relations we must establish: + // There are four relations we must establish: // // 1) The DebuggerFrame must point to the AbstractGeneratorObject. // @@ -9086,10 +9095,7 @@ bool DebuggerFrame::setGenerator(JSContext* cx, // 3) The compartment's crossCompartmentWrappers map must map this Debugger // and the AbstractGeneratorObject to the DebuggerFrame. // - // 4) The compartment's crossCompartmentWrappers map must map this Debugger - // and the generator's JSScript to the DebuggerFrame. - // - // 5) The generator's script's observer count must be bumped. + // 4) The generator's script's observer count must be bumped. RootedScript script(cx, genObj->callee().nonLazyScript()); auto* info = cx->new_(genObj, script); if (!info) { @@ -9109,17 +9115,14 @@ bool DebuggerFrame::setGenerator(JSContext* cx, Rooted generatorKey( cx, CrossCompartmentKey::DebuggeeFrameGenerator(owner()->toJSObject(), genObj)); - Rooted scriptKey( - cx, CrossCompartmentKey::DebuggeeFrameGeneratorScript( - owner()->toJSObject(), script)); - auto crossCompartmentKeysGuard = MakeScopeExit([&] { - compartment()->removeWrapper(generatorKey); - compartment()->removeWrapper(scriptKey); - }); - if (!compartment()->putWrapper(cx, generatorKey, ObjectValue(*this)) || - !compartment()->putWrapper(cx, scriptKey, ObjectValue(*this))) { + if (!compartment()->putWrapper(cx, generatorKey, ObjectValue(*this))) { return false; } + auto crossCompartmentKeysGuard = MakeScopeExit([&] { + WrapperMap::Ptr generatorPtr = compartment()->lookupWrapper(generatorKey); + MOZ_ASSERT(generatorPtr); + compartment()->removeWrapper(generatorPtr); + }); { AutoRealm ar(cx, script); @@ -9144,7 +9147,7 @@ void DebuggerFrame::clearGenerator(FreeOp* fop) { GeneratorInfo* info = generatorInfo(); - // 5) The generator's script's observer count must be dropped. + // 4) The generator's script's observer count must be dropped. // // For ordinary calls, Debugger.Frame objects drop the script's stepper count // when the frame is popped, but for generators, they leave the stepper count @@ -9175,21 +9178,15 @@ void DebuggerFrame::clearGenerator( return; } - // 4) The compartment's crossCompartmentWrappers map must map this Debugger - // and the generator's JSScript to the DebuggerFrame. - // // 3) The compartment's crossCompartmentWrappers map must map this Debugger // and the AbstractGeneratorObject to the DebuggerFrame. // GeneratorInfo* info = generatorInfo(); - HeapPtr& generatorScript = info->generatorScript(); CrossCompartmentKey generatorKey(CrossCompartmentKey::DebuggeeFrameGenerator( owner->object, &info->unwrappedGenerator())); - CrossCompartmentKey scriptKey( - CrossCompartmentKey::DebuggeeFrameGeneratorScript(owner->object, - generatorScript)); - compartment()->removeWrapper(generatorKey); - compartment()->removeWrapper(scriptKey); + auto generatorPtr = compartment()->lookupWrapper(generatorKey); + MOZ_ASSERT(generatorPtr); + compartment()->removeWrapper(generatorPtr); // 2) generatorFrames must no longer map the AbstractGeneratorObject to the // DebuggerFrame. diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index deec7efa0f65..478ed74553a5 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -1528,7 +1528,7 @@ class DebuggerFrame : public NativeObject { * * If provided, owner must be the Debugger to which this Debugger.Frame * belongs; remove this frame's entry from its generatorFrames map, and clean - * up its cross-compartment wrapper table entries. The owner must be passed + * up its cross-compartment wrapper table entry. The owner must be passed * unless this method is being called from the Debugger.Frame's finalizer. (In * that case, the owner is not reliably available, and is not actually * necessary.)