// Default values if not specified in styles
String startColor = "#ffffff";
String endColor = startColor;
Styles styles = element.getStyles();
StyleValue startColorValue = styles.getPropertyValues().getComputedValue(StylePropertyDetails.BACKGROUND_COLOR);
if(startColorValue != null) {
startColor = startColorValue.getStandardCSS();
}
//if default color is set, it should be change for highlight effect to white color
if(startColor.equals("transparent")) {
startColor = "#ffffff";
}
Styles focusStyles = styles.findNestedStyles(StatefulPseudoClasses.FOCUS);
if (focusStyles != null) {
StyleValue endColorValue = focusStyles.getPropertyValues().getComputedValue(StylePropertyDetails.BACKGROUND_COLOR);
if (endColorValue != null) {
endColor = endColorValue.getStandardCSS();
// highlight effect overrides standard behaviour of focus
focusStyles.getPropertyValues().setComputedAndSpecifiedValue(StylePropertyDetails.BACKGROUND_COLOR, startColorValue);
}
}
Element newElement = element.getDOMFactory().createElement();
newElement.setName("script");