You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(If the above is not checked) I have reviewed the AI-generated content before submitting.
What did you do?
a {
background-image:image("foo.png", red);
}
What did you expect to happen?
use-baseline should report image() as a non-baseline CSS function.
What actually happened?
No lint error was reported for image().
What is the purpose of this pull request?
This PR fixes CSS function baseline extraction in the generator.
The previous logic would treat CSS data types as CSS functions when reading css.types.* compat keys. In practice, that meant image() could fail to report correctly because css.types.image (<image>) was being conflated with the image() function.
What changes did you make? (Give an overview)
Refactored function extraction so CSS functions are handled explicitly, regenerated baseline-data.js, and added regression coverage.
Related Issues
Is there anything you'd like reviewers to focus on?
Thank you for spotting this.
In the future please split up the PR in the fix and refactor as combining them makes it harder to review.
How did you determine that only image and color are affected?
For example I tried sibling-index which is also non-baseline but use-baseline does not report it.
In the future please split up the PR in the fix and refactor as combining them makes it harder to review.
Yeah sorry about that. I had to refactor first to avoid making the code uglier with this fix.
How did you determine that only image and color are affected?
They’re the direct bare css.types.<name> collisions I identified.
For example I tried sibling-index which is also non-baseline but use-baseline does not report it.
sibling-index() is part of a broader gap here, same as sibling-count(), shape(), progress(), if(), etc. Those exist in web-features, but not in mdn-data.css.functions, so use-baseline doesn’t currently recognize/report them.
This should be addressed by the mdn-data -> @webref/css migration in #376, which I’m working on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites checklist
AI acknowledgment
What did you do?
What did you expect to happen?
use-baselineshould reportimage()as a non-baseline CSS function.What actually happened?
No lint error was reported for
image().What is the purpose of this pull request?
This PR fixes CSS function baseline extraction in the generator.
The previous logic would treat CSS data types as CSS functions when reading
css.types.*compat keys. In practice, that meantimage()could fail to report correctly becausecss.types.image(<image>) was being conflated with theimage()function.What changes did you make? (Give an overview)
Refactored function extraction so CSS functions are handled explicitly, regenerated
baseline-data.js, and added regression coverage.Related Issues
Is there anything you'd like reviewers to focus on?
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/image/image