def border_image_slice(style, name, values):
    """Compute the ``border-image-slice`` property."""
    computed_values = []
    fill = None
    for value in values:
        if value == 'fill':
            fill = value
        else:
            number, unit = value
            if unit is None:
                computed_values.append(number)
            else:
                computed_values.append(Dimension(number, '%'))
    if len(computed_values) == 1:
        computed_values *= 4
    elif len(computed_values) == 2:
        computed_values *= 2
    elif len(computed_values) == 3:
        computed_values.append(computed_values[1])
    return (*computed_values, fill)
Compute the ``border-image-slice`` property.
weasyprint/css/computed_values.py