W3C home > Mailing lists > Public > www-style@w3.org > February 2016

[css-values] range-checking, calc(-5), and serialization

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 16 Feb 2016 18:43:56 -0500
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <56C3B43C.2080309@inkedblade.net>
The definition for calc() states:

https://www.w3.org/TR/2015/CR-css-values-3-20150611/
  # The value resulting from an expression must be clamped to the
  # range allowed in the target context.

There's a few issues with this...

Issue 1:
   It doesn't state when this is clamped. Presumably the used value is clamped.
   Assuming everyone agrees, I'll update the spec to say so.

Issue 2:
   This presumably means that ''width: calc(-5px)'' is valid, and treated as zero.
   However, the serialization rules recently added to the spec state that
     https://drafts.csswg.org/css-values-3/#calc-serialize
     # If the result is a single value, serialize as that value,
     # discarding the calc() wrapper.
   This means that some calc() values will not be round-trippable.

~fantasai
Received on Tuesday, 16 February 2016 23:44:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:00 UTC