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

[css-typed-om] what is "hint" in "add two types" step 3 #1093

Open
gsnedders opened this issue Apr 25, 2023 · 3 comments
Open

[css-typed-om] what is "hint" in "add two types" step 3 #1093

gsnedders opened this issue Apr 25, 2023 · 3 comments

Comments

@gsnedders
Copy link
Member

from https://drafts.css-houdini.org/css-typed-om-1/#cssnumericvalue-add-two-types:

If type1 and/or type2 contain "percent" with a non-zero value, and type1 and/or type2 contain a key other than "percent" with a non-zero value
For each base type other than "percent" hint:
Provisionally apply the percent hint hint to both type1 and type2.

"hint" should presumably be the percent hint both types now have (from step 2), given it is styled as a variable, but I don't know how to read:

For each base type other than "percent" ["length" | "angle" | "time" | "frequency" | "resolution" | "flex"]

Or is "hint" meant to initialise the variable there to one of those values?

@tabatkins
Copy link
Member

The |hint| variable in the second line of your quote is initializing/setting the variable, per Infra language, to be each item among the base types (other than "percent"), and then |hint| on the third line is referring to that variable.

This is unrelated to the use of the |hint| variable in the preceding top-level step. I could name them differently, if that's the source of the confusion?

@gsnedders
Copy link
Member Author

I think the source of the confusion is constructing the parse tree for:

For each base type other than "percent" hint:

Like, I parsed it as something like (For (each base type) (other than "percent" hint)), probably because "percent hint" is something that exists all over this section.

Whereas I suppose the intent is something more like (For (each base type (other than "percent")) hint)?

@tabatkins
Copy link
Member

Correct.

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