mirror of
https://github.com/servo/servo.git
synced 2025-06-23 08:34:42 +01:00
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
23 lines
793 B
JavaScript
23 lines
793 B
JavaScript
// Invokes callback from a trusted click event, to satisfy
|
|
// https://html.spec.whatwg.org/#triggered-by-user-activation
|
|
function trusted_click(test, 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 = test.step_func(function()
|
|
{
|
|
callback();
|
|
container.removeChild(button);
|
|
});
|
|
container.appendChild(button);
|
|
}
|
|
|
|
// Invokes element.requestFullscreen() from a trusted click.
|
|
function trusted_request(test, element, container)
|
|
{
|
|
trusted_click(test, () => element.requestFullscreen(), container || element.parentNode);
|
|
}
|