Skip to content

[css-values-5] Fix dfn of <input-position> and <output-value> #12349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tidoust
Copy link
Member

@tidoust tidoust commented Jun 17, 2025

A <dfn> of type type should only enclose a basic data type (something between < and >). At least, that's been the case across specs until now. The spec was using the dfn to describe a more complex value. More likely, the spec was trying to combine the definition of the two types with the definition of the value pattern that uses them in one single dfn.

This update changes the value pattern definition type to value and creates additional type dfns for the individual types so that they can be referenced from other constructs.

A `<dfn>` of type `type` should only enclose a basic data type (something
between `<` and `>`). At least, that's been the case across specs until now.
The spec was using the dfn to describe a more complex `value`. More likely, the
spec was trying to combine the definition of the two types with the definition
of the value pattern that uses them in one single dfn.

This update changes the value pattern definition type to `value` and creates
additional `type` dfns for the individual types so that they can be referenced
from other constructs.
@tidoust tidoust requested a review from tabatkins June 17, 2025 06:17
@tabatkins
Copy link
Member

The current markup is only enclosing basic data types. It's doing two of them, but that's fine. The text content of the dfn is irrelevant, since lt is specified.

@tidoust
Copy link
Member Author

tidoust commented Jun 27, 2025

Ah, I was worried you might say that ;) I agree that this does not matter for referencing purpose. Extraction of grammar constructs is a bit more rigid for now (and, for example, cannot always rely on <dfn> and term references being used), and it's the only occurrence of that pattern across specs. Anwyay, that's fine, I'll be more flexible. 🤸

tidoust added a commit to w3c/reffy that referenced this pull request Jul 21, 2025
The `css-values-5` spec uses new patterns that were not supported yet:

- Definitions in headings, see #1890. Such definitions were correctly captured
in the dfns extracts but CSS extraction missed them.
- Definitions that define more than one type at once through `data-lt`
attributes, as discussed in w3c/csswg-drafts#12349.
More generally speaking, CSS extraction did not always take the `data-lt`
attribute into account.
- Definition of the `<boolean-expr[]>` notation, see #1878. The regular
expression used to split production rules wasn't designed for spaces in the
left-hand side.

The update also simplifies the selectors used to find production rules in a
document to make them more readable, and to avoid processing the production
rules more than once, as discussed in #1878.
tidoust added a commit to w3c/reffy that referenced this pull request Jul 21, 2025
The `css-values-5` spec uses new patterns that were not supported yet:

- Definitions in headings, see #1890. Such definitions were correctly captured
in the dfns extracts but CSS extraction missed them.
- Definitions that define more than one type at once through `data-lt`
attributes, as discussed in w3c/csswg-drafts#12349.
More generally speaking, CSS extraction did not always take the `data-lt`
attribute into account.
- Definition of the `<boolean-expr[]>` notation, see #1878. The regular
expression used to split production rules wasn't expecting spaces in the
left-hand side. Note extraction drops `[ <test> ]` and ends up with
`<boolean-expr>` as type name. That's not necessary ideal, but there's no good
way to represent that type in the extracts. Consumers need dedicated logic to
handle the notation.

The update also simplifies the selectors used to find production rules in a
document to make them more readable, and to avoid processing the production
rules more than once, as discussed in #1878.
tidoust added a commit to w3c/reffy that referenced this pull request Jul 21, 2025
…1891)

The `css-values-5` spec uses new patterns that were not supported yet:

- Definitions in headings, see #1890. Such definitions were correctly captured
in the dfns extracts but CSS extraction missed them.
- Definitions that define more than one type at once through `data-lt`
attributes, as discussed in w3c/csswg-drafts#12349.
More generally speaking, CSS extraction did not always take the `data-lt`
attribute into account.
- Definition of the `<boolean-expr[]>` notation, see #1878. The regular
expression used to split production rules wasn't expecting spaces in the
left-hand side. Note extraction drops `[ <test> ]` and ends up with
`<boolean-expr>` as type name. That's not necessary ideal, but there's no good
way to represent that type in the extracts. Consumers need dedicated logic to
handle the notation.

The update also simplifies the selectors used to find production rules in a
document to make them more readable, and to avoid processing the production
rules more than once, as discussed in #1878.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants