70479f374c6a5439a968b014f9b499e39a562195
[WebKit.git] / LayoutTests / fullscreen / full-screen-remove-ancestor-expected.txt
1
2 EVENT(webkitfullscreenchange)
3 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLElement]') OK
4 EVENT(webkitfullscreenchange)
5 EXPECTED (document.webkitCurrentFullScreenElement == '[object HTMLHtmlElement]') OK
6 END OF TEST
7
8
9
10     // Bail out early if the full screen API is not enabled or is missing:
11     if (Element.prototype.webkitRequestFullScreen == undefined) {
12         logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
13         endTest();
14     } else {
15         var callback;
16         var fullscreenChanged = function(event)
17         {
18             if (callback)
19                 callback(event)
20         };
21         waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
22
23         var span = document.getElementsByTagName('span')[0];
24         var div = span.parentNode;
25
26         var spanEnteredFullScreen = function(event) {
27             callback = documentEnteredFullScreen;
28             testExpected("document.webkitCurrentFullScreenElement", span);
29             document.body.removeChild(div);
30         };
31
32         var documentEnteredFullScreen = function(event) {
33             callback = null;
34             testExpected("document.webkitCurrentFullScreenElement", document.documentElement);
35             endTest();
36         };
37
38         callback = spanEnteredFullScreen;
39         span.webkitRequestFullScreen();
40     }
41
42