Web Inspector: ⌘E and ⌘G do not work in main content area when quick console drawer...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Sep 2017 19:46:38 +0000 (19:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Sep 2017 19:46:38 +0000 (19:46 +0000)
commit352054016b66507474f0f7d70cc7e3582e032700
treedacbff082418baf2e47c8de9d2262ed11aa5bb7d
parentc4776938ddc21085cad0da47b32bb8525debec71
Web Inspector: ⌘E and ⌘G do not work in main content area when quick console drawer is open
https://bugs.webkit.org/show_bug.cgi?id=176433

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-09-06
Reviewed by Brian Burg.

Make the ⌘E and ⌘G keyboard shortcuts behave more like the global ⌘K clear shortcut.
Instead of keeping them inside of FindBanner, and enabling/disabling them when they
make sense to apply, we make a single global instance of the keyboard shortcut and
apply it to whatever content view / content browser is active. This avoids conflicts
in situations where there are two ContentViews that are visible and each can handle
the keyboard shortcut.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
New keyboard shortcuts.

(WI._populateFind):
(WI._findNext):
(WI._findPrevious):
Perform the shortcut on the active content view or content browser.

* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype.shown):
(WI.ContentBrowser.prototype.hidden):
(WI.ContentBrowser.prototype.handlePopulateFindShortcut):
(WI.ContentBrowser.prototype.handleFindNextShortcut):
(WI.ContentBrowser.prototype.handleFindPreviousShortcut):
(WI.ContentBrowser.prototype.findBannerSearchQueryForSelection): Deleted.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.handlePopulateFindShortcut):
(WI.LogContentView.prototype.handleFindNextShortcut):
(WI.LogContentView.prototype.handleFindPreviousShortcut):
ContentBrowser and LogContentView (the only content view with a custom find banner)
now each handle the global keyboard shortcut handlers to do the right thing for
their respective cases.

* UserInterface/Views/FindBanner.js:
(WI.FindBanner.prototype.enableKeyboardShortcuts): Deleted.
(WI.FindBanner.prototype.disableKeyboardShortcuts): Deleted.
(WI.FindBanner.prototype._populateSearchQueryFromSelection): Deleted.
Move keyboard shortcut handling up to Main.js to be global.

* UserInterface/Views/ContentView.js:
(WI.ContentView.prototype.searchQueryWithSelection):
Default implementation should grab the selected text from the selection.
Previously shortcut selections only worked for selections in text editors.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js
Source/WebInspectorUI/UserInterface/Views/ContentView.js
Source/WebInspectorUI/UserInterface/Views/FindBanner.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js