Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uptransition-duration should not accept negative time value #15343
Comments
|
@simon-whitehead Does this look interesting? It involves a unit test in |
|
Yes it does @jdm. There is some interesting markup scattered through this file though which I am not familiar with. Do you have resources for this? Looks good otherwise - happy to have a go at it! |
|
It's a mako template, so it's a python-based templating language. |
|
Great thanks. Good to know just so I don't break anything :) I'll get started on this tonight hopefully! |
|
I will get to this in the next few days - I've just had a busy week transitioning between day jobs. Sorry for the delay! |
|
Just to clarify, should I be altering |
Return an error when a parsed "transition-duration" value is negative.
|
I think you should implement |
|
Sure, but the |
|
Oh, you mean that one. I thought you are talking about |
|
Great. That sounds like a better idea. Thanks! |
Fix #15343 <!-- Please describe your changes on the following line: --> Adds `Time::parse_non_negative` which errors on negative values. This new method is now used by `transition_duration::parse`. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #15343 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/15658) <!-- Reviewable:end -->
Disallow negative duration for animation and transition <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15343 <!-- Either: --> - [X] There are tests for these changes written by @simon-whitehead . Thank you! <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Disallow negative duration for animation and transition <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15343 <!-- Either: --> - [X] There are tests for these changes written by @simon-whitehead . Thank you! <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/16829) <!-- Reviewable:end -->
Disallow negative duration for animation and transition <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15343 <!-- Either: --> - [X] There are tests for these changes written by @simon-whitehead . Thank you! <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/16829) <!-- Reviewable:end -->
Spec: https://drafts.csswg.org/css-transitions/#transition-duration-property
Relevant code: https://github.com/servo/servo/blob/master/components/style/properties/longhand/box.mako.rs#L465
We probably need
Time::parse_non_negativeas well.