Refactoring: Pull all fullscreen code out of Document and into its own helper class
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2019 22:16:54 +0000 (22:16 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2019 22:16:54 +0000 (22:16 +0000)
commit1f3ecd44ee1ba4bb023c2f6e23c5cd9ffab2538f
tree4a18c927c9466e57cc515ac19caa603cf6165218
parent6148bfdb69a2d20239a73e51fcb2524ae742e7fc
Refactoring: Pull all fullscreen code out of Document and into its own helper class
https://bugs.webkit.org/show_bug.cgi?id=197017

Reviewed by Eric Carlson.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* css/SelectorCheckerTestFunctions.h:
(WebCore::matchesFullScreenPseudoClass):
(WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
(WebCore::matchesFullScreenDocumentPseudoClass):
(WebCore::matchesFullScreenControlsHiddenPseudoClass):
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
(WebCore::Document::prepareForDestruction):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::isAttributeOnAllOwners): Deleted.
(WebCore::Document::fullScreenIsAllowedForElement const): Deleted.
(WebCore::Document::requestFullScreenForElement): Deleted.
(WebCore::Document::webkitCancelFullScreen): Deleted.
(WebCore::Document::webkitExitFullscreen): Deleted.
(WebCore::Document::webkitFullscreenEnabled const): Deleted.
(WebCore::unwrapFullScreenRenderer): Deleted.
(WebCore::Document::webkitWillEnterFullScreen): Deleted.
(WebCore::Document::webkitDidEnterFullScreen): Deleted.
(WebCore::Document::webkitWillExitFullScreen): Deleted.
(WebCore::Document::webkitDidExitFullScreen): Deleted.
(WebCore::Document::setFullScreenRenderer): Deleted.
(WebCore::Document::dispatchFullScreenChangeEvents): Deleted.
(WebCore::Document::dispatchFullScreenChangeOrErrorEvent): Deleted.
(WebCore::Document::fullScreenElementRemoved): Deleted.
(WebCore::Document::adjustFullScreenElementOnNodeRemoval): Deleted.
(WebCore::Document::isAnimatingFullScreen const): Deleted.
(WebCore::Document::setAnimatingFullScreen): Deleted.
(WebCore::Document::areFullscreenControlsHidden const): Deleted.
(WebCore::Document::setFullscreenControlsHidden): Deleted.
(WebCore::Document::clearFullscreenElementStack): Deleted.
(WebCore::Document::popFullscreenElementStack): Deleted.
(WebCore::Document::pushFullscreenElementStack): Deleted.
(WebCore::Document::addDocumentToFullScreenChangeEventQueue): Deleted.
* dom/Document.h:
(WebCore::Document::fullscreenManager):
(WebCore::Document::webkitIsFullScreen const): Deleted.
(WebCore::Document::webkitFullScreenKeyboardInputAllowed const): Deleted.
(WebCore::Document::webkitCurrentFullScreenElement const): Deleted.
(WebCore::Document::webkitCurrentFullScreenElementForBindings const): Deleted.
(WebCore::Document::fullScreenRenderer const): Deleted.
(WebCore::Document::webkitFullscreenElement const): Deleted.
(WebCore::Document::webkitFullscreenElementForBindings const): Deleted.
* dom/Document.idl:
* dom/DocumentFullscreen.h:
(WebCore::DocumentFullscreen::webkitFullscreenEnabled):
(WebCore::DocumentFullscreen::webkitFullscreenElement):
(WebCore::DocumentFullscreen::webkitExitFullscreen):
(WebCore::DocumentFullscreen::webkitIsFullScreen):
(WebCore::DocumentFullscreen::webkitFullScreenKeyboardInputAllowed):
(WebCore::DocumentFullscreen::webkitCurrentFullScreenElement):
(WebCore::DocumentFullscreen::webkitCancelFullScreen):
* dom/DocumentFullscreen.idl:
* dom/Element.cpp:
(WebCore::Element::webkitRequestFullscreen):
* dom/EventPath.cpp:
(WebCore::shouldEventCrossShadowBoundary):
* dom/FullscreenManager.cpp: Added.
(WebCore::isAttributeOnAllOwners):
(WebCore::FullscreenManager::FullscreenManager):
(WebCore::FullscreenManager::fullscreenIsAllowedForElement const):
(WebCore::FullscreenManager::requestFullscreenForElement):
(WebCore::FullscreenManager::cancelFullscreen):
(WebCore::FullscreenManager::requestExitFullscreen):
(WebCore::FullscreenManager::exitFullscreen):
(WebCore::FullscreenManager::isFullscreenEnabled const):
(WebCore::unwrapFullscreenRenderer):
(WebCore::FullscreenManager::willEnterFullscreen):
(WebCore::FullscreenManager::didEnterFullscreen):
(WebCore::FullscreenManager::willExitFullscreen):
(WebCore::FullscreenManager::didExitFullscreen):
(WebCore::FullscreenManager::setFullscreenRenderer):
(WebCore::FullscreenManager::dispatchFullscreenChangeEvents):
(WebCore::FullscreenManager::dispatchFullscreenChangeOrErrorEvent):
(WebCore::FullscreenManager::fullscreenElementRemoved):
(WebCore::FullscreenManager::adjustFullscreenElementOnNodeRemoval):
(WebCore::FullscreenManager::isAnimatingFullscreen const):
(WebCore::FullscreenManager::setAnimatingFullscreen):
(WebCore::FullscreenManager::areFullscreenControlsHidden const):
(WebCore::FullscreenManager::setFullscreenControlsHidden):
(WebCore::FullscreenManager::clear):
(WebCore::FullscreenManager::emptyEventQueue):
(WebCore::FullscreenManager::clearFullscreenElementStack):
(WebCore::FullscreenManager::popFullscreenElementStack):
(WebCore::FullscreenManager::pushFullscreenElementStack):
(WebCore::FullscreenManager::addDocumentToFullscreenChangeEventQueue):
* dom/FullscreenManager.h: Added.
(WebCore::FullscreenManager::document):
(WebCore::FullscreenManager::document const):
(WebCore::FullscreenManager::topDocument const):
(WebCore::FullscreenManager::page const):
(WebCore::FullscreenManager::frame const):
(WebCore::FullscreenManager::documentElement const):
(WebCore::FullscreenManager::hasLivingRenderTree const):
(WebCore::FullscreenManager::pageCacheState const):
(WebCore::FullscreenManager::scheduleFullStyleRebuild):
(WebCore::FullscreenManager::fullscreenElement const):
(WebCore::FullscreenManager::isFullscreen const):
(WebCore::FullscreenManager::isFullscreenKeyboardInputAllowed const):
(WebCore::FullscreenManager::currentFullscreenElement const):
(WebCore::FullscreenManager::fullscreenRenderer const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isFullscreen const):
(WebCore::HTMLMediaElement::isStandardFullscreen const):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::exitFullscreen):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
* inspector/agents/InspectorDOMAgent.cpp:
* page/EventHandler.cpp:
(WebCore::EventHandler::isKeyEventAllowedInFullScreen const):
(WebCore::EventHandler::internalKeyEvent):
* page/Page.cpp:
(WebCore::Page::setFullscreenControlsHidden):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapNewRenderer):
(WebCore::RenderFullScreen::wrapExistingRenderer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::isDescendantOfFullScreenLayer):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::splitInlines):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::createRenderer):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement const):
* testing/Internals.cpp:
(WebCore::Internals::webkitWillEnterFullScreenForElement):
(WebCore::Internals::webkitDidEnterFullScreenForElement):
(WebCore::Internals::webkitWillExitFullScreenForElement):
(WebCore::Internals::webkitDidExitFullScreenForElement):
(WebCore::Internals::isAnimatingFullScreen const):

Source/WebKit:

* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::didEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):
(WebKit::WebFullScreenManager::didExitFullScreen):
(WebKit::WebFullScreenManager::setAnimatingFullScreen):
(WebKit::WebFullScreenManager::requestExitFullScreen):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_webkit_cancel_fullscreen):
(webkit_dom_document_webkit_exit_fullscreen):
(webkit_dom_document_get_webkit_is_fullscreen):
(webkit_dom_document_get_webkit_fullscreen_keyboard_input_allowed):
(webkit_dom_document_get_webkit_current_fullscreen_element):
(webkit_dom_document_get_webkit_fullscreen_element):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):

Source/WebKitLegacy/mac:

* DOM/DOMDocument.mm:
(-[DOMDocument webkitIsFullScreen]):
(-[DOMDocument webkitFullScreenKeyboardInputAllowed]):
(-[DOMDocument webkitCurrentFullScreenElement]):
(-[DOMDocument webkitFullscreenEnabled]):
(-[DOMDocument webkitFullscreenElement]):
(-[DOMDocument webkitCancelFullScreen]):
(-[DOMDocument webkitExitFullscreen]):
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::createWindow):
* WebCoreSupport/WebKitFullScreenListener.mm:
(-[WebKitFullScreenListener webkitWillEnterFullScreen]):
(-[WebKitFullScreenListener webkitDidEnterFullScreen]):
(-[WebKitFullScreenListener webkitWillExitFullScreen]):
(-[WebKitFullScreenListener webkitDidExitFullScreen]):
* WebView/WebFullScreenController.mm:
(-[WebFullScreenController enterFullScreen:]):
(-[WebFullScreenController finishedEnterFullScreenAnimation:]):
(-[WebFullScreenController requestExitFullScreen]):
(-[WebFullScreenController exitFullScreen]):
(-[WebFullScreenController finishedExitFullScreenAnimation:]):
(-[WebFullScreenController _manager]):
* WebView/WebView.mm:
(-[WebView _didStartProvisionalLoadForFrame:]):

Source/WebKitLegacy/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::createWindow):
* WebView.cpp:
(WebView::fullScreenClientWillEnterFullScreen):
(WebView::fullScreenClientDidEnterFullScreen):
(WebView::fullScreenClientWillExitFullScreen):
(WebView::fullScreenClientDidExitFullScreen):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources-input.xcfilelist
Source/WebCore/DerivedSources-output.xcfilelist
Source/WebCore/DerivedSources.make
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSDefaultStyleSheets.cpp
Source/WebCore/css/SelectorCheckerTestFunctions.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/DocumentFullscreen.h [new file with mode: 0644]
Source/WebCore/dom/DocumentFullscreen.idl [new file with mode: 0644]
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/EventPath.cpp
Source/WebCore/dom/FullscreenManager.cpp [new file with mode: 0644]
Source/WebCore/dom/FullscreenManager.h [new file with mode: 0644]
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/rendering/RenderFullScreen.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/updating/RenderTreeBuilder.h
Source/WebCore/rendering/updating/RenderTreeBuilderInline.cpp
Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
Source/WebCore/style/StyleSharingResolver.cpp
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp
Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/DOMDocument.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebKitFullScreenListener.mm
Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKitLegacy/win/WebView.cpp