private static bool IsCustomAttribute(HtmlAttribute attribute)
{
bool isCustomAttribute = false;
if (attribute.Type == HtmlAttributeType.Text)
{
string attributeNameInLowercase = attribute.NameInLowercase;
int charCount = attributeNameInLowercase.Length;
for (int charIndex = 0; charIndex < charCount; charIndex++)
{
char charValue = attributeNameInLowercase[charIndex];
if (!charValue.IsAlphaLower())
{
isCustomAttribute = true;
break;
}
}
if (isCustomAttribute)
{
isCustomAttribute = attributeNameInLowercase != "accept-charset"
&& attributeNameInLowercase != "http-equiv";
}
}
return isCustomAttribute;
}