Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 08a1f39. rdar://122924275
Fix Web Inspector: Remember the message type selection in the Console tab rdar://122924275 https://bugs.webkit.org/show_bug.cgi?id=268882 Reviewed by Devin Rousso. When showing the the inspector's console using `WI.showConsole()`, the caller can optionally pass in a `requestedScope` to control which levels (AKA message types) to be filtered automatically when the Console tab shows up. However, when `requestedScope` is falsy or left empty, it always applies `WI.LogContentView.Scopes.All` instead, which overrides the levels selected by default, which are read from local settings when the scope bar is created at the inspector's startup. This commit removes the forced application of `Scopes.All`, so when `requestedScope` is left empty, the Console tab is shown with levels unchanged, which is the expected behavior when launching the Console tab through Develop -> Show JavaScript Console (or Option-Command-C). This fix has one known side-effect: when an inspector tab does not support split console view, pressing Esc will switch to the actual Console tab instead. (The Settings tab is one example of such tab.) This commit will make that also "remember" the previously selected levels instead of deselecting back to just `Scopes.All`, which is arguably the correct behavior anyway. This commit also cleans up on how `requestedScope` gets passed in; passing in as part of the `options` parameter allows callers of `showConsole()` to self-document the usage `requestedScope`. * Source/WebInspectorUI/UserInterface/Base/Main.js: - Fix the bug. - Adapt to the clean up for the `options` parameter. * Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js: (InspectorFrontendAPI.showConsole): - Adapt to the clean up for the `options` parameter. * Source/WebInspectorUI/UserInterface/Views/LogContentView.js: (WI.LogContentView.prototype._showConsoleTab): - Adapt to the clean up for the `options` parameter. Canonical link: https://commits.webkit.org/275143@main
- Loading branch information