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.
<div style="float: left; width: ${param.width}px; height: 18px; background-color: #eee; padding: 3px; padding-left: 10px; padding-top: 8px; font-size: 0.8em; border-bottom: 2px solid rgb(167,163,126);"> Last Updated: <span id="lastUpdated" style="font-size: 1.0em; font-weight: bold;">${param.lastUpdated}</span> Modified By: <span id="modifiedBy" style="font-size: 1.0em; font-weight: bold;">${param.modifiedBy}</span> <div id="messages" style="font-size: 1.0em; display: none; margin-left: 10px;"> <div id="message" style="display: inline; font-size: 1.0em;"></div> <div id="moreDetails" style="display: none;"></div> </div> </div> <div style="clear: both;"></div>
There are two issues: 1) JSP breaks css-internal "css_number" token in: "${param.width}px" - we can change tokenizer (split number and "px") and change grammar It is not a big problem, but I am not sure if this change in grammar is acceptable for your semantic analyser based on Schliemann parser. 2) there is some error token <error,"""> generated for " on the end of html VALUE token that is broken by EL. - looks like some error in html lexer.
and... 3) el token replaces whole content between start and end tag in "<span >${param.modifiedBy}</span>". Looks like html grammar is not able to parse it?
Re #1 - splitting css_number into two tokens - shouldn't be a probme for the CssModel. I am currently not introspecting the content of the value, just using declarationNode.getNode("expr").getAsText(). But I would be grateful if you attach a patch to this issue for review before commiting. Re #2 - " error token - there is a bug in lexer, that the TokenHierarchy.tokenSequenceList(languagePath, startOffset, endOffset) returns token sequences outside of the limited area. I have added a workaround for that and file issue #121045 so the embedding is not created where is shouldn't. However the workaround revealed another problem - the HTML syntax parser doesn't properly handle tag attributes if there is a higher language token inside, so just a part of the attribute is marked as css. I have filed new issue #121046 (HTML SyntaxParser doesn't properly parse if there are higher language tokens inside) and I am going to fix it to 6.0, it is also related to some fix-in-60 issues. Re #3 - I do not understand what you mean, the EL in the mentioned case should be created for the "${param.modifiedBy}" part. Please try to update the EmbeddingUpdater and revalidate, it may be fixed Since I have the issue #121046 I am reassigning this back to you Hanzi to fix #1. Please be aware that if you update the commited fix, you won't be able to work on the #1 since I won't created the embedding behind the EL in the html tag attribute value. Btw, after my fix, I am getting IOOBE on each document parse, please fix that as well. java.lang.IndexOutOfBoundsException: Index: 0 at java.util.Collections$EmptyList.get(Collections.java:2970) at org.netbeans.modules.languages.parser.LLSyntaxAnalyser.join(LLSyntaxAnalyser.java:522) at org.netbeans.modules.languages.parser.LLSyntaxAnalyser.skipEmbedding(LLSyntaxAnalyser.java:499) at org.netbeans.modules.languages.parser.LLSyntaxAnalyser.readEmbeddings(LLSyntaxAnalyser.java:417) at org.netbeans.modules.languages.parser.LLSyntaxAnalyser.read2(LLSyntaxAnalyser.java:336) at org.netbeans.modules.languages.parser.LLSyntaxAnalyser.read(LLSyntaxAnalyser.java:153) at org.netbeans.modules.languages.ParserManagerImpl.parse(ParserManagerImpl.java:359) at org.netbeans.modules.languages.ParserManagerImpl.parseAST(ParserManagerImpl.java:309) at org.netbeans.modules.languages.ParserManagerImpl.access$100(ParserManagerImpl.java:84) at org.netbeans.modules.languages.ParserManagerImpl$1.run(ParserManagerImpl.java:181) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) Checking in EmbeddingUpdater.java; /cvs/html/editor/src/org/netbeans/modules/html/editor/coloring/EmbeddingUpdater.java,v <-- EmbeddingUpdater.java new revision: 1.17; previous revision: 1.16 done
Created attachment 52467 [details] css_inlined patch
java.lang.IndexOutOfBoundsException fixed, patch for #1 attached reassigning to Marek #3 fixed by EmbeddingUpdater
I) IOOBE fix verified II) patch for #1 verified, althought I cannot verify in the original place - in the inlined css bacause of bug #121046. I have commited the same change also to normal text/x-css so I can verify on following example: <style> h1 { width: ${"2px"}; height: ${"4"}px; } </style> One new problem, or maybe not now, I am not sure, I found during playing with the example is filled as new P2 to you Hanzi as issue #121093. So the last remaining problem is the incomplete embedding creation in the tag's attributes if they contain EL or JSP tags. This fully depends on #121046 thought may be hacked. I have filled a separated issue #121095 so I am closing this one as fixed.
forgot to commit the #1 problem patches Checking in CSS_inlined.nbs; /cvs/languages/css/src/org/netbeans/modules/languages/css/CSS_inlined.nbs,v <-- CSS_inlined.nbs new revision: 1.7; previous revision: 1.6 done Checking in CSS.nbs; /cvs/languages/css/src/org/netbeans/modules/languages/css/CSS.nbs,v <-- CSS.nbs new revision: 1.34; previous revision: 1.33 done
Verified. Product Version: NetBeans IDE Dev (Build 200809180201) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Linux version 2.6.24-19-generic running on i386; UTF-8; en_US (nb)