Search in sources :

Example 36 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector34.

public void testSelector34() {
    ICSSSelectorList list = createSelectorList("H1.1x3");
    checkSelectorList(list, "H1.1x3", 1, 1);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H1.1x3", 1, 101, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H1", false, 0, 1, 0, 0);
    checkSimpleSelectorClasses(item, new String[] { "1x3" });
}
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 37 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector21.

public void testSelector21() {
    ICSSSelectorList list = createSelectorList("DIV > P:first-child");
    checkSelectorList(list, "DIV > P:first-child", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "DIV > P:first-child", 3, 102, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "DIV", false, 0, 0, 0, 0);
    item = selector.getItem(1);
    checkSelectorCombinator(item, ">", ICSSSelectorCombinator.CHILD);
    item = selector.getItem(2);
    checkSimpleSelector(item, "P", 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 38 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector32.

public void testSelector32() {
    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)

Example 39 with ICSSSelectorItem

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem 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 40 with ICSSSelectorItem

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem 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)

Aggregations

ICSSSelectorItem (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)47 ICSSSelector (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector)42 ICSSSelectorList (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList)41 ICSSSimpleSelector (org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector)6 Iterator (java.util.Iterator)4 ICSSSelectorCombinator (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorCombinator)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Element (org.w3c.dom.Element)1