Skip to content
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

Extended CSS value definitions #1647

Open
cdoublev opened this issue Aug 14, 2024 · 1 comment
Open

Extended CSS value definitions #1647

cdoublev opened this issue Aug 14, 2024 · 1 comment

Comments

@cdoublev
Copy link
Contributor

When a spec extends a production rule whose LHS links to its definition in another spec, reffy reports it as a dangling production rule:

Do you think they could escape this segregation and move to the global values?

I presume this would require parsing the link before extracting the text content, and carry it forward to set rule.href, which does not seem ideal.

I also do not know if the extracted definition href would need to point to the other spec.

@tidoust
Copy link
Member

tidoust commented Aug 19, 2024

Do you think they could escape this segregation and move to the global values?

Yes, that would seem a good thing to do.

There should be a way to tell that this is an extension of a base definition. For properties, we have newValues. Perhaps we could record the syntax in a newValue property here, although I note that the semantics are slightly different: for newValues, these are additional values, whereas the extension here seems to always overwrite the base definition.

I presume this would require parsing the link before extracting the text content, and carry it forward to set rule.href, which does not seem ideal.

An additional complication is that these <pre> blocks may contain more than one production rule :( That is what the split on reSplitLines a couple of lines after the one you referenced attempts to take care of:

/**
* Regular expression used to split production rules:
* Split on the space that precedes a term immediately before an equal sign
* that is not wrapped in quotes (an equal sign wrapped in quotes is part of
* actual value syntax)
*/
const reSplitRules = /\s(?=[^\s]+?\s*?=[^'])/;

I also do not know if the extracted definition href would need to point to the other spec.

For property extensions, we simply do not put capture any href. I would suggest to do the same.

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

No branches or pull requests

2 participants