Title: [250779] trunk/Source/WebKit
Revision
250779
Author
commit-qu...@webkit.org
Date
2019-10-07 11:37:37 -0700 (Mon, 07 Oct 2019)

Log Message

foundStringMatchIndex in FindController::findString gets reset on page scroll
https://bugs.webkit.org/show_bug.cgi?id=201773
<rdar://problem/55351892>

Patch by Matt Mokary <mmok...@apple.com> on 2019-10-07
Reviewed by Tim Horton.

Decouple hiding of the find indicator from resetting match index, and only reset match index when there is not
an active match.

* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll):
(WebKit::FindController::hideFindUI):
(WebKit::FindController::hideFindIndicator):
(WebKit::FindController::resetMatchIndex):
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::hideFindIndicator):
(WebKit::FindController::resetMatchIndex):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (250778 => 250779)


--- trunk/Source/WebKit/ChangeLog	2019-10-07 18:35:00 UTC (rev 250778)
+++ trunk/Source/WebKit/ChangeLog	2019-10-07 18:37:37 UTC (rev 250779)
@@ -1,3 +1,24 @@
+2019-10-07  Matt Mokary  <mmok...@apple.com>
+
+        foundStringMatchIndex in FindController::findString gets reset on page scroll
+        https://bugs.webkit.org/show_bug.cgi?id=201773
+        <rdar://problem/55351892>
+
+        Reviewed by Tim Horton.
+
+        Decouple hiding of the find indicator from resetting match index, and only reset match index when there is not
+        an active match.
+
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindUIAfterPageScroll):
+        (WebKit::FindController::hideFindUI):
+        (WebKit::FindController::hideFindIndicator):
+        (WebKit::FindController::resetMatchIndex):
+        * WebProcess/WebPage/FindController.h:
+        * WebProcess/WebPage/ios/FindControllerIOS.mm:
+        (WebKit::FindController::hideFindIndicator):
+        (WebKit::FindController::resetMatchIndex):
+
 2019-10-07  youenn fablet  <you...@apple.com>
 
         WebPageProxy::updatePlayingMediaDidChange should protect from a null m_userMediaPermissionRequestManager

Modified: trunk/Source/WebKit/WebProcess/WebPage/FindController.cpp (250778 => 250779)


--- trunk/Source/WebKit/WebProcess/WebPage/FindController.cpp	2019-10-07 18:35:00 UTC (rev 250778)
+++ trunk/Source/WebKit/WebProcess/WebPage/FindController.cpp	2019-10-07 18:37:37 UTC (rev 250779)
@@ -146,6 +146,7 @@
             selectedFrame->selection().clear();
 
         hideFindIndicator();
+        resetMatchIndex();
         didFailToFindString();
 
         m_webPage->send(Messages::WebPageProxy::DidFailToFindString(string));
@@ -369,6 +370,7 @@
         m_webPage->corePage()->unmarkAllTextMatches();
     
     hideFindIndicator();
+    resetMatchIndex();
 }
 
 #if !PLATFORM(IOS_FAMILY)
@@ -395,10 +397,14 @@
 
     m_webPage->send(Messages::WebPageProxy::ClearTextIndicator());
     m_isShowingFindIndicator = false;
-    m_foundStringMatchIndex = -1;
     didHideFindIndicator();
 }
 
+void FindController::resetMatchIndex()
+{
+    m_foundStringMatchIndex = -1;
+}
+
 void FindController::willFindString()
 {
 }

Modified: trunk/Source/WebKit/WebProcess/WebPage/FindController.h (250778 => 250779)


--- trunk/Source/WebKit/WebProcess/WebPage/FindController.h	2019-10-07 18:35:00 UTC (rev 250778)
+++ trunk/Source/WebKit/WebProcess/WebPage/FindController.h	2019-10-07 18:37:37 UTC (rev 250779)
@@ -66,6 +66,7 @@
     uint32_t replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly);
     
     void hideFindIndicator();
+    void resetMatchIndex();
     void showFindIndicatorInSelection();
 
     bool isShowingOverlay() const { return m_isShowingFindIndicator && m_findPageOverlay; }

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


--- trunk/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm	2019-10-07 18:35:00 UTC (rev 250778)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm	2019-10-07 18:37:37 UTC (rev 250779)
@@ -128,10 +128,14 @@
     m_webPage->corePage()->pageOverlayController().uninstallPageOverlay(*m_findIndicatorOverlay, PageOverlay::FadeMode::DoNotFade);
     m_findIndicatorOverlay = nullptr;
     m_isShowingFindIndicator = false;
-    m_foundStringMatchIndex = -1;
     didHideFindIndicator();
 }
 
+void FindController::resetMatchIndex()
+{
+    m_foundStringMatchIndex = -1;
+}
+
 static void setSelectionChangeUpdatesEnabledInAllFrames(WebPage& page, bool enabled)
 {
     for (Frame* coreFrame = page.mainFrame(); coreFrame; coreFrame = coreFrame->tree().traverseNext())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to