Skip to content

[css-values-5] Range checking of media-progress()/container-progress() start/end values? #10802

@cdoublev

Description

@cdoublev

https://drafts.csswg.org/css-values-5/#media-progress-func

The specified media query must be a valid “range” type query, and its specified progress start value and progress end value must be valid values for the specified media query, or else the function is invalid.

Based on the above requirement:

  • media-progress(aspect-ratio from -1 to 1) is invalid because the start value is an invalid negative value
  • media-progress(aspect-ratio from 1em / -1px to 1) is valid because the start value may be positive or negative

This seems unfortunate/inconsistent.

Besides, I think range checking of calculations that are not nested in a math function, should be handled (skipped) like for math functions: aspect-ratio: calc(-1) is valid so media-progress(aspect-ratio from -1 to 1) should be valid.

I suggest:

The specified progress start value and progress end value must match a CSS type accepted by the media query.

Another consequence is that feature type validation (as a range) is no longer required, since all features accepting numeric values are range features (except the grid media feature).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions