W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > May 2022

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

From: youennf via GitHub <sysbot+gh@w3.org>
Date: Mon, 23 May 2022 09:32:17 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-1134425493-1653298334-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:57 UTC