private HtmlAttributeType GetAttributeType(string tagNameInLowercase, HtmlTagFlags tagFlags,
string attributeNameInLowercase, IList<HtmlAttribute> attributes)
{
HtmlAttributeType attributeType = HtmlAttributeType.Unknown;
if (attributeNameInLowercase == "class")
{
attributeType = HtmlAttributeType.ClassName;
}
else if (attributeNameInLowercase == "style")
{
attributeType = HtmlAttributeType.Style;
}
else if (HtmlAttributeTypeHelpers.IsEventAttribute(attributeNameInLowercase))
{
attributeType = HtmlAttributeType.Event;
}
if (attributeType == HtmlAttributeType.Unknown && !tagFlags.HasFlag(HtmlTagFlags.Xml))
{
if (HtmlAttributeTypeHelpers.IsBooleanAttribute(attributeNameInLowercase))
{
attributeType = HtmlAttributeType.Boolean;
}
else if (HtmlAttributeTypeHelpers.IsNumericAttribute(tagNameInLowercase, attributeNameInLowercase))
{
attributeType = HtmlAttributeType.Numeric;
}
else if (HtmlAttributeTypeHelpers.IsUriBasedAttribute(tagNameInLowercase, attributeNameInLowercase,
attributes))
{
attributeType = HtmlAttributeType.Uri;
}
}
if (attributeType == HtmlAttributeType.Unknown)
{
attributeType = HtmlAttributeTypeHelpers.IsXmlBasedAttribute(attributeNameInLowercase) ?
HtmlAttributeType.Xml : HtmlAttributeType.Text;
}
return attributeType;
}