1use super::prelude::*;
7
8#[syntax(" fill | none | [ contain | cover ] || scale-down ")]
10#[derive(
11 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
12)]
13#[declaration_metadata(
14 initial = "fill",
15 applies_to = Elements,
16 animation_type = Discrete,
17 property_group = Images,
18 computed_value_type = AsSpecified,
19 canonical_order = "per grammar",
20)]
21#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
22#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
23#[derive(csskit_derives::NodeWithMetadata)]
24pub enum OObjectFitStyleValue<'a> {}
25
26#[syntax(" content-box | border-box ")]
28#[derive(
29 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
30)]
31#[declaration_metadata(
32 initial = "content-box",
33 applies_to = Elements,
34 animation_type = Discrete,
35 property_group = Sizing,
36 computed_value_type = AsSpecified,
37 canonical_order = "per grammar",
38)]
39#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
40#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
41#[derive(csskit_derives::NodeWithMetadata)]
42pub enum OBoxSizingStyleValue<'a> {}
43
44#[syntax(" none | <filter-value-list> ")]
46#[derive(
47 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
48)]
49#[declaration_metadata(
50 initial = "none",
51 applies_to = Elements,
52 animation_type = Unknown,
53 property_group = FilterEffects,
54 computed_value_type = AsSpecified,
55 canonical_order = "per grammar",
56)]
57#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
58#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
59#[derive(csskit_derives::NodeWithMetadata)]
60pub struct OFilterStyleValue<'a>;
61
62#[cfg(test)]
63mod tests {
64 use super::*;
65 use crate::CssAtomSet;
66 use css_parse::{assert_parse, assert_peek_false};
67
68 #[test]
69 fn test_o_object_fit_parses() {
70 assert_parse!(CssAtomSet::ATOMS, OObjectFitStyleValue, "fill");
71 assert_parse!(CssAtomSet::ATOMS, OObjectFitStyleValue, "none");
72 assert_parse!(CssAtomSet::ATOMS, OObjectFitStyleValue, "contain");
73 assert_parse!(CssAtomSet::ATOMS, OObjectFitStyleValue, "cover");
74 assert_parse!(CssAtomSet::ATOMS, OObjectFitStyleValue, "scale-down");
75 }
76
77 #[test]
78 fn test_o_object_fit_errors() {
79 assert_peek_false!(CssAtomSet::ATOMS, OObjectFitStyleValue, "invalid");
80 }
81
82 #[test]
83 fn test_o_box_sizing_parses() {
84 assert_parse!(CssAtomSet::ATOMS, OBoxSizingStyleValue, "content-box");
85 assert_parse!(CssAtomSet::ATOMS, OBoxSizingStyleValue, "border-box");
86 }
87
88 #[test]
89 fn test_o_box_sizing_errors() {
90 assert_peek_false!(CssAtomSet::ATOMS, OBoxSizingStyleValue, "invalid");
91 }
92
93 #[test]
94 fn test_o_filter_parses() {
95 assert_parse!(CssAtomSet::ATOMS, OFilterStyleValue, "none");
96 assert_parse!(CssAtomSet::ATOMS, OFilterStyleValue, "blur(4px)");
97 assert_parse!(CssAtomSet::ATOMS, OFilterStyleValue, "brightness(0.5) contrast(1.2)");
98 }
99
100 #[test]
101 fn test_o_filter_errors() {
102 assert_peek_false!(CssAtomSet::ATOMS, OFilterStyleValue, "invalid");
103 }
104}