def preprocess_descriptors(rule, base_url, descriptors):
    """Filter unsupported names and values for descriptors.

    Log a warning for every ignored descriptor.

    Return a iterable of ``(name, value)`` tuples.

    """
    for descriptor in descriptors:
        if descriptor.type != 'declaration' or descriptor.important:
            continue
        tokens = remove_whitespace(descriptor.value)
        try:
            if descriptor.name in NOT_PRINT_MEDIA:
                continue
            elif descriptor.name not in DESCRIPTORS[rule]:
                raise InvalidValues('descriptor not supported')

            function = DESCRIPTORS[rule][descriptor.name]
            if function.wants_base_url:
                value = function(tokens, base_url)
            else:
                value = function(tokens)
            if value is None:
                raise InvalidValues
            result = ((descriptor.name, value),)
        except InvalidValues as exc:
            LOGGER.warning(
                'Ignored `%s:%s` at %d:%d, %s.',
                descriptor.name, tinycss2.serialize(descriptor.value),
                descriptor.source_line, descriptor.source_column,
                exc.args[0] if exc.args and exc.args[0] else 'invalid value')
            continue

        for long_name, value in result:
            yield long_name.replace('-', '_'), value
Filter unsupported names and values for descriptors.

Log a warning for every ignored descriptor.

Return a iterable of ``(name, value)`` tuples.
weasyprint/css/validation/descriptors.py