The viewport code should not depend on WebKitSystemInterface
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Mar 2014 00:21:30 +0000 (00:21 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Mar 2014 00:21:30 +0000 (00:21 +0000)
commit5fb95723aaac9e049f1f23ae667af2147450e3ed
treec0403793ccdb3951ebe181e67cf6193b7d732d14
parentd5a8e0760eef51a954901b9b7367017169d2f079
The viewport code should not depend on WebKitSystemInterface
https://bugs.webkit.org/show_bug.cgi?id=130218

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-03-13
Reviewed by Tim Horton.

Source/WebCore:

The viewport code cannot be generalized to other ports because it relies
on WebKit system interface to get the device screen size.
This patch fixes that by going through ChromeClient to get the data.

* dom/Document.cpp:
(WebCore::Document::processViewport):
Get the screensize from chrome client.

* dom/ViewportArguments.cpp:
(WebCore::computeViewportAttributes):
This is dead code. Nothing should ever use computeViewportAttributes().

(WebCore::finalizeViewportArguments):
* dom/ViewportArguments.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::viewportScreenSize):

Source/WebKit/ios:

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::viewportScreenSize):
Get the viewport size from WebKitSystemInterface.

Source/WebKit2:

Get the viewport size from the UIProcess when creating a new WebProcess.
From there, the value is stored in WebPage and used whenever we need to update
the viewport parameters.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::viewportScreenSize):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::viewportScreenSize):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::viewportScreenSize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/ViewportArguments.cpp
Source/WebCore/dom/ViewportArguments.h
Source/WebCore/page/ChromeClient.h
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.h
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.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/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm