You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2012/07/31 12:11:44 UTC

git commit: WICKET-4683 reference added in page header section

Updated Branches:
  refs/heads/master 5f3ae56b7 -> b89909c1f


WICKET-4683 <script> tag broken in certain situations when <script src="..."></script> reference added in page header section

Apply StyleAndScriptIdentifier only on <script> elements without 'src' attribute.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b89909c1
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b89909c1
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b89909c1

Branch: refs/heads/master
Commit: b89909c1fa99ae6973c3fb0738a966eb23c27e73
Parents: 5f3ae56
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Jul 31 13:10:25 2012 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Jul 31 13:10:25 2012 +0300

----------------------------------------------------------------------
 .../parser/filter/StyleAndScriptIdentifier.java    |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/b89909c1/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/StyleAndScriptIdentifier.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/StyleAndScriptIdentifier.java b/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/StyleAndScriptIdentifier.java
index 0cb3e02..6973981 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/StyleAndScriptIdentifier.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/StyleAndScriptIdentifier.java
@@ -54,10 +54,12 @@ public final class StyleAndScriptIdentifier extends AbstractMarkupFilter
 			return tag;
 		}
 
-		if (XmlPullParser.SCRIPT.equalsIgnoreCase(tag.getName()) ||
-			(XmlPullParser.STYLE.equalsIgnoreCase(tag.getName())))
+		String tagName = tag.getName();
+		boolean isScript = XmlPullParser.SCRIPT.equalsIgnoreCase(tagName);
+		boolean isStyle = XmlPullParser.STYLE.equalsIgnoreCase(tagName);
+		if (isScript || isStyle)
 		{
-			if (tag.isOpen() && (tag.getId() == null))
+			if (tag.isOpen() && tag.getId() == null && ((isScript && tag.getAttribute("src") == null) || isStyle))
 			{
 				// Not needed, but must not be null
 				tag.setId("_ScriptStyle");