Package org.w3c.css.sac

Examples of org.w3c.css.sac.SelectorList


/**
* @exception ParseException exception during the parse
*/
  final public void styleRule() throws ParseException {
    boolean start = false;
    SelectorList l = null;
    Token save;
    Locator loc;
    try {
      l = selectorList();
                        save = token;
View Full Code Here


      }
    }
  }

  final public SelectorList _parseSelectors() throws ParseException {
  SelectorList p = null;
    try {
      label_75:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
View Full Code Here

  {
    super.doneParsing();
    try
    {
      final NamespaceCollection namespaceCollection = StyleSheetParserUtil.getInstance().getNamespaceCollection();
      final SelectorList selectorList = StyleSheetParserUtil.getInstance().parseSelector(namespaceCollection, getResult());
      for (int i = 0; i < selectorList.getLength(); i+= 1)
      {
        selector.add((CSSSelector) selectorList.item(i));
      }
    }
    catch (CSSParseException e)
    {
      throw new ParseException("Failed to parse selector", e, getLocator());
View Full Code Here

  }

  public void testParsing() throws Exception
  {
    final NamespaceCollection namespaceCollection = StyleSheetParserUtil.getInstance().getNamespaceCollection();
    final SelectorList selectorList = StyleSheetParserUtil.getInstance().parseSelector(namespaceCollection, "h1.test[x-lang=\"fr'\\\"\"]");
    for (int i = 0; i < selectorList.getLength(); i+= 1)
    {
      CSSSelector item = (CSSSelector) selectorList.item(i);
      System.out.println (item.print(namespaceCollection));
    }
  }
View Full Code Here

  }

  public void testParsingClass() throws Exception
  {
    final NamespaceCollection namespaceCollection = StyleSheetParserUtil.getInstance().getNamespaceCollection();
    final SelectorList selectorList = StyleSheetParserUtil.getInstance().parseSelector(namespaceCollection, ".\\aa  test");
    for (int i = 0; i < selectorList.getLength(); i+= 1)
    {
      CSSSelector item = (CSSSelector) selectorList.item(i);
      System.out.println (item.print(namespaceCollection));
    }
  }
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

        for (int i = 0; i < len - 1; i++) {
            int idx = i;
            int min = Integer.MAX_VALUE;
            for (int j = i; j < len; j++) {
                StyleRule r = (StyleRule)rules.get(j);
                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

        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

        for (int i = 0; i < len - 1; i++) {
            int idx = i;
            int min = Integer.MAX_VALUE;
            for (int j = i; j < len; j++) {
                StyleRule r = (StyleRule)rules.get(j);
                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

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.