Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 499683

Summary: CSS tooling shows mis-matched colors based on where you hover...
Product: [ECD] Orion Reporter: Eric Moffatt <emoffatt>
Component: JS ToolsAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Michael_Rennie, Olivier_Thomann
Version: 12.0   
Target Milestone: 13.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
shows different colors
none
Proposed patch none

Description Eric Moffatt CLA 2016-08-15 15:06:56 EDT
Created attachment 263601 [details]
shows different colors

If you hover over the attribute name (i.e. background) but hover over the color you get a different hover color...
Comment 1 Olivier Thomann CLA 2016-08-23 10:39:57 EDT
I'll take a look.
Comment 2 Olivier Thomann CLA 2016-08-23 10:51:37 EDT
When hovering on the background:, you end up getting the default background color. When hovering on #fefefe, you end up getting that color.
I am not sure this is expected. If we expect both colors to be identical, we need to be able to retrieve the next token when hovering on 'background:'.
Comment 3 Olivier Thomann CLA 2016-08-23 10:58:49 EDT
csslinkt.Colors contains the 'background' entry so we try to show that color. It is part of deprecated entries. See https://www.w3.org/TR/css3-color/#css2-system.
So we could check if the "value" is a color format.
Curtis, I'll need your input on this to make sure what the expected behavior is.
Comment 4 Olivier Thomann CLA 2016-08-23 12:01:28 EDT
I think the intention was not to display the color when hovering on the "background:" entry. This was a side-effect on having "background" in the list of deprecated colors from the csslint.Colors collection.
This can be fixed, but then the user won't get a hover when hovering on the color with this entry:
.... {
 background: background;
}

I hope this is fine. The only way to really fix this would be to get an ast for css where we can distinguish both backgrounds (one being the attribute name/key and one being the attribute value).
We only want a hover for the value not the key. Right now the only thing we have is a token which is an identifier token.
Maybe checking the next token can be enough.
Comment 5 Olivier Thomann CLA 2016-08-23 12:13:43 EDT
Created attachment 263729 [details]
Proposed patch
Comment 6 Olivier Thomann CLA 2016-08-23 12:14:17 EDT
I cannot deliver it right now as git is not working on orion.eclipse.org.