OLD | NEW |
| 1 <!DOCTYPE html> |
1 <body onload="runTest();"> | 2 <body onload="runTest();"> |
2 <div>This tests the restrictions to entering full screen mode laid out in sectio
n 4.1 of the W3C | 3 <div>This tests the restrictions to entering full screen mode laid out in sectio
n 4.1 of the W3C |
3 <a href="http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html">Full Scree
n API</a></div> | 4 <a href="http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html">Full Scree
n API</a></div> |
4 <script src="full-screen-test.js"></script> | 5 <script src="full-screen-test.js"></script> |
5 <script> | 6 <script> |
6 // Bail out early if the full screen API is not enabled or is missing: | 7 // Bail out early if the full screen API is not enabled or is missing: |
7 if (Element.prototype.webkitRequestFullScreen == undefined) { | 8 if (Element.prototype.webkitRequestFullScreen == undefined) { |
8 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined
"); | 9 logResult(false, "Element.prototype.webkitRequestFullScreen == undefined
"); |
9 endTest(); | 10 endTest(); |
10 } else { | 11 } else { |
(...skipping 13 matching lines...) Expand all Loading... |
24 runWithKeyDown(function(){div.webkitRequestFullscreen()}); | 25 runWithKeyDown(function(){div.webkitRequestFullscreen()}); |
25 }; | 26 }; |
26 | 27 |
27 var step3 = function() { | 28 var step3 = function() { |
28 consoleWrite('"The context object\'s node document fullscreen elemen
t stack is not empty and its top element is not an ancestor of the context objec
t."'); | 29 consoleWrite('"The context object\'s node document fullscreen elemen
t stack is not empty and its top element is not an ancestor of the context objec
t."'); |
29 var div = document.documentElement.appendChild(document.createElemen
t('div')); | 30 var div = document.documentElement.appendChild(document.createElemen
t('div')); |
30 var div2 = document.documentElement.appendChild(document.createEleme
nt('div')); | 31 var div2 = document.documentElement.appendChild(document.createEleme
nt('div')); |
31 waitForEventOnce(document, 'webkitfullscreenchange', function() { | 32 waitForEventOnce(document, 'webkitfullscreenchange', function() { |
32 waitForEventOnce(document, 'webkitfullscreenerror', function() { | 33 waitForEventOnce(document, 'webkitfullscreenerror', function() { |
33 waitForEventOnce(document, 'webkitfullscreenchange', step4); | 34 waitForEventOnce(document, 'webkitfullscreenchange', step4); |
34 document.webkitExitFullscreen(); | 35 document.webkitExitFullscreen(); |
35 }); | 36 }); |
36 runWithKeyDown(function(){div2.webkitRequestFullscreen()}); | 37 runWithKeyDown(function(){div2.webkitRequestFullscreen()}); |
37 }); | 38 }); |
38 runWithKeyDown(function(){div.webkitRequestFullscreen()}); | 39 runWithKeyDown(function(){div.webkitRequestFullscreen()}); |
39 }; | 40 }; |
40 | 41 |
41 var step4 = function() { | 42 var step4 = function() { |
42 consoleWrite('"A descendant browsing context\'s document has a non-e
mpty fullscreen element stack."'); | 43 consoleWrite('"A descendant browsing context\'s document has a non-e
mpty fullscreen element stack."'); |
43 var iframe = document.documentElement.appendChild(document.createEle
ment('iframe')); | 44 var iframe = document.documentElement.appendChild(document.createEle
ment('iframe')); |
44 iframe.setAttribute('webkitallowfullscreen', 'true'); | 45 iframe.setAttribute('allowfullscreen', 'true'); |
45 var div = iframe.contentDocument.documentElement.appendChild(iframe.
contentDocument.createElement('div')); | 46 var div = iframe.contentDocument.documentElement.appendChild(iframe.
contentDocument.createElement('div')); |
46 var div2 = document.documentElement.appendChild(document.createEleme
nt('div')); | 47 var div2 = document.documentElement.appendChild(document.createEleme
nt('div')); |
47 waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', f
unction() { | 48 waitForEventOnce(iframe.contentDocument, 'webkitfullscreenchange', f
unction() { |
48 waitForEventOnce(document, 'webkitfullscreenerror', function(){ | 49 waitForEventOnce(document, 'webkitfullscreenerror', function(){ |
49 waitForEventOnce(iframe.contentDocument, 'webkitfullscreench
ange', step5); | 50 waitForEventOnce(iframe.contentDocument, 'webkitfullscreench
ange', step5); |
50 iframe.contentDocument.webkitExitFullscreen(); | 51 iframe.contentDocument.webkitExitFullscreen(); |
51 }); | 52 }); |
52 runWithKeyDown(function(){div2.webkitRequestFullscreen()}); | 53 runWithKeyDown(function(){div2.webkitRequestFullscreen()}); |
53 }); | 54 }); |
54 runWithKeyDown(function(){div.webkitRequestFullscreen()}); | 55 runWithKeyDown(function(){div.webkitRequestFullscreen()}); |
55 }; | 56 }; |
56 | 57 |
57 var step5 = function() { | 58 var step5 = function() { |
58 consoleWrite('"This algorithm is not allowed to show a pop-up."'); | 59 consoleWrite('"This algorithm is not allowed to show a pop-up."'); |
59 var div = document.documentElement.appendChild(document.createElemen
t('div')); | 60 var div = document.documentElement.appendChild(document.createElemen
t('div')); |
60 waitForEventOnce(document, 'webkitfullscreenerror', endTest); | 61 waitForEventOnce(document, 'webkitfullscreenerror', endTest); |
61 div.webkitRequestFullscreen(); | 62 div.webkitRequestFullscreen(); |
62 }; | 63 }; |
63 | 64 |
64 if (typeof(testRunner) != 'undefined') | 65 if (typeof(testRunner) != 'undefined') |
65 testRunner.setPopupBlockingEnabled(true); | 66 testRunner.setPopupBlockingEnabled(true); |
66 } | 67 } |
67 </script> | 68 </script> |
OLD | NEW |