setShorthandBackgroundPosition static method
Implementation
static void setShorthandBackgroundPosition(Map<String, String?> properties, String shorthandValue) {
// Only the first layer contributes to longhands; layered painting reads
// the full comma-separated list directly from style.
final String firstLayer = splitByTopLevelDelimiter(shorthandValue, _commaCodeUnit).first.trim();
final List<String> positions = CSSPosition.parsePositionShorthand(firstLayer);
if (positions.length >= 2) {
properties[BACKGROUND_POSITION_X] = positions[0];
properties[BACKGROUND_POSITION_Y] = positions[1];
} else {
properties[BACKGROUND_POSITION_X] = '0%';
properties[BACKGROUND_POSITION_Y] = '0%';
}
}