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 upstylo: Fix compute_squared_distance for AnimatedFilterList #17898
Conversation
When computing the distance between two filter functions, e.g. HueRotate(0deg) and HueRotate(-360deg), we got an Err(()) and unwrap it immediately in compute_filter_square_distance(), which causes a crash. The root-cause is that we don't implement computed_distance of Angle, and we assume we always get a valid result from compute_squared_distance() for each filter function.
highfive
commented
Jul 28, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jul 28, 2017
|
@bors-servo r=birtles |
|
|
bors-servo
added a commit
that referenced
this pull request
Jul 28, 2017
…birtles stylo: Fix compute_squared_distance for AnimatedFilterList We implement compute_distance for Angle to avoid returning Err(()) from it, and then rewrite compute_squared_distance of AnimatedFilterLIst to avoid using unwrap() and make it simpler. --- <!-- 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 [Bug 1384014](https://bugzilla.mozilla.org/show_bug.cgi?id=1384014). - [X] These changes do not require tests because there is a DevTools test for this already. <!-- 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/17898) <!-- Reviewable:end -->
d6ddc0a
to
9028195
|
@bors-servo r=birtles Fix cargo lock |
|
|
|
|
|
|
@bors-servo p=1 |
bors-servo
added a commit
that referenced
this pull request
Jul 28, 2017
…birtles stylo: Fix compute_squared_distance for AnimatedFilterList We implement compute_distance for Angle to avoid returning Err(()) from it, and then rewrite compute_squared_distance of AnimatedFilterLIst to avoid using unwrap() and make it simpler. --- <!-- 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 [Bug 1384014](https://bugzilla.mozilla.org/show_bug.cgi?id=1384014). - [X] These changes do not require tests because there is a DevTools test for this already. <!-- 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/17898) <!-- Reviewable:end -->
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
BorisChiou commentedJul 28, 2017
•
edited by larsbergstrom
We implement compute_distance for Angle to avoid returning Err(()) from it, and then rewrite compute_squared_distance of AnimatedFilterLIst to avoid using unwrap() and make it simpler.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is