W3C home > Mailing lists > Public > public-media-capture@w3.org > September 2017

[mediacapture-main] applyConstraints modifies DOM object "in parallel"

From: jan-ivar via GitHub <sysbot+gh@w3.org>
Date: Tue, 05 Sep 2017 17:24:34 +0000
To: public-media-capture@w3.org
Message-ID: <issues.opened-255350957-1504632265-sysbot+gh@w3.org>
jan-ivar has just created a new issue for https://github.com/w3c/mediacapture-main:

== applyConstraints modifies DOM object "in parallel" ==
The [applyConstraints algorithm](https://w3c.github.io/mediacapture-main/getusermedia.html#dfn-applyconstraints-algorithm) currently modifies DOM objects on multiple threads. Not a good idea.

It says: *"Run the following steps in parallel:"*, followed by read/write of the constrainable [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) DOM object.

This is causing confusion about the model, like https://github.com/w3c/mediacapture-main/issues/462#issuecomment-326898778.

Instead, applyConstraints MUST [queue a task](https://www.w3.org/TR/html52/webappapis.html#queuing) before modifying DOM objects.

Fixing this will likely require acknowledging in the spec that this algorithm is to be run not on the DOM object itself, but on an internal representation of the settings on another thread...

...followed by a step to [queue a task](https://www.w3.org/TR/html52/webappapis.html#queuing) to copy those settings to the DOM object and resolve the promise, guaranteeing that https://github.com/w3c/mediacapture-main/issues/462 will never be necessary.

Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/482 using your GitHub account
Received on Tuesday, 5 September 2017 17:24:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 5 September 2017 17:24:34 UTC