private static bool IsJavaScript(HtmlElement element) { if (!element.Name.Equals("script", StringComparison.OrdinalIgnoreCase)) { return(false); } return(IsAttributeValueJs(element.FindAttribute("type")?.Value)); }
private static bool IsCssStyle(HtmlElement element) { if (!element.Name.Equals("style", StringComparison.OrdinalIgnoreCase)) { return(false); } return(IsAttributeValueCss(element.FindAttribute("type")?.Value)); }
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); }