/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ //! Used for parsing and serializing component names from the syntax string. use super::{Component, ComponentName, Multiplier}; use std::fmt::{self, Debug, Write}; use style_traits::{CssWriter, ToCss}; /// Some types (lengths and colors) depend on other properties to resolve correctly. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, MallocSizeOf, ToShmem)] pub struct DependentDataTypes(u8); bitflags! { impl DependentDataTypes: u8 { /// values depend on font-size/line-height/zoom... const LENGTH = 1 << 0; /// values depend on color-scheme, etc.. const COLOR= 1 << 1; } } /// #[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq)] pub enum DataType { /// Any valid `` value Length, /// `` values Number, /// Any valid value Percentage, /// Any valid `` or `` value, any valid `` expression combining /// `` and `` components. LengthPercentage, /// Any valid `` value Color, /// Any valid `` value Image, /// Any valid `` value Url, /// Any valid `` value Integer, /// Any valid `` value Angle, /// Any valid `