Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/fullscreen/trusted-click.js

Issue 2376103007: Import wpt@09907a9c4bcee14986431d53e4381384c7c69107 (Closed)
Patch Set: update platform expectations Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Invokes callback from a trusted click event, to satisfy
2 // https://html.spec.whatwg.org/#triggered-by-user-activation
3 function trusted_click(callback, container)
4 {
5 var document = container.ownerDocument;
6 var button = document.createElement("button");
7 button.textContent = "click to continue test";
8 button.style.display = "block";
9 button.style.fontSize = "20px";
10 button.style.padding = "10px";
11 button.onclick = function()
12 {
13 callback();
14 container.removeChild(button);
15 };
16 container.appendChild(button);
17 }
18
19 // Invokes element.requestFullscreen() from a trusted click.
20 function trusted_request(element, container)
21 {
22 var request = element.requestFullscreen.bind(element);
23 trusted_click(request, container || element.parentNode);
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698