WICG / document-picture-in-picture

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

"The PiP window cannot be navigated" is not specified #65

Closed domenic closed 1 year ago

domenic commented 1 year ago

I only found this by accident by reading the non-normative introduction:

The PiP window cannot be navigated (any window.history or window.location calls that change to a new document will close the PiP window).

Is this still intended to be implemented? If so, we've got some fun ahead of us, figuring out how to spec it. Some questions to answer:

steimelchrome commented 1 year ago

Yes, so in Chrome we allow same-document navigations, but other navigations will result in closing the document PiP window. I believe that means we'd also close in the situations you describe in the second bullet point

steimelchrome commented 1 year ago

Specifically, here is the code that closes the window on navigation:

https://source.chromium.org/chromium/chromium/src/+/main:content/browser/picture_in_picture/document_picture_in_picture_window_controller_impl.cc;l=206;drc=0195cc9b83ebca340aee0a8404ab356cdc5b1d5b

domenic commented 1 year ago

OK, great, that makes sense. Then, I would suggest adding a monkeypatch section to the spec which happens as part of the task queued in step 16.3 of https://html.spec.whatwg.org/#navigate .

steimelchrome commented 1 year ago

I think this should be fixed, but let me know what you think about it. If it looks good, I can open an issue to merge the monkeypatch

domenic commented 1 year ago

This doesn't quite suffice, although it's close. What will happen now is:

We need to actually abort the navigation process, similar to what step 16.2 in navigation does.