[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)
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

index 9038567..e1cacb5 100644 (file)
@@ -1,3 +1,41 @@
+2014-04-17  Daniel Bates  <dabates@apple.com>
+
+        [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.
+
+        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:
+
 2014-04-17  Darin Adler  <darin@apple.com>
 
         origin spoofing possible (HTTP Origin, postMessage event.origin) due to inappropriate URL escape sequence decoding
index 4feebca..f284df5 100644 (file)
@@ -2716,7 +2716,8 @@ _wkGetScreenScaleFactor
 _wkGetUserAgent
 _wkGetVendorNameForNavigator
 _wkGetVerticalGlyphsForCharacters
-_wkGetViewportScreenSize
+_wkGetScreenSize
+_wkGetAvailableScreenSize
 _wkIsGB18030ComplianceRequired
 _wkSetLayerContentsScale
 #endif
index fc600d5..aa68a00 100644 (file)
@@ -2945,7 +2945,7 @@ void Document::processViewport(const String& features, ViewportArguments::Type o
     // bounds checking and determining concrete values for ValueAuto which we already do in UIKit.
     // To maintain old behavior, we just need to update a few values, leaving Auto's for UIKit.
     if (Page* page = this->page())
-        finalizeViewportArguments(m_viewportArguments, page->chrome().client().viewportScreenSize());
+        finalizeViewportArguments(m_viewportArguments, page->chrome().screenSize());
 #endif
 
     updateViewportArguments();
index a690e3b..4dcd635 100644 (file)
@@ -488,6 +488,16 @@ void Chrome::loadIconForFiles(const Vector<String>& filenames, FileIconLoader* l
     m_client.loadIconForFiles(filenames, loader);
 }
 
+FloatSize Chrome::screenSize() const
+{
+    return m_client.screenSize();
+}
+
+FloatSize Chrome::availableScreenSize() const
+{
+    return m_client.availableScreenSize();
+}
+
 void Chrome::dispatchViewportPropertiesDidChange(const ViewportArguments& arguments) const
 {
 #if PLATFORM(IOS)
index a299d4d..7a48cf3 100644 (file)
@@ -90,6 +90,9 @@ public:
     virtual PlatformDisplayID displayID() const override;
     virtual void windowScreenDidChange(PlatformDisplayID) override;
 
+    FloatSize screenSize() const override;
+    FloatSize availableScreenSize() const override;
+
     void scrollRectIntoView(const IntRect&) const;
 
     void contentsSizeChanged(Frame*, const IntSize&) const;
index 290e810..61d5bab 100644 (file)
@@ -176,7 +176,9 @@ public:
 #endif
     // End methods used by HostWindow.
 
-    virtual FloatSize viewportScreenSize() const { return const_cast<ChromeClient*>(this)->windowRect().size(); }
+    virtual FloatSize screenSize() const { return const_cast<ChromeClient*>(this)->windowRect().size(); }
+    virtual FloatSize availableScreenSize() const { return const_cast<ChromeClient*>(this)->windowRect().size(); }
+
     virtual void dispatchViewportPropertiesDidChange(const ViewportArguments&) const { }
 
     virtual void contentsSizeChanged(Frame*, const IntSize&) const = 0;
index 0663bac..f3d305b 100644 (file)
@@ -156,7 +156,7 @@ ViewportConfiguration::Parameters ViewportConfiguration::textDocumentParameters(
     Parameters parameters;
 
 #if PLATFORM(IOS)
-    parameters.width = static_cast<int>(wkGetViewportScreenSize().width);
+    parameters.width = static_cast<int>(wkGetScreenSize().width);
 #else
     // FIXME: this needs to be unified with ViewportArguments on all ports.
     parameters.width = 320;
index a767435..1fe3172 100644 (file)
@@ -76,6 +76,9 @@ public:
 
     virtual PlatformDisplayID displayID() const = 0;
     virtual void windowScreenDidChange(PlatformDisplayID) = 0;
+
+    virtual FloatSize screenSize() const = 0;
+    virtual FloatSize availableScreenSize() const = 0;
 };
 
 } // namespace WebCore
index 2586845..055e3de 100644 (file)
@@ -28,6 +28,7 @@
 
 #import "FloatRect.h"
 #import "FrameView.h"
+#import "HostWindow.h"
 #import "IntRect.h"
 #import "NotImplemented.h"
 #import "WAKWindow.h"
@@ -58,23 +59,33 @@ bool screenIsMonochrome(Widget*)
 FloatRect screenRect(Widget* widget)
 {
     if (!widget)
-        return CGRectZero;
-    WAKWindow *window = [widget->platformWidget() window];
-    if (!window)
-        return [widget->platformWidget() frame];
-    CGRect screenRect = { CGPointZero, [window screenSize] };
-    return enclosingIntRect(screenRect);
+        return FloatRect();
+
+    if (NSView *platformWidget = widget->platformWidget()) {
+        // WebKit1
+        WAKWindow *window = [platformWidget window];
+        if (!window)
+            return [platformWidget frame];
+        CGRect screenRect = { CGPointZero, [window screenSize] };
+        return enclosingIntRect(screenRect);
+    }
+    return enclosingIntRect(FloatRect(FloatPoint(), widget->root()->hostWindow()->screenSize()));
 }
 
 FloatRect screenAvailableRect(Widget* widget)
 {
     if (!widget)
-        return CGRectZero;
-    WAKWindow *window = [widget->platformWidget() window];
-    if (!window)
-        return CGRectZero;
-    CGRect screenRect = { CGPointZero, [window availableScreenSize] };
-    return enclosingIntRect(screenRect);
+        return FloatRect();
+
+    if (NSView *platformWidget = widget->platformWidget()) {
+        // WebKit1
+        WAKWindow *window = [platformWidget window];
+        if (!window)
+            return FloatRect();
+        CGRect screenRect = { CGPointZero, [window availableScreenSize] };
+        return enclosingIntRect(screenRect);
+    }
+    return enclosingIntRect(FloatRect(FloatPoint(), widget->root()->hostWindow()->availableScreenSize()));
 }
 
 void screenColorProfile(ColorProfile&)
index 88fb8a4..f10c45e 100644 (file)
@@ -68,7 +68,8 @@ void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
 CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
 bool (*wkExecutableWasLinkedOnOrAfterIOSVersion)(int);
 int (*wkGetDeviceClass)(void);
-CGSize (*wkGetViewportScreenSize)(void);
+CGSize (*wkGetScreenSize)(void);
+CGSize (*wkGetAvailableScreenSize)(void);
 void (*wkSetLayerContentsScale)(CALayer *);
 float (*wkGetScreenScaleFactor)(void);
 bool (*wkIsGB18030ComplianceRequired)(void);
index c53898a..cd7a1a2 100644 (file)
@@ -300,7 +300,8 @@ extern AXUIElementRef (*wkCreateAXUIElementRef)(id element);
 #endif // !PLATFORM(IOS)
 
 #if PLATFORM(IOS)
-extern CGSize (*wkGetViewportScreenSize)(void);
+extern CGSize (*wkGetScreenSize)(void);
+extern CGSize (*wkGetAvailableScreenSize)(void);
 extern void (*wkSetLayerContentsScale)(CALayer *);
 extern float (*wkGetScreenScaleFactor)(void);
 #endif
index 185fba9..8b440ae 100644 (file)
@@ -1,3 +1,21 @@
+2014-04-17  Daniel Bates  <dabates@apple.com>
+
+        [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.
+
+        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.
+
 2014-04-08  Alexey Proskuryakov  <ap@apple.com>
 
         Rename Clipboard to DataTransfer
index 0a1f31d..e0e4dbb 100644 (file)
@@ -52,7 +52,8 @@ public:
     virtual void setNeedsScrollNotifications(WebCore::Frame*, bool) override;
     virtual void observedContentChange(WebCore::Frame*) override;
     virtual void clearContentChangeObservers(WebCore::Frame*) override;
-    virtual WebCore::FloatSize viewportScreenSize() const override;
+    virtual WebCore::FloatSize screenSize() const override;
+    virtual WebCore::FloatSize availableScreenSize() const override;
     virtual void dispatchViewportPropertiesDidChange(const WebCore::ViewportArguments&) const override;
     virtual void notifyRevealedSelectionByScrollingFrame(WebCore::Frame*) override;
     virtual bool isStopping() override;
index 756cc16..b5a3484 100644 (file)
@@ -172,9 +172,16 @@ static inline NSDictionary* dictionaryForViewportArguments(const WebCore::Viewpo
               @"minimal-ui":@(arguments.minimalUI) };
 }
 
-FloatSize WebChromeClientIOS::viewportScreenSize() const
+FloatSize WebChromeClientIOS::screenSize() const
 {
-    return FloatSize(WKGetViewportScreenSize());
+    return FloatSize(WKGetScreenSize());
+}
+
+FloatSize WebChromeClientIOS::availableScreenSize() const
+{
+    // WebKit1 code should query the WAKWindow for the available screen size.
+    ASSERT_NOT_REACHED();
+    return FloatSize();
 }
 
 void WebChromeClientIOS::dispatchViewportPropertiesDidChange(const WebCore::ViewportArguments& arguments) const
index 82c4b14..e8c04a0 100644 (file)
@@ -1,3 +1,18 @@
+2014-04-17  Daniel Bates  <dabates@apple.com>
+
+        [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.
+
+        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):
+
 2014-04-17  Darin Adler  <darin@apple.com>
 
         Add separate flag for IndexedDatabase in workers since the current implementation is not threadsafe
index a8d2f19..aafff8e 100644 (file)
@@ -139,7 +139,8 @@ void InitWebCoreSystemInterface(void)
 #if PLATFORM(IOS)
     INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
     INIT(GetDeviceClass);
-    INIT(GetViewportScreenSize);
+    INIT(GetScreenSize);
+    INIT(GetAvailableScreenSize);
     INIT(GetScreenScaleFactor);
     INIT(IsGB18030ComplianceRequired);
 #endif
index 882826b..6f1a92f 100644 (file)
@@ -1,3 +1,41 @@
+2014-04-17  Daniel Bates  <dabates@apple.com>
+
+        [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.
+
+        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):
+
 2014-04-17  Anders Carlsson  <andersca@apple.com>
 
         Remove unused API enums
index 68059e2..4e3ceb4 100644 (file)
@@ -72,7 +72,8 @@ void WebPageCreationParameters::encode(IPC::ArgumentEncoder& encoder) const
     encoder << colorSpace;
 #endif
 #if PLATFORM(IOS)
-    encoder << viewportScreenSize;
+    encoder << screenSize;
+    encoder << availableScreenSize;
 #endif
 }
 
@@ -152,7 +153,9 @@ bool WebPageCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebPageCre
 #endif
 
 #if PLATFORM(IOS)
-    if (!decoder.decode(parameters.viewportScreenSize))
+    if (!decoder.decode(parameters.screenSize))
+        return false;
+    if (!decoder.decode(parameters.availableScreenSize))
         return false;
 #endif
 
index 0a172d0..147c0f4 100644 (file)
@@ -115,7 +115,8 @@ struct WebPageCreationParameters {
     ColorSpaceData colorSpace;
 #endif
 #if PLATFORM(IOS)
-    WebCore::FloatSize viewportScreenSize;
+    WebCore::FloatSize screenSize;
+    WebCore::FloatSize availableScreenSize;
 #endif
 };
 
index 5b420bf..f01513f 100644 (file)
@@ -4211,7 +4211,8 @@ WebPageCreationParameters WebPageProxy::creationParameters()
     parameters.colorSpace = m_pageClient.colorSpace();
 #endif
 #if PLATFORM(IOS)
-    parameters.viewportScreenSize = viewportScreenSize();
+    parameters.screenSize = screenSize();
+    parameters.availableScreenSize = availableScreenSize();
 #endif
 
     return parameters;
index 1b12a06..aca2e5d 100644 (file)
@@ -1347,7 +1347,9 @@ private:
 #endif // PLATFORM(MAC)
 
 #if PLATFORM(IOS)
-    WebCore::FloatSize viewportScreenSize();
+    WebCore::FloatSize screenSize();
+    WebCore::FloatSize availableScreenSize();
+
 
     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition);
     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
index dcbf1a1..7692d1d 100644 (file)
@@ -463,9 +463,14 @@ void WebPageProxy::blurAssistedNode()
     process().send(Messages::WebPage::BlurAssistedNode(), m_pageID);
 }
 
-FloatSize WebPageProxy::viewportScreenSize()
+FloatSize WebPageProxy::screenSize()
 {
-    return FloatSize(WKGetViewportScreenSize());
+    return FloatSize(WKGetScreenSize());
+}
+
+FloatSize WebPageProxy::availableScreenSize()
+{
+    return FloatSize(WKGetAvailableScreenSize());
 }
 
 void WebPageProxy::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition)
index 8844961..e72bfb2 100644 (file)
@@ -845,9 +845,14 @@ void WebChromeClient::exitFullScreenForElement(WebCore::Element* element)
 #endif
 
 #if PLATFORM(IOS)
-FloatSize WebChromeClient::viewportScreenSize() const
+FloatSize WebChromeClient::screenSize() const
 {
-    return m_page->viewportScreenSize();
+    return m_page->screenSize();
+}
+
+FloatSize WebChromeClient::availableScreenSize() const
+{
+    return m_page->availableScreenSize();
 }
 #endif
 
index e72d129..13cb82d 100644 (file)
@@ -252,7 +252,8 @@ private:
     virtual void disableSuddenTermination() override;
 
 #if PLATFORM(IOS)
-    virtual WebCore::FloatSize viewportScreenSize() const override;
+    virtual WebCore::FloatSize screenSize() const override;
+    virtual WebCore::FloatSize availableScreenSize() const override;
 #endif
     virtual void dispatchViewportPropertiesDidChange(const WebCore::ViewportArguments&) const override;
 
index 12e76eb..e39fd01 100644 (file)
@@ -219,7 +219,8 @@ void InitWebCoreSystemInterface(void)
 #if PLATFORM(IOS)
         INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
         INIT(GetDeviceClass);
-        INIT(GetViewportScreenSize);
+        INIT(GetScreenSize);
+        INIT(GetAvailableScreenSize);
         INIT(GetScreenScaleFactor);
         INIT(IsGB18030ComplianceRequired);
 #endif
index 29c3a66..4acb523 100644 (file)
@@ -290,7 +290,8 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     , m_hasReceivedVisibleContentRectsAfterDidCommitLoad(false)
     , m_scaleWasSetByUIProcess(false)
     , m_userHasChangedPageScaleFactor(false)
-    , m_viewportScreenSize(parameters.viewportScreenSize)
+    , m_screenSize(parameters.screenSize)
+    , m_availableScreenSize(parameters.availableScreenSize)
 #endif
     , m_inspectorClient(0)
     , m_backgroundColor(Color::white)
index 4c6210f..a774022 100644 (file)
@@ -437,7 +437,8 @@ public:
 #endif
 
 #if PLATFORM(IOS)
-    WebCore::FloatSize viewportScreenSize() const;
+    WebCore::FloatSize screenSize() const;
+    WebCore::FloatSize availableScreenSize() const;
     void viewportPropertiesDidChange(const WebCore::ViewportArguments&);
     void didReceiveMobileDocType(bool);
 
@@ -1154,7 +1155,8 @@ private:
     bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
     bool m_scaleWasSetByUIProcess;
     bool m_userHasChangedPageScaleFactor;
-    WebCore::FloatSize m_viewportScreenSize;
+    WebCore::FloatSize m_screenSize;
+    WebCore::FloatSize m_availableScreenSize;
     WebCore::IntSize m_blockSelectionDesiredSize;
 #endif
 
index a25abf0..3cdc714 100644 (file)
@@ -111,9 +111,14 @@ void WebPage::platformPreferencesDidChange(const WebPreferencesStore&)
     notImplemented();
 }
 
-FloatSize WebPage::viewportScreenSize() const
+FloatSize WebPage::screenSize() const
 {
-    return m_viewportScreenSize;
+    return m_screenSize;
+}
+
+FloatSize WebPage::availableScreenSize() const
+{
+    return m_availableScreenSize;
 }
 
 void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArguments)