Re: [mediacapture-screen-share] Conditional Focus (When Display-Capture Starts) (#190)

> @youennf Your fiddle is more lax than what the [OP proposes](https://wicg.github.io/conditional-focus/#dom-focusablemediastreamtrack-focus): _"MT finishes"_

That might be true, I haven't looked at Elad's spec.
I think Elad and I are mostly aligned there on this 'lax' proposal, @eladalon1983?.

> I disagree shimming should be this hard

Can you describe how hard that is? Shiming is a subtle job and I'd like to understand which getDisplayMedia shiming use cases we are talking about to evaluate whether this is impossible, just hard or just subtle.

> Shims should be able to return a different promise due to synchronous post-success code.

In that case, it becomes very subtle whether calling await will make calling the focus API working or not.
I am favouring web developer simplicity over shiming power/shiming authoring.

> I see no need for it, because you've not shown any benefit over simply queening a task.

I think we covered some benefits already but here are some:
- Simplicity: you cannot call await, instead you need to decide synchronously within one of getDisplayMedia promise registered resolution callback.
- Earlier is better than later when it comes to let UA decide whether to focus or not. By scheduling another task, the risk is to further delay the decision. As I said, fetch event decided for a synchronous constraint.
- After the micro tasks queue is emptied, there are some additional work to be done to finish the current task (contextrestored, animation frame callback...), which will further delay execution of the next task.
- An event loop has several task queues. There is no guarantee which task queue will be picked in the next event loop, so it is difficult to guarantee that the next task will actually be the task to let UA decide focus. This might lead to potential flakinesses or subtle interop issues.

My understanding is that you would like to be able to run the Microtask to select UA decision once all JS-observable microtasks have run. So far, we do not have that infrastructure and the closest to that is queue a microtask in the gym promise resolution task, not queue a task.

-- 
GitHub Notification of comment by youennf
Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share/issues/190#issuecomment-929217983 using your GitHub account


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

Received on Tuesday, 28 September 2021 13:37:29 UTC