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

Update the picture-in-picture IDL file #9811

31 changes: 31 additions & 0 deletions interfaces/picture-in-picture.idl
@@ -0,0 +1,31 @@
// GENERATED CONTENT - DO NOT EDIT
// Content of this file was automatically extracted from the
// "Picture-in-Picture" spec.
// See: https://wicg.github.io/picture-in-picture/

partial interface HTMLVideoElement {
Promise<PictureInPictureWindow> requestPictureInPicture();

attribute EventHandler onenterpictureinpicture;
attribute EventHandler onleavepictureinpicture;

[CEReactions]
attribute boolean disablePictureInPicture;
};

partial interface Document {
readonly attribute boolean pictureInPictureEnabled;

Promise<void> exitPictureInPicture();
};

partial interface DocumentOrShadowRoot {
readonly attribute Element? pictureInPictureElement;
};

interface PictureInPictureWindow {
readonly attribute long width;
readonly attribute long height;

attribute EventHandler onresize;
};
22 changes: 22 additions & 0 deletions picture-in-picture/idlharness.window.js
@@ -0,0 +1,22 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js

'use strict';

// https://wicg.github.io/picture-in-picture/

promise_test(async () => {
const srcs = ['html', 'dom', 'picture-in-picture'];
const [html, dom, pip] = await Promise.all(
srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())));

const idl_array = new IdlArray();
idl_array.add_idls(pip);
idl_array.add_dependency_idls(dom);
idl_array.add_dependency_idls(html);

idl_array.add_objects({
Document: ['document'],
});
idl_array.test();
}, 'picture-in-picture interfaces.');