Search in sources :

Example 16 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector08.

public void testSelector08() {
    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 17 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector37.

public void testSelector37() {
    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 18 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector09.

public void testSelector09() {
    ICSSSelectorList list = createSelectorList("*#myid");
    checkSelectorList(list, "*#myid", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "*#myid", 1, 10000, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "*", true, 0, 0, 1, 0);
    checkSimpleSelectorIDs(item, new String[] { "myid" });
}
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 19 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector31.

public void testSelector31() {
    ICSSSelectorList list = createSelectorList("P.123.456");
    checkSelectorList(list, "P.123.456", 1, 2);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "P.123.456", 1, 201, 2);
    item = selector.getItem(0);
    checkSimpleSelector(item, "P", false, 0, 2, 0, 0);
    checkSimpleSelectorClasses(item, new String[] { "123", "456" });
}
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 20 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector35.

public void testSelector35() {
    ICSSSelectorList list = createSelectorList("H2.123#46");
    checkSelectorList(list, "H2.123#46", 1, 1);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H2.123#46", 1, 10101, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H2", false, 0, 1, 1, 0);
    checkSimpleSelectorClasses(item, new String[] { "123" });
    checkSimpleSelectorIDs(item, new String[] { "46" });
}
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