Filter functions should allow calc()

RESOLVED FIXED

Status

()

defect
P3
normal
RESOLVED FIXED
3 years ago
10 months ago

People

(Reporter: sebo, Unassigned)

Tracking

(Blocks 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

3 years ago
According to the spec. CSS filter functions like e.g. contrast() allow <percentage> and <number> or <length> values. As percentages refer to the numbers or lengths, they are equivalent to each other. So, the use of calc() within those functions should be allowed.

Sebastian
Priority: -- → P3
This seems to have been fixed by stylo.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
(Reporter)

Comment 2

a year ago
This bug is not fixed, unfortunately. calc() itself is obviously allowed within the filter functions, though values like contrast(50% + 0.1) are still not interpreted as valid.
Tested in Nightly 59.0a1 (2017-12-20).

Sebastian
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Adding percentages and units is an invalid expression. So I think this is FIXED. Improvements to calc() in general should be tracked somewhere else.
Status: REOPENED → RESOLVED
Last Resolved: a year ago10 months ago
Resolution: --- → FIXED
(Reporter)

Comment 4

10 months ago
(In reply to Emilio Cobos Álvarez [:emilio] from comment #3)
> Adding percentages and units is an invalid expression.

My fault. I meant contrast(calc(50% + 0.1)) (as outlined in the example URL).
But I reread the CSS Values and Units spec. now and it made me unsure whether numbers can be combined with percentages in calc(). At the definition of the percentage values[1] it says yes but a note in the definition for calc()[2] indicates no.
I may raise an issue for that at the CSSWG.

> Improvements to calc() in general should be tracked somewhere else.

In any case, that's obviously tracked in bug 1264520 already.

Sebastian

[1] https://drafts.csswg.org/css-values-3/#percentages
[2] https://drafts.csswg.org/css-values-3/#calc-type-checking
You need to log in before you can comment on or make changes to this bug.