Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSStyleRule


      CSSRuleList list = stylesheet.getCssRules();
//      ArrayList assists = new ArrayList();
      for(int i=0;i<list.getLength();i++){
        CSSRule rule = list.item(i);
        if(rule instanceof CSSStyleRule){
          CSSStyleRule styleRule = (CSSStyleRule)rule;
          String selector = styleRule.getSelectorText();
          SelectorList selectors = parser.parseSelectors(new InputSource(new StringReader(selector)));
          for(int j=0;j<selectors.getLength();j++){
            Selector sel = selectors.item(j);
            if(sel instanceof ConditionalSelector){
              Condition cond = ((ConditionalSelector)sel).getCondition();
View Full Code Here


  if (userAgentStyleSheet != null) {
      addMatchingRules(userAgentStyleSheet.getCssRules(), e, pe,
                             null, uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserAgentProperty(decl.item(j), decl, rd);
    }
      }
View Full Code Here

 
  if (userStyleSheet != null) {
      addMatchingRules(userStyleSheet.getCssRules(), e, pe, null, uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserProperty(decl.item(j), decl, rd);
    }
      }
View Full Code Here

  if (userAgentStyleSheet != null) {
      addMatchingRules(userAgentStyleSheet.getCssRules(), e, pe,
                             uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserAgentProperty(decl.item(j), decl, rd);
    }
      }
View Full Code Here

 
  if (userStyleSheet != null) {
      addMatchingRules(userStyleSheet.getCssRules(), e, pe, uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserProperty(decl.item(j), decl, rd);
    }
      }
View Full Code Here

                                 pe,
                                 authorRules);
            }
            authorRules = sortRules(authorRules, e, pe);
            for (int i = 0; i < authorRules.getLength(); i++) {
                CSSStyleRule rule = (CSSStyleRule)authorRules.item(i);
                CSSStyleDeclaration decl = rule.getStyle();
                int len = decl.getLength();
                for (int j = 0; j < len; j++) {
                    setAuthorProperty(decl.item(j), decl, rd);
                }
            }
View Full Code Here

      CSSRuleList list = stylesheet.getCssRules();
      //      ArrayList assists = new ArrayList();
      for (int i = 0; i < list.getLength(); i++) {
        CSSRule rule = list.item(i);
        if (rule instanceof CSSStyleRule) {
          CSSStyleRule styleRule = (CSSStyleRule) rule;
          String selector = styleRule.getSelectorText();
          SelectorList selectors = parser.parseSelectors(new InputSource(new StringReader(selector)));
          for (int j = 0; j < selectors.getLength(); j++) {
            Selector sel = selectors.item(j);
            if (sel instanceof ConditionalSelector) {
              Condition cond = ((ConditionalSelector) sel).getCondition();
View Full Code Here

      this.selectors.clear();
      CSSRuleList list = stylesheet.getCssRules();
      for (int i = 0; i < list.getLength(); i++) {
        CSSRule rule = list.item(i);
        if (rule instanceof CSSStyleRule) {
          CSSStyleRule styleRule = (CSSStyleRule) rule;
          String selector = styleRule.getSelectorText();
          this.selectors.add(selector);
        }
      }
      getTreeViewer().refresh();
    }
View Full Code Here

        final List<CSSStyleRule> rules = new ArrayList<>();
        final CSSRuleList ruleList = styleSheet.getCssRules();
        for (int i = 0; i < ruleList.getLength(); i++) {
            final CSSRule rule = ruleList.item(i);
            if (rule instanceof CSSStyleRule) {
                final CSSStyleRule styleRule = (CSSStyleRule) rule;
                rules.add(styleRule);
            }
        }
        return rules;
View Full Code Here

  private ElementRuleList extractDOMModifications(List<CSSStyleRule> ruleList) {
    ElementRuleList modifierRules = new ElementRuleList();
   
    Iterator<CSSStyleRule> it = ruleList.iterator();
    while(it.hasNext()) {
      CSSStyleRule rule = it.next();
     
      PseudoClass pseudoModifier = getDOMModifier(rule.getSelectorText());
      if(pseudoModifier!=null) {
        ElementRule modifierRule = ElementRuleFactory.createElementRule(pseudoModifier, CSSUtil.asMap(rule.getStyle()));
        modifierRules.add(modifierRule);
        it.remove();
      }
    }
   
View Full Code Here

TOP

Related Classes of org.w3c.dom.css.CSSStyleRule

Copyright © 2018 www.massapicom. 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.