Skip to content

Commit

Permalink
Bug 1705289 revert from sticky to transient activation requirement fo…
Browse files Browse the repository at this point in the history
…r getDisplayMedia() r=jib

Backed out changeset 7a50bf09d726

There was no known value in relaxing the activation constraint because it
didn't resolve the use case that was thought to have regressed, but apparently
didn't.  https://bugzilla.mozilla.org/show_bug.cgi?id=1704278#c24

This restores specified behavior, which is similar to Safari.
https://github.com/w3c/mediacapture-screen-share/issues/167#issuecomment-821068685

Differential Revision: https://phabricator.services.mozilla.com/D122192
  • Loading branch information
karlt committed Aug 24, 2021
1 parent 99412d3 commit faf0659
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions dom/media/MediaDevices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,11 @@ already_AddRefed<Promise> MediaDevices::GetDisplayMedia(
return nullptr;
}
nsCOMPtr<nsPIDOMWindowInner> owner = do_QueryInterface(global);
/* TODO: bug 1705289
* If the relevant global object of this does not have transient activation,
/* If the relevant global object of this does not have transient activation,
* return a promise rejected with a DOMException object whose name attribute
* has the value InvalidStateError. */
WindowContext* wc = owner->GetWindowContext();
if (!wc || !wc->HasBeenUserGestureActivated()) {
if (!wc || !wc->HasValidTransientUserGestureActivation()) {
p->MaybeRejectWithInvalidStateError(
"getDisplayMedia must be called from a user gesture handler.");
return p.forget();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[getdisplaymedia-user-activation-consumed.https.html]
[Test getDisplayMedia() after user activation is consumed]
expected: FAIL
expected:
if os == "android": FAIL

0 comments on commit faf0659

Please sign in to comment.