def expand_text_decoration(tokens, name):
    """Expand the ``text-decoration`` shorthand property."""
    line = []
    color = []
    style = []
    thickness = []
    none_in_line = False

    for token in tokens:
        keyword = get_keyword(token)
        if keyword in ('none', 'underline', 'overline', 'line-through', 'blink'):
            line.append(token)
            if none_in_line:
                raise InvalidValues
            elif keyword == 'none':
                none_in_line = True
        elif keyword in ('solid', 'double', 'dotted', 'dashed', 'wavy'):
            if style:
                raise InvalidValues
            style.append(token)
        elif parse_color(token):
            if color:
                raise InvalidValues
            color.append(token)
        elif text_decoration_thickness([token]):
            if thickness:
                raise InvalidValues
            thickness.append(token)
        else:
            raise InvalidValues

    if line:
        yield '-line', line
    if color:
        yield '-color', color
    if style:
        yield '-style', style
    if thickness:
        yield '-thickness', thickness
Expand the ``text-decoration`` shorthand property.
weasyprint/css/validation/expanders.py