[mediacapture-main] relevant or current settings object for fully active tests? (#748)

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

== relevant or current settings object for fully active tests? ==
The `getUserMedia()` [algorithm](https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia) includes two document "fully active" checks.  The first provides a standardized way to reject the request when navigation has made the document inactive.

The spec says to perform "fully active" tests on the responsible document of the *current* settings object, but Firefox and Chrome at least perform a "fully active" test on the *relevant* settings object.

Platform objects [typically](https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-everything) reference the relevant settings settings object, so I'd propose changing to that, assuming there is no good reason for the choice of the current settings object.

> In general, web platform specifications should use the relevant concept, applied to the object being operated on (usually the `this` value of the current method). This mismatches the JavaScript specification, where current is generally used as the default (e.g. in determining the JavaScript realm whose Array constructor should be used to construct the result in Array.prototype.map). But this inconsistency is so embedded in the platform that we have to accept it going forward.

Similarly for the "has focus" test, when a window opener is making a call on the `MediaDevices` in another window, intuitively I expect the relevant window that holds the `MediaDevices` object to be the one that should be checked for focus. 

Similarly for the [device enumeration can proceed test](https://w3c.github.io/mediacapture-main/#device-enumeration-can-proceed).

Web Audio [uses](https://github.com/WebAudio/web-audio-api/issues/2176#issuecomment-640930168) the relevant global similarly.

When there are multiple documents involved, there might potentially be some resource reclaiming benefits to using the relevant settings object, because it short-cuts calls on a `MediaDevices` object when its window has been detached.

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


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

Received on Friday, 13 November 2020 03:48:41 UTC