New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make fullscreen API use the top layer #5467
Make fullscreen API use the top layer #5467
Conversation
EWS run on previous version of this PR (hash 8d536df) |
8d536df
to
989d542
Compare
EWS run on previous version of this PR (hash 989d542) |
989d542
to
5905241
Compare
EWS run on previous version of this PR (hash 5905241) |
5905241
to
8369b20
Compare
EWS run on previous version of this PR (hash 8369b20) |
8369b20
to
7a43e9e
Compare
EWS run on previous version of this PR (hash 7a43e9e) |
7a43e9e
to
b5962fe
Compare
EWS run on previous version of this PR (hash b5962fe) |
b5962fe
to
820d754
Compare
fcf9e0b
to
5ca9013
Compare
EWS run on previous version of this PR (hash 5ca9013)
|
5ca9013
to
158ab55
Compare
EWS run on previous version of this PR (hash 158ab55)
|
158ab55
to
2ca80c5
Compare
EWS run on previous version of this PR (hash 2ca80c5)
|
2ca80c5
to
302d488
Compare
EWS run on previous version of this PR (hash 302d488)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Iβm still not sure we have enough testing of this, weβd want tests that fail if any one line of this code was wrong. Regardless, r=me
302d488
to
2dad342
Compare
It took me a while to get the whole |
Thanks for the review! |
EWS run on current version of this PR (hash 2dad342)
|
https://bugs.webkit.org/show_bug.cgi?id=84798 rdar://11313423 Reviewed by Darin Adler. The fullscreen API should use the top layer instead of the fullscreen stack. Some notes: - Pushing to the top layer causes visual changes, so we need to update the DOM methods to follow spec order to prevent unintended effects. Visual changes can't happen before `willEnterFullscreen` and can't happen before `didExitFullscreen` when fully entering/exiting fullscreen. - Since top layer handles visual z-ordering, we can remove old style hacks of clobbering the ancestor chain with special styling, and the associated containsFullscreenElement node flag. Spec: https://fullscreen.spec.whatwg.org * LayoutTests/fullscreen/full-screen-enter-while-exiting-expected.txt: Events are now scheduled and dispatched in didExitFullscreen instead of exitFullscreen(), hence the order change. * Source/WebCore/css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * Source/WebCore/css/CSSSelector.h: * Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in: * Source/WebCore/cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): Remove temporary backdrop workaround that was landed in https://commits.webkit.org/256226@main . * Source/WebCore/css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): * Source/WebCore/css/SelectorCheckerTestFunctions.h: (WebCore::matchesFullScreenPseudoClass): (WebCore::matchesFullScreenAncestorPseudoClass): Rewrite selector checker functions to account for removal of containsFullscreenElement flag. Since :-webkit-fullscreen-ancestor main usage was for the UA stylesheet, we may be able to remove it in a followup clean up. (WebCore::matchesFullScreenParentPseudoClass): Deleted. (part of the backdrop workaround) * Source/WebCore/css/fullscreen.css: (#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API): (:root:-webkit-full-screen-document:not(:-webkit-full-screen)): Only keep overflow: hidden; since top layer does not make the root element unscrollable. (iframe:-webkit-full-screen): Match the spec. (:not(:root):-webkit-full-screen::backdrop): Match the spec by making the fullscreen backdrops black. (:-webkit-full-screen): Deleted. (not needed with top layer) (:root:-webkit-full-screen-document:not(:-webkit-full-screen), :root:-webkit-full-screen-ancestor): Deleted. (:-webkit-full-screen-ancestor:not(iframe)): Deleted. (not needed with top layer) (video:-webkit-full-screen, audio:-webkit-full-screen): Deleted. (to match the spec) (:-webkit-full-screen-parent::before): Deleted. (fake backdrop workaround) * Source/WebCore/dom/Document.cpp: (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): Move element removal handling to `Element::removedFromAncestor()` * Source/WebCore/dom/Element.cpp: (WebCore::Element::insertedIntoAncestor): (WebCore::Element::removedFromAncestor): (WebCore::Element::setFullscreenFlag): (WebCore::Element::setIframeFullscreenFlag): (WebCore::parentCrossingFrameBoundaries): Deleted. (WebCore::Element::setContainsFullScreenElement): Deleted. (WebCore::Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries): Deleted. Removed the containsFullscreenElement flag and replace it with fullscreen flag and iframe fullscreen flag. * Source/WebCore/dom/Element.h: Ditto (WebCore::Element::hasFullscreenFlag const): (WebCore::Element::hasIframeFullscreenFlag const): (WebCore::Element::containsFullScreenElement const): Deleted. * Source/WebCore/dom/FullscreenManager.cpp: (WebCore::FullscreenManager::fullscreenElement const): Rewrite it to iterate through top layer instead of fullscreen stack. (WebCore::FullscreenManager::requestFullscreenForElement): Removed all fullscreen stack handling. Top layer handling is now in `willEnterFullscreen` since it performs visual changes. (WebCore::FullscreenManager::cancelFullscreen): Basically exitFullscreen() but always exits everything. (WebCore::documentsToUnfullscreen): "collecting documents to unfullscreen" algorithm from spec (WebCore::FullscreenManager::exitFullscreen): Steps 1 - 8 of exit fullscreen algorithm from spec (WebCore::FullscreenManager::finishExitFullscreen): Steps 12 - 15 of exit fullscreen algorithm from spec (WebCore::FullscreenManager::willEnterFullscreen): Push documents to top layer, add fullscreen flag & emit events (Step 12 of request fullscreen in spec) (WebCore::FullscreenManager::didExitFullscreen): Everything else that is needed when fully exiting fullscreen. (WebCore::FullscreenManager::exitRemovedFullscreenElementIfNeeded): "removing steps" for element from spec (except for top layer removal which is already done later on in Element::removedFromAncestor) (WebCore::FullscreenManager::isSimpleFullscreenDocument const): "Simple fullscreen document" as defined by the spec, e.g. a document with only one fullscreen element in the top layer. (WebCore::FullscreenManager::adjustFullscreenElementOnNodeRemoval): Deleted. Replaced by exitRemovedFullscreenElementIfNeeded called from Element::removedFromAncestor(). (WebCore::FullscreenManager::clearFullscreenElementStack): Deleted. (WebCore::FullscreenManager::popFullscreenElementStack): Deleted. (WebCore::FullscreenManager::pushFullscreenElementStack): Deleted. (WebCore::FullscreenManager::clear): Remove fullscreen stack remainders. * Source/WebCore/dom/FullscreenManager.h: * Source/WebCore/dom/Node.h: Add IsFullscreen/IsIframeFullscreen flags, remove ContainsFullScreenElement. Shuffle flags around, since Bit 31 is actually not usable (causes integer overflow when using it). Canonical link: https://commits.webkit.org/257456@main
2dad342
to
c96dd4f
Compare
Committed 257456@main (c96dd4f): https://commits.webkit.org/257456@main Reviewed commits have been landed. Closing PR #5467 and removing active labels. |
https://bugs.webkit.org/show_bug.cgi?id=266820 rdar://120052751 Reviewed by Ryosuke Niwa. Remove this code to match the spec closer: https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen It was originally to address a review comment: WebKit#5467 (comment) But this review comment no longer applies now that `Element::setFullscreenFlag` only sets a single flag. * Source/WebCore/dom/FullscreenManager.cpp: (WebCore::clearFullscreenFlags): rename variable to be more consistent with other iframe downcasts in the file. (WebCore::FullscreenManager::willEnterFullscreen): Canonical link: https://commits.webkit.org/272462@main
c96dd4f
2dad342
π π§ͺ winπ mac-AS-debugπ gtkπ wincairoπ§ͺ ios-wk2π§ͺ api-macπ§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-wk1π§ͺ api-gtkπ§ͺ mac-wk2π§ͺ mac-AS-debug-wk2π watch