Search in sources :

Example 41 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector25.

public void testSelector25() {
    ICSSSelectorList list = createSelectorList(":link");
    checkSelectorList(list, ":link", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, ":link", 1, 100, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "", true, 0, 0, 0, 1);
    checkSimpleSelectorPseudoNames(item, new String[] { "link" });
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Example 42 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector04.

public void testSelector04() {
    ICSSSelectorList list = createSelectorList("P.pastoral.marine");
    checkSelectorList(list, "P.pastoral.marine", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "P.pastoral.marine", 1, 201, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "P", false, 0, 2, 0, 0);
    checkSimpleSelectorClasses(item, new String[] { "pastoral", "marine" });
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Example 43 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector02.

// see 214416 Dot char is not escaped in XML10Names.jFlex
// for complications leading to this test being changed.
public void testSelector02() {
    ICSSSelectorList list = createSelectorList("H\\\\, H\\1, H3");
    checkSelectorList(list, "H\\\\, H\\1, H3", 3, 2);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H\\\\", 1, 1, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H\\\\", false, 0, 0, 0, 0);
    selector = list.getSelector(1);
    checkSelector(selector, "H\\1", 1, 1, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H\\1", false, 0, 0, 0, 0);
    selector = list.getSelector(2);
    checkSelector(selector, "H3", 1, 1, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H3", false, 0, 0, 0, 0);
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Example 44 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector28.

public void testSelector28() {
    ICSSSelectorList list = createSelectorList("P > A:link, A.external:visited");
    checkSelectorList(list, "P > A:link, A.external:visited", 2, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "P > A:link", 3, 102, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "P", false, 0, 0, 0, 0);
    item = selector.getItem(1);
    checkSelectorCombinator(item, ">", ICSSSelectorCombinator.CHILD);
    item = selector.getItem(2);
    checkSimpleSelector(item, "A", false, 0, 0, 0, 1);
    checkSimpleSelectorPseudoNames(item, new String[] { "link" });
    selector = list.getSelector(1);
    checkSelector(selector, "A.external:visited", 1, 201, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "A", false, 0, 1, 0, 1);
    checkSimpleSelectorClasses(item, new String[] { "external" });
    checkSimpleSelectorPseudoNames(item, new String[] { "visited" });
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Example 45 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector19.

public void testSelector19() {
    ICSSSelectorList list = createSelectorList("EXAMPLE[notation=decimal]");
    checkSelectorList(list, "EXAMPLE[notation=decimal]", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "EXAMPLE[notation=decimal]", 1, 101, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "EXAMPLE", false, 1, 0, 0, 0);
    checkSimpleSelectorAttributes(item, new String[] { "notation=decimal" });
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Aggregations

ICSSSelector (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector)52 ICSSSelectorList (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList)48 ICSSSelectorItem (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)42 Iterator (java.util.Iterator)7 ICSSStyleRule (org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule)3 ImportedCollector (org.eclipse.wst.css.core.internal.util.ImportedCollector)3 SelectorsCollector (org.eclipse.wst.css.core.internal.util.SelectorsCollector)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ICSSNode (org.eclipse.wst.css.core.internal.provisional.document.ICSSNode)2 ICSSSimpleSelector (org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector)2 ICSSStyleSheet (org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet)2 Vector (java.util.Vector)1 CSSTextParser (org.eclipse.wst.css.core.internal.parserz.CSSTextParser)1 CSSTextToken (org.eclipse.wst.css.core.internal.parserz.CSSTextToken)1 ICSSImportRule (org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule)1 ICSSValue (org.eclipse.wst.css.core.internal.provisional.document.ICSSValue)1 ImportRuleCollector (org.eclipse.wst.css.core.internal.util.ImportRuleCollector)1