Support both window and view based video fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=135525

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-08-02
Reviewed by Simon Fraser.

Source/WebCore:
Presenting in a separate window gives greater flexibility for rotation separately from the app.
Presenting in the same window works better if the interface is rehosted in another process.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(-[WebVideoFullscreenController enterFullscreen:]): Use clientRect instead of screenRect.
* platform/ios/WebVideoFullscreenInterfaceAVKit.h: Add m_window and m_parentView.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVVideoLayer setBounds:]): Parent view might not be fullscreen; use window instead.
(WebVideoFullscreenInterfaceAVKit::setupFullscreen): Conditionally create UIWindow and UIViewController for fullscreen.
(WebVideoFullscreenInterfaceAVKit::enterFullscreen): Video, not the container should have black background.
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): Conditionally translate finalRect.
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): Clean up UIWindow and force status bar to correct orientation.
(WebVideoFullscreenInterfaceAVKit::invalidate): Clean up UIWindow.
(WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): Hide window and exit without animation.
* platform/ios/WebVideoFullscreenModelMediaElement.mm:
(WebVideoFullscreenModelMediaElement::setVideoFullscreenLayer): Apply frame, because it may have been set before the layer.

Source/WebKit/mac:
Parenting in the view instead of the window gives the fullscreen implementation more latitude
in how it implements the animation.

* WebView/WebView.mm:
(-[WebView _enterFullscreenForNode:]): Use view instead of window.

Source/WebKit2:
Parenting in the view instead of the window gives the fullscreen implementation more latitude
in how it implements the animation.

* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Use view instead of window.
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::clientRectForNode): Use client rect instead of screen rect.
(WebKit::WebVideoFullscreenManager::enterFullscreenForNode): ditto
(WebKit::WebVideoFullscreenManager::exitFullscreenForNode): ditto
(WebKit::screenRectForNode): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171973 268f45cc-cd09-0410-ab3c-d52691b4dbfc