Search in sources :

Example 21 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector11.

public void testSelector11() {
    ICSSSelectorList list = createSelectorList("H1#z98y");
    checkSelectorList(list, "H1#z98y", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H1#z98y", 1, 10001, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H1", false, 0, 0, 1, 0);
    checkSimpleSelectorIDs(item, new String[] { "z98y" });
}
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 22 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector26.

public void testSelector26() {
    ICSSSelectorList list = createSelectorList("A:focus:hover");
    checkSelectorList(list, "A:focus:hover", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "A:focus:hover", 1, 201, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "A", false, 0, 0, 0, 2);
    checkSimpleSelectorPseudoNames(item, new String[] { "focus", "hover" });
}
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 23 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector17.

public void testSelector17() {
    ICSSSelectorList list = createSelectorList("MATH + P");
    checkSelectorList(list, "MATH + P", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "MATH + P", 3, 2, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "MATH", false, 0, 0, 0, 0);
    item = selector.getItem(1);
    checkSelectorCombinator(item, "+", ICSSSelectorCombinator.ADJACENT);
    item = selector.getItem(2);
    checkSimpleSelector(item, "P", 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 24 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector30.

public void testSelector30() {
    ICSSSelectorList list = createSelectorList("H1.123");
    checkSelectorList(list, "H1.123", 1, 1);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H1.123", 1, 101, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H1", false, 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 25 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector05.

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