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

Bug 243838

Summary: JSPedCSSSourceParser problem while parsing tags like c:if
Product: [WebTools] WTP Source Editing Reporter: Gaurav Mising name <gaurav.bhattacharjee>
Component: jst.jspAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED INVALID QA Contact: Nitin Dahyabhai <thatnitind>
Severity: major    
Priority: P3 CC: chprakas, david_williams, gaurav.bhattacharjee, jatin.varshney, nsand.dev, saurabhagarwal
Version: 3.0Keywords: helpwanted
Target Milestone: 3.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Contains a Dynamic web project none

Description Gaurav Mising name CLA 2008-08-12 01:02:02 EDT
Created attachment 109748 [details]
Contains a Dynamic web project

Build ID: 3.4.0

Steps To Reproduce:
The attached zip(web_project.zip) contains a dynamic web project.
Open the file styes.jsp (which is being referenced as a css file from check.jsp). styles.jsp is being used to apply backround color to check.jsp.


CASE1: When c:if tag is after background-color
body {
             background-color: red;

                <c:if test="check">
                    border-bottom: green ;
                 </c:if>
             }

In this case it is working fine[It is able to apply backgound color].
but if you swap background color as shown below in CASE2. It stops working.

CASE2:
body {
             <c:if test="check">
                    border-bottom: green ;
                 </c:if>
                background-color: lime;
             }


The problem is in CSSStructuredDocumentReparser.java file where it is not
parsing correctly.Parser only considers node when it gets ";" character
(semicolon).

It is working fine in the CASE1 shown above because it is able to parse 
background-color: red when it gets ";" and considers it as one node.

In CASE2 it is not able to parse the background color so it considers  

<c:if test="check"> border-bottom: green  as a one node and 

</c:if> background-color: red  as a second node.Instead of this it should be
able to parse this as a background-color: red for applying styles.


CASE3:
body {

        <c:if test="check">
                    border-bottom: green ;
                 </c:if> ;

       background-color: red;

             }


If you add ";" in front of </c:if> [as case3]it will start working.Because now
it will consider 
<c:if test="check"> border-bottom: green [one node] 
</c:if> [second node]
background-color: red [third node] // it will apply styles to current file


This defect is blocking some of the RAD's functionalities. Would appreciate if this gets fixed ASAP.

Similar sort of bug was fixed recently. The bug id is 236008(https://bugs.eclipse.org/bugs/show_bug.cgi?id=236008) 

More information:
Comment 1 Nitin Dahyabhai CLA 2009-04-22 23:09:40 EDT
Will consider it for 3.2, unless we get a high quality patch, in which case we'll look at earlier inclusion.
Comment 2 Nick Sandonato CLA 2009-10-15 09:32:25 EDT
After discussing with the reporter, this bug is being resolved as working as designed.