Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326422 - [validation] Text after HTML style comment in JavaScript region marked as validation error
Summary: [validation] Text after HTML style comment in JavaScript region marked as val...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Web (show other bugs)
Version: 3.2.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 326818
  Show dependency tree
 
Reported: 2010-09-28 10:16 EDT by Ian Tewksbury CLA
Modified: 2010-10-03 22:33 EDT (History)
1 user (show)

See Also:
cmjaun: review+
thatnitind: review+


Attachments
Fix Patch with JUnits (23.25 KB, patch)
2010-09-28 10:30 EDT, Ian Tewksbury CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.