w3c/css-houdini-drafts

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

gsnedders opened this issue · 3 comments

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?

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?

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)?

Correct.