WebMarkupMin.Core.GenericHtmlMinifier.CanRemoveEmptyAttribute C# (CSharp) Метод

CanRemoveEmptyAttribute() приватный статический Метод

Checks whether remove an the attribute, that has empty value
private static CanRemoveEmptyAttribute ( WebMarkupMin.Core.Parsers.HtmlTag tag, HtmlAttribute attribute ) : bool
tag WebMarkupMin.Core.Parsers.HtmlTag Tag
attribute WebMarkupMin.Core.Parsers.HtmlAttribute Attribute
Результат bool
        private static bool CanRemoveEmptyAttribute(HtmlTag tag, HtmlAttribute attribute)
        {
            string tagNameInLowercase = tag.NameInLowercase;
            string attributeNameInLowercase = attribute.NameInLowercase;
            string attributeValue = attribute.Value;
            HtmlAttributeType attributeType = attribute.Type;

            bool result = false;
            bool isZeroLengthString = attributeValue.Length == 0;

            if (isZeroLengthString || string.IsNullOrWhiteSpace(attributeValue))
            {
                if (tagNameInLowercase == "input" && attributeNameInLowercase == "value")
                {
                    result = isZeroLengthString;
                }
                else if (attributeType == HtmlAttributeType.Event
                    || (tagNameInLowercase == "form" && attributeNameInLowercase == "action")
                    || _emptyAttributesForRemoval.Contains(attributeNameInLowercase))
                {
                    result = true;
                }
            }

            return result;
        }