Bug 215757 - Make window.find not default the search string to undefined
Summary: Make window.find not default the search string to undefined
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-23 06:18 PDT by Rob Buis
Modified: 2020-08-24 05:30 PDT (History)
6 users (show)

See Also:


Attachments
Patch (7.04 KB, patch)
2020-08-23 06:21 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.58 KB, patch)
2020-08-23 06:23 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (4.17 KB, patch)
2020-08-24 02:04 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (4.23 KB, patch)
2020-08-24 02:42 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>