2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / WebControl.cs
index 850015d346af60cb0b5820f0a3dd204e2328bfd1..59d82bee4616eade7432bdf56ff63339d893b81d 100644 (file)
@@ -92,7 +92,7 @@ namespace System.Web.UI.WebControls {
                public AttributeCollection Attributes {
                        get {
                                if (attributes == null) {
-                                       attribute_state = new StateBag ();
+                                       attribute_state = new StateBag (true);
                                        if (IsTrackingViewState)
                                                attribute_state.TrackViewState ();
                                        
@@ -249,12 +249,8 @@ namespace System.Web.UI.WebControls {
                [MonoTODO]
                public virtual new bool EnableTheming
                {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-                       set {
-                               throw new NotImplementedException ();
-                       }
+                       get { return base.EnableTheming; }
+                       set { base.EnableTheming = value; }
                }
 #endif         
 
@@ -327,12 +323,8 @@ namespace System.Web.UI.WebControls {
                [MonoTODO]
                public virtual new string SkinID
                {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-                       set {
-                               throw new NotImplementedException ();
-                       }
+                       get { return base.SkinID; }
+                       set { base.SkinID = value; }
                }
 #endif         
                
@@ -499,8 +491,16 @@ namespace System.Web.UI.WebControls {
                        if (TabIndex != 0)
                                writer.AddAttribute (HtmlTextWriterAttribute.Tabindex, TabIndex.ToString ());
 
-                       if (style != null && !style.IsEmpty)
+                       if (style != null && !style.IsEmpty) {
+#if NET_2_0
+                               //unbelievable, but see WebControlTest.RenderBeginTag_BorderWidth_xxx
+                               if (TagKey == HtmlTextWriterTag.Span)
+                                       if (style.BorderWidth != Unit.Empty 
+                                               || style.BorderStyle != BorderStyle.NotSet)
+                                               writer.AddStyleAttribute (HtmlTextWriterStyle.Display, "inline-block");
+#endif
                                style.AddAttributesToRender(writer, this);
+                       }
 
                        if (attributes != null)
                                foreach(string s in attributes.Keys)