Changeset 148274 in webkit
- Timestamp:
- Apr 12, 2013 6:10:28 AM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 11 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/CMakeLists.txt
r148165 r148274 302 302 UIProcess/WebVibrationProvider.cpp 303 303 UIProcess/WebVibrationProxy.cpp 304 UIProcess/WebViewportAttributes.cpp 304 305 305 306 UIProcess/API/C/WKApplicationCacheManager.cpp … … 344 345 UIProcess/API/C/WKTextChecker.cpp 345 346 UIProcess/API/C/WKVibration.cpp 347 UIProcess/API/C/WKViewportAttributes.cpp 346 348 347 349 UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp -
trunk/Source/WebKit2/ChangeLog
r148267 r148274 1 2013-04-12 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 3 [WK2][EFL] WebView: Add callbacks to the WKViewClient to handle page viewport update 4 https://bugs.webkit.org/show_bug.cgi?id=110463 5 6 Reviewed by Anders Carlsson. 7 8 * UIProcess/efl/ViewClientEfl.h: 9 (ViewClientEfl): 10 * UIProcess/efl/WebView.cpp: 11 (WebKit::WebView::didChangeViewportProperties): 12 * UIProcess/efl/WebViewClient.cpp: 13 (WebKit::WebViewClient::didChangeViewportAttributes): 14 (WebKit): 15 * UIProcess/efl/WebViewClient.h: 16 17 Added didChangeViewportAttributes callback to the WKViewClient to 18 handle page viewport updates. 19 20 * CMakeLists.txt: 21 * Shared/API/c/WKBase.h: 22 * Shared/APIObject.h: 23 * UIProcess/API/C/WKAPICast.h: 24 (WebKit): 25 * UIProcess/API/C/WKViewportAttributes.cpp: Added. 26 (WKViewportAttributesGetTypeID): 27 * UIProcess/API/C/WKViewportAttributes.h: Added. 28 * UIProcess/API/C/efl/WKView.h: 29 * UIProcess/WebViewportAttributes.cpp: Added. 30 (WebKit): 31 (WebKit::WebViewportAttributes::WebViewportAttributes): 32 (WebKit::WebViewportAttributes::~WebViewportAttributes): 33 * UIProcess/WebViewportAttributes.h: Added. 34 (WebKit): 35 (WebViewportAttributes): 36 (WebKit::WebViewportAttributes::create): 37 (WebKit::WebViewportAttributes::originalAttributes): 38 (WebKit::WebViewportAttributes::type): 39 40 Added WKViewportAttributesRef - WK2 C API object that is wrapping 41 WebCore::ViewportAttributes structure and is passed in didChangeViewportAttributes 42 WKViewClient callback. 43 44 * UIProcess/efl/ViewClientEfl.cpp: 45 (WebKit::ViewClientEfl::didChangeViewportAttributes): 46 (WebKit): 47 48 Added implementaion of didChangeViewportAttributes WKViewClient 49 callback so that existing EFL WK2 funtionality is kept. 50 51 1 52 2013-04-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 53 -
trunk/Source/WebKit2/Shared/API/c/WKBase.h
r147963 r148274 134 134 typedef const struct OpaqueWKTextChecker* WKTextCheckerRef; 135 135 typedef const struct OpaqueWKVibration* WKVibrationRef; 136 typedef const struct OpaqueWKViewportAttributes* WKViewportAttributesRef; 136 137 137 138 /* WebKit2 Bundle types */ -
trunk/Source/WebKit2/Shared/APIObject.h
r147403 r148274 110 110 TypeTextChecker, 111 111 TypeVibration, 112 TypeViewportAttributes, 112 113 113 114 // Bundle types -
trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h
r147963 r148274 95 95 class WebTextChecker; 96 96 class WebVibrationProxy; 97 class WebViewportAttributes; 97 98 98 99 WK_ADD_API_MAPPING(WKApplicationCacheManagerRef, WebApplicationCacheManagerProxy) … … 139 140 WK_ADD_API_MAPPING(WKTextCheckerRef, WebTextChecker) 140 141 WK_ADD_API_MAPPING(WKVibrationRef, WebVibrationProxy) 142 WK_ADD_API_MAPPING(WKViewportAttributesRef, WebViewportAttributes) 141 143 WK_ADD_API_MAPPING(WKInspectorRef, WebInspectorProxy) 142 144 -
trunk/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.cpp
r148273 r148274 1 1 /* 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.2 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 6 6 * are met: 7 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the follow ing disclaimer.8 * notice, this list of conditions and the followlayoutSizeing disclaimer. 9 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the10 * notice, this list Viewof conditions and the following disclaimer in the 11 11 * documentation and/or other materials provided with the distribution. 12 12 * … … 24 24 */ 25 25 26 #i fndef WebViewClient_h27 # define WebViewClient_h26 #include "config.h" 27 #include "WKViewportAttributes.h" 28 28 29 #include "APIClient.h" 30 #include "WKView.h" 31 #include <wtf/text/WTFString.h> 29 #include "WKAPICast.h" 30 #include "WebViewportAttributes.h" 32 31 33 namespace WebCore { 34 class IntPoint; 35 class IntRect; 36 class IntSize; 32 using namespace WebKit; 33 34 WKTypeID WKViewportAttributesGetTypeID() 35 { 36 return toAPI(WebViewportAttributes::APIType); 37 37 } 38 39 namespace WebKit {40 41 class WebView;42 43 class WebViewClient: public APIClient<WKViewClient, kWKViewClientCurrentVersion> {44 public:45 void viewNeedsDisplay(WebView*, const WebCore::IntRect&);46 void didChangeContentsSize(WebView*, const WebCore::IntSize&);47 void webProcessCrashed(WebView*, const String& url);48 void webProcessDidRelaunch(WebView*);49 void didChangeContentsPosition(WebView*, const WebCore::IntPoint&);50 void didRenderFrame(WebView*, const WebCore::IntSize&, const WebCore::IntRect&);51 void didCompletePageTransition(WebView*);52 };53 54 } // namespace WebKit55 56 #endif // WebViewClient_h -
trunk/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.h
r148273 r148274 1 1 /* 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.2 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 8 8 * notice, this list of conditions and the following disclaimer. 9 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the10 * notice, this list Viewof conditions and the following disclaimer in the 11 11 * documentation and/or other materials provided with the distribution. 12 12 * … … 24 24 */ 25 25 26 #ifndef W ebViewClient_h27 #define W ebViewClient_h26 #ifndef WKViewportAttributes_h 27 #define WKViewportAttributes_h 28 28 29 #include "APIClient.h" 30 #include "WKView.h" 31 #include <wtf/text/WTFString.h> 29 #include <WebKit2/WKBase.h> 30 #include <WebKit2/WKGeometry.h> 32 31 33 namespace WebCore { 34 class IntPoint; 35 class IntRect; 36 class IntSize; 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 WK_EXPORT WKTypeID WKViewportAttributesGetTypeID(); 37 38 #ifdef __cplusplus 37 39 } 40 #endif 38 41 39 namespace WebKit { 40 41 class WebView; 42 43 class WebViewClient: public APIClient<WKViewClient, kWKViewClientCurrentVersion> { 44 public: 45 void viewNeedsDisplay(WebView*, const WebCore::IntRect&); 46 void didChangeContentsSize(WebView*, const WebCore::IntSize&); 47 void webProcessCrashed(WebView*, const String& url); 48 void webProcessDidRelaunch(WebView*); 49 void didChangeContentsPosition(WebView*, const WebCore::IntPoint&); 50 void didRenderFrame(WebView*, const WebCore::IntSize&, const WebCore::IntRect&); 51 void didCompletePageTransition(WebView*); 52 }; 53 54 } // namespace WebKit 55 56 #endif // WebViewClient_h 42 #endif /* WKViewportAttributes_h */ -
trunk/Source/WebKit2/UIProcess/API/C/efl/WKView.h
r147913 r148274 37 37 typedef void (*WKViewPageDidChangeContentsPositionCallback)(WKViewRef view, WKPoint position, const void* clientInfo); 38 38 typedef void (*WKViewPageDidRenderFrameCallback)(WKViewRef view, WKSize contentsSize, WKRect coveredRect, const void* clientInfo); 39 typedef void (*WKViewPageDidChangeViewportAttributesCallback)(WKViewRef view, WKViewportAttributesRef, const void* clientInfo); 39 40 40 41 struct WKViewClient { … … 50 51 WKViewPageDidRenderFrameCallback didRenderFrame; 51 52 WKViewCallback didCompletePageTransition; 53 WKViewPageDidChangeViewportAttributesCallback didChangeViewportAttributes; 52 54 }; 53 55 typedef struct WKViewClient WKViewClient; -
trunk/Source/WebKit2/UIProcess/WebViewportAttributes.cpp
r148273 r148274 1 1 /* 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.2 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef WebViewClient_h 27 #define WebViewClient_h 28 29 #include "APIClient.h" 30 #include "WKView.h" 31 #include <wtf/text/WTFString.h> 32 33 namespace WebCore { 34 class IntPoint; 35 class IntRect; 36 class IntSize; 37 } 26 #include "config.h" 27 #include "WebViewportAttributes.h" 38 28 39 29 namespace WebKit { 40 30 41 class WebView; 31 WebViewportAttributes::WebViewportAttributes(const WebCore::ViewportAttributes& attributes) 32 : m_attributes(attributes) 33 { 34 } 42 35 43 class WebViewClient: public APIClient<WKViewClient, kWKViewClientCurrentVersion> { 44 public: 45 void viewNeedsDisplay(WebView*, const WebCore::IntRect&); 46 void didChangeContentsSize(WebView*, const WebCore::IntSize&); 47 void webProcessCrashed(WebView*, const String& url); 48 void webProcessDidRelaunch(WebView*); 49 void didChangeContentsPosition(WebView*, const WebCore::IntPoint&); 50 void didRenderFrame(WebView*, const WebCore::IntSize&, const WebCore::IntRect&); 51 void didCompletePageTransition(WebView*); 52 }; 36 WebViewportAttributes::~WebViewportAttributes() 37 { 38 } 53 39 54 40 } // namespace WebKit 55 56 #endif // WebViewClient_h -
trunk/Source/WebKit2/UIProcess/WebViewportAttributes.h
r148273 r148274 1 1 /* 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.2 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 8 8 * notice, this list of conditions and the following disclaimer. 9 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the10 * notice, this list Viewof conditions and the following disclaimer in the 11 11 * documentation and/or other materials provided with the distribution. 12 12 * … … 24 24 */ 25 25 26 #ifndef WebView Client_h27 #define WebView Client_h26 #ifndef WebViewportAttributes_h 27 #define WebViewportAttributes_h 28 28 29 #include "APIClient.h" 30 #include "WKView.h" 31 #include <wtf/text/WTFString.h> 32 33 namespace WebCore { 34 class IntPoint; 35 class IntRect; 36 class IntSize; 37 } 29 #include "APIObject.h" 30 #include <WebCore/ViewportArguments.h> 31 #include <wtf/PassRefPtr.h> 38 32 39 33 namespace WebKit { 40 34 41 class WebView; 35 class WebViewportAttributes : public TypedAPIObject<APIObject::TypeViewportAttributes> { 36 public: 37 static PassRefPtr<WebViewportAttributes> create(const WebCore::ViewportAttributes& attributes) 38 { 39 return adoptRef(new WebViewportAttributes(attributes)); 40 } 42 41 43 class WebViewClient: public APIClient<WKViewClient, kWKViewClientCurrentVersion> { 44 public: 45 void viewNeedsDisplay(WebView*, const WebCore::IntRect&); 46 void didChangeContentsSize(WebView*, const WebCore::IntSize&); 47 void webProcessCrashed(WebView*, const String& url); 48 void webProcessDidRelaunch(WebView*); 49 void didChangeContentsPosition(WebView*, const WebCore::IntPoint&); 50 void didRenderFrame(WebView*, const WebCore::IntSize&, const WebCore::IntRect&); 51 void didCompletePageTransition(WebView*); 42 virtual ~WebViewportAttributes(); 43 44 const WebCore::ViewportAttributes& originalAttributes() const { return m_attributes; } 45 46 private: 47 explicit WebViewportAttributes(const WebCore::ViewportAttributes&); 48 49 WebCore::ViewportAttributes m_attributes; 52 50 }; 53 51 54 52 } // namespace WebKit 55 53 56 #endif // WebView Client_h54 #endif // WebViewportAttributes_h -
trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp
r147913 r148274 29 29 #include "EwkView.h" 30 30 #include "PageViewportController.h" 31 #include "WebViewportAttributes.h" 31 32 #include <WebKit2/WKString.h> 32 33 #include <WebKit2/WKView.h> … … 132 133 } 133 134 135 void ViewClientEfl::didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef attributes, const void* clientInfo) 136 { 137 EwkView* ewkView = toEwkView(clientInfo); 138 if (WKPageUseFixedLayout(ewkView->wkPage())) { 139 #if USE(ACCELERATED_COMPOSITING) 140 // FIXME: pageViewportController should accept WKViewportAttributesRef. 141 ewkView->pageViewportController()->didChangeViewportAttributes(toImpl(attributes)->originalAttributes()); 142 #endif 143 return; 144 } 145 ewkView->scheduleUpdateDisplay(); 146 } 147 134 148 ViewClientEfl::ViewClientEfl(EwkView* view) 135 149 : m_view(view) -
trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h
r147913 r148274 55 55 static void didRenderFrame(WKViewRef, WKSize, WKRect, const void* clientInfo); 56 56 static void didCompletePageTransition(WKViewRef, const void* clientInfo); 57 static void didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef, const void* clientInfo); 57 58 58 59 EwkView* m_view; -
trunk/Source/WebKit2/UIProcess/efl/WebView.cpp
r147913 r148274 530 530 void WebView::didChangeViewportProperties(const WebCore::ViewportAttributes& attr) 531 531 { 532 if (m_page->useFixedLayout()) { 533 #if USE(ACCELERATED_COMPOSITING) 534 m_ewkView->pageViewportController()->didChangeViewportAttributes(attr); 535 #endif 536 return; 537 } 538 m_ewkView->scheduleUpdateDisplay(); 532 m_client.didChangeViewportAttributes(this, attr); 539 533 } 540 534 -
trunk/Source/WebKit2/UIProcess/efl/WebViewClient.cpp
r147913 r148274 26 26 #include "config.h" 27 27 #include "WebViewClient.h" 28 #include "WebViewportAttributes.h" 28 29 29 30 #include "WKAPICast.h" 31 #include "WKBase.h" 30 32 #include "WKRetainPtr.h" 31 33 … … 90 92 } 91 93 94 void WebViewClient::didChangeViewportAttributes(WebView* view, const ViewportAttributes& attributes) 95 { 96 if (!m_client.didChangeViewportAttributes) 97 return; 98 99 WKRetainPtr<WKViewportAttributesRef> wkAttributes = adoptWK(toAPI(WebViewportAttributes::create(attributes).leakRef())); 100 m_client.didChangeViewportAttributes(toAPI(view), wkAttributes.get(), m_client.clientInfo); 101 } 102 92 103 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/efl/WebViewClient.h
r147913 r148274 35 35 class IntRect; 36 36 class IntSize; 37 class ViewportAttributes; 37 38 } 38 39 … … 50 51 void didRenderFrame(WebView*, const WebCore::IntSize&, const WebCore::IntRect&); 51 52 void didCompletePageTransition(WebView*); 53 void didChangeViewportAttributes(WebView*, const WebCore::ViewportAttributes&); 52 54 }; 53 55
Note: See TracChangeset
for help on using the changeset viewer.