style: Use cbindgen for css-align types.

This provides stronger typing and removes a bunch of subtle constants matching.

Differential Revision: https://phabricator.services.mozilla.com/D61058
This commit is contained in:
Emilio Cobos Álvarez 2020-01-31 00:56:49 +00:00
parent 41ae92e045
commit 2bdcd766bb
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
3 changed files with 39 additions and 100 deletions

View file

@ -9,7 +9,7 @@
use crate::values::computed::{Context, ToComputedValue};
use crate::values::specified;
pub use super::specified::{AlignContent, AlignItems, JustifyContent, SelfAlignment};
pub use super::specified::{AlignContent, AlignItems, ContentDistribution, JustifyContent, SelfAlignment};
pub use super::specified::{AlignSelf, JustifySelf};
/// The computed value for the `justify-items` property.
@ -34,7 +34,8 @@ pub use super::specified::{AlignSelf, JustifySelf};
///
/// See the discussion in https://bugzil.la/1384542.
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss, ToResolvedValue)]
pub struct JustifyItems {
#[repr(C)]
pub struct ComputedJustifyItems {
/// The specified value for the property. Can contain the bare `legacy`
/// keyword.
#[css(skip)]
@ -45,6 +46,8 @@ pub struct JustifyItems {
pub computed: specified::JustifyItems,
}
pub use self::ComputedJustifyItems as JustifyItems;
impl JustifyItems {
/// Returns the `legacy` value.
pub fn legacy() -> Self {