예제 #1
0
 public boolean hasEmbeddedCSS(String css) {
   Element head = getHeadElement();
   for (Element style : head.getChildElements("style")) {
     if (style.getText().contains(css)) {
       return true;
     }
   }
   return false;
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
 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;
 }