Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-values][css-color] apparent contradiction #3270

Closed
frivoal opened this issue Oct 31, 2018 · 2 comments
Closed

[css-values][css-color] apparent contradiction #3270

frivoal opened this issue Oct 31, 2018 · 2 comments

Comments

@frivoal
Copy link
Collaborator

@frivoal frivoal commented Oct 31, 2018

(found by @TalbotG)

css-values-3 (and 4) say that

Properties may restrict numeric values to some range. If the value is outside the allowed range, the declaration is invalid and must be ignored.

However, there is at least one exception: the rgb() function, which says:

Values outside the device gamut should be clipped or mapped into the gamut when the gamut is known

and gives examples of values below 0 or above 255.

So, since there are some cases of properties doing restriction on the range other than at parsing time, we should probably change the sentence in css-values to something like this:

Properties may restrict numeric values to some range. Unless specified otherwise, if the value is outside the allowed range, the declaration is invalid and must be ignored.

This makes it clear which requirement takes precedence instead of just having a contradiction.

@TalbotG
Copy link
Collaborator

@TalbotG TalbotG commented Oct 31, 2018

Also:

out-of-range values [inside calc() function] do not cause the declaration to become invalid. However, the value resulting from an expression must be clamped to the range allowed in the target context.

8.1.4. Range Checking [inside calc() function]

@frivoal frivoal changed the title [css-values][css-color] [css-values][css-color] apparent contradiction Nov 1, 2018
@Crissov
Copy link
Contributor

@Crissov Crissov commented Nov 1, 2018

🤔 Inside rgb(), they are not numeric property values but function arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants