Bug 184255

Summary: Revealing find results fails in pages containing more than one subframe
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: FramesAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dvoytenko, malte, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=178789
https://bugs.webkit.org/show_bug.cgi?id=184297
Attachments:
Description Flags
testcase none

Description Frédéric Wang (:fredw) 2018-04-02 23:20:50 PDT
Created attachment 337061 [details]
testcase

Attached testcase is similar to attachment 312006 [details] but using subframes instead of "overflow: auto" nodes.

If you find "text" with the Find UI, the result will be highlighted in that order: 
* Main frame: text5a, text5b, text5c, text10a text10b text10c
* Subframe 1: text1a, text1b, text1c, ... text4a, text4b, text4c
* Subframe 2: text6a, text6b, text6c, ... text9a text9b text9c

Some remarks:
- The result from the main frame are returned first. Although this is different from "overflow: auto" node, it is the same behavior as on desktop and other browsers.
- Scrolling and smart magnification work for the main frame and the first subframe.

For the second subframe, text6a, text6b, text6c, ... text9a text9b text9c are highlighted as expected BUT the scrolling / magnification reveals the *first* subframe (you can scroll down to check that the expected text is highlighted).
Comment 1 Radar WebKit Bug Importer 2018-04-02 23:21:11 PDT
<rdar://problem/39132221>
Comment 2 Simon Fraser (smfr) 2018-11-12 14:57:45 PST
Relevant stack trace:

  * frame #0: 0x0000000319330158 WebCore`WebCore::FrameSelection::revealSelection(this=0x0000000341628c60, revealMode=RevealUpToMainFrame, alignment=0x000000031bf29608, revealExtentOption=DoNotRevealExtent) at FrameSelection.cpp:2366
    frame #1: 0x0000000308bda05a WebKit`WebKit::FindController::didFindString(this=0x00007f8cf8001770) at FindControllerIOS.mm:165
    frame #2: 0x0000000308f028bb WebKit`WebKit::FindController::findString(this=0x00007f8cf8001770, string={ length = 4, contents = 'text' }, options=343, maxMatchCount=100) at FindController.cpp:237
    frame #3: 0x000000030900e089 WebKit`WebKit::WebPage::findString(this=0x00007f8cfd000008, string={ length = 4, contents = 'text' }, options=343, maxMatchCount=100) at WebPage.cpp:3790