示例#1
0
 private static bool IsJavaScript(HtmlElement element)
 {
     if (!element.Name.Equals("script", StringComparison.OrdinalIgnoreCase))
     {
         return(false);
     }
     return(IsAttributeValueJs(element.FindAttribute("type")?.Value));
 }
示例#2
0
 private static bool IsCssStyle(HtmlElement element)
 {
     if (!element.Name.Equals("style", StringComparison.OrdinalIgnoreCase))
     {
         return(false);
     }
     return(IsAttributeValueCss(element.FindAttribute("type")?.Value));
 }
示例#3
0
        static HtmlScriptStyleElement GetElementMinificationType(HtmlElement element)
        {
            if (element.Name.Equals("script", StringComparison.OrdinalIgnoreCase))
            {
                return(GetJavascriptElementMinificationType(element.FindAttribute("type")?.Value));
            }

            if (element.Name.Equals("style", StringComparison.OrdinalIgnoreCase) && IsAttributeValueCss(element.FindAttribute("type")?.Value))
            {
                return(HtmlScriptStyleElement.Style);
            }

            return(HtmlScriptStyleElement.NA);
        }