2010-06-17 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Thu, 17 Jun 2010 00:56:12 +0000 (00:56 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Thu, 17 Jun 2010 00:56:12 +0000 (00:56 -0000)
* RootBuilder.cs: both LINK and META HTML tags must be represented
as instances of HtmlGenericControl. Fixes bug #603541

svn path=/trunk/mcs/; revision=159046

mcs/class/System.Web/System.Web.UI/ChangeLog
mcs/class/System.Web/System.Web.UI/RootBuilder.cs
mcs/class/System.Web/System.Web_standalone_test.dll.sources
mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
mcs/class/System.Web/Test/standalone-tests/RootBuilderChildControlTypes_Bug603541.cs [new file with mode: 0644]
mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/Default.aspx [new file with mode: 0644]
mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/Default.aspx.cs [new file with mode: 0644]
mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/web.config [new file with mode: 0644]

index 2bf3184e1ef03b2b2e892402a7706bd6a377d6f0..4c6aba5aa496696ee8d4642ddd6dc301307d64e6 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-17  Marek Habersack  <mhabersack@novell.com>
+
+       * RootBuilder.cs: both LINK and META HTML tags must be represented
+       as instances of HtmlGenericControl. Fixes bug #603541
+
 2010-06-02  Marek Habersack  <mhabersack@novell.com>
 
        * ViewStateMode.cs: added
index 77e5e385fc0966397727ed1dfc0ec194fdf42750..cbb9da6f3ca67ca43cf86993e3e0c98add389b48 100644 (file)
@@ -58,8 +58,6 @@ namespace System.Web.UI
                        htmlControls.Add ("HEAD", typeof (HtmlHead));
                        htmlControls.Add ("IMG", typeof (HtmlImage));
                        htmlControls.Add ("INPUT", "INPUT");
-                       htmlControls.Add ("LINK", typeof (HtmlLink));
-                       htmlControls.Add ("META", typeof (HtmlLink));
                        htmlControls.Add ("SELECT", typeof (HtmlSelect));
                        htmlControls.Add ("TABLE", typeof (HtmlTable));
                        htmlControls.Add ("TD", typeof (HtmlTableCell));
index 51a71a4118ab336756d6a1c3a6841beac7207fe7..0d2976198255d99c78fafb92caa9b7c56bd8e396 100644 (file)
@@ -11,4 +11,5 @@ Test/standalone-tests/Control_GetUniqueIDRelativeTo.cs
 Test/standalone-tests/RegisterBuildProvider.cs
 Test/standalone-tests/PageMetaAttributes.cs
 Test/standalone-tests/FormViewUpdateParameters_Bug607722.cs
+Test/standalone-tests/RootBuilderChildControlTypes_Bug603541.cs
 
index ec5560dfd07f509176543974c22f4d63748349d4..9d2f2f77413682790624aaabea41ca0ea5ddc3e7 100644 (file)
@@ -235,7 +235,7 @@ namespace MonoTests.System.Web.Compilation {
                        string pageHtml = new WebTest ("ConditionalClientComments.aspx").Run ();
                        string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
                        string originalHtml = @"<!--[if IE 6]>
-               <link rel=""styleheet"" type=""text/css"" href=""compat-ie6.css"" />
+               <link rel=""styleheet"" type=""text/css"" href=""~/compat-ie6.css""></link>
        <![endif]-->";
                        HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
                }
diff --git a/mcs/class/System.Web/Test/standalone-tests/RootBuilderChildControlTypes_Bug603541.cs b/mcs/class/System.Web/Test/standalone-tests/RootBuilderChildControlTypes_Bug603541.cs
new file mode 100644 (file)
index 0000000..ca6d633
--- /dev/null
@@ -0,0 +1,86 @@
+//
+// Authors:
+//   Marek Habersack (mhabersack@novell.com)
+//
+// (C) 2010 Novell, Inc http://novell.com/
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Web.Util;
+
+using StandAloneRunnerSupport;
+using StandAloneTests;
+
+using NUnit.Framework;
+
+namespace StandAloneTests.Control_GetUniqueIDRelativeTo
+{
+       [TestCase ("RootBuilderChildControlTypes_Bug603541", "HTML control types mapped by RootBuilder")]
+       public sealed class RootBuilderChildControlTypes_Bug603541 : ITestCase
+       {
+               public string PhysicalPath {
+                       get { return Path.Combine (Consts.BasePhysicalDir, "RootBuilderChildControlTypes_Bug603541"); }
+               }
+               
+               public string VirtualPath  {
+                       get { return "/"; }
+               }
+
+               public bool SetUp (List <TestRunItem> runItems)
+               {
+                       runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx));
+                       
+                       return true;
+               }
+               
+               void Default_Aspx (string result, TestRunItem runItem)
+               {
+                       string originalHtml = @"<pre id=""log"">a: System.Web.UI.HtmlControls.HtmlAnchor
+button: System.Web.UI.HtmlControls.HtmlButton
+img: System.Web.UI.HtmlControls.HtmlImage
+link: System.Web.UI.HtmlControls.HtmlGenericControl
+meta: System.Web.UI.HtmlControls.HtmlGenericControl
+select: System.Web.UI.HtmlControls.HtmlSelect
+table: System.Web.UI.HtmlControls.HtmlTable
+td: System.Web.UI.HtmlControls.HtmlTableCell
+tr: System.Web.UI.HtmlControls.HtmlTableRow
+th: System.Web.UI.HtmlControls.HtmlTableCell
+textarea: System.Web.UI.HtmlControls.HtmlTextArea
+inputButton: System.Web.UI.HtmlControls.HtmlInputButton
+inputSubmit: System.Web.UI.HtmlControls.HtmlInputSubmit
+inputReset: System.Web.UI.HtmlControls.HtmlInputReset
+inputCheckbox: System.Web.UI.HtmlControls.HtmlInputCheckBox
+inputFile: System.Web.UI.HtmlControls.HtmlInputFile
+inputHidden: System.Web.UI.HtmlControls.HtmlInputHidden
+inputImage: System.Web.UI.HtmlControls.HtmlInputImage
+inputRadio: System.Web.UI.HtmlControls.HtmlInputRadioButton
+inputText: System.Web.UI.HtmlControls.HtmlInputText
+inputPassword: System.Web.UI.HtmlControls.HtmlInputPassword
+</pre>";
+                       Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
+               }
+       }
+}
+
diff --git a/mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/Default.aspx b/mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/Default.aspx
new file mode 100644 (file)
index 0000000..02da6b4
--- /dev/null
@@ -0,0 +1,41 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+    <title></title>
+</head>
+<body>
+    <form id="form1" runat="server">
+    <div>
+       <a runat="server" id="anchor" href="/">Anchor</a><br />
+       <button runat="server" id="button" value="Button" /><br />
+       <img runat="server" id="img" src="http://google.com/favico.png" /><br />
+       <link runat="server" id="link" rel="test" /><br />
+       <meta runat="server" id="meta" name="test" /><br />
+       <select runat="server" id="testSelect"></select><br />
+       <table runat="server" id="table">
+               <tr runat="server" id="tr">
+                       <th runat="server" id="th"></th>
+                       <td runat="server" id="td"></td>
+               </tr>
+       </table><br />
+       <textarea runat="server" id="textarea"></textarea>
+       
+       <input runat="server" type="button" id="inputButton" /><br />
+       <input runat="server" type="submit" id="inputSubmit" /><br />
+       <input runat="server" type="reset" id="inputReset" /><br />
+       <input runat="server" type="checkbox" id="inputCheckbox" /><br />
+       <input runat="server" type="file" id="inputFile" /><br />
+       <input runat="server" type="hidden" id="inputHidden" /><br />
+       <input runat="server" type="image" id="inputImage" /><br />
+       <input runat="server" type="radio" id="inputRadio" /><br />
+       <input runat="server" type="text" id="inputText" /><br />
+       <input runat="server" type="password" id="inputPassword" /><br />
+
+       <%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><pre runat="server" id="log" /><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
+    </div>
+    </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/Default.aspx.cs b/mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/Default.aspx.cs
new file mode 100644 (file)
index 0000000..5631ec4
--- /dev/null
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+public partial class _Default : System.Web.UI.Page
+{
+    protected void Page_Load(object sender, EventArgs e)
+    {
+           StringBuilder sb = new StringBuilder ();
+
+           sb.AppendFormat ("a: {0}\n", anchor.GetType ());
+           sb.AppendFormat ("button: {0}\n", button.GetType ());
+           sb.AppendFormat ("img: {0}\n", img.GetType ());
+           sb.AppendFormat ("link: {0}\n", link.GetType ());
+           sb.AppendFormat ("meta: {0}\n", meta.GetType ());
+           sb.AppendFormat ("select: {0}\n", testSelect.GetType ());
+           sb.AppendFormat ("table: {0}\n", table.GetType ());
+           sb.AppendFormat ("td: {0}\n", td.GetType ());
+           sb.AppendFormat ("tr: {0}\n", tr.GetType ());
+           sb.AppendFormat ("th: {0}\n", th.GetType ());
+           sb.AppendFormat ("textarea: {0}\n", textarea.GetType ());
+
+           sb.AppendFormat ("inputButton: {0}\n", inputButton.GetType ());
+           sb.AppendFormat ("inputSubmit: {0}\n", inputSubmit.GetType ());
+           sb.AppendFormat ("inputReset: {0}\n", inputReset.GetType ());
+           sb.AppendFormat ("inputCheckbox: {0}\n", inputCheckbox.GetType ());
+           sb.AppendFormat ("inputFile: {0}\n", inputFile.GetType ());
+           sb.AppendFormat ("inputHidden: {0}\n", inputHidden.GetType ());
+           sb.AppendFormat ("inputImage: {0}\n", inputImage.GetType ());
+           sb.AppendFormat ("inputRadio: {0}\n", inputRadio.GetType ());
+           sb.AppendFormat ("inputText: {0}\n", inputText.GetType ());
+           sb.AppendFormat ("inputPassword: {0}\n", inputPassword.GetType ());
+
+           log.InnerText = sb.ToString ();
+    }
+}
\ No newline at end of file
diff --git a/mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/web.config b/mcs/class/System.Web/Test/standalone/RootBuilderChildControlTypes_Bug603541/web.config
new file mode 100644 (file)
index 0000000..873fb1b
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!--
+  For more information on how to configure your ASP.NET application, please visit
+  http://go.microsoft.com/fwlink/?LinkId=169433
+  -->
+
+<configuration>
+
+    <system.web>
+        <compilation debug="true" />
+    </system.web>
+
+</configuration>