Bug 147975

Summary: REGRESSION: Web Inspector: Autocomplete sometimes requires two tab presses
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: graouts, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=147720
https://bugs.webkit.org/show_bug.cgi?id=147316
https://bugs.webkit.org/show_bug.cgi?id=150493

Description Nikita Vasilyev 2015-08-13 06:07:54 PDT
Steps:
1. Type "document.body.fir" in the console
2. Press Tab

Expected:
"fir" is replaced with "first", the least common prefix.

              firstElementChild
              firstChild
document.body.first|

Actual:
Nothing happens on first Tab press

              firstElementChild
              firstChild
document.body.fir|
Comment 1 Devin Rousso 2015-08-13 10:39:00 PDT
This is a regression from https://bugs.webkit.org/show_bug.cgi?id=147316.
Comment 2 David Kilzer (:ddkilzer) 2016-09-09 11:20:20 PDT
<rdar://problem/28228742>
Comment 3 Devin Rousso 2016-09-10 23:39:51 PDT
This is actually regular behavior.  The issue is that r187708 <webkit.org/b/147316> changed the logic for adding autocompletion hints from using CodeMirror.replaceRange to CodeMirror.setUniqueBookmark.  What this means is that when you hit tab on "document.body.fir|", it will complete to "document.body.first|", but since it uses CodeMirror.setUniqueBookmark (that we fully control styling over), the added text isn't committed (which means it doesn't get syntax highlighting and doesn't effect the current text in any way).  Using CodeMirror.replaceRange caused the text of the CodeMirror instance to change, which triggered a change to the stylesheet itself (which is also why r191419 <webkit.org/b/147720> was filed), which then updated CodeMirror and the syntax highlighting, causing you to see that the "st" after "document.body.fir|" changed colors (meaning it was autocompleted).  This should be fixed by <webkit.org/b/150493>.
Comment 4 Devin Rousso 2016-09-10 23:41:49 PDT
(In reply to comment #3)
Oops...  Guess the link highlighting doesn't work without a scheme.

> r187708 <webkit.org/b/147316>

https://webkit.org/b/147316


> r191419 <webkit.org/b/147720>

https://webkit.org/b/147720


> <webkit.org/b/150493>

https://webkit.org/b/150493
Comment 5 Nikita Vasilyev 2017-10-14 12:48:39 PDT
Fixed in the new styles sidebar:
Bug 177313 - Web Inspector: Styles Redesign: hook up autocompletion to property names and values