Search in sources :

Example 26 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector29.

public void testSelector29() {
    ICSSSelectorList list = createSelectorList("P#hoge98 + *:hover > A:link, A.external:visited");
    checkSelectorList(list, "P#hoge98 + *:hover > A:link, A.external:visited", 2, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "P#hoge98 + *:hover > A:link", 5, 10202, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "P", false, 0, 0, 1, 0);
    checkSimpleSelectorIDs(item, new String[] { "hoge98" });
    item = selector.getItem(1);
    checkSelectorCombinator(item, "+", ICSSSelectorCombinator.ADJACENT);
    item = selector.getItem(2);
    checkSimpleSelector(item, "*", true, 0, 0, 0, 1);
    checkSimpleSelectorPseudoNames(item, new String[] { "hover" });
    item = selector.getItem(3);
    checkSelectorCombinator(item, ">", ICSSSelectorCombinator.CHILD);
    item = selector.getItem(4);
    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 27 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector38.

public void testSelector38() {
    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 28 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector22.

public void testSelector22() {
    ICSSSelectorList list = createSelectorList("P:first-child EM");
    checkSelectorList(list, "P:first-child EM", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "P:first-child EM", 3, 102, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "P", false, 0, 0, 0, 1);
    checkSimpleSelectorPseudoNames(item, new String[] { "first-child" });
    item = selector.getItem(1);
    checkSelectorCombinator(item, " ", ICSSSelectorCombinator.DESCENDANT);
    item = selector.getItem(2);
    checkSimpleSelector(item, "EM", 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 29 with ICSSSelectorItem

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

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

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