From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../properties_and_values/syntax/data_type.rs | 134 +++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 servo/components/style/properties_and_values/syntax/data_type.rs (limited to 'servo/components/style/properties_and_values/syntax/data_type.rs') diff --git a/servo/components/style/properties_and_values/syntax/data_type.rs b/servo/components/style/properties_and_values/syntax/data_type.rs new file mode 100644 index 0000000000..be331e2222 --- /dev/null +++ b/servo/components/style/properties_and_values/syntax/data_type.rs @@ -0,0 +1,134 @@ +/* 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}; + +/// +#[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 `