[css-values] custom-idents and excluded keywords

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[css-values] custom-idents and excluded keywords

Manuel Rego Casasnovas
Hi,

in the CSS Values spec [1] we could find the following sentence:
"This generic data type is denoted by <custom-ident>, and represents
 any valid CSS identifier that would not be misinterpreted as a
 pre-defined keyword in that property’s value definition."

But a few lines later it says:
"Specifications using <custom-ident> must specify clearly what other
 keywords are excluded from <custom-ident>, if any—for example by
 saying that any pre-defined keywords in that property’s value
 definition are excluded."

For example in the case of the CSS Grid Layout spec, it's not specified
which keywords are excluded in the different properties that use
<custom-ident> (for example the track sizing properties [2]).
However, in a previous thread [3] Tab said that "minmax", "auto" and
"subgrid" were not valid <custom-ident>.

The question is if the CSS Grid Layout spec needs to be updated to
specify the excluded keywords. Or the 2nd sentence above from the CSS
Values spec needs to be removed/reworded.

Thanks,
  Rego

[1] https://drafts.csswg.org/css-values-3/#custom-idents
[2] https://drafts.csswg.org/css-grid/#track-sizing
[3] https://lists.w3.org/Archives/Public/www-style/2014Feb/0761.html

Reply | Threaded
Open this post in threaded view
|

Re: [css-values] custom-idents and excluded keywords

Tab Atkins Jr.
On Thu, Mar 17, 2016 at 1:51 AM, Manuel Rego Casasnovas <[hidden email]> wrote:

> in the CSS Values spec [1] we could find the following sentence:
> "This generic data type is denoted by <custom-ident>, and represents
>  any valid CSS identifier that would not be misinterpreted as a
>  pre-defined keyword in that property’s value definition."
>
> But a few lines later it says:
> "Specifications using <custom-ident> must specify clearly what other
>  keywords are excluded from <custom-ident>, if any—for example by
>  saying that any pre-defined keywords in that property’s value
>  definition are excluded."
>
> For example in the case of the CSS Grid Layout spec, it's not specified
> which keywords are excluded in the different properties that use
> <custom-ident> (for example the track sizing properties [2]).
> However, in a previous thread [3] Tab said that "minmax", "auto" and
> "subgrid" were not valid <custom-ident>.
>
> The question is if the CSS Grid Layout spec needs to be updated to
> specify the excluded keywords. Or the 2nd sentence above from the CSS
> Values spec needs to be removed/reworded.

Grid needs to be updated.  Previously, Values tried to *automatically*
define that keywords appearing the grammar at the same level were
excluded from <custom-ident>, but that ended up not actually working
in a reasonable way; it implied that different keywords could be
excluded between a longhand and a shorthand, for example.

That section of Grid was just written against the old text, and needs
to be updated to explicitly exclude the handful of keywords that can
appear near it.

~TJ

Reply | Threaded
Open this post in threaded view
|

Re: [css-values] custom-idents and excluded keywords

fantasai
In reply to this post by Manuel Rego Casasnovas
On 03/17/2016 04:51 AM, Manuel Rego Casasnovas wrote:

> Hi,
>
> in the CSS Values spec [1] we could find the following sentence:
> "This generic data type is denoted by <custom-ident>, and represents
>   any valid CSS identifier that would not be misinterpreted as a
>   pre-defined keyword in that property’s value definition."
>
> But a few lines later it says:
> "Specifications using <custom-ident> must specify clearly what other
>   keywords are excluded from <custom-ident>, if any—for example by
>   saying that any pre-defined keywords in that property’s value
>   definition are excluded."
>
> For example in the case of the CSS Grid Layout spec, it's not specified
> which keywords are excluded in the different properties that use
> <custom-ident> (for example the track sizing properties [2]).
> However, in a previous thread [3] Tab said that "minmax", "auto" and
> "subgrid" were not valid <custom-ident>.
>
> The question is if the CSS Grid Layout spec needs to be updated to
> specify the excluded keywords. Or the 2nd sentence above from the CSS
> Values spec needs to be removed/reworded.

I don't think there's anything here that needs updating,
except to say that Tab's message is incorrect. Grid is
following that second sentence -- it states clearly that
the 'span' keyword is excluded.

~fantasai

Reply | Threaded
Open this post in threaded view
|

Re: [css-values] custom-idents and excluded keywords

Mats Palmgren
On 2016-06-09 02:52, fantasai wrote:
> I don't think there's anything here that needs updating,
> except to say that Tab's message is incorrect. Grid is
> following that second sentence -- it states clearly that
> the 'span' keyword is excluded.

FYI, I filed a bug [1] on Gecko to fix this for line name lists.

If I read the spec for 'grid-template-areas' [2] correctly though,
there are no restrictions on using keywords there, so for example:

grid-template-areas:"inherit"; is a valid declaration, and
grid-row:inherit-end; would match that area's end edge.

Is that correct?

/Mats


[1]
https://bugzilla.mozilla.org/show_bug.cgi?id=1279641
[2]
https://drafts.csswg.org/css-grid/#grid-template-areas-property


Reply | Threaded
Open this post in threaded view
|

Re: [css-values] custom-idents and excluded keywords

fantasai
On 06/10/2016 07:28 PM, Mats Palmgren wrote:

> On 2016-06-09 02:52, fantasai wrote:
>> I don't think there's anything here that needs updating,
>> except to say that Tab's message is incorrect. Grid is
>> following that second sentence -- it states clearly that
>> the 'span' keyword is excluded.
>
> FYI, I filed a bug [1] on Gecko to fix this for line name lists.
>
> If I read the spec for 'grid-template-areas' [2] correctly though,
> there are no restrictions on using keywords there, so for example:
>
> grid-template-areas:"inherit"; is a valid declaration, and
> grid-row:inherit-end; would match that area's end edge.
>
> Is that correct?

I guess? :) It's pretty weird for sure.

~fantasai