Bug 147536 - Web Inspector: Existing text after completions do not have their completion style removed once hint is applied
Summary: Web Inspector: Existing text after completions do not have their completion s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-02 00:04 PDT by Devin Rousso
Modified: 2015-08-04 15:48 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.37 KB, patch)
2015-08-02 00:06 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
[Image] “= "10px"” should not be opaque (21.45 KB, image/png)
2015-08-03 11:09 PDT, Nikita Vasilyev
no flags Details
Patch (3.88 KB, patch)
2015-08-03 23:14 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.