Introduce CSSPixelLength and update NonNegativeLength.

First, we define computed::CSSPixelLength which contains a CSSFloat, a
pixel value, and then we replace computed::Length with CSSPixelLength.
Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength,
FontRelativeLength, ViewportPercentageLength, CharacterWidth, and
PhysicalLength is CSSPixelLength.

Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength
with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
This commit is contained in:
Boris Chiou 2017-09-13 14:26:51 +08:00
parent cad3aff508
commit a949e2a057
40 changed files with 502 additions and 406 deletions

View file

@ -328,8 +328,9 @@ impl nsStyleImage {
match shape {
EndingShape::Circle(Circle::Radius(length)) => {
unsafe {
(*gecko_gradient).mRadiusX.set_value(CoordDataValue::Coord(length.0));
(*gecko_gradient).mRadiusY.set_value(CoordDataValue::Coord(length.0));
let au = length.to_i32_au();
(*gecko_gradient).mRadiusX.set_value(CoordDataValue::Coord(au));
(*gecko_gradient).mRadiusY.set_value(CoordDataValue::Coord(au));
}
},
EndingShape::Ellipse(Ellipse::Radii(x, y)) => {