style: Use rust lengths for the SVG lengths.

As it turns out we need this to avoid losing precision both during painting and
during serialization.

This patch also changes to serialize `context-value` if it's the computed value.

I could keep the previous behavior, but it makes no sense to serialize the
initial value. We're the only ones to support this value anyway, and I couldn't
find a definition or spec for this.

Also update tests and expectations for:

 * New unexpected passes.
 * Always serializing the unit in getComputedStyle.
 * Calc and interpolation support.

Chrome also always serializes the unit in getComputedStyle, so I'm pretty sure
this is compatible with them. Chrome is inconsistent and keeps numbers in
specified style, but that's inconsistent with itself and with other quirky
lengths, so I updated the tests instead.

Differential Revision: https://phabricator.services.mozilla.com/D21819
This commit is contained in:
Emilio Cobos Álvarez 2019-03-02 02:09:19 +01:00
parent f1b5d5c06a
commit 94686df11b
2 changed files with 7 additions and 16 deletions

View file

@ -84,7 +84,8 @@ ${helpers.predefined_type(
)}
${helpers.predefined_type(
"stroke-width", "SVGWidth",
"stroke-width",
"SVGWidth",
"computed::SVGWidth::one()",
products="gecko",
animation_value_type="crate::values::computed::SVGWidth",