W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2019

Re: [csswg-drafts] [css-values] Clarify that calc(0) is never a length (#4554)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Tue, 03 Dec 2019 11:01:17 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-561117176-1575370876-sysbot+gh@w3.org>
I think the important spec quote is in https://drafts.csswg.org/css-values/#length-value:

> However, if a 0 could be parsed as either a `<number>` or a `<length>` in a property (such as line-height), it must parse as a `<number>`.

Then, when https://drafts.csswg.org/css-values/#calc-type-checking could parse `0` in `calc()` as either a `<number>` or `<length>`...

> - `<number>`
> - `<integer>`
>    the type is «[ ]» (empty map)
> - `<length>`
>    the type is «[ "length" → 1 ]»

...it must do it as a `<number>`. So it follows that `calc(0)` is not a length.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4554#issuecomment-561117176 using your GitHub account
Received on Tuesday, 3 December 2019 11:01:19 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:57 UTC