Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 326422
Collapse All | Expand All

(-)src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java (-3 / +23 lines)
Lines 48-56 Link Here
48
import org.eclipse.jface.text.IDocumentExtension4;
48
import org.eclipse.jface.text.IDocumentExtension4;
49
import org.eclipse.jface.text.IDocumentListener;
49
import org.eclipse.jface.text.IDocumentListener;
50
import org.eclipse.jface.text.IDocumentRewriteSessionListener;
50
import org.eclipse.jface.text.IDocumentRewriteSessionListener;
51
import org.eclipse.jface.text.IRegion;
51
import org.eclipse.jface.text.Position;
52
import org.eclipse.jface.text.Position;
52
import org.eclipse.jface.text.Region;
53
import org.eclipse.jface.text.Region;
53
import org.eclipse.wst.jsdt.core.IBuffer;
54
import org.eclipse.wst.jsdt.core.IBuffer;
55
import org.eclipse.wst.jsdt.web.core.internal.Logger;
54
import org.eclipse.wst.sse.core.StructuredModelManager;
56
import org.eclipse.wst.sse.core.StructuredModelManager;
55
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
57
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
56
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
58
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
Lines 513-519 Link Here
513
				// skip over XML/HTML comment starts
515
				// skip over XML/HTML comment starts
514
				if (regionText.indexOf(XML_COMMENT_START) >= 0) {
516
				if (regionText.indexOf(XML_COMMENT_START) >= 0) {
515
					int index = regionText.indexOf(XML_COMMENT_START);
517
					int index = regionText.indexOf(XML_COMMENT_START);
516
					int leadingTrimPlusCommentStart = index + XML_COMMENT_START.length();
518
					
517
					boolean replaceCommentStart = true;
519
					boolean replaceCommentStart = true;
518
					for (int i = 0; i < index; i++) {
520
					for (int i = 0; i < index; i++) {
519
						/*
521
						/*
Lines 522-532 Link Here
522
						 */
524
						 */
523
						replaceCommentStart = replaceCommentStart && Character.isWhitespace(regionText.charAt(i));
525
						replaceCommentStart = replaceCommentStart && Character.isWhitespace(regionText.charAt(i));
524
					}
526
					}
527
					
525
					if (replaceCommentStart) {
528
					if (replaceCommentStart) {
529
						IRegion line;
530
						int end;
531
						int length;
532
						try {
533
							line = container.getParentDocument().getLineInformationOfOffset(index + scriptStart);
534
							end = line.getOffset() + line.getLength() - scriptStart;
535
							if(end > regionText.length()) {
536
								end = regionText.length()-1;
537
							}
538
							length = end - index;
539
						} catch (BadLocationException e) {
540
							Logger.logException("Could not get HTML style comment line information", e); //$NON-NLS-1$
541
							
542
							end = index + XML_COMMENT_START.length();
543
							length = XML_COMMENT_START.length();
544
						}
545
						
526
						StringBuffer newRegionText = new StringBuffer(regionText.substring(0, index));
546
						StringBuffer newRegionText = new StringBuffer(regionText.substring(0, index));
527
						spaces = Util.getPad(XML_COMMENT_START.length());
547
						spaces = Util.getPad(length);
528
						newRegionText.append(spaces);
548
						newRegionText.append(spaces);
529
						newRegionText.append(regionText.substring(leadingTrimPlusCommentStart));
549
						newRegionText.append(regionText.substring(end));
530
						regionText = newRegionText.toString();
550
						regionText = newRegionText.toString();
531
					}
551
					}
532
				}
552
				}
(-)src/org/eclipse/wst/jsdt/web/core/tests/translation/TestHtmlTranslation.java (-2 / +26 lines)
Lines 350-356 Link Here
350
	public void testMangleMultipleMixedServerSideInJSwithXMLcomment_and_CheckProblems() {
350
	public void testMangleMultipleMixedServerSideInJSwithXMLcomment_and_CheckProblems() {
351
		// get model
351
		// get model
352
		String fileName = getName() + ".html";
352
		String fileName = getName() + ".html";
353
		IStructuredModel structuredModel = getSharedModel(fileName, "<script> <!-- var text = <? serverObject.getText() ?>; <%=\"a\"%> <%=\"b\"%> <? serverObject.getText() ?><%=\"c\"%> </script>");
353
		IStructuredModel structuredModel = getSharedModel(fileName, "<script> <!-- \nvar text = <? serverObject.getText() ?>; <%=\"a\"%> <%=\"b\"%> <? serverObject.getText() ?><%=\"c\"%> </script>");
354
		assertNotNull("missing test model", structuredModel);
354
		assertNotNull("missing test model", structuredModel);
355
		
355
		
356
		// do translation
356
		// do translation
Lines 358-364 Link Here
358
		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) ((IDOMModel) structuredModel).getDocument().getAdapterFor(IJsTranslation.class);
358
		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) ((IDOMModel) structuredModel).getDocument().getAdapterFor(IJsTranslation.class);
359
		IJsTranslation translation = translationAdapter.getJsTranslation(false);
359
		IJsTranslation translation = translationAdapter.getJsTranslation(false);
360
		String translated = translation.getJsText();
360
		String translated = translation.getJsText();
361
		assertEquals("translated contents not as expected", "              var text = _$tag_______________________; _$tag___ _$tag___ _$tag________________________$tag___ ",translated);
361
		assertEquals("translated contents not as expected", "              \nvar text = _$tag_______________________; _$tag___ _$tag___ _$tag________________________$tag___ ",translated);
362
		assertTrue("translation empty", translated.length() > 5);
362
		assertTrue("translation empty", translated.length() > 5);
363
		assertTrue("server-side script block included", translated.indexOf("<?") < 0);
363
		assertTrue("server-side script block included", translated.indexOf("<?") < 0);
364
		assertTrue("server-side script block included", translated.indexOf("?>") < 0);
364
		assertTrue("server-side script block included", translated.indexOf("?>") < 0);
Lines 370-375 Link Here
370
		// release model
370
		// release model
371
		structuredModel.releaseFromRead();
371
		structuredModel.releaseFromRead();
372
	}
372
	}
373
	
374
	public void testMangleMultipleMixedServerSideInJSwithXMLcommentOnSameLine() {
375
		// get model
376
		String fileName = getName() + ".html";
377
		IStructuredModel structuredModel = getSharedModel(fileName, "<script> <!-- var text = <? serverObject.getText() ?>; <%=\"a\"%> <%=\"b\"%> <? serverObject.getText() ?><%=\"c\"%> </script>");
378
		assertNotNull("missing test model", structuredModel);
379
		
380
		// do translation
381
		JsTranslationAdapterFactory.setupAdapterFactory(structuredModel);
382
		JsTranslationAdapter translationAdapter = (JsTranslationAdapter) ((IDOMModel) structuredModel).getDocument().getAdapterFor(IJsTranslation.class);
383
		IJsTranslation translation = translationAdapter.getJsTranslation(false);
384
		String translated = translation.getJsText();
385
		assertEquals("translated contents not as expected",
386
				"                                                                                                              ",translated);
387
		assertTrue("translation empty", translated.length() > 5);
388
		assertTrue("server-side script block included", translated.indexOf("<?") < 0);
389
		assertTrue("server-side script block included", translated.indexOf("?>") < 0);
390
		assertTrue("server-side script block included", translated.indexOf("<%") < 0);
391
		assertTrue("server-side script block included", translated.indexOf("%>") < 0);
392
		assertTrue("problems found in translation ", translation.getProblems().isEmpty());
393
394
		// release model
395
		structuredModel.releaseFromRead();
396
	}
373
	public void testMangleMultipleMixedServerSideAndClientTagInJS_and_CheckProblems() {
397
	public void testMangleMultipleMixedServerSideAndClientTagInJS_and_CheckProblems() {
374
		// get model
398
		// get model
375
		String fileName = getName() + ".html";
399
		String fileName = getName() + ".html";
(-)src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java (-13 / +8 lines)
Lines 56-69 Link Here
56
* (repeatedly) as the API evolves.
56
* (repeatedly) as the API evolves.
57
*/
57
*/
58
public class FormattingStrategyJSDT extends ContextBasedFormattingStrategy {
58
public class FormattingStrategyJSDT extends ContextBasedFormattingStrategy {
59
	private static final String XML_COMMENT_START = "<!--"; //$NON-NLS-1$
59
	/** matches on //--> at end of script region */
60
	private static final String XML_COMMENT_END = "//-->"; //$NON-NLS-1$
60
	private static final Pattern END_PATTERN = Pattern.compile("((//.*-->\\s*)\\z)");
61
	
62
	/** matches on <!-- at beginning of script region */
63
	private static final Pattern START_PATTERN = Pattern.compile("(\\A(\\s*<!--))");
64
	
65
	/** matches on //--> or --> at end of script region */
66
	private static final Pattern END_PATTERN = Pattern.compile("(((//\\s*)?-->\\s*)\\z)");
67
	
61
	
68
	private static final int regionStartIndentLevel = 1;
62
	private static final int regionStartIndentLevel = 1;
69
	/** Documents to be formatted by this strategy */
63
	/** Documents to be formatted by this strategy */
Lines 114-130 Link Here
114
				String postText = lineDelim;
108
				String postText = lineDelim;
115
109
116
				//find start comment tag
110
				//find start comment tag
117
				Matcher matcher = START_PATTERN.matcher(jsTextNotTranslated);
111
				Pattern startPattern = Pattern.compile("(\\A(\\s*<!--.*(" + lineDelim + ")?))");
112
				Matcher matcher = startPattern.matcher(jsTextNotTranslated);
118
				if(matcher.find()) {
113
				if(matcher.find()) {
119
					jsTextNotTranslated = matcher.replaceAll("");
114
					jsTextNotTranslated = matcher.replaceFirst("");
120
					preText = lineDelim + XML_COMMENT_START;
115
					preText = lineDelim + matcher.group().trim();
121
				}
116
				}
122
				
117
				
123
				//find end tag
118
				//find end tag
124
				matcher = END_PATTERN.matcher(jsTextNotTranslated);
119
				matcher = END_PATTERN.matcher(jsTextNotTranslated);
125
				if(matcher.find()) {
120
				if(matcher.find()) {
126
					jsTextNotTranslated = matcher.replaceAll("");
121
					jsTextNotTranslated = matcher.replaceFirst("");
127
					postText = lineDelim + XML_COMMENT_END + lineDelim;
122
					postText = lineDelim + matcher.group().trim() + lineDelim;
128
				}
123
				}
129
				
124
				
130
				//replace the text in the document with the none-translated JS text but without HTML leading and trailing comments
125
				//replace the text in the document with the none-translated JS text but without HTML leading and trailing comments
(-)src/org/eclipse/wst/jsdt/web/ui/tests/format/FormattingTests.java (-38 / +62 lines)
Lines 10-16 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.web.ui.tests.format;
11
package org.eclipse.wst.jsdt.web.ui.tests.format;
12
12
13
import java.io.ByteArrayOutputStream;
14
import java.io.IOException;
13
import java.io.IOException;
15
import java.io.UnsupportedEncodingException;
14
import java.io.UnsupportedEncodingException;
16
15
Lines 23-28 Link Here
23
import org.eclipse.core.resources.IProject;
22
import org.eclipse.core.resources.IProject;
24
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.CoreException;
25
import org.eclipse.core.runtime.NullProgressMonitor;
24
import org.eclipse.core.runtime.NullProgressMonitor;
25
import org.eclipse.jface.text.IDocument;
26
import org.eclipse.jface.text.Region;
26
import org.eclipse.jface.text.Region;
27
import org.eclipse.jface.text.formatter.FormattingContext;
27
import org.eclipse.jface.text.formatter.FormattingContext;
28
import org.eclipse.jface.text.formatter.FormattingContextProperties;
28
import org.eclipse.jface.text.formatter.FormattingContextProperties;
Lines 50-57 Link Here
50
 *
50
 *
51
 */
51
 */
52
public class FormattingTests extends TestCase {
52
public class FormattingTests extends TestCase {
53
	private static final String UTF_8 = "UTF-8";
54
	
55
	/**
53
	/**
56
	 * The name of the project that all of these tests will use
54
	 * The name of the project that all of these tests will use
57
	 */
55
	 */
Lines 67-75 Link Here
67
	 */
65
	 */
68
	private static IProject fProject;
66
	private static IProject fProject;
69
	
67
	
70
	/** the viewer to use during the tests */
71
	private static ISourceViewer fViewer;
72
	
73
	/**
68
	/**
74
	 * <p>Default constructor<p>
69
	 * <p>Default constructor<p>
75
	 * <p>Use {@link #suite()}</p>
70
	 * <p>Use {@link #suite()}</p>
Lines 145-150 Link Here
145
		formatAndAssertEquals("test9.html", "test9-fmt.html", new StructuredTextViewerConfigurationJSDT());
140
		formatAndAssertEquals("test9.html", "test9-fmt.html", new StructuredTextViewerConfigurationJSDT());
146
	}
141
	}
147
	
142
	
143
	public void testFormatHTMLScriptRegionWrappedWithHTMLComment_TextInLeadingComment() throws UnsupportedEncodingException, IOException, CoreException {
144
		formatAndAssertEquals("test10.html", "test10-fmt.html", new StructuredTextViewerConfigurationJSDT());
145
	}
146
	
147
	public void testFormatHTMLScriptRegionWrappedWithHTMLComment_TextInTrailingComment() throws UnsupportedEncodingException, IOException, CoreException {
148
		formatAndAssertEquals("test11.html", "test11-fmt.html", new StructuredTextViewerConfigurationJSDT());
149
	}
150
	
151
	public void testFormatHTMLScriptRegionWrappedWithHTMLComment_TextInLeadingComment_and_TextInTrailingComment() throws UnsupportedEncodingException, IOException, CoreException {
152
		formatAndAssertEquals("test12.html", "test12-fmt.html", new StructuredTextViewerConfigurationJSDT());
153
	}
154
	
155
	public void testFormatHTMLScriptRegion_AllOnOneLine() throws UnsupportedEncodingException, IOException, CoreException {
156
		formatAndAssertEquals("test13.html", "test13-fmt.html", new StructuredTextViewerConfigurationJSDT());
157
	}
158
	
159
	public void testFormatHTMLScriptRegion_AllOnOneLine_LeadingComment() throws UnsupportedEncodingException, IOException, CoreException {
160
		formatAndAssertEquals("test14.html", "test14-fmt.html", new StructuredTextViewerConfigurationJSDT());
161
	}
162
	
148
	/**
163
	/**
149
	 * @param beforePath
164
	 * @param beforePath
150
	 * @param afterPath
165
	 * @param afterPath
Lines 172-198 Link Here
172
			normalizedContents = StringUtils.replace(normalizedContents, "\r", "\n");
187
			normalizedContents = StringUtils.replace(normalizedContents, "\r", "\n");
173
			document.set(normalizedContents);
188
			document.set(normalizedContents);
174
			
189
			
175
			//setup dummy viewer
190
			ISourceViewer viewer = getConfiguredViewer(document, configuration);
176
			fViewer.setDocument(document);
191
			assertNotNull("Could not get viewer to run test", viewer);
177
			fViewer.configure(configuration);
178
			
192
			
179
			//do the format
193
			//do the format
180
			IContentFormatterExtension formatter = (IContentFormatterExtension) configuration.getContentFormatter(fViewer);
194
			IContentFormatterExtension formatter = (IContentFormatterExtension) configuration.getContentFormatter(viewer);
181
			IFormattingContext fContext = new FormattingContext();
195
			IFormattingContext fContext = new FormattingContext();
182
			Region region = new Region(0, document.getLength());
196
			Region region = new Region(0, document.getLength());
183
			fContext.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.valueOf(true));
197
			fContext.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.valueOf(true));
184
			fContext.setProperty(FormattingContextProperties.CONTEXT_REGION, region);
198
			fContext.setProperty(FormattingContextProperties.CONTEXT_REGION, region);
185
			formatter.format(document, fContext);
199
			formatter.format(document, fContext);
186
			
200
			
187
			//save the models
201
			//get the contents
188
			ByteArrayOutputStream formattedBytes = new ByteArrayOutputStream();
202
			String actualContents = beforeModel.getStructuredDocument().get();
189
			beforeModel.save(formattedBytes); // "beforeModel" should now be after the formatter
203
			String expectedContents = afterModel.getStructuredDocument().get();
190
191
			ByteArrayOutputStream afterBytes = new ByteArrayOutputStream();
192
			afterModel.save(afterBytes);
193
194
			String expectedContents = new String(afterBytes.toByteArray(), UTF_8);
195
			String actualContents = new String(formattedBytes.toByteArray(), UTF_8);
196
204
197
			/* Make some adjustments to ignore cross platform line delimiter issues */
205
			/* Make some adjustments to ignore cross platform line delimiter issues */
198
			expectedContents = StringUtils.replace(expectedContents, "\r\n", "\n");
206
			expectedContents = StringUtils.replace(expectedContents, "\r\n", "\n");
Lines 206-215 Link Here
206
		}
214
		}
207
		finally {
215
		finally {
208
			if (beforeModel != null) {
216
			if (beforeModel != null) {
209
				beforeModel.releaseFromEdit();
217
				try {
218
					beforeModel.releaseFromEdit();
219
				} catch(Exception e) {
220
					//ignore
221
				}
210
			}
222
			}
211
			if (afterModel != null) {
223
			if (afterModel != null) {
212
				afterModel.releaseFromEdit();
224
				try {
225
					afterModel.releaseFromEdit();
226
				} catch(Exception e) {
227
					//ignore
228
				}
213
			}
229
			}
214
		}
230
		}
215
	}
231
	}
Lines 251-256 Link Here
251
	}
267
	}
252
	
268
	
253
	/**
269
	/**
270
	 * @param document {@link IDocument} to display in the dummy viewer
271
	 * @param configuration {@link SourceViewerConfiguration} to configure the dummy viewer with
272
	 * @return a configured {@link ISourceViewer} using the given parameters
273
	 */
274
	private static ISourceViewer getConfiguredViewer(IDocument document, SourceViewerConfiguration configuration) {
275
		ISourceViewer viewer = null;
276
		assertNotNull("Could not get current display to run test with.", Display.getCurrent());
277
278
		Shell shell = null;
279
280
		if (PlatformUI.isWorkbenchRunning()) {
281
			shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
282
		}
283
		else {
284
			shell = new Shell(Display.getCurrent());
285
		}
286
		Composite parent = new Composite(shell, SWT.NONE);
287
		viewer = new StructuredTextViewer(parent, null, null, false, SWT.NONE);
288
		viewer.setDocument(document);
289
		viewer.configure(configuration);
290
		
291
		return viewer;
292
	}
293
	
294
	/**
254
	 * <p>This inner class is used to do set up and tear down before and
295
	 * <p>This inner class is used to do set up and tear down before and
255
	 * after (respectively) all tests in the inclosing class have run.</p>
296
	 * after (respectively) all tests in the inclosing class have run.</p>
256
	 */
297
	 */
Lines 277-299 Link Here
277
			fProject = ProjectUtil.createProject(PROJECT_NAME, null, new String[] {JavaScriptCore.NATURE_ID});
318
			fProject = ProjectUtil.createProject(PROJECT_NAME, null, new String[] {JavaScriptCore.NATURE_ID});
278
			ProjectUtil.copyBundleEntriesIntoWorkspace(PROJECT_FILES, PROJECT_NAME);
319
			ProjectUtil.copyBundleEntriesIntoWorkspace(PROJECT_FILES, PROJECT_NAME);
279
			
320
			
280
			if (Display.getCurrent() != null) {
281
282
				Shell shell = null;
283
				Composite parent = null;
284
285
				if (PlatformUI.isWorkbenchRunning()) {
286
					shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
287
				}
288
				else {
289
					shell = new Shell(Display.getCurrent());
290
				}
291
				parent = new Composite(shell, SWT.NONE);
292
293
				// dummy viewer
294
				fViewer = new StructuredTextViewer(parent, null, null, false, SWT.NONE);
295
			}
296
			
297
			//set non-interactive
321
			//set non-interactive
298
			String noninteractive = System.getProperty(WTP_AUTOTEST_NONINTERACTIVE);
322
			String noninteractive = System.getProperty(WTP_AUTOTEST_NONINTERACTIVE);
299
			if (noninteractive != null) {
323
			if (noninteractive != null) {
(-)testFiles/formatting/test10-fmt.html (+16 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">
10
<!-- this is a test
11
	var t = true;
12
//-->
13
</script>
14
15
</body>
16
</html>
(-)testFiles/formatting/test10.html (+16 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">
10
<!-- this is a test
11
var t = true;
12
//--> 
13
</script>
14
15
</body>
16
</html>
(-)testFiles/formatting/test11-fmt.html (+16 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">
10
<!--
11
	var t = true;
12
// this is a test -->
13
</script>
14
15
</body>
16
</html>
(-)testFiles/formatting/test11.html (+16 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">
10
<!-- 
11
var t = true;
12
// this is a test --> 
13
</script>
14
15
</body>
16
</html>
(-)testFiles/formatting/test12-fmt.html (+16 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">
10
<!-- this is a test
11
	var t = true;
12
// this is a test -->
13
</script>
14
15
</body>
16
</html>
(-)testFiles/formatting/test12.html (+16 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">
10
<!-- this is a test
11
var t = true;
12
// this is a test --> 
13
</script>
14
15
</body>
16
</html>
(-)testFiles/formatting/test13-fmt.html (+14 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">
10
	var t = true;
11
</script>
12
13
</body>
14
</html>
(-)testFiles/formatting/test13.html (+12 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">var t = true;</script>
10
11
</body>
12
</html>
(-)testFiles/formatting/test14-fmt.html (+15 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript">
10
<!-- var t = true;
11
	
12
</script>
13
14
</body>
15
</html>
(-)testFiles/formatting/test14.html (+12 lines)
Added Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<title>Insert title here</title>
6
</head>
7
<body>
8
9
<script type="text/javascript"><!-- var t = true;</script>
10
11
</body>
12
</html>

Return to bug 326422