Title: [241323] trunk/Source/WebKit
Revision
241323
Author
timothy_hor...@apple.com
Date
2019-02-12 15:33:23 -0800 (Tue, 12 Feb 2019)

Log Message

Find on Page shouldn't zoom in on matches
https://bugs.webkit.org/show_bug.cgi?id=194557
<rdar://problem/42087017>

Reviewed by Wenson Hsieh.

* UIProcess/ios/SmartMagnificationController.h:
* UIProcess/ios/SmartMagnificationController.messages.in:
* UIProcess/ios/SmartMagnificationController.mm:
(WebKit::SmartMagnificationController::scrollToRect):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::updateFindIndicator):
Only scroll to reveal the find result, do not zoom in.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (241322 => 241323)


--- trunk/Source/WebKit/ChangeLog	2019-02-12 23:18:30 UTC (rev 241322)
+++ trunk/Source/WebKit/ChangeLog	2019-02-12 23:33:23 UTC (rev 241323)
@@ -1,3 +1,19 @@
+2019-02-12  Tim Horton  <timothy_hor...@apple.com>
+
+        Find on Page shouldn't zoom in on matches
+        https://bugs.webkit.org/show_bug.cgi?id=194557
+        <rdar://problem/42087017>
+
+        Reviewed by Wenson Hsieh.
+
+        * UIProcess/ios/SmartMagnificationController.h:
+        * UIProcess/ios/SmartMagnificationController.messages.in:
+        * UIProcess/ios/SmartMagnificationController.mm:
+        (WebKit::SmartMagnificationController::scrollToRect):
+        * WebProcess/WebPage/ios/FindControllerIOS.mm:
+        (WebKit::FindController::updateFindIndicator):
+        Only scroll to reveal the find result, do not zoom in.
+
 2019-02-12  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Allow pages to trigger programmatic paste from script on iOS

Modified: trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.h (241322 => 241323)


--- trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.h	2019-02-12 23:18:30 UTC (rev 241322)
+++ trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.h	2019-02-12 23:33:23 UTC (rev 241323)
@@ -54,6 +54,7 @@
 
     void didCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect renderRect, WebCore::FloatRect visibleContentBounds, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale);
     void magnify(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale);
+    void scrollToRect(WebCore::FloatPoint origin, WebCore::FloatRect targetRect);
     void adjustSmartMagnificationTargetRectAndZoomScales(bool addMagnificationPadding, WebCore::FloatRect& targetRect, double& minimumScale, double& maximumScale);
 
     WebPageProxy& m_webPageProxy;

Modified: trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.messages.in (241322 => 241323)


--- trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.messages.in	2019-02-12 23:18:30 UTC (rev 241322)
+++ trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.messages.in	2019-02-12 23:33:23 UTC (rev 241323)
@@ -25,6 +25,7 @@
 messages -> SmartMagnificationController {
     DidCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect renderRect, WebCore::FloatRect visibleContentBounds, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale)
     Magnify(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale)
+    ScrollToRect(WebCore::FloatPoint origin, WebCore::FloatRect targetRect)
 }
 
 #endif

Modified: trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm (241322 => 241323)


--- trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm	2019-02-12 23:18:30 UTC (rev 241322)
+++ trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm	2019-02-12 23:33:23 UTC (rev 241323)
@@ -128,6 +128,11 @@
     [m_contentView _zoomToRect:targetRect withOrigin:origin fitEntireRect:NO minimumScale:minimumScale maximumScale:maximumScale minimumScrollDistance:0];
 }
 
+void SmartMagnificationController::scrollToRect(FloatPoint origin, FloatRect targetRect)
+{
+    [m_contentView _scrollToRect:targetRect withOrigin:origin minimumScrollDistance:0];
+}
+
 } // namespace WebKit
 
 #endif // PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm (241322 => 241323)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm	2019-02-12 23:18:30 UTC (rev 241322)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm	2019-02-12 23:33:23 UTC (rev 241323)
@@ -106,15 +106,12 @@
     m_findIndicatorOverlay->setNeedsDisplay();
 
     if (shouldAnimate) {
-        FloatRect visibleContentRect = m_webPage->mainFrameView()->unobscuredContentRectIncludingScrollbars();
-
         bool isReplaced;
         const VisibleSelection& visibleSelection = selectedFrame.selection().selection();
         FloatRect renderRect = visibleSelection.start().containerNode()->renderRect(&isReplaced);
-
         IntRect startRect = visibleSelection.visibleStart().absoluteCaretBounds();
 
-        m_webPage->send(Messages::SmartMagnificationController::Magnify(startRect.center(), renderRect, visibleContentRect, m_webPage->minimumPageScaleFactor(), m_webPage->maximumPageScaleFactor()));
+        m_webPage->send(Messages::SmartMagnificationController::ScrollToRect(startRect.center(), renderRect));
     }
 
     m_isShowingFindIndicator = true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to