Re: [css-snappoints] repeat(calc(<value>)) clamping behaviour

On 07/06/2015 05:03 PM, Tab Atkins Jr. wrote:
> On Thu, Jul 2, 2015 at 8:24 AM, Majid Valipour <majidvp@chromium.org> wrote:
>> According to snap points spec, repeat(<length>) only allows positive length
>> values. This is reasonable because negative or zero length values do not
>> make sense as a repeat value.
>>
>> At the same time, length can be a calc in which case according to CSS Values
>> spec[1] its range should be a closed one which is at odds with the open
>> range that 'positive' implies.
>>
>> For example, what is the expected behaviour for:
>> repeat(calc(-10%))
>> repeat(calc(10px - 10%)) /* can be positive or negative depending on size */
>>
>> Perhaps we can allow 0 in repeat but make it a no-op?
>
> Yes, this should use strategy #1 from
> <https://wiki.csswg.org/spec/limited-ranges>, and define a minimum
> value (or say that there is a UA-specific minimum value).  I'd be fine
> with a minimum of 1px.

This makes sense to me, and matches css-break (where we enforce 1px
minimum for the fragmentainer).

> (Now that you mention it, *every* usage of "positive (or non-negative)
> length or you're invalid" in CSS has to be handled, actually.  With
> calc(), you can't always tell that it's non-negative until layout
> time, so you can't just assume that every value that survives is
> definitely non-negative.)

Yeah, we specify that here:
   http://www.w3.org/TR/css-values-3/#calc-range

~fantasai

Received on Monday, 19 October 2015 19:25:50 UTC