-
Notifications
You must be signed in to change notification settings - Fork 668
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-fonts-4] font-weight and calc. #2590
Comments
I agree that invalid at computed value time is the right way to go here. |
/me waves at @svgeesus |
/wave |
Alright, apparently there are already tests for this, so I guess Edge at least does the right thing, will align with it. Thanks! |
I believe https://drafts.csswg.org/css-values-3/#calc-range describes what to do. |
Yes, the spec is very clear on this matter - it should be clamped to 1 at computed value time. It is definitely not invalid at computed value time; that's not even remotely related to calc(), it's a variables thing. It absolutely can't be a parse error, because in the general case you can have expressions that can't be resolved at parse time. (V&U 3's calc() doesn't have any of these for purely numeric expressions, so you could tell at parse time what the value would end up being, but now that we have unit algebra it's back to being generally undecidable.) |
…ts. r=jwatt The test adjustments are: A subtest of variable-presentation-attribute.html is marked as failure, pending resolution of w3c/csswg-drafts#2605. font-parse-numeric-stretch-style-weight.html is updated to: * handle calc per spec (invalid at computed-value time), see w3c/csswg-drafts#2590 * Accept 0% in font-stretch: w3c/csswg-drafts#2591 * Accept font-weight descriptor ranges where the start is greater than the end, per https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight, which says: > User agents must swap the computed value of the startpoint and endpoint > of the range in order to forbid decreasing ranges. font-shorthand.html is updated to presumably fix a copy-paste error, where "oblique 45deg" was expected to compute to "oblique", which is wrong. The rest is removing failure annotations. MozReview-Commit-ID: CNJ3LG71KRj
The test adjustments are: A subtest of variable-presentation-attribute.html is marked as failure, pending resolution of w3c/csswg-drafts#2605. font-parse-numeric-stretch-style-weight.html is updated to: * handle calc per spec (invalid at computed-value time), see w3c/csswg-drafts#2590 * Accept 0% in font-stretch: w3c/csswg-drafts#2591 * Accept font-weight descriptor ranges where the start is greater than the end, per https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight, which says: > User agents must swap the computed value of the startpoint and endpoint > of the range in order to forbid decreasing ranges. font-shorthand.html is updated to presumably fix a copy-paste error, where "oblique 45deg" was expected to compute to "oblique", which is wrong. The rest is removing failure annotations. bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1436048 gecko-commit: b61541f85293fa3fddd7edfe9863624f9a56e92b gecko-integration-branch: mozilla-inbound gecko-reviewers: jwatt
The test adjustments are: A subtest of variable-presentation-attribute.html is marked as failure, pending resolution of w3c/csswg-drafts#2605. font-parse-numeric-stretch-style-weight.html is updated to: * handle calc per spec (invalid at computed-value time), see w3c/csswg-drafts#2590 * Accept 0% in font-stretch: w3c/csswg-drafts#2591 * Accept font-weight descriptor ranges where the start is greater than the end, per https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight, which says: > User agents must swap the computed value of the startpoint and endpoint > of the range in order to forbid decreasing ranges. font-shorthand.html is updated to presumably fix a copy-paste error, where "oblique 45deg" was expected to compute to "oblique", which is wrong. The rest is removing failure annotations. bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1436048 gecko-commit: b61541f85293fa3fddd7edfe9863624f9a56e92b gecko-integration-branch: mozilla-inbound gecko-reviewers: jwatt
…ts. r=jwatt The test adjustments are: A subtest of variable-presentation-attribute.html is marked as failure, pending resolution of w3c/csswg-drafts#2605. font-parse-numeric-stretch-style-weight.html is updated to: * handle calc per spec (invalid at computed-value time), see w3c/csswg-drafts#2590 * Accept 0% in font-stretch: w3c/csswg-drafts#2591 * Accept font-weight descriptor ranges where the start is greater than the end, per https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight, which says: > User agents must swap the computed value of the startpoint and endpoint > of the range in order to forbid decreasing ranges. font-shorthand.html is updated to presumably fix a copy-paste error, where "oblique 45deg" was expected to compute to "oblique", which is wrong. The rest is removing failure annotations. MozReview-Commit-ID: CNJ3LG71KRj UltraBlame original commit: b61541f85293fa3fddd7edfe9863624f9a56e92b
…ts. r=jwatt The test adjustments are: A subtest of variable-presentation-attribute.html is marked as failure, pending resolution of w3c/csswg-drafts#2605. font-parse-numeric-stretch-style-weight.html is updated to: * handle calc per spec (invalid at computed-value time), see w3c/csswg-drafts#2590 * Accept 0% in font-stretch: w3c/csswg-drafts#2591 * Accept font-weight descriptor ranges where the start is greater than the end, per https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight, which says: > User agents must swap the computed value of the startpoint and endpoint > of the range in order to forbid decreasing ranges. font-shorthand.html is updated to presumably fix a copy-paste error, where "oblique 45deg" was expected to compute to "oblique", which is wrong. The rest is removing failure annotations. MozReview-Commit-ID: CNJ3LG71KRj UltraBlame original commit: b61541f85293fa3fddd7edfe9863624f9a56e92b
…ts. r=jwatt The test adjustments are: A subtest of variable-presentation-attribute.html is marked as failure, pending resolution of w3c/csswg-drafts#2605. font-parse-numeric-stretch-style-weight.html is updated to: * handle calc per spec (invalid at computed-value time), see w3c/csswg-drafts#2590 * Accept 0% in font-stretch: w3c/csswg-drafts#2591 * Accept font-weight descriptor ranges where the start is greater than the end, per https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight, which says: > User agents must swap the computed value of the startpoint and endpoint > of the range in order to forbid decreasing ranges. font-shorthand.html is updated to presumably fix a copy-paste error, where "oblique 45deg" was expected to compute to "oblique", which is wrong. The rest is removing failure annotations. MozReview-Commit-ID: CNJ3LG71KRj UltraBlame original commit: b61541f85293fa3fddd7edfe9863624f9a56e92b
This is just a request for clarification.
https://drafts.csswg.org/css-fonts-4/#font-weight-numeric-values says:
This doesn't say how to handle calc(), but per my reading of previous discussions the expected behavior is that
font-weight: calc(-1)
is not a parse error, and it gets clamped at computed value time.However no UA does this AFAICT. Am I right that that's the expected behavior? Or should we give up on not making calc() for numeric values out of range be a parse error?
The text was updated successfully, but these errors were encountered: