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

Add disallowPositionReuse #119

Merged
merged 11 commits into from
Aug 19, 2024
19 changes: 19 additions & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ dictionary DocumentPictureInPictureOptions {
[EnforceRange] unsigned long long width = 0;
[EnforceRange] unsigned long long height = 0;
boolean disallowReturnToOpener = false;
boolean disallowPositionReuse = false;
};

[Exposed=Window, SecureContext]
Expand Down Expand Up @@ -670,6 +671,24 @@ button.
documentPictureInPicture.requestWindow({ disallowReturnToOpener: true });
</pre>

## Disallow position reuse ## {#example-disallow-position-reuse}

While a document picture-in-picture window is open, the user may choose
to resize or reposition it. If the document picture-in-picture window is
closed, then reopened later, the user agent may use the previous position
and size as a hint for where to place the new window.

The site can provide a hint to the user agent that reusing the previous
document picture-in-picture window position and size is not desirable
by setting the {{DocumentPictureInPictureOptions/disallowPositionReuse}}
option. For example, if the site is requesting the new document picture-in-
picture window for an unrelated activity from the previous one, then the site
could provide this hint to the user agent.

<pre class="lang-javascript">
documentPictureInPicture.requestWindow({ disallowPositionReuse: true });
</pre>

# Acknowledgments # {#acknowledgments}

Many thanks to Frank Liberato, Mark Foltz, Klaus Weidner, François Beaufort,
Expand Down