-
Notifications
You must be signed in to change notification settings - Fork 694
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] Should a type have a null percent hint to match <number>
?
#10763
Comments
However, based from #10017 (comment):
So to match Suggested text:
|
- a non-null percent hint must match the percentage resolution type (w3c/csswg-drafts#10763) - trigonometric functions, pow(), sqrt(), log(), exp(), must accept <percentage> resolving to <number>/<angle> (w3c/csswg-drafts#10765) - pow() and log() calculations must not need to have consistent types
- a non-null percent hint must match the percentage resolution type (w3c/csswg-drafts#10763) - trigonometric functions, pow(), sqrt(), log(), exp(), must accept <percentage> resolving to <number>/<angle> (w3c/csswg-drafts#10765) - pow() and log() calculations must not need to have consistent types
Ah, indeed, matching |
… hint to be more correct. w3c/csswg-drafts#10763
Okay, tweaked the definitions a little in w3c/css-houdini-drafts@d384226 to pay more attention to the percent hint, when you have context for the value's use. Your 'opacity' example is now properly invalid, as 'opacity' does not resolve percentages against any other type, so it requires the calculation to have a null percent hint. |
Thanks! I am aware that the algorithm has to account for inputs that cannot be produced in a style sheet but with handmade That said, would you say that all context/percentage conditions can be simplified to "if the type has a percent hint, this percent hint must match the type that |
I think so, yes. |
Allow percent hints of 'percent' for cases where %s are kept as themselves. w3c/css-houdini-drafts@3d51716 Tweak the validity of matching when you have a percent hint to be more correct. w3c/csswg-drafts#10763 w3c/css-houdini-drafts@d384226
Before w3c/css-houdini-drafts@808c87a, a type always had to have a null percent hint to match
<number>
.Now:
opacity: calc((1% + 1px) / 1px)
is now valid if I am not mistaken, which seems unexpected because what is the resolved value of1%
?<number>
and<percentage>
(resolved to<number>
)1%
has type[percent → 1]
1% + 1px
has type[length → 1]
with alength
percent hint(1% + 1px) / 1px
has type[length → 0]
with alength
percent hint[length → 0]
with alength
percent hint matches<number>
The text was updated successfully, but these errors were encountered: