haikuwebkit/LayoutTests/fullscreen/fullscreen-env.html

54 lines
2.7 KiB
HTML
Raw Permalink Normal View History

Address fullscreen api CSS env feedback https://bugs.webkit.org/show_bug.cgi?id=186684 Reviewed by Simon Fraser. Source/WebCore: Test: fullscreen/fullscreen-env.html + Update the phishing alert text to be more explicit about the specific threats phishing sites represent. + Make the top inset static, rather than dynamic. + Add bottom, left, and right insets for completeness. + Set the fullscreen animation duration as well as delay. + Notify the page when the controls show and hide. * English.lproj/Localizable.strings: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/CSSSelector.h: * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): * css/SelectorCheckerTestFunctions.h: (WebCore::matchesFullScreenControlsHiddenPseudoClass): * css/SelectorPseudoClassAndCompatibilityElementMap.in: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): * dom/ConstantPropertyMap.cpp: (WebCore::ConstantPropertyMap::nameForProperty const): (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): (WebCore::ConstantPropertyMap::didChangeFullscreenInsets): (WebCore::ConstantPropertyMap::setFullscreenAutoHideDuration): (WebCore::ConstantPropertyMap::setFullscreenInsetTop): Deleted. * dom/ConstantPropertyMap.h: * dom/Document.cpp: (WebCore::Document::areFullscreenControlsHidden const): (WebCore::Document::setFullscreenControlsHidden): * dom/Document.h: * page/Page.cpp: (WebCore::Page::setFullscreenInsets): (WebCore::Page::setFullscreenAutoHideDuration): (WebCore::Page::setFullscreenControlsHidden): (WebCore::Page::setFullscreenInsetTop): Deleted. * page/Page.h: (WebCore::Page::fullscreenInsets const): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setFullscreenInsets): (WebCore::Internals::setFullscreenAutoHideDuration): (WebCore::Internals::setFullscreenControlsHidden): (WebCore::Internals::setFullscreenInsetTop): Deleted. * testing/Internals.h: * testing/Internals.idl: Source/WebKit: + Update the phishing alert text to be more explicit about the specific threats phishing sites represent. + Make the top inset static, rather than dynamic. + Add bottom, left, and right insets for completeness. + Set the fullscreen animation duration as well as delay. + Notify the page when the controls show and hide. * UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::setFullscreenInsets): (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideTiming): (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden): (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop): Deleted. (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay): Deleted. * UIProcess/WebFullScreenManagerProxy.h: * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: (-[WKFullScreenViewController showUI]): (-[WKFullScreenViewController hideUI]): (-[WKFullScreenViewController viewWillAppear:]): (-[WKFullScreenViewController _effectiveFullscreenInsets]): (-[WKFullScreenViewController _updateWebViewFullscreenInsets]): (-[WKFullScreenViewController _showPhishingAlert]): (-[WKFullScreenViewController _effectiveFullscreenInsetTop]): Deleted. * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::didExitFullScreen): (WebKit::WebFullScreenManager::setFullscreenInsets): (WebKit::WebFullScreenManager::setFullscreenAutoHideTiming): (WebKit::WebFullScreenManager::setFullscreenControlsHidden): (WebKit::WebFullScreenManager::setFullscreenInsetTop): Deleted. (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay): Deleted. * WebProcess/FullScreen/WebFullScreenManager.h: * WebProcess/FullScreen/WebFullScreenManager.messages.in: LayoutTests: * fullscreen/fullscreen-env-expected.txt: Added. * fullscreen/fullscreen-env.html: Added. * fullscreen/fullscreen-inset-top-expected.txt: Removed. * fullscreen/fullscreen-inset-top.html: Removed. Canonical link: https://commits.webkit.org/202161@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-21 23:13:17 +00:00
<!DOCTYPE html>
<html>
<head>
<script src="full-screen-test.js"></script>
<script>
window.addEventListener('load', event => {
window.target = document.querySelector('#target');
run('internals.setFullscreenInsets({top:1, left:2, bottom:3, right:4})');
testExpected('window.getComputedStyle(target).top', '1px');
testExpected('window.getComputedStyle(target).left', '2px');
testExpected('window.getComputedStyle(target).bottom', '3px');
testExpected('window.getComputedStyle(target).right', '4px');
run('internals.setFullscreenInsets({top:20, left:30, bottom:40, right:50})');
testExpected('window.getComputedStyle(target).top', '20px');
testExpected('window.getComputedStyle(target).left', '30px');
testExpected('window.getComputedStyle(target).bottom', '40px');
testExpected('window.getComputedStyle(target).right', '50px');
run('internals.setFullscreenInsets({top:0, left:0, bottom:0, right:0})');
testExpected('window.getComputedStyle(target).top', '0px');
testExpected('window.getComputedStyle(target).left', '0px');
testExpected('window.getComputedStyle(target).bottom', '0px');
testExpected('window.getComputedStyle(target).right', '0px');
run('internals.setFullscreenAutoHideDuration(2)');
testExpected('window.getComputedStyle(target).transitionDuration', '2s');
run('internals.setFullscreenAutoHideDuration(30)');
testExpected('window.getComputedStyle(target).transitionDuration', '30s');
run('internals.setFullscreenAutoHideDuration(0)');
testExpected('window.getComputedStyle(target).transitionDuration', '0s');
runWithKeyDown(() => {target.webkitRequestFullscreen() });
waitForEventOnce(document, 'webkitfullscreenchange', event => {
run('internals.setFullscreenControlsHidden(true)');
testExpected('document.querySelector("#target:-webkit-full-screen-controls-hidden")', target);
run('internals.setFullscreenControlsHidden(false)');
testExpected('document.querySelector("#target:-webkit-full-screen-controls-hidden")', null);
endTest();
});
});
</script>
<style>
#target {
position: absolute;
top: env(fullscreen-inset-top);
left: env(fullscreen-inset-left);
bottom: env(fullscreen-inset-bottom);
right: env(fullscreen-inset-right);
transition-duration: env(fullscreen-auto-hide-duration);
}
</style>
</head>
<body>
<div id="target">&nbsp;</div>
</body>
</html>