Bug 107109 - Web Inspector: Search shortcut clears the current search box contents
Summary: Web Inspector: Search shortcut clears the current search box contents
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Vivek Galatage
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-17 02:54 PST by Alexander Pavlov (apavlov)
Modified: 2013-01-18 01:30 PST (History)
10 users (show)

See Also:


Attachments
Patch (1.76 KB, patch)
2013-01-17 20:52 PST, Vivek Galatage
no flags Details | Formatted Diff | Diff
Patch (1.90 KB, patch)
2013-01-17 21:24 PST, Vivek Galatage
no flags Details | Formatted Diff | Diff

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