w3c / picture-in-picture

Picture-in-Picture (PiP)
https://w3c.github.io/picture-in-picture
Other
309 stars 38 forks source link

Disable Picture-in-Picture steps should queue a task #225

Open chrisn opened 7 months ago

chrisn commented 7 months ago

Raised by @marcoscaceres in #224, about the Disable Picture-in-Picture steps:

This should queue a task or something... promises can't be rejected synchronously here.

Consider, what should happen here:

const video = document.querySelector("video"); await video.requestPictureInPicture(); video.setAttribute("disablePictureInPicture", ""); video.removeAttribute("disablePictureInPicture");

That should probably have no effect. The task at the turn of the event loop should check if the attribute is still present and reject the promise(s) at that point.