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

Bug 326420

Summary: [validation] Text after HTML style comment in JavaScript region marked as validation error
Product: [WebTools] JSDT Reporter: Ian Tewksbury <itewksbu>
Component: WebAssignee: Project Inbox <jsdt.web-inbox>
Status: CLOSED DUPLICATE QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: cmjaun, thatnitind
Version: 3.2.2   
Target Milestone: 3.2.2 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix Patch none

Description Ian Tewksbury CLA 2010-09-28 10:15:28 EDT
Fix for this bug is also needed in 3.2.2.patches

+++ 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:23:11 EDT
Fix for 3.2.3 and 3.3 being tracked by Bug 326422
Comment 2 Ian Tewksbury CLA 2010-09-28 10:27:05 EDT
Created attachment 179746 [details]
Fix Patch

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.
Comment 3 Ian Tewksbury CLA 2010-09-28 15:00:25 EDT
The patch for Bug 313624 has been updated to deal with the syntax highlighting
issues that come along with this problem.  Though that fix is substantially bigger and was not sure if you were interested in a 3.2.2p version of that patch or not, if so I can create another bug for that.
Comment 4 Nitin Dahyabhai CLA 2010-10-04 17:51:03 EDT
What's fixed in here that's not covered by bug 326817 nor bug 326818?
Comment 5 Ian Tewksbury CLA 2010-10-05 08:17:40 EDT
(In reply to comment #4)
> What's fixed in here that's not covered by bug 326817 nor bug 326818?

Apparently Chris was not aware I already had a bugzilla open for 3.2.2p for this issue. It would seem that Bug 326818 is a clone if this bug.

To clarify:
3.0.5p - Bug 326303 
3.2.2p - This bug & Bug 326818 (only need one of them)
3.2.3/3.3 - Bug 326422

*** This bug has been marked as a duplicate of bug 326818 ***