Clean up naming for and slightly refactor legacy video fullscreen support
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2014 21:32:25 +0000 (21:32 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2014 21:32:25 +0000 (21:32 +0000)
commit3f6d30b1e8be806c2b3f78d7fab9d1d021c575b0
tree4424eb904a2555c57a9ff1ae92905c2a1f9b8122
parent2b69b815ec8decee826d85b7890fe21c21a845a3
Clean up naming for and slightly refactor legacy video fullscreen support
https://bugs.webkit.org/show_bug.cgi?id=136446

Reviewed by Jer Noble.

Key changes:
supportsFullscreenForNode(Node*) --> supportsVideoFullscreen()
enterFullscreenForNode(Node*) --> enterVideoFullscreenForVideoElement(HTMLVideoElement*)
exitFullscreenForNode(Node*) --> exitVideoFullscreen()

The old versions had unnecessary parameters, did not clearly distinguish their purpose
from enterFullscreenForElement and friends, and wrongly claimed generality to all Nodes.
Also changed many other places to use HTMLVideoElement* instead of Node* or
HTMLMediaElement* when they were in fact only used for video elements and would only
work for such.

Source/WebCore:

The implications of this include a bunch of renaming in some iOS fullscreen code.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Rename m_isFullscreen flag to
m_isInVideoFullscreen, since it only covers the case of legacy video fullscreen,
not element fullscreen.
(WebCore::HTMLMediaElement::stop): ditto
(WebCore::HTMLMediaElement::requiresTextTrackRepresentation): ditto
(WebCore::HTMLMediaElement::isFullscreen): ditto
(WebCore::HTMLMediaElement::enterFullscreen): Rename m_isFullscreen flag to
m_isInVideoFullscreen. Hoist video element check here from all supportsFullscrenForNode
clients. Adjust for relevant ChromeClient refactorings.
(WebCore::HTMLMediaElement::enterFullscreen): ditto above
* html/HTMLMediaElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsFullscreen): Adjust for relevant ChromeClient
refactorings.
* page/ChromeClient.h:
(WebCore::ChromeClient::supportsVideoFullscreen): Renamed from
supportsFullscreenForNode, and removed Node* parameter.
(WebCore::ChromeClient::enterVideoFullscreenForVideoElement): Renamed from
enterFulscreenForNode and changed Node* parameter to HTMLVideoElement*.
(WebCore::ChromeClient::exitVideoFullscreen): Renamed from
exitFullscreenForNode, and removed Node* parameter.
* platform/ios/WebVideoFullscreenControllerAVKit.h:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(-[WebVideoFullscreenController videoElement]): Renamed from mediaElement;
return a video element and not just a media element.
(-[WebVideoFullscreenController dealloc]): Renamed _mediaElement data member
to _videoElement and changed type accordingly.
(-[WebVideoFullscreenController setVideoElement:]): Renamed from setMediaElement:
and adjust parameter type accordingly.
(-[WebVideoFullscreenController enterFullscreen:]): Video elements, not media
elements.
(-[WebVideoFullscreenController exitFullscreen]): ditto
(-[WebVideoFullscreenController didCleanupFullscreen]): ditto
* platform/ios/WebVideoFullscreenInterface.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.h: Remove gratuitous HTMLMEdiaElement.h include
and fix declarations accordingly.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Include WTFString.h
* platform/ios/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h.
* platform/ios/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm.
(WebVideoFullscreenModelVideoElement) Renamed from WebVideoFullscreenModelMediaElement
(WebVideoFullscreenModelVideoElement::setVideoElement): Renamed from setMediaElement and
change param type accordingly. Also no need to check for actual videoness of the element.
(WebVideoFullscreenModelVideoElement::updateForEventName): Rename data member from m_mediaElement
to m_videoElement and change type accordingly.
(WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): ditto
(WebVideoFullscreenModelVideoElement::play): ditto
(WebVideoFullscreenModelVideoElement::pause): ditto
(WebVideoFullscreenModelVideoElement::togglePlayState): ditto
(WebVideoFullscreenModelVideoElement::beginScrubbing): ditto
(WebVideoFullscreenModelVideoElement::endScrubbing): ditto
(WebVideoFullscreenModelVideoElement::seekToTime): ditto
(WebVideoFullscreenModelVideoElement::fastSeek): ditto
(WebVideoFullscreenModelVideoElement::beginScanningForward): ditto
(WebVideoFullscreenModelVideoElement::beginScanningBackward): ditto
(WebVideoFullscreenModelVideoElement::endScanning): ditto
(WebVideoFullscreenModelVideoElement::requestExitFullscreen): ditto
(WebVideoFullscreenModelVideoElement::setVideoLayerFrame): ditto
(WebVideoFullscreenModelVideoElement::setVideoLayerGravity): ditto
(WebVideoFullscreenModelVideoElement::updateLegibleOptions): ditto
* platform/mac/WebVideoFullscreenController.h:
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController videoElement]): Renamed from mediaElement
and update return type accordingly.
(-[WebVideoFullscreenController setVideoElement:]): Renamed from
setMediaElement and update return type accordingly.
(-[WebVideoFullscreenController videoElementRect]): Renamed
from mediaElementRect.
(-[WebVideoFullscreenController enterFullscreen:]): Update for
rename.
(-[WebVideoFullscreenController exitFullscreen]): ditto
(-[WebVideoFullscreenController updatePowerAssertions]): Rename
member from _mediaElement to _videoElement
(-[WebVideoFullscreenController _requestExit]): ditto
* WebCore.exp.in: Adjust for function and class renames.
* WebCore.xcodeproj/project.pbxproj: Adjust for file renames.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::supportsVideoFullscreen): Adjust for main refactoring.
Also no more need to check for video elementness.
(WebChromeClient::enterVideoFullscreenForVideoElement): Adjust for main refactoring.
(WebChromeClient::exitVideoFullscreen): ditto
* WebView/WebView.mm:
(-[WebView _enterVideoFullscreenForVideoElement:]): Adjust for main
refactoring.
(-[WebView _exitVideoFullscreen]): ditto
(-[WebView _close]): ditto
* WebView/WebViewInternal.h:

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::supportsVideoFullscreen): Adjust for the
main refactoring.
(WebChromeClient::enterVideoFullscreenForVideoElement): ditto
(WebChromeClient::exitVideoFullscreen): ditto
* WebCoreSupport/WebChromeClient.h:
* WebView.cpp:
(WebView::enterVideoFullscreenForVideoElement): Adjust for the
main refactoring.
(WebView::exitVideoFullscreen): ditto.
* WebView.h:
* FullscreenVideoController.cpp: Use video elements, not media elements throughout
(FullscreenVideoController::LayerClient::platformCALayerLayoutSublayersOfLayer):
(FullscreenVideoController::setVideoElement):
(FullscreenVideoController::enterFullscreen):
(FullscreenVideoController::exitFullscreen):
(FullscreenVideoController::canPlay):
(FullscreenVideoController::play):
(FullscreenVideoController::pause):
(FullscreenVideoController::volume):
(FullscreenVideoController::setVolume):
(FullscreenVideoController::currentTime):
(FullscreenVideoController::setCurrentTime):
(FullscreenVideoController::duration):
(FullscreenVideoController::beginScrubbing):
(FullscreenVideoController::endScrubbing):
(FullscreenVideoController::onChar):
(FullscreenVideoController::onKeyDown):
(FullscreenVideoController::onMouseUp):
* FullscreenVideoController.h:
(FullscreenVideoController::videoElement):

Source/WebKit2:

Legacy video fullscreen in WebKit2 is only supported on iOS (for other ports that support
it, it's WK1 only).

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::supportsVideoFullscreen): Adjust for renames as
mentioned.
(WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): ditto
(WebKit::WebChromeClient::exitVideoFullscreen): ditto
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/ios/WebVideoFullscreenManager.h:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::clientRectForElement): No need to be generic to node.
(WebKit::WebVideoFullscreenManager::supportsVideoFullscreen): Adjust for the
main refactoring. Also change m_node to m_videoElement with appropriate type change.
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): ditto
(WebKit::WebVideoFullscreenManager::exitVideoFullscreen): ditto
(WebKit::WebVideoFullscreenManager::didEnterFullscreen): ditto
(WebKit::WebVideoFullscreenManager::didExitFullscreen): ditto
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen): ditto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/page/ChromeClient.h
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.h
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
Source/WebCore/platform/ios/WebVideoFullscreenInterface.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h [moved from Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.h with 89% similarity]
Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm [moved from Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm with 61% similarity]
Source/WebCore/platform/mac/WebVideoFullscreenController.h
Source/WebCore/platform/mac/WebVideoFullscreenController.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewInternal.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/FullscreenVideoController.cpp
Source/WebKit/win/FullscreenVideoController.h
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h
Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm