Re: [mediacapture-region] Why expose produceCropTarget at MediaDevices level? (#11)

> @youennf - that seems to be a very liberal restriction when dealing with cross-origin iframe's internal structure.. I doubt this will fly.

Probably. As described in the same message, there are ways to fix this (opt-in via requiring to pass the environment id in cropTo, or additional API surface). We should look at what is best in terms of API shape from the use cases.

An opaque identifier like CropTarget has some benefits.
Consumption API is simpler (a single parameter vs. two), no potential race conditions and the intent is clearer in my mind (it remains tied to a single element, contrary to IDs).

The main benefit I see with a string identifier (or a combo of identifiers) is that it can be sent to all channels including server side channels.
@eladalon1983 mentioned several times this use case.
Do we have consensus that going with an opaque identifier means we will not add stringification support?

> The former is also the reason why the handle creation [needs to be async](https://github.com/w3c/mediacapture-region/issues/17).

I do not understand this, can you elaborate?
FWIW, a document has an environment ID which is generated before the document is even created.
CropTarget can be implemented as a pair (global environment ID, local element ID), which are easy to get synchronously.
cropTo is asynchronous so the failure cases can be handled by rejecting cropTo promise, if the given input parameter (CropTarget or element ID) does not allow to get a corresponding bounding box.

> Pages that want certain parts of the page to be focusable should be able to make an explicit decision to do so.

Agreed (with s/focusable/crop-able)

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


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

Received on Friday, 13 May 2022 09:56:34 UTC