Package org.w3c.css.sac

Examples of org.w3c.css.sac.Selector


            final CSSRule rule = rules.item(i);
            if (rule.getType() == CSSRule.STYLE_RULE) {
                final CSSStyleRuleImpl styleRule = (CSSStyleRuleImpl) rule;
                final SelectorList selectors = styleRule.getSelectors();
                for (int j = 0; j < selectors.getLength(); j++) {
                    final Selector selector = selectors.item(j);
                    final boolean selected = selects(selector, e);
                    if (selected) {
                        final org.w3c.dom.css.CSSStyleDeclaration dec = styleRule.getStyle();
                        style.applyStyleFromSelector(dec, selector);
                    }
View Full Code Here


    /**
     * Parses a selector.
     */
    protected Selector parseSelector() {
        SimpleSelector ss = parseSimpleSelector();
        Selector result = ss;

        pseudoElement = null;

        loop: for (;;) {
            switch (current) {
View Full Code Here

    /**
     * Parses a selector.
     */
    protected Selector parseSelector() {
        pseudoElement = null;
        Selector result = parseSimpleSelector();

        loop: for (;;) {
            switch (current) {
            default:
                break loop;
View Full Code Here

        // 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.
            if (i > 0)
                declaration = declaration.shallowCopy();

            if (selector.getSelectorType() == Selector.SAC_ELEMENT_NODE_SELECTOR)
            {
                addSimpleTypeSelector((ElementSelector)selector, declaration, mediaList, isLocal);
            }
            else if (selector.getSelectorType() == Selector.SAC_CONDITIONAL_SELECTOR)
            {
                addConditionalSelector((ConditionalSelector)selector, declaration, mediaList);
            }
            else if (selector.getSelectorType() == Selector.SAC_DESCENDANT_SELECTOR)
            {
                addDescendantSelector((DescendantSelector)selector, declaration, mediaList);
            }
            else
            {
View Full Code Here

            // We may have conditions too, so we call convertSelector().
            simpleTypeSelector = convertSelector(simpleSelector, declaration);
            if (simpleTypeSelector != null)
            {
                Selector ancestorSelector = descendantSelector.getAncestorSelector();
                simpleTypeSelector.setAncestor(convertSelector(ancestorSelector, declaration));
            }
        }
        else
        {
View Full Code Here

    /**
     * Parses a selector.
     */
    protected Selector parseSelector() {
        SimpleSelector ss = parseSimpleSelector();
        Selector result = ss;

        pseudoElement = null;

        loop: for (;;) {
            switch (current) {
View Full Code Here

  }

  public void startSelector(SelectorList selectors) throws CSSException {
    for (int i = 0; i < selectors.getLength(); i++) {
      Selector selector = selectors.item(i);
      if (i > 0)
        _buffer.append(',');
      _buffer.append(selector.toString());
    }
    _buffer.append("{");
  }
View Full Code Here

  }

  public void startSelector(SelectorList selectors) throws CSSException {
    for (int i = 0; i < selectors.getLength(); i++) {
      Selector selector = selectors.item(i);
      if (i > 0)
        _buffer.append(',');
      _buffer.append(selector.toString());
    }
    _buffer.append("{");
  }
View Full Code Here

    }
  }

  final public SelectorList selectorList() throws ParseException {
    SelectorListImpl selectors = new SelectorListImpl();
    Selector selector;
    selector = selector();
    label_40:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case COMMA:
View Full Code Here

/**
* @exception ParseException exception during the parse
*/
  final public Selector selector() throws ParseException {
    Selector selector;
    char    comb;
    try {
      selector = simple_selector(null, ' ');
      label_42:
      while (true) {
View Full Code Here

TOP

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

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.