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

Side by Side Diff: LayoutTests/fullscreen/trusted-event.js

Issue 395633011: Implement the unprefixed the Fullscreen API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Invokes callback from a trusted event.
2 // When testing manually, a button is added to the container.
3 function trusted_event(callback, container)
4 {
5 var document = container.ownerDocument;
6
7 if (window.testRunner) {
8 // Running under LayoutTests. Use timeout to be async.
9 setTimeout(function()
10 {
11 document.addEventListener("click", callback);
12 eventSender.mouseDown();
13 eventSender.mouseUp();
14 document.removeEventListener("click", callback);
15 }, 0);
16 } else {
17 // Running as manual test. Show a button to click.
18 var button = document.createElement("button");
19 button.textContent = "click to run test";
20 button.style.fontSize = "20px";
21 button.style.padding = "10px";
22 button.onclick = function()
23 {
24 callback();
25 button.onclick = null;
26 container.removeChild(button);
27 };
28 container.appendChild(button);
29 }
30 }
31
32 // Invokes element.requestFullscreen() from a trusted event.
33 function trusted_request(element)
34 {
35 var request = element.requestFullscreen.bind(element);
36 trusted_event(request, element.parentNode);
37 }
OLDNEW
« no previous file with comments | « LayoutTests/fullscreen/full-screen-unprefixed-and-prefixed-expected.txt ('k') | Source/core/dom/DocumentFullscreen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698