Auto merge of #14598 - DominoTree:master, r=canaltinova

Fix linear gradient's specified form #13892

<!-- Please describe your changes on the following line: -->
WIP for #13892

---
<!-- 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 #13892  (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/14598)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-12-16 15:11:29 -08:00 committed by GitHub
commit 9d2b98e6f8
6 changed files with 113 additions and 49 deletions

View file

@ -160,10 +160,9 @@ impl nsStyleImage {
use gecko_bindings::structs::{NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE, NS_STYLE_GRADIENT_SIZE_EXPLICIT_SIZE};
use gecko_bindings::structs::{NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER, NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE};
use gecko_bindings::structs::nsStyleCoord;
use values::computed::{GradientKind, GradientShape, LengthOrKeyword};
use values::computed::{AngleOrCorner, GradientKind, GradientShape, LengthOrKeyword};
use values::computed::LengthOrPercentageOrKeyword;
use values::specified::{AngleOrCorner, HorizontalDirection};
use values::specified::{SizeKeyword, VerticalDirection};
use values::specified::{HorizontalDirection, SizeKeyword, VerticalDirection};
let stop_count = gradient.stops.len();
if stop_count >= ::std::u32::MAX as usize {