haikuwebkit/LayoutTests/fullscreen/full-screen-exit-when-popup...

41 lines
1.4 KiB
HTML
Raw Permalink Normal View History

A page should exit fullscreen mode if it opens a new popup https://bugs.webkit.org/show_bug.cgi?id=122865 Reviewed by Jer Noble. Source/WebKit/blackberry: If a fullscreen page opens a popup, the popup would be hidden and therefore invisible to the user. To avoid this, exit fullscreen mode before opening a new window. * WebCoreSupport/ChromeClientBlackBerry.cpp: (WebCore::ChromeClientBlackBerry::createWindow): Source/WebKit/efl: If a fullscreen page opens a popup, the popup would be hidden and therefore invisible to the user. To avoid this, exit fullscreen mode before opening a new window. * WebCoreSupport/ChromeClientEfl.cpp: (WebCore::ChromeClientEfl::createWindow): Source/WebKit/gtk: If a fullscreen page opens a popup, the popup would be hidden and therefore invisible to the user. To avoid this, exit fullscreen mode before opening a new window. * WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::createWindow): Source/WebKit/mac: If a fullscreen page opens a popup, the popup would be hidden and therefore invisible to the user. To avoid this, exit fullscreen mode before opening a new window. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow): Source/WebKit/win: If a fullscreen page opens a popup, the popup would be hidden and therefore invisible to the user. To avoid this, exit fullscreen mode before opening a new window. * WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::createWindow): Source/WebKit2: If a fullscreen page opens a popup, the popup would be hidden and therefore invisible to the user. To avoid this, exit fullscreen mode before opening a new window. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): LayoutTests: * fullscreen/full-screen-exit-when-popup-expected.txt: Added. * fullscreen/full-screen-exit-when-popup.html: Added. Canonical link: https://commits.webkit.org/140996@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-16 22:20:13 +00:00
<body>
<script src="full-screen-test.js"></script>
<span></span>
<script>
// Bail out early if the full screen API is not enabled or is missing:
if (Element.prototype.webkitRequestFullScreen == undefined) {
logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
endTest();
} else {
if (window.testRunner) {
testRunner.setCanOpenWindows(true);
testRunner.setCloseRemainingWindowsWhenComplete(true);
}
var callback;
var fullscreenChanged = function(event)
{
if (callback)
callback(event)
};
waitForEvent(document, 'webkitfullscreenchange', fullscreenChanged);
var spanEnteredFullScreen = function() {
testExpected("document.webkitIsFullScreen", true);
testExpected("document.webkitCurrentFullScreenElement", span);
callback = cancelledFullScreen;
testExpected("window.open('about:blank')", null, "!=");
};
var cancelledFullScreen = function() {
testExpected("document.webkitIsFullScreen", false);
testExpected("document.webkitCurrentFullScreenElement", undefined);
endTest();
};
var span = document.getElementsByTagName('span')[0];
callback = spanEnteredFullScreen;
runWithKeyDown(function(){span.webkitRequestFullScreen()});
}
</script>