Examples of ICSSStyleRule


Examples of org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule

  /**
   */
  protected short preNode(ICSSNode node) {
    if (node instanceof ICSSStyleRule) {
      // style rule
      ICSSStyleRule style = (ICSSStyleRule) node;
      ICSSSelectorList list = style.getSelectors();
      int nSelectors = list.getLength();
      int maxSpecificity = -1;
      for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
        // Check each Selector Lists
        ICSSSelector selector = list.getSelector(iSelector);
        int specificity = selector.getSpecificity();
        if (maxSpecificity < specificity && selector.match(element, pseudoName)) {
          maxSpecificity = specificity;
        }
      }
      if (maxSpecificity >= 0) {
        // apply this style to the element
        overwriteDeclaration((ICSSStyleDeclaration) style.getStyle(), maxSpecificity);
      }
      return TRAV_PRUNE;
    }
    return TRAV_CONT;
  }
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.