mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Auto merge of #16334 - chenpighead:stylo-image-orientation-support, r=bholley
Stylo - support image-orientation property First, we need to make Servo's image-orientation parser to be agreed with Gecko's. Numbers without any AngleUnit, including unitless 0 angle, should be invalid for image-orientation. However, rotate() and skew() for transform properties accept unitless 0 angle. In order to make all these properties work properly, I fixed Angle::parse() to match Gecko. For the existing users of Angle::parse(), I create Angle::parse_with_unitless() and use it as an alternative for them. Once https://github.com/w3c/csswg-drafts/issues/1162 is resolved, we shall be able to use an unified version of Angle::parse() then. The parser of image-orientation is also fixed to report parsing errors on empty string. Then, with the newly added binding functions support in Gecko side, we shall reuse the same methods from Gecko to pass the computed value from Servo to Gecko. Gecko bug: Bug 1341758 <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/16334) <!-- Reviewable:end -->
This commit is contained in:
commit
2544c08521
8 changed files with 150 additions and 83 deletions
|
@ -17,7 +17,7 @@ fn image_orientation_longhand_should_parse_properly() {
|
|||
assert_eq!(from_image, SpecifiedValue { angle: None, flipped: false });
|
||||
|
||||
let flip = parse_longhand!(image_orientation, "flip");
|
||||
assert_eq!(flip, SpecifiedValue { angle: None, flipped: true });
|
||||
assert_eq!(flip, SpecifiedValue { angle: Some(Angle::from_degrees(0.0)), flipped: true });
|
||||
|
||||
let zero = parse_longhand!(image_orientation, "0deg");
|
||||
assert_eq!(zero, SpecifiedValue { angle: Some(Angle::from_degrees(0.0)), flipped: false });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue