1
//! Internal macros for reducing boilerplate in property definitions.
2
//!
3
//! - `impl_pixel_value!` — adds unit constructors (`px`, `em`, `pt`, …) to structs wrapping `PixelValue`
4
//! - `impl_percentage_value!` — adds constructors and `Display`/`Debug` impls for percentage wrappers
5
//! - `css_property_from_type!` — maps `CssPropertyType` variants to `CssProperty` enum values (used by `property.rs`)
6

            
7
/// Creates `pt`, `px` and `em` constructors for any struct that has a
8
/// `PixelValue` as its `self.inner` field.
9
macro_rules! impl_pixel_value {
10
    ($struct:ident) => {
11
        impl $struct {
12
            #[inline]
13
14
            #[must_use] pub const fn zero() -> Self {
14
14
                Self {
15
14
                    inner: crate::props::basic::pixel::PixelValue::zero(),
16
14
                }
17
14
            }
18

            
19
            #[inline]
20
1656332
            #[must_use] pub const fn const_px(value: isize) -> Self {
21
1656332
                Self {
22
1656332
                    inner: crate::props::basic::pixel::PixelValue::const_px(value),
23
1656332
                }
24
1656332
            }
25

            
26
            #[inline]
27
2
            #[must_use] pub const fn const_em(value: isize) -> Self {
28
2
                Self {
29
2
                    inner: crate::props::basic::pixel::PixelValue::const_em(value),
30
2
                }
31
2
            }
32

            
33
            #[inline]
34
2
            #[must_use] pub const fn const_pt(value: isize) -> Self {
35
2
                Self {
36
2
                    inner: crate::props::basic::pixel::PixelValue::const_pt(value),
37
2
                }
38
2
            }
39

            
40
            #[inline]
41
2
            #[must_use] pub const fn const_percent(value: isize) -> Self {
42
2
                Self {
43
2
                    inner: crate::props::basic::pixel::PixelValue::const_percent(value),
44
2
                }
45
2
            }
46

            
47
            #[inline]
48
1
            #[must_use] pub const fn const_in(value: isize) -> Self {
49
1
                Self {
50
1
                    inner: crate::props::basic::pixel::PixelValue::const_in(value),
51
1
                }
52
1
            }
53

            
54
            #[inline]
55
1
            #[must_use] pub const fn const_cm(value: isize) -> Self {
56
1
                Self {
57
1
                    inner: crate::props::basic::pixel::PixelValue::const_cm(value),
58
1
                }
59
1
            }
60

            
61
            #[inline]
62
1
            #[must_use] pub const fn const_mm(value: isize) -> Self {
63
1
                Self {
64
1
                    inner: crate::props::basic::pixel::PixelValue::const_mm(value),
65
1
                }
66
1
            }
67

            
68
            #[inline]
69
1
            #[must_use] pub const fn const_from_metric(
70
1
                metric: crate::props::basic::length::SizeMetric,
71
1
                value: isize,
72
1
            ) -> Self {
73
1
                Self {
74
1
                    inner: crate::props::basic::pixel::PixelValue::const_from_metric(metric, value),
75
1
                }
76
1
            }
77

            
78
            #[inline]
79
93
            #[must_use] pub fn px(value: f32) -> Self {
80
93
                Self {
81
93
                    inner: crate::props::basic::pixel::PixelValue::px(value),
82
93
                }
83
93
            }
84

            
85
            #[inline]
86
21
            #[must_use] pub fn em(value: f32) -> Self {
87
21
                Self {
88
21
                    inner: crate::props::basic::pixel::PixelValue::em(value),
89
21
                }
90
21
            }
91

            
92
            #[inline]
93
5
            #[must_use] pub fn pt(value: f32) -> Self {
94
5
                Self {
95
5
                    inner: crate::props::basic::pixel::PixelValue::pt(value),
96
5
                }
97
5
            }
98

            
99
            #[inline]
100
7
            #[must_use] pub fn percent(value: f32) -> Self {
101
7
                Self {
102
7
                    inner: crate::props::basic::pixel::PixelValue::percent(value),
103
7
                }
104
7
            }
105

            
106
            #[inline]
107
4
            #[must_use] pub fn from_metric(
108
4
                metric: crate::props::basic::length::SizeMetric,
109
4
                value: f32,
110
4
            ) -> Self {
111
4
                Self {
112
4
                    inner: crate::props::basic::pixel::PixelValue::from_metric(metric, value),
113
4
                }
114
4
            }
115

            
116
            #[inline]
117
46
            #[must_use] pub fn interpolate(&self, other: &Self, t: f32) -> Self {
118
46
                $struct {
119
46
                    inner: self.inner.interpolate(&other.inner, t),
120
46
                }
121
46
            }
122
        }
123
    };
124
}
125

            
126
macro_rules! impl_percentage_value {
127
    ($struct:ident) => {
128
        impl ::core::fmt::Display for $struct {
129
7
            fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
130
7
                write!(f, "{}%", self.inner.normalized() * 100.0)
131
7
            }
132
        }
133

            
134
        impl ::core::fmt::Debug for $struct {
135
            fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
136
                write!(f, "{}%", self.inner.normalized() * 100.0)
137
            }
138
        }
139

            
140
        impl $struct {
141
            /// Same as `PercentageValue::new()`, but only accepts whole numbers
142
            /// in order to be usable in `const` context.
143
            #[inline]
144
119847
            #[must_use] pub const fn const_new(value: isize) -> Self {
145
119847
                Self {
146
119847
                    inner: PercentageValue::const_new(value),
147
119847
                }
148
119847
            }
149

            
150
            #[inline]
151
9
            #[must_use] pub fn new(value: f32) -> Self {
152
9
                Self {
153
9
                    inner: PercentageValue::new(value),
154
9
                }
155
9
            }
156

            
157
            #[inline]
158
1440
            #[must_use] pub fn interpolate(&self, other: &Self, t: f32) -> Self {
159
1440
                $struct {
160
1440
                    inner: self.inner.interpolate(&other.inner, t),
161
1440
                }
162
1440
            }
163
        }
164
    };
165
}
166

            
167
/// Converts a `PixelValue` into a typed dimension wrapper, used by the layout solver.
168
pub trait PixelValueTaker {
169
    fn from_pixel_value(inner: crate::props::basic::pixel::PixelValue) -> Self;
170
}
171

            
172
macro_rules! css_property_from_type {
173
    ($prop_type:expr, $content_type:ident) => {{
174
        match $prop_type {
175
            CssPropertyType::CaretColor => CssProperty::CaretColor(CssPropertyValue::$content_type),
176
            CssPropertyType::CaretWidth => CssProperty::CaretWidth(CssPropertyValue::$content_type),
177
            CssPropertyType::CaretAnimationDuration => {
178
                CssProperty::CaretAnimationDuration(CssPropertyValue::$content_type)
179
            }
180
            CssPropertyType::Animation => CssProperty::Animation(CssPropertyValue::$content_type),
181
            CssPropertyType::AnimationIn => {
182
                CssProperty::AnimationIn(CssPropertyValue::$content_type)
183
            }
184
            CssPropertyType::AnimationOut => {
185
                CssProperty::AnimationOut(CssPropertyValue::$content_type)
186
            }
187
            CssPropertyType::SelectionBackgroundColor => {
188
                CssProperty::SelectionBackgroundColor(CssPropertyValue::$content_type)
189
            }
190
            CssPropertyType::SelectionColor => {
191
                CssProperty::SelectionColor(CssPropertyValue::$content_type)
192
            }
193
            CssPropertyType::SelectionRadius => {
194
                CssProperty::SelectionRadius(CssPropertyValue::$content_type)
195
            }
196

            
197
            CssPropertyType::TextColor => CssProperty::TextColor(CssPropertyValue::$content_type),
198
            CssPropertyType::FontSize => CssProperty::FontSize(CssPropertyValue::$content_type),
199
            CssPropertyType::FontFamily => CssProperty::FontFamily(CssPropertyValue::$content_type),
200
            CssPropertyType::TextAlign => CssProperty::TextAlign(CssPropertyValue::$content_type),
201
            CssPropertyType::VerticalAlign => {
202
                CssProperty::VerticalAlign(CssPropertyValue::$content_type)
203
            }
204
            CssPropertyType::LetterSpacing => {
205
                CssProperty::LetterSpacing(CssPropertyValue::$content_type)
206
            }
207
            CssPropertyType::TextIndent => CssProperty::TextIndent(CssPropertyValue::$content_type),
208
            CssPropertyType::InitialLetter => {
209
                CssProperty::InitialLetter(CssPropertyValue::$content_type)
210
            }
211
            CssPropertyType::LineClamp => CssProperty::LineClamp(CssPropertyValue::$content_type),
212
            CssPropertyType::HangingPunctuation => {
213
                CssProperty::HangingPunctuation(CssPropertyValue::$content_type)
214
            }
215
            CssPropertyType::TextCombineUpright => {
216
                CssProperty::TextCombineUpright(CssPropertyValue::$content_type)
217
            }
218
            CssPropertyType::ExclusionMargin => {
219
                CssProperty::ExclusionMargin(CssPropertyValue::$content_type)
220
            }
221
            CssPropertyType::HyphenationLanguage => {
222
                CssProperty::HyphenationLanguage(CssPropertyValue::$content_type)
223
            }
224
            CssPropertyType::LineHeight => CssProperty::LineHeight(CssPropertyValue::$content_type),
225
            CssPropertyType::WordSpacing => {
226
                CssProperty::WordSpacing(CssPropertyValue::$content_type)
227
            }
228
            CssPropertyType::TabSize => CssProperty::TabSize(CssPropertyValue::$content_type),
229
            CssPropertyType::Cursor => CssProperty::Cursor(CssPropertyValue::$content_type),
230
            CssPropertyType::Display => CssProperty::Display(CssPropertyValue::$content_type),
231
            CssPropertyType::Float => CssProperty::Float(CssPropertyValue::$content_type),
232
            CssPropertyType::BoxSizing => CssProperty::BoxSizing(CssPropertyValue::$content_type),
233
            CssPropertyType::Width => CssProperty::Width(CssPropertyValue::$content_type),
234
            CssPropertyType::Height => CssProperty::Height(CssPropertyValue::$content_type),
235
            CssPropertyType::MinWidth => CssProperty::MinWidth(CssPropertyValue::$content_type),
236
            CssPropertyType::MinHeight => CssProperty::MinHeight(CssPropertyValue::$content_type),
237
            CssPropertyType::MaxWidth => CssProperty::MaxWidth(CssPropertyValue::$content_type),
238
            CssPropertyType::MaxHeight => CssProperty::MaxHeight(CssPropertyValue::$content_type),
239
            CssPropertyType::Position => CssProperty::Position(CssPropertyValue::$content_type),
240
            CssPropertyType::Top => CssProperty::Top(CssPropertyValue::$content_type),
241
            CssPropertyType::Right => CssProperty::Right(CssPropertyValue::$content_type),
242
            CssPropertyType::Left => CssProperty::Left(CssPropertyValue::$content_type),
243
            CssPropertyType::Bottom => CssProperty::Bottom(CssPropertyValue::$content_type),
244
            CssPropertyType::ZIndex => CssProperty::ZIndex(CssPropertyValue::$content_type),
245
            CssPropertyType::FlexWrap => CssProperty::FlexWrap(CssPropertyValue::$content_type),
246
            CssPropertyType::FlexDirection => {
247
                CssProperty::FlexDirection(CssPropertyValue::$content_type)
248
            }
249
            CssPropertyType::FlexGrow => CssProperty::FlexGrow(CssPropertyValue::$content_type),
250
            CssPropertyType::FlexShrink => CssProperty::FlexShrink(CssPropertyValue::$content_type),
251
            CssPropertyType::FlexBasis => CssProperty::FlexBasis(CssPropertyValue::$content_type),
252
            CssPropertyType::JustifyContent => {
253
                CssProperty::JustifyContent(CssPropertyValue::$content_type)
254
            }
255
            CssPropertyType::AlignItems => CssProperty::AlignItems(CssPropertyValue::$content_type),
256
            CssPropertyType::AlignContent => {
257
                CssProperty::AlignContent(CssPropertyValue::$content_type)
258
            }
259
            CssPropertyType::ColumnGap => CssProperty::ColumnGap(CssPropertyValue::$content_type),
260
            CssPropertyType::RowGap => CssProperty::RowGap(CssPropertyValue::$content_type),
261
            CssPropertyType::GridTemplateColumns => {
262
                CssProperty::GridTemplateColumns(CssPropertyValue::$content_type)
263
            }
264
            CssPropertyType::GridTemplateRows => {
265
                CssProperty::GridTemplateRows(CssPropertyValue::$content_type)
266
            }
267
            CssPropertyType::GridAutoColumns => {
268
                CssProperty::GridAutoColumns(CssPropertyValue::$content_type)
269
            }
270
            CssPropertyType::GridAutoFlow => {
271
                CssProperty::GridAutoFlow(CssPropertyValue::$content_type)
272
            }
273
            CssPropertyType::JustifySelf => {
274
                CssProperty::JustifySelf(CssPropertyValue::$content_type)
275
            }
276
            CssPropertyType::JustifyItems => {
277
                CssProperty::JustifyItems(CssPropertyValue::$content_type)
278
            }
279
            CssPropertyType::Gap => CssProperty::Gap(CssPropertyValue::$content_type),
280
            CssPropertyType::GridGap => CssProperty::GridGap(CssPropertyValue::$content_type),
281
            CssPropertyType::AlignSelf => CssProperty::AlignSelf(CssPropertyValue::$content_type),
282
            CssPropertyType::Font => CssProperty::Font(CssPropertyValue::$content_type),
283
            CssPropertyType::GridAutoRows => {
284
                CssProperty::GridAutoRows(CssPropertyValue::$content_type)
285
            }
286
            CssPropertyType::GridColumn => CssProperty::GridColumn(CssPropertyValue::$content_type),
287
            CssPropertyType::GridRow => CssProperty::GridRow(CssPropertyValue::$content_type),
288
            CssPropertyType::GridTemplateAreas => {
289
                CssProperty::GridTemplateAreas(CssPropertyValue::$content_type)
290
            }
291
            CssPropertyType::WritingMode => {
292
                CssProperty::WritingMode(CssPropertyValue::$content_type)
293
            }
294
            CssPropertyType::Clear => CssProperty::Clear(CssPropertyValue::$content_type),
295
            CssPropertyType::OverflowX => CssProperty::OverflowX(CssPropertyValue::$content_type),
296
            CssPropertyType::OverflowY => CssProperty::OverflowY(CssPropertyValue::$content_type),
297
            CssPropertyType::OverflowBlock => CssProperty::OverflowBlock(CssPropertyValue::$content_type),
298
            CssPropertyType::OverflowInline => CssProperty::OverflowInline(CssPropertyValue::$content_type),
299
            CssPropertyType::PaddingTop => CssProperty::PaddingTop(CssPropertyValue::$content_type),
300
            CssPropertyType::PaddingLeft => {
301
                CssProperty::PaddingLeft(CssPropertyValue::$content_type)
302
            }
303
            CssPropertyType::PaddingRight => {
304
                CssProperty::PaddingRight(CssPropertyValue::$content_type)
305
            }
306
            CssPropertyType::PaddingBottom => {
307
                CssProperty::PaddingBottom(CssPropertyValue::$content_type)
308
            }
309
            CssPropertyType::PaddingInlineStart => {
310
                CssProperty::PaddingInlineStart(CssPropertyValue::$content_type)
311
            }
312
            CssPropertyType::PaddingInlineEnd => {
313
                CssProperty::PaddingInlineEnd(CssPropertyValue::$content_type)
314
            }
315
            CssPropertyType::MarginTop => CssProperty::MarginTop(CssPropertyValue::$content_type),
316
            CssPropertyType::MarginLeft => CssProperty::MarginLeft(CssPropertyValue::$content_type),
317
            CssPropertyType::MarginRight => {
318
                CssProperty::MarginRight(CssPropertyValue::$content_type)
319
            }
320
            CssPropertyType::MarginBottom => {
321
                CssProperty::MarginBottom(CssPropertyValue::$content_type)
322
            }
323
            CssPropertyType::BackgroundContent => {
324
                CssProperty::BackgroundContent(CssPropertyValue::$content_type)
325
            }
326
            CssPropertyType::BackgroundPosition => {
327
                CssProperty::BackgroundPosition(CssPropertyValue::$content_type)
328
            }
329
            CssPropertyType::BackgroundSize => {
330
                CssProperty::BackgroundSize(CssPropertyValue::$content_type)
331
            }
332
            CssPropertyType::BackgroundRepeat => {
333
                CssProperty::BackgroundRepeat(CssPropertyValue::$content_type)
334
            }
335
            CssPropertyType::BorderTopLeftRadius => {
336
                CssProperty::BorderTopLeftRadius(CssPropertyValue::$content_type)
337
            }
338
            CssPropertyType::BorderTopRightRadius => {
339
                CssProperty::BorderTopRightRadius(CssPropertyValue::$content_type)
340
            }
341
            CssPropertyType::BorderBottomLeftRadius => {
342
                CssProperty::BorderBottomLeftRadius(CssPropertyValue::$content_type)
343
            }
344
            CssPropertyType::BorderBottomRightRadius => {
345
                CssProperty::BorderBottomRightRadius(CssPropertyValue::$content_type)
346
            }
347
            CssPropertyType::BorderTopColor => {
348
                CssProperty::BorderTopColor(CssPropertyValue::$content_type)
349
            }
350
            CssPropertyType::BorderRightColor => {
351
                CssProperty::BorderRightColor(CssPropertyValue::$content_type)
352
            }
353
            CssPropertyType::BorderLeftColor => {
354
                CssProperty::BorderLeftColor(CssPropertyValue::$content_type)
355
            }
356
            CssPropertyType::BorderBottomColor => {
357
                CssProperty::BorderBottomColor(CssPropertyValue::$content_type)
358
            }
359
            CssPropertyType::BorderTopStyle => {
360
                CssProperty::BorderTopStyle(CssPropertyValue::$content_type)
361
            }
362
            CssPropertyType::BorderRightStyle => {
363
                CssProperty::BorderRightStyle(CssPropertyValue::$content_type)
364
            }
365
            CssPropertyType::BorderLeftStyle => {
366
                CssProperty::BorderLeftStyle(CssPropertyValue::$content_type)
367
            }
368
            CssPropertyType::BorderBottomStyle => {
369
                CssProperty::BorderBottomStyle(CssPropertyValue::$content_type)
370
            }
371
            CssPropertyType::BorderTopWidth => {
372
                CssProperty::BorderTopWidth(CssPropertyValue::$content_type)
373
            }
374
            CssPropertyType::BorderRightWidth => {
375
                CssProperty::BorderRightWidth(CssPropertyValue::$content_type)
376
            }
377
            CssPropertyType::BorderLeftWidth => {
378
                CssProperty::BorderLeftWidth(CssPropertyValue::$content_type)
379
            }
380
            CssPropertyType::BorderBottomWidth => {
381
                CssProperty::BorderBottomWidth(CssPropertyValue::$content_type)
382
            }
383
            CssPropertyType::BoxShadowLeft => {
384
                CssProperty::BoxShadowLeft(CssPropertyValue::$content_type)
385
            }
386
            CssPropertyType::BoxShadowRight => {
387
                CssProperty::BoxShadowRight(CssPropertyValue::$content_type)
388
            }
389
            CssPropertyType::BoxShadowTop => {
390
                CssProperty::BoxShadowTop(CssPropertyValue::$content_type)
391
            }
392
            CssPropertyType::BoxShadowBottom => {
393
                CssProperty::BoxShadowBottom(CssPropertyValue::$content_type)
394
            }
395
            CssPropertyType::ScrollbarTrack => {
396
                CssProperty::ScrollbarTrack(CssPropertyValue::$content_type)
397
            }
398
            CssPropertyType::ScrollbarThumb => {
399
                CssProperty::ScrollbarThumb(CssPropertyValue::$content_type)
400
            }
401
            CssPropertyType::ScrollbarButton => {
402
                CssProperty::ScrollbarButton(CssPropertyValue::$content_type)
403
            }
404
            CssPropertyType::ScrollbarCorner => {
405
                CssProperty::ScrollbarCorner(CssPropertyValue::$content_type)
406
            }
407
            CssPropertyType::ScrollbarResizer => {
408
                CssProperty::ScrollbarResizer(CssPropertyValue::$content_type)
409
            }
410
            CssPropertyType::ScrollbarWidth => {
411
                CssProperty::ScrollbarWidth(CssPropertyValue::$content_type)
412
            }
413
            CssPropertyType::ScrollbarColor => {
414
                CssProperty::ScrollbarColor(CssPropertyValue::$content_type)
415
            }
416
            CssPropertyType::ScrollbarVisibility => {
417
                CssProperty::ScrollbarVisibility(CssPropertyValue::$content_type)
418
            }
419
            CssPropertyType::ScrollbarFadeDelay => {
420
                CssProperty::ScrollbarFadeDelay(CssPropertyValue::$content_type)
421
            }
422
            CssPropertyType::ScrollbarFadeDuration => {
423
                CssProperty::ScrollbarFadeDuration(CssPropertyValue::$content_type)
424
            }
425
            CssPropertyType::Opacity => CssProperty::Opacity(CssPropertyValue::$content_type),
426
            CssPropertyType::Visibility => CssProperty::Visibility(CssPropertyValue::$content_type),
427
            CssPropertyType::Transform => CssProperty::Transform(CssPropertyValue::$content_type),
428
            CssPropertyType::PerspectiveOrigin => {
429
                CssProperty::PerspectiveOrigin(CssPropertyValue::$content_type)
430
            }
431
            CssPropertyType::TransformOrigin => {
432
                CssProperty::TransformOrigin(CssPropertyValue::$content_type)
433
            }
434
            CssPropertyType::BackfaceVisibility => {
435
                CssProperty::BackfaceVisibility(CssPropertyValue::$content_type)
436
            }
437
            CssPropertyType::MixBlendMode => {
438
                CssProperty::MixBlendMode(CssPropertyValue::$content_type)
439
            }
440
            CssPropertyType::Filter => CssProperty::Filter(CssPropertyValue::$content_type),
441
            CssPropertyType::BackdropFilter => {
442
                CssProperty::BackdropFilter(CssPropertyValue::$content_type)
443
            }
444
            CssPropertyType::TextShadow => CssProperty::TextShadow(CssPropertyValue::$content_type),
445
            CssPropertyType::Direction => CssProperty::Direction(CssPropertyValue::$content_type),
446
            CssPropertyType::Hyphens => CssProperty::Hyphens(CssPropertyValue::$content_type),
447
            CssPropertyType::WordBreak => CssProperty::WordBreak(CssPropertyValue::$content_type),
448
            CssPropertyType::OverflowWrap => CssProperty::OverflowWrap(CssPropertyValue::$content_type),
449
            CssPropertyType::LineBreak => CssProperty::LineBreak(CssPropertyValue::$content_type),
450
            CssPropertyType::TextOverflow => CssProperty::TextOverflow(CssPropertyValue::$content_type),
451
            CssPropertyType::ObjectFit => CssProperty::ObjectFit(CssPropertyValue::$content_type),
452
            CssPropertyType::ObjectPosition => CssProperty::ObjectPosition(CssPropertyValue::$content_type),
453
            CssPropertyType::AspectRatio => CssProperty::AspectRatio(CssPropertyValue::$content_type),
454
            CssPropertyType::TextOrientation => CssProperty::TextOrientation(CssPropertyValue::$content_type),
455
            CssPropertyType::TextAlignLast => CssProperty::TextAlignLast(CssPropertyValue::$content_type),
456
            CssPropertyType::TextTransform => CssProperty::TextTransform(CssPropertyValue::$content_type),
457
            CssPropertyType::WhiteSpace => CssProperty::WhiteSpace(CssPropertyValue::$content_type),
458
            CssPropertyType::UserSelect => CssProperty::UserSelect(CssPropertyValue::$content_type),
459
            CssPropertyType::TextDecoration => {
460
                CssProperty::TextDecoration(CssPropertyValue::$content_type)
461
            }
462
            // Fragmentation / Columns / Flow / Shape / Content
463
            CssPropertyType::TextJustify => {
464
                CssProperty::TextJustify(CssPropertyValue::$content_type)
465
            }
466
            CssPropertyType::BreakBefore => {
467
                CssProperty::BreakBefore(CssPropertyValue::$content_type)
468
            }
469
            CssPropertyType::BreakAfter => CssProperty::BreakAfter(CssPropertyValue::$content_type),
470
            CssPropertyType::BreakInside => {
471
                CssProperty::BreakInside(CssPropertyValue::$content_type)
472
            }
473
            CssPropertyType::Widows => CssProperty::Widows(CssPropertyValue::$content_type),
474
            CssPropertyType::Orphans => CssProperty::Orphans(CssPropertyValue::$content_type),
475
            CssPropertyType::BoxDecorationBreak => {
476
                CssProperty::BoxDecorationBreak(CssPropertyValue::$content_type)
477
            }
478
            CssPropertyType::ColumnCount => {
479
                CssProperty::ColumnCount(CssPropertyValue::$content_type)
480
            }
481
            CssPropertyType::ColumnWidth => {
482
                CssProperty::ColumnWidth(CssPropertyValue::$content_type)
483
            }
484
            CssPropertyType::ColumnSpan => CssProperty::ColumnSpan(CssPropertyValue::$content_type),
485
            CssPropertyType::ColumnFill => CssProperty::ColumnFill(CssPropertyValue::$content_type),
486
            CssPropertyType::ColumnRuleWidth => {
487
                CssProperty::ColumnRuleWidth(CssPropertyValue::$content_type)
488
            }
489
            CssPropertyType::ColumnRuleStyle => {
490
                CssProperty::ColumnRuleStyle(CssPropertyValue::$content_type)
491
            }
492
            CssPropertyType::ColumnRuleColor => {
493
                CssProperty::ColumnRuleColor(CssPropertyValue::$content_type)
494
            }
495
            CssPropertyType::FlowInto => CssProperty::FlowInto(CssPropertyValue::$content_type),
496
            CssPropertyType::FlowFrom => CssProperty::FlowFrom(CssPropertyValue::$content_type),
497
            CssPropertyType::ShapeOutside => {
498
                CssProperty::ShapeOutside(CssPropertyValue::$content_type)
499
            }
500
            CssPropertyType::ShapeInside => {
501
                CssProperty::ShapeInside(CssPropertyValue::$content_type)
502
            }
503
            CssPropertyType::ClipPath => CssProperty::ClipPath(CssPropertyValue::$content_type),
504
            CssPropertyType::ShapeMargin => {
505
                CssProperty::ShapeMargin(CssPropertyValue::$content_type)
506
            }
507
            CssPropertyType::ShapeImageThreshold => {
508
                CssProperty::ShapeImageThreshold(CssPropertyValue::$content_type)
509
            }
510
            CssPropertyType::Content => CssProperty::Content(CssPropertyValue::$content_type),
511
            CssPropertyType::CounterReset => {
512
                CssProperty::CounterReset(CssPropertyValue::$content_type)
513
            }
514
            CssPropertyType::CounterIncrement => {
515
                CssProperty::CounterIncrement(CssPropertyValue::$content_type)
516
            }
517
            CssPropertyType::ListStyleType => {
518
                CssProperty::ListStyleType(CssPropertyValue::$content_type)
519
            }
520
            CssPropertyType::ListStylePosition => {
521
                CssProperty::ListStylePosition(CssPropertyValue::$content_type)
522
            }
523
            CssPropertyType::StringSet => CssProperty::StringSet(CssPropertyValue::$content_type),
524
            CssPropertyType::TableLayout => {
525
                CssProperty::TableLayout(CssPropertyValue::$content_type)
526
            }
527
            CssPropertyType::BorderCollapse => {
528
                CssProperty::BorderCollapse(CssPropertyValue::$content_type)
529
            }
530
            CssPropertyType::BorderSpacing => {
531
                CssProperty::BorderSpacing(CssPropertyValue::$content_type)
532
            }
533
            CssPropertyType::CaptionSide => {
534
                CssProperty::CaptionSide(CssPropertyValue::$content_type)
535
            }
536
            CssPropertyType::EmptyCells => CssProperty::EmptyCells(CssPropertyValue::$content_type),
537
            CssPropertyType::FontWeight => CssProperty::FontWeight(CssPropertyValue::$content_type),
538
            CssPropertyType::FontStyle => CssProperty::FontStyle(CssPropertyValue::$content_type),
539
            CssPropertyType::UnicodeBidi => CssProperty::UnicodeBidi(CssPropertyValue::$content_type),
540
            CssPropertyType::TextBoxTrim => CssProperty::TextBoxTrim(CssPropertyValue::$content_type),
541
            CssPropertyType::TextBoxEdge => CssProperty::TextBoxEdge(CssPropertyValue::$content_type),
542
            CssPropertyType::DominantBaseline => CssProperty::DominantBaseline(CssPropertyValue::$content_type),
543
            CssPropertyType::AlignmentBaseline => CssProperty::AlignmentBaseline(CssPropertyValue::$content_type),
544
            CssPropertyType::BaselineSource => CssProperty::BaselineSource(CssPropertyValue::$content_type),
545
            CssPropertyType::LineFitEdge => CssProperty::LineFitEdge(CssPropertyValue::$content_type),
546
            CssPropertyType::InitialLetterAlign => CssProperty::InitialLetterAlign(CssPropertyValue::$content_type),
547
            CssPropertyType::InitialLetterWrap => CssProperty::InitialLetterWrap(CssPropertyValue::$content_type),
548
            CssPropertyType::ScrollbarGutter => CssProperty::ScrollbarGutter(CssPropertyValue::$content_type),
549
            CssPropertyType::OverflowClipMargin => CssProperty::OverflowClipMargin(CssPropertyValue::$content_type),
550
            CssPropertyType::Clip => CssProperty::Clip(CssPropertyValue::$content_type),
551
        }
552
    }};
553
}