Summary: | Web Inspector: Keep DOM tree expanded on page reload | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ben Frain <contact> | ||||||
Component: | Web Inspector | Assignee: | Antoine Quint <graouts> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, graouts, joepeck, timothy, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Ben Frain
2013-09-20 02:32:43 PDT
Created attachment 212707 [details]
Testcase
The attached test case shows that if you inspect the black rectangle, which is <div> nested 10 levels deep, and hit reload, we more often than not expand to the same place in the tree again. However, there are cases when we do not. Trying the same thing in the Chrome inspector seems to work a lot more reliably.
Created attachment 212711 [details]
Patch
Attached patch seems to work well with pages I've tested (apple.com, store.apple.com, lemonde.fr) but doesn't work for pages where the selected content had been generated by script, which also fails in the Chrome Web Inspector. I think this patch brings us to parity with Chrome. Comment on attachment 212711 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=212711&action=review > Source/WebInspectorUI/UserInterface/DOMTreeContentView.js:-300 > - // A selection was made while waiting for the async reply. Just bail now. > - if (this._domTreeOutline.selectedTreeElement) > - return; I think this will regress a rarer scenario (the reason this code was originally added). However, I think we should take this patch, which improves a very common case, and we should address the rare scenario in a different way. I would guess the scenario this breaks is: 1. Inspect for apple.com 2. Inspect the inspector (aim to inspect element something deep in the tree, like a deeply nested DOM node in the DOM tree) 3. When inspector² opens, quickly select something else in the DOM tree, like the Quick Console node => after a few beats, the DOM Tree will switch to show the originally selected "inspect element" node I think we would want to do something like this bail only if "a <em>user</em> selection was made while waiting for the async reply". The principal reason this came to my attention was inspecting the iOS simulator. Viewing and inspecting any web page there causes this issue. Comment on attachment 212711 [details] Patch Clearing flags on attachment: 212711 Committed r156481: <http://trac.webkit.org/changeset/156481> All reviewed patches have been landed. Closing bug. |