Commit 4e86ffc3 authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

[PiP v2] Make options optional

Make the PictureInPictureOptions optional
because we can infer everything from the
element.

BUG=953957

Change-Id: I85865a02a403d7694795d22d2fe49d030a5c2bdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1659151
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: default avatarFrançois Beaufort <beaufort.francois@gmail.com>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671494}
parent ad356ab2
......@@ -8,5 +8,5 @@
RuntimeEnabled=PictureInPictureV2
]
partial interface HTMLElement {
[CallWith=ScriptState, NewObject, RaisesException] Promise<PictureInPictureWindow> requestPictureInPicture(PictureInPictureOptions options);
[CallWith=ScriptState, NewObject, RaisesException] Promise<PictureInPictureWindow> requestPictureInPicture(optional PictureInPictureOptions options);
};
......@@ -105,5 +105,13 @@ promise_test(async t => {
const element = document.getElementById('example');
return promise_rejects(t, new TypeError(), element.requestPictureInPicture({ width: 0, height: 10 }));
}, 'request Picture-in-Picture requires width/height to not be zero (height zero)');
promise_test(async t => {
enablePictureInPictureV2ForTest(t);
const element = document.getElementById('example');
await test_driver.bless('request Picture-in-Picture');
return element.requestPictureInPicture();
}, 'request Picture-in-Picture does not require options');
</script>
</body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment