+2009-08-25 Marek Habersack <mhabersack@novell.com>
+
+ * Makefile (TEST_RESOURCE_FILES): added
+ Test/mainsoft/NunitWebResources/TagsNestedInClientTag.aspx
+
2009-08-18 Marek Habersack <mhabersack@novell.com>
* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWebResources/FullTagsInText.aspx \
Test/mainsoft/NunitWebResources/TagsExpressionsAndCommentsInText.aspx \
Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx \
- Test/mainsoft/NunitWebResources/DuplicateControlsInClientComment.aspx
+ Test/mainsoft/NunitWebResources/DuplicateControlsInClientComment.aspx \
+ Test/mainsoft/NunitWebResources/TagsNestedInClientTag.aspx
RESX_DIST = resources/TranslationResources.resx
ifneq (1, $(FRAMEWORK_VERSION_MAJOR))
if (exception != null || !StrUtils.StartsWith (newdir, HttpRuntime.AppDomainAppPath))
throw new ParseException (Location, "Files above the application's root directory cannot be included.");
}
+
+ string ChopOffTagStart (ILocation location, string content, string tagid)
+ {
+ string tagstart = '<' + tagid;
+ if (content.StartsWith (tagstart)) {
+ TextParsed (location, tagstart);
+ content = content.Substring (tagstart.Length);
+ }
+
+ return content;
+ }
void TagParsed (ILocation location, TagType tagtype, string tagid, TagAttributes attributes)
{
{
string plainText = location.PlainText;
if (!ProcessTagsInAttributes (location, tagid, attributes, TagType.Tag))
- TextParsed (location, plainText);
+ TextParsed (location, ChopOffTagStart (location, plainText, tagid));
}
break;
case TagType.Close:
if (!ProcessTag (location, tagid, attributes, tagtype, out tagIgnored) && !tagIgnored) {
string plainText = location.PlainText;
if (!ProcessTagsInAttributes (location, tagid, attributes, TagType.SelfClosing))
- TextParsed (location, plainText);
+ TextParsed (location, ChopOffTagStart (location, plainText, tagid));
} else if (stack.Count != count) {
CloseControl (tagid);
}
Parser.VerbatimID = "script";
javascript = true;
}
- TextParsed (location, location.PlainText);
+ string content = location.PlainText;
+ /* HACK, HACK, HACK */
+ if (content.StartsWith ("<script")) {
+ TextParsed (location, "<script");
+ content = content.Substring (7);
+ }
+
+ TextParsed (location, content);
return true;
}
}
+2009-08-25 Marek Habersack <mhabersack@novell.com>
+
+ * AspGenerator.cs: correctly parse server-side tags nested in
+ client-side ones. Fixes bug #323719
+
2009-08-24 Marek Habersack <mhabersack@novell.com>
* PageBuildProvider.cs: MapPath now takes a VirtualPath
mainsoft/NunitWeb/NunitWeb/StandardUrl.cs
mainsoft/NunitWeb/NunitWeb/WebTest.cs
mainsoft/NunitWeb/NunitWeb/WebTestResourcesSetupAttribute.cs
+mainsoft/NunitWeb/NunitWeb/Tests/TagsNestedInClientTag.cs
System.Web/AppBrowsersTest.cs
System.Web/HttpBrowserCapabilitiesTest.cs
System.Web/HttpCacheVaryByContentEncodingsTest.cs
+2009-08-25 Marek Habersack <mhabersack@novell.com>
+
+ * TemplateControlCompilerTest.cs: added test for bug #323719
+
2009-08-18 Marek Habersack <mhabersack@novell.com>
* TemplateControlCompilerTest.cs: added test for bug #525104 and
WebTest.CopyResource (GetType (), "TagsExpressionsAndCommentsInText.aspx", "TagsExpressionsAndCommentsInText.aspx");
WebTest.CopyResource (GetType (), "NewlineInCodeExpression.aspx", "NewlineInCodeExpression.aspx");
WebTest.CopyResource (GetType (), "DuplicateControlsInClientComment.aspx", "DuplicateControlsInClientComment.aspx");
+ WebTest.CopyResource (GetType (), "TagsNestedInClientTag.aspx", "TagsNestedInClientTag.aspx");
#if NET_2_0
WebTest.CopyResource (GetType (), "InvalidPropertyBind1.aspx", "InvalidPropertyBind1.aspx");
WebTest.CopyResource (GetType (), "InvalidPropertyBind2.aspx", "InvalidPropertyBind2.aspx");
new WebTest ("DuplicateControlsInClientComment.aspx").Run ();
}
#endif
+
+ [Test (Description="Bug #323719")]
+ public void TagsNestedInClientTag ()
+ {
+ string pageHtml = new WebTest ("TagsNestedInClientTag.aspx").Run ();
+ string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+ string originalHtml = @"<script language=""javascript"" src=""/js/test.js"" type=""text/javascript""></script>
+<sometag language=""javascript"" src=""/js/test.js"" type=""text/javascript""></sometag>";
+
+ HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+ }
[Test (Description="Bug #517656")]
public void ServerControlInClientSideComment ()
--- /dev/null
+using System;
+using System.Data;
+using System.Data.Common;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace Tests {
+ public class TagsNestedInClientTag : System.Web.UI.Page
+ {
+ protected Literal languageLiteral;
+ protected Literal typeLiteral;
+ protected Literal srcLiteral;
+ protected Literal languageLiteral1;
+ protected Literal typeLiteral1;
+ protected Literal srcLiteral1;
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ languageLiteral.Text = "language=\"javascript\"";
+ typeLiteral.Text = "type=\"text/javascript\"";
+ srcLiteral.Text = "src=\"/js/test.js\"";
+
+ languageLiteral1.Text = "language=\"javascript\"";
+ typeLiteral1.Text = "type=\"text/javascript\"";
+ srcLiteral1.Text = "src=\"/js/test.js\"";
+ }
+ }
+}
+
--- /dev/null
+<%@ Page Language="C#"
+ AutoEventWireup="true"
+ Inherits="Tests.TagsNestedInClientTag" %>
+<html>
+<head runat="server"><title>Bug #323719</title></head>
+<body>
+
+<p>
+This is a test to see if mono can handle a control embedded in a script tag; which MS is able to deal with.
+</p>
+
+<%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><script <asp:Literal ID="languageLiteral" runat="server" EnableViewState="false" /> <asp:Literal ID="srcLiteral" runat="server" EnableViewState="false" /> <asp:Literal ID="typeLiteral" runat="server" EnableViewState="false" />></script>
+<sometag <asp:Literal ID="languageLiteral1" runat="server" EnableViewState="false" /> <asp:Literal ID="srcLiteral1" runat="server" EnableViewState="false" /> <asp:Literal ID="typeLiteral1" runat="server" EnableViewState="false"/>></sometag></sometag><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+</body>
+</html>