Package org.w3c.css.sac

Examples of org.w3c.css.sac.Condition


* @exception ParseException exception during the parse
*/
  final public Condition hash(Condition pred) throws ParseException {
Token n;
    n = jj_consume_token(HASH);
      Condition d =
          conditionFactory.createIdCondition(n.image.substring(1));
      if (pred == null) {
          {if (true) return d;}
      } else {
          {if (true) return conditionFactory.createAndCondition(pred, d);}
View Full Code Here


        case LexicalUnits.ANY:
            next();
        default:
            result = selectorFactory.createElementSelector(null, null);
        }
        Condition cond = null;
        loop: for (;;) {
            Condition c = null;
            switch (current) {
            case LexicalUnits.HASH:
                c = conditionFactory.createIdCondition(scanner.currentValue());
                next();
                break;
View Full Code Here

                    oldConditionSelector.getCondition());
        }
        if (candidateSelector instanceof ConditionalSelector) {
            // TODO some cases not covered.
            ConditionalSelector candidateConditionSelector = (ConditionalSelector) candidateSelector;
            Condition newCondition = createConditionWithSomePartReplaced(
                    oldConditionSelector.getCondition(),
                    toBeReplacedSelectorName,
                    candidateConditionSelector.getCondition());
            return selectorFactory.createConditionalSelector(
                    oldConditionSelector.getSimpleSelector(), newCondition);
View Full Code Here

            return oldCondition;
        }
        if (oldCondition.getConditionType() == Condition.SAC_AND_CONDITION) {
            ConditionFactory conditionFactory = new ConditionFactoryImpl();
            CombinatorCondition oldCombinatorCondition = (CombinatorCondition) oldCondition;
            Condition newFirstCondition = createConditionWithSomePartReplaced(
                    oldCombinatorCondition.getFirstCondition(), toBeReplaced,
                    candidate);
            Condition newSecondCondition = createConditionWithSomePartReplaced(
                    oldCombinatorCondition.getSecondCondition(), toBeReplaced,
                    candidate);
            return conditionFactory.createAndCondition(newFirstCondition,
                    newSecondCondition);
        } else {
View Full Code Here

                simpleTypeSelector = convertTypeSelector((ElementSelector)simpleSelector, declaration);
            }

            if (simpleTypeSelector != null)
            {
                Condition condition = conditionalSelector.getCondition();
                boolean supportedCondition = convertCondition(simpleTypeSelector, condition);
                if (!supportedCondition)
                {
                    int lineNumber = getSelectorLineNumber(selector, declaration);
                    String path = getPathForReporting(declaration);
View Full Code Here

          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();
              SimpleSelector simple = ((ConditionalSelector) sel).getSimpleSelector();

              if (simple instanceof ElementSelector) {
                String tagName = ((ElementSelector) simple).getLocalName();
                if (tagName == null) {
View Full Code Here

    {
      return false;
    }

    final ConditionalSelector cs = (ConditionalSelector) selector;
    final Condition condition = cs.getCondition();
    if (condition.getConditionType() != Condition.SAC_PSEUDO_CLASS_CONDITION)
    {
      return false;
    }
    return true;
  }
View Full Code Here

    {
      final CSSStyleRule activeStyleRule = activePseudoStyleRules[i];

      final CSSSelector selector = activeStyleRule.getSelector();
      final ConditionalSelector cs = (ConditionalSelector) selector;
      final Condition condition = cs.getCondition();

      final AttributeCondition ac = (AttributeCondition) condition;
      if (ObjectUtilities.equal(ac.getValue(), pseudo) == false)
      {
        continue;
View Full Code Here

    {
      return false;
    }

    final ConditionalSelector cs = (ConditionalSelector) selector;
    final Condition condition = cs.getCondition();
    if (condition.getConditionType() != Condition.SAC_PSEUDO_CLASS_CONDITION)
    {
      return false;
    }
    return true;
  }
View Full Code Here

    {
      final CSSStyleRule activeStyleRule = activePseudoStyleRules[i];

      final CSSSelector selector = activeStyleRule.getSelector();
      final ConditionalSelector cs = (ConditionalSelector) selector;
      final Condition condition = cs.getCondition();

      final AttributeCondition ac = (AttributeCondition) condition;
      if (ObjectUtilities.equal(ac.getValue(), pseudo) == false)
      {
        continue;
View Full Code Here

TOP

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

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.