Diff
Modified: trunk/Source/WebKit2/CMakeLists.txt (148273 => 148274)
--- trunk/Source/WebKit2/CMakeLists.txt 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/CMakeLists.txt 2013-04-12 13:10:28 UTC (rev 148274)
@@ -301,6 +301,7 @@
UIProcess/WebUIClient.cpp
UIProcess/WebVibrationProvider.cpp
UIProcess/WebVibrationProxy.cpp
+ UIProcess/WebViewportAttributes.cpp
UIProcess/API/C/WKApplicationCacheManager.cpp
UIProcess/API/C/WKAuthenticationChallenge.cpp
@@ -343,6 +344,7 @@
UIProcess/API/C/WKResourceCacheManager.cpp
UIProcess/API/C/WKTextChecker.cpp
UIProcess/API/C/WKVibration.cpp
+ UIProcess/API/C/WKViewportAttributes.cpp
UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp
Modified: trunk/Source/WebKit2/ChangeLog (148273 => 148274)
--- trunk/Source/WebKit2/ChangeLog 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/ChangeLog 2013-04-12 13:10:28 UTC (rev 148274)
@@ -1,3 +1,54 @@
+2013-04-12 Mikhail Pozdnyakov <[email protected]>
+
+ [WK2][EFL] WebView: Add callbacks to the WKViewClient to handle page viewport update
+ https://bugs.webkit.org/show_bug.cgi?id=110463
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/efl/ViewClientEfl.h:
+ (ViewClientEfl):
+ * UIProcess/efl/WebView.cpp:
+ (WebKit::WebView::didChangeViewportProperties):
+ * UIProcess/efl/WebViewClient.cpp:
+ (WebKit::WebViewClient::didChangeViewportAttributes):
+ (WebKit):
+ * UIProcess/efl/WebViewClient.h:
+
+ Added didChangeViewportAttributes callback to the WKViewClient to
+ handle page viewport updates.
+
+ * CMakeLists.txt:
+ * Shared/API/c/WKBase.h:
+ * Shared/APIObject.h:
+ * UIProcess/API/C/WKAPICast.h:
+ (WebKit):
+ * UIProcess/API/C/WKViewportAttributes.cpp: Added.
+ (WKViewportAttributesGetTypeID):
+ * UIProcess/API/C/WKViewportAttributes.h: Added.
+ * UIProcess/API/C/efl/WKView.h:
+ * UIProcess/WebViewportAttributes.cpp: Added.
+ (WebKit):
+ (WebKit::WebViewportAttributes::WebViewportAttributes):
+ (WebKit::WebViewportAttributes::~WebViewportAttributes):
+ * UIProcess/WebViewportAttributes.h: Added.
+ (WebKit):
+ (WebViewportAttributes):
+ (WebKit::WebViewportAttributes::create):
+ (WebKit::WebViewportAttributes::originalAttributes):
+ (WebKit::WebViewportAttributes::type):
+
+ Added WKViewportAttributesRef - WK2 C API object that is wrapping
+ WebCore::ViewportAttributes structure and is passed in didChangeViewportAttributes
+ WKViewClient callback.
+
+ * UIProcess/efl/ViewClientEfl.cpp:
+ (WebKit::ViewClientEfl::didChangeViewportAttributes):
+ (WebKit):
+
+ Added implementaion of didChangeViewportAttributes WKViewClient
+ callback so that existing EFL WK2 funtionality is kept.
+
+
2013-04-12 Carlos Garcia Campos <[email protected]>
[GTK] The style of visited links doesn't change in WebKit2
Modified: trunk/Source/WebKit2/Shared/API/c/WKBase.h (148273 => 148274)
--- trunk/Source/WebKit2/Shared/API/c/WKBase.h 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/Shared/API/c/WKBase.h 2013-04-12 13:10:28 UTC (rev 148274)
@@ -133,6 +133,7 @@
typedef const struct OpaqueWKProtectionSpace* WKProtectionSpaceRef;
typedef const struct OpaqueWKTextChecker* WKTextCheckerRef;
typedef const struct OpaqueWKVibration* WKVibrationRef;
+typedef const struct OpaqueWKViewportAttributes* WKViewportAttributesRef;
/* WebKit2 Bundle types */
Modified: trunk/Source/WebKit2/Shared/APIObject.h (148273 => 148274)
--- trunk/Source/WebKit2/Shared/APIObject.h 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/Shared/APIObject.h 2013-04-12 13:10:28 UTC (rev 148274)
@@ -109,6 +109,7 @@
TypePreferences,
TypeTextChecker,
TypeVibration,
+ TypeViewportAttributes,
// Bundle types
TypeBundle,
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h (148273 => 148274)
--- trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h 2013-04-12 13:10:28 UTC (rev 148274)
@@ -94,6 +94,7 @@
class WebRenderObject;
class WebTextChecker;
class WebVibrationProxy;
+class WebViewportAttributes;
WK_ADD_API_MAPPING(WKApplicationCacheManagerRef, WebApplicationCacheManagerProxy)
WK_ADD_API_MAPPING(WKAuthenticationChallengeRef, AuthenticationChallengeProxy)
@@ -138,6 +139,7 @@
WK_ADD_API_MAPPING(WKRenderObjectRef, WebRenderObject)
WK_ADD_API_MAPPING(WKTextCheckerRef, WebTextChecker)
WK_ADD_API_MAPPING(WKVibrationRef, WebVibrationProxy)
+WK_ADD_API_MAPPING(WKViewportAttributesRef, WebViewportAttributes)
WK_ADD_API_MAPPING(WKInspectorRef, WebInspectorProxy)
/* Enum conversions */
Copied: trunk/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.cpp (from rev 148273, trunk/Source/WebKit2/UIProcess/efl/WebViewClient.h) (0 => 148274)
--- trunk/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.cpp 2013-04-12 13:10:28 UTC (rev 148274)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the followlayoutSizeing disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list Viewof conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKViewportAttributes.h"
+
+#include "WKAPICast.h"
+#include "WebViewportAttributes.h"
+
+using namespace WebKit;
+
+WKTypeID WKViewportAttributesGetTypeID()
+{
+ return toAPI(WebViewportAttributes::APIType);
+}
Copied: trunk/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.h (from rev 148273, trunk/Source/WebKit2/UIProcess/efl/WebViewClient.h) (0 => 148274)
--- trunk/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.h 2013-04-12 13:10:28 UTC (rev 148274)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list Viewof conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKViewportAttributes_h
+#define WKViewportAttributes_h
+
+#include <WebKit2/WKBase.h>
+#include <WebKit2/WKGeometry.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKViewportAttributesGetTypeID();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKViewportAttributes_h */
Modified: trunk/Source/WebKit2/UIProcess/API/C/efl/WKView.h (148273 => 148274)
--- trunk/Source/WebKit2/UIProcess/API/C/efl/WKView.h 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/UIProcess/API/C/efl/WKView.h 2013-04-12 13:10:28 UTC (rev 148274)
@@ -36,6 +36,7 @@
typedef void (*WKViewWebProcessCrashedCallback)(WKViewRef view, WKURLRef url, const void* clientInfo);
typedef void (*WKViewPageDidChangeContentsPositionCallback)(WKViewRef view, WKPoint position, const void* clientInfo);
typedef void (*WKViewPageDidRenderFrameCallback)(WKViewRef view, WKSize contentsSize, WKRect coveredRect, const void* clientInfo);
+typedef void (*WKViewPageDidChangeViewportAttributesCallback)(WKViewRef view, WKViewportAttributesRef, const void* clientInfo);
struct WKViewClient {
int version;
@@ -49,6 +50,7 @@
WKViewPageDidChangeContentsPositionCallback didChangeContentsPosition;
WKViewPageDidRenderFrameCallback didRenderFrame;
WKViewCallback didCompletePageTransition;
+ WKViewPageDidChangeViewportAttributesCallback didChangeViewportAttributes;
};
typedef struct WKViewClient WKViewClient;
Copied: trunk/Source/WebKit2/UIProcess/WebViewportAttributes.cpp (from rev 148273, trunk/Source/WebKit2/UIProcess/efl/WebViewClient.h) (0 => 148274)
--- trunk/Source/WebKit2/UIProcess/WebViewportAttributes.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebViewportAttributes.cpp 2013-04-12 13:10:28 UTC (rev 148274)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebViewportAttributes.h"
+
+namespace WebKit {
+
+WebViewportAttributes::WebViewportAttributes(const WebCore::ViewportAttributes& attributes)
+ : m_attributes(attributes)
+{
+}
+
+WebViewportAttributes::~WebViewportAttributes()
+{
+}
+
+} // namespace WebKit
Copied: trunk/Source/WebKit2/UIProcess/WebViewportAttributes.h (from rev 148273, trunk/Source/WebKit2/UIProcess/efl/WebViewClient.h) (0 => 148274)
--- trunk/Source/WebKit2/UIProcess/WebViewportAttributes.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebViewportAttributes.h 2013-04-12 13:10:28 UTC (rev 148274)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list Viewof conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebViewportAttributes_h
+#define WebViewportAttributes_h
+
+#include "APIObject.h"
+#include <WebCore/ViewportArguments.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+class WebViewportAttributes : public TypedAPIObject<APIObject::TypeViewportAttributes> {
+public:
+ static PassRefPtr<WebViewportAttributes> create(const WebCore::ViewportAttributes& attributes)
+ {
+ return adoptRef(new WebViewportAttributes(attributes));
+ }
+
+ virtual ~WebViewportAttributes();
+
+ const WebCore::ViewportAttributes& originalAttributes() const { return m_attributes; }
+
+private:
+ explicit WebViewportAttributes(const WebCore::ViewportAttributes&);
+
+ WebCore::ViewportAttributes m_attributes;
+};
+
+} // namespace WebKit
+
+#endif // WebViewportAttributes_h
Modified: trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp (148273 => 148274)
--- trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp 2013-04-12 13:10:28 UTC (rev 148274)
@@ -28,6 +28,7 @@
#include "EwkView.h"
#include "PageViewportController.h"
+#include "WebViewportAttributes.h"
#include <WebKit2/WKString.h>
#include <WebKit2/WKView.h>
@@ -131,6 +132,19 @@
ewkView->scheduleUpdateDisplay();
}
+void ViewClientEfl::didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef attributes, const void* clientInfo)
+{
+ EwkView* ewkView = toEwkView(clientInfo);
+ if (WKPageUseFixedLayout(ewkView->wkPage())) {
+#if USE(ACCELERATED_COMPOSITING)
+ // FIXME: pageViewportController should accept WKViewportAttributesRef.
+ ewkView->pageViewportController()->didChangeViewportAttributes(toImpl(attributes)->originalAttributes());
+#endif
+ return;
+ }
+ ewkView->scheduleUpdateDisplay();
+}
+
ViewClientEfl::ViewClientEfl(EwkView* view)
: m_view(view)
{
Modified: trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h (148273 => 148274)
--- trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h 2013-04-12 13:10:28 UTC (rev 148274)
@@ -54,6 +54,7 @@
static void didChangeContentsPosition(WKViewRef, WKPoint, const void* clientInfo);
static void didRenderFrame(WKViewRef, WKSize, WKRect, const void* clientInfo);
static void didCompletePageTransition(WKViewRef, const void* clientInfo);
+ static void didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef, const void* clientInfo);
EwkView* m_view;
};
Modified: trunk/Source/WebKit2/UIProcess/efl/WebView.cpp (148273 => 148274)
--- trunk/Source/WebKit2/UIProcess/efl/WebView.cpp 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/UIProcess/efl/WebView.cpp 2013-04-12 13:10:28 UTC (rev 148274)
@@ -529,13 +529,7 @@
void WebView::didChangeViewportProperties(const WebCore::ViewportAttributes& attr)
{
- if (m_page->useFixedLayout()) {
-#if USE(ACCELERATED_COMPOSITING)
- m_ewkView->pageViewportController()->didChangeViewportAttributes(attr);
-#endif
- return;
- }
- m_ewkView->scheduleUpdateDisplay();
+ m_client.didChangeViewportAttributes(this, attr);
}
void WebView::pageDidRequestScroll(const IntPoint& position)
Modified: trunk/Source/WebKit2/UIProcess/efl/WebViewClient.cpp (148273 => 148274)
--- trunk/Source/WebKit2/UIProcess/efl/WebViewClient.cpp 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/UIProcess/efl/WebViewClient.cpp 2013-04-12 13:10:28 UTC (rev 148274)
@@ -25,8 +25,10 @@
#include "config.h"
#include "WebViewClient.h"
+#include "WebViewportAttributes.h"
#include "WKAPICast.h"
+#include "WKBase.h"
#include "WKRetainPtr.h"
using namespace WebCore;
@@ -89,4 +91,13 @@
m_client.didCompletePageTransition(toAPI(view), m_client.clientInfo);
}
+void WebViewClient::didChangeViewportAttributes(WebView* view, const ViewportAttributes& attributes)
+{
+ if (!m_client.didChangeViewportAttributes)
+ return;
+
+ WKRetainPtr<WKViewportAttributesRef> wkAttributes = adoptWK(toAPI(WebViewportAttributes::create(attributes).leakRef()));
+ m_client.didChangeViewportAttributes(toAPI(view), wkAttributes.get(), m_client.clientInfo);
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit2/UIProcess/efl/WebViewClient.h (148273 => 148274)
--- trunk/Source/WebKit2/UIProcess/efl/WebViewClient.h 2013-04-12 10:54:21 UTC (rev 148273)
+++ trunk/Source/WebKit2/UIProcess/efl/WebViewClient.h 2013-04-12 13:10:28 UTC (rev 148274)
@@ -34,6 +34,7 @@
class IntPoint;
class IntRect;
class IntSize;
+class ViewportAttributes;
}
namespace WebKit {
@@ -49,6 +50,7 @@
void didChangeContentsPosition(WebView*, const WebCore::IntPoint&);
void didRenderFrame(WebView*, const WebCore::IntSize&, const WebCore::IntRect&);
void didCompletePageTransition(WebView*);
+ void didChangeViewportAttributes(WebView*, const WebCore::ViewportAttributes&);
};
} // namespace WebKit