Search in sources :

Example 41 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector02.

// see 214416 Dot char is not escaped in XML10Names.jFlex
// for complications leading to this test being changed.
public void testSelector02() {
    ICSSSelectorList list = createSelectorList("H\\\\, H\\1, H3");
    checkSelectorList(list, "H\\\\, H\\1, H3", 3, 2);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H\\\\", 1, 1, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H\\\\", false, 0, 0, 0, 0);
    selector = list.getSelector(1);
    checkSelector(selector, "H\\1", 1, 1, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H\\1", 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 42 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector28.

public void testSelector28() {
    ICSSSelectorList list = createSelectorList("P > A:link, A.external:visited");
    checkSelectorList(list, "P > A:link, A.external:visited", 2, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "P > A:link", 3, 102, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "P", false, 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[] { "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 43 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector19.

public void testSelector19() {
    ICSSSelectorList list = createSelectorList("EXAMPLE[notation=decimal]");
    checkSelectorList(list, "EXAMPLE[notation=decimal]", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "EXAMPLE[notation=decimal]", 1, 101, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "EXAMPLE", false, 1, 0, 0, 0);
    checkSimpleSelectorAttributes(item, new String[] { "notation=decimal" });
}
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 44 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector20.

public void testSelector20() {
    ICSSSelectorList list = createSelectorList("SPAN[hello=\"Cleveland\"][goodbye=\"Columbus\"]");
    checkSelectorList(list, "SPAN[hello=\"Cleveland\"][goodbye=\"Columbus\"]", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "SPAN[hello=\"Cleveland\"][goodbye=\"Columbus\"]", 1, 201, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "SPAN", false, 2, 0, 0, 0);
    checkSimpleSelectorAttributes(item, new String[] { "hello=\"Cleveland\"", "goodbye=\"Columbus\"" });
}
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 45 with ICSSSelectorItem

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

the class CSSSelectorTest method testSelector06.

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