SimpleSelector simpleSel = childSel.getSimpleSelector();
//
if (simpleSel.getSelectorType() == Selector.SAC_PSEUDO_ELEMENT_SELECTOR)
{
ElementSelector elementSel = (ElementSelector)simpleSel;
write(ancestorSel);
write(":");
write(elementSel.getLocalName());
}
else
{
write(ancestorSel);
write(">");
write(simpleSel);
}
break;
}
case Selector.SAC_DESCENDANT_SELECTOR : {
DescendantSelector descendantSel = (DescendantSelector)sel;
SimpleSelector simpleSel = descendantSel.getSimpleSelector();
write(descendantSel.getAncestorSelector());
//
if (simpleSel.getSelectorType() == Selector.SAC_PSEUDO_ELEMENT_SELECTOR)
{
ElementSelector pseudoElementSel = (ElementSelector)simpleSel;
write(":");
write(pseudoElementSel.getLocalName());
}
else
{
write(" ");
write(simpleSel);
}
break;
}
case Selector.SAC_ELEMENT_NODE_SELECTOR : {
ElementSelector elementSel = (ElementSelector)sel;
//
if (elementSel.getLocalName() == null)
{
// Universal element selector * that we can omit
}
else
{
write(elementSel.getLocalName());
}
break;
}
default :
throw new UnsupportedOperationException("Selector type = " + sel.getSelectorType() + " with class "