コード例 #1
0
 public void addSelectorToAvoid(ICSSStyleRule rule) {
   ICSSSelectorList list = rule.getSelectors();
   Iterator it = list.getIterator();
   while (it.hasNext()) {
     ICSSSelector sel = (ICSSSelector) it.next();
     addSelectorToAvoid(sel);
   }
 }
コード例 #2
0
 protected short preNode(ICSSNode node) {
   if (node.getNodeType() == ICSSNode.STYLERULE_NODE) {
     ICSSStyleRule rule = (ICSSStyleRule) node;
     ICSSSelectorList list = rule.getSelectors();
     Iterator it = list.getIterator();
     while (it.hasNext()) {
       Object obj = it.next();
       if (selectorsToAvoid != null && selectorsToAvoid.contains(obj)) continue;
       if (!selectors.contains(obj)) selectors.add(obj);
     }
     return TRAV_PRUNE;
   } else if (node.getNodeType() == ICSSNode.STYLESHEET_NODE) {
     return TRAV_CONT;
   }
   return TRAV_PRUNE;
 }