combined.setType(type);
}
// Iterate over all the entities qualifying the properties,
// adding them separately and to a combined sequence as
// necessary.
pseudoPath.accept(new PseudoStyleEntityVisitor() {
public void visit(StatefulPseudoClassSet pseudoClassSet) {
// If we haven't seen this pseudo class yet...
if (!pseudoClassSets.contains(pseudoClassSet)) {
pseudoClassSets.add(pseudoClassSet);
// ... then create sequence for it and add to list.
TypeSelectorSequence sequence =
new TypeSelectorSequence();
sequence.addPseudoClassSet(pseudoClassSet);
selectorList.add(sequence);
}
// Add pseudo class selector to combined selector.
combined.addPseudoClassSet(pseudoClassSet);
}
public void visit(PseudoElement pseudoElement) {
// If we haven't seen this pseudo element yet...
if (!pseudoElementSet.contains(pseudoElement)) {
pseudoElementSet.add(pseudoElement);
// ... then create sequence for it and add to list.
TypeSelectorSequence sequence =
new TypeSelectorSequence();
sequence.addPseudoElement(pseudoElement);
selectorList.add(sequence);
}
// Add pseudo class to combined selector.
combined.addPseudoElement(pseudoElement);
}
});
// If the combined sequence isn't simple and we haven't seen
// this combined sequence yet...
if (combined.isComposite() &&
!combinedSet.contains(combined)) {
combinedSet.add(combined);
// Then add it to the list.
final TypeSelectorSequence sequence =
new TypeSelectorSequence();
if (combined.getType() != null) {
sequence.setType(combined.getType());
}
pseudoPath.accept(new PseudoStyleEntityVisitor() {
public void visit(StatefulPseudoClassSet pseudoClassSet) {
sequence.addPseudoClassSet(pseudoClassSet);
}
public void visit(PseudoElement pseudoElement) {