Bug 151237 - Web Inspector: Add a keyboard shortcut to restore the default zoom level
Summary: Web Inspector: Add a keyboard shortcut to restore the default zoom level
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on: 151572
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-12 17:11 PST by Nikita Vasilyev
Modified: 2015-12-01 11:52 PST (History)
8 users (show)

See Also:


Attachments
Proposed Fix (2.54 KB, patch)
2015-11-23 14:07 PST, BJ Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2015-11-12 17:11:27 PST
Command +/- in Safari and WebKit Inspector increases and decreases the zoom level respectively.
Command 0 in Safari resets the zoom level.
Command 0 in Web Inspector toggles the left sidebar.
Comment 1 Radar WebKit Bug Importer 2015-11-12 17:12:00 PST
<rdar://problem/23527493>
Comment 2 BJ Burg 2015-11-22 14:28:10 PST
Cmd-0 is bound to show/hide main navigator in Xcode, which is how it got into Inspector. However, I think we should be consistent with Safari and other browsers and use Cmd-0 to reset the zoom level. Safari uses Cmd-Shift-L to toggle the left sidebar, I'm fine with that. Would probably want Cmd-Shift-R for the right sidebar, then.
Comment 3 Nikita Vasilyev 2015-11-23 13:39:22 PST
(In reply to comment #2)
> Cmd-0 is bound to show/hide main navigator in Xcode, which is how it got
> into Inspector. However, I think we should be consistent with Safari and
> other browsers and use Cmd-0 to reset the zoom level. Safari uses
> Cmd-Shift-L to toggle the left sidebar, I'm fine with that. Would probably
> want Cmd-Shift-R for the right sidebar, then.

Cmd-Shift-R already reloads ignoring cache in Web Inspector and Chrome.
https://www.webkit.org/blog-files/web-inspector-keyboard-shortcuts/tooltips.gif
Comment 4 BJ Burg 2015-11-23 14:07:37 PST
Created attachment 266099 [details]
Proposed Fix
Comment 5 BJ Burg 2015-11-23 15:40:26 PST
(In reply to comment #3)
> (In reply to comment #2)
> > Cmd-0 is bound to show/hide main navigator in Xcode, which is how it got
> > into Inspector. However, I think we should be consistent with Safari and
> > other browsers and use Cmd-0 to reset the zoom level. Safari uses
> > Cmd-Shift-L to toggle the left sidebar, I'm fine with that. Would probably
> > want Cmd-Shift-R for the right sidebar, then.
> 
> Cmd-Shift-R already reloads ignoring cache in Web Inspector and Chrome.
> https://www.webkit.org/blog-files/web-inspector-keyboard-shortcuts/tooltips.
> gif

I meant Cmd-Option-{R,L}, sorry.
Comment 6 WebKit Commit Bot 2015-11-23 18:53:36 PST
Comment on attachment 266099 [details]
Proposed Fix

Clearing flags on attachment: 266099

Committed r192757: <http://trac.webkit.org/changeset/192757>
Comment 7 WebKit Commit Bot 2015-11-23 18:53:39 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Joseph Pecoraro 2015-12-01 11:52:25 PST
Comment on attachment 266099 [details]
Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Base/Main.js:1851
> +    event.preventDefault();

Is this needed? I think KeyboardShortcut implicitly prevents default by default.