Skip to main content

css_ast/values/
webkit.rs

1//! Webkit-prefixed CSS property value types.
2//!
3//! Non-standard aliases for standardised properties, kept for compatibility
4//! with legacy stylesheets.
5
6use super::prelude::*;
7
8/// Represents the style value for `-webkit-filter`.
9///
10/// Legacy alias for `filter`. Accepts the same grammar.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// none | <filter-value-list>
16/// ```
17#[syntax(" none | <filter-value-list> ")]
18#[derive(
19	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
20)]
21#[declaration_metadata(
22    initial = "none",
23    applies_to = Unknown,
24    animation_type = Unknown,
25    property_group = FilterEffects,
26    computed_value_type = AsSpecified,
27    canonical_order = "per grammar",
28)]
29#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
31#[derive(csskit_derives::NodeWithMetadata)]
32pub struct WebkitFilterStyleValue<'a>;
33
34/// Represents the style value for `-webkit-flex`.
35///
36/// Legacy alias for `flex`. Accepts the same grammar.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
42/// ```
43#[syntax(" none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ] ")]
44#[derive(
45	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
46)]
47#[declaration_metadata(
48    initial = "0 1 auto",
49    applies_to = Elements,
50    animation_type = Unknown,
51    property_group = Flexbox,
52    computed_value_type = Unknown,
53    canonical_order = "per grammar",
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
57#[derive(csskit_derives::NodeWithMetadata)]
58pub struct WebkitFlexStyleValue;
59
60/// Represents the style value for `-webkit-order`.
61///
62/// Legacy alias for `order`. Accepts the same grammar.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// <integer>
68/// ```
69#[syntax(" <integer> ")]
70#[derive(
71	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
72)]
73#[declaration_metadata(
74    initial = "0",
75    applies_to = Elements,
76    animation_type = ByComputedValue,
77    property_group = Flexbox,
78    computed_value_type = AsSpecified,
79    canonical_order = "per grammar",
80)]
81#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
83#[derive(csskit_derives::NodeWithMetadata)]
84pub struct WebkitOrderStyleValue;
85
86/// Represents the style value for `-webkit-transition`.
87///
88/// Legacy alias for `transition`. Accepts the same grammar.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// <single-transition>#
94/// ```
95#[syntax(" <single-transition># ")]
96#[derive(
97	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
98)]
99#[declaration_metadata(
100    initial = "see individual properties",
101    applies_to = Elements,
102    property_group = Transitions,
103    computed_value_type = Unknown,
104    canonical_order = "per grammar",
105)]
106#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
107#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
108#[derive(csskit_derives::NodeWithMetadata)]
109pub struct WebkitTransitionStyleValue<'a>;
110
111/// Represents the style value for `-webkit-appearance`.
112///
113/// Legacy alias for `appearance`. Accepts the same grammar.
114///
115/// The grammar is defined as:
116///
117/// ```text,ignore
118/// none | auto | base | base-select | <compat-auto> | <compat-special>
119/// ```
120#[syntax(" none | auto | base | base-select | <compat-auto> | <compat-special> ")]
121#[derive(
122	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
123)]
124#[declaration_metadata(
125    initial = "none",
126    applies_to = Elements,
127    animation_type = Discrete,
128    property_group = Ui,
129    computed_value_type = Unknown,
130    canonical_order = "per grammar",
131)]
132#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
133#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
134#[derive(csskit_derives::NodeWithMetadata)]
135pub enum WebkitAppearanceStyleValue {}
136
137/// Represents the style value for `-webkit-transform`.
138///
139/// Legacy alias for `transform`. Accepts the same grammar.
140///
141/// The grammar is defined as:
142///
143/// ```text,ignore
144/// none | <transform-list>
145/// ```
146#[syntax(" none | <transform-list> ")]
147#[derive(
148	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
149)]
150#[declaration_metadata(
151    initial = "none",
152    applies_to = Unknown,
153    animation_type = Unknown,
154    property_group = Transforms,
155    computed_value_type = AsSpecified,
156    canonical_order = "per grammar",
157)]
158#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
159#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
160#[derive(csskit_derives::NodeWithMetadata)]
161pub struct WebkitTransformStyleValue<'a>;
162
163/// Represents the style value for `-webkit-font-smoothing`.
164///
165/// Non-standard WebKit property controlling font antialiasing.
166///
167/// The grammar is defined as:
168///
169/// ```text,ignore
170/// auto | none | antialiased | subpixel-antialiased
171/// ```
172#[syntax(" auto | none | antialiased | subpixel-antialiased ")]
173#[derive(
174	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
175)]
176#[declaration_metadata(
177    initial = "auto",
178    applies_to = Unknown,
179    animation_type = Unknown,
180    property_group = Fonts,
181    computed_value_type = AsSpecified,
182    canonical_order = "per grammar",
183)]
184#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
185#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
186#[derive(csskit_derives::NodeWithMetadata)]
187pub enum WebkitFontSmoothingStyleValue {}
188
189/// Represents the style value for `-webkit-text-size-adjust`.
190///
191/// Legacy alias for `text-size-adjust`.
192///
193/// The grammar is defined as:
194///
195/// ```text,ignore
196/// auto | none | <percentage [0,∞]>
197/// ```
198#[syntax(" auto | none | <percentage [0,∞]> ")]
199#[derive(
200	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
201)]
202#[declaration_metadata(
203    initial = "auto",
204    inherits,
205    applies_to = Elements,
206    animation_type = ByComputedValue,
207    percentages = Unknown,
208    property_group = SizeAdjust,
209    computed_value_type = Unknown,
210    canonical_order = "N/A",
211)]
212#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
213#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
214#[derive(csskit_derives::NodeWithMetadata)]
215pub struct WebkitTextSizeAdjustStyleValue;
216
217/// Represents the style value for `-webkit-animation-delay`.
218///
219/// Legacy alias for `animation-delay`. Accepts the same grammar.
220///
221/// The grammar is defined as:
222///
223/// ```text,ignore
224/// <time>#
225/// ```
226#[syntax(" <time># ")]
227#[derive(
228	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
229)]
230#[declaration_metadata(
231    initial = "0s",
232    applies_to = Elements,
233    property_group = Animations,
234    computed_value_type = Unknown,
235    canonical_order = "per grammar",
236)]
237#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
238#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
239#[derive(csskit_derives::NodeWithMetadata)]
240pub struct WebkitAnimationDelayStyleValue<'a>;
241
242/// Represents the style value for `-webkit-animation-duration`.
243///
244/// Legacy alias for `animation-duration`. Accepts the same grammar.
245///
246/// The grammar is defined as:
247///
248/// ```text,ignore
249/// [ auto | <time [0s,∞]> ]#
250/// ```
251#[syntax(" [ auto | <time [0s,∞]> ]# ")]
252#[derive(
253	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
254)]
255#[declaration_metadata(
256    initial = "auto",
257    applies_to = Elements,
258    property_group = Animations,
259    computed_value_type = Unknown,
260    canonical_order = "per grammar",
261)]
262#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
263#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
264#[derive(csskit_derives::NodeWithMetadata)]
265pub struct WebkitAnimationDurationStyleValue<'a>;
266
267/// Represents the style value for `-webkit-animation-fill-mode`.
268///
269/// Legacy alias for `animation-fill-mode`. Accepts the same grammar.
270///
271/// The grammar is defined as:
272///
273/// ```text,ignore
274/// <single-animation-fill-mode>#
275/// ```
276#[syntax(" <single-animation-fill-mode># ")]
277#[derive(
278	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
279)]
280#[declaration_metadata(
281    initial = "none",
282    applies_to = Elements,
283    property_group = Animations,
284    computed_value_type = Unknown,
285    canonical_order = "per grammar",
286)]
287#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
288#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
289#[derive(csskit_derives::NodeWithMetadata)]
290pub struct WebkitAnimationFillModeStyleValue<'a>;
291
292/// Represents the style value for `-webkit-animation-iteration-count`.
293///
294/// Legacy alias for `animation-iteration-count`. Accepts the same grammar.
295///
296/// The grammar is defined as:
297///
298/// ```text,ignore
299/// <single-animation-iteration-count>#
300/// ```
301#[syntax(" <single-animation-iteration-count># ")]
302#[derive(
303	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
304)]
305#[declaration_metadata(
306    initial = "1",
307    applies_to = Elements,
308    property_group = Animations,
309    computed_value_type = Unknown,
310    canonical_order = "per grammar",
311)]
312#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
313#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
314#[derive(csskit_derives::NodeWithMetadata)]
315pub struct WebkitAnimationIterationCountStyleValue<'a>;
316
317/// Represents the style value for `-webkit-animation-name`.
318///
319/// Legacy alias for `animation-name`. Accepts the same grammar.
320///
321/// The grammar is defined as:
322///
323/// ```text,ignore
324/// [ none | <keyframes-name> ]#
325/// ```
326#[syntax(" [ none | <keyframes-name> ]# ")]
327#[derive(
328	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
329)]
330#[declaration_metadata(
331    initial = "none",
332    applies_to = Elements,
333    property_group = Animations,
334    computed_value_type = Unknown,
335    canonical_order = "per grammar",
336)]
337#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
338#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
339#[derive(csskit_derives::NodeWithMetadata)]
340pub struct WebkitAnimationNameStyleValue<'a>;
341
342/// Represents the style value for `-webkit-animation-timing-function`.
343///
344/// Legacy alias for `animation-timing-function`. Accepts the same grammar.
345///
346/// The grammar is defined as:
347///
348/// ```text,ignore
349/// <easing-function>#
350/// ```
351#[syntax(" <easing-function># ")]
352#[derive(
353	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
354)]
355#[declaration_metadata(
356    initial = "ease",
357    applies_to = Elements,
358    property_group = Animations,
359    computed_value_type = Unknown,
360    canonical_order = "per grammar",
361)]
362#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
363#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
364#[derive(csskit_derives::NodeWithMetadata)]
365pub struct WebkitAnimationTimingFunctionStyleValue<'a>;
366
367/// Represents the style value for `-webkit-backface-visibility`.
368///
369/// Legacy alias for `backface-visibility`. Accepts the same grammar.
370///
371/// The grammar is defined as:
372///
373/// ```text,ignore
374/// visible | hidden
375/// ```
376#[syntax(" visible | hidden ")]
377#[derive(
378	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
379)]
380#[declaration_metadata(
381    initial = "visible",
382    applies_to = Elements,
383    property_group = Transforms,
384    computed_value_type = AsSpecified,
385    canonical_order = "per grammar",
386)]
387#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
388#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
389#[derive(csskit_derives::NodeWithMetadata)]
390pub enum WebkitBackfaceVisibilityStyleValue {}
391
392/// Represents the style value for `-webkit-tap-highlight-color`.
393///
394/// Non-standard property. Sets the highlight colour when an element is tapped.
395///
396/// The grammar is defined as:
397///
398/// ```text,ignore
399/// <color>
400/// ```
401#[syntax(" <color> ")]
402#[derive(
403	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
404)]
405#[declaration_metadata(
406    initial = "transparent",
407    applies_to = Elements,
408    property_group = Ui,
409    computed_value_type = AsSpecified,
410    canonical_order = "per grammar",
411)]
412#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
413#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
414#[derive(csskit_derives::NodeWithMetadata)]
415pub struct WebkitTapHighlightColorStyleValue<'a>;
416
417/// Represents the style value for `-webkit-transition-duration`.
418///
419/// Legacy alias for `transition-duration`. Accepts the same grammar.
420///
421/// The grammar is defined as:
422///
423/// ```text,ignore
424/// <time [0s,∞]>#
425/// ```
426#[syntax(" <time [0s,∞]># ")]
427#[derive(
428	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
429)]
430#[declaration_metadata(
431    initial = "0s",
432    applies_to = Elements,
433    property_group = Transitions,
434    computed_value_type = Unknown,
435    canonical_order = "per grammar",
436)]
437#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
438#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
439#[derive(csskit_derives::NodeWithMetadata)]
440pub struct WebkitTransitionDurationStyleValue<'a>;
441
442/// Represents the style value for `-webkit-transition-timing-function`.
443///
444/// Legacy alias for `transition-timing-function`. Accepts the same grammar.
445///
446/// The grammar is defined as:
447///
448/// ```text,ignore
449/// <easing-function>#
450/// ```
451#[syntax(" <easing-function># ")]
452#[derive(
453	Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
454)]
455#[declaration_metadata(
456    initial = "ease",
457    applies_to = Elements,
458    property_group = Transitions,
459    computed_value_type = AsSpecified,
460    canonical_order = "per grammar",
461)]
462#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
463#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
464#[derive(csskit_derives::NodeWithMetadata)]
465pub struct WebkitTransitionTimingFunctionStyleValue<'a>;
466
467#[cfg(test)]
468mod tests {
469	use super::*;
470	use crate::CssAtomSet;
471	use css_parse::{assert_parse, assert_parse_error};
472
473	#[test]
474	fn size_test() {
475		assert_eq!(std::mem::size_of::<WebkitFilterStyleValue>(), 32);
476	}
477
478	#[test]
479	fn test_parses() {
480		assert_parse!(CssAtomSet::ATOMS, WebkitFilterStyleValue, "none");
481		assert_parse!(CssAtomSet::ATOMS, WebkitFilterStyleValue, "blur(4px)");
482		assert_parse!(CssAtomSet::ATOMS, WebkitFilterStyleValue, "brightness(0.5) contrast(1.2)");
483		assert_parse!(CssAtomSet::ATOMS, WebkitFilterStyleValue, "drop-shadow(2px 4px)");
484		assert_parse!(CssAtomSet::ATOMS, WebkitFilterStyleValue, "drop-shadow(red 2px 4px)");
485	}
486
487	#[test]
488	fn test_errors() {
489		assert_parse_error!(CssAtomSet::ATOMS, WebkitFilterStyleValue, "invalid");
490	}
491
492	#[test]
493	fn size_test_transition() {
494		assert_eq!(
495			std::mem::size_of::<WebkitTransitionStyleValue>(),
496			std::mem::size_of::<crate::values::TransitionStyleValue>()
497		);
498	}
499
500	#[test]
501	fn test_transition_parses() {
502		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionStyleValue, "none");
503		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionStyleValue, "all 0.3s ease");
504		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionStyleValue, "opacity 1s, transform 0.5s");
505	}
506
507	#[test]
508	fn test_transition_errors() {
509		assert_parse_error!(CssAtomSet::ATOMS, WebkitTransitionStyleValue, "invalid!!!!");
510	}
511
512	#[test]
513	fn size_test_flex() {
514		assert_eq!(std::mem::size_of::<WebkitFlexStyleValue>(), std::mem::size_of::<crate::values::FlexStyleValue>());
515	}
516
517	#[test]
518	fn test_flex_parses() {
519		assert_parse!(CssAtomSet::ATOMS, WebkitFlexStyleValue, "none");
520		assert_parse!(CssAtomSet::ATOMS, WebkitFlexStyleValue, "1");
521		assert_parse!(CssAtomSet::ATOMS, WebkitFlexStyleValue, "1 1 auto");
522	}
523
524	#[test]
525	fn test_flex_errors() {
526		assert_parse_error!(CssAtomSet::ATOMS, WebkitFlexStyleValue, "invalid");
527	}
528
529	#[test]
530	fn size_test_order() {
531		assert_eq!(std::mem::size_of::<WebkitOrderStyleValue>(), std::mem::size_of::<crate::values::OrderStyleValue>());
532	}
533
534	#[test]
535	fn test_order_parses() {
536		assert_parse!(CssAtomSet::ATOMS, WebkitOrderStyleValue, "0");
537		assert_parse!(CssAtomSet::ATOMS, WebkitOrderStyleValue, "-1");
538		assert_parse!(CssAtomSet::ATOMS, WebkitOrderStyleValue, "5");
539	}
540
541	#[test]
542	fn test_order_errors() {
543		assert_parse_error!(CssAtomSet::ATOMS, WebkitOrderStyleValue, "none");
544	}
545
546	#[test]
547	fn size_test_appearance() {
548		assert_eq!(std::mem::size_of::<WebkitAppearanceStyleValue>(), 20);
549	}
550
551	#[test]
552	fn test_appearance_parses() {
553		assert_parse!(CssAtomSet::ATOMS, WebkitAppearanceStyleValue, "none");
554		assert_parse!(CssAtomSet::ATOMS, WebkitAppearanceStyleValue, "auto");
555		assert_parse!(CssAtomSet::ATOMS, WebkitAppearanceStyleValue, "textfield");
556		assert_parse!(CssAtomSet::ATOMS, WebkitAppearanceStyleValue, "button");
557	}
558
559	#[test]
560	fn test_appearance_errors() {
561		assert_parse_error!(CssAtomSet::ATOMS, WebkitAppearanceStyleValue, "invalid");
562	}
563
564	#[test]
565	fn size_test_transform() {
566		assert_eq!(std::mem::size_of::<WebkitTransformStyleValue>(), 32);
567	}
568
569	#[test]
570	fn test_transform_parses() {
571		assert_parse!(CssAtomSet::ATOMS, WebkitTransformStyleValue, "none");
572		assert_parse!(CssAtomSet::ATOMS, WebkitTransformStyleValue, "rotate(45deg)");
573		assert_parse!(CssAtomSet::ATOMS, WebkitTransformStyleValue, "scale(-1, 1)");
574	}
575
576	#[test]
577	fn test_transform_errors() {
578		assert_parse_error!(CssAtomSet::ATOMS, WebkitTransformStyleValue, "invalid");
579	}
580
581	#[test]
582	fn size_test_font_smoothing() {
583		assert_eq!(std::mem::size_of::<WebkitFontSmoothingStyleValue>(), 16);
584	}
585
586	#[test]
587	fn test_font_smoothing_parses() {
588		assert_parse!(CssAtomSet::ATOMS, WebkitFontSmoothingStyleValue, "auto");
589		assert_parse!(CssAtomSet::ATOMS, WebkitFontSmoothingStyleValue, "none");
590		assert_parse!(CssAtomSet::ATOMS, WebkitFontSmoothingStyleValue, "antialiased");
591		assert_parse!(CssAtomSet::ATOMS, WebkitFontSmoothingStyleValue, "subpixel-antialiased");
592	}
593
594	#[test]
595	fn test_font_smoothing_errors() {
596		assert_parse_error!(CssAtomSet::ATOMS, WebkitFontSmoothingStyleValue, "invalid");
597	}
598
599	#[test]
600	fn size_test_text_size_adjust() {
601		assert_eq!(std::mem::size_of::<WebkitTextSizeAdjustStyleValue>(), 16);
602	}
603
604	#[test]
605	fn test_text_size_adjust_parses() {
606		assert_parse!(CssAtomSet::ATOMS, WebkitTextSizeAdjustStyleValue, "auto");
607		assert_parse!(CssAtomSet::ATOMS, WebkitTextSizeAdjustStyleValue, "none");
608		assert_parse!(CssAtomSet::ATOMS, WebkitTextSizeAdjustStyleValue, "100%");
609	}
610
611	#[test]
612	fn test_text_size_adjust_errors() {
613		assert_parse_error!(CssAtomSet::ATOMS, WebkitTextSizeAdjustStyleValue, "invalid");
614	}
615
616	#[test]
617	fn size_test_animation_delay() {
618		assert_eq!(
619			std::mem::size_of::<WebkitAnimationDelayStyleValue>(),
620			std::mem::size_of::<crate::values::AnimationDelayStyleValue>()
621		);
622	}
623
624	#[test]
625	fn test_animation_delay_parses() {
626		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationDelayStyleValue, "0s");
627		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationDelayStyleValue, "0.5s, 1s");
628	}
629
630	#[test]
631	fn test_animation_delay_errors() {
632		assert_parse_error!(CssAtomSet::ATOMS, WebkitAnimationDelayStyleValue, "invalid");
633	}
634
635	#[test]
636	fn size_test_animation_duration() {
637		assert_eq!(
638			std::mem::size_of::<WebkitAnimationDurationStyleValue>(),
639			std::mem::size_of::<crate::values::AnimationDurationStyleValue>()
640		);
641	}
642
643	#[test]
644	fn test_animation_duration_parses() {
645		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationDurationStyleValue, "auto");
646		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationDurationStyleValue, "0.3s");
647		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationDurationStyleValue, "1s, 2s");
648	}
649
650	#[test]
651	fn test_animation_duration_errors() {
652		assert_parse_error!(CssAtomSet::ATOMS, WebkitAnimationDurationStyleValue, "invalid");
653	}
654
655	#[test]
656	fn size_test_animation_fill_mode() {
657		assert_eq!(
658			std::mem::size_of::<WebkitAnimationFillModeStyleValue>(),
659			std::mem::size_of::<crate::values::AnimationFillModeStyleValue>()
660		);
661	}
662
663	#[test]
664	fn test_animation_fill_mode_parses() {
665		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationFillModeStyleValue, "none");
666		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationFillModeStyleValue, "forwards");
667		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationFillModeStyleValue, "both");
668	}
669
670	#[test]
671	fn test_animation_fill_mode_errors() {
672		assert_parse_error!(CssAtomSet::ATOMS, WebkitAnimationFillModeStyleValue, "invalid");
673	}
674
675	#[test]
676	fn size_test_animation_iteration_count() {
677		assert_eq!(
678			std::mem::size_of::<WebkitAnimationIterationCountStyleValue>(),
679			std::mem::size_of::<crate::values::AnimationIterationCountStyleValue>()
680		);
681	}
682
683	#[test]
684	fn test_animation_iteration_count_parses() {
685		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationIterationCountStyleValue, "1");
686		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationIterationCountStyleValue, "infinite");
687		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationIterationCountStyleValue, "3");
688	}
689
690	#[test]
691	fn test_animation_iteration_count_errors() {
692		assert_parse_error!(CssAtomSet::ATOMS, WebkitAnimationIterationCountStyleValue, "invalid");
693	}
694
695	#[test]
696	fn size_test_animation_name() {
697		assert_eq!(
698			std::mem::size_of::<WebkitAnimationNameStyleValue>(),
699			std::mem::size_of::<crate::values::AnimationNameStyleValue>()
700		);
701	}
702
703	#[test]
704	fn test_animation_name_parses() {
705		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationNameStyleValue, "none");
706		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationNameStyleValue, "my-animation");
707	}
708
709	#[test]
710	fn test_animation_name_errors() {
711		assert_parse_error!(CssAtomSet::ATOMS, WebkitAnimationNameStyleValue, "");
712	}
713
714	#[test]
715	fn size_test_animation_timing_function() {
716		assert_eq!(
717			std::mem::size_of::<WebkitAnimationTimingFunctionStyleValue>(),
718			std::mem::size_of::<crate::values::AnimationTimingFunctionStyleValue>()
719		);
720	}
721
722	#[test]
723	fn test_animation_timing_function_parses() {
724		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationTimingFunctionStyleValue, "ease");
725		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationTimingFunctionStyleValue, "linear");
726		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationTimingFunctionStyleValue, "ease-in-out");
727		assert_parse!(CssAtomSet::ATOMS, WebkitAnimationTimingFunctionStyleValue, "cubic-bezier(0.4, 0, 0.2, 1)");
728	}
729
730	#[test]
731	fn test_animation_timing_function_errors() {
732		assert_parse_error!(CssAtomSet::ATOMS, WebkitAnimationTimingFunctionStyleValue, "invalid");
733	}
734
735	#[test]
736	fn size_test_backface_visibility() {
737		assert_eq!(
738			std::mem::size_of::<WebkitBackfaceVisibilityStyleValue>(),
739			std::mem::size_of::<crate::values::BackfaceVisibilityStyleValue>()
740		);
741	}
742
743	#[test]
744	fn test_backface_visibility_parses() {
745		assert_parse!(CssAtomSet::ATOMS, WebkitBackfaceVisibilityStyleValue, "visible");
746		assert_parse!(CssAtomSet::ATOMS, WebkitBackfaceVisibilityStyleValue, "hidden");
747	}
748
749	#[test]
750	fn test_backface_visibility_errors() {
751		assert_parse_error!(CssAtomSet::ATOMS, WebkitBackfaceVisibilityStyleValue, "invalid");
752	}
753
754	#[test]
755	fn size_test_tap_highlight_color() {
756		assert_eq!(
757			std::mem::size_of::<WebkitTapHighlightColorStyleValue>(),
758			std::mem::size_of::<crate::values::BackgroundColorStyleValue>()
759		);
760	}
761
762	#[test]
763	fn test_tap_highlight_color_parses() {
764		assert_parse!(CssAtomSet::ATOMS, WebkitTapHighlightColorStyleValue, "transparent");
765		assert_parse!(CssAtomSet::ATOMS, WebkitTapHighlightColorStyleValue, "red");
766		assert_parse!(CssAtomSet::ATOMS, WebkitTapHighlightColorStyleValue, "rgba(0, 0, 0, 0)");
767	}
768
769	#[test]
770	fn test_tap_highlight_color_errors() {
771		assert_parse_error!(CssAtomSet::ATOMS, WebkitTapHighlightColorStyleValue, "invalid");
772	}
773
774	#[test]
775	fn size_test_transition_duration() {
776		assert_eq!(
777			std::mem::size_of::<WebkitTransitionDurationStyleValue>(),
778			std::mem::size_of::<crate::values::TransitionDurationStyleValue>()
779		);
780	}
781
782	#[test]
783	fn test_transition_duration_parses() {
784		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionDurationStyleValue, "0s");
785		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionDurationStyleValue, "0.3s");
786		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionDurationStyleValue, "1s, 200ms");
787	}
788
789	#[test]
790	fn test_transition_duration_errors() {
791		assert_parse_error!(CssAtomSet::ATOMS, WebkitTransitionDurationStyleValue, "invalid");
792	}
793
794	#[test]
795	fn size_test_transition_timing_function() {
796		assert_eq!(
797			std::mem::size_of::<WebkitTransitionTimingFunctionStyleValue>(),
798			std::mem::size_of::<crate::values::TransitionTimingFunctionStyleValue>()
799		);
800	}
801
802	#[test]
803	fn test_transition_timing_function_parses() {
804		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionTimingFunctionStyleValue, "ease");
805		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionTimingFunctionStyleValue, "linear");
806		assert_parse!(CssAtomSet::ATOMS, WebkitTransitionTimingFunctionStyleValue, "cubic-bezier(0.4, 0, 0.2, 1)");
807	}
808
809	#[test]
810	fn test_transition_timing_function_errors() {
811		assert_parse_error!(CssAtomSet::ATOMS, WebkitTransitionTimingFunctionStyleValue, "invalid");
812	}
813}