Bug 147536

Summary: Web Inspector: Existing text after completions do not have their completion style removed once hint is applied
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
[Image] “= "10px"” should not be opaque
none
Patch none

Description Devin Rousso 2015-08-02 00:04:33 PDT
* STEPS TO REPRODUCE:
1. Open the Console tab and paste the following into the prompt:

document.body.style.margin = "10px";

2. Highlight "margin" and delete it
3. Press Escape to open the autocomplete, find margin, and press enter/click on it

Expected:
The styling of " = "10px"" would at first be slightly opaque (when the completion hint is shown) but revert to the original styling once the completion is applied.

Actual:
After the completion is applied the opacity remains the same.
Comment 1 Devin Rousso 2015-08-02 00:06:55 PDT
Created attachment 258025 [details]
Patch
Comment 2 Nikita Vasilyev 2015-08-03 11:09:54 PDT
Created attachment 258083 [details]
[Image] “= "10px"” should not be opaque

(In reply to comment #0)
> * STEPS TO REPRODUCE:
> 1. Open the Console tab and paste the following into the prompt:
> 
> document.body.style.margin = "10px";
> 
> 2. Highlight "margin" and delete it
> 3. Press Escape to open the autocomplete, find margin, and press enter/click
> on it
> 
> Expected:
> The styling of " = "10px"" would at first be slightly opaque (when the
> completion hint is shown) but revert to the original styling once the
> completion is applied.
> 

“= "10px"” should not be opaque at all since it isn't a part of the autocomplete hint. This a recent regression, possibly from "Web Inspector: Autocomplete: Undo (Cmd+Z) doesn't work as expected" https://bugs.webkit.org/show_bug.cgi?id=147316?
Comment 3 Devin Rousso 2015-08-03 23:14:55 PDT
Created attachment 258158 [details]
Patch
Comment 4 Nikita Vasilyev 2015-08-03 23:54:43 PDT
Looks good to me!
Comment 5 Nikita Vasilyev 2015-08-03 23:55:57 PDT
Comment on attachment 258158 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258158&action=review

> Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css:27
> +    text-decoration: none !important;

Why is this needed?
Comment 6 Devin Rousso 2015-08-04 13:09:20 PDT
(In reply to comment #5)
> > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.css:27
> > +    text-decoration: none !important;
> 
> Why is this needed?

In the styles sidebar, any text in a nested span that doesn't have a CSS property/value/atom/keyword classname is given a strikethrough.

In CSSStyleDeclarationTextEditor.css:
.css-style-text-editor > .CodeMirror .CodeMirror-lines pre > span span:not(.css-style-declaration-property, .CodeMirror-widget, .cm-comment, .cm-tab)
Comment 7 WebKit Commit Bot 2015-08-04 15:48:55 PDT
Comment on attachment 258158 [details]
Patch

Clearing flags on attachment: 258158

Committed r187902: <http://trac.webkit.org/changeset/187902>
Comment 8 WebKit Commit Bot 2015-08-04 15:48:58 PDT
All reviewed patches have been landed.  Closing bug.