This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 30053

Summary: CSS comments syntax colour highlighting problem
Product: xml Reporter: ats37 <ats37>
Component: CSSAssignee: Marek Fukala <mfukala>
Status: RESOLVED FIXED    
Severity: blocker CC: mmetelka
Priority: P4    
Version: 3.x   
Hardware: PC   
OS: Windows 3.1/NT   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 27350    
Bug Blocks:    

Description ats37 2003-01-14 11:19:29 UTC
According to the CSS 1 specs on w3c.org, "A declaration consists of a property, a colon (:) and a value. Around each of these there may be whitespace."

However, unless the declarations are written in the form "property: value", the syntax colouring doesn't recognize them.  i.e. "font-size: 16px;" will highlight the "font-size:" in blue, but "font-size:16px;" and "font-size : 16px;" both leave it in the default black.
Comment 1 ats37 2003-01-15 15:36:52 UTC
Something else odd I've noticed it doing - in one of the stylesheets I'm editing, there are comment blocks at various points of the form

/*******************************/
/* Comments of various lengths */
/*******************************/

If there is an odd number of asterisks in the comment line, the subsequent style declarations are fine.  However, if there's an even number of asterisks, the subsequent declarations are all displayed in the same grey as the comment, up until the next comment the occurs with an even no. of stars...

Further experimentation showed the same behaviour for comments of the form
/* **/
/* ***/
etc. - if the closing comment has an even no. of *'s, the subsequent lines continue to be displayed in grey.
Comment 2 _ pkuzel 2003-01-23 16:57:57 UTC
CSS lexer is described using JavaCC. See xml/css/**jj in CVS. I'll
check if I can fix it.
Comment 3 _ pkuzel 2003-01-23 19:40:31 UTC
Looked at CSSSynstax.jj and realized that it is a good candidate for
moving to lexer. It saves me from hacks that complicates the grammar.

E.g. comment token description with lexer could be as simple as:
<*>
TOKEN:
{
  <COMMENT: ("<!--" (~[])* "-->") | ("/*" (~[])* "*/")>
}

Well RE is greedy so it does not work for /*......*/....*/
Comment 4 ats37 2003-01-24 11:04:14 UTC
Another thing I've noticed that currently isn't working properly:

/*
 *
 */

With nothing after the '*' in the middle line, it gets displayed in red.  Add a space or some other character after it, and it displays it in grey like the other two lines.
Comment 5 _ pkuzel 2003-02-25 15:10:35 UTC
I have fixed property coloring, leaving the rest for the lexer rework.
Comment 6 Marek Fukala 2007-02-16 14:57:21 UTC
Reassigning all CSS issues to me, I'll transfer them to web/css later
Comment 7 Marek Fukala 2007-09-26 08:17:09 UTC
fixed