Bug 39237 - Web Inspector: keyboard shortcut screen does not disappear on Esc.
Summary: Web Inspector: keyboard shortcut screen does not disappear on Esc.
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: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-17 14:31 PDT by Pavel Feldman
Modified: 2010-05-19 21:37 PDT (History)
5 users (show)

See Also:


Attachments
patch: maintain focus on help screen while it's shown (2.48 KB, patch)
2010-05-18 08:23 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2010-05-17 14:31:43 PDT
- Open inspector in docked mode
- Press ? to show the screen
- Undock inspector
- Press Esc

Actual: console is being opened. (Observed on Chromium ToT).
Comment 1 Andrey Kosyakov 2010-05-18 08:23:55 PDT
Created attachment 56377 [details]
patch: maintain focus on help screen while it's shown

This is obviously because we loose focus. I fixed it, but there are some caveats:
- It doesn't work vice-versa (when transitioning for undocked to docked state), as entire inspector window gets out of focus. One would need to click it to get it focused again. This should probably be fixed in the browsers.
- Text edit fields commit edited changes upon loosing focus. I hesitated whether we should disable our help when inspector is in editing mode, but then realized we only use shortcuts that would cause browser help to be opened, so we'll loose editor focus and commit changes anyway.
Comment 2 Timothy Hatcher 2010-05-18 08:28:27 PDT
Comment on attachment 56377 [details]
patch: maintain focus on help screen while it's shown

WebCore/inspector/front-end/HelpScreen.js:44
 +      this.contentElement.addEventListener("blur", this._onBlur.bind(this), false);
You should register this in show and _hide so there isn't always a listener, even if help is never used.

WebCore/inspector/front-end/HelpScreen.js:87
 +          if (this._isShown)
Then you wouldn't need to check this, since you know it was visible or your wouldn't have been called.

Otherwise r+.
Comment 3 Andrey Kosyakov 2010-05-18 08:46:33 PDT
(In reply to comment #2)
> (From update of attachment 56377 [details])
> WebCore/inspector/front-end/HelpScreen.js:44
>  +      this.contentElement.addEventListener("blur", this._onBlur.bind(this), false);
> You should register this in show and _hide so there isn't always a listener, even if help is never used.

HelpScreen is created lazily, so if help is never used, to HelpScreen() is never called in the first place, and there won't be a listener. If help has been used, having a listener on the event that's not fired is probably cheaper than removing it?
Comment 4 WebKit Commit Bot 2010-05-19 21:37:15 PDT
Comment on attachment 56377 [details]
patch: maintain focus on help screen while it's shown

Clearing flags on attachment: 56377

Committed r59816: <http://trac.webkit.org/changeset/59816>
Comment 5 WebKit Commit Bot 2010-05-19 21:37:20 PDT
All reviewed patches have been landed.  Closing bug.