haikuwebkit/LayoutTests/fullscreen/full-screen-iframe-not-allo...

25 lines
919 B
HTML
Raw Permalink Normal View History

2011-03-12 Jer Noble <jer.noble@apple.com> Reviewed by Eric Carlson. FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 * fullscreen/full-screen-css.html: Use runWithKeyDown. * fullscreen/full-screen-remove-ancestor.html: Ditto. * fullscreen/full-screen-remove.html: Ditto. * fullscreen/full-screen-request.html: Ditto. * fullscreen/full-screen-twice.html: Ditto. * fullscreen/full-screen-test.js: * fullscreen/full-screen-iframe-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-allowed.html: Added. * fullscreen/full-screen-iframe-not-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-not-allowed.html: Added. (runWithKeyDown): Added. Wraps the command in a keyDown/keyPress listener. * platform/mac-wk2/Skipped: Added new tests to skipped list. * platform/qt-wk2/Skipped: Ditto. 2011-03-13 Jer Noble <jer.noble@apple.com> FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 Tests: fullscreen/full-screen-iframe-allowed.html fullscreen/full-screen-iframe-not-allowed.html Disable full screen documents in the following conditions: 1) requesting element is in an iframe which does not have a webkitallowfullscreen attribute. 2) page is not processing a user gesture. * dom/Document.cpp: (WebCore::Document::fullScreenIsAllowedForElement): Added. Checks to see if elements contained in IFRAMES are allowed to enter full screen. (WebCore::Document::webkitRequestFullScreenForElement): Checks if page is currently processing a user gesture. * dom/Document.h: * html/HTMLAttributeNames.in: Added webkitallowfullscreenAttr. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::allowFullScreen): Added. * html/HTMLFrameElementBase.h: Canonical link: https://commits.webkit.org/70918@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-03-14 17:52:31 +00:00
<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=56264">bug 56264</a>:
Handle entering full screen security restrictions</p>
2011-04-19 Jer Noble <jer.noble@apple.com> Reviewed by Daniel Bates. Full Screen from within an <iframe> does not cause <iframe> to resize. https://bugs.webkit.org/show_bug.cgi?id=58638 * fullscreen/full-screen-frameset-expected.txt: Added. * fullscreen/full-screen-frameset.html: Added. * fullscreen/content/inner.html: Added. * fullscreen/full-screen-iframe-allowed-expected.txt: Updated. * fullscreen/full-screen-iframe-allowed.html: Add a button with which to trigger full screen mode in Safari. * fullscreen/full-screen-iframe-not-allowed-expected.txt: Updated. * fullscreen/full-screen-iframe-not-allowed.html: Ditto. * fullscreen/resources/allowed.html: Added. * fullscreen/resources/inner.html: Added. 2011-04-19 Jer Noble <jer.noble@apple.com> Reviewed by Daniel Bates. Full Screen from within an <iframe> does not cause <iframe> to resize. https://bugs.webkit.org/show_bug.cgi?id=58638 Tests: fullscreen/full-screen-frameset.html * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Add the -webkit-full-screen pseudo class to frame elements which contain full screen elements. * css/fullscreen.css: (iframe:-webkit-full-screen): Add iframe-specific styling rules. * dom/Document.cpp: (WebCore::Document::setContainsFullScreenElementRecursively): Added. Walk up each successive document owner element, calling setContainsFullScreenElement() if owner is a frame element. (WebCore::Document::fullScreenIsAllowedForElement): Use the new Element::isFrameElementBase call instead of checking the element's tag name. (WebCore::Document::webkitWillEnterFullScreenForElement): Mark any containing iframes as containing a full screen element. (WebCore::Document::webkitWillExitFullScreenForElement): Ditto. * dom/Element.h: (WebCore::Element::isFrameElementBase): Added. * html/HTMLFrameElement.h: (WebCore::HTMLFrameElement::allowFullScreen): Disable full screen from within HTMLFrameElements. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::setContainsFullScreenElement): Added. * html/HTMLFrameElementBase.h: (WebCore::HTMLFrameElementBase::containsFullScreenElement): Added. (WebCore::HTMLFrameElementBase::isFrameElementBase): Added. 2011-04-19 Jer Noble <jer.noble@apple.com> Reviewed by Daniel Bates. Full Screen from within an <iframe> does not cause <iframe> to resize. https://bugs.webkit.org/show_bug.cgi?id=58638 Tests: fullscreen/full-screen-frameset-allowed.html fullscreen/full-screen-frameset-not-allowed.html Return the _element's document instead of the WKView's document, which will be different in the case of elements within <iframe>s. * WebView/WebFullScreenController.mm: (-[WebFullScreenController _document]): 2011-04-19 Jer Noble <jer.noble@apple.com> Reviewed by Daniel Bates. Full Screen from within an <iframe> does not cause <iframe> to resize. https://bugs.webkit.org/show_bug.cgi?id=58638 Tests: fullscreen/full-screen-frameset-allowed.html fullscreen/full-screen-frameset-not-allowed.html * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Cancel the background animation if the full screen animation finishes first. * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): m_fullScreenRootLayer was uninitialized. Canonical link: https://commits.webkit.org/74435@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-04-22 23:52:44 +00:00
<p>To test manually, click the "Go full screen" button - the page should not enter full screen mode.</p>
2011-03-12 Jer Noble <jer.noble@apple.com> Reviewed by Eric Carlson. FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 * fullscreen/full-screen-css.html: Use runWithKeyDown. * fullscreen/full-screen-remove-ancestor.html: Ditto. * fullscreen/full-screen-remove.html: Ditto. * fullscreen/full-screen-request.html: Ditto. * fullscreen/full-screen-twice.html: Ditto. * fullscreen/full-screen-test.js: * fullscreen/full-screen-iframe-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-allowed.html: Added. * fullscreen/full-screen-iframe-not-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-not-allowed.html: Added. (runWithKeyDown): Added. Wraps the command in a keyDown/keyPress listener. * platform/mac-wk2/Skipped: Added new tests to skipped list. * platform/qt-wk2/Skipped: Ditto. 2011-03-13 Jer Noble <jer.noble@apple.com> FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 Tests: fullscreen/full-screen-iframe-allowed.html fullscreen/full-screen-iframe-not-allowed.html Disable full screen documents in the following conditions: 1) requesting element is in an iframe which does not have a webkitallowfullscreen attribute. 2) page is not processing a user gesture. * dom/Document.cpp: (WebCore::Document::fullScreenIsAllowedForElement): Added. Checks to see if elements contained in IFRAMES are allowed to enter full screen. (WebCore::Document::webkitRequestFullScreenForElement): Checks if page is currently processing a user gesture. * dom/Document.h: * html/HTMLAttributeNames.in: Added webkitallowfullscreenAttr. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::allowFullScreen): Added. * html/HTMLFrameElementBase.h: Canonical link: https://commits.webkit.org/70918@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-03-14 17:52:31 +00:00
<script src="full-screen-test.js"></script>
<script>
function runTest() {
var frame = document.getElementById('frame');
waitForEvent(frame.contentDocument, 'webkitfullscreenchange', function() {
consoleWrite("FAIL - entered full screen!");
endTest();
});
waitForEventAndEnd(frame.contentDocument, 'webkitfullscreenerror', function() {
consoleWrite("SUCCEED - did not enter full screen!");
});
2011-03-12 Jer Noble <jer.noble@apple.com> Reviewed by Eric Carlson. FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 * fullscreen/full-screen-css.html: Use runWithKeyDown. * fullscreen/full-screen-remove-ancestor.html: Ditto. * fullscreen/full-screen-remove.html: Ditto. * fullscreen/full-screen-request.html: Ditto. * fullscreen/full-screen-twice.html: Ditto. * fullscreen/full-screen-test.js: * fullscreen/full-screen-iframe-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-allowed.html: Added. * fullscreen/full-screen-iframe-not-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-not-allowed.html: Added. (runWithKeyDown): Added. Wraps the command in a keyDown/keyPress listener. * platform/mac-wk2/Skipped: Added new tests to skipped list. * platform/qt-wk2/Skipped: Ditto. 2011-03-13 Jer Noble <jer.noble@apple.com> FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 Tests: fullscreen/full-screen-iframe-allowed.html fullscreen/full-screen-iframe-not-allowed.html Disable full screen documents in the following conditions: 1) requesting element is in an iframe which does not have a webkitallowfullscreen attribute. 2) page is not processing a user gesture. * dom/Document.cpp: (WebCore::Document::fullScreenIsAllowedForElement): Added. Checks to see if elements contained in IFRAMES are allowed to enter full screen. (WebCore::Document::webkitRequestFullScreenForElement): Checks if page is currently processing a user gesture. * dom/Document.h: * html/HTMLAttributeNames.in: Added webkitallowfullscreenAttr. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::allowFullScreen): Added. * html/HTMLFrameElementBase.h: Canonical link: https://commits.webkit.org/70918@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-03-14 17:52:31 +00:00
runWithKeyDown(function() {
2011-03-12 Jer Noble <jer.noble@apple.com> Reviewed by Eric Carlson. FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 * fullscreen/full-screen-css.html: Use runWithKeyDown. * fullscreen/full-screen-remove-ancestor.html: Ditto. * fullscreen/full-screen-remove.html: Ditto. * fullscreen/full-screen-request.html: Ditto. * fullscreen/full-screen-twice.html: Ditto. * fullscreen/full-screen-test.js: * fullscreen/full-screen-iframe-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-allowed.html: Added. * fullscreen/full-screen-iframe-not-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-not-allowed.html: Added. (runWithKeyDown): Added. Wraps the command in a keyDown/keyPress listener. * platform/mac-wk2/Skipped: Added new tests to skipped list. * platform/qt-wk2/Skipped: Ditto. 2011-03-13 Jer Noble <jer.noble@apple.com> FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 Tests: fullscreen/full-screen-iframe-allowed.html fullscreen/full-screen-iframe-not-allowed.html Disable full screen documents in the following conditions: 1) requesting element is in an iframe which does not have a webkitallowfullscreen attribute. 2) page is not processing a user gesture. * dom/Document.cpp: (WebCore::Document::fullScreenIsAllowedForElement): Added. Checks to see if elements contained in IFRAMES are allowed to enter full screen. (WebCore::Document::webkitRequestFullScreenForElement): Checks if page is currently processing a user gesture. * dom/Document.h: * html/HTMLAttributeNames.in: Added webkitallowfullscreenAttr. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::allowFullScreen): Added. * html/HTMLFrameElementBase.h: Canonical link: https://commits.webkit.org/70918@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-03-14 17:52:31 +00:00
frame.contentDocument.documentElement.webkitRequestFullScreen();
});
}
</script>
Support 'allow="fullscreen"' feature policy https://bugs.webkit.org/show_bug.cgi?id=206806 <rdar://problem/55640448> Patch by Jer Noble <jer.noble@apple.com> on 2020-01-27 Reviewed by Youenn Fablet. Source/WebCore: Test: http/tests/fullscreen/fullscreen-feature-policy.html The unprefixed version of the Fullscreen API has deprecated the 'allowfullscreen' iframe attribute in favor of the 'allow="fullscreen"' style attribute used by Feature Policy. Add support for such, including the specified handling for the legacy 'allowfullscreen' attribute. Note: this patch will (intentionally) change the default behavior of <iframe>s. Previously any <iframe> without the "allowfullscreen" attribute would not be allowed to enter fullscreen mode. After this patch, <iframes> without the legacy attribute or an explicit fullscreen Feature Policy will be allowed to enter fullscreen so long as their origin is the same as the top document (and that all parent iframes are also allowed to enter fullscreen). * dom/FullscreenManager.cpp: (WebCore::FullscreenManager::requestFullscreenForElement): (WebCore::FullscreenManager::isFullscreenEnabled const): (WebCore::isAttributeOnAllOwners): Deleted. (WebCore::FullscreenManager::fullscreenIsAllowedForElement const): Deleted. * dom/FullscreenManager.h: * html/FeaturePolicy.cpp: (WebCore::isFeaturePolicyAllowedByDocumentAndAllOwners): (WebCore::FeaturePolicy::parse): (WebCore::FeaturePolicy::allows const): * html/FeaturePolicy.h: * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::parseAttribute): (WebCore::HTMLIFrameElement::featurePolicy const): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): (WebCore::isSyncXHRAllowedByFeaturePolicy): Deleted. LayoutTests: * fullscreen/full-screen-enabled-prefixed.html: * fullscreen/full-screen-enabled.html: * fullscreen/full-screen-frameset-expected.txt: Removed. * fullscreen/full-screen-frameset.html: Removed. * fullscreen/full-screen-iframe-not-allowed.html: * fullscreen/full-screen-restrictions.html: * http/tests/fullscreen/fullscreen-feature-policy-expected.txt: Added. * http/tests/fullscreen/fullscreen-feature-policy.html: Added. Canonical link: https://commits.webkit.org/219826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-27 20:54:54 +00:00
<iframe id="frame" src="resources/inner.html" onload="runTest()" allow="fullscreen 'none'">
2011-03-12 Jer Noble <jer.noble@apple.com> Reviewed by Eric Carlson. FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 * fullscreen/full-screen-css.html: Use runWithKeyDown. * fullscreen/full-screen-remove-ancestor.html: Ditto. * fullscreen/full-screen-remove.html: Ditto. * fullscreen/full-screen-request.html: Ditto. * fullscreen/full-screen-twice.html: Ditto. * fullscreen/full-screen-test.js: * fullscreen/full-screen-iframe-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-allowed.html: Added. * fullscreen/full-screen-iframe-not-allowed-expected.txt: Added. * fullscreen/full-screen-iframe-not-allowed.html: Added. (runWithKeyDown): Added. Wraps the command in a keyDown/keyPress listener. * platform/mac-wk2/Skipped: Added new tests to skipped list. * platform/qt-wk2/Skipped: Ditto. 2011-03-13 Jer Noble <jer.noble@apple.com> FullScreen: Handle entering full screen security restrictions https://bugs.webkit.org/show_bug.cgi?id=56264 Tests: fullscreen/full-screen-iframe-allowed.html fullscreen/full-screen-iframe-not-allowed.html Disable full screen documents in the following conditions: 1) requesting element is in an iframe which does not have a webkitallowfullscreen attribute. 2) page is not processing a user gesture. * dom/Document.cpp: (WebCore::Document::fullScreenIsAllowedForElement): Added. Checks to see if elements contained in IFRAMES are allowed to enter full screen. (WebCore::Document::webkitRequestFullScreenForElement): Checks if page is currently processing a user gesture. * dom/Document.h: * html/HTMLAttributeNames.in: Added webkitallowfullscreenAttr. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::allowFullScreen): Added. * html/HTMLFrameElementBase.h: Canonical link: https://commits.webkit.org/70918@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-03-14 17:52:31 +00:00
</iframe>