+2009-09-30 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+ * HtmlSelectBuilder.cs: <option> allows the value of the 'selected'
+ attribute to be a boolean or the string "selected", which is treated
+ as "true".
+
2009-06-16 Marek Habersack <mhabersack@novell.com>
* HtmlHeadBuilder.cs: use faster String.Compare overloads.
public override Type GetChildControlType (string tagName, IDictionary attribs)
{
- if (System.String.Compare (tagName, "option", true, CultureInfo.InvariantCulture) != 0)
+ if (String.Compare (tagName, "option", true, CultureInfo.InvariantCulture) != 0)
return null;
+ string selected = attribs ["selected"] as string;
+ if (selected != null && selected.Length > 0 && String.Compare (selected, "selected", true, CultureInfo.InvariantCulture) == 0)
+ attribs ["selected"] = "true";
return typeof (ListItem);
}
}