Bug 145446 - Web Inspector: Last selected DOM node loses focus after reload
Summary: Web Inspector: Last selected DOM node loses focus after reload
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 144231
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-28 15:29 PDT by Matt Baker
Modified: 2017-10-06 09:26 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2015-05-28 15:29:55 PDT
* SUMMARY
Last selected DOM node loses focus after reload. Node is correctly reselected in the DOM tree, but selection uses unfocused style (gray background).

* STEPS TO REPRODUCE
1. Inspect element
2. Elements tab shows selected and focused DOM node.
3. Reload page.
  => Node is reselected but not focused. Quick console has the focus.

* NOTES
Occurred during move to tab UI:
http://trac.webkit.org/log/trunk/?rev=183335&stop_rev=183323
Comment 1 Radar WebKit Bug Importer 2015-05-28 15:30:07 PDT
<rdar://problem/21149327>
Comment 2 Matt Baker 2015-05-28 20:09:33 PDT
This isn't a regression after all. When the navigation sidebar is visible in the Elements tab, the previously selected item in the tree outline is restored on page reload, stealing the focus from the console prompt.

By the time the previously selected DOM node is restored, the prompt no longer has the focus, and the selected node can be given the focus instead:

DOMTreeContentView.js: 340: selectAndRevealDOMNode(nodeToFocus, WebInspector.isConsoleFocused());

When the navigation sidebar is closed the prompt is never blurred.
Comment 3 Matt Baker 2015-05-29 12:25:37 PDT
(In reply to comment #2)
> This isn't a regression after all. When the navigation sidebar is visible in
> the Elements tab, the previously selected item in the tree outline is
> restored on page reload, stealing the focus from the console prompt.

This scenario could only occur prior to the tab UI, when viewing the DOM tree for a resource. As the Elements tab lacks a navigation sidebar, the focus will always be set to the console prompt after reloading the page.

Maybe we should persist the focus state of the console prompt. If the prompt had the focus prior to reloading the page, the expectation is that the focus will be restored after the view refreshes.
Comment 4 Devin Rousso 2016-09-05 20:50:13 PDT
Is this still an issue?  It seems to be working fine for me.