RESOLVED FIXED Bug 178789
Make iOS Find UI reveal matches in scrollable elements
https://bugs.webkit.org/show_bug.cgi?id=178789
Summary Make iOS Find UI reveal matches in scrollable elements
Frédéric Wang (:fredw)
Reported 2017-10-25 06:54:53 PDT
Make iOS Find UI reveal matches in scrollable elements
Attachments
Patch (1.91 KB, patch)
2017-10-25 06:57 PDT, Frédéric Wang (:fredw)
no flags
Patch (tentative test) (2.94 KB, patch)
2017-10-26 04:12 PDT, Frédéric Wang (:fredw)
no flags
Patch (12.61 KB, patch)
2017-10-27 07:31 PDT, Frédéric Wang (:fredw)
no flags
Patch (12.32 KB, patch)
2017-11-01 11:41 PDT, Frédéric Wang (:fredw)
thorton: review+
Patch (try to implement findString in DumpRenderTree) (2.05 KB, patch)
2018-10-25 05:40 PDT, Frédéric Wang (:fredw)
no flags
Frédéric Wang (:fredw)
Comment 1 2017-10-25 06:57:16 PDT
Frédéric Wang (:fredw)
Comment 2 2017-10-25 07:00:35 PDT
Alexey Proskuryakov
Comment 3 2017-10-25 10:28:16 PDT
Comment on attachment 324816 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=324816&action=review > Source/WebKit/ChangeLog:3 > + Make iOS Find UI reveal matches in scrollable elements Can a test be made for this change?
Frédéric Wang (:fredw)
Comment 4 2017-10-25 10:40:37 PDT
(In reply to Alexey Proskuryakov from comment #3) > Comment on attachment 324816 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=324816&action=review > > > Source/WebKit/ChangeLog:3 > > + Make iOS Find UI reveal matches in scrollable elements > > Can a test be made for this change? It seems that old changes in this part of the code do not have tests... I can test manually, but I'm not sure how to do it in the test runner. Does anyone know how to simulate opening the Find UI and searching some text? Also, note that window.find does not follow the same code path (bug 163911 comment 18) so it does not make sense to use that API to test this change.
Frédéric Wang (:fredw)
Comment 5 2017-10-26 04:12:39 PDT
Created attachment 324985 [details] Patch (tentative test)
Frédéric Wang (:fredw)
Comment 6 2017-10-26 04:18:32 PDT
Comment on attachment 324816 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=324816&action=review >>> Source/WebKit/ChangeLog:3 >>> + Make iOS Find UI reveal matches in scrollable elements >> >> Can a test be made for this change? > > It seems that old changes in this part of the code do not have tests... I can test manually, but I'm not sure how to do it in the test runner. Does anyone know how to simulate opening the Find UI and searching some text? > > Also, note that window.find does not follow the same code path (bug 163911 comment 18) so it does not make sense to use that API to test this change. I tried again today. It seems that the test runner webview does not have the same UI as Safari. Trying to send Cmd+F with eventSender fails (see attachment 324985 [details]). In Safari, we can also use the "Share" menu to execute "Find in Page" but again that UI is not visible in the test runner webview. Finally, I also tried the command document.execCommand("FindString", true, "match") but again, it follows a different code path and won't allow to test that change (see bug 163911 comment 19).
Tim Horton
Comment 7 2017-10-26 09:22:52 PDT
(In reply to Frédéric Wang (:fredw) from comment #6) > Comment on attachment 324816 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=324816&action=review > > >>> Source/WebKit/ChangeLog:3 > >>> + Make iOS Find UI reveal matches in scrollable elements > >> > >> Can a test be made for this change? > > > > It seems that old changes in this part of the code do not have tests... I can test manually, but I'm not sure how to do it in the test runner. Does anyone know how to simulate opening the Find UI and searching some text? > > > > Also, note that window.find does not follow the same code path (bug 163911 comment 18) so it does not make sense to use that API to test this change. > > I tried again today. It seems that the test runner webview does not have the > same UI as Safari. Trying to send Cmd+F with eventSender fails (see > attachment 324985 [details]). In Safari, we can also use the "Share" menu to > execute "Find in Page" but again that UI is not visible in the test runner > webview. Finally, I also tried the command > document.execCommand("FindString", true, "match") but again, it follows a > different code path and won't allow to test that change (see bug 163911 > comment 19). Like smfr said in the other bug, you probably want a UIScriptController function that invokes WKWebView's _findString:options:maxCount:
Frédéric Wang (:fredw)
Comment 8 2017-10-27 07:31:12 PDT
Frédéric Wang (:fredw)
Comment 9 2017-10-27 07:33:17 PDT
(In reply to Tim Horton from comment #7) > Like smfr said in the other bug, you probably want a UIScriptController > function that invokes WKWebView's _findString:options:maxCount: Thanks Tim. I uploaded a new patch with a test to check the effect of the change.
Tim Horton
Comment 10 2017-11-01 10:37:03 PDT
Comment on attachment 325159 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=325159&action=review > Source/WebKit/WebProcess/WebPage/FindController.cpp:254 > +#if PLATFORM(IOS) Can we hide this in FindControllerIOS instead? Maybe in didFindString?
Frédéric Wang (:fredw)
Comment 11 2017-11-01 11:41:24 PDT
Frédéric Wang (:fredw)
Comment 12 2017-11-01 11:44:13 PDT
Comment on attachment 325159 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=325159&action=review >> Source/WebKit/WebProcess/WebPage/FindController.cpp:254 >> +#if PLATFORM(IOS) > > Can we hide this in FindControllerIOS instead? Maybe in didFindString? Right, thanks. Done in the latest patch.
Frédéric Wang (:fredw)
Comment 13 2017-11-01 11:50:45 PDT
Radar WebKit Bug Importer
Comment 14 2017-11-15 12:47:49 PST
Frédéric Wang (:fredw)
Comment 15 2018-10-25 05:40:11 PDT
Created attachment 353082 [details] Patch (try to implement findString in DumpRenderTree) Simon had suggested to test scrolling on WK1. Just for the record, I'm attaching an attempt to implement UIScriptController::findString for DumpRenderTree's UIScriptControllerIOS. Unfortunately, WebKitLegacy's WebFindOptions does not have the ShowFindIndicator option required by find-text-in-overflow-node.html and WebView does not even expose findString (only the more limited searchFor function). So I believe we can not run this test on WK1.
Note You need to log in before you can comment on or make changes to this bug.