Skip to content

[css-color-4] fix of dfn-for attribute for named-color values #9632

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

Closed
SofyaPovarova opened this issue Nov 24, 2023 · 9 comments
Closed

[css-color-4] fix of dfn-for attribute for named-color values #9632

SofyaPovarova opened this issue Nov 24, 2023 · 9 comments
Assignees
Labels
Closed Accepted as Obvious Bugfix Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-color-4 Current Work

Comments

@SofyaPovarova
Copy link

Could we modify the "dfn-for" attribute for the named colors table in the named-colors block from "<color>" to "<named-color>"? The table represents the set of values for <named-color>.

@svgeesus
Copy link
Contributor

Good catch, fixed

@SofyaPovarova
Copy link
Author

Thank you!

@svgeesus svgeesus added the Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. label Nov 28, 2023
@tabatkins
Copy link
Member

Nope, this is broken. Remember that Bikeshed does not chase down the production hierarchy; right now, you've made it so that anything which wants to say <color>/red will fail. (I mean, there's probably not much, if any, of that in the specs today, but still.)

It should be dfn-for="<color>, <named-color>". (And same for the <deprecated-color> production you did for another issue.)

@SofyaPovarova
Copy link
Author

Could you please provide an example to clarify what broke down when the "dfn-for" attribute ceased to contain <color>?

I'm relatively new to working on specifications, but I'm really curious about the specifics, especially when it comes to practical examples like this. Thank you!

@tabatkins
Copy link
Member

The for values on a definition are just opaque strings that serve to namespace the definition; Bikeshed does not infer anything about the value used. So if you have <color> = <named-color> | ..., and then define a <dfn value for="<named-color>">red</dfn>, you can link to it with ''<named-color>/red'' but not with ''<color>/red'' - Bikeshed does not know that every <named-color> is a <color> as well.

This sort of inheritance relationship needs to be handled explicitly, with for="<color>, <named-color>" giving it two distinct for values.

@svgeesus
Copy link
Contributor

TIL

@tabatkins
Copy link
Member

It's on my low-priority list of things to fix some day, now that Reffy is parsing the CSS grammars and inferring these relationships (and forcing us to fix things when there are mistakes). But I have no timeline for it.

@cdoublev
Copy link
Collaborator

Out of curiosity, why is the data extracted by Reffy not generated by Bikeshed? I would say because of lack of time, but crawling specs through the network obviously represents unnecessary overhead.

@svgeesus
Copy link
Contributor

svgeesus commented Dec 1, 2023

Illuminating discussion on the wider issues, but closing here because the specific spec defect has been corrected with #9632

@svgeesus svgeesus closed this as completed Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Obvious Bugfix Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-color-4 Current Work
Projects
None yet
Development

No branches or pull requests

4 participants