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

Bug 326422

Summary: [validation] Text after HTML style comment in JavaScript region marked as validation error
Product: [WebTools] JSDT Reporter: Ian Tewksbury <itewksbu>
Component: WebAssignee: Ian Tewksbury <itewksbu>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: cmjaun
Version: 3.2.3Flags: cmjaun: review+
thatnitind: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 326818    
Attachments:
Description Flags
Fix Patch with JUnits none

Description Ian Tewksbury CLA 2010-09-28 10:16:38 EDT
Fix for this bug is also needed in 3.2.3 and 3.3

+++ This bug was initially created as a clone of Bug #326303 +++

Currently the JSDT validator does not support text after a leading opening HTML style comment in a JavaScript region.  This scenario is stated as valid in http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.3

Example:

<script type="text/javascript">
<!--  to hide script contents from old browsers
var v = "foo";
// -->
</script>
Comment 1 Ian Tewksbury CLA 2010-09-28 10:30:05 EDT
Created attachment 179747 [details]
Fix Patch with JUnits

This fix takes care of fixing the JsTranslator and FormattingStrategyJSDT.  This in turn fixes the invalid validation message and deals with formatting this situation.  What is not fixed by this is syntax highlighting.  The text following the leading HTML comment will still show styled as JS content and not as a JS comment.  A separate bug will be opened to fix that.

The patch also adds 6 new JUnits and updates one existing JUnit.  5 of the new junits are for formatting, 1 is for translation, and the updated JUnit is also in translation.
Comment 2 Ian Tewksbury CLA 2010-09-28 14:58:42 EDT
The patch for Bug 313624 has been updated to deal with the syntax highlighting issues that come along with this problem.
Comment 3 Chris Jaun CLA 2010-10-01 17:07:31 EDT
Patch checked into 3.2.3 and HEAD.