style: Some preparation to start using cbindgen for shape-outside and clip-path.

Tweak the ShapeSourceRepresentation so that it doesn't store Option<>s.

Some renames so that GeometryBox doesn't conflict with the Gecko type, and some
other usual bits / re-exports to deal with cbindgen and generics.

Also, drive-by derive parsing of GeometryBox as it's trivial.

Doing this unfortunately is not possible without removing nsStyleImage first, so
let's do that before.

This makes us serialize in the shortest form for shape-outside, but that's what
we should do anyway.

(aside: the shapes code is a bit too generic, maybe we should unify
ClippingShape and FloatAreaShape...)

Differential Revision: https://phabricator.services.mozilla.com/D62163
This commit is contained in:
Emilio Cobos Álvarez 2020-02-11 20:56:13 +00:00
parent 08175a494e
commit 4dadcf71a5
5 changed files with 76 additions and 68 deletions

View file

@ -15,10 +15,10 @@ use crate::values::generics::basic_shape as generic;
pub use crate::values::generics::basic_shape::FillRule;
/// A computed clipping shape.
pub type ClippingShape = generic::ClippingShape<BasicShape, ComputedUrl>;
pub type ClippingShape = generic::GenericClippingShape<BasicShape, ComputedUrl>;
/// A computed float area shape.
pub type FloatAreaShape = generic::FloatAreaShape<BasicShape, Image>;
pub type FloatAreaShape = generic::GenericFloatAreaShape<BasicShape, Image>;
/// A computed basic shape.
pub type BasicShape = generic::GenericBasicShape<