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

@ -69,10 +69,10 @@ ${helpers.predefined_type(
${helpers.predefined_type("outline-width",
"BorderSideWidth",
"::values::computed::NonNegativeAu::from_px(3)",
"::values::computed::NonNegativeLength::new(3.)",
initial_specified_value="specified::BorderSideWidth::Medium",
computed_type="::values::computed::NonNegativeAu",
animation_value_type="NonNegativeAu",
computed_type="::values::computed::NonNegativeLength",
animation_value_type="NonNegativeLength",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-width")}
// The -moz-outline-radius-* properties are non-standard and not on a standards track.
@ -85,6 +85,6 @@ ${helpers.predefined_type("outline-width",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)")}
% endfor
${helpers.predefined_type("outline-offset", "Length", "Au(0)", products="servo gecko",
animation_value_type="ComputedValue",
${helpers.predefined_type("outline-offset", "Length", "::values::computed::Length::new(0.)",
products="servo gecko", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset")}