Skip to content

[css-images-4] Computed value of stripes() #8140

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
fantasai opened this issue Nov 28, 2022 · 6 comments
Open

[css-images-4] Computed value of stripes() #8140

fantasai opened this issue Nov 28, 2022 · 6 comments

Comments

@fantasai
Copy link
Collaborator

The current spec says that the computed value of stripes() has all length-percentage values “absolutized and computed to the extent possible”. For border widths, that means it'll resolve to an absolute length.

However, I suspect we want to keep percentages uncomputed for inheritance, if we ever do use this in an inherited property, so I propose to use the same formulation as width etc. rather than line-height.

@SebastianZ
Copy link
Contributor

However, I suspect we want to keep percentages uncomputed for inheritance, if we ever do use this in an inherited property, so I propose to use the same formulation as width etc. rather than line-height.

But percentages in width do get computed to a <length>. If we keep percentages (and <flex> values) uncomputed, how would you transition between different values? See also #8163 (comment) and generally the discussion there.

Sebastian

@Loirooriol
Copy link
Contributor

Percentages in width compute as-is, not to a length. In this testcase, width: inherit sees 50% instead of the resolved width.

jakearchibald pushed a commit to jakearchibald/csswg-drafts that referenced this issue Jan 16, 2023
@SebastianZ
Copy link
Contributor

Percentages in width compute as-is, not to a length. In this testcase, width: inherit sees 50% instead of the resolved width.

You're right. I mixed up the resolved value from getComputedStyle() with the computed value.

Because @fantasai already changed the spec. to keep percentages unchanged, I close this issue now. Feel free to re-open it if I missed anything.

Sebastian

@SebastianZ
Copy link
Contributor

Having said that, #8163 (comment) outlines a reason why keeping percentages as-is restricts us regarding transitions.

Sebastian

@tabatkins
Copy link
Member

Actually, I think this was better initially, where flexes were computed to lengths eagerly. That solves the transition issue immediately and clearly, without needing further interventions as I outlined in my comment.

And as stripes are essentially an image type, I find it very unlikely that they'll ever be used in an inherited property.

@tabatkins tabatkins reopened this Mar 24, 2023
@SebastianZ
Copy link
Contributor

I added #8622 to the agenda, which will also cover the things discussed here. The proposal is to adopt Tab's suggestion from above.

I assume, if there's a real need to add stripes() to an inherited property at some point, we could still account for that in that specific context.

Sebastian

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

No branches or pull requests

4 participants