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 upDefault is top-to-bottom if unset, not bottom-to-top #14746
Conversation
highfive
commented
Dec 27, 2016
highfive
commented
Dec 27, 2016
|
Could we add a ref test for this? |
|
I added a unit test, it required a bit of boilerplate, not sure if we should put it into a macro or something. Need to figure out the ref tests. |
|
Here is how to add a new reftest: https://github.com/servo/servo/tree/master/tests/wpt#writing-new-tests |
|
r? @SimonSapin |
| @@ -32,6 +38,12 @@ fn test_linear_gradient() { | |||
|
|
|||
| // Parsing without <angle> and <side-or-corner> | |||
| assert_roundtrip_with_context!(Image::parse, "linear-gradient(red, green)"); | |||
|
|
|||
| // AngleOrCorner::None should become AngleOrCorner::Angle(Angle(PI)) when parsed | |||
This comment has been minimized.
This comment has been minimized.
shinglyu
Dec 28, 2016
Member
Maybe add a link to the spec in the comment. Or at least make clear that PI means "top-to-bottom". :)
|
For the reftest, you can create two htmls, the test html could be a gradient box with the default, the reference html can be a gradient box that was explicitly set as To begin with, you can put the test in |
|
Added reftests to existing linear-gradient parsing tests in |
|
Looks great to me, thanks. @bors-servo r+ |
|
|
Default is top-to-bottom if unset, not bottom-to-top <!-- Please describe your changes on the following line: --> Reverse linear gradient direction if not explicitly specified to match expected default behavior --- <!-- 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 #14745 (github issue number if applicable). <!-- 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/14746) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
Default is top-to-bottom if unset, not bottom-to-top <!-- Please describe your changes on the following line: --> Reverse linear gradient direction if not explicitly specified to match expected default behavior --- <!-- 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 #14745 (github issue number if applicable). <!-- 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/14746) <!-- Reviewable:end -->
|
|

DominoTree commentedDec 27, 2016
•
edited
Reverse linear gradient direction if not explicitly specified to match expected default behavior
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is