[mediacapture-main] Broken foreground detection (#752)

jan-ivar has just created a new issue for https://github.com/w3c/mediacapture-main:

== Broken foreground detection ==
This spec references _"focus"_  in 8 places, [e.g.](https://w3c.github.io/mediacapture-main/getusermedia.html#dom-mediadevices-getusermedia): _"The User Agent MUST wait to proceed to the next step until the [relevant settings object](https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object)'s responsible document is [fully active](https://html.spec.whatwg.org/multipage/browsers.html#fully-active) and has [focus](https://html.spec.whatwg.org/multipage/#gains-focus)."_

All are meant to ensure camera & microphone cannot be turned on from background tabs, but it doesn't work:

- [focus](https://html.spec.whatwg.org/multipage/#gains-focus) is the wrong algorithm (meant for elements)
- We never intended to require iframe focus (we want the top-level browsing context instead) 
- HTML doesn't detect system-level focus changes https://github.com/whatwg/html/issues/5049.

Other specs are in the same boat.

We need to fix https://github.com/whatwg/html/issues/5049 and use the following algorithm instead of _"and has [focus](https://html.spec.whatwg.org/multipage/#gains-focus)"_:

- _"...and satisfies the [has focus steps](https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps)."_


Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/752 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 22 November 2020 01:56:45 UTC