WICG / document-picture-in-picture

https://wicg.github.io/document-picture-in-picture/
Other
58 stars 9 forks source link

Operating in parallel / on promises #9

Closed steimelchrome closed 1 year ago

steimelchrome commented 1 year ago

Migrated from https://github.com/steimelchrome/steimelchrome.github.io/issues/7

From domenic@:

" Check out https://html.spec.whatwg.org/#event-loop-for-spec-authors .

You cannot throw from in parallel. You cannot look at a document's style sheets in parallel. You cannot manipulate promises in parallel. You cannot create new DocumentPictureInPictureSession objects, or even Window objects, in parallel.

Basically, you need to clearly separate the stuff that's on the main thread, and happens before you go in parallel, from the stuff that's in the "browser process", in parallel. And carefully post tasks when you need to sync back to the main thread.

This also applies when navigating to existing concepts. E.g. you use "associated Document" a lot---but whose associated Document? Associated Document is, by definition, the property of a Window object. So presumably, you need to navigate from the one object you have a handle to---the this value inside your method steps---pass that along to the "open DocumentPictureInPictureSession algorithm", then look at documentPictureInPicture's relevant global object's associated Document. "

steimelchrome commented 1 year ago

I think this can be closed since the method steps no longer go into parallel