Skip to content

Avoid deriving production rule from function definitions #1355

Open
@cdoublev

Description

@cdoublev

I would like to propose that CSS function definitions are no longer assigned a value derived from an inline definition (without a = sign, here). For example, I would like to avoid the value of fn() being assigned fn(foo) when fn() is defined with <dfn data-dfn-type=function>fn(foo)</dfn >.

I think it should instead be assigned to the prose of fn(). But more importantly, I think assuming it represents the right side of a production rule is problematic.

minmax() is defined inline with minmax(min, max) but min and max are not valid arguments when interpreted as a CSS value definition, regardless of the context that includes it in its value definition.

Until this recent change, minmax(min, max) was defined as a value rather than a function. Since I do not use the values exported by webref, this was not a problem but now I have to specifically ignore it¹ because <minmax()> does not expand to minmax(min, max).

A function can be referenced by Bikeshed autolinks <<fn()>> or <<context/fn()>>, generating <fn()> as their text. In w3c/csswg-drafts#7682 (comment), Tab Atkins says:

Right, the functions should still be marked as functions rather than values, but their context-sensitivity (indicated by the presence of the for value) means they can't be meaningfully used as productions.

I find this confusing and I am not sure why/if I can use <<grid-template-rows/minmax()>>. Perhaps a distinction should be made between a context-sensitive value definition (parsing) and a context-sensitive definition (interpretation by the UA).

But in any case, my proposal seems desirable to me.

¹ more concretely, my problem is that minmax() is unnecessarily included in the collection of productions extracted from webref data, whereas there is no property value definition, or higher-order production rule, that includes <minmax()> and requires to resolve its value definition by looking into the productions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions