[292073] [parser] Scriptlet in <script> attribute tags can cause the region to not be block text
[292077] [translation] Javascript can cause custom tags to not be translated
[292073] [parser] Scriptlet in <script> attribute tags can cause the region to not be block text
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
index 3c20593..99866c7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -186,6 +186,10 @@
 				}
 			}
 			else if (isJSPStartRegion(sdRegion)) {
+				int illegalContent = hasIllegalContent(sdRegion);
+				// If illegal content was found, start decoding again after the region
+				if (illegalContent >= 0)
+					decodeRemainingRegions(sdRegion, illegalContent + 1);
 				String nameStr = getRegionName(sdRegion);
 				if (sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
 					if (isPossibleCustomTag(nameStr)) {
@@ -266,6 +270,25 @@
 		}
 	}
 
+	private void decodeRemainingRegions(IStructuredDocumentRegion sdRegion, int start) {
+		ITextRegion region = sdRegion.getRegions().get(start);
+		String text = sdRegion.getFullText();
+		if (region.getStart() <= text.length())
+			fTranslator.decodeScriptBlock(text.substring(region.getStart(), text.length()), 0);
+	}
+
+	private int hasIllegalContent(IStructuredDocumentRegion sdRegion) {
+		ITextRegionList list = sdRegion.getRegions();
+		for (int i = 0; i < list.size(); i++) {
+			ITextRegion region = list.get(i);
+			String type = region.getType();
+			if (type == DOMRegionContext.UNDEFINED)
+				return i;
+			if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_EMPTY_TAG_CLOSE || type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE)
+				return -1;
+		}
+		return -1;
+	}
 
 	private void handleScopingIfNecessary(IStructuredDocumentRegion sdRegion) {
 		if(true)
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
index bc1a523..f62632f 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.2.2 on 2/4/09 2:15 PM */
+/* The following code was generated by JFlex 1.2.2 on 10/12/09 2:44 PM */
 
 /*******************************************************************************
  * Copyright (c) 2004, 2009 IBM Corporation and others.
@@ -37,7 +37,7 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 2/4/09 2:15 PM from the specification file
+ * on 10/12/09 2:44 PM from the specification file
  * <tt>file:/D:/dev/workspaces/wtp1.5/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex</tt>
  */
 public class JSPTokenizer implements BlockTokenizer, DOMJSPRegionContexts {
@@ -1309,6 +1309,8 @@
  */
 private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {
 	boolean stillSearching = true;
+	boolean wasBlockingEnabled = fIsBlockingEnabled;
+	try {
 	// Disable further block (probably)
 	fIsBlockingEnabled = false;
 	int searchStringLength = searchString.length();
@@ -1518,6 +1520,10 @@
 	if(yy_markedPos == yy_startRead)
 		return primGetNextToken();
 	return searchContext;
+	}
+	finally {
+		fIsBlockingEnabled = wasBlockingEnabled;
+	}
 }
 /**
  * user method 
@@ -1705,7 +1711,7 @@
 		fBufferedLength = 0;
 		fStateStack = new IntStack();
 		fJspTagStack.clear();
-
+	
 		fLastInternalBlockStart = -1;
 	
 		context = null;
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
index 16a9c30..6d279b4 100644
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
+++ b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex
@@ -414,6 +414,8 @@
  */

 private final String doScan(String searchString, boolean requireTailSeparator, boolean allowJSP, boolean allowCDATA, String searchContext, int exitState, int immediateFallbackState) throws IOException {

 	boolean stillSearching = true;

+	boolean wasBlockingEnabled = fIsBlockingEnabled;

+	try {

 	// Disable further block (probably)

 	fIsBlockingEnabled = false;

 	int searchStringLength = searchString.length();

@@ -623,6 +625,10 @@
 	if(yy_markedPos == yy_startRead)

 		return primGetNextToken();

 	return searchContext;

+	}

+	finally {

+		fIsBlockingEnabled = wasBlockingEnabled;

+	}

 }

 /**

  * user method 

diff --git a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
index e4d6d7e..5f99c09 100644
--- a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.sse.core; singleton:=true
-Bundle-Version: 1.1.104.qualifier
+Bundle-Version: 1.1.105.qualifier
 Bundle-Activator: org.eclipse.wst.sse.core.internal.SSECorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html b/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
index ff0c79c..801d33f 100644
--- a/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
+++ b/features/org.eclipse.wst.xml_core.feature.patch/buildnotes_org.eclipse.wst.xml_core.feature.patch.html
@@ -28,6 +28,9 @@
 <p>Bug <a
 	href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=285076'>285076</a>.
 Remove automatic promotion of invalid child tags in XMLModelParser</p>
+<p>Bug <a
+	href='https://bugs.eclipse.org/bugs/show_bug.cgi?id=292073'>292073</a>.
+[parser] Scriptlet in <script> attribute tags can cause the region to not be block text</p>
 
 </body>
 </head>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.xml_core.feature.patch/feature.properties b/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
index e21eb32..044370f 100644
--- a/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
+++ b/features/org.eclipse.wst.xml_core.feature.patch/feature.properties
@@ -31,7 +31,8 @@
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=250030 Ignoring problems caused by missing start and end tags\n\
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=235445 CatalogWriter.write() does not closing the outputstream\n\
 Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=262637 JSP quote escaping as per JSP rules in tag attributes are reported as ERRORS.\n\
-Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=285076 Remove automatic promotion of invalid child tags in XMLModelParser\n\ 
+Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=285076 Remove automatic promotion of invalid child tags in XMLModelParser\n\
+Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=292073 [parser] Scriptlet in <script> attribute tags can cause the region to not be block text\n\ 
 # "copyright" property - text of the "Feature Update Copyright"
 copyright=\
 Copyright (c) 2008 IBM Corporation and others.\n\