haikuwebkit/LayoutTests/fullscreen/full-screen-iframe-zIndex.html

54 lines
2.0 KiB
HTML
Raw Permalink Normal View History

2011-05-29 Jer Noble <jer.noble@apple.com> Reviewed by Simon Fraser. Embedded Vimeo video, when taken fullscreen, is overlapped by content from the enclosing page https://bugs.webkit.org/show_bug.cgi?id=61712 * fullscreen/full-screen-iframe-zIndex-expected.txt: Added. * fullscreen/full-screen-iframe-zIndex.html: Added. * platform/mac/fullscreen/full-screen-iframe-zIndex-expected.png: Added. 2011-05-29 Jer Noble <jer.noble@apple.com> Reviewed by Simon Fraser. Embedded Vimeo video, when taken fullscreen, is overlapped by content from the enclosing page https://bugs.webkit.org/show_bug.cgi?id=61712 Tests: fullscreen/full-screen-iframe-zIndex.html Walk up the ancestor chain for the full-screen element, marking them as full-screen ancestors. Then, we apply a pseudo-class to those elements, which disable all their stacking-context-creating styles. Set the z-index of all full-screen elements (and the iframes which contain them) to a large value, ensuring they appear above other sibling elements. This new behavior replaces the previous "-webkit-full-screen-media-document" behavior and pesudo-class, so remove it and replace it with the new pseudo-class. * css/CSSSelector.cpp: (WebCore::nameToPseudoTypeMap): Add -webkit-full-screen-ancestor and remove -webkit-full-screen-media-document. (WebCore::CSSSelector::pseudoId): Add PseudoFullScreenAncestor and remove PseudoFullScreenMediaDocument (WebCore::CSSSelector::extractPseudoType): Ditto. * css/CSSSelector.h: Ditto. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Remove the PseudoFullScreenMediaDocument implementation and replace it with PseudoFullScreenAncestor. * css/fullscreen.css: (:-webkit-full-screen): Add a z-index property. (:-webkit-full-screen-ancestor:not(iframe)): Added. Reset the z-index to auto, and reset other stacking-context creating properties. * dom/Document.cpp: (WebCore::Document::setContainsFullScreenElementRecursively): Recurse up every element instead of just the iframe elements. (WebCore::Document::webkitWillEnterFullScreenForElement): Ditto. * dom/Element.cpp: (WebCore::Element::willRemove): Reset our parent's containsFullScreenElement property. (WebCore::Element::insertedIntoTree): Ditto. (WebCore::Element::containsFullScreenElement): Moved here from HTMLElementBase. (WebCore::Element::setContainsFullScreenElement): Ditto. * dom/Element.h: * dom/ElementRareData.h: (WebCore::ElementRareData::ElementRareData): Added ivar and initializer for m_containsFullScreenElement. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): Removed ivar and initializer. (WebCore::HTMLFrameElementBase::setContainsFullScreenElement): Moved into Element. * html/HTMLFrameElementBase.h: * rendering/style/RenderStyleConstants.h: Canonical link: https://commits.webkit.org/77155@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-05-30 02:05:30 +00:00
<!DOCTYPE html>
<html>
<head>
<script>
var runPixelTests = true;
function init() {
// 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 {
var iframe = document.getElementById('block1');
var element = iframe.contentDocument.documentElement;
waitForEventAndEnd(element, 'webkitfullscreenchange');
runWithKeyDown(goFullScreen);
}
}
function goFullScreen() {
var iframe = document.getElementById('block1');
var element = iframe.contentDocument.documentElement;
element.webkitRequestFullScreen();
}
</script>
<script src="full-screen-test.js"></script>
<style>
#block1 {
width: 200px;
height: 100px;
border: 4px solid darkgreen;
background-color: green;
z-index: 0;
2011-05-29 Jer Noble <jer.noble@apple.com> Reviewed by Simon Fraser. Embedded Vimeo video, when taken fullscreen, is overlapped by content from the enclosing page https://bugs.webkit.org/show_bug.cgi?id=61712 * fullscreen/full-screen-iframe-zIndex-expected.txt: Added. * fullscreen/full-screen-iframe-zIndex.html: Added. * platform/mac/fullscreen/full-screen-iframe-zIndex-expected.png: Added. 2011-05-29 Jer Noble <jer.noble@apple.com> Reviewed by Simon Fraser. Embedded Vimeo video, when taken fullscreen, is overlapped by content from the enclosing page https://bugs.webkit.org/show_bug.cgi?id=61712 Tests: fullscreen/full-screen-iframe-zIndex.html Walk up the ancestor chain for the full-screen element, marking them as full-screen ancestors. Then, we apply a pseudo-class to those elements, which disable all their stacking-context-creating styles. Set the z-index of all full-screen elements (and the iframes which contain them) to a large value, ensuring they appear above other sibling elements. This new behavior replaces the previous "-webkit-full-screen-media-document" behavior and pesudo-class, so remove it and replace it with the new pseudo-class. * css/CSSSelector.cpp: (WebCore::nameToPseudoTypeMap): Add -webkit-full-screen-ancestor and remove -webkit-full-screen-media-document. (WebCore::CSSSelector::pseudoId): Add PseudoFullScreenAncestor and remove PseudoFullScreenMediaDocument (WebCore::CSSSelector::extractPseudoType): Ditto. * css/CSSSelector.h: Ditto. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Remove the PseudoFullScreenMediaDocument implementation and replace it with PseudoFullScreenAncestor. * css/fullscreen.css: (:-webkit-full-screen): Add a z-index property. (:-webkit-full-screen-ancestor:not(iframe)): Added. Reset the z-index to auto, and reset other stacking-context creating properties. * dom/Document.cpp: (WebCore::Document::setContainsFullScreenElementRecursively): Recurse up every element instead of just the iframe elements. (WebCore::Document::webkitWillEnterFullScreenForElement): Ditto. * dom/Element.cpp: (WebCore::Element::willRemove): Reset our parent's containsFullScreenElement property. (WebCore::Element::insertedIntoTree): Ditto. (WebCore::Element::containsFullScreenElement): Moved here from HTMLElementBase. (WebCore::Element::setContainsFullScreenElement): Ditto. * dom/Element.h: * dom/ElementRareData.h: (WebCore::ElementRareData::ElementRareData): Added ivar and initializer for m_containsFullScreenElement. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): Removed ivar and initializer. (WebCore::HTMLFrameElementBase::setContainsFullScreenElement): Moved into Element. * html/HTMLFrameElementBase.h: * rendering/style/RenderStyleConstants.h: Canonical link: https://commits.webkit.org/77155@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-05-30 02:05:30 +00:00
}
#block2 {
width: 100px;
height: 50px;
border: 4px solid darkred;
background-color: red;
z-index: 500;
position: relative;
left: 50px;
top: 25px;
}
</style>
</head>
<body onload="init()">
<div>This tests that an element with a positive z-index appears behind the full screen element.
After entering full screen mode, only a white box should be visible.
Click <button onclick="goFullScreen()">go full screen</button> to run the test.</div>
<div id="block2"></div>
<iframe webkitallowfullscreen src="resources/inner.html" id="block1"></iframe>
Fonts, fullscreen, gamepad, and html5lib tests should use testRunner instead of layoutTestController https://bugs.webkit.org/show_bug.cgi?id=88959 Reviewed by Darin Adler. * fonts/valid-standard-font.html: * fullscreen/anonymous-block-merge-crash.html: * fullscreen/full-screen-element-stack.html: * fullscreen/full-screen-frameset.html: * fullscreen/full-screen-iframe-zIndex.html: * fullscreen/full-screen-keyboard-disabled.html: * fullscreen/full-screen-keyboard-enabled.html: * fullscreen/full-screen-remove-ancestor-during-transition.html: * fullscreen/full-screen-remove-sibling.html: * fullscreen/full-screen-render-inline.html: * fullscreen/full-screen-request-rejected.html: * fullscreen/full-screen-request-removed.html: * fullscreen/full-screen-restrictions.html: * fullscreen/full-screen-stacking-context.html: * fullscreen/full-screen-test.js: (runWithKeyDown): (endTest): * fullscreen/full-screen-zIndex-after.html: * fullscreen/full-screen-zIndex.html: * fullscreen/non-ancestor-iframe.html: * fullscreen/parent-flow-inline-with-block-child.html: * fullscreen/video-controls-override.html: * html5lib/resources/runner.js: (run): * html5lib/webkit-resumer.html: * platform/gtk/fonts/custom-font-missing-glyphs.html: * platform/gtk/fonts/font-face-with-complex-text.html: * platform/gtk/fonts/font-family-fallback.html: * platform/gtk/fonts/synthetic-oblique-positioning.html: Canonical link: https://commits.webkit.org/106812@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-13 12:34:26 +00:00
</body>