Bug 151530

Summary: Web Inspector: Spacebar to toggle Timeline recording doesn't work in Timeline tab after reloading the page
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix timothy: review+

Description Joseph Pecoraro 2015-11-20 17:04:57 PST
* SUMMARY
Spacebar to toggle Timeline recording doesn't work in Timeline tab after reloading the page.

* STEPS TO REPRODUCE
1. Inspect this page
2. Show Timelines Tab
3. Cmd+R to reload the page
4. Spacebar to try to toggle start/stop recording
  => Doesn't work because quick console is focused and this is just inputing spaces

* NOTES
- Apparently we are focusing the QuickConsole as a result of clearing the log on reload
CONSOLE LOG CM.focus()
CONSOLE TRACE
0: focus(External/CodeMirror/codemirror.js:1357:22)
1: focus(External/CodeMirror/codemirror.js:4843:63)
2: focus(Views/ConsolePrompt.js:115:31)
3: clear(Controllers/JavaScriptLogViewController.js:84:26)
4: _logCleared(Views/LogContentView.js:643:38)
5: dispatch(Base/Object.js:155:55)
6: dispatchEventToListeners(Base/Object.js:162:17)
7: _delayedMessagesCleared(Controllers/LogManager.js:85:38)
8: _delayedMessagesCleared([native code])

- Apparently this means that if the inspected page does `console.clear` the inspector frontend will suddenly focus the Quick Console. lol!
- Some users might be used to a Reload focusing the console. We may need to tweak behavior.
Comment 1 Radar WebKit Bug Importer 2015-11-20 17:05:17 PST
<rdar://problem/23639291>
Comment 2 Joseph Pecoraro 2015-11-20 17:11:21 PST
Created attachment 266021 [details]
[PATCH] Proposed Fix

I haven't lived on this much yet. We may want to tweak this.

Some ideas:
- Maybe Clicking Console Nav Bar's Clear Log button should focus the console
- Maybe reload on tabs that support split content (WebInspector.doesCurrentTabSupportSplitContentBrowser()) should focus the console
Comment 3 Joseph Pecoraro 2015-12-01 13:57:00 PST
<http://trac.webkit.org/changeset/192908>