// Then extract the appropriate properties from the styles.
MutableStyleProperties properties = null;
PseudoStylePath pseudoPath = selectorSequence.getPath();
// If the element has styles
OutputStyles styles = element.getStyles();
if (styles != null) {
// Then we might have some style properties.
properties = styles.getPathProperties(pseudoPath);
}
// else, no styles. This means the properties are empty.
action = filtered.next(properties);
// the filtered may remove property values, so we need to check
// to see if the containing objects are still required.
if (properties != null && properties.isEmpty()) {
// if the properties is now empty, remove it.
styles.removePathProperties(pseudoPath);
if (styles.isEmpty()) {
element.clearStyles();
}
}
}