[iOS] Hook up screen.{availHeight, availWidth, height, width}
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2014 03:51:14 +0000 (03:51 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2014 03:51:14 +0000 (03:51 +0000)
commitda2bd894420c03b11d90fb5f6d601b7e22693007
treeabcb5be7124460e92d9d3de4d7178ecfbc6e3f68
parent32f577712ff3a70ec5ad48a45a9a51e5bfc6e5b4
[iOS] Hook up screen.{availHeight, availWidth, height, width}
https://bugs.webkit.org/show_bug.cgi?id=131821
<rdar://problem/16413795>

Reviewed by Benjamin Poulain and Tim Horton.

Source/WebCore:
Implement support for screen.{availHeight, availWidth, height, width} in WebKit2 for iOS.

Additionally substitute "screenSize" for "viewporScreenSize" to make the code more understandable.

* WebCore.exp.in: Export symbol for WebCore System Interface function
_wkGetViewportAvailableScreenSize.
* dom/Document.cpp:
(WebCore::Document::processViewport): Modified to call Chrome::screenSize(); formerly it
called ChromeClient::viewportScreenSize().
* page/Chrome.cpp:
(WebCore::Chrome::screenSize): Added; turns around and calls ChromeClient::screenSize().
(WebCore::Chrome::availableScreenSize): Added; turns around and calls ChromeClient::availableScreenSize().
* page/Chrome.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::screenSize): Renamed; formerly named viewportScreenSize.
(WebCore::ChromeClient::availableScreenSize): Added; default implementation, which
returns the size of Chrome::windowRect().
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::textDocumentParameters):
* platform/HostWindow.h: Added declarations for availableScreenSize() and screenSize()
so that a caller (e.g. WebCore::screenRect()) can query for such screen information using
only the HostWindow interface. That is, a caller doesn't need to know about ChromeClient.
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenRect): Modified to query HostWindow::screenSize() when computing the
screen rectangle in WebKit2 for iOS.
(WebCore::screenAvailableRect): Modified to query HostWindow::availableScreenSize()
when computing the available screen rectangle in WebKit2 for iOS.
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/mac/WebCoreSystemInterface.h:

Source/WebKit/ios:
Provide iOS-specific WebKit1 implementation for ChromeClient::availableScreenSize().

Additionally substitute "screenSize" for "viewporScreenSize" to make the code more understandable.

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::screenSize): Renamed; formerly named viewportScreenSize.
(WebChromeClientIOS::availableScreenSize): Added; ASSERT_NOT_REACHED() as a widget
should consult it's associated WAKWindow for the available screen size.

Source/WebKit/mac:
Add declaration for WKGetViewportAvailableScreenSize() to return the available screen size.

Additionally substitute "ScreenSize" for "ViewportScreenSize" to make the code more understandable.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:
Implement WebKit2-specific support infrastructure.

Additionally substitute "screenSize" for "viewporScreenSize" to make the code more understandable.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode): Modified to encode the available screen size
creation parameter.
(WebKit::WebPageCreationParameters::decode): Modified to decode the available screen size
creation parameter.
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Initialize the available screen size
parameter.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::screenSize): Renamed; formerly named viewportScreenSize.
(WebKit::WebPageProxy::availableScreenSize): Added.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::screenSize): Renamed; formerly named viewportScreenSize.
(WebKit::WebChromeClient::availableScreenSize): Added; turns around and calls WebPage::availableScreenSize().
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Hook up WebKit System Interface function WKGetAvailableScreenSize.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Initialize available screen size instance variable.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::screenSize):
(WebKit::WebPage::availableScreenSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/Document.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Chrome.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/ViewportConfiguration.cpp
Source/WebCore/platform/HostWindow.h
Source/WebCore/platform/ios/PlatformScreenIOS.mm
Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.h
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPageCreationParameters.cpp
Source/WebKit2/Shared/WebPageCreationParameters.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm