W3C home > Mailing lists > Public > www-style@w3.org > July 2015

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 6 Jul 2015 14:03:12 -0700
Message-ID: <CAAWBYDC99EFsvZktZeb+8SsXNkJBigpJfx=1N6imOmCpjFrnyg@mail.gmail.com>
To: Majid Valipour <majidvp@chromium.org>
Cc: "www-style@w3.org list" <www-style@w3.org>
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.

(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.)

Received on Monday, 6 July 2015 21:04:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:18 UTC