https://github.com/web-platform-tests/wpt
Raw File
Tip revision: ada36ad22e53c231d18145935b158ba4dc58c561 authored by Zhuoyu Qian on 29 March 2018, 01:09:38 UTC
Check BackgroundEdgeOrigin when check BackgroundPosition.
Tip revision: ada36ad
picture-in-picture-helpers.js
function callWithTrustedClick(callback) {
  return new Promise(resolve => {
    let button = document.createElement('button');
    button.textContent = 'click to continue test';
    button.style.display = 'block';
    button.style.fontSize = '20px';
    button.style.padding = '10px';
    button.onclick = () => {
      document.body.removeChild(button);
      resolve(callback());
    };
    document.body.appendChild(button);
    test_driver.click(button);
  });
}

// Calls requestPictureInPicture() in a context that's 'allowed to request PiP'.
function requestPictureInPictureWithTrustedClick(videoElement) {
  return callWithTrustedClick(
      () => videoElement.requestPictureInPicture());
}
back to top