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 207080 - Insufficient CSS parser error recovery
Summary: Insufficient CSS parser error recovery
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Visual Tools (show other bugs)
Version: 7.1
Hardware: PC Windows 7
: P1 normal with 1 vote (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-09 17:59 UTC by shuklasp
Modified: 2012-02-14 08:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shuklasp 2012-01-09 17:59:59 UTC
Product Version = NetBeans IDE 7.1 (Build 201112071828)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.0-b11

Stylebuilder is not showing any predifined and hence code completion is also not working for css.
Comment 1 shuklasp 2012-01-10 07:45:05 UTC
Stylebuilder is not showing any predifined styles and hence code completion is also not working for css.
Comment 2 shuklasp 2012-01-13 23:43:29 UTC
This defect renders the stylebuilder useless in NB 7.1! So this needs to fixed at a priority!
Comment 3 shuklasp 2012-01-15 04:59:04 UTC
Raising the priority. This issue needs to be fixed on an urgent basis as this is making one feature of IDE practically unusable!
Comment 4 Marek Fukala 2012-01-16 14:24:19 UTC
>"Stylebuilder is not showing any predifined styles" 
can you please elaborate this a bit? What do you mean?

"Stylebuilder is not showing any predifined styles and hence code completion is
also not working for css."
There's no relation between the SB and code completion so I assume you are talking about editing a source which is not properly parsed so most of the features like coloring, completion and the SB don't work.

In such case I need to look at the edited file itself or I need a code sample to be able to reproduce.

Thank you in advance.
Comment 5 shuklasp 2012-01-16 15:14:56 UTC
There was a syntax error on one line of css file. Due to this, all the selectors and code after that line was not being highlighted and code completion was also not working. But this should not be the case. It should ignore the error line and work for rest of the selectors.
Comment 6 Marek Fukala 2012-01-16 15:26:15 UTC
Thank you for the confirmation. Now please add a sample code which causes such unrecoverable parsing error.
Comment 7 shuklasp 2012-01-17 00:13:27 UTC
h1 {color:#ee1b6a; font-size:14px; margin:0; padding; 0px 0px 3px 0px;}

This code causes the issue! There is an error in this code. Instead of colon, a semi-colon has been put inadvertendly. This line shows an error an lines after this code are not parsed properly.
Comment 8 lemon_juice 2012-02-09 13:21:00 UTC
I confirm this bug exists as of 7.1 and should be corrected. Sometimes we need to introduce css hacks for IE which are in fact invalid css declarations, so Netbeans should allow that. Example:

#wrapper {
	position: relative;
	width: 980px;
	margin: 0 auto;
	min-height: 100%;
	height: auto !important;
	height: 100%;
	#z-index: 200;  /* For IE7 z-index bug */
}

#header {
	height: 96px;
	min-width: 980px;
	position: relative;
	background: url('../images/header-bg.png') white bottom repeat-x;
	border-bottom: 1px solid #CDCDCD;
}

Anything below #z-index: 200; loses syntax highlighting and the navigator is blind to that content, too. This worked fine in netbeans 7.

It's great that an error is highlighted but it shouldn't stop parsing the rest of the document.
Comment 9 lemon_juice 2012-02-09 13:36:38 UTC
I should point out that in my example above the bug is triggered when the #z-index line is followed by spaces and a comment. Without the comment there is no problem. But even if I don't use any comments and I change the order of lines some problems appear, however less serious:

#wrapper {
    position: relative;
    width: 980px;
    margin: 0 auto;
    min-height: 100%;
    #z-index: 200;
    height: auto !important;
    height: 100%;
}

#header {
    height: 96px;
    min-width: 980px;
    position: relative;
    background: url('../images/header-bg.png') white bottom repeat-x;
    border-bottom: 1px solid #CDCDCD;
}

Here the two lines after #z-index get wrong highlighting and the #header line is also highlighted improperly. But all the code that follows is highlighted well.

I also confirm that the code by shuklasp triggers the bug in the serious way - turns off highlighting of all the code below.
Comment 10 Marek Fukala 2012-02-09 14:26:19 UTC
fixed in web-main#4491e3506ec0 (for the listed cases (error in s rule)
Comment 11 Marek Fukala 2012-02-10 10:17:38 UTC
the code samples from this issue related to the problem works fine. verifying so I can put it into 7.1patch (Feb 13th deadline)
Comment 12 Marek Fukala 2012-02-10 15:48:04 UTC
transplanted into releases/release71_fixes#9e26ed212bbd
Comment 13 Quality Engineering 2012-02-11 02:51:49 UTC
Integrated into 'releases', will be available in build *201202102200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/9e26ed212bbd
User: Marek Fukala <mfukala@netbeans.org>
Log: #207080 - Insufficient CSS parser error recovery
Comment 14 Vladimir Riha 2012-02-14 08:29:45 UTC
verified 7.1.1

Product Version: NetBeans IDE 7.1.1 RC1 (Build 201202132200)