servo/components/style/values/generics
Emilio Cobos Álvarez 7d438cd816 style: Ensure that derived types are right for optimized-away implementations.
We have this optimization where, for non-generic structs, we generate just a
clone / move as the ToComputedValue / ToResolvedValue implementation.

This moves the optimization a bit further down, and refines it so that we still
generate all the relevant where clauses that make it sound, that is, that all
the ToComputedValue implementations of the fields return the same type.

Otherwise this wouldn't be sound and the type would need to become generic.

We add an escape hatch (no_field_bound) for fields that need to be cloned but
which don't implement the trait. This is right now only for the RefPtr<> in the
shared font-family list, and a piece of code in PaintWorklet which looks kinda
fishy, and probably should be fixed (but we don't ship it in Firefox and there's
a pre-existing FIXME for servo, so I punted on it for now).

The other thing this patch does is adding a bunch of ToComputedValue /
ToResolvedValue implementations that are trivial and were missing.

Differential Revision: https://phabricator.services.mozilla.com/D67913
2020-04-16 16:35:07 +02:00
..
background.rs style: Fix the serialization of the computed value of background-size. 2019-06-25 13:11:31 +02:00
basic_shape.rs style: Split clip-path and shape-outside values. 2020-04-16 16:35:07 +02:00
border.rs style: Make various border-image-* properties interpolable. 2019-10-09 13:21:35 +02:00
box.rs style: Use rust types for vertical-align. 2019-05-07 12:55:41 +02:00
calc.rs style: Properly reject numbers as part of <length-percentage>. 2020-04-16 16:35:07 +02:00
color.rs style: Reformat recent changes. 2019-04-12 12:20:14 +02:00
column.rs style: Derive ToResolvedValue. 2019-04-12 12:20:09 +02:00
counters.rs Generate ::before and ::after content from attr() for layout 2020 2020-02-25 10:47:48 +01:00
easing.rs style: Use static_prefs::pref!. 2019-08-15 17:00:37 +02:00
effects.rs style: Update cbindgen. 2019-09-12 22:34:16 +02:00
flex.rs style: Derive ToResolvedValue. 2019-04-12 12:20:09 +02:00
font.rs style: Fix Servo build, and rustfmt recent changes. 2019-09-12 23:04:56 +02:00
grid.rs style: Enable multiple grid repeat values in Servo. 2020-04-16 16:35:07 +02:00
image.rs style: Ensure that derived types are right for optimized-away implementations. 2020-04-16 16:35:07 +02:00
length.rs layout-2020: build fixes. 2019-12-16 14:23:56 +01:00
mod.rs style: Move the guts of calc nodes into a generic enum. 2020-04-16 16:35:07 +02:00
motion.rs style: Use Serde for SVGOffsetPath. 2020-02-12 02:43:14 +01:00
position.rs style: Use Serde for OffsetRotate and PositionOrAuto. 2020-02-12 02:43:14 +01:00
rect.rs style: Make various border-image-* properties interpolable. 2019-10-09 13:21:35 +02:00
size.rs style: Derive ToResolvedValue. 2019-04-12 12:20:09 +02:00
svg.rs style: Use cbindgen for SVG lengths. 2020-04-16 16:35:07 +02:00
text.rs style: Move the from-font value from text-underline-offset to text-underline-position, as per recent spec changes, and fix interaction between position and offset. 2020-02-12 02:43:19 +01:00
transform.rs style: Make CalcNode the specified representation of <length> and <length-percentage> values. 2020-04-16 16:35:07 +02:00
ui.rs style: Use cbindgen for cursors. 2020-04-16 16:35:07 +02:00
url.rs style: Update cbindgen. 2019-09-12 22:34:16 +02:00