throw new IllegalStateException("styles cannot be null");
}
counters.iterate(counterElementStarter);
PropertyValues values = styles.getPropertyValues();
if (values != null) {
// If this styles has display:none ...
StyleValue display = values.getComputedValue(
StylePropertyDetails.DISPLAY);
if (display == DisplayKeywords.NONE) {
// ... then it cannot increment or reset a counter.
} else {
// ... else it can increment and reset counters.
// So process the counters.
// Process any resets before any increments.
StyleValue reset = values.getComputedValue(
StylePropertyDetails.COUNTER_RESET);
if (reset != null) {
reset.visit(counterResetter, null);
}
StyleValue increment = values.getComputedValue(
StylePropertyDetails.COUNTER_INCREMENT);
if (increment != null) {
increment.visit(counterIncrementer, null);
}
}