Re: [mediacapture-region] Should generation of CropTarget from elements be able to fail? (#48)

> we're also discussing failure due to incomplete implementation. (This particular type of failure ~can~ should be synchronous.)

Incomplete implementations are not defined in the spec, you can implement it however you like.
Throwing an exception/rejecting a promise might be fine, using WebIDL or synchronous checks.
Maybe it might be easier for web developers to generate a valid CropTarget attached to the nearest parent element for which cropping is supported (div or body/iframe). When rolling out support of a new element type, the cropping will become more accurate.
Or failing at cropTo time by considering that this was not a valid CropTarget.

In any case, a TypeError synchronous failure is very different from the kind of failures https://github.com/w3c/mediacapture-region/pull/47 is trying to add to the spec.
The scope of this issue is about the latter: should we allow crop target production to fail in case of surface state propagation failure?

> Chrome has so far only implemented cropping to HTMLDivElement and HTMLIFrameElement.

I am surprised to hear that.
I remember stating that kind of possibility in favour of putting this API in element and not mediaDevices as a convenient way to improve feature detection. At the time, I remember you saying this was out of scope since we were going with Element.

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


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

Received on Monday, 23 May 2022 09:32:19 UTC