[compute-pressure] "Valid source type" check in PressureObserver.observe() needs more details (#273)

rakuco has just created a new issue for https://github.com/w3c/compute-pressure:

== "Valid source type" check in PressureObserver.observe() needs more details ==
The current text says:

> If source is not a [valid source type](https://w3c.github.io/compute-pressure/#dfn-valid-source-types), [queue a global task](https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task) on the [PressureObserver task source](https://w3c.github.io/compute-pressure/#dfn-pressureobserver-task-source) given relevantGlobal to reject promise [NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror) and abort these steps.

It is not very clear how to determine whether a given source type is valid or not: https://w3c.github.io/compute-pressure/#dfn-valid-source-types just says "global system thermals" and "central processing unit" (as represented in PressureSource) are the valid source types, but the check in `observe()` is really for whether a source type is supported by the underlying platform/hardware rather than being "valid" from a spec sense.

I think `observe()` should use some different concept that better represents what it is trying to do, which could also integrate more nicely with the automation steps (since a virtual pressure source could be configured to report itself as non-existent).

Please view or discuss this issue at https://github.com/w3c/compute-pressure/issues/273 using your GitHub account


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

Received on Thursday, 30 May 2024 14:37:21 UTC