mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d
This commit is contained in:
parent
65dd6d4340
commit
ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions
24
tests/wpt/web-platform-tests/fullscreen/trusted-click.js
Normal file
24
tests/wpt/web-platform-tests/fullscreen/trusted-click.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Invokes callback from a trusted click event, to satisfy
|
||||
// https://html.spec.whatwg.org/#triggered-by-user-activation
|
||||
function trusted_click(callback, container)
|
||||
{
|
||||
var document = container.ownerDocument;
|
||||
var button = document.createElement("button");
|
||||
button.textContent = "click to continue test";
|
||||
button.style.display = "block";
|
||||
button.style.fontSize = "20px";
|
||||
button.style.padding = "10px";
|
||||
button.onclick = function()
|
||||
{
|
||||
callback();
|
||||
container.removeChild(button);
|
||||
};
|
||||
container.appendChild(button);
|
||||
}
|
||||
|
||||
// Invokes element.requestFullscreen() from a trusted click.
|
||||
function trusted_request(element, container)
|
||||
{
|
||||
var request = element.requestFullscreen.bind(element);
|
||||
trusted_click(request, container || element.parentNode);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue