Examples of CSSRule


Examples of org.w3c.dom.css.CSSRule

   *
   * @return DOCUMENT ME!
   */
  public String toString() {
    CStringBuilder result = new CStringBuilder();
    CSSRule       rule  = this;
    int         level = 0;

    while (rule.getParentRule() != null) {
      level++;
      rule = rule.getParentRule();
    } // end while

    for (int i = 0; i < level; i++) {
      result.append("\t");
    } // end for
View Full Code Here

Examples of org.w3c.dom.css.CSSRule

 
  private void parseSelectors(CSSStyleSheet css,List result) {
    CSSRuleList ruleList = css.getCssRules();
   
    for (int j = 0; j < ruleList.getLength(); j++) {
      CSSRule rule = ruleList.item(j);

      if (rule == null) {
        continue;
      }

      if (rule.getType() == CSSRule.STYLE_RULE) {
        CSSStyleRule      cssRule = (CSSStyleRule) rule;
        CSSStyleDeclaration decl = cssRule.getStyle();
        StringTokenizer selectorsToken = new StringTokenizer(cssRule.getSelectorText(),",", false);
        while (selectorsToken.hasMoreTokens()) {
          String   selector = selectorsToken.nextToken().trim();
          CElement element = getElements(selector);
          if (element != null) {
            result.add(new CStyle(element,decl));
          }
        }
      } // end if
      else if (rule.getType() == CSSRule.IMPORT_RULE) {
        CSSStyleSheet importCSS = ((CSSImportRule) rule).getStyleSheet();
        parseSelectors(importCSS,result);
      } // end else if
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.