Bug 107109

Summary: Web Inspector: Search shortcut clears the current search box contents
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: Web Inspector (Deprecated)Assignee: Vivek Galatage <vivek.vg>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, keishi, loislo, pfeldman, pmuellr, vivek.vg, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Alexander Pavlov (apavlov) 2013-01-17 02:54:58 PST
Steps to reproduce (on Mac):

1. Open a source in the Sources panel (e.g. JavaScript)
2. Hit Cmd-F and type a substring that is found in the open resource, press Enter. A match is highlighted.
3. Hit Cmd-F once again.

This should be a no-op, but instead, the search box contents are cleared and replaced by the "Find" placeholder
Comment 1 Vivek Galatage 2013-01-17 20:52:59 PST
Created attachment 183361 [details]
Patch
Comment 2 Pavel Feldman 2013-01-17 21:11:28 PST
Comment on attachment 183361 [details]
Patch

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

> Source/WebCore/inspector/front-end/SearchController.js:253
> +        if (selection.rangeCount) {

I think you should first check for WebInspector.currentFocusElement() !== this._searchInputElemen and only if that is true, grap the window.getSelection().
Comment 3 Vivek Galatage 2013-01-17 21:22:31 PST
Comment on attachment 183361 [details]
Patch

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

>> Source/WebCore/inspector/front-end/SearchController.js:253
>> +        if (selection.rangeCount) {
> 
> I think you should first check for WebInspector.currentFocusElement() !== this._searchInputElemen and only if that is true, grap the window.getSelection().

oh yeah sure. Will upload a new patch. Thank you!
Comment 4 Vivek Galatage 2013-01-17 21:24:32 PST
Created attachment 183369 [details]
Patch
Comment 5 Vivek Galatage 2013-01-18 01:01:20 PST
Comment on attachment 183369 [details]
Patch

Thank you!
Comment 6 WebKit Review Bot 2013-01-18 01:30:51 PST
Comment on attachment 183369 [details]
Patch

Clearing flags on attachment: 183369

Committed r140109: <http://trac.webkit.org/changeset/140109>
Comment 7 WebKit Review Bot 2013-01-18 01:30:55 PST
All reviewed patches have been landed.  Closing bug.