Bug 37579 - Web Inspector: Ctrl-L (Clear Console) does nothing on Windows
Summary: Web Inspector: Ctrl-L (Clear Console) does nothing on Windows
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 09:18 PDT by Alexander Pavlov (apavlov)
Modified: 2010-04-14 11:18 PDT (History)
8 users (show)

See Also:


Attachments
[PATCH] Trivial fix (1.31 KB, patch)
2010-04-14 09:23 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
[PATCH] Comments addressed (1.56 KB, patch)
2010-04-14 10:02 PDT, Alexander Pavlov (apavlov)
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) 2010-04-14 09:18:39 PDT
The console is not cleared on non-Mac platforms when Ctrl-L is hit in the text prompt.
Comment 1 Alexander Pavlov (apavlov) 2010-04-14 09:23:55 PDT
Created attachment 53337 [details]
[PATCH] Trivial fix
Comment 2 Joseph Pecoraro 2010-04-14 09:42:31 PDT
Comment on attachment 53337 [details]
[PATCH] Trivial fix

I don't understand how this fixes Ctrl "L" on Windows.

> 1      var clearConsoleHandler = this.requestClearMessages.bind(this);
> 2 
> 3      shortcut = WebInspector.KeyboardShortcut.makeKey("k", WebInspector.KeyboardShortcut.Modifiers.Meta);
> 4 -    this._shortcuts[shortcut] = clearConsoleHandler;
> 5 +    this._shortcuts[shortcut] = this.requestClearMessages.bind(this);
> 6      this._shortcuts[shortcut].isMacOnly = true;
> 7      shortcut = WebInspector.KeyboardShortcut.makeKey("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl);
> 8      this._shortcuts[shortcut] = clearConsoleHandler;


Line 1 shows that the clearConsoleHandler variable already has the requestClearMessages bound to this already. So the change doesn't appear to do anything. Also, the change is made to the Mac only <Cmd>K clear shortcut, not to the Windows <Ctrl>L part. Is there something I am missing?
Comment 3 Joseph Pecoraro 2010-04-14 09:46:04 PDT
Comment on attachment 53337 [details]
[PATCH] Trivial fix

Ahhhh, I think I got it. The "isMacOnly" property was being set on the shared bound function, and so all other cases (like Windows) see the isMacOnly property and don't run. Thats unfortunate.

r=me if you Provide a comment explaining this (because its tricky). You might even want to reorder the code slightly if that helps make it clearer as well.
Comment 4 Alexander Pavlov (apavlov) 2010-04-14 10:02:34 PDT
Created attachment 53342 [details]
[PATCH] Comments addressed
Comment 5 Joseph Pecoraro 2010-04-14 10:10:25 PDT
Comment on attachment 53342 [details]
[PATCH] Comments addressed

Excellent. Thanks!
Comment 6 WebKit Commit Bot 2010-04-14 11:18:43 PDT
Comment on attachment 53342 [details]
[PATCH] Comments addressed

Clearing flags on attachment: 53342

Committed r57590: <http://trac.webkit.org/changeset/57590>
Comment 7 WebKit Commit Bot 2010-04-14 11:18:50 PDT
All reviewed patches have been landed.  Closing bug.