Summary: | Regression: Web Inspector: Sometimes in Elements panel two elements showed as selected at the same time | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> | ||||||
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bburg, commit-queue, graouts, joepeck, lance, mattbaker, nvasilyev, timothy, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Local Build | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
It's started happening for me a couple of months ago. Possibly a regression. Were there exceptions in the inspector? (In reply to comment #3) > Were there exceptions in the inspector? No. I recently observed this exception: Assertion Failed markAsNeedsRefresh — StyleDetailsPanel.js:85 visibilityDidChange — CSSStyleDetailsSidebarPanel.js:148 removeSidebarPanel — Sidebar.js:98 showDetailsSidebarPanels — ContentBrowserTabContentView.js:168 dispatch — Object.js:151 dispatchEventToListeners — Object.js:158 _dispatchCurrentRepresentedObjectsDidChangeEvent — ContentBrowser.js:437 That is an assert, not an exception. So it wouldn't cause random breakage. We should file a separate bug for that. * SUMMARY Regression produced by r187496. * TEST <body> <div> <p>Test</p> <p>Test</p> <p>Test</p> <p>Test</p> <button id="start">Start</button> <button id="stop">Stop</button> </div> <script> setInterval(function() { var elem = document.body.appendChild(document.createElement("div")); elem.style.cssText = "width: 100px; height: 100px; background: blue"; setTimeout(function() { document.body.removeChild(elem); }, 0); }, 500); </script> * STEPS TO REPRODUCE 1. Inspect a <p> on the test page 2. Click the other <p> tags => multiple selections left over * NOTES - The TreeOutline loses the selectedTreeElement, but the inner selected TreeElement still sees itself as selected... Created attachment 270913 [details] [PATCH] Proposed Fix This fixes the issue, and keyboard navigation within the DOM Tree gets fixed as well (previously when this was happened the tree would lose focus). However I'm marking as cq- because I still fail to see how this was caused by r187496, which means there is something I don't yet fully understand here, so I want to investigate this a bit more. > However I'm marking as cq- because I still fail to see how this was caused > by r187496, which means there is something I don't yet fully understand > here, so I want to investigate this a bit more. I now understand! The same optimization that I'm adding to moveChild(...) effectively happened before. While iterating over the child list the old code would skip over tree elements in the correct place: > while (child) { > var currentTreeElement = treeElement.children[treeChildIndex]; > if (!currentTreeElement || currentTreeElement.representedObject !== child) { > ... > } > ... > } Basically we now do that first check in moveChild(...). The old code could presumably have a bug that this addresses with the correct selecting. Either way, I'm now confident that this can land. Comment on attachment 270913 [details] [PATCH] Proposed Fix Clearing flags on attachment: 270913 Committed r196362: <http://trac.webkit.org/changeset/196362> All reviewed patches have been landed. Closing bug. *** Bug 154645 has been marked as a duplicate of this bug. *** |
Created attachment 262321 [details] [Animated GIF] Bug See the attached GIF. So far I was unable to find exact steps to reproduce the problem.