Merge pull request #1345 from mattleibow/websocket-continuation-frame-fix
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlMeta.cs
index 703ea06d6f7502ac2c6fc052f375e68c11295959..6cb40f441a68b3943025111a07903235c838abe2 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@ximian.com)
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.ComponentModel;
 using System.Collections;
 using System.Security.Permissions;
 using System.Web.UI.WebControls;
+using System.Web.Configuration;
 
 namespace System.Web.UI.HtmlControls
 {
@@ -48,7 +47,7 @@ namespace System.Web.UI.HtmlControls
                        get {
                                string s = Attributes["content"];
                                if (s == null)
-                                       return "";
+                                       return String.Empty;
                                return s;
                        }
                        set {
@@ -65,7 +64,7 @@ namespace System.Web.UI.HtmlControls
                        get {
                                string s = Attributes["http-equiv"];
                                if (s == null)
-                                       return "";
+                                       return String.Empty;
                                return s;
                        }
                        set {
@@ -76,14 +75,13 @@ namespace System.Web.UI.HtmlControls
                        }
                }
 
-               [MonoTODO]
                [DefaultValue ("")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public virtual string Name {
                        get {
                                string s = Attributes["name"];
                                if (s == null)
-                                       return "";
+                                       return String.Empty;
                                return s;
                        }
                        set {
@@ -94,12 +92,13 @@ namespace System.Web.UI.HtmlControls
                        }
                }
 
-               [MonoTODO]
+               [DefaultValue ("")]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public virtual string Scheme {
                        get {
                                string s = Attributes["scheme"];
                                if (s == null)
-                                       return "";
+                                       return String.Empty;
                                return s;
                        }
                        set {
@@ -109,7 +108,19 @@ namespace System.Web.UI.HtmlControls
                                        Attributes["scheme"] = value;
                        }
                }
+
+               protected internal override void Render (HtmlTextWriter writer)
+               {
+                       XhtmlConformanceSection xhtml = WebConfigurationManager.GetSection ("system.web/xhtmlConformance") as XhtmlConformanceSection;
+
+                       if (xhtml != null && xhtml.Mode == XhtmlConformanceMode.Legacy)
+                               base.Render (writer);
+                       else {
+                               writer.WriteBeginTag (TagName);
+                               RenderAttributes (writer);
+                               writer.Write ("/>");
+                       }
+               }
        }
 }
 
-#endif