Bug 215757

Summary: Make window.find not default the search string to undefined
Product: WebKit Reporter: Rob Buis <rbuis>
Component: DOMAssignee: Rob Buis <rbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, darin, esprehn+autocc, ews-watchlist, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Rob Buis 2020-08-23 06:18:25 PDT
Make window.find not default the search string to undefined, instead use the null string. Before this change window.find() would
find a hit in a page containing the text string "undefined".
Comment 1 Rob Buis 2020-08-23 06:21:11 PDT
Created attachment 407069 [details]
Patch
Comment 2 Rob Buis 2020-08-23 06:23:22 PDT
Created attachment 407070 [details]
Patch
Comment 3 Darin Adler 2020-08-23 11:32:19 PDT
Comment on attachment 407070 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407070&action=review

> LayoutTests/ChangeLog:10
> +        Add tests to verify window.find() does not use "undefined"
> +        as text string. This also fixes the logic of the test to
> +        not always output PASS at the end.

Downside to these changes is that now it will only report a single failure. The ideal version would report all the failures to help the person who broke things get an overview of what’s wrong.
Comment 4 Rob Buis 2020-08-24 02:04:07 PDT
Created attachment 407092 [details]
Patch
Comment 5 Rob Buis 2020-08-24 02:42:01 PDT
Created attachment 407093 [details]
Patch
Comment 6 Rob Buis 2020-08-24 05:19:44 PDT
Comment on attachment 407070 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407070&action=review

>> LayoutTests/ChangeLog:10
>> +        not always output PASS at the end.
> 
> Downside to these changes is that now it will only report a single failure. The ideal version would report all the failures to help the person who broke things get an overview of what’s wrong.

You are right, my new version only reports the "success" message if there was no fail call at all.
Comment 7 EWS 2020-08-24 05:29:29 PDT
Committed r266054: <https://trac.webkit.org/changeset/266054>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407093 [details].
Comment 8 Radar WebKit Bug Importer 2020-08-24 05:30:24 PDT
<rdar://problem/67674892>