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

Bug 454946

Summary: [CSS] CSS Validator has incorrect problem ranges
Product: [ECD] Orion Reporter: Curtis Windatt <curtis.windatt.public>
Component: ClientAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Curtis Windatt CLA 2014-12-11 16:33:08 EST
This likely applies to many rules, but take zero-units:

rule {
border : 0px;
}

Here csslint reports back the correct line (2) and col (11) for the start of the problem.  However, it does not provide an end or length.  So instead we use the evidence string length.  However, sometimes, such as in this example, the evidence string contains content from before the start location (in this case it returns the entire line).

This means that the annotation will be marked past where it should stop, likely to the end of the line.  It also means that finding the problem for testing is difficult.
Comment 1 Curtis Windatt CLA 2014-12-15 16:51:26 EST
This is a known problem with CSS Lint.

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=05756a7e79ea6f9806f30f9f8cac99d87be3212e
I added a token finder function to the validator.  I also fixed up all of our quickfixes and the tests as well to handle the new ranges.  For parsing errors we select the whole line.