# STEPS TO REPRODUCE: 1. inspect any page 2. go to the Audit Tab 3. run any audit 4. select any audit 5. keep pressing ↓ to eventually select the Results folder => folder isn't actually selected, but instead a focus outline can be seen 6. press ↓ again => selection jumps to the first item in the list
<rdar://problem/60108942>
A combination of a couple of odd things cause this bug. _dispatchSelectionDidChangeEvent gets called twice. First time from SelectionController: _dispatchSelectionDidChangeEvent (TreeOutline.js:1131) selectionControllerSelectionDidChange (TreeOutline.js:811) _updateSelectedItems (SelectionController.js:392) selectItem (SelectionController.js:97) _selectItemsFromArrowKey (SelectionController.js:334) handleKeyDown (SelectionController.js:229) _treeKeyDown (TreeOutline.js:669) _treeKeyDown Second time directly from TreeOutline: _dispatchSelectionDidChangeEvent (TreeOutline.js:1131) selectTreeElementInternal (TreeOutline.js:897) select (TreeElement.js:542) _treeKeyDown (TreeOutline.js:682) _treeKeyDown The second call results in ContentViewContainer.prototype.showDefaultContentView: showDefaultContentView (AuditNavigationSidebarPanel.js:71) _treeSelectionDidChange (AuditNavigationSidebarPanel.js:287) dispatch (Object.js:165) dispatchEventToListeners (Object.js:172) _dispatchSelectionDidChangeEvent (TreeOutline.js:1139) selectTreeElementInternal (TreeOutline.js:897) select (TreeElement.js:542) _treeKeyDown (TreeOutline.js:682) _treeKeyDown Which resets treeElement selection. Thus this bug happens.
This didn't regress with r257380.
This broken more than 6 weeks ago. My recent AXI changes had nothing to do with it. Works in r255037 Broken in r252338 http://trac.webkit.org/log/trunk/?mode=follow_copy&rev=255037&stop_rev=252338 A lot of builds in this range are broken so I'm stopping bisecting for now.
This broke in Bug 205435 - Web Inspector: Audit: exiting edit mode with the same selection as before entering edit mode doesn't reselect https://trac.webkit.org/changeset/253759/webkit
Created attachment 392743 [details] Patch
Comment on attachment 392743 [details] Patch I think it's fine to duct tape this for now. Ultimately, when allowsRepeatSelection is true, WI.TreeOutline.Event.SelectionDidChange shouldn't fire twice when selection only changes once.
Comment on attachment 392743 [details] Patch Clearing flags on attachment: 392743 Committed r258246: <https://trac.webkit.org/changeset/258246>
All reviewed patches have been landed. Closing bug.