use crate::derives::*;
use crate::values::computed::{Context, ToComputedValue};
use crate::values::specified;
pub use super::specified::{ContentDistribution, ItemPlacement, SelfAlignment};
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToCss, ToResolvedValue, ToTyped)]
#[repr(C)]
#[typed(todo_derive_fields)]
pub struct ComputedJustifyItems {
#[css(skip)]
pub specified: specified::JustifyItems,
pub computed: specified::JustifyItems,
}
pub use self::ComputedJustifyItems as JustifyItems;
impl JustifyItems {
pub fn legacy() -> Self {
Self {
specified: specified::JustifyItems::legacy(),
computed: specified::JustifyItems::normal(),
}
}
}
impl ToComputedValue for specified::JustifyItems {
type ComputedValue = JustifyItems;
fn to_computed_value(&self, _context: &Context) -> JustifyItems {
use crate::values::specified::align;
let specified = *self;
let computed = if (self.0).0 != align::AlignFlags::LEGACY {
*self
} else {
Self::normal()
};
JustifyItems {
specified,
computed,
}
}
#[inline]
fn from_computed_value(computed: &JustifyItems) -> Self {
computed.specified
}
}