Changeset 152878 in webkit
- Timestamp:
- Jul 18, 2013 7:12:09 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/CMakeLists.txt
r152774 r152878 367 367 368 368 UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp 369 UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp 369 370 370 371 UIProcess/Downloads/DownloadProxy.cpp … … 520 521 521 522 WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp 523 WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp 522 524 ) 523 525 -
trunk/Source/WebKit2/ChangeLog
r152877 r152878 1 2013-07-18 Eunmi Lee <eunmi15.lee@samsung.com> 2 3 [WK2] Share Qt port's codes to find zoomable area with CoordinatedGraphics. 4 https://bugs.webkit.org/show_bug.cgi?id=118585 5 6 Reviewed by Anders Carlsson. 7 8 The function to find zoomable area is needed in order to implement the 9 feature to scale for double-tap gesture. The WK2 EFL and NIX port want 10 to use that function, so extract the code from the Qt port, make it 11 usable in the CoordinatedGraphics and add API and callback. 12 13 * CMakeLists.txt: 14 * Target.pri: 15 * UIProcess/API/C/CoordinatedGraphics/WKView.cpp: 16 (WKViewFindZoomableAreaForRect): 17 * UIProcess/API/C/CoordinatedGraphics/WKView.h: 18 * UIProcess/API/efl/EwkView.cpp: 19 (EwkView::didFindZoomableArea): 20 * UIProcess/API/efl/EwkView.h: 21 * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp: Added. 22 (WebKit::WebPageProxy::findZoomableAreaForPoint): 23 (WebKit::WebPageProxy::didFindZoomableArea): 24 * UIProcess/CoordinatedGraphics/WebView.cpp: 25 (WebKit::WebView::didFindZoomableArea): 26 (WebKit::WebView::findZoomableAreaForPoint): 27 * UIProcess/CoordinatedGraphics/WebView.h: 28 * UIProcess/CoordinatedGraphics/WebViewClient.cpp: 29 (WebKit::WebViewClient::didFindZoomableArea): 30 * UIProcess/CoordinatedGraphics/WebViewClient.h: 31 * UIProcess/PageClient.h: 32 * UIProcess/WebPageProxy.h: 33 * UIProcess/WebPageProxy.messages.in: 34 * UIProcess/efl/ViewClientEfl.cpp: 35 (WebKit::ViewClientEfl::didFindZoomableArea): 36 (WebKit::ViewClientEfl::ViewClientEfl): 37 * UIProcess/efl/ViewClientEfl.h: 38 * UIProcess/qt/WebPageProxyQt.cpp: 39 * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Added. 40 (WebKit::WebPage::findZoomableAreaForPoint): 41 * WebProcess/WebPage/WebPage.cpp: 42 * WebProcess/WebPage/WebPage.h: 43 * WebProcess/WebPage/WebPage.messages.in: 44 1 45 2013-07-18 Simon Cooper <scooper@apple.com> 2 46 -
trunk/Source/WebKit2/Target.pri
r151699 r152878 566 566 UIProcess/qt/BackingStoreQt.cpp \ 567 567 UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp \ 568 UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp \ 568 569 UIProcess/DefaultUndoController.cpp \ 569 570 UIProcess/Downloads/DownloadProxy.cpp \ … … 749 750 WebProcess/WebPage/FindController.cpp \ 750 751 WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp \ 752 WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp \ 751 753 WebProcess/WebPage/TapHighlightController.cpp \ 752 754 WebProcess/WebPage/LayerTreeHost.cpp \ -
trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp
r151541 r152878 27 27 #include "WebView.h" 28 28 29 using namespace WebCore; 29 30 using namespace WebKit; 30 31 … … 189 190 } 190 191 192 void WKViewFindZoomableAreaForRect(WKViewRef viewRef, WKRect wkRect) 193 { 194 IntRect rect = toIntRect(wkRect); 195 toImpl(viewRef)->findZoomableAreaForPoint(rect.center(), rect.size()); 196 } 197 191 198 #endif // USE(COORDINATED_GRAPHICS) -
trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h
r151541 r152878 37 37 typedef void (*WKViewPageDidChangeViewportAttributesCallback)(WKViewRef view, WKViewportAttributesRef, const void* clientInfo); 38 38 typedef void (*WKViewPageDidChangeTooltipCallback)(WKViewRef view, WKStringRef newTooltip, const void* clientInfo); 39 typedef void (*WKViewDidFindZoomableAreaCallback)(WKViewRef view, WKPoint point, WKRect area, const void* clientInfo); 39 40 40 41 struct WKViewClient { … … 52 53 WKViewPageDidChangeViewportAttributesCallback didChangeViewportAttributes; 53 54 WKViewPageDidChangeTooltipCallback didChangeTooltip; 55 WKViewDidFindZoomableAreaCallback didFindZoomableArea; 54 56 }; 55 57 typedef struct WKViewClient WKViewClient; … … 104 106 WK_EXPORT double WKViewOpacity(WKViewRef view); 105 107 108 WK_EXPORT void WKViewFindZoomableAreaForRect(WKViewRef, WKRect); 109 106 110 #ifdef __cplusplus 107 111 } -
trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
r152147 r152878 30 30 #include "NativeWebMouseEvent.h" 31 31 #include "NativeWebWheelEvent.h" 32 #include "NotImplemented.h" 32 33 #include "PageLoadClientEfl.h" 33 34 #include "PagePolicyClientEfl.h" … … 1375 1376 } 1376 1377 1378 void EwkView::didFindZoomableArea(const WKPoint& point, const WKRect& area) 1379 { 1380 notImplemented(); 1381 } 1382 1377 1383 Evas_Smart_Class EwkView::parentSmartClass = EVAS_SMART_CLASS_INIT_NULL; 1378 1384 -
trunk/Source/WebKit2/UIProcess/API/efl/EwkView.h
r151313 r152878 202 202 PassRefPtr<cairo_surface_t> takeSnapshot(); 203 203 204 void didFindZoomableArea(const WKPoint&, const WKRect&); 205 204 206 private: 205 207 EwkView(WKViewRef, Evas_Object*); -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
r152841 r152878 208 208 } 209 209 210 void WebView::didFindZoomableArea(const WebCore::IntPoint& target, const WebCore::IntRect& area) 211 { 212 m_client.didFindZoomableArea(this, target, area); 213 } 214 210 215 AffineTransform WebView::transformFromScene() const 211 216 { … … 500 505 } 501 506 507 void WebView::findZoomableAreaForPoint(const IntPoint& point, const IntSize& size) 508 { 509 m_page->findZoomableAreaForPoint(transformFromScene().mapPoint(point), transformFromScene().mapSize(size)); 510 } 511 502 512 } // namespace WebKit 503 513 -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h
r152841 r152878 94 94 #endif 95 95 96 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&); 97 96 98 // View client. 97 99 void initializeClient(const WKViewClient*); … … 102 104 const WebCore::IntSize& contentsSize() const { return m_contentsSize; } 103 105 WebCore::FloatSize visibleContentsSize() const; 106 void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&); 104 107 105 108 // FIXME: Should become private when Web Events creation is moved to WebView. -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.cpp
r148963 r152878 112 112 } 113 113 114 void WebViewClient::didFindZoomableArea(WebView* view, const IntPoint& target, const IntRect& area) 115 { 116 if (!m_client.didFindZoomableArea) 117 return; 118 119 m_client.didFindZoomableArea(toAPI(view), toAPI(target), toAPI(area), m_client.clientInfo); 120 } 121 114 122 } // namespace WebKit 115 123 -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebViewClient.h
r148963 r152878 55 55 void didChangeViewportAttributes(WebView*, const WebCore::ViewportAttributes&); 56 56 void didChangeTooltip(WebView*, const String& tooltip); 57 void didFindZoomableArea(WebView*, const WebCore::IntPoint&, const WebCore::IntRect&); 57 58 }; 58 59 -
trunk/Source/WebKit2/UIProcess/PageClient.h
r152841 r152878 122 122 virtual void pageTransitionViewportReady() = 0; 123 123 #endif 124 #if USE(COORDINATED_GRAPHICS) 125 virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) = 0; 126 #endif 124 127 #if PLATFORM(QT) 125 virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&) = 0;126 128 virtual void handleAuthenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password) = 0; 127 129 virtual void handleCertificateVerificationRequest(const String& hostname, bool& ignoreErrors) = 0; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r152841 r152878 663 663 WebPageCreationParameters creationParameters() const; 664 664 665 #if PLATFORM(QT)665 #if USE(COORDINATED_GRAPHICS) 666 666 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize&); 667 667 #endif … … 888 888 void pageTransitionViewportReady(); 889 889 #endif 890 #if PLATFORM(QT)890 #if USE(COORDINATED_GRAPHICS) 891 891 void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&); 892 892 #endif 893 894 893 #if PLATFORM(QT) || PLATFORM(EFL) 895 894 void didChangeContentsSize(const WebCore::IntSize&); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r152841 r152878 78 78 PageTransitionViewportReady() 79 79 #endif 80 #if USE(COORDINATED_GRAPHICS) 81 DidFindZoomableArea(WebCore::IntPoint target, WebCore::IntRect area) 82 #endif 80 83 #if PLATFORM(QT) 81 DidFindZoomableArea(WebCore::IntPoint target, WebCore::IntRect area)82 84 AuthenticationRequiredRequest(WTF::String hostname, WTF::String realm, WTF::String prefilledUsername) -> (WTF::String username, WTF::String password) 83 85 CertificateVerificationRequest(WTF::String hostname) -> (bool ignoreErrors) -
trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp
r152525 r152878 155 155 } 156 156 157 void ViewClientEfl::didFindZoomableArea(WKViewRef, WKPoint point, WKRect area, const void* clientInfo) 158 { 159 toEwkView(clientInfo)->didFindZoomableArea(point, area); 160 } 161 157 162 ViewClientEfl::ViewClientEfl(EwkView* view) 158 163 : m_view(view) … … 165 170 viewClient.clientInfo = this; 166 171 viewClient.didChangeContentsSize = didChangeContentsSize; 172 viewClient.didFindZoomableArea = didFindZoomableArea; 167 173 viewClient.viewNeedsDisplay = viewNeedsDisplay; 168 174 viewClient.webProcessCrashed = webProcessCrashed; -
trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h
r148660 r152878 57 57 static void didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef, const void* clientInfo); 58 58 static void didChangeTooltip(WKViewRef, WKStringRef, const void* clientInfo); 59 static void didFindZoomableArea(WKViewRef, WKPoint, WKRect, const void* clientInfo); 59 60 60 61 EwkView* m_view; -
trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp
r145515 r152878 87 87 } 88 88 89 void WebPageProxy::didFindZoomableArea(const IntPoint& target, const IntRect& area)90 {91 m_pageClient->didFindZoomableArea(target, area);92 }93 94 void WebPageProxy::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)95 {96 if (!isValid())97 return;98 99 m_process->send(Messages::WebPage::FindZoomableAreaForPoint(point, area), m_pageID);100 }101 102 89 void WebPageProxy::authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password) 103 90 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r152841 r152878 3178 3178 } 3179 3179 3180 #if PLATFORM(QT)3181 #if ENABLE(TOUCH_ADJUSTMENT)3182 void WebPage::findZoomableAreaForPoint(const WebCore::IntPoint& point, const WebCore::IntSize& area)3183 {3184 Node* node = 0;3185 IntRect zoomableArea;3186 bool foundAreaForTouchPoint = m_mainFrame->coreFrame()->eventHandler()->bestZoomableAreaForTouchPoint(point, IntSize(area.width() / 2, area.height() / 2), zoomableArea, node);3187 3188 if (!foundAreaForTouchPoint)3189 return;3190 3191 ASSERT(node);3192 3193 if (node->document() && node->document()->view())3194 zoomableArea = node->document()->view()->contentsToWindow(zoomableArea);3195 3196 send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));3197 }3198 3199 #else3200 void WebPage::findZoomableAreaForPoint(const WebCore::IntPoint& point, const WebCore::IntSize& area)3201 {3202 UNUSED_PARAM(area);3203 Frame* mainframe = m_mainFrame->coreFrame();3204 HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);3205 3206 Node* node = result.innerNode();3207 3208 if (!node)3209 return;3210 3211 IntRect zoomableArea = node->pixelSnappedBoundingBox();3212 3213 while (true) {3214 bool found = !node->isTextNode() && !node->isShadowRoot();3215 3216 // No candidate found, bail out.3217 if (!found && !node->parentNode())3218 return;3219 3220 // Candidate found, and it is a better candidate than its parent.3221 // NB: A parent is considered a better candidate iff the node is3222 // contained by it and it is the only child.3223 if (found && (!node->parentNode() || node->parentNode()->childNodeCount() != 1))3224 break;3225 3226 node = node->parentNode();3227 zoomableArea.unite(node->pixelSnappedBoundingBox());3228 }3229 3230 if (node->document() && node->document()->frame() && node->document()->frame()->view()) {3231 const ScrollView* view = node->document()->frame()->view();3232 zoomableArea = view->contentsToWindow(zoomableArea);3233 }3234 3235 send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));3236 }3237 #endif3238 #endif3239 3240 3180 WebPage::SandboxExtensionTracker::~SandboxExtensionTracker() 3241 3181 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r152841 r152878 795 795 void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount); 796 796 797 #if PLATFORM(QT)797 #if USE(COORDINATED_GRAPHICS) 798 798 void findZoomableAreaForPoint(const WebCore::IntPoint&, const WebCore::IntSize& area); 799 799 #endif -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r152425 r152878 298 298 CancelComposition() 299 299 #endif 300 #if PLATFORM(QT)300 #if USE(COORDINATED_GRAPHICS) 301 301 FindZoomableAreaForPoint(WebCore::IntPoint point, WebCore::IntSize area) 302 302 #endif
Note: See TracChangeset
for help on using the changeset viewer.