Changeset 242757 in webkit
- Timestamp:
- Mar 11, 2019, 4:43:04 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 25 edited
- 2 moved
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/events/ios/ipad (added)
-
LayoutTests/fast/events/ios/ipad/fast-click-double-tap-sends-click-on-insignificant-zoom-expected.txt (added)
-
LayoutTests/fast/events/ios/ipad/fast-click-double-tap-sends-click-on-insignificant-zoom.html (added)
-
LayoutTests/platform/ios/TestExpectations (modified) (1 diff)
-
LayoutTests/resources/ui-helper.js (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/WebPreferences.yaml (modified) (1 diff)
-
Source/WebKit/SourcesCocoa.txt (modified) (1 diff)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h (modified) (1 diff)
-
Source/WebKit/UIProcess/PageClient.h (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/PageClientImplIOS.h (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/SmartMagnificationController.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/ios/SmartMagnificationController.mm (modified) (4 diffs)
-
Source/WebKit/UIProcess/ios/WKContentView.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/ios/WKContentView.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (modified) (3 diffs)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (11 diffs)
-
Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.h (moved) (moved from trunk/Source/WebKit/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h ) (2 diffs, 2 props)
-
Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.m (moved) (moved from trunk/Source/WebKit/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m ) (4 diffs)
-
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (modified) (2 diffs)
-
Source/WebKit/WebKit.xcodeproj/project.pbxproj (modified) (5 diffs)
-
Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.h (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/WebPage.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242749 r242757 1 2019-03-11 Dean Jackson <dino@apple.com> 2 3 [iOS] Implement a faster click detection that intercepts double-tap-to-zoom if possible 4 https://bugs.webkit.org/show_bug.cgi?id=195473 5 <rdar://problem/48718396> 6 7 Reviewed by Wenson Hsieh (with some help from Dan Bates). 8 9 Implement a test (iPad only) that sets up a page with zoomable content 10 but not quite at a significant scale, meaning we should dispatch a click 11 event rather than Double Tap To Zoom. 12 13 In order to do this, a humanSpeedDoubleTapAt() method was added to 14 UIHelper that sleeps a bit between taps, otherwise the double tap 15 gesture is recognized before the Web Process has had a chance to 16 evaluate the potential click. 17 18 * fast/events/ios/ipad/fast-click-double-tap-sends-click-on-insignificant-zoom-expected.txt: Added. 19 * fast/events/ios/ipad/fast-click-double-tap-sends-click-on-insignificant-zoom.html: Added. 20 * platform/ios/TestExpectations: 21 * platform/ipad/TestExpectations: 22 * resources/ui-helper.js: 23 (window.UIHelper.humanSpeedDoubleTapAt): 24 1 25 2019-03-11 Wenson Hsieh <wenson_hsieh@apple.com> 2 26 -
trunk/LayoutTests/platform/ios/TestExpectations
r242730 r242757 23 23 # End platform-specific directories. 24 24 #////////////////////////////////////////////////////////////////////////////////////////// 25 26 # iPad-specific tests skipped here and re-enabled in platform/ipad 27 fast/events/ios/ipad [ Skip ] 25 28 26 29 ### -
trunk/LayoutTests/resources/ui-helper.js
r242683 r242757 72 72 uiController.uiScriptComplete(); 73 73 });`, resolve); 74 }); 75 } 76 77 static humanSpeedDoubleTapAt(x, y) 78 { 79 console.assert(this.isIOS()); 80 81 if (!this.isWebKit2()) { 82 // FIXME: Add a sleep in here. 83 eventSender.addTouchPoint(x, y); 84 eventSender.touchStart(); 85 eventSender.releaseTouchPoint(0); 86 eventSender.touchEnd(); 87 eventSender.addTouchPoint(x, y); 88 eventSender.touchStart(); 89 eventSender.releaseTouchPoint(0); 90 eventSender.touchEnd(); 91 return Promise.resolve(); 92 } 93 94 return new Promise(async (resolve) => { 95 await UIHelper.tapAt(x, y); 96 await new Promise(resolveAfterDelay => setTimeout(resolveAfterDelay, 120)); 97 await UIHelper.tapAt(x, y); 98 resolve(); 74 99 }); 75 100 } -
trunk/Source/WebKit/ChangeLog
r242756 r242757 1 2019-03-11 Dean Jackson <dino@apple.com> 2 3 [iOS] Implement a faster click detection that intercepts double-tap-to-zoom if possible 4 https://bugs.webkit.org/show_bug.cgi?id=195473 5 <rdar://problem/48718396> 6 7 Reviewed by Wenson Hsieh (with some help from Dan Bates). 8 9 Adds a new algorithm, behind a flag FasterClicksEnabled, that can trigger a click 10 event without waiting to see if a double tap will occur. It does this by examining 11 the amount of zoom that would be triggered if it was a double tap, and if that value 12 doesn't exceed a set threshold, commits to the click event instead. 13 14 This is implemented by having the Web Process respond to the potential click with 15 some geometry information. If the UI Process receives the information before the 16 second tap in a double tap, it can decide to trigger a click. 17 18 * Shared/WebPreferences.yaml: New internal feature so this can be toggled in 19 a UI for testing. 20 21 * SourcesCocoa.txt: Renamed WKSyntheticTapGestureRecognizer. 22 * WebKit.xcodeproj/project.pbxproj: Ditto. 23 24 * UIProcess/ios/WKSyntheticTapGestureRecognizer.h: 25 * UIProcess/ios/WKSyntheticTapGestureRecognizer.m: 26 (-[WKSyntheticTapGestureRecognizer setGestureIdentifiedTarget:action:]): 27 (-[WKSyntheticTapGestureRecognizer setGestureFailedTarget:action:]): 28 (-[WKSyntheticTapGestureRecognizer setResetTarget:action:]): 29 (-[WKSyntheticTapGestureRecognizer setState:]): 30 (-[WKSyntheticTapGestureRecognizer reset]): Renamed WKSyntheticClickTapGestureRecognizer to 31 WKSyntheticTapGestureRecognizer, changed the signature of the main function to be a bit 32 more clear about what it does, and added a gesture failed target. 33 34 * UIProcess/API/Cocoa/WKWebViewInternal.h: 35 * UIProcess/API/Cocoa/WKWebView.mm: 36 (-[WKWebView _initialScaleFactor]): 37 (-[WKWebView _contentZoomScale]): 38 (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]): 39 Exposed the initial content scale, the current scale and added a declaration that 40 was missing from the .h. 41 42 * UIProcess/WebPageProxy.messages.in: Add a new message, 43 HandleSmartMagnificationInformationForPotentialTap, to 44 communicate the geometry of the clicked node to the UI Process. 45 46 * UIProcess/PageClient.h: Pure virtual function for the geometry message response. 47 * UIProcess/WebPageProxy.h: Ditto. 48 49 * UIProcess/ios/PageClientImplIOS.h: Calls into the WKContentView. 50 * UIProcess/ios/PageClientImplIOS.mm: 51 (WebKit::PageClientImpl::handleSmartMagnificationInformationForPotentialTap): 52 53 * UIProcess/ios/SmartMagnificationController.h: 54 * UIProcess/ios/SmartMagnificationController.mm: 55 (WebKit::SmartMagnificationController::calculatePotentialZoomParameters): A new method that 56 asks the WKContentView to work out what the zoom factor will be for a potential double 57 tap at a location. 58 (WebKit::SmartMagnificationController::smartMagnificationTargetRectAndZoomScales): New implementation 59 of this function to avoid multiple out-arguments. 60 61 * UIProcess/ios/WKContentView.h: 62 * UIProcess/ios/WKContentView.mm: 63 (-[WKContentView _initialScaleFactor]): 64 (-[WKContentView _contentZoomScale]): 65 (-[WKContentView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]): 66 Exposed the initial content scale, the current scale and the target zoom scale. These 67 all just call into the WKWebView implementation. 68 69 * UIProcess/ios/WKContentViewInteraction.h: 70 * UIProcess/ios/WKContentViewInteraction.mm: 71 (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]): Use a WKSyntheticTapGestureRecognizer instead 72 of a generic one, so we can capture the failure. 73 (-[WKContentView setupInteraction]): 74 (-[WKContentView cleanupInteraction]): 75 (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:origin:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]): 76 New method that responds to the incoming Web Process message, and decides if any 77 potential zoom would be "significant". 78 (-[WKContentView _singleTapIdentified:]): 79 (-[WKContentView _doubleTapDidFail:]): 80 (-[WKContentView _didCompleteSyntheticClick]): 81 (-[WKContentView _singleTapRecognized:]): 82 (-[WKContentView _doubleTapRecognized:]): 83 Add some release logging. 84 (-[WKContentView _singleTapCommited:]): Deleted. 85 86 * UIProcess/ios/WebPageProxyIOS.mm: 87 (WebKit::WebPageProxy::potentialTapAtPosition): 88 (WebKit::WebPageProxy::handleSmartMagnificationInformationForPotentialTap): 89 * WebProcess/WebPage/ViewGestureGeometryCollector.h: 90 * WebProcess/WebPage/WebPage.h: 91 * WebProcess/WebPage/WebPage.messages.in: 92 Removed an unused parameter from the existing message. 93 94 * WebProcess/WebPage/ios/WebPageIOS.mm: 95 (WebKit::WebPage::potentialTapAtPosition): Calculates the geometry of the element 96 if requested, and sends it to the UIProcess. 97 1 98 2019-03-11 Per Arne Vollan <pvollan@apple.com> 2 99 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r242748 r242757 1471 1471 webcoreName: selectionAcrossShadowBoundariesEnabled 1472 1472 1473 FasterClicksEnabled: 1474 type: bool 1475 defaultValue: true 1476 condition: PLATFORM(IOS_FAMILY) 1477 humanReadableName: "Faster clicks" 1478 humanReadableDescription: "Support faster clicks on zoomable pages" 1479 webcoreBinding: none 1480 category: internal 1481 1473 1482 InputTypeColorEnabled: 1474 1483 type: bool -
trunk/Source/WebKit/SourcesCocoa.txt
r242748 r242757 412 412 UIProcess/ios/WKPDFView.mm 413 413 UIProcess/ios/WKScrollView.mm 414 UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m415 414 UIProcess/ios/WKSyntheticFlagsChangedWebEvent.mm 415 UIProcess/ios/WKSyntheticTapGestureRecognizer.m 416 416 UIProcess/ios/WKSystemPreviewView.mm 417 417 UIProcess/ios/WKWebEvent.mm -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r242696 r242757 2456 2456 } 2457 2457 2458 - (CGFloat)_targetContentZoomScaleForRect:(const WebCore::FloatRect&)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale 2458 - (double)_initialScaleFactor 2459 { 2460 return _initialScaleFactor; 2461 } 2462 2463 - (double)_contentZoomScale 2464 { 2465 return contentZoomScale(self); 2466 } 2467 2468 - (double)_targetContentZoomScaleForRect:(const WebCore::FloatRect&)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale 2459 2469 { 2460 2470 WebCore::FloatSize unobscuredContentSize([self _contentRectForUserInteraction].size); -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
r242339 r242757 100 100 - (void)_scrollToContentScrollPosition:(WebCore::FloatPoint)scrollPosition scrollOrigin:(WebCore::IntPoint)scrollOrigin; 101 101 - (BOOL)_scrollToRect:(WebCore::FloatRect)targetRect origin:(WebCore::FloatPoint)origin minimumScrollDistance:(float)minimumScrollDistance; 102 - (double)_initialScaleFactor; 103 - (double)_contentZoomScale; 104 - (double)_targetContentZoomScaleForRect:(const WebCore::FloatRect&)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale; 102 105 - (void)_zoomToFocusRect:(const WebCore::FloatRect&)focusedElementRect selectionRect:(const WebCore::FloatRect&)selectionRectInDocumentCoordinates insideFixed:(BOOL)insideFixed fontSize:(float)fontSize minimumScale:(double)minimumScale maximumScale:(double)maximumScale allowScaling:(BOOL)allowScaling forceScroll:(BOOL)forceScroll; 103 106 - (BOOL)_zoomToRect:(WebCore::FloatRect)targetRect withOrigin:(WebCore::FloatPoint)origin fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale minimumScrollDistance:(float)minimumScrollDistance; -
trunk/Source/WebKit/UIProcess/PageClient.h
r242551 r242757 380 380 virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&) = 0; 381 381 virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) = 0; 382 virtual void handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale) = 0; 382 383 virtual double minimumZoomScale() const = 0; 383 384 virtual WebCore::FloatRect documentRect() const = 0; -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r242753 r242757 679 679 void didCompleteSyntheticClick(); 680 680 void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID); 681 void handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale); 681 682 void contentSizeCategoryDidChange(const String& contentSizeCategory); 682 683 void getSelectionContext(WTF::Function<void(const String&, const String&, const String&, CallbackBase::Error)>&&); … … 1179 1180 void willStartUserTriggeredZooming(); 1180 1181 1181 void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);1182 void potentialTapAtPosition(const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation, uint64_t& requestID); 1182 1183 void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart); 1183 1184 void cancelPotentialTap(); -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r242753 r242757 196 196 DidCompleteSyntheticClick() 197 197 DisableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) 198 HandleSmartMagnificationInformationForPotentialTap(uint64_t requestID, WebCore::FloatRect renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale) 198 199 DrawToPDFCallback(IPC::DataReference pdfData, WebKit::CallbackID callbackID) 199 200 SelectionRectsCallback(Vector<WebCore::SelectionRect> selectionRects, WebKit::CallbackID callbackID); -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r242551 r242757 162 162 163 163 void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) override; 164 void handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale) override; 165 164 166 double minimumZoomScale() const override; 165 167 WebCore::FloatRect documentRect() const override; -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r242551 r242757 239 239 } 240 240 241 void PageClientImpl::handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale) 242 { 243 [m_contentView _handleSmartMagnificationInformationForPotentialTap:requestID renderRect:renderRect fitEntireRect:fitEntireRect viewportMinimumScale:viewportMinimumScale viewportMaximumScale:viewportMaximumScale]; 244 } 245 241 246 double PageClientImpl::minimumZoomScale() const 242 247 { -
trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.h
r241323 r242757 49 49 void handleResetMagnificationGesture(WebCore::FloatPoint origin); 50 50 51 double zoomFactorForTargetRect(WebCore::FloatRect targetRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale); 52 51 53 private: 52 54 // IPC::MessageReceiver. … … 56 58 void magnify(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale); 57 59 void scrollToRect(WebCore::FloatPoint origin, WebCore::FloatRect targetRect); 58 void adjustSmartMagnificationTargetRectAndZoomScales(bool addMagnificationPadding, WebCore::FloatRect& targetRect, double& minimumScale, double& maximumScale);60 std::tuple<WebCore::FloatRect, double, double> smartMagnificationTargetRectAndZoomScales(WebCore::FloatRect targetRect, double minimumScale, double maximumScale, bool addMagnificationPadding); 59 61 60 62 WebPageProxy& m_webPageProxy; -
trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm
r241323 r242757 77 77 } 78 78 79 void SmartMagnificationController::adjustSmartMagnificationTargetRectAndZoomScales(bool addMagnificationPadding, WebCore::FloatRect& targetRect, double& minimumScale, double& maximumScale)79 std::tuple<FloatRect, double, double> SmartMagnificationController::smartMagnificationTargetRectAndZoomScales(FloatRect targetRect, double minimumScale, double maximumScale, bool addMagnificationPadding) 80 80 { 81 FloatRect outTargetRect = targetRect; 82 double outMinimumScale = minimumScale; 83 double outMaximumScale = maximumScale; 84 81 85 if (addMagnificationPadding) { 82 targetRect.inflateX(smartMagnificationElementPadding * targetRect.width());83 targetRect.inflateY(smartMagnificationElementPadding * targetRect.height());86 outTargetRect.inflateX(smartMagnificationElementPadding * outTargetRect.width()); 87 outTargetRect.inflateY(smartMagnificationElementPadding * outTargetRect.height()); 84 88 } 85 89 86 minimumScale = std::max(minimumScale, smartMagnificationMinimumScale); 87 maximumScale = std::min(maximumScale, smartMagnificationMaximumScale); 90 outMinimumScale = std::max(outMinimumScale, smartMagnificationMinimumScale); 91 outMaximumScale = std::min(outMaximumScale, smartMagnificationMaximumScale); 92 93 return { outTargetRect, outMinimumScale, outMaximumScale }; 94 } 95 96 double SmartMagnificationController::zoomFactorForTargetRect(FloatRect targetRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale) 97 { 98 // FIXME: Share some of this code with didCollectGeometryForSmartMagnificationGesture? 99 100 FloatRect adjustedTargetRect; 101 double minimumScale = viewportMinimumScale; 102 double maximumScale = viewportMaximumScale; 103 std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect); 104 105 double currentScale = [m_contentView _contentZoomScale]; 106 double targetScale = [m_contentView _targetContentZoomScaleForRect:adjustedTargetRect currentScale:currentScale fitEntireRect:fitEntireRect minimumScale:minimumScale maximumScale:maximumScale]; 107 108 if (targetScale == currentScale) 109 targetScale = [m_contentView _initialScaleFactor]; 110 111 return targetScale; 88 112 } 89 113 … … 95 119 return; 96 120 } 121 FloatRect adjustedTargetRect; 97 122 double minimumScale = viewportMinimumScale; 98 123 double maximumScale = viewportMaximumScale; 99 adjustSmartMagnificationTargetRectAndZoomScales(!fitEntireRect, targetRect, minimumScale, maximumScale);124 std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect); 100 125 101 126 // FIXME: Check if text selection wants to consume the double tap before we attempt magnification. … … 114 139 // in the view, so scale it down enough to make both dimensions fit if possible. 115 140 // For other elements, try to fit them horizontally. 116 if ([m_contentView _zoomToRect: targetRect withOrigin:origin fitEntireRect:fitEntireRect minimumScale:minimumScale maximumScale:maximumScale minimumScrollDistance:minimumScrollDistance])141 if ([m_contentView _zoomToRect:adjustedTargetRect withOrigin:origin fitEntireRect:fitEntireRect minimumScale:minimumScale maximumScale:maximumScale minimumScrollDistance:minimumScrollDistance]) 117 142 return; 118 143 … … 123 148 void SmartMagnificationController::magnify(FloatPoint origin, FloatRect targetRect, FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale) 124 149 { 150 FloatRect adjustedTargetRect; 125 151 double maximumScale = viewportMaximumScale; 126 152 double minimumScale = viewportMinimumScale; 127 adjustSmartMagnificationTargetRectAndZoomScales(true, targetRect, minimumScale, maximumScale); 128 [m_contentView _zoomToRect:targetRect withOrigin:origin fitEntireRect:NO minimumScale:minimumScale maximumScale:maximumScale minimumScrollDistance:0]; 153 std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, true); 154 155 [m_contentView _zoomToRect:adjustedTargetRect withOrigin:origin fitEntireRect:NO minimumScale:minimumScale maximumScale:maximumScale minimumScrollDistance:0]; 129 156 } 130 157 -
trunk/Source/WebKit/UIProcess/ios/WKContentView.h
r240139 r242757 39 39 40 40 namespace WebCore { 41 class FloatRect; 41 42 struct Highlight; 42 43 } … … 109 110 - (void)_zoomOutWithOrigin:(CGPoint)origin; 110 111 - (void)_zoomToInitialScaleWithOrigin:(CGPoint)origin; 112 - (double)_initialScaleFactor; 113 - (double)_contentZoomScale; 114 - (double)_targetContentZoomScaleForRect:(const WebCore::FloatRect&)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale; 111 115 112 116 @end -
trunk/Source/WebKit/UIProcess/ios/WKContentView.mm
r242339 r242757 642 642 } 643 643 644 - (double)_initialScaleFactor 645 { 646 return [_webView _initialScaleFactor]; 647 } 648 649 - (double)_contentZoomScale 650 { 651 return [_webView _contentZoomScale]; 652 } 653 654 - (double)_targetContentZoomScaleForRect:(const WebCore::FloatRect&)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale 655 { 656 return [_webView _targetContentZoomScaleForRect:targetRect currentScale:currentScale fitEntireRect:fitEntireRect minimumScale:minimumScale maximumScale:maximumScale]; 657 } 658 644 659 - (void)_applicationWillResignActive:(NSNotification*)notification 645 660 { -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r242551 r242757 44 44 #import "WKKeyboardScrollingAnimator.h" 45 45 #import "WKShareSheet.h" 46 #import "WKSynthetic ClickTapGestureRecognizer.h"46 #import "WKSyntheticTapGestureRecognizer.h" 47 47 #import "_WKFormInputSession.h" 48 48 #import <UIKit/UIView.h> … … 203 203 #endif 204 204 205 RetainPtr<WKSynthetic ClickTapGestureRecognizer> _singleTapGestureRecognizer;205 RetainPtr<WKSyntheticTapGestureRecognizer> _singleTapGestureRecognizer; 206 206 RetainPtr<_UIWebHighlightLongPressGestureRecognizer> _highlightLongPressGestureRecognizer; 207 207 RetainPtr<UILongPressGestureRecognizer> _longPressGestureRecognizer; 208 RetainPtr< UITapGestureRecognizer> _doubleTapGestureRecognizer;208 RetainPtr<WKSyntheticTapGestureRecognizer> _doubleTapGestureRecognizer; 209 209 RetainPtr<UITapGestureRecognizer> _nonBlockingDoubleTapGestureRecognizer; 210 210 RetainPtr<UITapGestureRecognizer> _twoFingerDoubleTapGestureRecognizer; … … 406 406 - (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap; 407 407 - (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID; 408 - (void)_handleSmartMagnificationInformationForPotentialTap:(uint64_t)requestID renderRect:(const WebCore::FloatRect&)renderRect fitEntireRect:(BOOL)fitEntireRect viewportMinimumScale:(double)viewportMinimumScale viewportMaximumScale:(double)viewportMaximumScale; 408 409 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject; 409 410 - (void)_elementDidBlur; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r242695 r242757 229 229 } // namespace WebKit 230 230 231 static const float highlightDelay = 0.12; 232 static const float tapAndHoldDelay = 0.75; 233 const CGFloat minimumTapHighlightRadius = 2.0; 231 constexpr float highlightDelay = 0.12; 232 constexpr float tapAndHoldDelay = 0.75; 233 constexpr CGFloat minimumTapHighlightRadius = 2.0; 234 constexpr double fasterTapSignificantZoomThreshold = 0.8; 234 235 235 236 @interface WKTextRange : UITextRange { … … 646 647 - (void)_createAndConfigureDoubleTapGestureRecognizer 647 648 { 648 _doubleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_doubleTapRecognized:)]); 649 _doubleTapGestureRecognizer = adoptNS([[WKSyntheticTapGestureRecognizer alloc] initWithTarget:self action:@selector(_doubleTapRecognized:)]); 650 [_doubleTapGestureRecognizer setGestureFailedTarget:self action:@selector(_doubleTapDidFail:)]; 649 651 [_doubleTapGestureRecognizer setNumberOfTapsRequired:2]; 650 652 [_doubleTapGestureRecognizer setDelegate:self]; … … 695 697 #endif 696 698 697 _singleTapGestureRecognizer = adoptNS([[WKSynthetic ClickTapGestureRecognizer alloc] initWithTarget:self action:@selector(_singleTapCommited:)]);699 _singleTapGestureRecognizer = adoptNS([[WKSyntheticTapGestureRecognizer alloc] initWithTarget:self action:@selector(_singleTapRecognized:)]); 698 700 [_singleTapGestureRecognizer setDelegate:self]; 699 [_singleTapGestureRecognizer setGesture RecognizedTarget:self action:@selector(_singleTapRecognized:)];701 [_singleTapGestureRecognizer setGestureIdentifiedTarget:self action:@selector(_singleTapIdentified:)]; 700 702 [_singleTapGestureRecognizer setResetTarget:self action:@selector(_singleTapDidReset:)]; 701 703 [self addGestureRecognizer:_singleTapGestureRecognizer.get()]; … … 814 816 815 817 [_singleTapGestureRecognizer setDelegate:nil]; 816 [_singleTapGestureRecognizer setGesture RecognizedTarget:nil action:nil];818 [_singleTapGestureRecognizer setGestureIdentifiedTarget:nil action:nil]; 817 819 [_singleTapGestureRecognizer setResetTarget:nil action:nil]; 818 820 [self removeGestureRecognizer:_singleTapGestureRecognizer.get()]; … … 1490 1492 1491 1493 [self _setDoubleTapGesturesEnabled:NO]; 1494 } 1495 1496 - (void)_handleSmartMagnificationInformationForPotentialTap:(uint64_t)requestID renderRect:(const WebCore::FloatRect&)renderRect fitEntireRect:(BOOL)fitEntireRect viewportMinimumScale:(double)viewportMinimumScale viewportMaximumScale:(double)viewportMaximumScale 1497 { 1498 ASSERT(_page->preferences().fasterClicksEnabled()); 1499 if (!_potentialTapInProgress) 1500 return; 1501 1502 auto targetScale = _smartMagnificationController->zoomFactorForTargetRect(renderRect, fitEntireRect, viewportMinimumScale, viewportMaximumScale); 1503 1504 auto initialScale = [self _initialScaleFactor]; 1505 if (std::min(targetScale, initialScale) / std::max(targetScale, initialScale) > fasterTapSignificantZoomThreshold) { 1506 RELEASE_LOG(ViewGestures, "Potential tap would not cause a significant zoom. Trigger click. (%p)", self); 1507 [self _setDoubleTapGesturesEnabled:NO]; 1508 return; 1509 } 1510 RELEASE_LOG(ViewGestures, "Potential tap may cause significant zoom. Wait. (%p)", self); 1492 1511 } 1493 1512 … … 2177 2196 } 2178 2197 2179 - (void)_singleTap Recognized:(UITapGestureRecognizer *)gestureRecognizer2198 - (void)_singleTapIdentified:(UITapGestureRecognizer *)gestureRecognizer 2180 2199 { 2181 2200 ASSERT(gestureRecognizer == _singleTapGestureRecognizer); … … 2183 2202 [self _resetIsDoubleTapPending]; 2184 2203 2185 _page->potentialTapAtPosition(gestureRecognizer.location, ++_latestTapID); 2204 bool shouldRequestMagnificationInformation = _page->preferences().fasterClicksEnabled(); 2205 if (shouldRequestMagnificationInformation) 2206 RELEASE_LOG(ViewGestures, "Single tap identified. Request details on potential zoom. (%p)", self); 2207 2208 _page->potentialTapAtPosition(gestureRecognizer.location, shouldRequestMagnificationInformation, ++_latestTapID); 2186 2209 _potentialTapInProgress = YES; 2187 2210 _isTapHighlightIDValid = YES; … … 2202 2225 ASSERT(gestureRecognizer == _singleTapGestureRecognizer); 2203 2226 cancelPotentialTapIfNecessary(self); 2227 } 2228 2229 - (void)_doubleTapDidFail:(UITapGestureRecognizer *)gestureRecognizer 2230 { 2231 RELEASE_LOG(ViewGestures, "Double tap was not recognized. (%p)", self); 2232 ASSERT(gestureRecognizer == _doubleTapGestureRecognizer); 2204 2233 } 2205 2234 … … 2233 2262 - (void)_didCompleteSyntheticClick 2234 2263 { 2264 RELEASE_LOG(ViewGestures, "Synthetic click completed. (%p)", self); 2235 2265 [self _resetInputViewDeferral]; 2236 2266 } 2237 2267 2238 - (void)_singleTap Commited:(UITapGestureRecognizer *)gestureRecognizer2268 - (void)_singleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer 2239 2269 { 2240 2270 ASSERT(gestureRecognizer == _singleTapGestureRecognizer); … … 2261 2291 2262 2292 [_inputPeripheral endEditing]; 2293 2294 RELEASE_LOG(ViewGestures, "Single tap recognized - commit potential tap (%p)", self); 2295 2263 2296 _page->commitPotentialTap(WebKit::webEventModifierFlags(gestureRecognizerModifierFlags(gestureRecognizer)), _layerTreeTransactionIdAtLastTouchStart); 2264 2297 … … 2269 2302 - (void)_doubleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer 2270 2303 { 2304 RELEASE_LOG(ViewGestures, "Identified a double tap (%p)", self); 2305 2271 2306 [self _resetIsDoubleTapPending]; 2272 2307 _lastInteractionLocation = gestureRecognizer.location; -
trunk/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.h
-
Property svn:eol-style
set to
native -
Property svn:keywords
set to
Date Author Id Revision HeadURL
r242756 r242757 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014 - 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #import "UIKitSPI.h" 29 29 30 @interface WKSyntheticClickTapGestureRecognizer : UITapGestureRecognizer 31 - (void)setGestureRecognizedTarget:(id)target action:(SEL)action; 30 // The purpose of this class is to call a target/action when 31 // the gesture is recognized, as well as the typical time when 32 // a gesture should be handled. This allows it to be used while 33 // it is waiting for another gesture recognizer to fail. 34 @interface WKSyntheticTapGestureRecognizer : UITapGestureRecognizer 35 - (void)setGestureIdentifiedTarget:(id)target action:(SEL)action; 36 - (void)setGestureFailedTarget:(id)target action:(SEL)action; 32 37 - (void)setResetTarget:(id)target action:(SEL)action; 33 38 @end -
Property svn:eol-style
set to
-
trunk/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.m
r242756 r242757 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014 - 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #import "config.h" 27 #import "WKSynthetic ClickTapGestureRecognizer.h"27 #import "WKSyntheticTapGestureRecognizer.h" 28 28 29 29 #if PLATFORM(IOS_FAMILY) … … 31 31 #import <UIKit/UIGestureRecognizerSubclass.h> 32 32 33 @implementation WKSyntheticClickTapGestureRecognizer { 34 id _gestureRecognizedTarget; 35 SEL _gestureRecognizedAction; 33 @implementation WKSyntheticTapGestureRecognizer { 34 id _gestureIdentifiedTarget; 35 SEL _gestureIdentifiedAction; 36 id _gestureFailedTarget; 37 SEL _gestureFailedAction; 36 38 id _resetTarget; 37 39 SEL _resetAction; 38 40 } 39 41 40 - (void)setGesture RecognizedTarget:(id)target action:(SEL)action42 - (void)setGestureIdentifiedTarget:(id)target action:(SEL)action 41 43 { 42 _gestureRecognizedTarget = target; 43 _gestureRecognizedAction = action; 44 _gestureIdentifiedTarget = target; 45 _gestureIdentifiedAction = action; 46 } 47 48 - (void)setGestureFailedTarget:(id)target action:(SEL)action 49 { 50 _gestureFailedTarget = target; 51 _gestureFailedAction = action; 44 52 } 45 53 … … 53 61 { 54 62 if (state == UIGestureRecognizerStateEnded) 55 [_gestureRecognizedTarget performSelector:_gestureRecognizedAction withObject:self]; 63 [_gestureIdentifiedTarget performSelector:_gestureIdentifiedAction withObject:self]; 64 else if (state == UIGestureRecognizerStateFailed) 65 [_gestureFailedTarget performSelector:_gestureFailedAction withObject:self]; 56 66 [super setState:state]; 57 67 } -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r242748 r242757 813 813 } 814 814 815 void WebPageProxy::potentialTapAtPosition(const WebCore::FloatPoint& position, uint64_t& requestID)815 void WebPageProxy::potentialTapAtPosition(const WebCore::FloatPoint& position, bool shouldRequestMagnificationInformation, uint64_t& requestID) 816 816 { 817 817 hideValidationMessage(); 818 process().send(Messages::WebPage::PotentialTapAtPosition(requestID, position ), m_pageID);818 process().send(Messages::WebPage::PotentialTapAtPosition(requestID, position, shouldRequestMagnificationInformation), m_pageID); 819 819 } 820 820 … … 1031 1031 { 1032 1032 pageClient().disableDoubleTapGesturesDuringTapIfNecessary(requestID); 1033 } 1034 1035 void WebPageProxy::handleSmartMagnificationInformationForPotentialTap(uint64_t requestID, const WebCore::FloatRect& renderRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale) 1036 { 1037 pageClient().handleSmartMagnificationInformationForPotentialTap(requestID, renderRect, fitEntireRect, viewportMinimumScale, viewportMaximumScale); 1033 1038 } 1034 1039 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r242748 r242757 416 416 2684055218B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */; }; 417 417 2684055318B86ED60022C38B /* ViewUpdateDispatcherMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */; }; 418 26F10BE819187E2E001D0E68 /* WKSynthetic ClickTapGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F10BE619187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.h */; };419 26F10BE919187E2E001D0E68 /* WKSynthetic ClickTapGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 26F10BE719187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m */; };418 26F10BE819187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F10BE619187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.h */; }; 419 26F10BE919187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 26F10BE719187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.m */; }; 420 420 26F9A83B18A3468100AEB88A /* WKWebViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 421 421 2749F6442146561B008380BF /* InjectedBundleNodeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4BEEAA120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.cpp */; }; … … 2446 2446 2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ViewUpdateDispatcherMessageReceiver.cpp; path = DerivedSources/WebKit2/ViewUpdateDispatcherMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; 2447 2447 2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewUpdateDispatcherMessages.h; path = DerivedSources/WebKit2/ViewUpdateDispatcherMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; 2448 26F10BE619187E2E001D0E68 /* WKSynthetic ClickTapGestureRecognizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKSyntheticClickTapGestureRecognizer.h; path = ios/WKSyntheticClickTapGestureRecognizer.h; sourceTree = "<group>"; };2449 26F10BE719187E2E001D0E68 /* WKSynthetic ClickTapGestureRecognizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WKSyntheticClickTapGestureRecognizer.m; path = ios/WKSyntheticClickTapGestureRecognizer.m; sourceTree = "<group>"; };2448 26F10BE619187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKSyntheticTapGestureRecognizer.h; path = ios/WKSyntheticTapGestureRecognizer.h; sourceTree = "<group>"; }; 2449 26F10BE719187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WKSyntheticTapGestureRecognizer.m; path = ios/WKSyntheticTapGestureRecognizer.m; sourceTree = "<group>"; }; 2450 2450 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebViewPrivate.h; sourceTree = "<group>"; }; 2451 2451 290F4271172A0C7400939FF0 /* AuxiliaryProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuxiliaryProcessSupplement.h; sourceTree = "<group>"; }; … … 5905 5905 0FCB4E4418BBE044000FCFC9 /* WKScrollView.h */, 5906 5906 0FCB4E4518BBE044000FCFC9 /* WKScrollView.mm */, 5907 26F10BE619187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.h */,5908 26F10BE719187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m */,5909 5907 CE5B4C8621B73D870022E64F /* WKSyntheticFlagsChangedWebEvent.h */, 5910 5908 CE5B4C8721B73D870022E64F /* WKSyntheticFlagsChangedWebEvent.mm */, 5909 26F10BE619187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.h */, 5910 26F10BE719187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.m */, 5911 5911 316B8B622054B55800BD4A62 /* WKSystemPreviewView.h */, 5912 5912 316B8B612054B55800BD4A62 /* WKSystemPreviewView.mm */, … … 9965 9965 BC40761A124FF0370068F20A /* WKStringCF.h in Headers */, 9966 9966 BC9099801256A98200083756 /* WKStringPrivate.h in Headers */, 9967 26F10BE819187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.h in Headers */,9968 9967 CE5B4C8821B73D870022E64F /* WKSyntheticFlagsChangedWebEvent.h in Headers */, 9968 26F10BE819187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.h in Headers */, 9969 9969 316B8B642054B55800BD4A62 /* WKSystemPreviewView.h in Headers */, 9970 9970 51F886A61F2C228100C193EF /* WKTestingSupport.h in Headers */, … … 11168 11168 5CA26D83217AD1B800F97A35 /* WKSafeBrowsingWarning.mm in Sources */, 11169 11169 1DB01944211CF005009FB3E8 /* WKShareSheet.mm in Sources */, 11170 26F10BE919187E2E001D0E68 /* WKSynthetic ClickTapGestureRecognizer.m in Sources */,11170 26F10BE919187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.m in Sources */, 11171 11171 ); 11172 11172 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.h
r241224 r242757 47 47 void mainFrameDidLayout(); 48 48 49 void computeZoomInformationForNode(WebCore::Node&, WebCore::FloatPoint& origin, WebCore::FloatRect& renderRect, bool& isReplaced, double& viewportMinimumScale, double& viewportMaximumScale); 50 49 51 private: 50 52 // IPC::MessageReceiver. … … 63 65 64 66 void dispatchDidCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale); 65 void computeZoomInformationForNode(WebCore::Node&, WebCore::FloatPoint& origin, WebCore::FloatRect& renderRect, bool& isReplaced, double& viewportMinimumScale, double& viewportMaximumScale);66 67 void computeMinimumAndMaximumViewportScales(double& viewportMinimumScale, double& viewportMaximumScale) const; 67 68 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r242753 r242757 615 615 616 616 void handleTap(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t lastLayerTreeTransactionId); 617 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint& );617 void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&, bool shouldRequestMagnificationInformation); 618 618 void commitPotentialTap(OptionSet<WebKit::WebEvent::Modifier>, uint64_t lastLayerTreeTransactionId); 619 619 void commitPotentialTapFailed(); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r242696 r242757 53 53 54 54 HandleTap(WebCore::IntPoint point, OptionSet<WebKit::WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId) 55 PotentialTapAtPosition(uint64_t requestID, WebCore::FloatPoint point )55 PotentialTapAtPosition(uint64_t requestID, WebCore::FloatPoint point, bool shouldRequestMagnificationInformation) 56 56 CommitPotentialTap(OptionSet<WebKit::WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId) 57 57 CancelPotentialTap() -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r242675 r242757 44 44 #import "UIKitSPI.h" 45 45 #import "UserData.h" 46 #import "ViewGestureGeometryCollector.h" 46 47 #import "VisibleContentRectUpdateInfo.h" 47 48 #import "WKAccessibilityWebPageObjectIOS.h" … … 809 810 } 810 811 811 void WebPage::potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint& position )812 void WebPage::potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint& position, bool shouldRequestMagnificationInformation) 812 813 { 813 814 m_potentialTapNode = m_page->mainFrame().nodeRespondingToClickEvents(position, m_potentialTapLocation, m_potentialTapSecurityOrigin.get()); 815 816 if (shouldRequestMagnificationInformation && m_potentialTapNode && m_viewGestureGeometryCollector) { 817 // FIXME: Could this be combined into tap highlight? 818 FloatPoint origin = position; 819 FloatRect renderRect; 820 bool fitEntireRect; 821 double viewportMinimumScale; 822 double viewportMaximumScale; 823 824 m_viewGestureGeometryCollector->computeZoomInformationForNode(*m_potentialTapNode, origin, renderRect, fitEntireRect, viewportMinimumScale, viewportMaximumScale); 825 send(Messages::WebPageProxy::HandleSmartMagnificationInformationForPotentialTap(requestID, renderRect, fitEntireRect, viewportMinimumScale, viewportMaximumScale)); 826 } 827 814 828 sendTapHighlightForNodeIfNecessary(requestID, m_potentialTapNode.get()); 815 829 #if ENABLE(TOUCH_EVENTS)
Note:
See TracChangeset
for help on using the changeset viewer.