w3c / compute-pressure

A web API proposal that provides information about available compute capacity
https://www.w3.org/TR/compute-pressure/
Other
69 stars 10 forks source link

Move Options to observe? #259

Closed kenchris closed 6 months ago

kenchris commented 6 months ago

If we want to do that, we should do it now.

Spec wise this should be easy

@arskama would this be hard implementation wise?

Do we recall why we move it to the ctor?

ResizeObserver, PerformanceObserver, MutationObserver has it as part of observe:

undefined observe(Node target, optional MutationObserverInit options = {});
undefined observe(Element target, optional ResizeObserverOptions options = {});
undefined observe(optional PerformanceObserverInit options = {});
kenchris commented 6 months ago

Looks pretty much like we inherited this from when Google was working on this feature:

https://chromium-review.googlesource.com/c/chromium/src/+/2727134/53/third_party/blink/renderer/modules/compute_pressure/compute_pressure_observer.idl

I would say it makes sense to change before shipping

arskama commented 6 months ago

Looking at the implementation, I don't see any big changes necessary in the implementation. Testing code though might have a lot of changes :)