*
* @deprecated Use {@link #getCompleteStyles(String)}
*/
public static Styles getStyles(String cssValues, boolean specified) {
CSSParser parser = CSS_PARSER_FACTORY.createStrictParser();
// Create a new styled element.
Styles styles = new StylesImpl();
if (cssValues != null) {
String selectorBlock = null;
String pseudoSelectorBlock = null;
// Determine if there are multiple selector rules to be
// parsed and what type they are (i.e. pseudo or standard)
if (cssValues.indexOf('{') == -1) {
// No pseudoselector rules were specified
selectorBlock = cssValues;
} else if ('{' == cssValues.charAt(0)) {
// Both standard and pseudoselector rules were specified
int index = cssValues.indexOf("}");
selectorBlock = cssValues.substring(1, index);
pseudoSelectorBlock = cssValues.substring(index + 1);
} else {
// No standard selector rules were specified
pseudoSelectorBlock = cssValues;
}
// Put the standard selector rules onto the styled element
if (selectorBlock != null) {
// Parse the values into a properties object.
StyleProperties properties = parser.parseDeclarations(
selectorBlock);
// Translate that to a property values object.
setComputedValuesFromProperties(styles, properties, specified);
}