w3c / picture-in-picture

Picture-in-Picture (PiP)
https://w3c.github.io/picture-in-picture
Other
309 stars 38 forks source link

Add the UA slot 'initiators of active Picture-in-Picture sessions' #210

Closed kenchris closed 2 years ago

kenchris commented 2 years ago

Add the internal UA slot 'initiators of active Picture-in-Picture sessions'

This allows other specs, like Compute Pressure, to know if a document currently has an active Picture-in-Picture session.

This is related to https://github.com/WICG/compute-pressure/issues/83


Preview | Diff

kenchris commented 2 years ago

@beaufortfrancois fyi

kenchris commented 2 years ago

Thanks for starting this PR @kenchris! Can you share an example of how you'll use it in Compute Pressure API spec for instance?

This will be used in https://wicg.github.io/compute-pressure/#supporting-algorithms

If [=user agent=]'s [=initiators of active Picture-in-Picture sessions=] [=set/contains=] o's associated document, return true.

kenchris commented 2 years ago

Thanks @beaufortfrancois - I see that I need to change this to store origin instead, as I need to use this from workers (incl. shared workers). I will update the PR

kenchris commented 2 years ago

The way it is going to be used now will be:

Foreach origin in [=initiators of active Picture-in-Picture sessions=]: If o's [relevant settings object]'s [origin] is [same origin-domain] with origin, return true. Otherwise, return false.

kenchris commented 2 years ago

Friendly ping (❁´◡`❁)

beaufortfrancois commented 2 years ago

I'll use my editor hat to merge this CL. @jernoble Let us know if we've missed something. We can always update the spec later.

kenchris commented 2 years ago

Thank you!