diff --git a/components/style/values/specified/calc.rs b/components/style/values/specified/calc.rs new file mode 100644 index 00000000000..4f49df256e7 --- /dev/null +++ b/components/style/values/specified/calc.rs @@ -0,0 +1,547 @@ +/* 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 http://mozilla.org/MPL/2.0/. */ + +//! [Calc expressions][calc]. +//! +//! [calc]: https://drafts.csswg.org/css-values/#calc-notation + +use app_units::Au; +use cssparser::{Parser, Token}; +use parser::ParserContext; +use std::ascii::AsciiExt; +use std::fmt; +use style_traits::ToCss; +use values::{CSSInteger, CSSFloat, HasViewportPercentage}; +use values::specified::{Angle, Time}; +use values::specified::length::{FontRelativeLength, NoCalcLength, ViewportPercentageLength}; + +/// A node inside a `Calc` expression's AST. +#[derive(Clone, Debug)] +pub enum CalcNode { + /// `` + Length(NoCalcLength), + /// `` + Angle(Angle), + /// `