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
Don't reject out of bound calc() values at parsing-time #16382
Conversation
Heads up! This PR modifies the following files:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome! r=me % nits
@@ -690,11 +698,11 @@ impl ToCss for Time { | |||
#[allow(missing_docs)] | |||
pub struct Number { | |||
/// The numeric value itself. | |||
pub value: CSSFloat, | |||
value: CSSFloat, | |||
/// Whether this came from a `calc()` expression. This is needed for | |||
/// serialization purposes, since `calc(1)` should still serialize to | |||
/// `calc(1)`, not just `1`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the comment?
components/style_traits/values.rs
Outdated
match *self { | ||
AllowedNumericType::NonNegative if val < 0. => 0., | ||
AllowedNumericType::AtLeastOne if val < 1. => 1., | ||
_ => val, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just add AllowedNumericType::All
here.
parse_number_with_clamping_mode(input, AllowedNumericType::All) | ||
} | ||
|
||
#[allow(missing_docs)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we'd have something here, but I guess I won't complain
@bors-servo r+ |
📌 Commit 3dd4e88 has been approved by |
☔ The latest upstream changes (presumably #16373) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors-servo r=emilio |
📌 Commit dfbd898 has been approved by |
Don't reject out of bound calc() values at parsing-time <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16382) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev |
This change is