Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move requirements for PiP window visibility and closing #223

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chrisn
Copy link
Member

@chrisn chrisn commented Mar 21, 2024

This PR is in response to #191 and the Interaction with Page Visibility section. It moves the part about the PiP window being visible to the Request Picture-in-Picture section, as well as the recommendation to provide a way for users to close the PiP window.


Preview | Diff

index.bs Outdated
@@ -209,14 +209,16 @@ the user agent MUST run the following steps:
8. Set {{pictureInPictureElement}} to |video|.
9. Let <dfn>Picture-in-Picture window</dfn> be a new instance of
{{PictureInPictureWindow}} associated with {{pictureInPictureElement}}.
10. Append <a>relevant settings object</a>'s <a>origin</a> to
10. When the Picture-in-Picture window is opened it MUST be visible, even when
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the right place actually.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about simply moving the following at the end of ## Request Picture-in-Picture ## {#request-pip} section?

When {{pictureInPictureElement}} is set, the Picture-in-Picture window MUST
be visible, even when the <a>Document</a> is not in focus or hidden. The user
agent SHOULD provide a way for users to manually close the Picture-in-Picture
window.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would work. I was in two minds about it when I made this edit...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it as you suggested.

Copy link
Collaborator

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@beaufortfrancois
Copy link
Collaborator

@chrisn I'll let you merge when you're ready.

@chrisn
Copy link
Member Author

chrisn commented Mar 22, 2024

Perfect, thanks. Just waiting on confirmation from @marcoscaceres.

Comment on lines +240 to +243
When {{pictureInPictureElement}} is set, the Picture-in-Picture window MUST
be visible, even when the <a>Document</a> is not in focus or hidden. The user
agent SHOULD provide a way for users to manually close the Picture-in-Picture
window.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is quite right... or not stringent enough. I think what needs to happen is that:

  • The pip window needs to be classified as a [=browsing context/top-level traversable=].
  • The user agent MUST retain a system visibility state if "visible" for the pip window - and should be above all other windows.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the relevant parts of the HTML spec I'm not sure if a PiP window should be a top-level traversable, which makes it a traversable navigable, hence a navigable which "presents a Document to the user via its active session history entry". The reason I say this is that a PiP window doesn't present a Document (it's just a rendering surface for video) and doesn't affect session history AFAIK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, yes... it's not a navigable, but I think I think this should maybe run:

Run the focusing steps with the Picture-in-Picture
window.

To focus it. It's still a Window and Document with some limited functionality.

@@ -237,6 +237,11 @@ It is also RECOMMENDED that the Picture-in-Picture window has a maximum and
minimum size. For example, it could be restricted to be between a quarter and
a half of one dimension of the screen.

When {{pictureInPictureElement}} is set, the Picture-in-Picture window MUST
be visible, even when the <a>Document</a> is not in focus or hidden. The user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
be visible, even when the <a>Document</a> is not in focus or hidden. The user
be visible, even when the [=document=]'s {{Window}} is not in [=Window/focus=] or the [=document=]'s [=Document/visibility state=] is "hidden". The user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants