Package org.w3c.css.sac

Examples of org.w3c.css.sac.SelectorList


     * Parses selectors using the current scanner.
     */
    protected SelectorList parseSelectorsInternal()
        throws CSSException, IOException {
        nextIgnoreSpaces();
        SelectorList ret = parseSelectorList();
        scanner = null;
        return ret;
    }
View Full Code Here


    /**
     * Parses a ruleset.
     */
    protected void parseRuleSet() {
        SelectorList sl = null;

        try {
            sl = parseSelectorList();
        } catch (CSSParseException e) {
            reportError(e);
View Full Code Here

        for (int i = 0; i < len; i++) {
            Rule r = ss.getRule(i);
            switch (r.getType()) {
            case StyleRule.TYPE:
                StyleRule style = (StyleRule)r;
                SelectorList sl = style.getSelectorList();
                int slen = sl.getLength();
                for (int j = 0; j < slen; j++) {
                    ExtendedSelector s = (ExtendedSelector)sl.item(j);
                    s.fillAttributeSet(attrs);
                }
                break;

            case MediaRule.TYPE:
View Full Code Here

        for (int i = 0; i < len; i++) {
            Rule r = ss.getRule(i);
            switch (r.getType()) {
            case StyleRule.TYPE:
                StyleRule style = (StyleRule)r;
                SelectorList sl = style.getSelectorList();
                int slen = sl.getLength();
                for (int j = 0; j < slen; j++) {
                    ExtendedSelector s = (ExtendedSelector)sl.item(j);
                    if (s.match(elt, pseudo)) {
                        rules.add(style);
                    }
                }
                break;
View Full Code Here

    protected void sortRules(ArrayList rules, Element elt, String pseudo) {
        int len = rules.size();
        int[] specificities = new int[len];
        for (int i = 0; i < len; i++) {
            StyleRule r = (StyleRule) rules.get(i);
            SelectorList sl = r.getSelectorList();
            int spec = 0;
            int slen = sl.getLength();
            for (int k = 0; k < slen; k++) {
                ExtendedSelector s = (ExtendedSelector) sl.item(k);
                if (s.match(elt, pseudo)) {
                    int sp = s.getSpecificity();
                    if (sp > spec) {
                        spec = sp;
                    }
View Full Code Here

     * @param isLocal
     */
    protected void addStyleRule(StyleRule rule, MediaList mediaList, boolean isLocal)
    {
        // for each selector in this rule
        SelectorList selectors = rule.getSelectorList();
        int nSelectors = selectors.getLength();
        for (int i = 0; i < nSelectors; i++)
        {
            Selector selector = selectors.item(i);
            StyleDeclaration declaration = rule.getStyleDeclaration();

            // If we have a list of selectors, copy the shared
            // StyleDeclaration so that we can independently track
            // subject and selectors per instance.
View Full Code Here

     * Parses selectors using the current scanner.
     */
    protected SelectorList parseSelectorsInternal()
  throws CSSException, IOException {
        nextIgnoreSpaces();
        SelectorList ret = parseSelectorList();
        scanner = null;
        return ret;
    }
View Full Code Here

    /**
     * Parses a ruleset.
     */
    protected void parseRuleSet() {
        SelectorList sl = null;

        try {
            sl = parseSelectorList();
        } catch (CSSParseException e) {
            reportError(e);
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.css.CSSRule#setCssText(String)}.
     */
    public void setCssText(String cssText) throws DOMException {
  SelectorList s = selectors;
  CSSOMStyleDeclaration sd = style;
  try {
      fireCSSStyleRuleChangeStart();
      style = new CSSOMStyleDeclaration(this, parser);
      style.addCSSStyleDeclarationChangeListener(this);
View Full Code Here

    public void setSelectorText(String selectorText) throws DOMException {
  try {
      InputSource is = new InputSource(new StringReader(selectorText));
      parser.setSelectorFactory(SELECTOR_FACTORY);
      parser.setConditionFactory(CONDITION_FACTORY);
      SelectorList sl = selectors;
      selectors = parser.parseSelectors(is);
      if (styleRuleChangeSupport != null) {
    styleRuleChangeSupport.fireSelectorListChange(sl, selectors);
      }
  } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.w3c.css.sac.SelectorList

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.