Closed rakuco closed 2 years ago
The current steps for PressureObserver.observe() essentially create a promise, run everything else in an "in parallel" block and return the promise.
This is not entirely spec-compliant though, as per https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-for-spec-authors reaching into gloabals or settings objects is against the idea of running steps in parallel.
The same section has some examples of what can be done, and https://w3c.github.io/screen-wake-lock/#the-request-method should be a good example too.
@arskama @kenchris @wangw-1991
So I guess accessing the document is fine (it is not manipulating) but that can also be done before, but the last steps manipulate the global and should not be done
The current steps for PressureObserver.observe() essentially create a promise, run everything else in an "in parallel" block and return the promise.
This is not entirely spec-compliant though, as per https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-for-spec-authors reaching into gloabals or settings objects is against the idea of running steps in parallel.
The same section has some examples of what can be done, and https://w3c.github.io/screen-wake-lock/#the-request-method should be a good example too.