mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #16229 - tomhoule:fix-lengths, r=emilio
style: Do not immediately convert absolute specified lengths <!-- Please describe your changes on the following line: --> This PR aims to solve issue #15729. I tried to follow the recommendations there as much as possible. This is my first attempt at contributing to Servo, so this will probably need a lot of input, although I'm eager to make it as polished as possible. - The base inaccuracy issue seems solved, as can be easily verified with the `console.log` based example in the issue. - Very basic unit tests were added. I have doubts mainly about the right way to represent these new enum variants for the various length units: 1. With new enum variants in `NoCalcLength` *and* newtypes (current solution) 2. With a `NoCalcLength::Absolute` variant that contains a new `AbsoluteLength` enum, but without newtypes 3. Same as solution 2 but with newtypes - I mostly cared about unit tests until now but will investigate other types of tests - Tests to check the clamping - Write a proper commit message Thanks for your time and feedback :) --- <!-- 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 #15729. <!-- Either: --> - [X] There are tests for these changes <!-- 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/16229) <!-- Reviewable:end -->
This commit is contained in:
commit
c8cd70f333
12 changed files with 161 additions and 51 deletions
|
@ -29,6 +29,7 @@ pub use self::grid::{GridLine, TrackKeyword};
|
|||
pub use self::image::{AngleOrCorner, ColorStop, EndingShape as GradientEndingShape, Gradient};
|
||||
pub use self::image::{GradientKind, HorizontalDirection, Image, ImageRect, LengthOrKeyword};
|
||||
pub use self::image::{LengthOrPercentageOrKeyword, SizeKeyword, VerticalDirection};
|
||||
pub use self::length::AbsoluteLength;
|
||||
pub use self::length::{FontRelativeLength, ViewportPercentageLength, CharacterWidth, Length, CalcLengthOrPercentage};
|
||||
pub use self::length::{Percentage, LengthOrNone, LengthOrNumber, LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
pub use self::length::{LengthOrPercentageOrNone, LengthOrPercentageOrAutoOrContent, NoCalcLength, CalcUnit};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue