Skip to content

Commit

Permalink
PiP 2.0: Add width/height options to DocumentPictureInPictureOptions
Browse files Browse the repository at this point in the history
This CL adds width and height as options in
DocumentPictureInPictureOptions to allow websites to give a specific
size if they'd prefer over giving just an aspect ratio.

Bug: 1392767
Change-Id: I1954b050536c5ecd901c0e4779e95066ff80b9a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4049624
Reviewed-by: Frank Liberato <[email protected]>
Reviewed-by: Alexander Timin <[email protected]>
Reviewed-by: Fr <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Elly Fong-Jones <[email protected]>
Commit-Queue: Tommy Steimel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1097969}
  • Loading branch information
steimelchrome authored and chromium-wpt-export-bot committed Jan 27, 2023
1 parent 06adeef commit 97b6d03
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<title>Test that documentPictureInPicture.requestWindow()
fails if width or height is specified without the other</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<body>
<script>
promise_test(async t => {
await test_driver.bless('request PiP window');
await promise_rejects_js(t, RangeError,
documentPictureInPicture.requestWindow({width: 500}));
},
"requestWindow should fail when width is specified without height");

promise_test(async t => {
await test_driver.bless('request PiP window');
await promise_rejects_js(t, RangeError,
documentPictureInPicture.requestWindow({height: 300}));
},
"requestWindow should fail when height is specified without width");
</script>
</body>

0 comments on commit 97b6d03

Please sign in to comment.