mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Get rid of ComputedValueAsSpecified for alignment props.
This commit is contained in:
parent
64ab73eabd
commit
4c283fbed6
3 changed files with 6 additions and 8 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::computed::{ComputedValueAsSpecified, Context, ToComputedValue};
|
||||
use values::computed::{Context, ToComputedValue};
|
||||
use values::specified;
|
||||
|
||||
pub use super::specified::{AlignItems, AlignJustifyContent, AlignJustifySelf};
|
||||
|
@ -69,7 +69,3 @@ impl ToComputedValue for specified::JustifyItems {
|
|||
computed.specified
|
||||
}
|
||||
}
|
||||
|
||||
impl ComputedValueAsSpecified for AlignItems {}
|
||||
impl ComputedValueAsSpecified for AlignJustifyContent {}
|
||||
impl ComputedValueAsSpecified for AlignJustifySelf {}
|
||||
|
|
|
@ -334,6 +334,7 @@ impl<T> ToComputedValue for T
|
|||
|
||||
trivial_to_computed_value!(Atom);
|
||||
trivial_to_computed_value!(u8);
|
||||
trivial_to_computed_value!(u16);
|
||||
trivial_to_computed_value!(bool);
|
||||
trivial_to_computed_value!(i32);
|
||||
trivial_to_computed_value!(f32);
|
||||
|
|
|
@ -18,6 +18,7 @@ bitflags! {
|
|||
/// Constants shared by multiple CSS Box Alignment properties
|
||||
///
|
||||
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
||||
#[derive(ToComputedValue)]
|
||||
pub flags AlignFlags: u8 {
|
||||
// Enumeration stored in the lower 5 bits:
|
||||
/// 'auto'
|
||||
|
@ -113,7 +114,7 @@ const ALIGN_ALL_SHIFT: u32 = structs::NS_STYLE_ALIGN_ALL_SHIFT;
|
|||
///
|
||||
/// The 16-bit field stores the primary value in its lower 8 bits, and the optional fallback value
|
||||
/// in its upper 8 bits. This matches the representation of these properties in Gecko.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub struct AlignJustifyContent(u16);
|
||||
|
||||
|
@ -205,7 +206,7 @@ impl Parse for AlignJustifyContent {
|
|||
/// Value of the `align-self` or `justify-self` property.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#self-alignment
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
||||
pub struct AlignJustifySelf(pub AlignFlags);
|
||||
|
||||
impl AlignJustifySelf {
|
||||
|
@ -242,7 +243,7 @@ impl Parse for AlignJustifySelf {
|
|||
/// Value of the `align-items` property
|
||||
///
|
||||
/// https://drafts.csswg.org/css-align/#self-alignment
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue, ToCss)]
|
||||
pub struct AlignItems(pub AlignFlags);
|
||||
|
||||
impl AlignItems {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue