Search in sources :

Example 31 with ICSSSelector

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

the class CSSSelectorTest method testSelector01.

public void testSelector01() {
    ICSSSelectorList list = createSelectorList("H1, H2, H3");
    checkSelectorList(list, "H1, H2, H3", 3, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H1", 1, 1, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H1", false, 0, 0, 0, 0);
    selector = list.getSelector(1);
    checkSelector(selector, "H2", 1, 1, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H2", 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 32 with ICSSSelector

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

the class CSSSelectorTest method testSelector27.

public void testSelector27() {
    ICSSSelectorList list = createSelectorList("HTML:lang(de) > Q");
    checkSelectorList(list, "HTML:lang(de) > Q", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "HTML:lang(de) > Q", 3, 102, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "HTML", false, 0, 0, 0, 1);
    checkSimpleSelectorPseudoNames(item, new String[] { "lang(de)" });
    item = selector.getItem(1);
    checkSelectorCombinator(item, ">", ICSSSelectorCombinator.CHILD);
    item = selector.getItem(2);
    checkSimpleSelector(item, "Q", 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 33 with ICSSSelector

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

the class CSSSelectorTest method testSelector07.

public void testSelector07() {
    ICSSSelectorList list = createSelectorList("*[lang=fr]");
    checkSelectorList(list, "*[lang=fr]", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "*[lang=fr]", 1, 100, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "*", true, 1, 0, 0, 0);
    checkSimpleSelectorAttributes(item, new String[] { "lang=fr" });
}
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 34 with ICSSSelector

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

the class CSSSelectorTest method testSelector23.

public void testSelector23() {
    ICSSSelectorList list = createSelectorList("* > A:first-child");
    checkSelectorList(list, "* > A:first-child", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "* > A:first-child", 3, 101, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "*", true, 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[] { "first-child" });
}
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 35 with ICSSSelector

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

the class CSSSelectorTest method testSelector33.

public void testSelector33() {
    ICSSSelectorList list = createSelectorList(".123");
    checkSelectorList(list, ".123", 1, 1);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, ".123", 1, 100, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "", true, 0, 1, 0, 0);
    checkSimpleSelectorClasses(item, new String[] { "123" });
}
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