Bug 23109

Summary: REGRESSION: Backwards search in a long document matches incorrectly
Product: WebKit Reporter: mitz
Component: TextAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, hausmann, mitz
Priority: P1 Keywords: Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://build.webkit.org/builders/trunk-mac-ppc-pixel/builds/765/steps/compile-release/logs/stdio
Attachments:
Description Flags
patch mitz: review+

Description mitz 2009-01-04 14:51:33 PST
To reproduce:
1) Go to the URL
2) Choose Edit > Find > Find
3) In the search field, type "display"
4) Click the previous match button near the search field

Note that the highlighted text is not the word "display".
Comment 1 Darin Adler 2009-01-04 20:54:43 PST
Should be simple to fix. I'll look at it tomorrow.
Comment 2 Darin Adler 2009-01-04 21:44:31 PST
Given the structure of the code, it's quite surprising that searching forward works properly and searching backward fails.
Comment 3 Darin Adler 2009-01-04 23:09:01 PST
Created attachment 26425 [details]
patch
Comment 4 Darin Adler 2009-01-05 11:50:54 PST
http://trac.webkit.org/changeset/39609
Comment 5 Simon Hausmann 2009-01-21 14:39:21 PST
I'd like to note that on a build _without_ the ICU based SearchBuffer the backwards search results in an endless loop, including in the changeset's testcase fast/text/find-backwards.html. It looks like the goto inserted in the last hunk triggers this, but I don't know the code well enough to be sure it's really the goto's fault or just a symptom.
Comment 6 mitz 2009-01-21 14:40:35 PST
(In reply to comment #5)
> I'd like to note that on a build _without_ the ICU based SearchBuffer the
> backwards search results in an endless loop, including in the changeset's
> testcase fast/text/find-backwards.html. It looks like the goto inserted in the
> last hunk triggers this, but I don't know the code well enough to be sure it's
> really the goto's fault or just a symptom.

Please file a new bug.
Comment 7 Darin Adler 2009-01-21 14:43:19 PST
And please cc me. I'll be happy to take a crack at fixing it.