Re: [css-values] [css-color] XSL-FO and CSS - expression languages compared

> On Nov 17, 2016, at 06:16, Liam R. E. Quin <liam@w3.org> wrote:
> 
> (3) CSS calc() lacks the mod operator and the round() function --
> probably an easy addition. FO uses div instead of / for division but I
> don't consider that important. Similarly percentages are treated
> specially in CSS and not in FO - features in CSS but not FO don't in
> general pose a problem for moving to CSS from FO.

and

> (6) Functions and operators not in CSS calc()
> =============================================
> 
> 6.1 numeric
> 
> mod (operator)
> floor()
> ceiling()
> round()
> min(a, b) - seems better than using units like vmin/vmax
> max(a, b)
> abs()

I believe that allowing calc() to do non linear functions, and discontinuous functions in particular would make things like intrinsic sizing more complicated than they are now,
possibly allowing multiple solutions in some cases, so it is not obvious that this is actually an easy change to add, despite how obvious it looks at the syntax level. I think it is likely to be useful, but in the face of implementation difficulties, it is probably worth looking at specific use cases that would benefit from these, and see if we have other ways of addressing them in CSS. If not, then maybe we should bite the bullet and deal with the complexity.

—Florian

Received on Thursday, 17 November 2016 03:12:04 UTC