public boolean hasEmbeddedCSS(String css) { Element head = getHeadElement(); for (Element style : head.getChildElements("style")) { if (style.getText().contains(css)) { return true; } } return false; }
public boolean hasEmbeddedJavaScript(String javaScript) { Element head = getHeadElement(); for (Element script : head.getChildElements("script")) { String type = script.getAttributeValue("type"); if ("text/javascript".equals(type) && script.getText().contains(javaScript)) { return true; } } return false; }
public boolean hasJavaScriptDeclaration(String cssFilename) { Element head = getHeadElement(); for (Element script : head.getChildElements("script")) { String type = script.getAttributeValue("type"); String src = script.getAttributeValue("src"); if ("text/javascript".equals(type) && cssFilename.equals(src)) { return true; } } return false; }
public boolean hasCSSDeclaration(String cssFilename) { Element head = getHeadElement(); for (Element link : head.getChildElements("link")) { String href = link.getAttributeValue("href"); String type = link.getAttributeValue("type"); String rel = link.getAttributeValue("rel"); if (cssFilename.equals(href) && "text/css".equals(type) && "stylesheet".equals(rel)) { return true; } } return false; }