1
//! Defines the core `CssProperty` enum, which represents any single parsed CSS property,
2
//! as well as top-level functions for parsing CSS keys and values.
3

            
4
use alloc::{
5
    boxed::Box,
6
    collections::btree_map::BTreeMap,
7
    string::{String, ToString},
8
    vec::Vec,
9
};
10
use core::fmt;
11

            
12
use crate::{
13
    corety::AzString,
14
    css::{BoxOrStatic, CssPropertyValue},
15
    props::basic::{error::InvalidValueErr, pixel::PixelValueWithAuto},
16
};
17
// Import all property types from their new locations.
18
// wildcard imports: this is the property aggregator module that pulls in every
19
// property type from its sub-modules; enumerating them all explicitly would be
20
// unmaintainable and defeats the purpose of the per-category modules.
21
#[allow(clippy::wildcard_imports)]
22
use crate::{
23
    codegen::format::FormatAsRustCode,
24
    props::{
25
        basic::{
26
            color::{parse_css_color, ColorU, CssColorParseError, CssColorParseErrorOwned},
27
            font::{
28
                parse_style_font_family, CssStyleFontFamilyParseError,
29
                CssStyleFontFamilyParseErrorOwned, StyleFontFamilyVec, *,
30
            },
31
            length::{parse_float_value, parse_percentage_value, FloatValue, PercentageValue},
32
            pixel::{
33
                parse_pixel_value, CssPixelValueParseError, CssPixelValueParseErrorOwned,
34
                PixelValue,
35
            },
36
            DurationParseError, DurationParseErrorOwned, InterpolateResolver, InvalidValueErrOwned,
37
            PercentageParseError,
38
        },
39
        formatter::PrintAsCssValue,
40
        layout::{
41
            column::*, dimensions::*, display::*, flex::*, flow::*, fragmentation::*, grid::*,
42
            overflow::*, position::*, shape::*, spacing::*, table::*, text::*, wrapping::*,
43
        },
44
        style::{
45
            background::*, border::*, border_radius::*, box_shadow::*, content::*, effects::*,
46
            exclusion::*, filter::*, lists::*, scrollbar::*, text::*, transform::*,
47
            SelectionBackgroundColor, SelectionColor, SelectionRadius,
48
        },
49
    },
50
};
51

            
52
const COMBINED_CSS_PROPERTIES_KEY_MAP: [(CombinedCssPropertyType, &str); 27] = [
53
    (CombinedCssPropertyType::BorderRadius, "border-radius"),
54
    (CombinedCssPropertyType::Overflow, "overflow"),
55
    (CombinedCssPropertyType::Padding, "padding"),
56
    (CombinedCssPropertyType::Margin, "margin"),
57
    (CombinedCssPropertyType::Border, "border"),
58
    (CombinedCssPropertyType::BorderLeft, "border-left"),
59
    (CombinedCssPropertyType::BorderRight, "border-right"),
60
    (CombinedCssPropertyType::BorderTop, "border-top"),
61
    (CombinedCssPropertyType::BorderBottom, "border-bottom"),
62
    (CombinedCssPropertyType::BorderColor, "border-color"),
63
    (CombinedCssPropertyType::BorderStyle, "border-style"),
64
    (CombinedCssPropertyType::BorderWidth, "border-width"),
65
    (CombinedCssPropertyType::BoxShadow, "box-shadow"),
66
    (CombinedCssPropertyType::BackgroundColor, "background-color"),
67
    (CombinedCssPropertyType::BackgroundImage, "background-image"),
68
    (CombinedCssPropertyType::Background, "background"),
69
    (CombinedCssPropertyType::Flex, "flex"),
70
    (CombinedCssPropertyType::Grid, "grid"),
71
    (CombinedCssPropertyType::Gap, "gap"),
72
    (CombinedCssPropertyType::GridGap, "grid-gap"),
73
    (CombinedCssPropertyType::Font, "font"),
74
    (CombinedCssPropertyType::Columns, "columns"),
75
    (CombinedCssPropertyType::GridArea, "grid-area"),
76
    (CombinedCssPropertyType::ColumnRule, "column-rule"),
77
    (CombinedCssPropertyType::TextBox, "text-box"),
78
    // +spec:writing-modes:798cca - inset-block/inset-inline shorthand properties
79
    (CombinedCssPropertyType::InsetBlock, "inset-block"),
80
    (CombinedCssPropertyType::InsetInline, "inset-inline"),
81
];
82

            
83
const CSS_PROPERTY_KEY_MAP: [(CssPropertyType, &str); 190] = [
84
    (CssPropertyType::Display, "display"),
85
    (CssPropertyType::Float, "float"),
86
    (CssPropertyType::BoxSizing, "box-sizing"),
87
    (CssPropertyType::TextColor, "color"),
88
    (CssPropertyType::FontSize, "font-size"),
89
    (CssPropertyType::FontFamily, "font-family"),
90
    (CssPropertyType::FontWeight, "font-weight"),
91
    (CssPropertyType::FontStyle, "font-style"),
92
    (CssPropertyType::TextAlign, "text-align"),
93
    (CssPropertyType::TextJustify, "text-justify"),
94
    (CssPropertyType::VerticalAlign, "vertical-align"),
95
    (CssPropertyType::LetterSpacing, "letter-spacing"),
96
    (CssPropertyType::LineHeight, "line-height"),
97
    (CssPropertyType::WordSpacing, "word-spacing"),
98
    (CssPropertyType::TabSize, "tab-size"),
99
    (CssPropertyType::WhiteSpace, "white-space"),
100
    (CssPropertyType::Hyphens, "hyphens"),
101
    (CssPropertyType::WordBreak, "word-break"),
102
    (CssPropertyType::OverflowWrap, "overflow-wrap"),
103
    (CssPropertyType::OverflowWrap, "word-wrap"), // +spec:line-breaking:45074d - word-wrap is legacy name alias for overflow-wrap
104
    (CssPropertyType::LineBreak, "line-break"),
105
    (CssPropertyType::TextOverflow, "text-overflow"),
106
    (CssPropertyType::ObjectFit, "object-fit"),
107
    (CssPropertyType::ObjectPosition, "object-position"),
108
    (CssPropertyType::AspectRatio, "aspect-ratio"),
109
    (CssPropertyType::TextOrientation, "text-orientation"),
110
    (CssPropertyType::TextAlignLast, "text-align-last"),
111
    (CssPropertyType::TextTransform, "text-transform"),
112
    (CssPropertyType::Direction, "direction"),
113
    (CssPropertyType::UserSelect, "user-select"),
114
    (CssPropertyType::TextDecoration, "text-decoration"),
115
    (CssPropertyType::TextIndent, "text-indent"),
116
    (CssPropertyType::InitialLetter, "initial-letter"),
117
    (CssPropertyType::LineClamp, "line-clamp"),
118
    (CssPropertyType::HangingPunctuation, "hanging-punctuation"),
119
    (CssPropertyType::TextCombineUpright, "text-combine-upright"),
120
    (CssPropertyType::UnicodeBidi, "unicode-bidi"),
121
    (CssPropertyType::TextBoxTrim, "text-box-trim"),
122
    (CssPropertyType::TextBoxEdge, "text-box-edge"),
123
    (CssPropertyType::DominantBaseline, "dominant-baseline"),
124
    (CssPropertyType::AlignmentBaseline, "alignment-baseline"),
125
    // +spec:inline-block:939f05 - baseline-source longhand (auto | first | last)
126
    (CssPropertyType::BaselineSource, "baseline-source"),
127
    // +spec:line-height:cc03df - line-fit-edge longhand (leading | text | cap | ex | ...)
128
    (CssPropertyType::LineFitEdge, "line-fit-edge"),
129
    (CssPropertyType::InitialLetterAlign, "initial-letter-align"),
130
    (CssPropertyType::InitialLetterWrap, "initial-letter-wrap"),
131
    (CssPropertyType::ScrollbarGutter, "scrollbar-gutter"),
132
    (CssPropertyType::OverflowClipMargin, "overflow-clip-margin"),
133
    // +spec:overflow:297dc3 - clip rect() auto values resolve to border box edges
134
    (CssPropertyType::Clip, "clip"),
135
    (CssPropertyType::ExclusionMargin, "-azul-exclusion-margin"),
136
    (
137
        CssPropertyType::HyphenationLanguage,
138
        "-azul-hyphenation-language",
139
    ),
140
    (CssPropertyType::Cursor, "cursor"),
141
    (CssPropertyType::Width, "width"),
142
    (CssPropertyType::Height, "height"),
143
    (CssPropertyType::MinWidth, "min-width"),
144
    (CssPropertyType::MinHeight, "min-height"),
145
    (CssPropertyType::MaxWidth, "max-width"),
146
    (CssPropertyType::MaxHeight, "max-height"),
147
    (CssPropertyType::Position, "position"),
148
    (CssPropertyType::Top, "top"),
149
    (CssPropertyType::Right, "right"),
150
    (CssPropertyType::Left, "left"),
151
    (CssPropertyType::Bottom, "bottom"),
152
    (CssPropertyType::ZIndex, "z-index"),
153
    (CssPropertyType::FlexWrap, "flex-wrap"),
154
    (CssPropertyType::FlexDirection, "flex-direction"),
155
    (CssPropertyType::FlexGrow, "flex-grow"),
156
    (CssPropertyType::FlexShrink, "flex-shrink"),
157
    (CssPropertyType::FlexBasis, "flex-basis"),
158
    (CssPropertyType::JustifyContent, "justify-content"),
159
    (CssPropertyType::AlignItems, "align-items"),
160
    (CssPropertyType::AlignContent, "align-content"),
161
    (CssPropertyType::ColumnGap, "column-gap"),
162
    (CssPropertyType::RowGap, "row-gap"),
163
    (
164
        CssPropertyType::GridTemplateColumns,
165
        "grid-template-columns",
166
    ),
167
    (CssPropertyType::GridTemplateRows, "grid-template-rows"),
168
    (CssPropertyType::GridAutoColumns, "grid-auto-columns"),
169
    (CssPropertyType::GridAutoRows, "grid-auto-rows"),
170
    (CssPropertyType::GridColumn, "grid-column"),
171
    (CssPropertyType::GridRow, "grid-row"),
172
    (CssPropertyType::GridTemplateAreas, "grid-template-areas"),
173
    (CssPropertyType::WritingMode, "writing-mode"),
174
    (CssPropertyType::Clear, "clear"),
175
    (CssPropertyType::OverflowX, "overflow-x"),
176
    (CssPropertyType::OverflowY, "overflow-y"),
177
    // +spec:overflow:17654b - overflow-block and overflow-inline logical properties
178
    (CssPropertyType::OverflowBlock, "overflow-block"),
179
    (CssPropertyType::OverflowInline, "overflow-inline"),
180
    (CssPropertyType::PaddingTop, "padding-top"),
181
    (CssPropertyType::PaddingLeft, "padding-left"),
182
    (CssPropertyType::PaddingRight, "padding-right"),
183
    (CssPropertyType::PaddingBottom, "padding-bottom"),
184
    (CssPropertyType::PaddingInlineStart, "padding-inline-start"),
185
    (CssPropertyType::PaddingInlineEnd, "padding-inline-end"),
186
    (CssPropertyType::MarginTop, "margin-top"),
187
    (CssPropertyType::MarginLeft, "margin-left"),
188
    (CssPropertyType::MarginRight, "margin-right"),
189
    (CssPropertyType::MarginBottom, "margin-bottom"),
190
    (CssPropertyType::BackgroundContent, "background"),
191
    (CssPropertyType::BackgroundPosition, "background-position"),
192
    (CssPropertyType::BackgroundSize, "background-size"),
193
    (CssPropertyType::BackgroundRepeat, "background-repeat"),
194
    (
195
        CssPropertyType::BorderTopLeftRadius,
196
        "border-top-left-radius",
197
    ),
198
    (
199
        CssPropertyType::BorderTopRightRadius,
200
        "border-top-right-radius",
201
    ),
202
    (
203
        CssPropertyType::BorderBottomLeftRadius,
204
        "border-bottom-left-radius",
205
    ),
206
    (
207
        CssPropertyType::BorderBottomRightRadius,
208
        "border-bottom-right-radius",
209
    ),
210
    (CssPropertyType::BorderTopColor, "border-top-color"),
211
    (CssPropertyType::BorderRightColor, "border-right-color"),
212
    (CssPropertyType::BorderLeftColor, "border-left-color"),
213
    (CssPropertyType::BorderBottomColor, "border-bottom-color"),
214
    (CssPropertyType::BorderTopStyle, "border-top-style"),
215
    (CssPropertyType::BorderRightStyle, "border-right-style"),
216
    (CssPropertyType::BorderLeftStyle, "border-left-style"),
217
    (CssPropertyType::BorderBottomStyle, "border-bottom-style"),
218
    (CssPropertyType::BorderTopWidth, "border-top-width"),
219
    (CssPropertyType::BorderRightWidth, "border-right-width"),
220
    (CssPropertyType::BorderLeftWidth, "border-left-width"),
221
    (CssPropertyType::BorderBottomWidth, "border-bottom-width"),
222
    (CssPropertyType::BoxShadowTop, "-azul-box-shadow-top"),
223
    (CssPropertyType::BoxShadowRight, "-azul-box-shadow-right"),
224
    (CssPropertyType::BoxShadowLeft, "-azul-box-shadow-left"),
225
    (CssPropertyType::BoxShadowBottom, "-azul-box-shadow-bottom"),
226
    (CssPropertyType::ScrollbarTrack, "-azul-scrollbar-track"),
227
    (CssPropertyType::ScrollbarThumb, "-azul-scrollbar-thumb"),
228
    (CssPropertyType::ScrollbarButton, "-azul-scrollbar-button"),
229
    (CssPropertyType::ScrollbarCorner, "-azul-scrollbar-corner"),
230
    (CssPropertyType::ScrollbarResizer, "-azul-scrollbar-resizer"),
231
    (CssPropertyType::CaretColor, "caret-color"),
232
    (
233
        CssPropertyType::CaretAnimationDuration,
234
        "caret-animation-duration",
235
    ),
236
    (CssPropertyType::CaretWidth, "-azul-caret-width"),
237
    (
238
        CssPropertyType::SelectionBackgroundColor,
239
        "-azul-selection-background-color",
240
    ),
241
    (CssPropertyType::SelectionColor, "-azul-selection-color"),
242
    (CssPropertyType::SelectionRadius, "-azul-selection-radius"),
243
    (CssPropertyType::ScrollbarWidth, "scrollbar-width"),
244
    (CssPropertyType::ScrollbarColor, "scrollbar-color"),
245
    (
246
        CssPropertyType::ScrollbarVisibility,
247
        "-azul-scrollbar-visibility",
248
    ),
249
    (
250
        CssPropertyType::ScrollbarFadeDelay,
251
        "-azul-scrollbar-fade-delay",
252
    ),
253
    (
254
        CssPropertyType::ScrollbarFadeDuration,
255
        "-azul-scrollbar-fade-duration",
256
    ),
257
    (CssPropertyType::Opacity, "opacity"),
258
    (CssPropertyType::Visibility, "visibility"),
259
    (CssPropertyType::Transform, "transform"),
260
    (CssPropertyType::PerspectiveOrigin, "perspective-origin"),
261
    (CssPropertyType::TransformOrigin, "transform-origin"),
262
    (CssPropertyType::BackfaceVisibility, "backface-visibility"),
263
    (CssPropertyType::Animation, "animation"),
264
    (CssPropertyType::AnimationIn, "-azul-animation-in"),
265
    (CssPropertyType::AnimationOut, "-azul-animation-out"),
266
    (CssPropertyType::MixBlendMode, "mix-blend-mode"),
267
    (CssPropertyType::Filter, "filter"),
268
    (CssPropertyType::BackdropFilter, "backdrop-filter"),
269
    (CssPropertyType::TextShadow, "text-shadow"),
270
    (CssPropertyType::GridAutoFlow, "grid-auto-flow"),
271
    (CssPropertyType::JustifySelf, "justify-self"),
272
    (CssPropertyType::JustifyItems, "justify-items"),
273
    (CssPropertyType::Gap, "gap"),
274
    (CssPropertyType::GridGap, "grid-gap"),
275
    (CssPropertyType::AlignSelf, "align-self"),
276
    (CssPropertyType::Font, "font"),
277
    (CssPropertyType::BreakBefore, "break-before"),
278
    (CssPropertyType::BreakAfter, "break-after"),
279
    (CssPropertyType::BreakInside, "break-inside"),
280
    // CSS 2.1 legacy aliases for page breaking
281
    (CssPropertyType::BreakBefore, "page-break-before"),
282
    (CssPropertyType::BreakAfter, "page-break-after"),
283
    (CssPropertyType::BreakInside, "page-break-inside"),
284
    (CssPropertyType::Orphans, "orphans"),
285
    (CssPropertyType::Widows, "widows"),
286
    (CssPropertyType::BoxDecorationBreak, "box-decoration-break"),
287
    (CssPropertyType::ColumnCount, "column-count"),
288
    (CssPropertyType::ColumnWidth, "column-width"),
289
    (CssPropertyType::ColumnSpan, "column-span"),
290
    (CssPropertyType::ColumnFill, "column-fill"),
291
    (CssPropertyType::ColumnRuleWidth, "column-rule-width"),
292
    (CssPropertyType::ColumnRuleStyle, "column-rule-style"),
293
    (CssPropertyType::ColumnRuleColor, "column-rule-color"),
294
    (CssPropertyType::FlowInto, "flow-into"),
295
    (CssPropertyType::FlowFrom, "flow-from"),
296
    (CssPropertyType::ShapeOutside, "shape-outside"),
297
    (CssPropertyType::ShapeInside, "shape-inside"),
298
    (CssPropertyType::ClipPath, "clip-path"),
299
    (CssPropertyType::ShapeMargin, "shape-margin"),
300
    (
301
        CssPropertyType::ShapeImageThreshold,
302
        "shape-image-threshold",
303
    ),
304
    (CssPropertyType::Content, "content"),
305
    (CssPropertyType::CounterReset, "counter-reset"),
306
    (CssPropertyType::CounterIncrement, "counter-increment"),
307
    (CssPropertyType::ListStyleType, "list-style-type"),
308
    (CssPropertyType::ListStylePosition, "list-style-position"),
309
    (CssPropertyType::StringSet, "string-set"),
310
    // CSS 2.1 table properties (value parsers already exist; these key-map
311
    // entries make them reachable from stylesheet text via parser2).
312
    (CssPropertyType::TableLayout, "table-layout"),
313
    (CssPropertyType::BorderCollapse, "border-collapse"),
314
    (CssPropertyType::BorderSpacing, "border-spacing"),
315
    (CssPropertyType::CaptionSide, "caption-side"),
316
    (CssPropertyType::EmptyCells, "empty-cells"),
317
];
318

            
319
// Type aliases for `CssPropertyValue<T>`
320
pub type CaretColorValue = CssPropertyValue<CaretColor>;
321
pub type CaretAnimationDurationValue = CssPropertyValue<CaretAnimationDuration>;
322
pub type StyleAnimationValue = CssPropertyValue<crate::props::basic::animation::StyleAnimation>;
323
pub type StyleAnimationVecValue =
324
    CssPropertyValue<crate::props::basic::animation::StyleAnimationVec>;
325
pub type CaretWidthValue = CssPropertyValue<CaretWidth>;
326
pub type SelectionBackgroundColorValue = CssPropertyValue<SelectionBackgroundColor>;
327
pub type SelectionColorValue = CssPropertyValue<SelectionColor>;
328
pub type SelectionRadiusValue = CssPropertyValue<SelectionRadius>;
329
pub type StyleBackgroundContentVecValue = CssPropertyValue<StyleBackgroundContentVec>;
330
pub type StyleBackgroundPositionVecValue = CssPropertyValue<StyleBackgroundPositionVec>;
331
pub type StyleBackgroundSizeVecValue = CssPropertyValue<StyleBackgroundSizeVec>;
332
pub type StyleBackgroundRepeatVecValue = CssPropertyValue<StyleBackgroundRepeatVec>;
333
pub type StyleFontSizeValue = CssPropertyValue<StyleFontSize>;
334
pub type StyleFontFamilyVecValue = CssPropertyValue<StyleFontFamilyVec>;
335
pub type StyleFontWeightValue = CssPropertyValue<StyleFontWeight>;
336
pub type StyleFontStyleValue = CssPropertyValue<StyleFontStyle>;
337
pub type StyleTextColorValue = CssPropertyValue<StyleTextColor>;
338
pub type StyleTextAlignValue = CssPropertyValue<StyleTextAlign>;
339
pub type StyleVerticalAlignValue = CssPropertyValue<StyleVerticalAlign>;
340
pub type StyleLineHeightValue = CssPropertyValue<StyleLineHeight>;
341
pub type StyleLetterSpacingValue = CssPropertyValue<StyleLetterSpacing>;
342
pub type StyleTextIndentValue = CssPropertyValue<StyleTextIndent>;
343
pub type StyleInitialLetterValue = CssPropertyValue<StyleInitialLetter>;
344
pub type StyleLineClampValue = CssPropertyValue<StyleLineClamp>;
345
pub type StyleHangingPunctuationValue = CssPropertyValue<StyleHangingPunctuation>;
346
pub type StyleTextCombineUprightValue = CssPropertyValue<StyleTextCombineUpright>;
347
pub type StyleUnicodeBidiValue = CssPropertyValue<StyleUnicodeBidi>;
348
pub type StyleTextBoxTrimValue = CssPropertyValue<StyleTextBoxTrim>;
349
pub type StyleTextBoxEdgeValue = CssPropertyValue<StyleTextBoxEdge>;
350
pub type StyleDominantBaselineValue = CssPropertyValue<StyleDominantBaseline>;
351
pub type StyleAlignmentBaselineValue = CssPropertyValue<StyleAlignmentBaseline>;
352
pub type StyleBaselineSourceValue = CssPropertyValue<StyleBaselineSource>;
353
pub type StyleLineFitEdgeValue = CssPropertyValue<StyleLineFitEdge>;
354
pub type StyleInitialLetterAlignValue = CssPropertyValue<StyleInitialLetterAlign>;
355
pub type StyleInitialLetterWrapValue = CssPropertyValue<StyleInitialLetterWrap>;
356
pub type StyleScrollbarGutterValue = CssPropertyValue<StyleScrollbarGutter>;
357
pub type StyleOverflowClipMarginValue = CssPropertyValue<StyleOverflowClipMargin>;
358
pub type StyleClipRectValue = CssPropertyValue<StyleClipRect>;
359
pub type StyleExclusionMarginValue = CssPropertyValue<StyleExclusionMargin>;
360
pub type StyleHyphenationLanguageValue = CssPropertyValue<StyleHyphenationLanguage>;
361
pub type StyleWordSpacingValue = CssPropertyValue<StyleWordSpacing>;
362
pub type StyleTabSizeValue = CssPropertyValue<StyleTabSize>;
363
pub type StyleCursorValue = CssPropertyValue<StyleCursor>;
364
pub type StyleBoxShadowValue = CssPropertyValue<crate::css::BoxOrStaticStyleBoxShadow>;
365
pub type StyleBorderTopColorValue = CssPropertyValue<StyleBorderTopColor>;
366
pub type StyleBorderLeftColorValue = CssPropertyValue<StyleBorderLeftColor>;
367
pub type StyleBorderRightColorValue = CssPropertyValue<StyleBorderRightColor>;
368
pub type StyleBorderBottomColorValue = CssPropertyValue<StyleBorderBottomColor>;
369
pub type StyleBorderTopStyleValue = CssPropertyValue<StyleBorderTopStyle>;
370
pub type StyleBorderLeftStyleValue = CssPropertyValue<StyleBorderLeftStyle>;
371
pub type StyleBorderRightStyleValue = CssPropertyValue<StyleBorderRightStyle>;
372
pub type StyleBorderBottomStyleValue = CssPropertyValue<StyleBorderBottomStyle>;
373
pub type StyleBorderTopLeftRadiusValue = CssPropertyValue<StyleBorderTopLeftRadius>;
374
pub type StyleBorderTopRightRadiusValue = CssPropertyValue<StyleBorderTopRightRadius>;
375
pub type StyleBorderBottomLeftRadiusValue = CssPropertyValue<StyleBorderBottomLeftRadius>;
376
pub type StyleBorderBottomRightRadiusValue = CssPropertyValue<StyleBorderBottomRightRadius>;
377
pub type StyleOpacityValue = CssPropertyValue<StyleOpacity>;
378
pub type StyleVisibilityValue = CssPropertyValue<StyleVisibility>;
379
pub type StyleTransformVecValue = CssPropertyValue<StyleTransformVec>;
380
pub type StyleTransformOriginValue = CssPropertyValue<StyleTransformOrigin>;
381
pub type StylePerspectiveOriginValue = CssPropertyValue<StylePerspectiveOrigin>;
382
pub type StyleBackfaceVisibilityValue = CssPropertyValue<StyleBackfaceVisibility>;
383
pub type StyleMixBlendModeValue = CssPropertyValue<StyleMixBlendMode>;
384
pub type StyleFilterVecValue = CssPropertyValue<StyleFilterVec>;
385
pub type StyleBackgroundContentValue = CssPropertyValue<StyleBackgroundContent>;
386
pub type LayoutScrollbarWidthValue = CssPropertyValue<LayoutScrollbarWidth>;
387
pub type StyleScrollbarColorValue = CssPropertyValue<StyleScrollbarColor>;
388
pub type ScrollbarVisibilityModeValue = CssPropertyValue<ScrollbarVisibilityMode>;
389
pub type ScrollbarFadeDelayValue = CssPropertyValue<ScrollbarFadeDelay>;
390
pub type ScrollbarFadeDurationValue = CssPropertyValue<ScrollbarFadeDuration>;
391
pub type LayoutDisplayValue = CssPropertyValue<LayoutDisplay>;
392
pub type StyleHyphensValue = CssPropertyValue<StyleHyphens>;
393
pub type StyleWordBreakValue = CssPropertyValue<StyleWordBreak>;
394
pub type StyleOverflowWrapValue = CssPropertyValue<StyleOverflowWrap>;
395
pub type StyleLineBreakValue = CssPropertyValue<StyleLineBreak>;
396
pub type StyleTextOverflowValue = CssPropertyValue<StyleTextOverflow>;
397
pub type StyleObjectFitValue = CssPropertyValue<StyleObjectFit>;
398
pub type StyleObjectPositionValue = CssPropertyValue<StyleObjectPosition>;
399
pub type StyleAspectRatioValue = CssPropertyValue<StyleAspectRatio>;
400
pub type StyleTextOrientationValue = CssPropertyValue<StyleTextOrientation>;
401
pub type StyleTextAlignLastValue = CssPropertyValue<StyleTextAlignLast>;
402
pub type StyleTextTransformValue = CssPropertyValue<StyleTextTransform>;
403
pub type StyleDirectionValue = CssPropertyValue<StyleDirection>;
404
pub type StyleUserSelectValue = CssPropertyValue<StyleUserSelect>;
405
pub type StyleTextDecorationValue = CssPropertyValue<StyleTextDecoration>;
406
pub type StyleWhiteSpaceValue = CssPropertyValue<StyleWhiteSpace>;
407
pub type LayoutFloatValue = CssPropertyValue<LayoutFloat>;
408
pub type LayoutBoxSizingValue = CssPropertyValue<LayoutBoxSizing>;
409
pub type LayoutWidthValue = CssPropertyValue<LayoutWidth>;
410
pub type LayoutHeightValue = CssPropertyValue<LayoutHeight>;
411
pub type LayoutMinWidthValue = CssPropertyValue<LayoutMinWidth>;
412
pub type LayoutMinHeightValue = CssPropertyValue<LayoutMinHeight>;
413
pub type LayoutMaxWidthValue = CssPropertyValue<LayoutMaxWidth>;
414
pub type LayoutMaxHeightValue = CssPropertyValue<LayoutMaxHeight>;
415
pub type LayoutPositionValue = CssPropertyValue<LayoutPosition>;
416
pub type LayoutTopValue = CssPropertyValue<LayoutTop>;
417
pub type LayoutInsetBottomValue = CssPropertyValue<LayoutInsetBottom>;
418
pub type LayoutRightValue = CssPropertyValue<LayoutRight>;
419
pub type LayoutLeftValue = CssPropertyValue<LayoutLeft>;
420
pub type LayoutZIndexValue = CssPropertyValue<LayoutZIndex>;
421
pub type LayoutPaddingTopValue = CssPropertyValue<LayoutPaddingTop>;
422
pub type LayoutPaddingBottomValue = CssPropertyValue<LayoutPaddingBottom>;
423
pub type LayoutPaddingLeftValue = CssPropertyValue<LayoutPaddingLeft>;
424
pub type LayoutPaddingRightValue = CssPropertyValue<LayoutPaddingRight>;
425
pub type LayoutPaddingInlineStartValue = CssPropertyValue<LayoutPaddingInlineStart>;
426
pub type LayoutPaddingInlineEndValue = CssPropertyValue<LayoutPaddingInlineEnd>;
427
pub type LayoutMarginTopValue = CssPropertyValue<LayoutMarginTop>;
428
pub type LayoutMarginBottomValue = CssPropertyValue<LayoutMarginBottom>;
429
pub type LayoutTextJustifyValue = CssPropertyValue<LayoutTextJustify>;
430
pub type LayoutMarginLeftValue = CssPropertyValue<LayoutMarginLeft>;
431
pub type LayoutMarginRightValue = CssPropertyValue<LayoutMarginRight>;
432
pub type LayoutBorderTopWidthValue = CssPropertyValue<LayoutBorderTopWidth>;
433
pub type LayoutBorderLeftWidthValue = CssPropertyValue<LayoutBorderLeftWidth>;
434
pub type LayoutBorderRightWidthValue = CssPropertyValue<LayoutBorderRightWidth>;
435
pub type LayoutBorderBottomWidthValue = CssPropertyValue<LayoutBorderBottomWidth>;
436
pub type LayoutOverflowValue = CssPropertyValue<LayoutOverflow>;
437
pub type LayoutFlexDirectionValue = CssPropertyValue<LayoutFlexDirection>;
438
pub type LayoutFlexWrapValue = CssPropertyValue<LayoutFlexWrap>;
439
pub type LayoutFlexGrowValue = CssPropertyValue<LayoutFlexGrow>;
440
pub type LayoutFlexShrinkValue = CssPropertyValue<LayoutFlexShrink>;
441
pub type LayoutFlexBasisValue = CssPropertyValue<LayoutFlexBasis>;
442
pub type LayoutJustifyContentValue = CssPropertyValue<LayoutJustifyContent>;
443
pub type LayoutAlignItemsValue = CssPropertyValue<LayoutAlignItems>;
444
pub type LayoutAlignContentValue = CssPropertyValue<LayoutAlignContent>;
445
pub type LayoutColumnGapValue = CssPropertyValue<LayoutColumnGap>;
446
pub type LayoutRowGapValue = CssPropertyValue<LayoutRowGap>;
447
pub type LayoutGridTemplateColumnsValue = CssPropertyValue<GridTemplate>;
448
pub type LayoutGridTemplateRowsValue = CssPropertyValue<GridTemplate>;
449
pub type LayoutGridAutoColumnsValue = CssPropertyValue<GridAutoTracks>;
450
pub type LayoutGridAutoRowsValue = CssPropertyValue<GridAutoTracks>;
451
pub type LayoutGridColumnValue = CssPropertyValue<GridPlacement>;
452
pub type LayoutGridRowValue = CssPropertyValue<GridPlacement>;
453
pub type LayoutGridTemplateAreasValue =
454
    CssPropertyValue<GridTemplateAreas>;
455
pub type LayoutWritingModeValue = CssPropertyValue<LayoutWritingMode>;
456
pub type LayoutClearValue = CssPropertyValue<LayoutClear>;
457
pub type LayoutGridAutoFlowValue = CssPropertyValue<LayoutGridAutoFlow>;
458
pub type LayoutJustifySelfValue = CssPropertyValue<LayoutJustifySelf>;
459
pub type LayoutJustifyItemsValue = CssPropertyValue<LayoutJustifyItems>;
460
pub type LayoutGapValue = CssPropertyValue<LayoutGap>;
461
pub type LayoutAlignSelfValue = CssPropertyValue<LayoutAlignSelf>;
462
pub type StyleFontValue = CssPropertyValue<StyleFontFamilyVec>;
463
pub type PageBreakValue = CssPropertyValue<PageBreak>;
464
pub type BreakInsideValue = CssPropertyValue<BreakInside>;
465
pub type WidowsValue = CssPropertyValue<Widows>;
466
pub type OrphansValue = CssPropertyValue<Orphans>;
467
pub type BoxDecorationBreakValue = CssPropertyValue<BoxDecorationBreak>;
468
pub type ColumnCountValue = CssPropertyValue<ColumnCount>;
469
pub type ColumnWidthValue = CssPropertyValue<ColumnWidth>;
470
pub type ColumnSpanValue = CssPropertyValue<ColumnSpan>;
471
pub type ColumnFillValue = CssPropertyValue<ColumnFill>;
472
pub type ColumnRuleWidthValue = CssPropertyValue<ColumnRuleWidth>;
473
pub type ColumnRuleStyleValue = CssPropertyValue<ColumnRuleStyle>;
474
pub type ColumnRuleColorValue = CssPropertyValue<ColumnRuleColor>;
475
pub type FlowIntoValue = CssPropertyValue<FlowInto>;
476
pub type FlowFromValue = CssPropertyValue<FlowFrom>;
477
pub type ShapeOutsideValue = CssPropertyValue<ShapeOutside>;
478
pub type ShapeInsideValue = CssPropertyValue<ShapeInside>;
479
pub type ClipPathValue = CssPropertyValue<ClipPath>;
480
pub type ShapeMarginValue = CssPropertyValue<ShapeMargin>;
481
pub type ShapeImageThresholdValue = CssPropertyValue<ShapeImageThreshold>;
482
pub type LayoutTableLayoutValue = CssPropertyValue<LayoutTableLayout>;
483
pub type StyleBorderCollapseValue = CssPropertyValue<StyleBorderCollapse>;
484
pub type LayoutBorderSpacingValue = CssPropertyValue<LayoutBorderSpacing>;
485
pub type StyleCaptionSideValue = CssPropertyValue<StyleCaptionSide>;
486
pub type StyleEmptyCellsValue = CssPropertyValue<StyleEmptyCells>;
487
pub type ContentValue = CssPropertyValue<Content>;
488
pub type CounterResetValue = CssPropertyValue<CounterReset>;
489
pub type CounterIncrementValue = CssPropertyValue<CounterIncrement>;
490
pub type StyleListStyleTypeValue = CssPropertyValue<StyleListStyleType>;
491
pub type StyleListStylePositionValue = CssPropertyValue<StyleListStylePosition>;
492
pub type StringSetValue = CssPropertyValue<StringSet>;
493

            
494
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
495
pub struct CssKeyMap {
496
    // Contains all keys that have no shorthand
497
    pub non_shorthands: BTreeMap<&'static str, CssPropertyType>,
498
    // Contains all keys that act as a shorthand for other types
499
    pub shorthands: BTreeMap<&'static str, CombinedCssPropertyType>,
500
}
501

            
502
impl CssKeyMap {
503
253
    #[must_use] pub fn get() -> Self {
504
253
        get_css_key_map()
505
253
    }
506
}
507

            
508
/// Returns a map useful for parsing the keys of CSS stylesheets
509
68340
#[must_use] pub fn get_css_key_map() -> CssKeyMap {
510
    CssKeyMap {
511
12984600
        non_shorthands: CSS_PROPERTY_KEY_MAP.iter().map(|(v, k)| (*k, *v)).collect(),
512
68340
        shorthands: COMBINED_CSS_PROPERTIES_KEY_MAP
513
68340
            .iter()
514
1845180
            .map(|(v, k)| (*k, *v))
515
68340
            .collect(),
516
    }
517
68340
}
518

            
519
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
520
#[repr(C)]
521
pub enum CombinedCssPropertyType {
522
    BorderRadius,
523
    Overflow,
524
    Margin,
525
    Border,
526
    BorderLeft,
527
    BorderRight,
528
    BorderTop,
529
    BorderBottom,
530
    BorderColor,
531
    BorderStyle,
532
    BorderWidth,
533
    Padding,
534
    BoxShadow,
535
    BackgroundColor, // BackgroundContent::Color
536
    BackgroundImage, // BackgroundContent::Image
537
    Background,
538
    Flex,
539
    Grid,
540
    Gap,
541
    GridGap,
542
    Font,
543
    Columns,
544
    ColumnRule,
545
    GridArea,
546
    TextBox,
547
    /// `inset-block` shorthand: sets `inset-block-start` + `inset-block-end`
548
    /// (maps to `top` + `bottom` in horizontal-tb writing mode)
549
    InsetBlock,
550
    /// `inset-inline` shorthand: sets `inset-inline-start` + `inset-inline-end`
551
    /// (maps to `left` + `right` in horizontal-tb writing mode)
552
    InsetInline,
553
}
554

            
555
impl fmt::Display for CombinedCssPropertyType {
556
30
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
557
        // The map is `[(CombinedCssPropertyType, &str)]`, so the NAME is slot 1.
558
        // `.map(|(k, _)| k)` bound slot 0 — the enum itself — and `write!` then called
559
        // this very impl on it again, recursing until the stack blew.
560
30
        let key = COMBINED_CSS_PROPERTIES_KEY_MAP
561
30
            .iter()
562
390
            .find(|(v, _)| *v == *self)
563
30
            .map(|(_, k)| k)
564
30
            .unwrap();
565
30
        write!(f, "{key}")
566
30
    }
567
}
568

            
569
impl CombinedCssPropertyType {
570
    /// Parses a CSS key, such as `width` from a string:
571
    ///
572
    /// # Example
573
    ///
574
    /// ```rust
575
    /// # use azul_css::props::property::{CombinedCssPropertyType, get_css_key_map};
576
    /// let map = get_css_key_map();
577
    /// assert_eq!(
578
    ///     Some(CombinedCssPropertyType::Border),
579
    ///     CombinedCssPropertyType::from_str("border", &map)
580
    /// );
581
    /// ```
582
415101
    #[must_use] pub fn from_str(input: &str, map: &CssKeyMap) -> Option<Self> {
583
415101
        let input = input.trim();
584
415101
        map.shorthands.get(input).copied()
585
415101
    }
586

            
587
    /// Returns the original string that was used to construct this `CssPropertyType`.
588
    ///
589
    /// # Panics
590
    ///
591
    /// Panics if `self` is not present in `map` (i.e. `map` is not the
592
    /// `CssKeyMap` this property type was constructed from).
593
27
    #[must_use] pub fn to_str(&self, map: &CssKeyMap) -> &'static str {
594
27
        map.shorthands
595
27
            .iter()
596
378
            .find(|(_, v)| *v == self)
597
27
            .map(|(k, _)| k)
598
27
            .unwrap()
599
27
    }
600
}
601

            
602
/// Represents one parsed CSS key-value pair, such as `"width: 20px"` =>
603
/// `CssProperty::Width(LayoutWidth::px(20.0))`
604
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
605
#[repr(C, u8)]
606
pub enum CssProperty {
607
    CaretColor(CaretColorValue),
608
    CaretAnimationDuration(CaretAnimationDurationValue),
609
    /// `animation: all 2s [timing]` — diff-driven transitions; the OLD tree's
610
    /// value governs (USER spec 2026-08-17).
611
    Animation(StyleAnimationVecValue),
612
    /// `-azul-animation-in: <name> <duration> [timing]` — runs on mount.
613
    AnimationIn(StyleAnimationVecValue),
614
    /// `-azul-animation-out: <name> <duration> [timing]` — runs on unmount,
615
    /// against the retained (frozen) zombie subtree.
616
    AnimationOut(StyleAnimationVecValue),
617
    CaretWidth(CaretWidthValue),
618
    SelectionBackgroundColor(SelectionBackgroundColorValue),
619
    SelectionColor(SelectionColorValue),
620
    SelectionRadius(SelectionRadiusValue),
621
    TextColor(StyleTextColorValue),
622
    FontSize(StyleFontSizeValue),
623
    FontFamily(StyleFontFamilyVecValue),
624
    FontWeight(StyleFontWeightValue),
625
    FontStyle(StyleFontStyleValue),
626
    TextAlign(StyleTextAlignValue),
627
    TextJustify(LayoutTextJustifyValue),
628
    VerticalAlign(StyleVerticalAlignValue),
629
    LetterSpacing(StyleLetterSpacingValue),
630
    TextIndent(StyleTextIndentValue),
631
    InitialLetter(StyleInitialLetterValue),
632
    LineClamp(StyleLineClampValue),
633
    HangingPunctuation(StyleHangingPunctuationValue),
634
    TextCombineUpright(StyleTextCombineUprightValue),
635
    UnicodeBidi(StyleUnicodeBidiValue),
636
    TextBoxTrim(StyleTextBoxTrimValue),
637
    TextBoxEdge(StyleTextBoxEdgeValue),
638
    DominantBaseline(StyleDominantBaselineValue),
639
    AlignmentBaseline(StyleAlignmentBaselineValue),
640
    BaselineSource(StyleBaselineSourceValue),
641
    LineFitEdge(StyleLineFitEdgeValue),
642
    InitialLetterAlign(StyleInitialLetterAlignValue),
643
    InitialLetterWrap(StyleInitialLetterWrapValue),
644
    ScrollbarGutter(StyleScrollbarGutterValue),
645
    OverflowClipMargin(StyleOverflowClipMarginValue),
646
    Clip(StyleClipRectValue),
647
    ExclusionMargin(StyleExclusionMarginValue),
648
    HyphenationLanguage(StyleHyphenationLanguageValue),
649
    LineHeight(StyleLineHeightValue),
650
    WordSpacing(StyleWordSpacingValue),
651
    TabSize(StyleTabSizeValue),
652
    WhiteSpace(StyleWhiteSpaceValue),
653
    Hyphens(StyleHyphensValue),
654
    WordBreak(StyleWordBreakValue),
655
    OverflowWrap(StyleOverflowWrapValue),
656
    LineBreak(StyleLineBreakValue),
657
    TextOverflow(StyleTextOverflowValue),
658
    ObjectFit(StyleObjectFitValue),
659
    ObjectPosition(StyleObjectPositionValue),
660
    AspectRatio(StyleAspectRatioValue),
661
    TextOrientation(StyleTextOrientationValue),
662
    TextAlignLast(StyleTextAlignLastValue),
663
    TextTransform(StyleTextTransformValue),
664
    Direction(StyleDirectionValue),
665
    UserSelect(StyleUserSelectValue),
666
    TextDecoration(StyleTextDecorationValue),
667
    Cursor(StyleCursorValue),
668
    Display(LayoutDisplayValue),
669
    Float(LayoutFloatValue),
670
    BoxSizing(LayoutBoxSizingValue),
671
    Width(LayoutWidthValue),
672
    Height(LayoutHeightValue),
673
    MinWidth(LayoutMinWidthValue),
674
    MinHeight(LayoutMinHeightValue),
675
    MaxWidth(LayoutMaxWidthValue),
676
    MaxHeight(LayoutMaxHeightValue),
677
    Position(LayoutPositionValue),
678
    Top(LayoutTopValue),
679
    Right(LayoutRightValue),
680
    Left(LayoutLeftValue),
681
    Bottom(LayoutInsetBottomValue),
682
    ZIndex(LayoutZIndexValue),
683
    FlexWrap(LayoutFlexWrapValue),
684
    FlexDirection(LayoutFlexDirectionValue),
685
    FlexGrow(LayoutFlexGrowValue),
686
    FlexShrink(LayoutFlexShrinkValue),
687
    FlexBasis(LayoutFlexBasisValue),
688
    JustifyContent(LayoutJustifyContentValue),
689
    AlignItems(LayoutAlignItemsValue),
690
    AlignContent(LayoutAlignContentValue),
691
    ColumnGap(LayoutColumnGapValue),
692
    RowGap(LayoutRowGapValue),
693
    GridTemplateColumns(LayoutGridTemplateColumnsValue),
694
    GridTemplateRows(LayoutGridTemplateRowsValue),
695
    GridAutoColumns(LayoutGridAutoColumnsValue),
696
    GridAutoRows(LayoutGridAutoRowsValue),
697
    GridColumn(LayoutGridColumnValue),
698
    GridRow(LayoutGridRowValue),
699
    GridTemplateAreas(LayoutGridTemplateAreasValue),
700
    WritingMode(LayoutWritingModeValue),
701
    Clear(LayoutClearValue),
702
    BackgroundContent(StyleBackgroundContentVecValue),
703
    BackgroundPosition(StyleBackgroundPositionVecValue),
704
    BackgroundSize(StyleBackgroundSizeVecValue),
705
    BackgroundRepeat(StyleBackgroundRepeatVecValue),
706
    OverflowX(LayoutOverflowValue),
707
    OverflowY(LayoutOverflowValue),
708
    OverflowBlock(LayoutOverflowValue),
709
    OverflowInline(LayoutOverflowValue),
710
    GridAutoFlow(LayoutGridAutoFlowValue),
711
    JustifySelf(LayoutJustifySelfValue),
712
    JustifyItems(LayoutJustifyItemsValue),
713
    Gap(LayoutGapValue),
714
    GridGap(LayoutGapValue),
715
    AlignSelf(LayoutAlignSelfValue),
716
    Font(StyleFontValue),
717
    PaddingTop(LayoutPaddingTopValue),
718
    PaddingLeft(LayoutPaddingLeftValue),
719
    PaddingRight(LayoutPaddingRightValue),
720
    PaddingBottom(LayoutPaddingBottomValue),
721
    PaddingInlineStart(LayoutPaddingInlineStartValue),
722
    PaddingInlineEnd(LayoutPaddingInlineEndValue),
723
    MarginTop(LayoutMarginTopValue),
724
    MarginLeft(LayoutMarginLeftValue),
725
    MarginRight(LayoutMarginRightValue),
726
    MarginBottom(LayoutMarginBottomValue),
727
    BorderTopLeftRadius(StyleBorderTopLeftRadiusValue),
728
    BorderTopRightRadius(StyleBorderTopRightRadiusValue),
729
    BorderBottomLeftRadius(StyleBorderBottomLeftRadiusValue),
730
    BorderBottomRightRadius(StyleBorderBottomRightRadiusValue),
731
    BorderTopColor(StyleBorderTopColorValue),
732
    BorderRightColor(StyleBorderRightColorValue),
733
    BorderLeftColor(StyleBorderLeftColorValue),
734
    BorderBottomColor(StyleBorderBottomColorValue),
735
    BorderTopStyle(StyleBorderTopStyleValue),
736
    BorderRightStyle(StyleBorderRightStyleValue),
737
    BorderLeftStyle(StyleBorderLeftStyleValue),
738
    BorderBottomStyle(StyleBorderBottomStyleValue),
739
    BorderTopWidth(LayoutBorderTopWidthValue),
740
    BorderRightWidth(LayoutBorderRightWidthValue),
741
    BorderLeftWidth(LayoutBorderLeftWidthValue),
742
    BorderBottomWidth(LayoutBorderBottomWidthValue),
743
    BoxShadowLeft(StyleBoxShadowValue),
744
    BoxShadowRight(StyleBoxShadowValue),
745
    BoxShadowTop(StyleBoxShadowValue),
746
    BoxShadowBottom(StyleBoxShadowValue),
747
    ScrollbarTrack(StyleBackgroundContentValue),
748
    ScrollbarThumb(StyleBackgroundContentValue),
749
    ScrollbarButton(StyleBackgroundContentValue),
750
    ScrollbarCorner(StyleBackgroundContentValue),
751
    ScrollbarResizer(StyleBackgroundContentValue),
752
    ScrollbarWidth(LayoutScrollbarWidthValue),
753
    ScrollbarColor(StyleScrollbarColorValue),
754
    ScrollbarVisibility(ScrollbarVisibilityModeValue),
755
    ScrollbarFadeDelay(ScrollbarFadeDelayValue),
756
    ScrollbarFadeDuration(ScrollbarFadeDurationValue),
757
    Opacity(StyleOpacityValue),
758
    Visibility(StyleVisibilityValue),
759
    Transform(StyleTransformVecValue),
760
    TransformOrigin(StyleTransformOriginValue),
761
    PerspectiveOrigin(StylePerspectiveOriginValue),
762
    BackfaceVisibility(StyleBackfaceVisibilityValue),
763
    MixBlendMode(StyleMixBlendModeValue),
764
    Filter(StyleFilterVecValue),
765
    BackdropFilter(StyleFilterVecValue),
766
    TextShadow(StyleBoxShadowValue),
767
    BreakBefore(PageBreakValue),
768
    BreakAfter(PageBreakValue),
769
    BreakInside(BreakInsideValue),
770
    Orphans(OrphansValue),
771
    Widows(WidowsValue),
772
    BoxDecorationBreak(BoxDecorationBreakValue),
773
    ColumnCount(ColumnCountValue),
774
    ColumnWidth(ColumnWidthValue),
775
    ColumnSpan(ColumnSpanValue),
776
    ColumnFill(ColumnFillValue),
777
    ColumnRuleWidth(ColumnRuleWidthValue),
778
    ColumnRuleStyle(ColumnRuleStyleValue),
779
    ColumnRuleColor(ColumnRuleColorValue),
780
    FlowInto(FlowIntoValue),
781
    FlowFrom(FlowFromValue),
782
    ShapeOutside(ShapeOutsideValue),
783
    ShapeInside(ShapeInsideValue),
784
    ClipPath(ClipPathValue),
785
    ShapeMargin(ShapeMarginValue),
786
    ShapeImageThreshold(ShapeImageThresholdValue),
787
    TableLayout(LayoutTableLayoutValue),
788
    BorderCollapse(StyleBorderCollapseValue),
789
    BorderSpacing(LayoutBorderSpacingValue),
790
    CaptionSide(StyleCaptionSideValue),
791
    EmptyCells(StyleEmptyCellsValue),
792
    Content(ContentValue),
793
    CounterReset(CounterResetValue),
794
    CounterIncrement(CounterIncrementValue),
795
    ListStyleType(StyleListStyleTypeValue),
796
    ListStylePosition(StyleListStylePositionValue),
797
    StringSet(StringSetValue),
798
}
799

            
800
impl_option!(
801
    CssProperty,
802
    OptionCssProperty,
803
    copy = false,
804
    [Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord]
805
);
806

            
807
crate::impl_vec!(
808
    CssProperty,
809
    CssPropertyVec,
810
    CssPropertyVecDestructor,
811
    CssPropertyVecDestructorType,
812
    CssPropertyVecSlice,
813
    OptionCssProperty
814
);
815
crate::impl_vec_clone!(CssProperty, CssPropertyVec, CssPropertyVecDestructor);
816
crate::impl_vec_debug!(CssProperty, CssPropertyVec);
817
crate::impl_vec_partialeq!(CssProperty, CssPropertyVec);
818
crate::impl_vec_eq!(CssProperty, CssPropertyVec);
819
crate::impl_vec_partialord!(CssProperty, CssPropertyVec);
820
crate::impl_vec_ord!(CssProperty, CssPropertyVec);
821
crate::impl_vec_hash!(CssProperty, CssPropertyVec);
822

            
823
/// Categorizes a CSS property by its effect on the layout pipeline.
824
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
825
pub enum CssPropertyCategory {
826
    GpuOnly,
827
    /// Affects geometry (width, height, margin, padding, font-size, etc.)
828
    Layout,
829
    /// Affects only appearance (color, background-color, etc.)
830
    Paint,
831
    /// A layout-affecting property that also requires children to be re-evaluated.
832
    InheritedLayout,
833
    /// A paint-affecting property that also requires children to be re-evaluated.
834
    InheritedPaint,
835
}
836

            
837
/// Fine-grained dirty classification for CSS property changes.
838
///
839
/// Inspired by Taffy's binary dirty flag but extended to 4 levels for CSS-specific
840
/// optimizations. Instead of "clean vs dirty", we classify property changes by their
841
/// actual layout impact, enabling the engine to skip unnecessary work.
842
///
843
/// Reference: Taffy (<https://github.com/DioxusLabs/taffy>) uses a binary dirty flag
844
/// (clean/dirty). Our improvement: 4-level classification enables IFC-only reflow,
845
/// sizing-only recomputation, and paint-only updates without full subtree relayout.
846
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
847
#[repr(C)]
848
#[derive(Default)]
849
pub enum RelayoutScope {
850
    /// No relayout needed — repaint only (e.g., color, background, opacity, transform).
851
    /// The node's size and position are unchanged.
852
    #[default]
853
    None,
854
    /// Only the IFC (Inline Formatting Context) containing this node needs re-shaping.
855
    /// Block-level siblings are unaffected unless the IFC height changes,
856
    /// in which case this auto-upgrades to `SizingOnly`.
857
    IfcOnly,
858
    /// This node's sizing needs recomputation. Parent may need repositioning
859
    /// of subsequent siblings but doesn't need full recursive relayout.
860
    SizingOnly,
861
    /// Full subtree relayout required (e.g., display, position, float change).
862
    Full,
863
}
864

            
865
/// Represents a CSS key (for example `"border-radius"` => `BorderRadius`).
866
/// You can also derive this key from a `CssProperty` by calling `CssProperty::get_type()`.
867
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
868
#[repr(C)]
869
pub enum CssPropertyType {
870
    CaretColor,
871
    CaretAnimationDuration,
872
    Animation,
873
    AnimationIn,
874
    AnimationOut,
875
    CaretWidth,
876
    SelectionBackgroundColor,
877
    SelectionColor,
878
    SelectionRadius,
879
    TextColor,
880
    FontSize,
881
    FontFamily,
882
    FontWeight,
883
    FontStyle,
884
    TextAlign,
885
    TextJustify,
886
    VerticalAlign,
887
    LetterSpacing,
888
    TextIndent,
889
    InitialLetter,
890
    LineClamp,
891
    HangingPunctuation,
892
    TextCombineUpright,
893
    UnicodeBidi,
894
    TextBoxTrim,
895
    TextBoxEdge,
896
    DominantBaseline,
897
    AlignmentBaseline,
898
    BaselineSource,
899
    LineFitEdge,
900
    InitialLetterAlign,
901
    InitialLetterWrap,
902
    ScrollbarGutter,
903
    OverflowClipMargin,
904
    Clip,
905
    ExclusionMargin,
906
    HyphenationLanguage,
907
    LineHeight,
908
    WordSpacing,
909
    TabSize,
910
    WhiteSpace,
911
    Hyphens,
912
    WordBreak,
913
    OverflowWrap,
914
    LineBreak,
915
    TextOverflow,
916
    ObjectFit,
917
    ObjectPosition,
918
    AspectRatio,
919
    TextOrientation,
920
    TextAlignLast,
921
    TextTransform,
922
    Direction,
923
    UserSelect,
924
    TextDecoration,
925
    Cursor,
926
    Display,
927
    Float,
928
    BoxSizing,
929
    Width,
930
    Height,
931
    MinWidth,
932
    MinHeight,
933
    MaxWidth,
934
    MaxHeight,
935
    Position,
936
    Top,
937
    Right,
938
    Left,
939
    Bottom,
940
    ZIndex,
941
    FlexWrap,
942
    FlexDirection,
943
    FlexGrow,
944
    FlexShrink,
945
    FlexBasis,
946
    JustifyContent,
947
    AlignItems,
948
    AlignContent,
949
    ColumnGap,
950
    RowGap,
951
    GridTemplateColumns,
952
    GridTemplateRows,
953
    GridAutoColumns,
954
    GridAutoRows,
955
    GridColumn,
956
    GridRow,
957
    GridTemplateAreas,
958
    GridAutoFlow,
959
    JustifySelf,
960
    JustifyItems,
961
    Gap,
962
    GridGap,
963
    AlignSelf,
964
    Font,
965
    WritingMode,
966
    Clear,
967
    BackgroundContent,
968
    BackgroundPosition,
969
    BackgroundSize,
970
    BackgroundRepeat,
971
    OverflowX,
972
    OverflowY,
973
    OverflowBlock,
974
    OverflowInline,
975
    PaddingTop,
976
    PaddingLeft,
977
    PaddingRight,
978
    PaddingBottom,
979
    PaddingInlineStart,
980
    PaddingInlineEnd,
981
    MarginTop,
982
    MarginLeft,
983
    MarginRight,
984
    MarginBottom,
985
    BorderTopLeftRadius,
986
    BorderTopRightRadius,
987
    BorderBottomLeftRadius,
988
    BorderBottomRightRadius,
989
    BorderTopColor,
990
    BorderRightColor,
991
    BorderLeftColor,
992
    BorderBottomColor,
993
    BorderTopStyle,
994
    BorderRightStyle,
995
    BorderLeftStyle,
996
    BorderBottomStyle,
997
    BorderTopWidth,
998
    BorderRightWidth,
999
    BorderLeftWidth,
    BorderBottomWidth,
    BoxShadowLeft,
    BoxShadowRight,
    BoxShadowTop,
    BoxShadowBottom,
    ScrollbarTrack,
    ScrollbarThumb,
    ScrollbarButton,
    ScrollbarCorner,
    ScrollbarResizer,
    ScrollbarWidth,
    ScrollbarColor,
    ScrollbarVisibility,
    ScrollbarFadeDelay,
    ScrollbarFadeDuration,
    Opacity,
    Visibility,
    Transform,
    TransformOrigin,
    PerspectiveOrigin,
    BackfaceVisibility,
    MixBlendMode,
    Filter,
    BackdropFilter,
    TextShadow,
    BreakBefore,
    BreakAfter,
    BreakInside,
    Orphans,
    Widows,
    BoxDecorationBreak,
    ColumnCount,
    ColumnWidth,
    ColumnSpan,
    ColumnFill,
    ColumnRuleWidth,
    ColumnRuleStyle,
    ColumnRuleColor,
    FlowInto,
    FlowFrom,
    ShapeOutside,
    ShapeInside,
    ClipPath,
    ShapeMargin,
    ShapeImageThreshold,
    TableLayout,
    BorderCollapse,
    BorderSpacing,
    CaptionSide,
    EmptyCells,
    Content,
    CounterReset,
    CounterIncrement,
    ListStyleType,
    ListStylePosition,
    StringSet,
}
impl CssPropertyType {
    /// All CSS property types, in declaration order.
    ///
    /// Use this instead of strum's `EnumIter` — ensures a compile error
    /// if a variant is added to the enum but not to this array.
    pub const ALL: &[Self] = &[
        Self::CaretColor,
        Self::CaretAnimationDuration,
        Self::Animation,
        Self::AnimationIn,
        Self::AnimationOut,
        Self::CaretWidth,
        Self::SelectionBackgroundColor,
        Self::SelectionColor,
        Self::SelectionRadius,
        Self::TextColor,
        Self::FontSize,
        Self::FontFamily,
        Self::FontWeight,
        Self::FontStyle,
        Self::TextAlign,
        Self::TextJustify,
        Self::VerticalAlign,
        Self::LetterSpacing,
        Self::TextIndent,
        Self::InitialLetter,
        Self::LineClamp,
        Self::HangingPunctuation,
        Self::TextCombineUpright,
        Self::UnicodeBidi,
        Self::TextBoxTrim,
        Self::TextBoxEdge,
        Self::DominantBaseline,
        Self::AlignmentBaseline,
        Self::BaselineSource,
        Self::LineFitEdge,
        Self::InitialLetterAlign,
        Self::InitialLetterWrap,
        Self::ScrollbarGutter,
        Self::OverflowClipMargin,
        Self::Clip,
        Self::ExclusionMargin,
        Self::HyphenationLanguage,
        Self::LineHeight,
        Self::WordSpacing,
        Self::TabSize,
        Self::WhiteSpace,
        Self::Hyphens,
        Self::WordBreak,
        Self::OverflowWrap,
        Self::LineBreak,
        Self::TextOverflow,
        Self::ObjectFit,
        Self::ObjectPosition,
        Self::AspectRatio,
        Self::TextOrientation,
        Self::TextAlignLast,
        Self::TextTransform,
        Self::Direction,
        Self::UserSelect,
        Self::TextDecoration,
        Self::Cursor,
        Self::Display,
        Self::Float,
        Self::BoxSizing,
        Self::Width,
        Self::Height,
        Self::MinWidth,
        Self::MinHeight,
        Self::MaxWidth,
        Self::MaxHeight,
        Self::Position,
        Self::Top,
        Self::Right,
        Self::Left,
        Self::Bottom,
        Self::ZIndex,
        Self::FlexWrap,
        Self::FlexDirection,
        Self::FlexGrow,
        Self::FlexShrink,
        Self::FlexBasis,
        Self::JustifyContent,
        Self::AlignItems,
        Self::AlignContent,
        Self::ColumnGap,
        Self::RowGap,
        Self::GridTemplateColumns,
        Self::GridTemplateRows,
        Self::GridAutoColumns,
        Self::GridAutoRows,
        Self::GridColumn,
        Self::GridRow,
        Self::GridTemplateAreas,
        Self::GridAutoFlow,
        Self::JustifySelf,
        Self::JustifyItems,
        Self::Gap,
        Self::GridGap,
        Self::AlignSelf,
        Self::Font,
        Self::WritingMode,
        Self::Clear,
        Self::BackgroundContent,
        Self::BackgroundPosition,
        Self::BackgroundSize,
        Self::BackgroundRepeat,
        Self::OverflowX,
        Self::OverflowY,
        Self::OverflowBlock,
        Self::OverflowInline,
        Self::PaddingTop,
        Self::PaddingLeft,
        Self::PaddingRight,
        Self::PaddingBottom,
        Self::PaddingInlineStart,
        Self::PaddingInlineEnd,
        Self::MarginTop,
        Self::MarginLeft,
        Self::MarginRight,
        Self::MarginBottom,
        Self::BorderTopLeftRadius,
        Self::BorderTopRightRadius,
        Self::BorderBottomLeftRadius,
        Self::BorderBottomRightRadius,
        Self::BorderTopColor,
        Self::BorderRightColor,
        Self::BorderLeftColor,
        Self::BorderBottomColor,
        Self::BorderTopStyle,
        Self::BorderRightStyle,
        Self::BorderLeftStyle,
        Self::BorderBottomStyle,
        Self::BorderTopWidth,
        Self::BorderRightWidth,
        Self::BorderLeftWidth,
        Self::BorderBottomWidth,
        Self::BoxShadowLeft,
        Self::BoxShadowRight,
        Self::BoxShadowTop,
        Self::BoxShadowBottom,
        Self::ScrollbarTrack,
        Self::ScrollbarThumb,
        Self::ScrollbarButton,
        Self::ScrollbarCorner,
        Self::ScrollbarResizer,
        Self::ScrollbarWidth,
        Self::ScrollbarColor,
        Self::ScrollbarVisibility,
        Self::ScrollbarFadeDelay,
        Self::ScrollbarFadeDuration,
        Self::Opacity,
        Self::Visibility,
        Self::Transform,
        Self::TransformOrigin,
        Self::PerspectiveOrigin,
        Self::BackfaceVisibility,
        Self::MixBlendMode,
        Self::Filter,
        Self::BackdropFilter,
        Self::TextShadow,
        Self::BreakBefore,
        Self::BreakAfter,
        Self::BreakInside,
        Self::Orphans,
        Self::Widows,
        Self::BoxDecorationBreak,
        Self::ColumnCount,
        Self::ColumnWidth,
        Self::ColumnSpan,
        Self::ColumnFill,
        Self::ColumnRuleWidth,
        Self::ColumnRuleStyle,
        Self::ColumnRuleColor,
        Self::FlowInto,
        Self::FlowFrom,
        Self::ShapeOutside,
        Self::ShapeInside,
        Self::ClipPath,
        Self::ShapeMargin,
        Self::ShapeImageThreshold,
        Self::TableLayout,
        Self::BorderCollapse,
        Self::BorderSpacing,
        Self::CaptionSide,
        Self::EmptyCells,
        Self::Content,
        Self::CounterReset,
        Self::CounterIncrement,
        Self::ListStyleType,
        Self::ListStylePosition,
        Self::StringSet,
    ];
    /// Returns an iterator over all CSS property types.
13
    pub fn iter() -> impl Iterator<Item = Self> {
13
        Self::ALL.iter().copied()
13
    }
}
impl fmt::Debug for CssPropertyType {
819
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
819
        write!(f, "{}", self.to_str())
819
    }
}
impl fmt::Display for CssPropertyType {
186
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
186
        write!(f, "{}", self.to_str())
186
    }
}
impl CssPropertyType {
    /// Parses a CSS key, such as `width` from a string:
    ///
    /// # Example
    ///
    /// ```rust
    /// # use azul_css::props::property::{CssPropertyType, get_css_key_map};
    /// let map = get_css_key_map();
    /// assert_eq!(
    ///     Some(CssPropertyType::Width),
    ///     CssPropertyType::from_str("width", &map)
    /// );
    /// assert_eq!(
    ///     Some(CssPropertyType::JustifyContent),
    ///     CssPropertyType::from_str("justify-content", &map)
    /// );
    /// assert_eq!(None, CssPropertyType::from_str("asdfasdfasdf", &map));
    /// ```
361868
    #[must_use] pub fn from_str(input: &str, map: &CssKeyMap) -> Option<Self> {
361868
        let input = input.trim();
361868
        map.non_shorthands.get(input).copied()
361868
    }
    /// Returns the original string that was used to construct this `CssPropertyType`.
    #[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
3767
    #[must_use] pub const fn to_str(&self) -> &'static str {
3767
        match self {
16
            Self::CaretColor => "caret-color",
16
            Self::CaretAnimationDuration => "caret-animation-duration",
52
            Self::Animation => "animation",
16
            Self::AnimationIn => "-azul-animation-in",
16
            Self::AnimationOut => "-azul-animation-out",
16
            Self::CaretWidth => "-azul-caret-width",
16
            Self::SelectionBackgroundColor => "-azul-selection-background-color",
16
            Self::SelectionColor => "-azul-selection-color",
16
            Self::SelectionRadius => "-azul-selection-radius",
28
            Self::TextColor => "color",
176
            Self::FontSize => "font-size",
16
            Self::FontFamily => "font-family",
226
            Self::FontWeight => "font-weight",
16
            Self::FontStyle => "font-style",
16
            Self::TextAlign => "text-align",
16
            Self::TextJustify => "text-justify",
16
            Self::VerticalAlign => "vertical-align",
16
            Self::LetterSpacing => "letter-spacing",
16
            Self::TextIndent => "text-indent",
16
            Self::InitialLetter => "initial-letter",
16
            Self::LineClamp => "line-clamp",
16
            Self::HangingPunctuation => "hanging-punctuation",
16
            Self::TextCombineUpright => "text-combine-upright",
16
            Self::UnicodeBidi => "unicode-bidi",
16
            Self::TextBoxTrim => "text-box-trim",
16
            Self::TextBoxEdge => "text-box-edge",
16
            Self::DominantBaseline => "dominant-baseline",
16
            Self::AlignmentBaseline => "alignment-baseline",
16
            Self::BaselineSource => "baseline-source",
16
            Self::LineFitEdge => "line-fit-edge",
16
            Self::InitialLetterAlign => "initial-letter-align",
16
            Self::InitialLetterWrap => "initial-letter-wrap",
16
            Self::ScrollbarGutter => "scrollbar-gutter",
16
            Self::OverflowClipMargin => "overflow-clip-margin",
16
            Self::Clip => "clip",
16
            Self::ExclusionMargin => "-azul-exclusion-margin",
16
            Self::HyphenationLanguage => "-azul-hyphenation-language",
16
            Self::LineHeight => "line-height",
16
            Self::WordSpacing => "word-spacing",
16
            Self::TabSize => "tab-size",
100
            Self::Cursor => "cursor",
16
            Self::Display => "display",
16
            Self::Float => "float",
16
            Self::BoxSizing => "box-sizing",
76
            Self::Width => "width",
38
            Self::Height => "height",
16
            Self::MinWidth => "min-width",
16
            Self::MinHeight => "min-height",
16
            Self::MaxWidth => "max-width",
16
            Self::MaxHeight => "max-height",
16
            Self::Position => "position",
16
            Self::Top => "top",
16
            Self::Right => "right",
16
            Self::Left => "left",
16
            Self::Bottom => "bottom",
16
            Self::ZIndex => "z-index",
16
            Self::FlexWrap => "flex-wrap",
16
            Self::FlexDirection => "flex-direction",
16
            Self::FlexGrow => "flex-grow",
16
            Self::FlexShrink => "flex-shrink",
16
            Self::FlexBasis => "flex-basis",
16
            Self::JustifyContent => "justify-content",
16
            Self::AlignItems => "align-items",
16
            Self::AlignContent => "align-content",
16
            Self::ColumnGap => "column-gap",
16
            Self::RowGap => "row-gap",
16
            Self::GridTemplateColumns => "grid-template-columns",
16
            Self::GridTemplateRows => "grid-template-rows",
16
            Self::GridAutoFlow => "grid-auto-flow",
16
            Self::JustifySelf => "justify-self",
16
            Self::JustifyItems => "justify-items",
16
            Self::Gap => "gap",
16
            Self::GridGap => "grid-gap",
16
            Self::AlignSelf => "align-self",
16
            Self::Font => "font",
16
            Self::GridAutoColumns => "grid-auto-columns",
16
            Self::GridAutoRows => "grid-auto-rows",
16
            Self::GridColumn => "grid-column",
16
            Self::GridRow => "grid-row",
16
            Self::GridTemplateAreas => "grid-template-areas",
16
            Self::WritingMode => "writing-mode",
16
            Self::Clear => "clear",
41
            Self::BackgroundContent => "background",
16
            Self::BackgroundPosition => "background-position",
16
            Self::BackgroundSize => "background-size",
16
            Self::BackgroundRepeat => "background-repeat",
16
            Self::OverflowX => "overflow-x",
16
            Self::OverflowY => "overflow-y",
16
            Self::OverflowBlock => "overflow-block",
16
            Self::OverflowInline => "overflow-inline",
16
            Self::PaddingTop => "padding-top",
16
            Self::PaddingLeft => "padding-left",
16
            Self::PaddingRight => "padding-right",
16
            Self::PaddingBottom => "padding-bottom",
16
            Self::PaddingInlineStart => "padding-inline-start",
16
            Self::PaddingInlineEnd => "padding-inline-end",
100
            Self::MarginTop => "margin-top",
16
            Self::MarginLeft => "margin-left",
16
            Self::MarginRight => "margin-right",
100
            Self::MarginBottom => "margin-bottom",
16
            Self::BorderTopLeftRadius => "border-top-left-radius",
16
            Self::BorderTopRightRadius => "border-top-right-radius",
16
            Self::BorderBottomLeftRadius => "border-bottom-left-radius",
16
            Self::BorderBottomRightRadius => "border-bottom-right-radius",
16
            Self::BorderTopColor => "border-top-color",
16
            Self::BorderRightColor => "border-right-color",
16
            Self::BorderLeftColor => "border-left-color",
16
            Self::BorderBottomColor => "border-bottom-color",
16
            Self::BorderTopStyle => "border-top-style",
16
            Self::BorderRightStyle => "border-right-style",
16
            Self::BorderLeftStyle => "border-left-style",
16
            Self::BorderBottomStyle => "border-bottom-style",
16
            Self::BorderTopWidth => "border-top-width",
16
            Self::BorderRightWidth => "border-right-width",
16
            Self::BorderLeftWidth => "border-left-width",
16
            Self::BorderBottomWidth => "border-bottom-width",
16
            Self::BoxShadowLeft => "-azul-box-shadow-left",
16
            Self::BoxShadowRight => "-azul-box-shadow-right",
16
            Self::BoxShadowTop => "-azul-box-shadow-top",
16
            Self::BoxShadowBottom => "-azul-box-shadow-bottom",
16
            Self::ScrollbarTrack => "-azul-scrollbar-track",
16
            Self::ScrollbarThumb => "-azul-scrollbar-thumb",
16
            Self::ScrollbarButton => "-azul-scrollbar-button",
16
            Self::ScrollbarCorner => "-azul-scrollbar-corner",
16
            Self::ScrollbarResizer => "-azul-scrollbar-resizer",
16
            Self::ScrollbarWidth => "scrollbar-width",
16
            Self::ScrollbarColor => "scrollbar-color",
16
            Self::ScrollbarVisibility => "-azul-scrollbar-visibility",
16
            Self::ScrollbarFadeDelay => "-azul-scrollbar-fade-delay",
16
            Self::ScrollbarFadeDuration => "-azul-scrollbar-fade-duration",
28
            Self::Opacity => "opacity",
16
            Self::Visibility => "visibility",
16
            Self::Transform => "transform",
16
            Self::TransformOrigin => "transform-origin",
16
            Self::PerspectiveOrigin => "perspective-origin",
16
            Self::BackfaceVisibility => "backface-visibility",
16
            Self::MixBlendMode => "mix-blend-mode",
16
            Self::Filter => "filter",
16
            Self::BackdropFilter => "backdrop-filter",
16
            Self::TextShadow => "text-shadow",
16
            Self::WhiteSpace => "white-space",
16
            Self::Hyphens => "hyphens",
16
            Self::WordBreak => "word-break",
17
            Self::OverflowWrap => "overflow-wrap",
16
            Self::LineBreak => "line-break",
17
            Self::TextOverflow => "text-overflow",
16
            Self::ObjectFit => "object-fit",
16
            Self::ObjectPosition => "object-position",
16
            Self::AspectRatio => "aspect-ratio",
16
            Self::TextOrientation => "text-orientation",
16
            Self::TextAlignLast => "text-align-last",
16
            Self::TextTransform => "text-transform",
16
            Self::Direction => "direction",
16
            Self::UserSelect => "user-select",
16
            Self::TextDecoration => "text-decoration",
16
            Self::BreakBefore => "break-before",
16
            Self::BreakAfter => "break-after",
16
            Self::BreakInside => "break-inside",
16
            Self::Orphans => "orphans",
16
            Self::Widows => "widows",
16
            Self::BoxDecorationBreak => "box-decoration-break",
16
            Self::ColumnCount => "column-count",
16
            Self::ColumnWidth => "column-width",
16
            Self::ColumnSpan => "column-span",
16
            Self::ColumnFill => "column-fill",
16
            Self::ColumnRuleWidth => "column-rule-width",
16
            Self::ColumnRuleStyle => "column-rule-style",
16
            Self::ColumnRuleColor => "column-rule-color",
16
            Self::FlowInto => "flow-into",
16
            Self::FlowFrom => "flow-from",
16
            Self::ShapeOutside => "shape-outside",
16
            Self::ShapeInside => "shape-inside",
16
            Self::ClipPath => "clip-path",
16
            Self::ShapeMargin => "shape-margin",
16
            Self::ShapeImageThreshold => "shape-image-threshold",
16
            Self::TableLayout => "table-layout",
16
            Self::BorderCollapse => "border-collapse",
16
            Self::BorderSpacing => "border-spacing",
16
            Self::CaptionSide => "caption-side",
16
            Self::EmptyCells => "empty-cells",
16
            Self::Content => "content",
16
            Self::CounterReset => "counter-reset",
16
            Self::CounterIncrement => "counter-increment",
16
            Self::ListStyleType => "list-style-type",
16
            Self::ListStylePosition => "list-style-position",
16
            Self::StringSet => "string-set",
        }
3767
    }
    /// Returns whether this property will be inherited during cascading
    /// Returns whether this CSS property is inherited by default according to CSS specifications.
    ///
    /// Reference: <https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Cascade/Inheritance>
    // +spec:display-property:b4cf6d - unicode-bidi does not inherit (removed from inheritable set)
22885025
    #[must_use] pub const fn is_inheritable(&self) -> bool {
        use self::CssPropertyType::{FontFamily, FontSize, FontWeight, FontStyle, LineHeight, LetterSpacing, WordSpacing, TextIndent, TextColor, TextAlign, TextJustify, TextDecoration, WhiteSpace, Direction, Hyphens, TabSize, WordBreak, OverflowWrap, LineBreak, TextAlignLast, TextTransform, TextOrientation, HangingPunctuation, TextCombineUpright, HyphenationLanguage, ListStyleType, ListStylePosition, BorderCollapse, BorderSpacing, CaptionSide, EmptyCells, Visibility, Cursor, Widows, Orphans, WritingMode, UserSelect};
22885025
        match self {
            // Font properties
            FontFamily | FontSize | FontWeight | FontStyle | LineHeight | LetterSpacing | WordSpacing | TextIndent |
            // Text properties
            TextColor | TextAlign | TextJustify | TextDecoration | WhiteSpace | Direction | Hyphens | TabSize |
            WordBreak | OverflowWrap | LineBreak | TextAlignLast | TextTransform |
            TextOrientation |
            HangingPunctuation | TextCombineUpright | HyphenationLanguage |
            // List properties
            ListStyleType | ListStylePosition |
            // Table properties
            BorderCollapse | BorderSpacing | CaptionSide | EmptyCells |
            // Other inherited properties
            // NOTE: Cursor is inheritable per CSS spec (https://developer.mozilla.org/en-US/docs/Web/CSS/cursor)
            // This means a Button with cursor:pointer will pass that to child Text nodes.
            // This is correct behavior - if you want text inside a button to show I-beam,
            // the Text node needs an explicit cursor:text style that overrides the inherited value.
            Visibility | Cursor | Widows | Orphans |
            // Writing mode
            WritingMode |
            // User interaction
            UserSelect
11415687
            => true,
11469338
            _ => false,
        }
22885025
    }
2380314
    #[must_use] pub const fn has_compact_encoding(&self) -> bool {
        use self::CssPropertyType::{Display, Position, Float, OverflowX, OverflowY, BoxSizing, FlexDirection, FlexWrap, JustifyContent, AlignItems, AlignContent, WritingMode, Clear, FontWeight, FontStyle, TextAlign, Visibility, WhiteSpace, Direction, VerticalAlign, BorderCollapse, Width, Height, MinWidth, MaxWidth, MinHeight, MaxHeight, FlexBasis, FontSize, PaddingTop, PaddingRight, PaddingBottom, PaddingLeft, MarginTop, MarginRight, MarginBottom, MarginLeft, BorderTopWidth, BorderRightWidth, BorderBottomWidth, BorderLeftWidth, Top, Right, Bottom, Left, FlexGrow, FlexShrink, ZIndex, BorderTopStyle, BorderRightStyle, BorderBottomStyle, BorderLeftStyle, BorderTopColor, BorderRightColor, BorderBottomColor, BorderLeftColor, BorderSpacing, TabSize, TextColor, FontFamily, LineHeight, LetterSpacing, WordSpacing, TextIndent, AlignSelf, JustifySelf, GridAutoFlow, JustifyItems, ColumnGap, RowGap, Gap, GridColumn, GridRow};
597829
        matches!(
2380314
            self,
            // Tier 1 enums
            Display | Position | Float | OverflowX | OverflowY | BoxSizing |
            FlexDirection | FlexWrap | JustifyContent | AlignItems | AlignContent |
            WritingMode | Clear | FontWeight | FontStyle | TextAlign |
            Visibility | WhiteSpace | Direction | VerticalAlign | BorderCollapse |
            // Tier 2 dims
            Width | Height | MinWidth | MaxWidth | MinHeight | MaxHeight |
            FlexBasis | FontSize |
            PaddingTop | PaddingRight | PaddingBottom | PaddingLeft |
            MarginTop | MarginRight | MarginBottom | MarginLeft |
            BorderTopWidth | BorderRightWidth | BorderBottomWidth | BorderLeftWidth |
            Top | Right | Bottom | Left |
            FlexGrow | FlexShrink |
            // Tier 2 cold
            ZIndex |
            BorderTopStyle | BorderRightStyle | BorderBottomStyle | BorderLeftStyle |
            BorderTopColor | BorderRightColor | BorderBottomColor | BorderLeftColor |
            BorderSpacing | TabSize |
            // Tier 2b text
            TextColor | FontFamily | LineHeight | LetterSpacing | WordSpacing | TextIndent |
            // Grid/flex alignment (tier1 extension)
            AlignSelf | JustifySelf | GridAutoFlow | JustifyItems |
            // Gap (tier2 extension)
            ColumnGap | RowGap | Gap |
            // Grid placement (tier2_cold extension)
            GridColumn | GridRow
        )
2380314
    }
561
    #[must_use] pub const fn get_category(&self) -> CssPropertyCategory {
561
        if self.is_gpu_only_property() {
7
            CssPropertyCategory::GpuOnly
        } else {
554
            let is_inheritable = self.is_inheritable();
554
            let can_trigger_layout = self.can_trigger_relayout();
554
            match (is_inheritable, can_trigger_layout) {
106
                (true, true) => CssPropertyCategory::InheritedLayout,
6
                (true, false) => CssPropertyCategory::InheritedPaint,
325
                (false, true) => CssPropertyCategory::Layout,
117
                (false, false) => CssPropertyCategory::Paint,
            }
        }
561
    }
    /// Returns whether this property can trigger a re-layout (important for incremental layout and
    /// caching layouted DOMs).
5018
    #[must_use] pub const fn can_trigger_relayout(&self) -> bool {
        use self::CssPropertyType::{Animation, AnimationIn, AnimationOut, TextColor, Cursor, BackgroundContent, BackgroundPosition, BackgroundSize, BackgroundRepeat, BorderTopLeftRadius, BorderTopRightRadius, BorderBottomLeftRadius, BorderBottomRightRadius, BorderTopColor, BorderRightColor, BorderLeftColor, BorderBottomColor, BorderTopStyle, BorderRightStyle, BorderLeftStyle, BorderBottomStyle, ColumnRuleColor, ColumnRuleStyle, BoxShadowLeft, BoxShadowRight, BoxShadowTop, BoxShadowBottom, BoxDecorationBreak, ScrollbarTrack, ScrollbarThumb, ScrollbarButton, ScrollbarCorner, ScrollbarResizer, Opacity, Transform, TransformOrigin, PerspectiveOrigin, BackfaceVisibility, MixBlendMode, Filter, BackdropFilter, TextShadow, Clip};
        // Since the border can be larger than the content,
        // in which case the content needs to be re-layouted, assume true for Border
        // FontFamily, FontSize, LetterSpacing and LineHeight can affect
        // the text layout and therefore the screen layout
2957
        !matches!(
5018
            self,
            TextColor
            | Cursor
            | BackgroundContent
            | BackgroundPosition
            | BackgroundSize
            | BackgroundRepeat
            | BorderTopLeftRadius
            | BorderTopRightRadius
            | BorderBottomLeftRadius
            | BorderBottomRightRadius
            | BorderTopColor
            | BorderRightColor
            | BorderLeftColor
            | BorderBottomColor
            | BorderTopStyle
            | BorderRightStyle
            | BorderLeftStyle
            | BorderBottomStyle
            | ColumnRuleColor
            | ColumnRuleStyle
            | BoxShadowLeft
            | BoxShadowRight
            | BoxShadowTop
            | BoxShadowBottom
            | BoxDecorationBreak
            | ScrollbarTrack
            | ScrollbarThumb
            | ScrollbarButton
            | ScrollbarCorner
            | ScrollbarResizer
            | Opacity
            | Transform
            | TransformOrigin
            | PerspectiveOrigin
            | BackfaceVisibility
            | MixBlendMode
            | Filter
            | BackdropFilter
            | TextShadow
            | Clip
            // The animation properties are META: they DESCRIBE motion, they
            // are not motion. Changing them must never charge a layout pass
            // (the transition driver reads them at the diff seam).
            | Animation
            | AnimationIn
            | AnimationOut
        )
5018
    }
    /// Returns whether the property is a GPU property (currently only opacity and transforms)
1745
    #[must_use] pub const fn is_gpu_only_property(&self) -> bool {
1745
        match self {
            Self::Opacity |
35
            Self::Transform /* | CssPropertyType::Color */ => true,
1710
            _ => false
        }
1745
    }
    /// Context-dependent relayout scope for a CSS property change.
    ///
    /// This is a more granular replacement for `can_trigger_relayout()`.
    /// Instead of returning a flat bool, it classifies the property change
    /// into one of four impact levels (see `RelayoutScope`).
    ///
    /// Inspired by Taffy's binary dirty flag, extended with CSS-specific
    /// knowledge: font/text changes only affect IFC, sizing changes don't
    /// require full subtree relayout, and paint-only changes skip layout entirely.
    ///
    /// `node_is_ifc_member`: whether this node participates in an IFC
    /// (has inline formatting context membership). When true, font/text
    /// property changes trigger IFC-only relayout instead of being ignored.
5950
    #[must_use] pub const fn relayout_scope(&self, node_is_ifc_member: bool) -> RelayoutScope {
        use CssPropertyType::{Animation, AnimationIn, AnimationOut, TextColor, Cursor, BackgroundContent, BackgroundPosition, BackgroundSize, BackgroundRepeat, BorderTopColor, BorderRightColor, BorderLeftColor, BorderBottomColor, BorderTopStyle, BorderRightStyle, BorderLeftStyle, BorderBottomStyle, BorderTopLeftRadius, BorderTopRightRadius, BorderBottomLeftRadius, BorderBottomRightRadius, ColumnRuleColor, ColumnRuleStyle, BoxShadowLeft, BoxShadowRight, BoxShadowTop, BoxShadowBottom, BoxDecorationBreak, ScrollbarTrack, ScrollbarThumb, ScrollbarButton, ScrollbarCorner, ScrollbarResizer, Opacity, Transform, TransformOrigin, PerspectiveOrigin, BackfaceVisibility, MixBlendMode, Filter, BackdropFilter, TextShadow, SelectionBackgroundColor, SelectionColor, SelectionRadius, CaretColor, CaretAnimationDuration, CaretWidth, TextOverflow, ObjectFit, ObjectPosition, Clip, FontFamily, FontSize, FontWeight, FontStyle, LetterSpacing, WordSpacing, LineHeight, TextAlign, TextJustify, TextIndent, WhiteSpace, TabSize, Hyphens, WordBreak, OverflowWrap, LineBreak, TextAlignLast, TextOrientation, HyphenationLanguage, TextCombineUpright, TextDecoration, HangingPunctuation, InitialLetter, LineClamp, Direction, VerticalAlign, UnicodeBidi, TextBoxTrim, TextBoxEdge, DominantBaseline, AlignmentBaseline, BaselineSource, LineFitEdge, InitialLetterAlign, InitialLetterWrap, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, PaddingTop, PaddingRight, PaddingBottom, PaddingLeft, PaddingInlineStart, PaddingInlineEnd, BorderTopWidth, BorderRightWidth, BorderBottomWidth, BorderLeftWidth, BoxSizing, ScrollbarWidth, ScrollbarVisibility, ScrollbarGutter, OverflowClipMargin};
5950
        match self {
            // Pure paint — never triggers relayout
            TextColor
            | Cursor
            | BackgroundContent
            | BackgroundPosition
            | BackgroundSize
            | BackgroundRepeat
            | BorderTopColor
            | BorderRightColor
            | BorderLeftColor
            | BorderBottomColor
            | BorderTopStyle
            | BorderRightStyle
            | BorderLeftStyle
            | BorderBottomStyle
            | BorderTopLeftRadius
            | BorderTopRightRadius
            | BorderBottomLeftRadius
            | BorderBottomRightRadius
            | ColumnRuleColor
            | ColumnRuleStyle
            | BoxShadowLeft
            | BoxShadowRight
            | BoxShadowTop
            | BoxShadowBottom
            | BoxDecorationBreak
            | ScrollbarTrack
            | ScrollbarThumb
            | ScrollbarButton
            | ScrollbarCorner
            | ScrollbarResizer
            | Opacity
            | Transform
            | TransformOrigin
            | PerspectiveOrigin
            | BackfaceVisibility
            | MixBlendMode
            | Filter
            | BackdropFilter
            | TextShadow
            | SelectionBackgroundColor
            | SelectionColor
            | SelectionRadius
            | CaretColor
            | CaretAnimationDuration
            | CaretWidth
            | TextOverflow
            | ObjectFit
            | ObjectPosition
            | Clip
            // Meta-properties describing animations — never layout by
            // themselves (see can_trigger_relayout).
            | Animation
            | AnimationIn
2102
            | AnimationOut => RelayoutScope::None,
            // Font/text properties — IFC-only if inside inline context,
            // otherwise no layout impact (block with only block children
            // inherits but doesn't directly reflow).
            FontFamily | FontSize | FontWeight | FontStyle | LetterSpacing | WordSpacing
            | LineHeight | TextAlign | TextJustify | TextIndent | WhiteSpace | TabSize
            | Hyphens | WordBreak | OverflowWrap | LineBreak | TextAlignLast | TextOrientation
            | HyphenationLanguage | TextCombineUpright | TextDecoration | HangingPunctuation
            | InitialLetter | LineClamp | Direction | VerticalAlign | UnicodeBidi | TextBoxTrim
            | TextBoxEdge | DominantBaseline | AlignmentBaseline | BaselineSource
            | LineFitEdge | InitialLetterAlign | InitialLetterWrap => {
776
                if node_is_ifc_member {
490
                    RelayoutScope::IfcOnly
                } else {
                    // Block container with only block children: font properties
                    // are inherited but don't affect this node's own sizing.
                    // Children pick up the change via inheritance and get their
                    // own dirty flags.
286
                    RelayoutScope::None
                }
            }
            // Sizing properties — only this node's size changes.
            // Parent may reposition subsequent siblings but doesn't need
            // full recursive relayout of unaffected subtrees.
            Width | Height | MinWidth | MinHeight | MaxWidth | MaxHeight | PaddingTop
            | PaddingRight | PaddingBottom | PaddingLeft | PaddingInlineStart
            | PaddingInlineEnd | BorderTopWidth | BorderRightWidth | BorderBottomWidth
            | BorderLeftWidth | BoxSizing | ScrollbarWidth | ScrollbarVisibility
1504
            | ScrollbarGutter | OverflowClipMargin => RelayoutScope::SizingOnly,
            // Everything else: display, position, float, margin, flex-*,
            // grid-*, overflow, writing-mode, etc. — full relayout.
1568
            _ => RelayoutScope::Full,
        }
5950
    }
}
// -- PARSING --
/// Master error type that aggregates all possible CSS parsing errors.
#[derive(Clone, PartialEq)]
pub enum CssParsingError<'a> {
    // Shorthand properties
    Border(CssBorderParseError<'a>),
    BorderRadius(CssBorderRadiusParseError<'a>),
    Padding(LayoutPaddingParseError<'a>),
    Margin(LayoutMarginParseError<'a>),
    Overflow(InvalidValueErr<'a>),
    BoxShadow(CssShadowParseError<'a>),
    // Individual properties
    Color(CssColorParseError<'a>),
    PixelValue(CssPixelValueParseError<'a>),
    Percentage(PercentageParseError),
    FontFamily(CssStyleFontFamilyParseError<'a>),
    InvalidValue(InvalidValueErr<'a>),
    FlexGrow(FlexGrowParseError<'a>),
    FlexShrink(FlexShrinkParseError<'a>),
    Background(CssBackgroundParseError<'a>),
    BackgroundPosition(CssBackgroundPositionParseError<'a>),
    Opacity(OpacityParseError<'a>),
    Visibility(StyleVisibilityParseError<'a>),
    LayoutScrollbarWidth(LayoutScrollbarWidthParseError<'a>),
    StyleScrollbarColor(StyleScrollbarColorParseError<'a>),
    ScrollbarVisibilityMode(ScrollbarVisibilityModeParseError<'a>),
    ScrollbarFadeDelay(ScrollbarFadeDelayParseError<'a>),
    ScrollbarFadeDuration(ScrollbarFadeDurationParseError<'a>),
    Transform(CssStyleTransformParseError<'a>),
    TransformOrigin(CssStyleTransformOriginParseError<'a>),
    PerspectiveOrigin(CssStylePerspectiveOriginParseError<'a>),
    Filter(CssStyleFilterParseError<'a>),
    // Text/Style properties
    TextColor(StyleTextColorParseError<'a>),
    FontSize(CssStyleFontSizeParseError<'a>),
    FontWeight(CssFontWeightParseError<'a>),
    FontStyle(CssFontStyleParseError<'a>),
    TextAlign(StyleTextAlignParseError<'a>),
    TextJustify(TextJustifyParseError<'a>),
    VerticalAlign(StyleVerticalAlignParseError<'a>),
    LetterSpacing(StyleLetterSpacingParseError<'a>),
    TextIndent(StyleTextIndentParseError<'a>),
    InitialLetter(StyleInitialLetterParseError<'a>),
    LineClamp(StyleLineClampParseError<'a>),
    HangingPunctuation(StyleHangingPunctuationParseError<'a>),
    TextCombineUpright(StyleTextCombineUprightParseError<'a>),
    UnicodeBidi(StyleUnicodeBidiParseError<'a>),
    TextBoxTrim(StyleTextBoxTrimParseError<'a>),
    TextBoxEdge(StyleTextBoxEdgeParseError<'a>),
    DominantBaseline(StyleDominantBaselineParseError<'a>),
    AlignmentBaseline(StyleAlignmentBaselineParseError<'a>),
    BaselineSource(StyleBaselineSourceParseError<'a>),
    LineFitEdge(StyleLineFitEdgeParseError<'a>),
    InitialLetterAlign(StyleInitialLetterAlignParseError<'a>),
    InitialLetterWrap(StyleInitialLetterWrapParseError<'a>),
    ScrollbarGutter(StyleScrollbarGutterParseError<'a>),
    OverflowClipMargin(StyleOverflowClipMarginParseError<'a>),
    Clip(StyleClipRectParseError<'a>),
    ExclusionMargin(StyleExclusionMarginParseError),
    HyphenationLanguage(StyleHyphenationLanguageParseError),
    LineHeight(StyleLineHeightParseError),
    WordSpacing(StyleWordSpacingParseError<'a>),
    TabSize(StyleTabSizeParseError<'a>),
    WhiteSpace(StyleWhiteSpaceParseError<'a>),
    Hyphens(StyleHyphensParseError<'a>),
    WordBreak(StyleWordBreakParseError<'a>),
    OverflowWrap(StyleOverflowWrapParseError<'a>),
    LineBreak(StyleLineBreakParseError<'a>),
    TextOverflow(StyleTextOverflowParseError<'a>),
    ObjectFit(StyleObjectFitParseError<'a>),
    ObjectPosition(StyleObjectPositionParseError<'a>),
    AspectRatio(StyleAspectRatioParseError<'a>),
    TextOrientation(StyleTextOrientationParseError<'a>),
    TextAlignLast(StyleTextAlignLastParseError<'a>),
    TextTransform(StyleTextTransformParseError<'a>),
    Direction(StyleDirectionParseError<'a>),
    UserSelect(StyleUserSelectParseError<'a>),
    TextDecoration(StyleTextDecorationParseError<'a>),
    Cursor(CursorParseError<'a>),
    CaretColor(CssColorParseError<'a>),
    CaretAnimationDuration(DurationParseError<'a>),
    Animation(crate::props::basic::animation::StyleAnimationParseError<'a>),
    CaretWidth(CssPixelValueParseError<'a>),
    SelectionBackgroundColor(CssColorParseError<'a>),
    SelectionColor(CssColorParseError<'a>),
    SelectionRadius(CssPixelValueParseError<'a>),
    // Layout basic properties
    LayoutDisplay(LayoutDisplayParseError<'a>),
    LayoutFloat(LayoutFloatParseError<'a>),
    LayoutBoxSizing(LayoutBoxSizingParseError<'a>),
    // Layout dimensions
    LayoutWidth(LayoutWidthParseError<'a>),
    LayoutHeight(LayoutHeightParseError<'a>),
    LayoutMinWidth(LayoutMinWidthParseError<'a>),
    LayoutMinHeight(LayoutMinHeightParseError<'a>),
    LayoutMaxWidth(LayoutMaxWidthParseError<'a>),
    LayoutMaxHeight(LayoutMaxHeightParseError<'a>),
    // Layout position
    LayoutPosition(LayoutPositionParseError<'a>),
    LayoutTop(LayoutTopParseError<'a>),
    LayoutRight(LayoutRightParseError<'a>),
    LayoutLeft(LayoutLeftParseError<'a>),
    LayoutInsetBottom(LayoutInsetBottomParseError<'a>),
    LayoutZIndex(LayoutZIndexParseError<'a>),
    // Layout flex
    FlexWrap(FlexWrapParseError<'a>),
    FlexDirection(FlexDirectionParseError<'a>),
    FlexBasis(FlexBasisParseError<'a>),
    JustifyContent(JustifyContentParseError<'a>),
    AlignItems(AlignItemsParseError<'a>),
    AlignContent(AlignContentParseError<'a>),
    // Layout grid
    Grid(GridParseError<'a>),
    GridAutoFlow(GridAutoFlowParseError<'a>),
    JustifySelf(JustifySelfParseError<'a>),
    JustifyItems(JustifyItemsParseError<'a>),
    AlignSelf(AlignSelfParseError<'a>),
    // Layout wrapping
    LayoutWritingMode(LayoutWritingModeParseError<'a>),
    LayoutClear(LayoutClearParseError<'a>),
    // Layout overflow
    LayoutOverflow(LayoutOverflowParseError<'a>),
    // Border radius individual corners
    BorderTopLeftRadius(StyleBorderTopLeftRadiusParseError<'a>),
    BorderTopRightRadius(StyleBorderTopRightRadiusParseError<'a>),
    BorderBottomLeftRadius(StyleBorderBottomLeftRadiusParseError<'a>),
    BorderBottomRightRadius(StyleBorderBottomRightRadiusParseError<'a>),
    // Border style
    BorderStyle(CssBorderStyleParseError<'a>),
    // Effects
    BackfaceVisibility(CssBackfaceVisibilityParseError<'a>),
    MixBlendMode(MixBlendModeParseError<'a>),
    // Fragmentation
    PageBreak(PageBreakParseError<'a>),
    BreakInside(BreakInsideParseError<'a>),
    Widows(WidowsParseError<'a>),
    Orphans(OrphansParseError<'a>),
    BoxDecorationBreak(BoxDecorationBreakParseError<'a>),
    // Columns
    ColumnCount(ColumnCountParseError<'a>),
    ColumnWidth(ColumnWidthParseError<'a>),
    ColumnSpan(ColumnSpanParseError<'a>),
    ColumnFill(ColumnFillParseError<'a>),
    ColumnRuleWidth(ColumnRuleWidthParseError<'a>),
    ColumnRuleStyle(ColumnRuleStyleParseError<'a>),
    ColumnRuleColor(ColumnRuleColorParseError<'a>),
    // Flow & Shape
    FlowInto(FlowIntoParseError<'a>),
    FlowFrom(FlowFromParseError<'a>),
    GenericParseError,
    // Content
    Content, // Simplified errors for now
    Counter,
    ListStyleType(StyleListStyleTypeParseError<'a>),
    ListStylePosition(StyleListStylePositionParseError<'a>),
    StringSet,
}
/// Owned version of `CssParsingError`.
#[derive(Debug, Clone, PartialEq)]
#[repr(C, u8)]
pub enum CssParsingErrorOwned {
    // Shorthand properties
    Border(CssBorderParseErrorOwned),
    BorderRadius(CssStyleBorderRadiusParseErrorOwned),
    Padding(LayoutPaddingParseErrorOwned),
    Margin(LayoutMarginParseErrorOwned),
    Overflow(InvalidValueErrOwned),
    BoxShadow(CssShadowParseErrorOwned),
    // Individual properties
    Color(CssColorParseErrorOwned),
    PixelValue(CssPixelValueParseErrorOwned),
    Percentage(PercentageParseError),
    FontFamily(CssStyleFontFamilyParseErrorOwned),
    InvalidValue(InvalidValueErrOwned),
    FlexGrow(FlexGrowParseErrorOwned),
    FlexShrink(FlexShrinkParseErrorOwned),
    Background(CssBackgroundParseErrorOwned),
    BackgroundPosition(CssBackgroundPositionParseErrorOwned),
    Opacity(OpacityParseErrorOwned),
    Visibility(StyleVisibilityParseErrorOwned),
    LayoutScrollbarWidth(LayoutScrollbarWidthParseErrorOwned),
    StyleScrollbarColor(StyleScrollbarColorParseErrorOwned),
    ScrollbarVisibilityMode(ScrollbarVisibilityModeParseErrorOwned),
    ScrollbarFadeDelay(ScrollbarFadeDelayParseErrorOwned),
    ScrollbarFadeDuration(ScrollbarFadeDurationParseErrorOwned),
    Transform(CssStyleTransformParseErrorOwned),
    TransformOrigin(CssStyleTransformOriginParseErrorOwned),
    PerspectiveOrigin(CssStylePerspectiveOriginParseErrorOwned),
    Filter(CssStyleFilterParseErrorOwned),
    // Text/Style properties
    TextColor(StyleTextColorParseErrorOwned),
    FontSize(CssStyleFontSizeParseErrorOwned),
    FontWeight(CssFontWeightParseErrorOwned),
    FontStyle(CssFontStyleParseErrorOwned),
    TextAlign(StyleTextAlignParseErrorOwned),
    TextJustify(TextJustifyParseErrorOwned),
    VerticalAlign(StyleVerticalAlignParseErrorOwned),
    LetterSpacing(StyleLetterSpacingParseErrorOwned),
    TextIndent(StyleTextIndentParseErrorOwned),
    InitialLetter(StyleInitialLetterParseErrorOwned),
    LineClamp(StyleLineClampParseErrorOwned),
    HangingPunctuation(StyleHangingPunctuationParseErrorOwned),
    TextCombineUpright(StyleTextCombineUprightParseErrorOwned),
    UnicodeBidi(StyleUnicodeBidiParseErrorOwned),
    TextBoxTrim(StyleTextBoxTrimParseErrorOwned),
    TextBoxEdge(StyleTextBoxEdgeParseErrorOwned),
    DominantBaseline(StyleDominantBaselineParseErrorOwned),
    AlignmentBaseline(StyleAlignmentBaselineParseErrorOwned),
    BaselineSource(StyleBaselineSourceParseErrorOwned),
    LineFitEdge(StyleLineFitEdgeParseErrorOwned),
    InitialLetterAlign(StyleInitialLetterAlignParseErrorOwned),
    InitialLetterWrap(StyleInitialLetterWrapParseErrorOwned),
    ScrollbarGutter(StyleScrollbarGutterParseErrorOwned),
    OverflowClipMargin(StyleOverflowClipMarginParseErrorOwned),
    Clip(StyleClipRectParseErrorOwned),
    ExclusionMargin(StyleExclusionMarginParseErrorOwned),
    HyphenationLanguage(StyleHyphenationLanguageParseErrorOwned),
    LineHeight(StyleLineHeightParseError),
    WordSpacing(StyleWordSpacingParseErrorOwned),
    TabSize(StyleTabSizeParseErrorOwned),
    WhiteSpace(StyleWhiteSpaceParseErrorOwned),
    Hyphens(StyleHyphensParseErrorOwned),
    WordBreak(StyleWordBreakParseErrorOwned),
    OverflowWrap(StyleOverflowWrapParseErrorOwned),
    LineBreak(StyleLineBreakParseErrorOwned),
    TextOverflow(StyleTextOverflowParseErrorOwned),
    ObjectFit(StyleObjectFitParseErrorOwned),
    ObjectPosition(StyleObjectPositionParseErrorOwned),
    AspectRatio(StyleAspectRatioParseErrorOwned),
    TextOrientation(StyleTextOrientationParseErrorOwned),
    TextAlignLast(StyleTextAlignLastParseErrorOwned),
    TextTransform(StyleTextTransformParseErrorOwned),
    Direction(StyleDirectionParseErrorOwned),
    UserSelect(StyleUserSelectParseErrorOwned),
    TextDecoration(StyleTextDecorationParseErrorOwned),
    Cursor(CursorParseErrorOwned),
    CaretColor(CssColorParseErrorOwned),
    CaretAnimationDuration(DurationParseErrorOwned),
    Animation(crate::props::basic::animation::StyleAnimationParseErrorOwned),
    CaretWidth(CssPixelValueParseErrorOwned),
    SelectionBackgroundColor(CssColorParseErrorOwned),
    SelectionColor(CssColorParseErrorOwned),
    SelectionRadius(CssPixelValueParseErrorOwned),
    // Layout basic properties
    LayoutDisplay(LayoutDisplayParseErrorOwned),
    LayoutFloat(LayoutFloatParseErrorOwned),
    LayoutBoxSizing(LayoutBoxSizingParseErrorOwned),
    // Layout dimensions
    LayoutWidth(LayoutWidthParseErrorOwned),
    LayoutHeight(LayoutHeightParseErrorOwned),
    LayoutMinWidth(LayoutMinWidthParseErrorOwned),
    LayoutMinHeight(LayoutMinHeightParseErrorOwned),
    LayoutMaxWidth(LayoutMaxWidthParseErrorOwned),
    LayoutMaxHeight(LayoutMaxHeightParseErrorOwned),
    // Layout position
    LayoutPosition(LayoutPositionParseErrorOwned),
    LayoutTop(LayoutTopParseErrorOwned),
    LayoutRight(LayoutRightParseErrorOwned),
    LayoutLeft(LayoutLeftParseErrorOwned),
    LayoutInsetBottom(LayoutInsetBottomParseErrorOwned),
    LayoutZIndex(LayoutZIndexParseErrorOwned),
    // Layout flex
    FlexWrap(FlexWrapParseErrorOwned),
    FlexDirection(FlexDirectionParseErrorOwned),
    FlexBasis(FlexBasisParseErrorOwned),
    JustifyContent(JustifyContentParseErrorOwned),
    AlignItems(AlignItemsParseErrorOwned),
    AlignContent(AlignContentParseErrorOwned),
    // Layout grid
    Grid(GridParseErrorOwned),
    GridAutoFlow(GridAutoFlowParseErrorOwned),
    JustifySelf(JustifySelfParseErrorOwned),
    JustifyItems(JustifyItemsParseErrorOwned),
    AlignSelf(AlignSelfParseErrorOwned),
    // Layout wrapping
    LayoutWritingMode(LayoutWritingModeParseErrorOwned),
    LayoutClear(LayoutClearParseErrorOwned),
    // Layout overflow
    LayoutOverflow(LayoutOverflowParseErrorOwned),
    // Border radius individual corners
    BorderTopLeftRadius(StyleBorderTopLeftRadiusParseErrorOwned),
    BorderTopRightRadius(StyleBorderTopRightRadiusParseErrorOwned),
    BorderBottomLeftRadius(StyleBorderBottomLeftRadiusParseErrorOwned),
    BorderBottomRightRadius(StyleBorderBottomRightRadiusParseErrorOwned),
    // Border style
    BorderStyle(CssBorderStyleParseErrorOwned),
    // Effects
    BackfaceVisibility(CssBackfaceVisibilityParseErrorOwned),
    MixBlendMode(MixBlendModeParseErrorOwned),
    // Fragmentation
    PageBreak(PageBreakParseErrorOwned),
    BreakInside(BreakInsideParseErrorOwned),
    Widows(WidowsParseErrorOwned),
    Orphans(OrphansParseErrorOwned),
    BoxDecorationBreak(BoxDecorationBreakParseErrorOwned),
    // Columns
    ColumnCount(ColumnCountParseErrorOwned),
    ColumnWidth(ColumnWidthParseErrorOwned),
    ColumnSpan(ColumnSpanParseErrorOwned),
    ColumnFill(ColumnFillParseErrorOwned),
    ColumnRuleWidth(ColumnRuleWidthParseErrorOwned),
    ColumnRuleStyle(ColumnRuleStyleParseErrorOwned),
    ColumnRuleColor(ColumnRuleColorParseErrorOwned),
    // Flow & Shape
    FlowInto(FlowIntoParseErrorOwned),
    FlowFrom(FlowFromParseErrorOwned),
    GenericParseError,
    // Content
    Content,
    Counter,
    ListStyleType(StyleListStyleTypeParseErrorOwned),
    ListStylePosition(StyleListStylePositionParseErrorOwned),
    StringSet,
}
// -- PARSING ERROR IMPLEMENTATIONS --
impl_debug_as_display!(CssParsingError<'a>);
impl_display! { CssParsingError<'a>, {
    CaretColor(e) => format!("Invalid caret-color: {}", e),
    CaretAnimationDuration(e) => format!("Invalid caret-animation-duration: {}", e),
    Animation(e) => format!("Invalid animation: {}", e),
    CaretWidth(e) => format!("Invalid -azul-caret-width: {}", e),
    SelectionBackgroundColor(e) => format!("Invalid -azul-selection-background-color: {}", e),
    SelectionColor(e) => format!("Invalid -azul-selection-color: {}", e),
    SelectionRadius(e) => format!("Invalid -azul-selection-radius: {}", e),
    Border(e) => format!("Invalid border property: {}", e),
    BorderRadius(e) => format!("Invalid border-radius: {}", e),
    Padding(e) => format!("Invalid padding property: {}", e),
    Margin(e) => format!("Invalid margin property: {}", e),
    Overflow(e) => format!("Invalid overflow property: \"{}\"", e.0),
    BoxShadow(e) => format!("Invalid shadow property: {}", e),
    Color(e) => format!("Invalid color value: {}", e),
    PixelValue(e) => format!("Invalid pixel value: {}", e),
    Percentage(e) => format!("Invalid percentage value: {}", e),
    FontFamily(e) => format!("Invalid font-family value: {}", e),
    InvalidValue(e) => format!("Invalid value: \"{}\"", e.0),
    FlexGrow(e) => format!("Invalid flex-grow value: {}", e),
    FlexShrink(e) => format!("Invalid flex-shrink value: {}", e),
    Background(e) => format!("Invalid background property: {}", e),
    BackgroundPosition(e) => format!("Invalid background-position: {}", e),
    Opacity(e) => format!("Invalid opacity value: {}", e),
    Visibility(e) => format!("Invalid visibility value: {}", e),
    LayoutScrollbarWidth(e) => format!("Invalid scrollbar-width: {}", e),
    StyleScrollbarColor(e) => format!("Invalid scrollbar-color: {}", e),
    ScrollbarVisibilityMode(e) => format!("Invalid scrollbar-visibility: {}", e),
    ScrollbarFadeDelay(e) => format!("Invalid scrollbar-fade-delay: {}", e),
    ScrollbarFadeDuration(e) => format!("Invalid scrollbar-fade-duration: {}", e),
    Transform(e) => format!("Invalid transform property: {}", e),
    TransformOrigin(e) => format!("Invalid transform-origin: {}", e),
    PerspectiveOrigin(e) => format!("Invalid perspective-origin: {}", e),
    Filter(e) => format!("Invalid filter property: {}", e),
    LayoutWidth(e) => format!("Invalid width value: {}", e),
    LayoutHeight(e) => format!("Invalid height value: {}", e),
    LayoutMinWidth(e) => format!("Invalid min-width value: {}", e),
    LayoutMinHeight(e) => format!("Invalid min-height value: {}", e),
    LayoutMaxWidth(e) => format!("Invalid max-width value: {}", e),
    LayoutMaxHeight(e) => format!("Invalid max-height value: {}", e),
    LayoutPosition(e) => format!("Invalid position value: {}", e),
    LayoutTop(e) => format!("Invalid top value: {}", e),
    LayoutRight(e) => format!("Invalid right value: {}", e),
    LayoutLeft(e) => format!("Invalid left value: {}", e),
    LayoutInsetBottom(e) => format!("Invalid bottom value: {}", e),
    LayoutZIndex(e) => format!("Invalid z-index value: {}", e),
    FlexWrap(e) => format!("Invalid flex-wrap value: {}", e),
    FlexDirection(e) => format!("Invalid flex-direction value: {}", e),
    FlexBasis(e) => format!("Invalid flex-basis value: {}", e),
    JustifyContent(e) => format!("Invalid justify-content value: {}", e),
    AlignItems(e) => format!("Invalid align-items value: {}", e),
    AlignContent(e) => format!("Invalid align-content value: {}", e),
    GridAutoFlow(e) => format!("Invalid grid-auto-flow value: {}", e),
    JustifySelf(e) => format!("Invalid justify-self value: {}", e),
    JustifyItems(e) => format!("Invalid justify-items value: {}", e),
    AlignSelf(e) => format!("Invalid align-self value: {}", e),
    Grid(e) => format!("Invalid grid value: {}", e),
    LayoutWritingMode(e) => format!("Invalid writing-mode value: {}", e),
    LayoutClear(e) => format!("Invalid clear value: {}", e),
    LayoutOverflow(e) => format!("Invalid overflow value: {}", e),
    BorderTopLeftRadius(e) => format!("Invalid border-top-left-radius: {}", e),
    BorderTopRightRadius(e) => format!("Invalid border-top-right-radius: {}", e),
    BorderBottomLeftRadius(e) => format!("Invalid border-bottom-left-radius: {}", e),
    BorderBottomRightRadius(e) => format!("Invalid border-bottom-right-radius: {}", e),
    BorderStyle(e) => format!("Invalid border style: {}", e),
    BackfaceVisibility(e) => format!("Invalid backface-visibility: {}", e),
    MixBlendMode(e) => format!("Invalid mix-blend-mode: {}", e),
    TextColor(e) => format!("Invalid text color: {}", e),
    FontSize(e) => format!("Invalid font-size: {}", e),
    FontWeight(e) => format!("Invalid font-weight: {}", e),
    FontStyle(e) => format!("Invalid font-style: {}", e),
    TextAlign(e) => format!("Invalid text-align: {}", e),
    TextJustify(e) => format!("Invalid text-justify: {}", e),
    VerticalAlign(e) => format!("Invalid vertical-align: {}", e),
    LetterSpacing(e) => format!("Invalid letter-spacing: {}", e),
    TextIndent(e) => format!("Invalid text-indent: {}", e),
    InitialLetter(e) => format!("Invalid initial-letter: {}", e),
    LineClamp(e) => format!("Invalid line-clamp: {}", e),
    HangingPunctuation(e) => format!("Invalid hanging-punctuation: {}", e),
    TextCombineUpright(e) => format!("Invalid text-combine-upright: {}", e),
    UnicodeBidi(e) => format!("Invalid unicode-bidi: {}", e),
    TextBoxTrim(e) => format!("Invalid text-box-trim: {}", e),
    TextBoxEdge(e) => format!("Invalid text-box-edge: {}", e),
    DominantBaseline(e) => format!("Invalid dominant-baseline: {}", e),
    AlignmentBaseline(e) => format!("Invalid alignment-baseline: {}", e),
    BaselineSource(e) => format!("Invalid baseline-source: {}", e),
    LineFitEdge(e) => format!("Invalid line-fit-edge: {}", e),
    InitialLetterAlign(e) => format!("Invalid initial-letter-align: {}", e),
    InitialLetterWrap(e) => format!("Invalid initial-letter-wrap: {}", e),
    ScrollbarGutter(e) => format!("Invalid scrollbar-gutter: {}", e),
    OverflowClipMargin(e) => format!("Invalid overflow-clip-margin: {}", e),
    Clip(e) => format!("Invalid clip: {}", e),
    ExclusionMargin(e) => format!("Invalid -azul-exclusion-margin: {}", e),
    HyphenationLanguage(e) => format!("Invalid -azul-hyphenation-language: {}", e),
    LineHeight(e) => format!("Invalid line-height: {}", e),
    WordSpacing(e) => format!("Invalid word-spacing: {}", e),
    TabSize(e) => format!("Invalid tab-size: {}", e),
    WhiteSpace(e) => format!("Invalid white-space: {}", e),
    Hyphens(e) => format!("Invalid hyphens: {}", e),
    WordBreak(e) => format!("Invalid word-break: {}", e),
    OverflowWrap(e) => format!("Invalid overflow-wrap: {}", e),
    LineBreak(e) => format!("Invalid line-break: {}", e),
    TextOverflow(e) => format!("Invalid text-overflow: {}", e),
    ObjectFit(e) => format!("Invalid object-fit: {}", e),
    ObjectPosition(e) => format!("Invalid object-position: {}", e),
    AspectRatio(e) => format!("Invalid aspect-ratio: {}", e),
    TextOrientation(e) => format!("Invalid text-orientation: {}", e),
    TextAlignLast(e) => format!("Invalid text-align-last: {}", e),
    TextTransform(e) => format!("Invalid text-transform: {}", e),
    Direction(e) => format!("Invalid direction: {}", e),
    UserSelect(e) => format!("Invalid user-select: {}", e),
    TextDecoration(e) => format!("Invalid text-decoration: {}", e),
    Cursor(e) => format!("Invalid cursor: {}", e),
    LayoutDisplay(e) => format!("Invalid display: {}", e),
    LayoutFloat(e) => format!("Invalid float: {}", e),
    LayoutBoxSizing(e) => format!("Invalid box-sizing: {}", e),
    PageBreak(e) => format!("Invalid break property: {}", e),
    BreakInside(e) => format!("Invalid break-inside property: {}", e),
    Widows(e) => format!("Invalid widows property: {}", e),
    Orphans(e) => format!("Invalid orphans property: {}", e),
    BoxDecorationBreak(e) => format!("Invalid box-decoration-break property: {}", e),
    ColumnCount(e) => format!("Invalid column-count: {}", e),
    ColumnWidth(e) => format!("Invalid column-width: {}", e),
    ColumnSpan(e) => format!("Invalid column-span: {}", e),
    ColumnFill(e) => format!("Invalid column-fill: {}", e),
    ColumnRuleWidth(e) => format!("Invalid column-rule-width: {}", e),
    ColumnRuleStyle(e) => format!("Invalid column-rule-style: {}", e),
    ColumnRuleColor(e) => format!("Invalid column-rule-color: {}", e),
    FlowInto(e) => format!("Invalid flow-into: {}", e),
    FlowFrom(e) => format!("Invalid flow-from: {}", e),
    GenericParseError => "Failed to parse value",
    Content => "Failed to parse content property",
    Counter => "Failed to parse counter property",
    ListStyleType(e) => format!("Invalid list-style-type: {}", e),
    ListStylePosition(e) => format!("Invalid list-style-position: {}", e),
    StringSet => "Failed to parse string-set property",
}}
// From impls for CssParsingError
impl_from!(
    DurationParseError<'a>,
    CssParsingError::CaretAnimationDuration
);
impl<'a> From<crate::props::basic::animation::StyleAnimationParseError<'a>>
    for CssParsingError<'a>
{
    fn from(e: crate::props::basic::animation::StyleAnimationParseError<'a>) -> Self {
        CssParsingError::Animation(e)
    }
}
impl_from!(CssBorderParseError<'a>, CssParsingError::Border);
impl_from!(CssBorderRadiusParseError<'a>, CssParsingError::BorderRadius);
impl_from!(LayoutPaddingParseError<'a>, CssParsingError::Padding);
impl_from!(LayoutMarginParseError<'a>, CssParsingError::Margin);
impl_from!(CssShadowParseError<'a>, CssParsingError::BoxShadow);
impl_from!(CssColorParseError<'a>, CssParsingError::Color);
impl_from!(CssPixelValueParseError<'a>, CssParsingError::PixelValue);
impl_from!(
    CssStyleFontFamilyParseError<'a>,
    CssParsingError::FontFamily
);
impl_from!(CssFontWeightParseError<'a>, CssParsingError::FontWeight);
impl_from!(CssFontStyleParseError<'a>, CssParsingError::FontStyle);
impl_from!(
    StyleInitialLetterParseError<'a>,
    CssParsingError::InitialLetter
);
impl_from!(StyleLineClampParseError<'a>, CssParsingError::LineClamp);
impl_from!(
    StyleHangingPunctuationParseError<'a>,
    CssParsingError::HangingPunctuation
);
impl_from!(
    StyleTextCombineUprightParseError<'a>,
    CssParsingError::TextCombineUpright
);
impl_from!(StyleUnicodeBidiParseError<'a>, CssParsingError::UnicodeBidi);
impl_from!(StyleTextBoxTrimParseError<'a>, CssParsingError::TextBoxTrim);
impl_from!(StyleTextBoxEdgeParseError<'a>, CssParsingError::TextBoxEdge);
impl_from!(
    StyleDominantBaselineParseError<'a>,
    CssParsingError::DominantBaseline
);
impl_from!(
    StyleAlignmentBaselineParseError<'a>,
    CssParsingError::AlignmentBaseline
);
impl_from!(
    StyleBaselineSourceParseError<'a>,
    CssParsingError::BaselineSource
);
impl_from!(
    StyleLineFitEdgeParseError<'a>,
    CssParsingError::LineFitEdge
);
impl_from!(
    StyleInitialLetterAlignParseError<'a>,
    CssParsingError::InitialLetterAlign
);
impl_from!(
    StyleInitialLetterWrapParseError<'a>,
    CssParsingError::InitialLetterWrap
);
impl_from!(
    StyleScrollbarGutterParseError<'a>,
    CssParsingError::ScrollbarGutter
);
impl_from!(
    StyleOverflowClipMarginParseError<'a>,
    CssParsingError::OverflowClipMargin
);
impl_from!(StyleClipRectParseError<'a>, CssParsingError::Clip);
// Manual From implementation for StyleExclusionMarginParseError (no lifetime)
#[cfg(feature = "parser")]
impl From<StyleExclusionMarginParseError> for CssParsingError<'_> {
    fn from(e: StyleExclusionMarginParseError) -> Self {
        CssParsingError::ExclusionMargin(e)
    }
}
// Manual From implementation for StyleHyphenationLanguageParseError (no lifetime)
#[cfg(feature = "parser")]
impl From<StyleHyphenationLanguageParseError> for CssParsingError<'_> {
    fn from(e: StyleHyphenationLanguageParseError) -> Self {
        CssParsingError::HyphenationLanguage(e)
    }
}
impl_from!(FlexGrowParseError<'a>, CssParsingError::FlexGrow);
impl_from!(FlexShrinkParseError<'a>, CssParsingError::FlexShrink);
impl_from!(CssBackgroundParseError<'a>, CssParsingError::Background);
impl_from!(
    CssBackgroundPositionParseError<'a>,
    CssParsingError::BackgroundPosition
);
impl_from!(OpacityParseError<'a>, CssParsingError::Opacity);
impl_from!(StyleVisibilityParseError<'a>, CssParsingError::Visibility);
impl_from!(
    LayoutScrollbarWidthParseError<'a>,
    CssParsingError::LayoutScrollbarWidth
);
impl_from!(
    StyleScrollbarColorParseError<'a>,
    CssParsingError::StyleScrollbarColor
);
impl_from!(
    ScrollbarVisibilityModeParseError<'a>,
    CssParsingError::ScrollbarVisibilityMode
);
impl_from!(
    ScrollbarFadeDelayParseError<'a>,
    CssParsingError::ScrollbarFadeDelay
);
impl_from!(
    ScrollbarFadeDurationParseError<'a>,
    CssParsingError::ScrollbarFadeDuration
);
impl_from!(CssStyleTransformParseError<'a>, CssParsingError::Transform);
impl_from!(
    CssStyleTransformOriginParseError<'a>,
    CssParsingError::TransformOrigin
);
impl_from!(
    CssStylePerspectiveOriginParseError<'a>,
    CssParsingError::PerspectiveOrigin
);
impl_from!(CssStyleFilterParseError<'a>, CssParsingError::Filter);
// Layout dimensions
impl_from!(LayoutWidthParseError<'a>, CssParsingError::LayoutWidth);
impl_from!(LayoutHeightParseError<'a>, CssParsingError::LayoutHeight);
impl_from!(
    LayoutMinWidthParseError<'a>,
    CssParsingError::LayoutMinWidth
);
impl_from!(
    LayoutMinHeightParseError<'a>,
    CssParsingError::LayoutMinHeight
);
impl_from!(
    LayoutMaxWidthParseError<'a>,
    CssParsingError::LayoutMaxWidth
);
impl_from!(
    LayoutMaxHeightParseError<'a>,
    CssParsingError::LayoutMaxHeight
);
// Layout position
impl_from!(
    LayoutPositionParseError<'a>,
    CssParsingError::LayoutPosition
);
impl_from!(LayoutTopParseError<'a>, CssParsingError::LayoutTop);
impl_from!(LayoutRightParseError<'a>, CssParsingError::LayoutRight);
impl_from!(LayoutLeftParseError<'a>, CssParsingError::LayoutLeft);
impl_from!(
    LayoutInsetBottomParseError<'a>,
    CssParsingError::LayoutInsetBottom
);
impl_from!(LayoutZIndexParseError<'a>, CssParsingError::LayoutZIndex);
// Layout flex
impl_from!(FlexWrapParseError<'a>, CssParsingError::FlexWrap);
impl_from!(FlexDirectionParseError<'a>, CssParsingError::FlexDirection);
impl_from!(FlexBasisParseError<'a>, CssParsingError::FlexBasis);
impl_from!(
    JustifyContentParseError<'a>,
    CssParsingError::JustifyContent
);
impl_from!(AlignItemsParseError<'a>, CssParsingError::AlignItems);
impl_from!(AlignContentParseError<'a>, CssParsingError::AlignContent);
// Layout grid
impl_from!(GridParseError<'a>, CssParsingError::Grid);
impl_from!(GridAutoFlowParseError<'a>, CssParsingError::GridAutoFlow);
impl_from!(JustifySelfParseError<'a>, CssParsingError::JustifySelf);
impl_from!(JustifyItemsParseError<'a>, CssParsingError::JustifyItems);
// pixel value impl_from already exists earlier; avoid duplicate impl
// impl_from!(CssPixelValueParseError<'a>, CssParsingError::PixelValue);
impl_from!(AlignSelfParseError<'a>, CssParsingError::AlignSelf);
// Layout wrapping
impl_from!(
    LayoutWritingModeParseError<'a>,
    CssParsingError::LayoutWritingMode
);
impl_from!(LayoutClearParseError<'a>, CssParsingError::LayoutClear);
// Layout overflow
impl_from!(
    LayoutOverflowParseError<'a>,
    CssParsingError::LayoutOverflow
);
// Border radius individual corners
impl_from!(
    StyleBorderTopLeftRadiusParseError<'a>,
    CssParsingError::BorderTopLeftRadius
);
impl_from!(
    StyleBorderTopRightRadiusParseError<'a>,
    CssParsingError::BorderTopRightRadius
);
impl_from!(
    StyleBorderBottomLeftRadiusParseError<'a>,
    CssParsingError::BorderBottomLeftRadius
);
impl_from!(
    StyleBorderBottomRightRadiusParseError<'a>,
    CssParsingError::BorderBottomRightRadius
);
// Border style
impl_from!(CssBorderStyleParseError<'a>, CssParsingError::BorderStyle);
// Effects
impl_from!(
    CssBackfaceVisibilityParseError<'a>,
    CssParsingError::BackfaceVisibility
);
impl_from!(MixBlendModeParseError<'a>, CssParsingError::MixBlendMode);
// Text/Style properties
impl_from!(StyleTextColorParseError<'a>, CssParsingError::TextColor);
impl_from!(CssStyleFontSizeParseError<'a>, CssParsingError::FontSize);
impl_from!(StyleTextAlignParseError<'a>, CssParsingError::TextAlign);
impl_from!(TextJustifyParseError<'a>, CssParsingError::TextJustify);
impl_from!(
    StyleLetterSpacingParseError<'a>,
    CssParsingError::LetterSpacing
);
impl_from!(StyleWordSpacingParseError<'a>, CssParsingError::WordSpacing);
impl_from!(StyleTabSizeParseError<'a>, CssParsingError::TabSize);
impl_from!(StyleWhiteSpaceParseError<'a>, CssParsingError::WhiteSpace);
impl_from!(StyleHyphensParseError<'a>, CssParsingError::Hyphens);
impl_from!(StyleWordBreakParseError<'a>, CssParsingError::WordBreak);
impl_from!(
    StyleOverflowWrapParseError<'a>,
    CssParsingError::OverflowWrap
);
impl_from!(StyleLineBreakParseError<'a>, CssParsingError::LineBreak);
impl_from!(StyleTextOverflowParseError<'a>, CssParsingError::TextOverflow);
impl_from!(StyleObjectFitParseError<'a>, CssParsingError::ObjectFit);
impl_from!(
    StyleObjectPositionParseError<'a>,
    CssParsingError::ObjectPosition
);
impl_from!(StyleAspectRatioParseError<'a>, CssParsingError::AspectRatio);
impl_from!(
    StyleTextOrientationParseError<'a>,
    CssParsingError::TextOrientation
);
impl_from!(
    StyleTextAlignLastParseError<'a>,
    CssParsingError::TextAlignLast
);
impl_from!(
    StyleTextTransformParseError<'a>,
    CssParsingError::TextTransform
);
impl_from!(StyleDirectionParseError<'a>, CssParsingError::Direction);
impl_from!(StyleUserSelectParseError<'a>, CssParsingError::UserSelect);
impl_from!(
    StyleTextDecorationParseError<'a>,
    CssParsingError::TextDecoration
);
impl_from!(CursorParseError<'a>, CssParsingError::Cursor);
// Layout basic properties
impl_from!(LayoutDisplayParseError<'a>, CssParsingError::LayoutDisplay);
impl_from!(LayoutFloatParseError<'a>, CssParsingError::LayoutFloat);
impl_from!(
    LayoutBoxSizingParseError<'a>,
    CssParsingError::LayoutBoxSizing
);
// DTP properties
impl_from!(PageBreakParseError<'a>, CssParsingError::PageBreak);
impl_from!(BreakInsideParseError<'a>, CssParsingError::BreakInside);
impl_from!(WidowsParseError<'a>, CssParsingError::Widows);
impl_from!(OrphansParseError<'a>, CssParsingError::Orphans);
impl_from!(
    BoxDecorationBreakParseError<'a>,
    CssParsingError::BoxDecorationBreak
);
impl_from!(ColumnCountParseError<'a>, CssParsingError::ColumnCount);
impl_from!(ColumnWidthParseError<'a>, CssParsingError::ColumnWidth);
impl_from!(ColumnSpanParseError<'a>, CssParsingError::ColumnSpan);
impl_from!(ColumnFillParseError<'a>, CssParsingError::ColumnFill);
impl_from!(
    ColumnRuleWidthParseError<'a>,
    CssParsingError::ColumnRuleWidth
);
impl_from!(
    ColumnRuleStyleParseError<'a>,
    CssParsingError::ColumnRuleStyle
);
impl_from!(
    ColumnRuleColorParseError<'a>,
    CssParsingError::ColumnRuleColor
);
impl_from!(FlowIntoParseError<'a>, CssParsingError::FlowInto);
impl_from!(FlowFromParseError<'a>, CssParsingError::FlowFrom);
impl<'a> From<InvalidValueErr<'a>> for CssParsingError<'a> {
    fn from(e: InvalidValueErr<'a>) -> Self {
        CssParsingError::InvalidValue(e)
    }
}
impl From<PercentageParseError> for CssParsingError<'_> {
    fn from(e: PercentageParseError) -> Self {
        CssParsingError::Percentage(e)
    }
}
impl From<StyleLineHeightParseError> for CssParsingError<'_> {
    fn from(e: StyleLineHeightParseError) -> Self {
        CssParsingError::LineHeight(e)
    }
}
impl<'a> From<StyleTextIndentParseError<'a>> for CssParsingError<'a> {
    fn from(e: StyleTextIndentParseError<'a>) -> Self {
        CssParsingError::TextIndent(e)
    }
}
impl<'a> From<StyleVerticalAlignParseError<'a>> for CssParsingError<'a> {
    fn from(e: StyleVerticalAlignParseError<'a>) -> Self {
        CssParsingError::VerticalAlign(e)
    }
}
impl CssParsingError<'_> {
    #[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
9
    #[must_use] pub fn to_contained(&self) -> CssParsingErrorOwned {
9
        match self {
            CssParsingError::CaretColor(e) => CssParsingErrorOwned::CaretColor(e.to_contained()),
            CssParsingError::CaretWidth(e) => CssParsingErrorOwned::CaretWidth(e.to_contained()),
            CssParsingError::CaretAnimationDuration(e) => {
                CssParsingErrorOwned::CaretAnimationDuration(e.to_contained())
            }
            CssParsingError::Animation(e) => {
                CssParsingErrorOwned::Animation(e.to_contained())
            }
            CssParsingError::SelectionBackgroundColor(e) => {
                CssParsingErrorOwned::SelectionBackgroundColor(e.to_contained())
            }
            CssParsingError::SelectionColor(e) => {
                CssParsingErrorOwned::SelectionColor(e.to_contained())
            }
            CssParsingError::SelectionRadius(e) => {
                CssParsingErrorOwned::SelectionRadius(e.to_contained())
            }
            CssParsingError::Border(e) => CssParsingErrorOwned::Border(e.to_contained().into()),
            CssParsingError::BorderRadius(e) => {
                CssParsingErrorOwned::BorderRadius(e.to_contained().into())
            }
            CssParsingError::Padding(e) => CssParsingErrorOwned::Padding(e.to_contained()),
            CssParsingError::Margin(e) => CssParsingErrorOwned::Margin(e.to_contained()),
            CssParsingError::Overflow(e) => CssParsingErrorOwned::Overflow(e.to_contained()),
            CssParsingError::BoxShadow(e) => CssParsingErrorOwned::BoxShadow(e.to_contained()),
            CssParsingError::Color(e) => CssParsingErrorOwned::Color(e.to_contained()),
            CssParsingError::PixelValue(e) => CssParsingErrorOwned::PixelValue(e.to_contained()),
            CssParsingError::Percentage(e) => CssParsingErrorOwned::Percentage(e.clone()),
            CssParsingError::FontFamily(e) => CssParsingErrorOwned::FontFamily(e.to_contained()),
            CssParsingError::InvalidValue(e) => {
                CssParsingErrorOwned::InvalidValue(e.to_contained())
            }
            CssParsingError::FlexGrow(e) => CssParsingErrorOwned::FlexGrow(e.to_contained()),
            CssParsingError::FlexShrink(e) => CssParsingErrorOwned::FlexShrink(e.to_contained()),
1
            CssParsingError::Background(e) => CssParsingErrorOwned::Background(e.to_contained()),
            CssParsingError::BackgroundPosition(e) => {
                CssParsingErrorOwned::BackgroundPosition(e.to_contained())
            }
            CssParsingError::GridAutoFlow(e) => {
                CssParsingErrorOwned::GridAutoFlow(e.to_contained())
            }
            CssParsingError::JustifySelf(e) => CssParsingErrorOwned::JustifySelf(e.to_contained()),
            CssParsingError::JustifyItems(e) => {
                CssParsingErrorOwned::JustifyItems(e.to_contained())
            }
            CssParsingError::AlignSelf(e) => CssParsingErrorOwned::AlignSelf(e.to_contained()),
1
            CssParsingError::Opacity(e) => CssParsingErrorOwned::Opacity(e.to_contained()),
            CssParsingError::Visibility(e) => CssParsingErrorOwned::Visibility(e.to_contained()),
            CssParsingError::LayoutScrollbarWidth(e) => {
                CssParsingErrorOwned::LayoutScrollbarWidth(e.to_contained())
            }
            CssParsingError::StyleScrollbarColor(e) => {
                CssParsingErrorOwned::StyleScrollbarColor(e.to_contained())
            }
            CssParsingError::ScrollbarVisibilityMode(e) => {
                CssParsingErrorOwned::ScrollbarVisibilityMode(e.to_contained())
            }
            CssParsingError::ScrollbarFadeDelay(e) => {
                CssParsingErrorOwned::ScrollbarFadeDelay(e.to_contained())
            }
            CssParsingError::ScrollbarFadeDuration(e) => {
                CssParsingErrorOwned::ScrollbarFadeDuration(e.to_contained())
            }
1
            CssParsingError::Transform(e) => CssParsingErrorOwned::Transform(e.to_contained()),
            CssParsingError::TransformOrigin(e) => {
                CssParsingErrorOwned::TransformOrigin(e.to_contained())
            }
            CssParsingError::PerspectiveOrigin(e) => {
                CssParsingErrorOwned::PerspectiveOrigin(e.to_contained())
            }
            CssParsingError::Filter(e) => CssParsingErrorOwned::Filter(e.to_contained()),
4
            CssParsingError::LayoutWidth(e) => CssParsingErrorOwned::LayoutWidth(e.to_contained()),
            CssParsingError::LayoutHeight(e) => {
                CssParsingErrorOwned::LayoutHeight(e.to_contained())
            }
            CssParsingError::LayoutMinWidth(e) => {
                CssParsingErrorOwned::LayoutMinWidth(e.to_contained())
            }
            CssParsingError::LayoutMinHeight(e) => {
                CssParsingErrorOwned::LayoutMinHeight(e.to_contained())
            }
            CssParsingError::LayoutMaxWidth(e) => {
                CssParsingErrorOwned::LayoutMaxWidth(e.to_contained())
            }
            CssParsingError::LayoutMaxHeight(e) => {
                CssParsingErrorOwned::LayoutMaxHeight(e.to_contained())
            }
            CssParsingError::LayoutPosition(e) => {
                CssParsingErrorOwned::LayoutPosition(e.to_contained())
            }
            CssParsingError::LayoutTop(e) => CssParsingErrorOwned::LayoutTop(e.to_contained()),
            CssParsingError::LayoutRight(e) => CssParsingErrorOwned::LayoutRight(e.to_contained()),
            CssParsingError::LayoutLeft(e) => CssParsingErrorOwned::LayoutLeft(e.to_contained()),
            CssParsingError::LayoutInsetBottom(e) => {
                CssParsingErrorOwned::LayoutInsetBottom(e.to_contained())
            }
            CssParsingError::LayoutZIndex(e) => {
                CssParsingErrorOwned::LayoutZIndex(e.to_contained())
            }
            CssParsingError::FlexWrap(e) => CssParsingErrorOwned::FlexWrap(e.to_contained()),
            CssParsingError::FlexDirection(e) => {
                CssParsingErrorOwned::FlexDirection(e.to_contained())
            }
            CssParsingError::FlexBasis(e) => CssParsingErrorOwned::FlexBasis(e.to_contained()),
            CssParsingError::JustifyContent(e) => {
                CssParsingErrorOwned::JustifyContent(e.to_contained())
            }
            CssParsingError::AlignItems(e) => CssParsingErrorOwned::AlignItems(e.to_contained()),
            CssParsingError::AlignContent(e) => {
                CssParsingErrorOwned::AlignContent(e.to_contained())
            }
            CssParsingError::Grid(e) => CssParsingErrorOwned::Grid(e.to_contained()),
            CssParsingError::LayoutWritingMode(e) => {
                CssParsingErrorOwned::LayoutWritingMode(e.to_contained())
            }
            CssParsingError::LayoutClear(e) => CssParsingErrorOwned::LayoutClear(e.to_contained()),
            CssParsingError::LayoutOverflow(e) => {
                CssParsingErrorOwned::LayoutOverflow(e.to_contained())
            }
            CssParsingError::BorderTopLeftRadius(e) => {
                CssParsingErrorOwned::BorderTopLeftRadius(e.to_contained())
            }
            CssParsingError::BorderTopRightRadius(e) => {
                CssParsingErrorOwned::BorderTopRightRadius(e.to_contained())
            }
            CssParsingError::BorderBottomLeftRadius(e) => {
                CssParsingErrorOwned::BorderBottomLeftRadius(e.to_contained())
            }
            CssParsingError::BorderBottomRightRadius(e) => {
                CssParsingErrorOwned::BorderBottomRightRadius(e.to_contained())
            }
            CssParsingError::BorderStyle(e) => CssParsingErrorOwned::BorderStyle(e.to_contained()),
            CssParsingError::BackfaceVisibility(e) => {
                CssParsingErrorOwned::BackfaceVisibility(e.to_contained())
            }
            CssParsingError::MixBlendMode(e) => {
                CssParsingErrorOwned::MixBlendMode(e.to_contained())
            }
1
            CssParsingError::TextColor(e) => CssParsingErrorOwned::TextColor(e.to_contained()),
1
            CssParsingError::FontSize(e) => CssParsingErrorOwned::FontSize(e.to_contained()),
            CssParsingError::TextAlign(e) => CssParsingErrorOwned::TextAlign(e.to_contained()),
            CssParsingError::TextJustify(e) => CssParsingErrorOwned::TextJustify(e.to_owned()),
            CssParsingError::VerticalAlign(e) => {
                CssParsingErrorOwned::VerticalAlign(e.to_contained())
            }
            CssParsingError::LetterSpacing(e) => {
                CssParsingErrorOwned::LetterSpacing(e.to_contained())
            }
            CssParsingError::TextIndent(e) => CssParsingErrorOwned::TextIndent(e.to_contained()),
            CssParsingError::InitialLetter(e) => {
                CssParsingErrorOwned::InitialLetter(e.to_contained())
            }
            CssParsingError::LineClamp(e) => CssParsingErrorOwned::LineClamp(e.to_contained()),
            CssParsingError::HangingPunctuation(e) => {
                CssParsingErrorOwned::HangingPunctuation(e.to_contained())
            }
            CssParsingError::TextCombineUpright(e) => {
                CssParsingErrorOwned::TextCombineUpright(e.to_contained())
            }
            CssParsingError::UnicodeBidi(e) => CssParsingErrorOwned::UnicodeBidi(e.to_contained()),
            CssParsingError::TextBoxTrim(e) => CssParsingErrorOwned::TextBoxTrim(e.to_contained()),
            CssParsingError::TextBoxEdge(e) => CssParsingErrorOwned::TextBoxEdge(e.to_contained()),
            CssParsingError::DominantBaseline(e) => {
                CssParsingErrorOwned::DominantBaseline(e.to_contained())
            }
            CssParsingError::AlignmentBaseline(e) => {
                CssParsingErrorOwned::AlignmentBaseline(e.to_contained())
            }
            CssParsingError::BaselineSource(e) => {
                CssParsingErrorOwned::BaselineSource(e.to_contained())
            }
            CssParsingError::LineFitEdge(e) => {
                CssParsingErrorOwned::LineFitEdge(e.to_contained())
            }
            CssParsingError::InitialLetterAlign(e) => {
                CssParsingErrorOwned::InitialLetterAlign(e.to_contained())
            }
            CssParsingError::InitialLetterWrap(e) => {
                CssParsingErrorOwned::InitialLetterWrap(e.to_contained())
            }
            CssParsingError::ScrollbarGutter(e) => {
                CssParsingErrorOwned::ScrollbarGutter(e.to_contained())
            }
            CssParsingError::OverflowClipMargin(e) => {
                CssParsingErrorOwned::OverflowClipMargin(e.to_contained())
            }
            CssParsingError::Clip(e) => CssParsingErrorOwned::Clip(e.to_contained()),
            CssParsingError::ExclusionMargin(e) => {
                CssParsingErrorOwned::ExclusionMargin(e.to_contained())
            }
            CssParsingError::HyphenationLanguage(e) => {
                CssParsingErrorOwned::HyphenationLanguage(e.to_contained())
            }
            CssParsingError::LineHeight(e) => CssParsingErrorOwned::LineHeight(e.clone()),
            CssParsingError::WordSpacing(e) => CssParsingErrorOwned::WordSpacing(e.to_contained()),
            CssParsingError::TabSize(e) => CssParsingErrorOwned::TabSize(e.to_contained()),
            CssParsingError::WhiteSpace(e) => CssParsingErrorOwned::WhiteSpace(e.to_contained()),
            CssParsingError::Hyphens(e) => CssParsingErrorOwned::Hyphens(e.to_contained()),
            CssParsingError::WordBreak(e) => CssParsingErrorOwned::WordBreak(e.to_contained()),
            CssParsingError::OverflowWrap(e) => {
                CssParsingErrorOwned::OverflowWrap(e.to_contained())
            }
            CssParsingError::LineBreak(e) => CssParsingErrorOwned::LineBreak(e.to_contained()),
            CssParsingError::TextOverflow(e) => CssParsingErrorOwned::TextOverflow(e.to_contained()),
            CssParsingError::ObjectFit(e) => CssParsingErrorOwned::ObjectFit(e.to_contained()),
            CssParsingError::ObjectPosition(e) => {
                CssParsingErrorOwned::ObjectPosition(e.to_contained())
            }
            CssParsingError::AspectRatio(e) => CssParsingErrorOwned::AspectRatio(e.to_contained()),
            CssParsingError::TextOrientation(e) => {
                CssParsingErrorOwned::TextOrientation(e.to_contained())
            }
            CssParsingError::TextAlignLast(e) => {
                CssParsingErrorOwned::TextAlignLast(e.to_contained())
            }
            CssParsingError::TextTransform(e) => {
                CssParsingErrorOwned::TextTransform(e.to_contained())
            }
            CssParsingError::Direction(e) => CssParsingErrorOwned::Direction(e.to_contained()),
            CssParsingError::UserSelect(e) => CssParsingErrorOwned::UserSelect(e.to_contained()),
            CssParsingError::TextDecoration(e) => {
                CssParsingErrorOwned::TextDecoration(e.to_contained())
            }
            CssParsingError::Cursor(e) => CssParsingErrorOwned::Cursor(e.to_contained()),
            CssParsingError::LayoutDisplay(e) => {
                CssParsingErrorOwned::LayoutDisplay(e.to_contained())
            }
            CssParsingError::LayoutFloat(e) => CssParsingErrorOwned::LayoutFloat(e.to_contained()),
            CssParsingError::LayoutBoxSizing(e) => {
                CssParsingErrorOwned::LayoutBoxSizing(e.to_contained())
            }
            // DTP properties...
            CssParsingError::PageBreak(e) => CssParsingErrorOwned::PageBreak(e.to_contained()),
            CssParsingError::BreakInside(e) => CssParsingErrorOwned::BreakInside(e.to_contained()),
            CssParsingError::Widows(e) => CssParsingErrorOwned::Widows(e.to_contained()),
            CssParsingError::Orphans(e) => CssParsingErrorOwned::Orphans(e.to_contained()),
            CssParsingError::BoxDecorationBreak(e) => {
                CssParsingErrorOwned::BoxDecorationBreak(e.to_contained())
            }
            CssParsingError::ColumnCount(e) => CssParsingErrorOwned::ColumnCount(e.to_contained()),
            CssParsingError::ColumnWidth(e) => CssParsingErrorOwned::ColumnWidth(e.to_contained()),
            CssParsingError::ColumnSpan(e) => CssParsingErrorOwned::ColumnSpan(e.to_contained()),
            CssParsingError::ColumnFill(e) => CssParsingErrorOwned::ColumnFill(e.to_contained()),
            CssParsingError::ColumnRuleWidth(e) => {
                CssParsingErrorOwned::ColumnRuleWidth(e.to_contained())
            }
            CssParsingError::ColumnRuleStyle(e) => {
                CssParsingErrorOwned::ColumnRuleStyle(e.to_contained())
            }
            CssParsingError::ColumnRuleColor(e) => {
                CssParsingErrorOwned::ColumnRuleColor(e.to_contained())
            }
            CssParsingError::FlowInto(e) => CssParsingErrorOwned::FlowInto(e.to_contained()),
            CssParsingError::FlowFrom(e) => CssParsingErrorOwned::FlowFrom(e.to_contained()),
            CssParsingError::GenericParseError => CssParsingErrorOwned::GenericParseError,
            CssParsingError::Content => CssParsingErrorOwned::Content,
            CssParsingError::Counter => CssParsingErrorOwned::Counter,
            CssParsingError::ListStyleType(e) => {
                CssParsingErrorOwned::ListStyleType(e.to_contained())
            }
            CssParsingError::ListStylePosition(e) => {
                CssParsingErrorOwned::ListStylePosition(e.to_contained())
            }
            CssParsingError::StringSet => CssParsingErrorOwned::StringSet,
            CssParsingError::FontWeight(e) => CssParsingErrorOwned::FontWeight(e.to_contained()),
            CssParsingError::FontStyle(e) => CssParsingErrorOwned::FontStyle(e.to_contained()),
        }
9
    }
}
impl CssParsingErrorOwned {
    #[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
9
    #[must_use] pub fn to_shared(&self) -> CssParsingError<'_> {
9
        match self {
            Self::CaretColor(e) => CssParsingError::CaretColor(e.to_shared()),
            Self::CaretWidth(e) => CssParsingError::CaretWidth(e.to_shared()),
            Self::CaretAnimationDuration(e) => {
                CssParsingError::CaretAnimationDuration(e.to_shared())
            }
            Self::Animation(e) => {
                CssParsingError::Animation(e.to_shared())
            }
            Self::SelectionBackgroundColor(e) => {
                CssParsingError::SelectionBackgroundColor(e.to_shared())
            }
            Self::SelectionColor(e) => {
                CssParsingError::SelectionColor(e.to_shared())
            }
            Self::SelectionRadius(e) => {
                CssParsingError::SelectionRadius(e.to_shared())
            }
            Self::Border(e) => CssParsingError::Border(e.inner.to_shared()),
            Self::BorderRadius(e) => {
                CssParsingError::BorderRadius(e.inner.to_shared())
            }
            Self::Padding(e) => CssParsingError::Padding(e.to_shared()),
            Self::Margin(e) => CssParsingError::Margin(e.to_shared()),
            Self::Overflow(e) => CssParsingError::Overflow(e.to_shared()),
            Self::BoxShadow(e) => CssParsingError::BoxShadow(e.to_shared()),
            Self::Color(e) => CssParsingError::Color(e.to_shared()),
            Self::PixelValue(e) => CssParsingError::PixelValue(e.to_shared()),
            Self::Percentage(e) => CssParsingError::Percentage(e.clone()),
            Self::FontFamily(e) => CssParsingError::FontFamily(e.to_shared()),
            Self::InvalidValue(e) => CssParsingError::InvalidValue(e.to_shared()),
            Self::FlexGrow(e) => CssParsingError::FlexGrow(e.to_shared()),
            Self::FlexShrink(e) => CssParsingError::FlexShrink(e.to_shared()),
1
            Self::Background(e) => CssParsingError::Background(e.to_shared()),
            Self::BackgroundPosition(e) => {
                CssParsingError::BackgroundPosition(e.to_shared())
            }
1
            Self::Opacity(e) => CssParsingError::Opacity(e.to_shared()),
            Self::Visibility(e) => CssParsingError::Visibility(e.to_shared()),
            Self::LayoutScrollbarWidth(e) => {
                CssParsingError::LayoutScrollbarWidth(e.to_shared())
            }
            Self::StyleScrollbarColor(e) => {
                CssParsingError::StyleScrollbarColor(e.to_shared())
            }
            Self::ScrollbarVisibilityMode(e) => {
                CssParsingError::ScrollbarVisibilityMode(e.to_shared())
            }
            Self::ScrollbarFadeDelay(e) => {
                CssParsingError::ScrollbarFadeDelay(e.to_shared())
            }
            Self::ScrollbarFadeDuration(e) => {
                CssParsingError::ScrollbarFadeDuration(e.to_shared())
            }
1
            Self::Transform(e) => CssParsingError::Transform(e.to_shared()),
            Self::TransformOrigin(e) => {
                CssParsingError::TransformOrigin(e.to_shared())
            }
            Self::PerspectiveOrigin(e) => {
                CssParsingError::PerspectiveOrigin(e.to_shared())
            }
            Self::Filter(e) => CssParsingError::Filter(e.to_shared()),
4
            Self::LayoutWidth(e) => CssParsingError::LayoutWidth(e.to_shared()),
            Self::LayoutHeight(e) => CssParsingError::LayoutHeight(e.to_shared()),
            Self::LayoutMinWidth(e) => {
                CssParsingError::LayoutMinWidth(e.to_shared())
            }
            Self::LayoutMinHeight(e) => {
                CssParsingError::LayoutMinHeight(e.to_shared())
            }
            Self::LayoutMaxWidth(e) => {
                CssParsingError::LayoutMaxWidth(e.to_shared())
            }
            Self::LayoutMaxHeight(e) => {
                CssParsingError::LayoutMaxHeight(e.to_shared())
            }
            Self::LayoutPosition(e) => {
                CssParsingError::LayoutPosition(e.to_shared())
            }
            Self::LayoutTop(e) => CssParsingError::LayoutTop(e.to_shared()),
            Self::LayoutRight(e) => CssParsingError::LayoutRight(e.to_shared()),
            Self::LayoutLeft(e) => CssParsingError::LayoutLeft(e.to_shared()),
            Self::LayoutInsetBottom(e) => {
                CssParsingError::LayoutInsetBottom(e.to_shared())
            }
            Self::LayoutZIndex(e) => CssParsingError::LayoutZIndex(e.to_shared()),
            Self::FlexWrap(e) => CssParsingError::FlexWrap(e.to_shared()),
            Self::FlexDirection(e) => CssParsingError::FlexDirection(e.to_shared()),
            Self::FlexBasis(e) => CssParsingError::FlexBasis(e.to_shared()),
            Self::JustifyContent(e) => {
                CssParsingError::JustifyContent(e.to_shared())
            }
            Self::AlignItems(e) => CssParsingError::AlignItems(e.to_shared()),
            Self::AlignContent(e) => CssParsingError::AlignContent(e.to_shared()),
            Self::Grid(e) => CssParsingError::Grid(e.to_shared()),
            Self::GridAutoFlow(e) => CssParsingError::GridAutoFlow(e.to_shared()),
            Self::JustifySelf(e) => CssParsingError::JustifySelf(e.to_shared()),
            Self::JustifyItems(e) => CssParsingError::JustifyItems(e.to_shared()),
            Self::AlignSelf(e) => CssParsingError::AlignSelf(e.to_shared()),
            Self::LayoutWritingMode(e) => {
                CssParsingError::LayoutWritingMode(e.to_shared())
            }
            Self::LayoutClear(e) => CssParsingError::LayoutClear(e.to_shared()),
            Self::LayoutOverflow(e) => {
                CssParsingError::LayoutOverflow(e.to_shared())
            }
            Self::BorderTopLeftRadius(e) => {
                CssParsingError::BorderTopLeftRadius(e.to_shared())
            }
            Self::BorderTopRightRadius(e) => {
                CssParsingError::BorderTopRightRadius(e.to_shared())
            }
            Self::BorderBottomLeftRadius(e) => {
                CssParsingError::BorderBottomLeftRadius(e.to_shared())
            }
            Self::BorderBottomRightRadius(e) => {
                CssParsingError::BorderBottomRightRadius(e.to_shared())
            }
            Self::BorderStyle(e) => CssParsingError::BorderStyle(e.to_shared()),
            Self::BackfaceVisibility(e) => {
                CssParsingError::BackfaceVisibility(e.to_shared())
            }
            Self::MixBlendMode(e) => CssParsingError::MixBlendMode(e.to_shared()),
1
            Self::TextColor(e) => CssParsingError::TextColor(e.to_shared()),
1
            Self::FontSize(e) => CssParsingError::FontSize(e.to_shared()),
            Self::TextAlign(e) => CssParsingError::TextAlign(e.to_shared()),
            Self::TextJustify(e) => CssParsingError::TextJustify(e.to_borrowed()),
            Self::LetterSpacing(e) => CssParsingError::LetterSpacing(e.to_shared()),
            Self::TextIndent(e) => CssParsingError::TextIndent(e.to_shared()),
            Self::InitialLetter(e) => CssParsingError::InitialLetter(e.to_shared()),
            Self::LineClamp(e) => CssParsingError::LineClamp(e.to_shared()),
            Self::HangingPunctuation(e) => {
                CssParsingError::HangingPunctuation(e.to_shared())
            }
            Self::TextCombineUpright(e) => {
                CssParsingError::TextCombineUpright(e.to_shared())
            }
            Self::UnicodeBidi(e) => CssParsingError::UnicodeBidi(e.to_shared()),
            Self::TextBoxTrim(e) => CssParsingError::TextBoxTrim(e.to_shared()),
            Self::TextBoxEdge(e) => CssParsingError::TextBoxEdge(e.to_shared()),
            Self::DominantBaseline(e) => {
                CssParsingError::DominantBaseline(e.to_shared())
            }
            Self::AlignmentBaseline(e) => {
                CssParsingError::AlignmentBaseline(e.to_shared())
            }
            Self::BaselineSource(e) => {
                CssParsingError::BaselineSource(e.to_shared())
            }
            Self::LineFitEdge(e) => {
                CssParsingError::LineFitEdge(e.to_shared())
            }
            Self::InitialLetterAlign(e) => {
                CssParsingError::InitialLetterAlign(e.to_shared())
            }
            Self::InitialLetterWrap(e) => {
                CssParsingError::InitialLetterWrap(e.to_shared())
            }
            Self::ScrollbarGutter(e) => {
                CssParsingError::ScrollbarGutter(e.to_shared())
            }
            Self::OverflowClipMargin(e) => {
                CssParsingError::OverflowClipMargin(e.to_shared())
            }
            Self::Clip(e) => CssParsingError::Clip(e.to_shared()),
            Self::ExclusionMargin(e) => {
                CssParsingError::ExclusionMargin(e.to_shared())
            }
            Self::HyphenationLanguage(e) => {
                CssParsingError::HyphenationLanguage(e.to_shared())
            }
            Self::LineHeight(e) => CssParsingError::LineHeight(e.clone()),
            Self::WordSpacing(e) => CssParsingError::WordSpacing(e.to_shared()),
            Self::TabSize(e) => CssParsingError::TabSize(e.to_shared()),
            Self::WhiteSpace(e) => CssParsingError::WhiteSpace(e.to_shared()),
            Self::Hyphens(e) => CssParsingError::Hyphens(e.to_shared()),
            Self::WordBreak(e) => CssParsingError::WordBreak(e.to_shared()),
            Self::OverflowWrap(e) => CssParsingError::OverflowWrap(e.to_shared()),
            Self::LineBreak(e) => CssParsingError::LineBreak(e.to_shared()),
            Self::TextOverflow(e) => CssParsingError::TextOverflow(e.to_shared()),
            Self::ObjectFit(e) => CssParsingError::ObjectFit(e.to_shared()),
            Self::ObjectPosition(e) => {
                CssParsingError::ObjectPosition(e.to_shared())
            }
            Self::AspectRatio(e) => CssParsingError::AspectRatio(e.to_shared()),
            Self::TextOrientation(e) => {
                CssParsingError::TextOrientation(e.to_shared())
            }
            Self::TextAlignLast(e) => CssParsingError::TextAlignLast(e.to_shared()),
            Self::TextTransform(e) => CssParsingError::TextTransform(e.to_shared()),
            Self::Direction(e) => CssParsingError::Direction(e.to_shared()),
            Self::UserSelect(e) => CssParsingError::UserSelect(e.to_shared()),
            Self::TextDecoration(e) => {
                CssParsingError::TextDecoration(e.to_shared())
            }
            Self::Cursor(e) => CssParsingError::Cursor(e.to_shared()),
            Self::LayoutDisplay(e) => CssParsingError::LayoutDisplay(e.to_shared()),
            Self::LayoutFloat(e) => CssParsingError::LayoutFloat(e.to_shared()),
            Self::LayoutBoxSizing(e) => {
                CssParsingError::LayoutBoxSizing(e.to_shared())
            }
            // DTP properties...
            Self::PageBreak(e) => CssParsingError::PageBreak(e.to_shared()),
            Self::BreakInside(e) => CssParsingError::BreakInside(e.to_shared()),
            Self::Widows(e) => CssParsingError::Widows(e.to_shared()),
            Self::Orphans(e) => CssParsingError::Orphans(e.to_shared()),
            Self::BoxDecorationBreak(e) => {
                CssParsingError::BoxDecorationBreak(e.to_shared())
            }
            Self::ColumnCount(e) => CssParsingError::ColumnCount(e.to_shared()),
            Self::ColumnWidth(e) => CssParsingError::ColumnWidth(e.to_shared()),
            Self::ColumnSpan(e) => CssParsingError::ColumnSpan(e.to_shared()),
            Self::ColumnFill(e) => CssParsingError::ColumnFill(e.to_shared()),
            Self::ColumnRuleWidth(e) => {
                CssParsingError::ColumnRuleWidth(e.to_shared())
            }
            Self::ColumnRuleStyle(e) => {
                CssParsingError::ColumnRuleStyle(e.to_shared())
            }
            Self::ColumnRuleColor(e) => {
                CssParsingError::ColumnRuleColor(e.to_shared())
            }
            Self::FlowInto(e) => CssParsingError::FlowInto(e.to_shared()),
            Self::FlowFrom(e) => CssParsingError::FlowFrom(e.to_shared()),
            Self::GenericParseError => CssParsingError::GenericParseError,
            Self::Content => CssParsingError::Content,
            Self::Counter => CssParsingError::Counter,
            Self::ListStyleType(e) => CssParsingError::ListStyleType(e.to_shared()),
            Self::ListStylePosition(e) => {
                CssParsingError::ListStylePosition(e.to_shared())
            }
            Self::StringSet => CssParsingError::StringSet,
            Self::FontWeight(e) => CssParsingError::FontWeight(e.to_shared()),
            Self::FontStyle(e) => CssParsingError::FontStyle(e.to_shared()),
            Self::VerticalAlign(e) => CssParsingError::VerticalAlign(e.to_shared()),
        }
9
    }
}
#[cfg(feature = "parser")]
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
/// # Errors
///
/// Returns an error if `input` is not a valid CSS `css-property` value.
336925
pub fn parse_css_property(
336925
    key: CssPropertyType,
336925
    value: &str,
336925
) -> Result<CssProperty, CssParsingError<'_>> {
    use crate::props::style::{
        parse_selection_background_color, parse_selection_color, parse_selection_radius,
    };
336925
    let value = value.trim();
    // For properties where "auto" or "none" is a valid typed value (not just the generic CSS
    // keyword), we must NOT intercept them here. Let the specific parser handle them.
336925
    let has_typed_auto = matches!(
336925
        key,
        CssPropertyType::Hyphens |      // hyphens: auto means StyleHyphens::Auto
        CssPropertyType::LineBreak |    // line-break: auto means StyleLineBreak::Auto
        CssPropertyType::TextAlignLast | // text-align-last: auto means StyleTextAlignLast::Auto
        CssPropertyType::OverflowX |
        CssPropertyType::OverflowY |
        CssPropertyType::OverflowBlock |
        CssPropertyType::OverflowInline |
        CssPropertyType::UserSelect | // user-select: auto is a typed value
        CssPropertyType::AspectRatio // aspect-ratio: auto means StyleAspectRatio::Auto
    );
336925
    let has_typed_none = matches!(
336925
        key,
        CssPropertyType::Hyphens |      // hyphens: none means StyleHyphens::None
        CssPropertyType::Display |      // display: none means LayoutDisplay::None
        CssPropertyType::UserSelect |
        CssPropertyType::Float |        // float: none means LayoutFloat::None
        CssPropertyType::TextDecoration | // text-decoration: none is a typed value
        CssPropertyType::ObjectFit // object-fit: none means StyleObjectFit::None
    );
205
    Ok(match value {
336925
        "auto" if !has_typed_auto => CssProperty::auto(key),
336793
        "none" if !has_typed_none => CssProperty::none(key),
336588
        "initial" => CssProperty::initial(key),
336216
        "inherit" => CssProperty::inherit(key),
336318
        value => match key {
            CssPropertyType::CaretColor => parse_caret_color(value)?.into(),
            CssPropertyType::CaretWidth => parse_caret_width(value)?.into(),
            CssPropertyType::CaretAnimationDuration => {
96
                parse_caret_animation_duration(value)?.into()
            }
            CssPropertyType::Animation => CssProperty::Animation(CssPropertyValue::Exact(
97
                crate::props::basic::animation::parse_style_animation_vec(value)?,
            )),
            CssPropertyType::AnimationIn => CssProperty::AnimationIn(CssPropertyValue::Exact(
49
                crate::props::basic::animation::parse_style_animation_vec(value)?,
            )),
            CssPropertyType::AnimationOut => CssProperty::AnimationOut(CssPropertyValue::Exact(
241
                crate::props::basic::animation::parse_style_animation_vec(value)?,
            )),
            CssPropertyType::SelectionBackgroundColor => {
36
                parse_selection_background_color(value)?.into()
            }
36
            CssPropertyType::SelectionColor => parse_selection_color(value)?.into(),
            CssPropertyType::SelectionRadius => parse_selection_radius(value)?.into(),
63076
            CssPropertyType::TextColor => parse_style_text_color(value)?.into(),
            CssPropertyType::FontSize => {
17544
                CssProperty::FontSize(parse_style_font_size(value)?.into())
            }
2924
            CssPropertyType::FontFamily => parse_style_font_family(value)?.into(),
            CssPropertyType::FontWeight => {
43
                CssProperty::FontWeight(parse_font_weight(value)?.into())
            }
24
            CssPropertyType::FontStyle => CssProperty::FontStyle(parse_font_style(value)?.into()),
99
            CssPropertyType::TextAlign => parse_style_text_align(value)?.into(),
            CssPropertyType::TextJustify => parse_layout_text_justify(value)?.into(),
24
            CssPropertyType::VerticalAlign => parse_style_vertical_align(value)?.into(),
36
            CssPropertyType::LetterSpacing => parse_style_letter_spacing(value)?.into(),
12
            CssPropertyType::TextIndent => parse_style_text_indent(value)?.into(),
            CssPropertyType::InitialLetter => parse_style_initial_letter(value)?.into(),
            CssPropertyType::LineClamp => parse_style_line_clamp(value)?.into(),
            CssPropertyType::HangingPunctuation => parse_style_hanging_punctuation(value)?.into(),
            CssPropertyType::TextCombineUpright => parse_style_text_combine_upright(value)?.into(),
            CssPropertyType::UnicodeBidi => parse_style_unicode_bidi(value)?.into(),
            CssPropertyType::TextBoxTrim => parse_style_text_box_trim(value)?.into(),
            CssPropertyType::TextBoxEdge => parse_style_text_box_edge(value)?.into(),
            CssPropertyType::DominantBaseline => parse_style_dominant_baseline(value)?.into(),
            CssPropertyType::AlignmentBaseline => parse_style_alignment_baseline(value)?.into(),
            CssPropertyType::BaselineSource => parse_style_baseline_source(value)?.into(),
            CssPropertyType::LineFitEdge => parse_style_line_fit_edge(value)?.into(),
            CssPropertyType::InitialLetterAlign => parse_style_initial_letter_align(value)?.into(),
            CssPropertyType::InitialLetterWrap => parse_style_initial_letter_wrap(value)?.into(),
            CssPropertyType::ScrollbarGutter => parse_style_scrollbar_gutter(value)?.into(),
            CssPropertyType::OverflowClipMargin => parse_style_overflow_clip_margin(value)?.into(),
            CssPropertyType::Clip => parse_clip_rect(value)?.into(),
            CssPropertyType::ExclusionMargin => parse_style_exclusion_margin(value)?.into(),
            CssPropertyType::HyphenationLanguage => parse_style_hyphenation_language(value)?.into(),
910
            CssPropertyType::LineHeight => parse_style_line_height(value)?.into(),
12
            CssPropertyType::WordSpacing => parse_style_word_spacing(value)?.into(),
            CssPropertyType::TabSize => parse_style_tab_size(value)?.into(),
424
            CssPropertyType::WhiteSpace => parse_style_white_space(value)?.into(),
            CssPropertyType::Hyphens => parse_style_hyphens(value)?.into(),
            CssPropertyType::WordBreak => parse_style_word_break(value)?.into(),
12
            CssPropertyType::OverflowWrap => parse_style_overflow_wrap(value)?.into(),
            CssPropertyType::LineBreak => parse_style_line_break(value)?.into(),
30
            CssPropertyType::TextOverflow => parse_style_text_overflow(value)?.into(),
            CssPropertyType::ObjectFit => parse_style_object_fit(value)?.into(),
            CssPropertyType::ObjectPosition => parse_style_object_position(value)?.into(),
24
            CssPropertyType::AspectRatio => parse_style_aspect_ratio(value)?.into(),
            CssPropertyType::TextOrientation => parse_style_text_orientation(value)?.into(),
            CssPropertyType::TextAlignLast => parse_style_text_align_last(value)?.into(),
24
            CssPropertyType::TextTransform => parse_style_text_transform(value)?.into(),
36
            CssPropertyType::Direction => parse_style_direction(value)?.into(),
120
            CssPropertyType::UserSelect => parse_style_user_select(value)?.into(),
            CssPropertyType::TextDecoration => parse_style_text_decoration(value)?.into(),
17456
            CssPropertyType::Cursor => parse_style_cursor(value)?.into(),
30816
            CssPropertyType::Display => parse_layout_display(value)?.into(),
468
            CssPropertyType::Float => parse_layout_float(value)?.into(),
516
            CssPropertyType::BoxSizing => parse_layout_box_sizing(value)?.into(),
26762
            CssPropertyType::Width => parse_layout_width(value)?.into(),
24279
            CssPropertyType::Height => parse_layout_height(value)?.into(),
1545
            CssPropertyType::MinWidth => parse_layout_min_width(value)?.into(),
588
            CssPropertyType::MinHeight => parse_layout_min_height(value)?.into(),
780
            CssPropertyType::MaxWidth => parse_layout_max_width(value)?.into(),
588
            CssPropertyType::MaxHeight => parse_layout_max_height(value)?.into(),
22732
            CssPropertyType::Position => parse_layout_position(value)?.into(),
20634
            CssPropertyType::Top => parse_layout_top(value)?.into(),
813
            CssPropertyType::Right => parse_layout_right(value)?.into(),
20401
            CssPropertyType::Left => parse_layout_left(value)?.into(),
801
            CssPropertyType::Bottom => parse_layout_bottom(value)?.into(),
118
            CssPropertyType::ZIndex => CssProperty::ZIndex(parse_layout_z_index(value)?.into()),
33
            CssPropertyType::FlexWrap => parse_layout_flex_wrap(value)?.into(),
19159
            CssPropertyType::FlexDirection => parse_layout_flex_direction(value)?.into(),
1657
            CssPropertyType::FlexGrow => parse_layout_flex_grow(value)?.into(),
372
            CssPropertyType::FlexShrink => parse_layout_flex_shrink(value)?.into(),
            CssPropertyType::FlexBasis => parse_layout_flex_basis(value)?.into(),
193
            CssPropertyType::JustifyContent => parse_layout_justify_content(value)?.into(),
17101
            CssPropertyType::AlignItems => parse_layout_align_items(value)?.into(),
            CssPropertyType::AlignContent => parse_layout_align_content(value)?.into(),
            CssPropertyType::ColumnGap => parse_layout_column_gap(value)?.into(),
            CssPropertyType::RowGap => parse_layout_row_gap(value)?.into(),
            CssPropertyType::GridTemplateColumns => {
58
                CssProperty::GridTemplateColumns(parse_grid_template(value)?.into())
            }
            CssPropertyType::GridTemplateRows => {
57
                CssProperty::GridTemplateRows(parse_grid_template(value)?.into())
            }
            CssPropertyType::GridAutoColumns => {
                let template = parse_grid_template(value)?;
                CssProperty::GridAutoColumns(CssPropertyValue::Exact(GridAutoTracks::from(
                    template,
                )))
            }
            CssPropertyType::GridAutoFlow => {
                CssProperty::GridAutoFlow(parse_layout_grid_auto_flow(value)?.into())
            }
            CssPropertyType::JustifySelf => {
                CssProperty::JustifySelf(parse_layout_justify_self(value)?.into())
            }
            CssPropertyType::JustifyItems => {
                CssProperty::JustifyItems(parse_layout_justify_items(value)?.into())
            }
            CssPropertyType::Gap => {
                // gap shorthand: single value -> both row & column
1
                CssProperty::Gap(parse_layout_gap(value)?.into())
            }
            CssPropertyType::GridGap => CssProperty::GridGap(parse_layout_gap(value)?.into()),
            CssPropertyType::AlignSelf => {
24
                CssProperty::AlignSelf(parse_layout_align_self(value)?.into())
            }
            CssPropertyType::Font => {
                // minimal font parser: map to font-family for now
                let fam = parse_style_font_family(value)?;
                CssProperty::Font(fam.into())
            }
            CssPropertyType::GridAutoRows => {
                let template = parse_grid_template(value)?;
                CssProperty::GridAutoRows(CssPropertyValue::Exact(GridAutoTracks::from(template)))
            }
            CssPropertyType::GridColumn => {
                CssProperty::GridColumn(CssPropertyValue::Exact(parse_grid_placement(value)?))
            }
            CssPropertyType::GridRow => {
                CssProperty::GridRow(CssPropertyValue::Exact(parse_grid_placement(value)?))
            }
            CssPropertyType::GridTemplateAreas => {
                use crate::props::layout::grid::parse_grid_template_areas;
26
                let areas = parse_grid_template_areas(value)
26
                    .map_err(|()| CssParsingError::InvalidValue(InvalidValueErr(value)))?;
26
                CssProperty::GridTemplateAreas(CssPropertyValue::Exact(areas))
            }
36
            CssPropertyType::WritingMode => parse_layout_writing_mode(value)?.into(),
84
            CssPropertyType::Clear => parse_layout_clear(value)?.into(),
            CssPropertyType::BackgroundContent => {
73
                parse_style_background_content_multiple(value)?.into()
            }
            CssPropertyType::BackgroundPosition => {
                parse_style_background_position_multiple(value)?.into()
            }
            CssPropertyType::BackgroundSize => parse_style_background_size_multiple(value)?.into(),
            CssPropertyType::BackgroundRepeat => {
                parse_style_background_repeat_multiple(value)?.into()
            }
            CssPropertyType::OverflowX => {
1140
                CssProperty::OverflowX(parse_layout_overflow(value)?.into())
            }
            CssPropertyType::OverflowY => {
1801
                CssProperty::OverflowY(parse_layout_overflow(value)?.into())
            }
            CssPropertyType::OverflowBlock => {
                CssProperty::OverflowBlock(parse_layout_overflow(value)?.into())
            }
            CssPropertyType::OverflowInline => {
12
                CssProperty::OverflowInline(parse_layout_overflow(value)?.into())
            }
48
            CssPropertyType::PaddingTop => parse_layout_padding_top(value)?.into(),
16812
            CssPropertyType::PaddingLeft => parse_layout_padding_left(value)?.into(),
16308
            CssPropertyType::PaddingRight => parse_layout_padding_right(value)?.into(),
            CssPropertyType::PaddingBottom => parse_layout_padding_bottom(value)?.into(),
            CssPropertyType::PaddingInlineStart => parse_layout_padding_inline_start(value)?.into(),
            CssPropertyType::PaddingInlineEnd => parse_layout_padding_inline_end(value)?.into(),
552
            CssPropertyType::MarginTop => parse_layout_margin_top(value)?.into(),
960
            CssPropertyType::MarginLeft => parse_layout_margin_left(value)?.into(),
62
            CssPropertyType::MarginRight => parse_layout_margin_right(value)?.into(),
2675
            CssPropertyType::MarginBottom => parse_layout_margin_bottom(value)?.into(),
            CssPropertyType::BorderTopLeftRadius => {
                parse_style_border_top_left_radius(value)?.into()
            }
            CssPropertyType::BorderTopRightRadius => {
                parse_style_border_top_right_radius(value)?.into()
            }
            CssPropertyType::BorderBottomLeftRadius => {
                parse_style_border_bottom_left_radius(value)?.into()
            }
            CssPropertyType::BorderBottomRightRadius => {
                parse_style_border_bottom_right_radius(value)?.into()
            }
            CssPropertyType::BorderTopColor => parse_border_top_color(value)?.into(),
            CssPropertyType::BorderRightColor => parse_border_right_color(value)?.into(),
            CssPropertyType::BorderLeftColor => parse_border_left_color(value)?.into(),
            CssPropertyType::BorderBottomColor => parse_border_bottom_color(value)?.into(),
            CssPropertyType::BorderTopStyle => parse_border_top_style(value)?.into(),
            CssPropertyType::BorderRightStyle => parse_border_right_style(value)?.into(),
            CssPropertyType::BorderLeftStyle => parse_border_left_style(value)?.into(),
            CssPropertyType::BorderBottomStyle => parse_border_bottom_style(value)?.into(),
            CssPropertyType::BorderTopWidth => parse_border_top_width(value)?.into(),
            CssPropertyType::BorderRightWidth => parse_border_right_width(value)?.into(),
            CssPropertyType::BorderLeftWidth => parse_border_left_width(value)?.into(),
            CssPropertyType::BorderBottomWidth => parse_border_bottom_width(value)?.into(),
            CssPropertyType::BoxShadowLeft => CssProperty::BoxShadowLeft(CssPropertyValue::Exact(
                BoxOrStatic::heap(parse_style_box_shadow(value)?),
            )),
            CssPropertyType::BoxShadowRight => CssProperty::BoxShadowRight(
                CssPropertyValue::Exact(BoxOrStatic::heap(parse_style_box_shadow(value)?)),
            ),
            CssPropertyType::BoxShadowTop => CssProperty::BoxShadowTop(CssPropertyValue::Exact(
                BoxOrStatic::heap(parse_style_box_shadow(value)?),
            )),
            CssPropertyType::BoxShadowBottom => CssProperty::BoxShadowBottom(
                CssPropertyValue::Exact(BoxOrStatic::heap(parse_style_box_shadow(value)?)),
            ),
            CssPropertyType::ScrollbarTrack => CssProperty::ScrollbarTrack(
                CssPropertyValue::Exact(parse_style_background_content(value)?),
            ),
            CssPropertyType::ScrollbarThumb => CssProperty::ScrollbarThumb(
                CssPropertyValue::Exact(parse_style_background_content(value)?),
            ),
            CssPropertyType::ScrollbarButton => CssProperty::ScrollbarButton(
                CssPropertyValue::Exact(parse_style_background_content(value)?),
            ),
            CssPropertyType::ScrollbarCorner => CssProperty::ScrollbarCorner(
                CssPropertyValue::Exact(parse_style_background_content(value)?),
            ),
            CssPropertyType::ScrollbarResizer => CssProperty::ScrollbarResizer(
                CssPropertyValue::Exact(parse_style_background_content(value)?),
            ),
            CssPropertyType::ScrollbarWidth => parse_layout_scrollbar_width(value)?.into(),
            CssPropertyType::ScrollbarColor => parse_style_scrollbar_color(value)?.into(),
            CssPropertyType::ScrollbarVisibility => parse_scrollbar_visibility_mode(value)?.into(),
            CssPropertyType::ScrollbarFadeDelay => parse_scrollbar_fade_delay(value)?.into(),
            CssPropertyType::ScrollbarFadeDuration => parse_scrollbar_fade_duration(value)?.into(),
522
            CssPropertyType::Opacity => parse_style_opacity(value)?.into(),
21
            CssPropertyType::Visibility => parse_style_visibility(value)?.into(),
826
            CssPropertyType::Transform => parse_style_transform_vec(value)?.into(),
            CssPropertyType::TransformOrigin => parse_style_transform_origin(value)?.into(),
            CssPropertyType::PerspectiveOrigin => parse_style_perspective_origin(value)?.into(),
            CssPropertyType::BackfaceVisibility => parse_style_backface_visibility(value)?.into(),
            CssPropertyType::MixBlendMode => parse_style_mix_blend_mode(value)?.into(),
            CssPropertyType::Filter => CssProperty::Filter(parse_style_filter_vec(value)?.into()),
            CssPropertyType::BackdropFilter => {
                CssProperty::BackdropFilter(parse_style_filter_vec(value)?.into())
            }
            CssPropertyType::TextShadow => CssProperty::TextShadow(CssPropertyValue::Exact(
                BoxOrStatic::heap(parse_style_box_shadow(value)?),
            )),
            // DTP properties
            CssPropertyType::BreakBefore => {
12
                CssProperty::BreakBefore(parse_page_break(value)?.into())
            }
            CssPropertyType::BreakAfter => CssProperty::BreakAfter(parse_page_break(value)?.into()),
            CssPropertyType::BreakInside => {
108
                CssProperty::BreakInside(parse_break_inside(value)?.into())
            }
132
            CssPropertyType::Orphans => CssProperty::Orphans(parse_orphans(value)?.into()),
132
            CssPropertyType::Widows => CssProperty::Widows(parse_widows(value)?.into()),
            CssPropertyType::BoxDecorationBreak => {
                CssProperty::BoxDecorationBreak(parse_box_decoration_break(value)?.into())
            }
            CssPropertyType::ColumnCount => {
                CssProperty::ColumnCount(parse_column_count(value)?.into())
            }
            CssPropertyType::ColumnWidth => {
                CssProperty::ColumnWidth(parse_column_width(value)?.into())
            }
            CssPropertyType::ColumnSpan => {
                CssProperty::ColumnSpan(parse_column_span(value)?.into())
            }
            CssPropertyType::ColumnFill => {
                CssProperty::ColumnFill(parse_column_fill(value)?.into())
            }
            CssPropertyType::ColumnRuleWidth => {
                CssProperty::ColumnRuleWidth(parse_column_rule_width(value)?.into())
            }
            CssPropertyType::ColumnRuleStyle => {
                CssProperty::ColumnRuleStyle(parse_column_rule_style(value)?.into())
            }
            CssPropertyType::ColumnRuleColor => {
                CssProperty::ColumnRuleColor(parse_column_rule_color(value)?.into())
            }
            CssPropertyType::FlowInto => CssProperty::FlowInto(parse_flow_into(value)?.into()),
            CssPropertyType::FlowFrom => CssProperty::FlowFrom(parse_flow_from(value)?.into()),
            CssPropertyType::ShapeOutside => CssProperty::ShapeOutside(CssPropertyValue::Exact(
                parse_shape_outside(value).map_err(|_| CssParsingError::GenericParseError)?,
            )),
            CssPropertyType::ShapeInside => CssProperty::ShapeInside(CssPropertyValue::Exact(
                parse_shape_inside(value).map_err(|_| CssParsingError::GenericParseError)?,
            )),
            CssPropertyType::ClipPath => CssProperty::ClipPath(CssPropertyValue::Exact(
                parse_clip_path(value).map_err(|_| CssParsingError::GenericParseError)?,
            )),
            CssPropertyType::ShapeMargin => {
                CssProperty::ShapeMargin(parse_shape_margin(value)?.into())
            }
            CssPropertyType::ShapeImageThreshold => CssProperty::ShapeImageThreshold(
                parse_shape_image_threshold(value)
                    .map_err(|_| CssParsingError::GenericParseError)?
                    .into(),
            ),
            CssPropertyType::Content => CssProperty::Content(
31
                parse_content(value)
31
                    .map_err(|()| CssParsingError::Content)?
31
                    .into(),
            ),
            CssPropertyType::CounterReset => CssProperty::CounterReset(
                parse_counter_reset(value)
                    .map_err(|()| CssParsingError::Counter)?
                    .into(),
            ),
            CssPropertyType::CounterIncrement => CssProperty::CounterIncrement(
                parse_counter_increment(value)
                    .map_err(|()| CssParsingError::Counter)?
                    .into(),
            ),
            CssPropertyType::ListStyleType => CssProperty::ListStyleType(
                parse_style_list_style_type(value)
                    .map_err(CssParsingError::ListStyleType)?
                    .into(),
            ),
            CssPropertyType::ListStylePosition => CssProperty::ListStylePosition(
                parse_style_list_style_position(value)
                    .map_err(CssParsingError::ListStylePosition)?
                    .into(),
            ),
            CssPropertyType::StringSet => CssProperty::StringSet(
                parse_string_set(value)
                    .map_err(|()| CssParsingError::StringSet)?
                    .into(),
            ),
            CssPropertyType::TableLayout => CssProperty::TableLayout(
1
                parse_table_layout(value)
1
                    .map_err(|_| CssParsingError::GenericParseError)?
1
                    .into(),
            ),
            CssPropertyType::BorderCollapse => CssProperty::BorderCollapse(
49
                parse_border_collapse(value)
49
                    .map_err(|_| CssParsingError::GenericParseError)?
49
                    .into(),
            ),
            CssPropertyType::BorderSpacing => CssProperty::BorderSpacing(
12
                parse_border_spacing(value)
12
                    .map_err(|_| CssParsingError::GenericParseError)?
12
                    .into(),
            ),
            CssPropertyType::CaptionSide => CssProperty::CaptionSide(
1
                parse_caption_side(value)
1
                    .map_err(|_| CssParsingError::GenericParseError)?
1
                    .into(),
            ),
            CssPropertyType::EmptyCells => CssProperty::EmptyCells(
1
                parse_empty_cells(value)
1
                    .map_err(|_| CssParsingError::GenericParseError)?
1
                    .into(),
            ),
        },
    })
336925
}
/// Parses a combined CSS property or a CSS property shorthand, for example "margin"
/// (as a shorthand for setting all four properties of "margin-top", "margin-bottom",
/// "margin-left" and "margin-right")
///
/// ```rust
/// # extern crate azul_css;
/// # use azul_css::*;
/// # use azul_css::props::style::*;
/// # use azul_css::css::CssPropertyValue;
/// # use azul_css::props::property::*;
/// assert_eq!(
///     parse_combined_css_property(CombinedCssPropertyType::BorderRadius, "10px"),
///     Ok(vec![
///         CssProperty::BorderTopLeftRadius(CssPropertyValue::Exact(
///             StyleBorderTopLeftRadius::px(10.0)
///         )),
///         CssProperty::BorderTopRightRadius(CssPropertyValue::Exact(
///             StyleBorderTopRightRadius::px(10.0)
///         )),
///         CssProperty::BorderBottomLeftRadius(CssPropertyValue::Exact(
///             StyleBorderBottomLeftRadius::px(10.0)
///         )),
///         CssProperty::BorderBottomRightRadius(CssPropertyValue::Exact(
///             StyleBorderBottomRightRadius::px(10.0)
///         )),
///     ])
/// )
/// ```
#[cfg(feature = "parser")]
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
/// # Errors
///
/// Returns an error if `input` is not a valid CSS `combined-css-property` value.
59644
pub fn parse_combined_css_property(
59644
    key: CombinedCssPropertyType,
59644
    value: &str,
59644
) -> Result<Vec<CssProperty>, CssParsingError<'_>> {
    use self::CombinedCssPropertyType::{BorderRadius, Overflow, Padding, Margin, Border, BorderLeft, BorderRight, BorderTop, BorderBottom, BorderColor, BorderStyle, BorderWidth, BoxShadow, BackgroundColor, BackgroundImage, Background, Flex, Grid, Gap, GridGap, Font, Columns, GridArea, ColumnRule, TextBox, InsetBlock, InsetInline};
    macro_rules! convert_value {
        ($thing:expr, $prop_type:ident, $wrapper:ident) => {
            match $thing {
                PixelValueWithAuto::None => CssProperty::none(CssPropertyType::$prop_type),
                PixelValueWithAuto::Initial => CssProperty::initial(CssPropertyType::$prop_type),
                PixelValueWithAuto::Inherit => CssProperty::inherit(CssPropertyType::$prop_type),
                PixelValueWithAuto::Auto => CssProperty::auto(CssPropertyType::$prop_type),
                PixelValueWithAuto::Exact(x) => {
                    CssProperty::$prop_type($wrapper { inner: x }.into())
                }
            }
        };
    }
59644
    let keys = match key {
        BorderRadius => {
261
            vec![
261
                CssPropertyType::BorderTopLeftRadius,
261
                CssPropertyType::BorderTopRightRadius,
261
                CssPropertyType::BorderBottomLeftRadius,
261
                CssPropertyType::BorderBottomRightRadius,
            ]
        }
        Overflow => {
1931
            vec![CssPropertyType::OverflowX, CssPropertyType::OverflowY]
        }
        Padding => {
7783
            vec![
7783
                CssPropertyType::PaddingTop,
7783
                CssPropertyType::PaddingBottom,
7783
                CssPropertyType::PaddingLeft,
7783
                CssPropertyType::PaddingRight,
            ]
        }
        Margin => {
7540
            vec![
7540
                CssPropertyType::MarginTop,
7540
                CssPropertyType::MarginBottom,
7540
                CssPropertyType::MarginLeft,
7540
                CssPropertyType::MarginRight,
            ]
        }
        Border => {
9552
            vec![
9552
                CssPropertyType::BorderTopColor,
9552
                CssPropertyType::BorderRightColor,
9552
                CssPropertyType::BorderLeftColor,
9552
                CssPropertyType::BorderBottomColor,
9552
                CssPropertyType::BorderTopStyle,
9552
                CssPropertyType::BorderRightStyle,
9552
                CssPropertyType::BorderLeftStyle,
9552
                CssPropertyType::BorderBottomStyle,
9552
                CssPropertyType::BorderTopWidth,
9552
                CssPropertyType::BorderRightWidth,
9552
                CssPropertyType::BorderLeftWidth,
9552
                CssPropertyType::BorderBottomWidth,
            ]
        }
        BorderLeft => {
25
            vec![
25
                CssPropertyType::BorderLeftColor,
25
                CssPropertyType::BorderLeftStyle,
25
                CssPropertyType::BorderLeftWidth,
            ]
        }
        BorderRight => {
1
            vec![
1
                CssPropertyType::BorderRightColor,
1
                CssPropertyType::BorderRightStyle,
1
                CssPropertyType::BorderRightWidth,
            ]
        }
        BorderTop => {
13
            vec![
13
                CssPropertyType::BorderTopColor,
13
                CssPropertyType::BorderTopStyle,
13
                CssPropertyType::BorderTopWidth,
            ]
        }
        BorderBottom => {
53
            vec![
53
                CssPropertyType::BorderBottomColor,
53
                CssPropertyType::BorderBottomStyle,
53
                CssPropertyType::BorderBottomWidth,
            ]
        }
        BorderColor => {
1
            vec![
1
                CssPropertyType::BorderTopColor,
1
                CssPropertyType::BorderRightColor,
1
                CssPropertyType::BorderBottomColor,
1
                CssPropertyType::BorderLeftColor,
            ]
        }
        BorderStyle => {
25
            vec![
25
                CssPropertyType::BorderTopStyle,
25
                CssPropertyType::BorderRightStyle,
25
                CssPropertyType::BorderBottomStyle,
25
                CssPropertyType::BorderLeftStyle,
            ]
        }
        BorderWidth => {
25
            vec![
25
                CssPropertyType::BorderTopWidth,
25
                CssPropertyType::BorderRightWidth,
25
                CssPropertyType::BorderBottomWidth,
25
                CssPropertyType::BorderLeftWidth,
            ]
        }
        BoxShadow => {
44
            vec![
44
                CssPropertyType::BoxShadowLeft,
44
                CssPropertyType::BoxShadowRight,
44
                CssPropertyType::BoxShadowTop,
44
                CssPropertyType::BoxShadowBottom,
            ]
        }
        BackgroundColor | BackgroundImage | Background => {
32121
            vec![CssPropertyType::BackgroundContent]
        }
        Flex => {
93
            vec![
93
                CssPropertyType::FlexGrow,
93
                CssPropertyType::FlexShrink,
93
                CssPropertyType::FlexBasis,
            ]
        }
        Grid => {
1
            vec![
1
                CssPropertyType::GridTemplateColumns,
1
                CssPropertyType::GridTemplateRows,
            ]
        }
        Gap | GridGap => {
42
            vec![CssPropertyType::RowGap, CssPropertyType::ColumnGap]
        }
        Font => {
1
            vec![CssPropertyType::Font]
        }
        Columns => {
1
            vec![CssPropertyType::ColumnWidth, CssPropertyType::ColumnCount]
        }
        GridArea => {
103
            vec![CssPropertyType::GridRow, CssPropertyType::GridColumn]
        }
        ColumnRule => {
1
            vec![
1
                CssPropertyType::ColumnRuleWidth,
1
                CssPropertyType::ColumnRuleStyle,
1
                CssPropertyType::ColumnRuleColor,
            ]
        }
        TextBox => {
25
            vec![CssPropertyType::TextBoxTrim, CssPropertyType::TextBoxEdge]
        }
        // +spec:writing-modes:798cca - inset-block/inset-inline shorthand expansion
        // In horizontal-tb (default), block axis = vertical, inline axis = horizontal.
        // First value = start side, second = end side; if omitted, second defaults to first.
        InsetBlock => {
1
            vec![CssPropertyType::Top, CssPropertyType::Bottom]
        }
        InsetInline => {
1
            vec![CssPropertyType::Left, CssPropertyType::Right]
        }
    };
    // For Overflow, "auto" is a typed value (LayoutOverflow::Auto), not the generic CSS keyword,
    // so we must not intercept it here and let the specific parser handle it below.
59644
    let has_typed_auto = matches!(key, Overflow);
59644
    let has_typed_none = false; // Currently no combined properties have typed "none"
26
    match value {
59644
        "auto" if !has_typed_auto => return Ok(keys.into_iter().map(CssProperty::auto).collect()),
59385
        "none" if !has_typed_none => return Ok(keys.into_iter().map(CssProperty::none).collect()),
59359
        "initial" => {
27
            return Ok(keys.into_iter().map(CssProperty::initial).collect());
        }
59332
        "inherit" => {
            return Ok(keys.into_iter().map(CssProperty::inherit).collect());
        }
59579
        _ => {}
    }
59579
    match key {
        BorderRadius => {
260
            let border_radius = parse_style_border_radius(value)?;
256
            Ok(vec![
256
                CssProperty::BorderTopLeftRadius(
256
                    StyleBorderTopLeftRadius {
256
                        inner: border_radius.top_left,
256
                    }
256
                    .into(),
256
                ),
256
                CssProperty::BorderTopRightRadius(
256
                    StyleBorderTopRightRadius {
256
                        inner: border_radius.top_right,
256
                    }
256
                    .into(),
256
                ),
256
                CssProperty::BorderBottomLeftRadius(
256
                    StyleBorderBottomLeftRadius {
256
                        inner: border_radius.bottom_left,
256
                    }
256
                    .into(),
256
                ),
256
                CssProperty::BorderBottomRightRadius(
256
                    StyleBorderBottomRightRadius {
256
                        inner: border_radius.bottom_right,
256
                    }
256
                    .into(),
256
                ),
256
            ])
        }
        // +spec:overflow:ff5ea4 - overflow shorthand sets overflow-x and overflow-y; second value copied from first if omitted
        Overflow => {
1930
            let parts: Vec<&str> = value.split_whitespace().collect();
1930
            match parts.len() {
                1 => {
1930
                    let overflow = parse_layout_overflow(value)?;
1930
                    Ok(vec![
1930
                        CssProperty::OverflowX(overflow.into()),
1930
                        CssProperty::OverflowY(overflow.into()),
1930
                    ])
                }
                2 => {
                    let overflow_x = parse_layout_overflow(parts[0])?;
                    let overflow_y = parse_layout_overflow(parts[1])?;
                    Ok(vec![
                        CssProperty::OverflowX(overflow_x.into()),
                        CssProperty::OverflowY(overflow_y.into()),
                    ])
                }
                _ => Err(CssParsingError::InvalidValue(InvalidValueErr(value))),
            }
        }
        Padding => {
7782
            let padding = parse_layout_padding(value)?;
7782
            Ok(vec![
7782
                convert_value!(padding.top, PaddingTop, LayoutPaddingTop),
7782
                convert_value!(padding.bottom, PaddingBottom, LayoutPaddingBottom),
7782
                convert_value!(padding.left, PaddingLeft, LayoutPaddingLeft),
7782
                convert_value!(padding.right, PaddingRight, LayoutPaddingRight),
            ])
        }
        Margin => {
7527
            let margin = parse_layout_margin(value)?;
7510
            Ok(vec![
7510
                convert_value!(margin.top, MarginTop, LayoutMarginTop),
7510
                convert_value!(margin.bottom, MarginBottom, LayoutMarginBottom),
7510
                convert_value!(margin.left, MarginLeft, LayoutMarginLeft),
7510
                convert_value!(margin.right, MarginRight, LayoutMarginRight),
            ])
        }
        Border => {
9551
            let border = parse_style_border(value)?;
9550
            Ok(vec![
9550
                CssProperty::BorderTopColor(
9550
                    StyleBorderTopColor {
9550
                        inner: border.border_color,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderRightColor(
9550
                    StyleBorderRightColor {
9550
                        inner: border.border_color,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderLeftColor(
9550
                    StyleBorderLeftColor {
9550
                        inner: border.border_color,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderBottomColor(
9550
                    StyleBorderBottomColor {
9550
                        inner: border.border_color,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderTopStyle(
9550
                    StyleBorderTopStyle {
9550
                        inner: border.border_style,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderRightStyle(
9550
                    StyleBorderRightStyle {
9550
                        inner: border.border_style,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderLeftStyle(
9550
                    StyleBorderLeftStyle {
9550
                        inner: border.border_style,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderBottomStyle(
9550
                    StyleBorderBottomStyle {
9550
                        inner: border.border_style,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderTopWidth(
9550
                    LayoutBorderTopWidth {
9550
                        inner: border.border_width,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderRightWidth(
9550
                    LayoutBorderRightWidth {
9550
                        inner: border.border_width,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderLeftWidth(
9550
                    LayoutBorderLeftWidth {
9550
                        inner: border.border_width,
9550
                    }
9550
                    .into(),
9550
                ),
9550
                CssProperty::BorderBottomWidth(
9550
                    LayoutBorderBottomWidth {
9550
                        inner: border.border_width,
9550
                    }
9550
                    .into(),
9550
                ),
9550
            ])
        }
        BorderLeft => {
24
            let border = parse_style_border(value)?;
24
            Ok(vec![
24
                CssProperty::BorderLeftColor(
24
                    StyleBorderLeftColor {
24
                        inner: border.border_color,
24
                    }
24
                    .into(),
24
                ),
24
                CssProperty::BorderLeftStyle(
24
                    StyleBorderLeftStyle {
24
                        inner: border.border_style,
24
                    }
24
                    .into(),
24
                ),
24
                CssProperty::BorderLeftWidth(
24
                    LayoutBorderLeftWidth {
24
                        inner: border.border_width,
24
                    }
24
                    .into(),
24
                ),
24
            ])
        }
        BorderRight => {
            let border = parse_style_border(value)?;
            Ok(vec![
                CssProperty::BorderRightColor(
                    StyleBorderRightColor {
                        inner: border.border_color,
                    }
                    .into(),
                ),
                CssProperty::BorderRightStyle(
                    StyleBorderRightStyle {
                        inner: border.border_style,
                    }
                    .into(),
                ),
                CssProperty::BorderRightWidth(
                    LayoutBorderRightWidth {
                        inner: border.border_width,
                    }
                    .into(),
                ),
            ])
        }
        BorderTop => {
12
            let border = parse_style_border(value)?;
12
            Ok(vec![
12
                CssProperty::BorderTopColor(
12
                    StyleBorderTopColor {
12
                        inner: border.border_color,
12
                    }
12
                    .into(),
12
                ),
12
                CssProperty::BorderTopStyle(
12
                    StyleBorderTopStyle {
12
                        inner: border.border_style,
12
                    }
12
                    .into(),
12
                ),
12
                CssProperty::BorderTopWidth(
12
                    LayoutBorderTopWidth {
12
                        inner: border.border_width,
12
                    }
12
                    .into(),
12
                ),
12
            ])
        }
        BorderBottom => {
52
            let border = parse_style_border(value)?;
24
            Ok(vec![
24
                CssProperty::BorderBottomColor(
24
                    StyleBorderBottomColor {
24
                        inner: border.border_color,
24
                    }
24
                    .into(),
24
                ),
24
                CssProperty::BorderBottomStyle(
24
                    StyleBorderBottomStyle {
24
                        inner: border.border_style,
24
                    }
24
                    .into(),
24
                ),
24
                CssProperty::BorderBottomWidth(
24
                    LayoutBorderBottomWidth {
24
                        inner: border.border_width,
24
                    }
24
                    .into(),
24
                ),
24
            ])
        }
        BorderColor => {
            let colors = parse_style_border_color(value)?;
            Ok(vec![
                CssProperty::BorderTopColor(StyleBorderTopColor { inner: colors.top }.into()),
                CssProperty::BorderRightColor(
                    StyleBorderRightColor {
                        inner: colors.right,
                    }
                    .into(),
                ),
                CssProperty::BorderBottomColor(
                    StyleBorderBottomColor {
                        inner: colors.bottom,
                    }
                    .into(),
                ),
                CssProperty::BorderLeftColor(StyleBorderLeftColor { inner: colors.left }.into()),
            ])
        }
        BorderStyle => {
12
            let styles = parse_style_border_style(value)?;
12
            Ok(vec![
12
                CssProperty::BorderTopStyle(StyleBorderTopStyle { inner: styles.top }.into()),
12
                CssProperty::BorderRightStyle(
12
                    StyleBorderRightStyle {
12
                        inner: styles.right,
12
                    }
12
                    .into(),
12
                ),
12
                CssProperty::BorderBottomStyle(
12
                    StyleBorderBottomStyle {
12
                        inner: styles.bottom,
12
                    }
12
                    .into(),
12
                ),
12
                CssProperty::BorderLeftStyle(StyleBorderLeftStyle { inner: styles.left }.into()),
12
            ])
        }
        BorderWidth => {
24
            let widths = parse_style_border_width(value)?;
24
            Ok(vec![
24
                CssProperty::BorderTopWidth(LayoutBorderTopWidth { inner: widths.top }.into()),
24
                CssProperty::BorderRightWidth(
24
                    LayoutBorderRightWidth {
24
                        inner: widths.right,
24
                    }
24
                    .into(),
24
                ),
24
                CssProperty::BorderBottomWidth(
24
                    LayoutBorderBottomWidth {
24
                        inner: widths.bottom,
24
                    }
24
                    .into(),
24
                ),
24
                CssProperty::BorderLeftWidth(LayoutBorderLeftWidth { inner: widths.left }.into()),
24
            ])
        }
        BoxShadow => {
43
            let box_shadow = parse_style_box_shadow(value)?;
36
            Ok(vec![
36
                CssProperty::BoxShadowLeft(CssPropertyValue::Exact(BoxOrStatic::heap(box_shadow))),
36
                CssProperty::BoxShadowRight(CssPropertyValue::Exact(BoxOrStatic::heap(box_shadow))),
36
                CssProperty::BoxShadowTop(CssPropertyValue::Exact(BoxOrStatic::heap(box_shadow))),
36
                CssProperty::BoxShadowBottom(CssPropertyValue::Exact(BoxOrStatic::heap(
36
                    box_shadow,
36
                ))),
36
            ])
        }
        BackgroundColor => {
746
            let color = parse_css_color(value)?;
746
            let vec: StyleBackgroundContentVec = vec![StyleBackgroundContent::Color(color)].into();
746
            Ok(vec![CssProperty::BackgroundContent(
746
                CssPropertyValue::Exact(vec),
746
            )])
        }
        BackgroundImage => {
24
            let background_content = parse_style_background_content(value)?;
24
            let vec: StyleBackgroundContentVec = vec![background_content].into();
24
            Ok(vec![CssProperty::BackgroundContent(
24
                CssPropertyValue::Exact(vec),
24
            )])
        }
        Background => {
31348
            let background_content = parse_style_background_content_multiple(value)?;
31337
            Ok(vec![CssProperty::BackgroundContent(
31337
                CssPropertyValue::Exact(background_content),
31337
            )])
        }
        Flex => {
            // parse shorthand into grow/shrink/basis
78
            let parts: Vec<&str> = value.split_whitespace().collect();
78
            if parts.len() == 1 && parts[0] == "none" {
                return Ok(vec![
                    CssProperty::FlexGrow(
                        LayoutFlexGrow {
                            inner: crate::props::basic::length::FloatValue::const_new(0),
                        }
                        .into(),
                    ),
                    CssProperty::FlexShrink(
                        LayoutFlexShrink {
                            inner: crate::props::basic::length::FloatValue::const_new(0),
                        }
                        .into(),
                    ),
                    CssProperty::FlexBasis(LayoutFlexBasis::Auto.into()),
                ]);
78
            }
78
            if parts.len() == 1 {
                // CSS spec: flex: <number> => grow: <number>, shrink: 1, basis: 0
38
                if let Ok(g) = parse_layout_flex_grow(parts[0]) {
38
                    return Ok(vec![
38
                        CssProperty::FlexGrow(g.into()),
38
                        CssProperty::FlexShrink(
38
                            LayoutFlexShrink {
38
                                inner: crate::props::basic::length::FloatValue::const_new(1),
38
                            }
38
                            .into(),
38
                        ),
38
                        CssProperty::FlexBasis(
38
                            LayoutFlexBasis::Exact(PixelValue::px(0.0))
38
                                .into(),
38
                        ),
38
                    ]);
                }
                if let Ok(b) = parse_layout_flex_basis(parts[0]) {
                    return Ok(vec![CssProperty::FlexBasis(b.into())]);
                }
40
            }
40
            if parts.len() == 2 {
                // CSS spec: flex: <number> <number> => grow, shrink, basis: 0
                // Try grow+shrink first (two unitless numbers)
7
                if let (Ok(g), Ok(s)) = (
14
                    parse_layout_flex_grow(parts[0]),
14
                    parse_layout_flex_shrink(parts[1]),
                ) {
7
                    return Ok(vec![
7
                        CssProperty::FlexGrow(g.into()),
7
                        CssProperty::FlexShrink(s.into()),
7
                        CssProperty::FlexBasis(
7
                            LayoutFlexBasis::Exact(PixelValue::px(0.0))
7
                                .into(),
7
                        ),
7
                    ]);
7
                }
                // CSS spec: flex: <number> <width> => grow, shrink: 1, basis: <width>
7
                if let (Ok(g), Ok(b)) = (
7
                    parse_layout_flex_grow(parts[0]),
7
                    parse_layout_flex_basis(parts[1]),
                ) {
7
                    return Ok(vec![
7
                        CssProperty::FlexGrow(g.into()),
7
                        CssProperty::FlexShrink(
7
                            LayoutFlexShrink {
7
                                inner: crate::props::basic::length::FloatValue::const_new(1),
7
                            }
7
                            .into(),
7
                        ),
7
                        CssProperty::FlexBasis(b.into()),
7
                    ]);
                }
26
            }
26
            if parts.len() == 3 {
26
                let g = parse_layout_flex_grow(parts[0])?;
26
                let s = parse_layout_flex_shrink(parts[1])?;
26
                let b = parse_layout_flex_basis(parts[2])?;
26
                return Ok(vec![
26
                    CssProperty::FlexGrow(g.into()),
26
                    CssProperty::FlexShrink(s.into()),
26
                    CssProperty::FlexBasis(b.into()),
26
                ]);
            }
            Err(CssParsingError::InvalidValue(InvalidValueErr(value)))
        }
        Grid => {
            // minimal: try to parse as grid-template and set both columns and rows
            let tpl = parse_grid_template(value)?;
            Ok(vec![
                CssProperty::GridTemplateColumns(tpl.clone().into()),
                CssProperty::GridTemplateRows(tpl.into()),
            ])
        }
        Gap => {
40
            let parts: Vec<&str> = value.split_whitespace().collect();
40
            if parts.len() == 1 {
40
                let g = parse_layout_gap(parts[0])?;
40
                Ok(vec![
40
                    CssProperty::RowGap(LayoutRowGap { inner: g.inner }.into()),
40
                    CssProperty::ColumnGap(LayoutColumnGap { inner: g.inner }.into()),
40
                ])
            } else if parts.len() == 2 {
                let row = parse_layout_gap(parts[0])?;
                let col = parse_layout_gap(parts[1])?;
                Ok(vec![
                    CssProperty::RowGap(LayoutRowGap { inner: row.inner }.into()),
                    CssProperty::ColumnGap(LayoutColumnGap { inner: col.inner }.into()),
                ])
            } else {
                Err(CssParsingError::InvalidValue(InvalidValueErr(value)))
            }
        }
        GridGap => {
            let parts: Vec<&str> = value.split_whitespace().collect();
            if parts.len() == 1 {
                let g = parse_layout_gap(parts[0])?;
                Ok(vec![
                    CssProperty::RowGap(LayoutRowGap { inner: g.inner }.into()),
                    CssProperty::ColumnGap(LayoutColumnGap { inner: g.inner }.into()),
                ])
            } else if parts.len() == 2 {
                let row = parse_layout_gap(parts[0])?;
                let col = parse_layout_gap(parts[1])?;
                Ok(vec![
                    CssProperty::RowGap(LayoutRowGap { inner: row.inner }.into()),
                    CssProperty::ColumnGap(LayoutColumnGap { inner: col.inner }.into()),
                ])
            } else {
                Err(CssParsingError::InvalidValue(InvalidValueErr(value)))
            }
        }
        Font => {
            let fam = parse_style_font_family(value)?;
            Ok(vec![CssProperty::Font(fam.into())])
        }
        Columns => {
            let mut props = Vec::new();
            for part in value.split_whitespace() {
                if let Ok(width) = parse_column_width(part) {
                    props.push(CssProperty::ColumnWidth(width.into()));
                } else if let Ok(count) = parse_column_count(part) {
                    props.push(CssProperty::ColumnCount(count.into()));
                } else {
                    return Err(CssParsingError::InvalidValue(InvalidValueErr(value)));
                }
            }
            Ok(props)
        }
        GridArea => {
            // CSS grid-area shorthand: grid-area: <name>
            // Expands to grid-row: <name> / <name> and grid-column: <name> / <name>
            // This tells taffy to resolve the named area via NamedLineResolver.
            //
            // Full syntax: grid-area: row-start / column-start / row-end / column-end
            // But for named areas, typically just: grid-area: <name>
102
            let parts: Vec<&str> = value.split('/').map(str::trim).collect();
102
            let (row_start, col_start, row_end, col_end) = match parts.len() {
102
                1 => (parts[0], parts[0], parts[0], parts[0]),
                2 => (parts[0], parts[1], parts[0], parts[1]),
                3 => (parts[0], parts[1], parts[2], parts[1]),
                4 => (parts[0], parts[1], parts[2], parts[3]),
                _ => return Err(CssParsingError::InvalidValue(InvalidValueErr(value))),
            };
408
            let parse_line = |s: &str| -> Result<GridLine, CssParsingError<'_>> {
408
                parse_grid_line_owned(s.trim())
408
                    .map_err(|()| CssParsingError::InvalidValue(InvalidValueErr(value)))
408
            };
102
            Ok(vec![
                CssProperty::GridRow(CssPropertyValue::Exact(GridPlacement {
102
                    grid_start: parse_line(row_start)?,
102
                    grid_end: parse_line(row_end)?,
                })),
                CssProperty::GridColumn(CssPropertyValue::Exact(GridPlacement {
102
                    grid_start: parse_line(col_start)?,
102
                    grid_end: parse_line(col_end)?,
                })),
            ])
        }
        ColumnRule => {
            let border = parse_style_border(value)?;
            Ok(vec![
                CssProperty::ColumnRuleWidth(
                    ColumnRuleWidth {
                        inner: border.border_width,
                    }
                    .into(),
                ),
                CssProperty::ColumnRuleStyle(
                    ColumnRuleStyle {
                        inner: border.border_style,
                    }
                    .into(),
                ),
                CssProperty::ColumnRuleColor(
                    ColumnRuleColor {
                        inner: border.border_color,
                    }
                    .into(),
                ),
            ])
        }
        // +spec:overflow:33aaf7 - text-box shorthand: "normal" sets trim=none/edge=auto,
        // omitting trim defaults to "both", omitting edge defaults to "auto"
        TextBox => {
24
            let trimmed = value.trim();
24
            if trimmed == "normal" {
                return Ok(vec![
                    CssProperty::TextBoxTrim(CssPropertyValue::Exact(StyleTextBoxTrim::None)),
                    CssProperty::TextBoxEdge(CssPropertyValue::Exact(StyleTextBoxEdge::AUTO)),
                ]);
24
            }
            // Trim keywords are single tokens; the edge is ONE value of up
            // to TWO tokens ("cap alphabetic"). Collect all non-trim tokens
            // and parse them as one edge - the per-token loop rejected every
            // two-token edge and silently dropped the whole declaration.
24
            let parts: Vec<&str> = trimmed.split_whitespace().collect();
24
            let mut trim_val = None;
24
            let mut edge_tokens: Vec<&str> = Vec::new();
84
            for part in &parts {
60
                if let Ok(t) = parse_style_text_box_trim(part) {
24
                    if trim_val.is_some() {
                        return Err(CssParsingError::InvalidValue(InvalidValueErr(value)));
24
                    }
24
                    trim_val = Some(t);
36
                } else {
36
                    edge_tokens.push(part);
36
                }
            }
24
            let edge_val = if edge_tokens.is_empty() {
                None
            } else {
24
                match parse_style_text_box_edge(&edge_tokens.join(" ")) {
24
                    Ok(e) => Some(e),
                    Err(_) => return Err(CssParsingError::InvalidValue(InvalidValueErr(value))),
                }
            };
            // Per spec: omitting trim defaults to "both" (not the initial "none")
24
            let trim = trim_val.unwrap_or(StyleTextBoxTrim::TrimBoth);
            // Per spec: omitting edge defaults to "auto" (the initial value)
24
            let edge = edge_val.unwrap_or(StyleTextBoxEdge::AUTO);
24
            Ok(vec![
24
                CssProperty::TextBoxTrim(CssPropertyValue::Exact(trim)),
24
                CssProperty::TextBoxEdge(CssPropertyValue::Exact(edge)),
24
            ])
        }
        // +spec:writing-modes:798cca - inset-block shorthand: first value = start, second = end;
        // if omitted, second defaults to first. Maps to top/bottom in horizontal-tb.
        InsetBlock => {
            let parts: Vec<&str> = value.split_whitespace().collect();
            let start_val = parts
                .first()
                .ok_or(CssParsingError::InvalidValue(InvalidValueErr(value)))?;
            let end_val = parts.get(1).unwrap_or(start_val);
            let start = parse_layout_top(start_val)?;
            let end = parse_layout_bottom(end_val)?;
            Ok(vec![
                CssProperty::Top(start.into()),
                CssProperty::Bottom(end.into()),
            ])
        }
        // +spec:writing-modes:798cca - inset-inline shorthand: first value = start, second = end;
        // if omitted, second defaults to first. Maps to left/right in horizontal-tb.
        InsetInline => {
            let parts: Vec<&str> = value.split_whitespace().collect();
            let start_val = parts
                .first()
                .ok_or(CssParsingError::InvalidValue(InvalidValueErr(value)))?;
            let end_val = parts.get(1).unwrap_or(start_val);
            let start = parse_layout_left(start_val)?;
            let end = parse_layout_right(end_val)?;
            Ok(vec![
                CssProperty::Left(start.into()),
                CssProperty::Right(end.into()),
            ])
        }
    }
59644
}
// Re-add the From implementations for convenience
macro_rules! impl_from_css_prop {
    ($a:ident, $b:ident:: $enum_type:ident) => {
        impl From<$a> for $b {
281087
            fn from(e: $a) -> Self {
281087
                $b::$enum_type(CssPropertyValue::from(e))
281087
            }
        }
    };
}
impl_from_css_prop!(CaretColor, CssProperty::CaretColor);
impl_from_css_prop!(CaretWidth, CssProperty::CaretWidth);
impl_from_css_prop!(CaretAnimationDuration, CssProperty::CaretAnimationDuration);
impl_from_css_prop!(
    SelectionBackgroundColor,
    CssProperty::SelectionBackgroundColor
);
impl_from_css_prop!(SelectionColor, CssProperty::SelectionColor);
impl_from_css_prop!(SelectionRadius, CssProperty::SelectionRadius);
impl_from_css_prop!(StyleTextColor, CssProperty::TextColor);
impl_from_css_prop!(StyleFontSize, CssProperty::FontSize);
impl_from_css_prop!(StyleFontFamilyVec, CssProperty::FontFamily);
impl_from_css_prop!(StyleTextAlign, CssProperty::TextAlign);
impl_from_css_prop!(LayoutTextJustify, CssProperty::TextJustify);
impl_from_css_prop!(StyleVerticalAlign, CssProperty::VerticalAlign);
impl_from_css_prop!(StyleLetterSpacing, CssProperty::LetterSpacing);
impl_from_css_prop!(StyleTextIndent, CssProperty::TextIndent);
impl_from_css_prop!(StyleInitialLetter, CssProperty::InitialLetter);
impl_from_css_prop!(StyleLineClamp, CssProperty::LineClamp);
impl_from_css_prop!(StyleHangingPunctuation, CssProperty::HangingPunctuation);
impl_from_css_prop!(StyleTextCombineUpright, CssProperty::TextCombineUpright);
impl_from_css_prop!(StyleUnicodeBidi, CssProperty::UnicodeBidi);
impl_from_css_prop!(StyleTextBoxTrim, CssProperty::TextBoxTrim);
impl_from_css_prop!(StyleTextBoxEdge, CssProperty::TextBoxEdge);
impl_from_css_prop!(StyleDominantBaseline, CssProperty::DominantBaseline);
impl_from_css_prop!(StyleAlignmentBaseline, CssProperty::AlignmentBaseline);
impl_from_css_prop!(StyleBaselineSource, CssProperty::BaselineSource);
impl_from_css_prop!(StyleLineFitEdge, CssProperty::LineFitEdge);
impl_from_css_prop!(StyleInitialLetterAlign, CssProperty::InitialLetterAlign);
impl_from_css_prop!(StyleInitialLetterWrap, CssProperty::InitialLetterWrap);
impl_from_css_prop!(StyleScrollbarGutter, CssProperty::ScrollbarGutter);
impl_from_css_prop!(StyleOverflowClipMargin, CssProperty::OverflowClipMargin);
impl_from_css_prop!(StyleClipRect, CssProperty::Clip);
impl_from_css_prop!(StyleExclusionMargin, CssProperty::ExclusionMargin);
impl_from_css_prop!(StyleHyphenationLanguage, CssProperty::HyphenationLanguage);
impl_from_css_prop!(StyleLineHeight, CssProperty::LineHeight);
impl_from_css_prop!(StyleWordSpacing, CssProperty::WordSpacing);
impl_from_css_prop!(StyleTabSize, CssProperty::TabSize);
impl_from_css_prop!(StyleCursor, CssProperty::Cursor);
impl_from_css_prop!(LayoutDisplay, CssProperty::Display);
impl_from_css_prop!(LayoutFloat, CssProperty::Float);
impl_from_css_prop!(LayoutBoxSizing, CssProperty::BoxSizing);
impl_from_css_prop!(LayoutWidth, CssProperty::Width);
impl_from_css_prop!(LayoutHeight, CssProperty::Height);
impl_from_css_prop!(LayoutMinWidth, CssProperty::MinWidth);
impl_from_css_prop!(LayoutMinHeight, CssProperty::MinHeight);
impl_from_css_prop!(LayoutMaxWidth, CssProperty::MaxWidth);
impl_from_css_prop!(LayoutMaxHeight, CssProperty::MaxHeight);
impl_from_css_prop!(LayoutPosition, CssProperty::Position);
impl_from_css_prop!(LayoutTop, CssProperty::Top);
impl_from_css_prop!(LayoutRight, CssProperty::Right);
impl_from_css_prop!(LayoutLeft, CssProperty::Left);
impl_from_css_prop!(LayoutInsetBottom, CssProperty::Bottom);
impl_from_css_prop!(LayoutFlexWrap, CssProperty::FlexWrap);
impl_from_css_prop!(LayoutFlexDirection, CssProperty::FlexDirection);
impl_from_css_prop!(LayoutFlexGrow, CssProperty::FlexGrow);
impl_from_css_prop!(LayoutFlexShrink, CssProperty::FlexShrink);
impl_from_css_prop!(LayoutFlexBasis, CssProperty::FlexBasis);
impl_from_css_prop!(LayoutJustifyContent, CssProperty::JustifyContent);
impl_from_css_prop!(LayoutAlignItems, CssProperty::AlignItems);
impl_from_css_prop!(LayoutAlignContent, CssProperty::AlignContent);
impl_from_css_prop!(LayoutColumnGap, CssProperty::ColumnGap);
impl_from_css_prop!(LayoutRowGap, CssProperty::RowGap);
impl_from_css_prop!(LayoutGridAutoFlow, CssProperty::GridAutoFlow);
impl_from_css_prop!(LayoutJustifySelf, CssProperty::JustifySelf);
impl_from_css_prop!(LayoutJustifyItems, CssProperty::JustifyItems);
impl_from_css_prop!(LayoutGap, CssProperty::Gap);
impl_from_css_prop!(LayoutAlignSelf, CssProperty::AlignSelf);
impl_from_css_prop!(LayoutWritingMode, CssProperty::WritingMode);
impl_from_css_prop!(LayoutClear, CssProperty::Clear);
// BackgroundContent uses the standard From pattern
impl_from_css_prop!(StyleBackgroundContentVec, CssProperty::BackgroundContent);
impl_from_css_prop!(StyleBackgroundPositionVec, CssProperty::BackgroundPosition);
impl_from_css_prop!(StyleBackgroundSizeVec, CssProperty::BackgroundSize);
impl_from_css_prop!(StyleBackgroundRepeatVec, CssProperty::BackgroundRepeat);
impl_from_css_prop!(LayoutPaddingTop, CssProperty::PaddingTop);
impl_from_css_prop!(LayoutPaddingLeft, CssProperty::PaddingLeft);
impl_from_css_prop!(LayoutPaddingRight, CssProperty::PaddingRight);
impl_from_css_prop!(LayoutPaddingBottom, CssProperty::PaddingBottom);
impl_from_css_prop!(LayoutPaddingInlineStart, CssProperty::PaddingInlineStart);
impl_from_css_prop!(LayoutPaddingInlineEnd, CssProperty::PaddingInlineEnd);
impl_from_css_prop!(LayoutMarginTop, CssProperty::MarginTop);
impl_from_css_prop!(LayoutMarginLeft, CssProperty::MarginLeft);
impl_from_css_prop!(LayoutMarginRight, CssProperty::MarginRight);
impl_from_css_prop!(LayoutMarginBottom, CssProperty::MarginBottom);
impl_from_css_prop!(StyleBorderTopLeftRadius, CssProperty::BorderTopLeftRadius);
impl_from_css_prop!(StyleBorderTopRightRadius, CssProperty::BorderTopRightRadius);
impl_from_css_prop!(
    StyleBorderBottomLeftRadius,
    CssProperty::BorderBottomLeftRadius
);
impl_from_css_prop!(
    StyleBorderBottomRightRadius,
    CssProperty::BorderBottomRightRadius
);
impl_from_css_prop!(StyleBorderTopColor, CssProperty::BorderTopColor);
impl_from_css_prop!(StyleBorderRightColor, CssProperty::BorderRightColor);
impl_from_css_prop!(StyleBorderLeftColor, CssProperty::BorderLeftColor);
impl_from_css_prop!(StyleBorderBottomColor, CssProperty::BorderBottomColor);
impl_from_css_prop!(StyleBorderTopStyle, CssProperty::BorderTopStyle);
impl_from_css_prop!(StyleBorderRightStyle, CssProperty::BorderRightStyle);
impl_from_css_prop!(StyleBorderLeftStyle, CssProperty::BorderLeftStyle);
impl_from_css_prop!(StyleBorderBottomStyle, CssProperty::BorderBottomStyle);
impl_from_css_prop!(LayoutBorderTopWidth, CssProperty::BorderTopWidth);
impl_from_css_prop!(LayoutBorderRightWidth, CssProperty::BorderRightWidth);
impl_from_css_prop!(LayoutBorderLeftWidth, CssProperty::BorderLeftWidth);
impl_from_css_prop!(LayoutBorderBottomWidth, CssProperty::BorderBottomWidth);
impl_from_css_prop!(LayoutScrollbarWidth, CssProperty::ScrollbarWidth);
impl_from_css_prop!(StyleScrollbarColor, CssProperty::ScrollbarColor);
impl_from_css_prop!(ScrollbarVisibilityMode, CssProperty::ScrollbarVisibility);
impl_from_css_prop!(ScrollbarFadeDelay, CssProperty::ScrollbarFadeDelay);
impl_from_css_prop!(ScrollbarFadeDuration, CssProperty::ScrollbarFadeDuration);
impl_from_css_prop!(StyleOpacity, CssProperty::Opacity);
impl_from_css_prop!(StyleVisibility, CssProperty::Visibility);
impl_from_css_prop!(StyleTransformVec, CssProperty::Transform);
impl_from_css_prop!(StyleTransformOrigin, CssProperty::TransformOrigin);
impl_from_css_prop!(StylePerspectiveOrigin, CssProperty::PerspectiveOrigin);
impl_from_css_prop!(StyleBackfaceVisibility, CssProperty::BackfaceVisibility);
impl_from_css_prop!(StyleMixBlendMode, CssProperty::MixBlendMode);
impl_from_css_prop!(StyleHyphens, CssProperty::Hyphens);
impl_from_css_prop!(StyleWordBreak, CssProperty::WordBreak);
impl_from_css_prop!(StyleOverflowWrap, CssProperty::OverflowWrap);
impl_from_css_prop!(StyleLineBreak, CssProperty::LineBreak);
impl_from_css_prop!(StyleTextOverflow, CssProperty::TextOverflow);
impl_from_css_prop!(StyleObjectFit, CssProperty::ObjectFit);
impl_from_css_prop!(StyleObjectPosition, CssProperty::ObjectPosition);
impl_from_css_prop!(StyleAspectRatio, CssProperty::AspectRatio);
impl_from_css_prop!(StyleTextOrientation, CssProperty::TextOrientation);
impl_from_css_prop!(StyleTextAlignLast, CssProperty::TextAlignLast);
impl_from_css_prop!(StyleTextTransform, CssProperty::TextTransform);
impl_from_css_prop!(StyleDirection, CssProperty::Direction);
impl_from_css_prop!(StyleWhiteSpace, CssProperty::WhiteSpace);
impl_from_css_prop!(PageBreak, CssProperty::BreakBefore);
impl_from_css_prop!(BreakInside, CssProperty::BreakInside);
impl_from_css_prop!(Widows, CssProperty::Widows);
impl_from_css_prop!(Orphans, CssProperty::Orphans);
impl_from_css_prop!(BoxDecorationBreak, CssProperty::BoxDecorationBreak);
impl_from_css_prop!(ColumnCount, CssProperty::ColumnCount);
impl_from_css_prop!(ColumnWidth, CssProperty::ColumnWidth);
impl_from_css_prop!(ColumnSpan, CssProperty::ColumnSpan);
impl_from_css_prop!(ColumnFill, CssProperty::ColumnFill);
impl_from_css_prop!(ColumnRuleWidth, CssProperty::ColumnRuleWidth);
impl_from_css_prop!(ColumnRuleStyle, CssProperty::ColumnRuleStyle);
impl_from_css_prop!(ColumnRuleColor, CssProperty::ColumnRuleColor);
impl_from_css_prop!(FlowInto, CssProperty::FlowInto);
impl_from_css_prop!(FlowFrom, CssProperty::FlowFrom);
impl_from_css_prop!(ShapeOutside, CssProperty::ShapeOutside);
impl_from_css_prop!(ShapeInside, CssProperty::ShapeInside);
impl_from_css_prop!(ClipPath, CssProperty::ClipPath);
impl_from_css_prop!(ShapeMargin, CssProperty::ShapeMargin);
impl_from_css_prop!(ShapeImageThreshold, CssProperty::ShapeImageThreshold);
impl_from_css_prop!(Content, CssProperty::Content);
impl_from_css_prop!(CounterReset, CssProperty::CounterReset);
impl_from_css_prop!(CounterIncrement, CssProperty::CounterIncrement);
impl_from_css_prop!(StyleListStyleType, CssProperty::ListStyleType);
impl_from_css_prop!(StyleListStylePosition, CssProperty::ListStylePosition);
impl_from_css_prop!(StringSet, CssProperty::StringSet);
impl_from_css_prop!(LayoutTableLayout, CssProperty::TableLayout);
impl_from_css_prop!(StyleBorderCollapse, CssProperty::BorderCollapse);
impl_from_css_prop!(LayoutBorderSpacing, CssProperty::BorderSpacing);
impl_from_css_prop!(StyleCaptionSide, CssProperty::CaptionSide);
impl_from_css_prop!(StyleEmptyCells, CssProperty::EmptyCells);
impl CssProperty {
979
    #[must_use] pub const fn key(&self) -> &'static str {
979
        self.get_type().to_str()
979
    }
    // Every arm delegates to `v.get_css_value_fmt()`, but each `v` is a different
    // `CssPropertyValue<T>` — the identical bodies cannot merge into one or-pattern
    // (mismatched binding types), so clippy::match_same_arms is a false positive here.
    #[allow(clippy::match_same_arms)]
    #[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
2740
    #[must_use] pub fn value(&self) -> String {
2740
        match self {
14
            Self::CaretColor(v) => v.get_css_value_fmt(),
14
            Self::CaretWidth(v) => v.get_css_value_fmt(),
14
            Self::CaretAnimationDuration(v) => v.get_css_value_fmt(),
14
            Self::Animation(v) => v.get_css_value_fmt(),
14
            Self::AnimationIn(v) => v.get_css_value_fmt(),
14
            Self::AnimationOut(v) => v.get_css_value_fmt(),
14
            Self::SelectionBackgroundColor(v) => v.get_css_value_fmt(),
14
            Self::SelectionColor(v) => v.get_css_value_fmt(),
14
            Self::SelectionRadius(v) => v.get_css_value_fmt(),
14
            Self::TextJustify(v) => v.get_css_value_fmt(),
14
            Self::TextColor(v) => v.get_css_value_fmt(),
48
            Self::FontSize(v) => v.get_css_value_fmt(),
14
            Self::FontFamily(v) => v.get_css_value_fmt(),
14
            Self::TextAlign(v) => v.get_css_value_fmt(),
14
            Self::LetterSpacing(v) => v.get_css_value_fmt(),
14
            Self::TextIndent(v) => v.get_css_value_fmt(),
14
            Self::InitialLetter(v) => v.get_css_value_fmt(),
14
            Self::LineClamp(v) => v.get_css_value_fmt(),
14
            Self::HangingPunctuation(v) => v.get_css_value_fmt(),
14
            Self::TextCombineUpright(v) => v.get_css_value_fmt(),
14
            Self::UnicodeBidi(v) => v.get_css_value_fmt(),
15
            Self::TextBoxTrim(v) => v.get_css_value_fmt(),
15
            Self::TextBoxEdge(v) => v.get_css_value_fmt(),
14
            Self::DominantBaseline(v) => v.get_css_value_fmt(),
14
            Self::AlignmentBaseline(v) => v.get_css_value_fmt(),
14
            Self::BaselineSource(v) => v.get_css_value_fmt(),
14
            Self::LineFitEdge(v) => v.get_css_value_fmt(),
14
            Self::InitialLetterAlign(v) => v.get_css_value_fmt(),
14
            Self::InitialLetterWrap(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarGutter(v) => v.get_css_value_fmt(),
14
            Self::OverflowClipMargin(v) => v.get_css_value_fmt(),
14
            Self::Clip(v) => v.get_css_value_fmt(),
14
            Self::ExclusionMargin(v) => v.get_css_value_fmt(),
14
            Self::HyphenationLanguage(v) => v.get_css_value_fmt(),
14
            Self::LineHeight(v) => v.get_css_value_fmt(),
14
            Self::WordSpacing(v) => v.get_css_value_fmt(),
14
            Self::TabSize(v) => v.get_css_value_fmt(),
14
            Self::Cursor(v) => v.get_css_value_fmt(),
14
            Self::Display(v) => v.get_css_value_fmt(),
14
            Self::Float(v) => v.get_css_value_fmt(),
14
            Self::BoxSizing(v) => v.get_css_value_fmt(),
30
            Self::Width(v) => v.get_css_value_fmt(),
14
            Self::Height(v) => v.get_css_value_fmt(),
14
            Self::MinWidth(v) => v.get_css_value_fmt(),
14
            Self::MinHeight(v) => v.get_css_value_fmt(),
14
            Self::MaxWidth(v) => v.get_css_value_fmt(),
14
            Self::MaxHeight(v) => v.get_css_value_fmt(),
14
            Self::Position(v) => v.get_css_value_fmt(),
15
            Self::Top(v) => v.get_css_value_fmt(),
15
            Self::Right(v) => v.get_css_value_fmt(),
15
            Self::Left(v) => v.get_css_value_fmt(),
15
            Self::Bottom(v) => v.get_css_value_fmt(),
14
            Self::ZIndex(v) => v.get_css_value_fmt(),
14
            Self::FlexWrap(v) => v.get_css_value_fmt(),
14
            Self::FlexDirection(v) => v.get_css_value_fmt(),
15
            Self::FlexGrow(v) => v.get_css_value_fmt(),
15
            Self::FlexShrink(v) => v.get_css_value_fmt(),
15
            Self::FlexBasis(v) => v.get_css_value_fmt(),
14
            Self::JustifyContent(v) => v.get_css_value_fmt(),
14
            Self::AlignItems(v) => v.get_css_value_fmt(),
14
            Self::AlignContent(v) => v.get_css_value_fmt(),
16
            Self::ColumnGap(v) => v.get_css_value_fmt(),
16
            Self::RowGap(v) => v.get_css_value_fmt(),
15
            Self::GridTemplateColumns(v) => v.get_css_value_fmt(),
15
            Self::GridTemplateRows(v) => v.get_css_value_fmt(),
14
            Self::GridAutoFlow(v) => v.get_css_value_fmt(),
14
            Self::JustifySelf(v) => v.get_css_value_fmt(),
14
            Self::JustifyItems(v) => v.get_css_value_fmt(),
14
            Self::Gap(v) => v.get_css_value_fmt(),
14
            Self::GridGap(v) => v.get_css_value_fmt(),
14
            Self::AlignSelf(v) => v.get_css_value_fmt(),
15
            Self::Font(v) => v.get_css_value_fmt(),
14
            Self::GridAutoColumns(v) => v.get_css_value_fmt(),
14
            Self::GridAutoRows(v) => v.get_css_value_fmt(),
15
            Self::GridColumn(v) => v.get_css_value_fmt(),
15
            Self::GridRow(v) => v.get_css_value_fmt(),
14
            Self::GridTemplateAreas(v) => v.get_css_value_fmt(),
14
            Self::WritingMode(v) => v.get_css_value_fmt(),
14
            Self::Clear(v) => v.get_css_value_fmt(),
17
            Self::BackgroundContent(v) => v.get_css_value_fmt(),
14
            Self::BackgroundPosition(v) => v.get_css_value_fmt(),
14
            Self::BackgroundSize(v) => v.get_css_value_fmt(),
14
            Self::BackgroundRepeat(v) => v.get_css_value_fmt(),
15
            Self::OverflowX(v) => v.get_css_value_fmt(),
15
            Self::OverflowY(v) => v.get_css_value_fmt(),
14
            Self::OverflowBlock(v) => v.get_css_value_fmt(),
14
            Self::OverflowInline(v) => v.get_css_value_fmt(),
15
            Self::PaddingTop(v) => v.get_css_value_fmt(),
15
            Self::PaddingLeft(v) => v.get_css_value_fmt(),
15
            Self::PaddingRight(v) => v.get_css_value_fmt(),
15
            Self::PaddingBottom(v) => v.get_css_value_fmt(),
14
            Self::PaddingInlineStart(v) => v.get_css_value_fmt(),
14
            Self::PaddingInlineEnd(v) => v.get_css_value_fmt(),
16
            Self::MarginTop(v) => v.get_css_value_fmt(),
16
            Self::MarginLeft(v) => v.get_css_value_fmt(),
16
            Self::MarginRight(v) => v.get_css_value_fmt(),
16
            Self::MarginBottom(v) => v.get_css_value_fmt(),
15
            Self::BorderTopLeftRadius(v) => v.get_css_value_fmt(),
15
            Self::BorderTopRightRadius(v) => v.get_css_value_fmt(),
15
            Self::BorderBottomLeftRadius(v) => v.get_css_value_fmt(),
15
            Self::BorderBottomRightRadius(v) => v.get_css_value_fmt(),
17
            Self::BorderTopColor(v) => v.get_css_value_fmt(),
17
            Self::BorderRightColor(v) => v.get_css_value_fmt(),
17
            Self::BorderLeftColor(v) => v.get_css_value_fmt(),
17
            Self::BorderBottomColor(v) => v.get_css_value_fmt(),
17
            Self::BorderTopStyle(v) => v.get_css_value_fmt(),
17
            Self::BorderRightStyle(v) => v.get_css_value_fmt(),
17
            Self::BorderLeftStyle(v) => v.get_css_value_fmt(),
17
            Self::BorderBottomStyle(v) => v.get_css_value_fmt(),
17
            Self::BorderTopWidth(v) => v.get_css_value_fmt(),
17
            Self::BorderRightWidth(v) => v.get_css_value_fmt(),
17
            Self::BorderLeftWidth(v) => v.get_css_value_fmt(),
17
            Self::BorderBottomWidth(v) => v.get_css_value_fmt(),
15
            Self::BoxShadowLeft(v) => v.get_css_value_fmt(),
15
            Self::BoxShadowRight(v) => v.get_css_value_fmt(),
15
            Self::BoxShadowTop(v) => v.get_css_value_fmt(),
15
            Self::BoxShadowBottom(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarTrack(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarThumb(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarButton(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarCorner(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarResizer(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarWidth(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarColor(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarVisibility(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarFadeDelay(v) => v.get_css_value_fmt(),
14
            Self::ScrollbarFadeDuration(v) => v.get_css_value_fmt(),
14
            Self::Opacity(v) => v.get_css_value_fmt(),
14
            Self::Visibility(v) => v.get_css_value_fmt(),
14
            Self::Transform(v) => v.get_css_value_fmt(),
14
            Self::TransformOrigin(v) => v.get_css_value_fmt(),
14
            Self::PerspectiveOrigin(v) => v.get_css_value_fmt(),
14
            Self::BackfaceVisibility(v) => v.get_css_value_fmt(),
14
            Self::MixBlendMode(v) => v.get_css_value_fmt(),
14
            Self::Filter(v) => v.get_css_value_fmt(),
14
            Self::BackdropFilter(v) => v.get_css_value_fmt(),
14
            Self::TextShadow(v) => v.get_css_value_fmt(),
14
            Self::Hyphens(v) => v.get_css_value_fmt(),
14
            Self::WordBreak(v) => v.get_css_value_fmt(),
14
            Self::OverflowWrap(v) => v.get_css_value_fmt(),
14
            Self::LineBreak(v) => v.get_css_value_fmt(),
16
            Self::TextOverflow(v) => v.get_css_value_fmt(),
14
            Self::ObjectFit(v) => v.get_css_value_fmt(),
14
            Self::ObjectPosition(v) => v.get_css_value_fmt(),
14
            Self::AspectRatio(v) => v.get_css_value_fmt(),
14
            Self::TextOrientation(v) => v.get_css_value_fmt(),
14
            Self::TextAlignLast(v) => v.get_css_value_fmt(),
14
            Self::TextTransform(v) => v.get_css_value_fmt(),
14
            Self::Direction(v) => v.get_css_value_fmt(),
14
            Self::UserSelect(v) => v.get_css_value_fmt(),
14
            Self::TextDecoration(v) => v.get_css_value_fmt(),
14
            Self::WhiteSpace(v) => v.get_css_value_fmt(),
14
            Self::BreakBefore(v) => v.get_css_value_fmt(),
14
            Self::BreakAfter(v) => v.get_css_value_fmt(),
14
            Self::BreakInside(v) => v.get_css_value_fmt(),
14
            Self::Orphans(v) => v.get_css_value_fmt(),
14
            Self::Widows(v) => v.get_css_value_fmt(),
14
            Self::BoxDecorationBreak(v) => v.get_css_value_fmt(),
15
            Self::ColumnCount(v) => v.get_css_value_fmt(),
15
            Self::ColumnWidth(v) => v.get_css_value_fmt(),
14
            Self::ColumnSpan(v) => v.get_css_value_fmt(),
14
            Self::ColumnFill(v) => v.get_css_value_fmt(),
15
            Self::ColumnRuleWidth(v) => v.get_css_value_fmt(),
15
            Self::ColumnRuleStyle(v) => v.get_css_value_fmt(),
15
            Self::ColumnRuleColor(v) => v.get_css_value_fmt(),
14
            Self::FlowInto(v) => v.get_css_value_fmt(),
14
            Self::FlowFrom(v) => v.get_css_value_fmt(),
14
            Self::ShapeOutside(v) => v.get_css_value_fmt(),
14
            Self::ShapeInside(v) => v.get_css_value_fmt(),
14
            Self::ClipPath(v) => v.get_css_value_fmt(),
14
            Self::ShapeMargin(v) => v.get_css_value_fmt(),
14
            Self::ShapeImageThreshold(v) => v.get_css_value_fmt(),
14
            Self::Content(v) => v.get_css_value_fmt(),
14
            Self::CounterReset(v) => v.get_css_value_fmt(),
14
            Self::CounterIncrement(v) => v.get_css_value_fmt(),
14
            Self::ListStyleType(v) => v.get_css_value_fmt(),
14
            Self::ListStylePosition(v) => v.get_css_value_fmt(),
14
            Self::StringSet(v) => v.get_css_value_fmt(),
14
            Self::TableLayout(v) => v.get_css_value_fmt(),
14
            Self::BorderCollapse(v) => v.get_css_value_fmt(),
14
            Self::BorderSpacing(v) => v.get_css_value_fmt(),
14
            Self::CaptionSide(v) => v.get_css_value_fmt(),
14
            Self::EmptyCells(v) => v.get_css_value_fmt(),
14
            Self::FontWeight(v) => v.get_css_value_fmt(),
14
            Self::FontStyle(v) => v.get_css_value_fmt(),
14
            Self::VerticalAlign(v) => v.get_css_value_fmt(),
        }
2740
    }
793
    #[must_use] pub fn format_css(&self) -> String {
793
        format!("{}: {};", self.key(), self.value())
793
    }
    #[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
3684
    #[must_use] pub fn interpolate(
3684
        &self,
3684
        other: &Self,
3684
        t: f32,
3684
        interpolate_resolver: &InterpolateResolver,
3684
    ) -> Self {
3684
        if t <= 0.0 {
5
            return self.clone();
3679
        } else if t >= 1.0 {
52
            return other.clone();
3627
        }
        // Map from linear interpolation function to Easing curve
3627
        let t: f32 = interpolate_resolver.interpolate_func.evaluate(f64::from(t));
3627
        let t = t.clamp(0.0, 1.0);
3627
        match (self, other) {
720
            (Self::TextColor(col_start), Self::TextColor(col_end)) => {
720
                let col_start = col_start.get_property().copied().unwrap_or_default();
720
                let col_end = col_end.get_property().copied().unwrap_or_default();
720
                Self::text_color(col_start.interpolate(&col_end, t))
            }
24
            (Self::FontSize(fs_start), Self::FontSize(fs_end)) => {
24
                let fs_start = fs_start.get_property().copied().unwrap_or_default();
24
                let fs_end = fs_end.get_property().copied().unwrap_or_default();
24
                Self::font_size(fs_start.interpolate(&fs_end, t))
            }
            (Self::LetterSpacing(ls_start), Self::LetterSpacing(ls_end)) => {
                let ls_start = ls_start.get_property().copied().unwrap_or_default();
                let ls_end = ls_end.get_property().copied().unwrap_or_default();
                Self::letter_spacing(ls_start.interpolate(&ls_end, t))
            }
            (Self::TextIndent(ti_start), Self::TextIndent(ti_end)) => {
                let ti_start = ti_start.get_property().copied().unwrap_or_default();
                let ti_end = ti_end.get_property().copied().unwrap_or_default();
                Self::text_indent(ti_start.interpolate(&ti_end, t))
            }
            (Self::LineHeight(lh_start), Self::LineHeight(lh_end)) => {
                let lh_start = lh_start.get_property().copied().unwrap_or_default();
                let lh_end = lh_end.get_property().copied().unwrap_or_default();
                Self::line_height(lh_start.interpolate(&lh_end, t))
            }
            (Self::WordSpacing(ws_start), Self::WordSpacing(ws_end)) => {
                let ws_start = ws_start.get_property().copied().unwrap_or_default();
                let ws_end = ws_end.get_property().copied().unwrap_or_default();
                Self::word_spacing(ws_start.interpolate(&ws_end, t))
            }
            (Self::TabSize(tw_start), Self::TabSize(tw_end)) => {
                let tw_start = tw_start.get_property().copied().unwrap_or_default();
                let tw_end = tw_end.get_property().copied().unwrap_or_default();
                Self::tab_size(tw_start.interpolate(&tw_end, t))
            }
1440
            (Self::Width(start), Self::Width(end)) => {
1440
                let start =
1440
                    start
1440
                        .get_property()
1440
                        .cloned()
1440
                        .unwrap_or(LayoutWidth::Px(PixelValue::px(
1440
                            interpolate_resolver.current_rect_width,
1440
                        )));
1440
                let end = end.get_property().cloned().unwrap_or_default();
1440
                Self::Width(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::Height(start), Self::Height(end)) => {
                let start =
                    start
                        .get_property()
                        .cloned()
                        .unwrap_or(LayoutHeight::Px(PixelValue::px(
                            interpolate_resolver.current_rect_height,
                        )));
                let end = end.get_property().cloned().unwrap_or_default();
                Self::Height(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::MinWidth(start), Self::MinWidth(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::MinWidth(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::MinHeight(start), Self::MinHeight(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::MinHeight(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::MaxWidth(start), Self::MaxWidth(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::MaxWidth(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::MaxHeight(start), Self::MaxHeight(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::MaxHeight(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::Top(start), Self::Top(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::Top(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::Right(start), Self::Right(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::Right(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::Left(start), Self::Left(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::Left(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::Bottom(start), Self::Bottom(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::Bottom(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::FlexGrow(start), Self::FlexGrow(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::FlexGrow(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::FlexShrink(start), Self::FlexShrink(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::FlexShrink(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::PaddingTop(start), Self::PaddingTop(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::PaddingTop(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::PaddingLeft(start), Self::PaddingLeft(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::PaddingLeft(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::PaddingRight(start), Self::PaddingRight(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::PaddingRight(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::PaddingBottom(start), Self::PaddingBottom(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::PaddingBottom(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::MarginTop(start), Self::MarginTop(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::MarginTop(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::MarginLeft(start), Self::MarginLeft(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::MarginLeft(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::MarginRight(start), Self::MarginRight(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::MarginRight(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::MarginBottom(start), Self::MarginBottom(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::MarginBottom(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::BorderTopLeftRadius(start), Self::BorderTopLeftRadius(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderTopLeftRadius(CssPropertyValue::Exact(
                    start.interpolate(&end, t),
                ))
            }
            (Self::BorderTopRightRadius(start), Self::BorderTopRightRadius(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderTopRightRadius(CssPropertyValue::Exact(
                    start.interpolate(&end, t),
                ))
            }
            (
                Self::BorderBottomLeftRadius(start),
                Self::BorderBottomLeftRadius(end),
            ) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderBottomLeftRadius(CssPropertyValue::Exact(
                    start.interpolate(&end, t),
                ))
            }
            (
                Self::BorderBottomRightRadius(start),
                Self::BorderBottomRightRadius(end),
            ) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderBottomRightRadius(CssPropertyValue::Exact(
                    start.interpolate(&end, t),
                ))
            }
            (Self::BorderTopColor(start), Self::BorderTopColor(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderTopColor(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::BorderRightColor(start), Self::BorderRightColor(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderRightColor(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::BorderLeftColor(start), Self::BorderLeftColor(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderLeftColor(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::BorderBottomColor(start), Self::BorderBottomColor(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderBottomColor(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::BorderTopWidth(start), Self::BorderTopWidth(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderTopWidth(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::BorderRightWidth(start), Self::BorderRightWidth(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderRightWidth(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::BorderLeftWidth(start), Self::BorderLeftWidth(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderLeftWidth(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::BorderBottomWidth(start), Self::BorderBottomWidth(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::BorderBottomWidth(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
1440
            (Self::Opacity(start), Self::Opacity(end)) => {
1440
                let start = start.get_property().copied().unwrap_or_default();
1440
                let end = end.get_property().copied().unwrap_or_default();
1440
                Self::Opacity(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::TransformOrigin(start), Self::TransformOrigin(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::TransformOrigin(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            (Self::PerspectiveOrigin(start), Self::PerspectiveOrigin(end)) => {
                let start = start.get_property().copied().unwrap_or_default();
                let end = end.get_property().copied().unwrap_or_default();
                Self::PerspectiveOrigin(CssPropertyValue::Exact(start.interpolate(&end, t)))
            }
            /*
            animate transform:
            CssProperty::Transform(CssPropertyValue<StyleTransformVec>),
            animate box shadow:
            CssProperty::BoxShadowLeft(CssPropertyValue<StyleBoxShadow>),
            CssProperty::BoxShadowRight(CssPropertyValue<StyleBoxShadow>),
            CssProperty::BoxShadowTop(CssPropertyValue<StyleBoxShadow>),
            CssProperty::BoxShadowBottom(CssPropertyValue<StyleBoxShadow>),
            animate background:
            CssProperty::BackgroundContent(CssPropertyValue<StyleBackgroundContentVec>),
            CssProperty::BackgroundPosition(CssPropertyValue<StyleBackgroundPositionVec>),
            CssProperty::BackgroundSize(CssPropertyValue<StyleBackgroundSizeVec>),
            */
            (_, _) => {
                // not animatable, fallback
3
                if t > 0.5 {
1
                    other.clone()
                } else {
2
                    self.clone()
                }
            }
        }
3684
    }
    /// Return the type (key) of this property as a statically typed enum
    #[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
41999459
    #[must_use] pub const fn get_type(&self) -> CssPropertyType {
41999459
        match &self {
11
            Self::CaretColor(_) => CssPropertyType::CaretColor,
11
            Self::CaretWidth(_) => CssPropertyType::CaretWidth,
203
            Self::CaretAnimationDuration(_) => CssPropertyType::CaretAnimationDuration,
203
            Self::Animation(_) => CssPropertyType::Animation,
107
            Self::AnimationIn(_) => CssPropertyType::AnimationIn,
443
            Self::AnimationOut(_) => CssPropertyType::AnimationOut,
83
            Self::SelectionBackgroundColor(_) => CssPropertyType::SelectionBackgroundColor,
83
            Self::SelectionColor(_) => CssPropertyType::SelectionColor,
11
            Self::SelectionRadius(_) => CssPropertyType::SelectionRadius,
11
            Self::TextJustify(_) => CssPropertyType::TextJustify,
1580385
            Self::TextColor(_) => CssPropertyType::TextColor,
1221379
            Self::FontSize(_) => CssPropertyType::FontSize,
414959
            Self::FontFamily(_) => CssPropertyType::FontFamily,
3713
            Self::FontWeight(_) => CssPropertyType::FontWeight,
83
            Self::FontStyle(_) => CssPropertyType::FontStyle,
654992
            Self::TextAlign(_) => CssPropertyType::TextAlign,
2021
            Self::VerticalAlign(_) => CssPropertyType::VerticalAlign,
119
            Self::LetterSpacing(_) => CssPropertyType::LetterSpacing,
47
            Self::TextIndent(_) => CssPropertyType::TextIndent,
11
            Self::InitialLetter(_) => CssPropertyType::InitialLetter,
11
            Self::LineClamp(_) => CssPropertyType::LineClamp,
11
            Self::HangingPunctuation(_) => CssPropertyType::HangingPunctuation,
11
            Self::TextCombineUpright(_) => CssPropertyType::TextCombineUpright,
11
            Self::UnicodeBidi(_) => CssPropertyType::UnicodeBidi,
60
            Self::TextBoxTrim(_) => CssPropertyType::TextBoxTrim,
60
            Self::TextBoxEdge(_) => CssPropertyType::TextBoxEdge,
11
            Self::DominantBaseline(_) => CssPropertyType::DominantBaseline,
11
            Self::AlignmentBaseline(_) => CssPropertyType::AlignmentBaseline,
11
            Self::BaselineSource(_) => CssPropertyType::BaselineSource,
11
            Self::LineFitEdge(_) => CssPropertyType::LineFitEdge,
11
            Self::InitialLetterAlign(_) => CssPropertyType::InitialLetterAlign,
11
            Self::InitialLetterWrap(_) => CssPropertyType::InitialLetterWrap,
11
            Self::ScrollbarGutter(_) => CssPropertyType::ScrollbarGutter,
11
            Self::OverflowClipMargin(_) => CssPropertyType::OverflowClipMargin,
11
            Self::Clip(_) => CssPropertyType::Clip,
11
            Self::ExclusionMargin(_) => CssPropertyType::ExclusionMargin,
11
            Self::HyphenationLanguage(_) => CssPropertyType::HyphenationLanguage,
69299
            Self::LineHeight(_) => CssPropertyType::LineHeight,
47
            Self::WordSpacing(_) => CssPropertyType::WordSpacing,
11
            Self::TabSize(_) => CssPropertyType::TabSize,
1315313
            Self::Cursor(_) => CssPropertyType::Cursor,
1852503
            Self::Display(_) => CssPropertyType::Display,
947
            Self::Float(_) => CssPropertyType::Float,
2293415
            Self::BoxSizing(_) => CssPropertyType::BoxSizing,
475711
            Self::Width(_) => CssPropertyType::Width,
665559
            Self::Height(_) => CssPropertyType::Height,
176345
            Self::MinWidth(_) => CssPropertyType::MinWidth,
12323
            Self::MinHeight(_) => CssPropertyType::MinHeight,
3335
            Self::MaxWidth(_) => CssPropertyType::MaxWidth,
1187
            Self::MaxHeight(_) => CssPropertyType::MaxHeight,
77561
            Self::Position(_) => CssPropertyType::Position,
29022
            Self::Top(_) => CssPropertyType::Top,
3342
            Self::Right(_) => CssPropertyType::Right,
28866
            Self::Left(_) => CssPropertyType::Left,
2034
            Self::Bottom(_) => CssPropertyType::Bottom,
269
            Self::ZIndex(_) => CssPropertyType::ZIndex,
6317
            Self::FlexWrap(_) => CssPropertyType::FlexWrap,
999749
            Self::FlexDirection(_) => CssPropertyType::FlexDirection,
1781418
            Self::FlexGrow(_) => CssPropertyType::FlexGrow,
548220
            Self::FlexShrink(_) => CssPropertyType::FlexShrink,
41064
            Self::FlexBasis(_) => CssPropertyType::FlexBasis,
232721
            Self::JustifyContent(_) => CssPropertyType::JustifyContent,
735857
            Self::AlignItems(_) => CssPropertyType::AlignItems,
11
            Self::AlignContent(_) => CssPropertyType::AlignContent,
37
            Self::ColumnGap(_) => CssPropertyType::ColumnGap,
37
            Self::RowGap(_) => CssPropertyType::RowGap,
84
            Self::GridTemplateColumns(_) => CssPropertyType::GridTemplateColumns,
84
            Self::GridTemplateRows(_) => CssPropertyType::GridTemplateRows,
11
            Self::GridAutoColumns(_) => CssPropertyType::GridAutoColumns,
11
            Self::GridAutoRows(_) => CssPropertyType::GridAutoRows,
132
            Self::GridColumn(_) => CssPropertyType::GridColumn,
11
            Self::GridAutoFlow(_) => CssPropertyType::GridAutoFlow,
11
            Self::JustifySelf(_) => CssPropertyType::JustifySelf,
11
            Self::JustifyItems(_) => CssPropertyType::JustifyItems,
11
            Self::Gap(_) => CssPropertyType::Gap,
11
            Self::GridGap(_) => CssPropertyType::GridGap,
28559
            Self::AlignSelf(_) => CssPropertyType::AlignSelf,
12
            Self::Font(_) => CssPropertyType::Font,
132
            Self::GridRow(_) => CssPropertyType::GridRow,
35
            Self::GridTemplateAreas(_) => CssPropertyType::GridTemplateAreas,
143
            Self::WritingMode(_) => CssPropertyType::WritingMode,
179
            Self::Clear(_) => CssPropertyType::Clear,
760134
            Self::BackgroundContent(_) => CssPropertyType::BackgroundContent,
155
            Self::BackgroundPosition(_) => CssPropertyType::BackgroundPosition,
11
            Self::BackgroundSize(_) => CssPropertyType::BackgroundSize,
155
            Self::BackgroundRepeat(_) => CssPropertyType::BackgroundRepeat,
78927
            Self::OverflowX(_) => CssPropertyType::OverflowX,
80115
            Self::OverflowY(_) => CssPropertyType::OverflowY,
11
            Self::OverflowBlock(_) => CssPropertyType::OverflowBlock,
35
            Self::OverflowInline(_) => CssPropertyType::OverflowInline,
2510457
            Self::PaddingTop(_) => CssPropertyType::PaddingTop,
2414244
            Self::PaddingLeft(_) => CssPropertyType::PaddingLeft,
2413893
            Self::PaddingRight(_) => CssPropertyType::PaddingRight,
2391129
            Self::PaddingBottom(_) => CssPropertyType::PaddingBottom,
11
            Self::PaddingInlineStart(_) => CssPropertyType::PaddingInlineStart,
11
            Self::PaddingInlineEnd(_) => CssPropertyType::PaddingInlineEnd,
2302261
            Self::MarginTop(_) => CssPropertyType::MarginTop,
2247745
            Self::MarginLeft(_) => CssPropertyType::MarginLeft,
2015377
            Self::MarginRight(_) => CssPropertyType::MarginRight,
2275984
            Self::MarginBottom(_) => CssPropertyType::MarginBottom,
204624
            Self::BorderTopLeftRadius(_) => CssPropertyType::BorderTopLeftRadius,
204624
            Self::BorderTopRightRadius(_) => CssPropertyType::BorderTopRightRadius,
206112
            Self::BorderBottomLeftRadius(_) => CssPropertyType::BorderBottomLeftRadius,
206112
            Self::BorderBottomRightRadius(_) => CssPropertyType::BorderBottomRightRadius,
390380
            Self::BorderTopColor(_) => CssPropertyType::BorderTopColor,
506855
            Self::BorderRightColor(_) => CssPropertyType::BorderRightColor,
351587
            Self::BorderLeftColor(_) => CssPropertyType::BorderLeftColor,
502031
            Self::BorderBottomColor(_) => CssPropertyType::BorderBottomColor,
332960
            Self::BorderTopStyle(_) => CssPropertyType::BorderTopStyle,
385031
            Self::BorderRightStyle(_) => CssPropertyType::BorderRightStyle,
294167
            Self::BorderLeftStyle(_) => CssPropertyType::BorderLeftStyle,
433931
            Self::BorderBottomStyle(_) => CssPropertyType::BorderBottomStyle,
356480
            Self::BorderTopWidth(_) => CssPropertyType::BorderTopWidth,
413243
            Self::BorderRightWidth(_) => CssPropertyType::BorderRightWidth,
322475
            Self::BorderLeftWidth(_) => CssPropertyType::BorderLeftWidth,
462167
            Self::BorderBottomWidth(_) => CssPropertyType::BorderBottomWidth,
1860
            Self::BoxShadowLeft(_) => CssPropertyType::BoxShadowLeft,
1860
            Self::BoxShadowRight(_) => CssPropertyType::BoxShadowRight,
1860
            Self::BoxShadowTop(_) => CssPropertyType::BoxShadowTop,
1860
            Self::BoxShadowBottom(_) => CssPropertyType::BoxShadowBottom,
11
            Self::ScrollbarTrack(_) => CssPropertyType::ScrollbarTrack,
11
            Self::ScrollbarThumb(_) => CssPropertyType::ScrollbarThumb,
11
            Self::ScrollbarButton(_) => CssPropertyType::ScrollbarButton,
11
            Self::ScrollbarCorner(_) => CssPropertyType::ScrollbarCorner,
11
            Self::ScrollbarResizer(_) => CssPropertyType::ScrollbarResizer,
515
            Self::ScrollbarWidth(_) => CssPropertyType::ScrollbarWidth,
1271
            Self::ScrollbarColor(_) => CssPropertyType::ScrollbarColor,
515
            Self::ScrollbarVisibility(_) => CssPropertyType::ScrollbarVisibility,
536
            Self::ScrollbarFadeDelay(_) => CssPropertyType::ScrollbarFadeDelay,
536
            Self::ScrollbarFadeDuration(_) => CssPropertyType::ScrollbarFadeDuration,
59363
            Self::Opacity(_) => CssPropertyType::Opacity,
53
            Self::Visibility(_) => CssPropertyType::Visibility,
11741
            Self::Transform(_) => CssPropertyType::Transform,
11
            Self::PerspectiveOrigin(_) => CssPropertyType::PerspectiveOrigin,
11
            Self::TransformOrigin(_) => CssPropertyType::TransformOrigin,
11
            Self::BackfaceVisibility(_) => CssPropertyType::BackfaceVisibility,
11
            Self::MixBlendMode(_) => CssPropertyType::MixBlendMode,
59
            Self::Filter(_) => CssPropertyType::Filter,
11
            Self::BackdropFilter(_) => CssPropertyType::BackdropFilter,
11
            Self::TextShadow(_) => CssPropertyType::TextShadow,
26999
            Self::WhiteSpace(_) => CssPropertyType::WhiteSpace,
11
            Self::Hyphens(_) => CssPropertyType::Hyphens,
11
            Self::WordBreak(_) => CssPropertyType::WordBreak,
47
            Self::OverflowWrap(_) => CssPropertyType::OverflowWrap,
11
            Self::LineBreak(_) => CssPropertyType::LineBreak,
13
            Self::TextOverflow(_) => CssPropertyType::TextOverflow,
11
            Self::ObjectFit(_) => CssPropertyType::ObjectFit,
11
            Self::ObjectPosition(_) => CssPropertyType::ObjectPosition,
515
            Self::AspectRatio(_) => CssPropertyType::AspectRatio,
11
            Self::TextOrientation(_) => CssPropertyType::TextOrientation,
11
            Self::TextAlignLast(_) => CssPropertyType::TextAlignLast,
83
            Self::TextTransform(_) => CssPropertyType::TextTransform,
119
            Self::Direction(_) => CssPropertyType::Direction,
1557947
            Self::UserSelect(_) => CssPropertyType::UserSelect,
941
            Self::TextDecoration(_) => CssPropertyType::TextDecoration,
35
            Self::BreakBefore(_) => CssPropertyType::BreakBefore,
1235
            Self::BreakAfter(_) => CssPropertyType::BreakAfter,
2324
            Self::BreakInside(_) => CssPropertyType::BreakInside,
59
            Self::Orphans(_) => CssPropertyType::Orphans,
59
            Self::Widows(_) => CssPropertyType::Widows,
11
            Self::BoxDecorationBreak(_) => CssPropertyType::BoxDecorationBreak,
12
            Self::ColumnCount(_) => CssPropertyType::ColumnCount,
12
            Self::ColumnWidth(_) => CssPropertyType::ColumnWidth,
11
            Self::ColumnSpan(_) => CssPropertyType::ColumnSpan,
11
            Self::ColumnFill(_) => CssPropertyType::ColumnFill,
12
            Self::ColumnRuleWidth(_) => CssPropertyType::ColumnRuleWidth,
12
            Self::ColumnRuleStyle(_) => CssPropertyType::ColumnRuleStyle,
12
            Self::ColumnRuleColor(_) => CssPropertyType::ColumnRuleColor,
11
            Self::FlowInto(_) => CssPropertyType::FlowInto,
11
            Self::FlowFrom(_) => CssPropertyType::FlowFrom,
11
            Self::ShapeOutside(_) => CssPropertyType::ShapeOutside,
11
            Self::ShapeInside(_) => CssPropertyType::ShapeInside,
11
            Self::ClipPath(_) => CssPropertyType::ClipPath,
11
            Self::ShapeMargin(_) => CssPropertyType::ShapeMargin,
11
            Self::ShapeImageThreshold(_) => CssPropertyType::ShapeImageThreshold,
53
            Self::Content(_) => CssPropertyType::Content,
797
            Self::CounterReset(_) => CssPropertyType::CounterReset,
11
            Self::CounterIncrement(_) => CssPropertyType::CounterIncrement,
797
            Self::ListStyleType(_) => CssPropertyType::ListStyleType,
11
            Self::ListStylePosition(_) => CssPropertyType::ListStylePosition,
11
            Self::StringSet(_) => CssPropertyType::StringSet,
12
            Self::TableLayout(_) => CssPropertyType::TableLayout,
348
            Self::BorderCollapse(_) => CssPropertyType::BorderCollapse,
71
            Self::BorderSpacing(_) => CssPropertyType::BorderSpacing,
12
            Self::CaptionSide(_) => CssPropertyType::CaptionSide,
12
            Self::EmptyCells(_) => CssPropertyType::EmptyCells,
        }
41999459
    }
    // const constructors for easier API access
670
    #[must_use] pub const fn none(prop_type: CssPropertyType) -> Self {
670
        css_property_from_type!(prop_type, None)
670
    }
640
    #[must_use] pub const fn auto(prop_type: CssPropertyType) -> Self {
640
        css_property_from_type!(prop_type, Auto)
640
    }
1243
    #[must_use] pub const fn initial(prop_type: CssPropertyType) -> Self {
1243
        css_property_from_type!(prop_type, Initial)
1243
    }
559
    #[must_use] pub const fn inherit(prop_type: CssPropertyType) -> Self {
559
        css_property_from_type!(prop_type, Inherit)
559
    }
720
    #[must_use] pub const fn text_color(input: StyleTextColor) -> Self {
720
        Self::TextColor(CssPropertyValue::Exact(input))
720
    }
672
    #[must_use] pub const fn font_size(input: StyleFontSize) -> Self {
672
        Self::FontSize(CssPropertyValue::Exact(input))
672
    }
165
    #[must_use] pub const fn font_family(input: StyleFontFamilyVec) -> Self {
165
        Self::FontFamily(CssPropertyValue::Exact(input))
165
    }
9
    #[must_use] pub const fn font_weight(input: StyleFontWeight) -> Self {
9
        Self::FontWeight(CssPropertyValue::Exact(input))
9
    }
    #[must_use] pub const fn font_style(input: StyleFontStyle) -> Self {
        Self::FontStyle(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn text_align(input: StyleTextAlign) -> Self {
        Self::TextAlign(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn text_justify(input: LayoutTextJustify) -> Self {
        Self::TextJustify(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn vertical_align(input: StyleVerticalAlign) -> Self {
        Self::VerticalAlign(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn letter_spacing(input: StyleLetterSpacing) -> Self {
        Self::LetterSpacing(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn text_indent(input: StyleTextIndent) -> Self {
        Self::TextIndent(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn line_height(input: StyleLineHeight) -> Self {
        Self::LineHeight(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn word_spacing(input: StyleWordSpacing) -> Self {
        Self::WordSpacing(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn tab_size(input: StyleTabSize) -> Self {
        Self::TabSize(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn cursor(input: StyleCursor) -> Self {
        Self::Cursor(CssPropertyValue::Exact(input))
    }
272220
    #[must_use] pub const fn user_select(input: StyleUserSelect) -> Self {
272220
        Self::UserSelect(CssPropertyValue::Exact(input))
272220
    }
    #[must_use] pub const fn text_decoration(input: StyleTextDecoration) -> Self {
        Self::TextDecoration(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn display(input: LayoutDisplay) -> Self {
        Self::Display(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn box_sizing(input: LayoutBoxSizing) -> Self {
        Self::BoxSizing(CssPropertyValue::Exact(input))
    }
15859
    #[must_use] pub const fn width(input: LayoutWidth) -> Self {
15859
        Self::Width(CssPropertyValue::Exact(input))
15859
    }
155
    #[must_use] pub const fn height(input: LayoutHeight) -> Self {
155
        Self::Height(CssPropertyValue::Exact(input))
155
    }
    #[must_use] pub const fn min_width(input: LayoutMinWidth) -> Self {
        Self::MinWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn caret_color(input: CaretColor) -> Self {
        Self::CaretColor(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn caret_width(input: CaretWidth) -> Self {
        Self::CaretWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn caret_animation_duration(input: CaretAnimationDuration) -> Self {
        Self::CaretAnimationDuration(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn selection_background_color(input: SelectionBackgroundColor) -> Self {
        Self::SelectionBackgroundColor(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn selection_color(input: SelectionColor) -> Self {
        Self::SelectionColor(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn min_height(input: LayoutMinHeight) -> Self {
        Self::MinHeight(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn max_width(input: LayoutMaxWidth) -> Self {
        Self::MaxWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn max_height(input: LayoutMaxHeight) -> Self {
        Self::MaxHeight(CssPropertyValue::Exact(input))
    }
176
    #[must_use] pub const fn position(input: LayoutPosition) -> Self {
176
        Self::Position(CssPropertyValue::Exact(input))
176
    }
    #[must_use] pub const fn top(input: LayoutTop) -> Self {
        Self::Top(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn right(input: LayoutRight) -> Self {
        Self::Right(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn left(input: LayoutLeft) -> Self {
        Self::Left(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn bottom(input: LayoutInsetBottom) -> Self {
        Self::Bottom(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn z_index(input: LayoutZIndex) -> Self {
        Self::ZIndex(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn flex_wrap(input: LayoutFlexWrap) -> Self {
        Self::FlexWrap(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn flex_direction(input: LayoutFlexDirection) -> Self {
        Self::FlexDirection(CssPropertyValue::Exact(input))
    }
352
    #[must_use] pub const fn flex_grow(input: LayoutFlexGrow) -> Self {
352
        Self::FlexGrow(CssPropertyValue::Exact(input))
352
    }
    #[must_use] pub const fn flex_shrink(input: LayoutFlexShrink) -> Self {
        Self::FlexShrink(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn justify_content(input: LayoutJustifyContent) -> Self {
        Self::JustifyContent(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn grid_auto_flow(input: LayoutGridAutoFlow) -> Self {
        Self::GridAutoFlow(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn justify_self(input: LayoutJustifySelf) -> Self {
        Self::JustifySelf(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn justify_items(input: LayoutJustifyItems) -> Self {
        Self::JustifyItems(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn gap(input: LayoutGap) -> Self {
        Self::Gap(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn grid_gap(input: LayoutGap) -> Self {
        Self::GridGap(CssPropertyValue::Exact(input))
    }
42053
    #[must_use] pub const fn align_self(input: LayoutAlignSelf) -> Self {
42053
        Self::AlignSelf(CssPropertyValue::Exact(input))
42053
    }
    #[must_use] pub const fn font(input: StyleFontFamilyVec) -> Self {
        Self::Font(StyleFontValue::Exact(input))
    }
    #[must_use] pub const fn align_items(input: LayoutAlignItems) -> Self {
        Self::AlignItems(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn align_content(input: LayoutAlignContent) -> Self {
        Self::AlignContent(CssPropertyValue::Exact(input))
    }
176
    #[must_use] pub const fn background_content(input: StyleBackgroundContentVec) -> Self {
176
        Self::BackgroundContent(CssPropertyValue::Exact(input))
176
    }
176
    #[must_use] pub const fn background_position(input: StyleBackgroundPositionVec) -> Self {
176
        Self::BackgroundPosition(CssPropertyValue::Exact(input))
176
    }
    #[must_use] pub const fn background_size(input: StyleBackgroundSizeVec) -> Self {
        Self::BackgroundSize(CssPropertyValue::Exact(input))
    }
176
    #[must_use] pub const fn background_repeat(input: StyleBackgroundRepeatVec) -> Self {
176
        Self::BackgroundRepeat(CssPropertyValue::Exact(input))
176
    }
352
    #[must_use] pub const fn overflow_x(input: LayoutOverflow) -> Self {
352
        Self::OverflowX(CssPropertyValue::Exact(input))
352
    }
352
    #[must_use] pub const fn overflow_y(input: LayoutOverflow) -> Self {
352
        Self::OverflowY(CssPropertyValue::Exact(input))
352
    }
    #[must_use] pub const fn overflow_block(input: LayoutOverflow) -> Self {
        Self::OverflowBlock(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn overflow_inline(input: LayoutOverflow) -> Self {
        Self::OverflowInline(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn padding_top(input: LayoutPaddingTop) -> Self {
        Self::PaddingTop(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn padding_left(input: LayoutPaddingLeft) -> Self {
        Self::PaddingLeft(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn padding_right(input: LayoutPaddingRight) -> Self {
        Self::PaddingRight(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn padding_bottom(input: LayoutPaddingBottom) -> Self {
        Self::PaddingBottom(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn margin_top(input: LayoutMarginTop) -> Self {
        Self::MarginTop(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn margin_left(input: LayoutMarginLeft) -> Self {
        Self::MarginLeft(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn margin_right(input: LayoutMarginRight) -> Self {
        Self::MarginRight(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn margin_bottom(input: LayoutMarginBottom) -> Self {
        Self::MarginBottom(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_top_left_radius(input: StyleBorderTopLeftRadius) -> Self {
        Self::BorderTopLeftRadius(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_top_right_radius(input: StyleBorderTopRightRadius) -> Self {
        Self::BorderTopRightRadius(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_bottom_left_radius(input: StyleBorderBottomLeftRadius) -> Self {
        Self::BorderBottomLeftRadius(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_bottom_right_radius(input: StyleBorderBottomRightRadius) -> Self {
        Self::BorderBottomRightRadius(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_top_color(input: StyleBorderTopColor) -> Self {
        Self::BorderTopColor(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_right_color(input: StyleBorderRightColor) -> Self {
        Self::BorderRightColor(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_left_color(input: StyleBorderLeftColor) -> Self {
        Self::BorderLeftColor(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_bottom_color(input: StyleBorderBottomColor) -> Self {
        Self::BorderBottomColor(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_top_style(input: StyleBorderTopStyle) -> Self {
        Self::BorderTopStyle(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_right_style(input: StyleBorderRightStyle) -> Self {
        Self::BorderRightStyle(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_left_style(input: StyleBorderLeftStyle) -> Self {
        Self::BorderLeftStyle(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_bottom_style(input: StyleBorderBottomStyle) -> Self {
        Self::BorderBottomStyle(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_top_width(input: LayoutBorderTopWidth) -> Self {
        Self::BorderTopWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_right_width(input: LayoutBorderRightWidth) -> Self {
        Self::BorderRightWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_left_width(input: LayoutBorderLeftWidth) -> Self {
        Self::BorderLeftWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_bottom_width(input: LayoutBorderBottomWidth) -> Self {
        Self::BorderBottomWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub fn box_shadow_left(input: StyleBoxShadow) -> Self {
        Self::BoxShadowLeft(CssPropertyValue::Exact(BoxOrStatic::heap(input)))
    }
    #[must_use] pub fn box_shadow_right(input: StyleBoxShadow) -> Self {
        Self::BoxShadowRight(CssPropertyValue::Exact(BoxOrStatic::heap(input)))
    }
    #[must_use] pub fn box_shadow_top(input: StyleBoxShadow) -> Self {
        Self::BoxShadowTop(CssPropertyValue::Exact(BoxOrStatic::heap(input)))
    }
    #[must_use] pub fn box_shadow_bottom(input: StyleBoxShadow) -> Self {
        Self::BoxShadowBottom(CssPropertyValue::Exact(BoxOrStatic::heap(input)))
    }
    #[must_use] pub const fn opacity(input: StyleOpacity) -> Self {
        Self::Opacity(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn visibility(input: StyleVisibility) -> Self {
        Self::Visibility(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn transform(input: StyleTransformVec) -> Self {
        Self::Transform(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn transform_origin(input: StyleTransformOrigin) -> Self {
        Self::TransformOrigin(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn perspective_origin(input: StylePerspectiveOrigin) -> Self {
        Self::PerspectiveOrigin(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn backface_visibility(input: StyleBackfaceVisibility) -> Self {
        Self::BackfaceVisibility(CssPropertyValue::Exact(input))
    }
    // New DTP const fn constructors
    #[must_use] pub const fn break_before(input: PageBreak) -> Self {
        Self::BreakBefore(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn break_after(input: PageBreak) -> Self {
        Self::BreakAfter(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn break_inside(input: BreakInside) -> Self {
        Self::BreakInside(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn orphans(input: Orphans) -> Self {
        Self::Orphans(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn widows(input: Widows) -> Self {
        Self::Widows(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn box_decoration_break(input: BoxDecorationBreak) -> Self {
        Self::BoxDecorationBreak(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn column_count(input: ColumnCount) -> Self {
        Self::ColumnCount(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn column_width(input: ColumnWidth) -> Self {
        Self::ColumnWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn column_span(input: ColumnSpan) -> Self {
        Self::ColumnSpan(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn column_fill(input: ColumnFill) -> Self {
        Self::ColumnFill(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn column_rule_width(input: ColumnRuleWidth) -> Self {
        Self::ColumnRuleWidth(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn column_rule_style(input: ColumnRuleStyle) -> Self {
        Self::ColumnRuleStyle(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn column_rule_color(input: ColumnRuleColor) -> Self {
        Self::ColumnRuleColor(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn flow_into(input: FlowInto) -> Self {
        Self::FlowInto(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn flow_from(input: FlowFrom) -> Self {
        Self::FlowFrom(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn shape_outside(input: ShapeOutside) -> Self {
        Self::ShapeOutside(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn shape_inside(input: ShapeInside) -> Self {
        Self::ShapeInside(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn clip_path(input: ClipPath) -> Self {
        Self::ClipPath(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn shape_margin(input: ShapeMargin) -> Self {
        Self::ShapeMargin(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn shape_image_threshold(input: ShapeImageThreshold) -> Self {
        Self::ShapeImageThreshold(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn content(input: Content) -> Self {
        Self::Content(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn counter_reset(input: CounterReset) -> Self {
        Self::CounterReset(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn counter_increment(input: CounterIncrement) -> Self {
        Self::CounterIncrement(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn list_style_type(input: StyleListStyleType) -> Self {
        Self::ListStyleType(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn list_style_position(input: StyleListStylePosition) -> Self {
        Self::ListStylePosition(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn string_set(input: StringSet) -> Self {
        Self::StringSet(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn table_layout(input: LayoutTableLayout) -> Self {
        Self::TableLayout(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_collapse(input: StyleBorderCollapse) -> Self {
        Self::BorderCollapse(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn border_spacing(input: LayoutBorderSpacing) -> Self {
        Self::BorderSpacing(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn caption_side(input: StyleCaptionSide) -> Self {
        Self::CaptionSide(CssPropertyValue::Exact(input))
    }
    #[must_use] pub const fn empty_cells(input: StyleEmptyCells) -> Self {
        Self::EmptyCells(CssPropertyValue::Exact(input))
    }
72
    #[must_use] pub const fn as_z_index(&self) -> Option<&LayoutZIndexValue> {
72
        match self {
72
            Self::ZIndex(f) => Some(f),
            _ => None,
        }
72
    }
    #[must_use] pub const fn as_flex_basis(&self) -> Option<&LayoutFlexBasisValue> {
        match self {
            Self::FlexBasis(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_column_gap(&self) -> Option<&LayoutColumnGapValue> {
        match self {
            Self::ColumnGap(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_row_gap(&self) -> Option<&LayoutRowGapValue> {
        match self {
            Self::RowGap(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_grid_template_columns(&self) -> Option<&LayoutGridTemplateColumnsValue> {
        match self {
            Self::GridTemplateColumns(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_grid_template_rows(&self) -> Option<&LayoutGridTemplateRowsValue> {
        match self {
            Self::GridTemplateRows(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_grid_auto_columns(&self) -> Option<&LayoutGridAutoColumnsValue> {
        match self {
            Self::GridAutoColumns(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_grid_auto_rows(&self) -> Option<&LayoutGridAutoRowsValue> {
        match self {
            Self::GridAutoRows(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_grid_column(&self) -> Option<&LayoutGridColumnValue> {
        match self {
            Self::GridColumn(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_grid_row(&self) -> Option<&LayoutGridRowValue> {
        match self {
            Self::GridRow(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_writing_mode(&self) -> Option<&LayoutWritingModeValue> {
        match self {
            Self::WritingMode(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_clear(&self) -> Option<&LayoutClearValue> {
        match self {
            Self::Clear(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_track(&self) -> Option<&StyleBackgroundContentValue> {
        match self {
            Self::ScrollbarTrack(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_thumb(&self) -> Option<&StyleBackgroundContentValue> {
        match self {
            Self::ScrollbarThumb(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_button(&self) -> Option<&StyleBackgroundContentValue> {
        match self {
            Self::ScrollbarButton(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_corner(&self) -> Option<&StyleBackgroundContentValue> {
        match self {
            Self::ScrollbarCorner(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_resizer(&self) -> Option<&StyleBackgroundContentValue> {
        match self {
            Self::ScrollbarResizer(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_visibility(&self) -> Option<&StyleVisibilityValue> {
        match self {
            Self::Visibility(f) => Some(f),
            _ => None,
        }
    }
425752
    #[must_use] pub const fn as_background_content(&self) -> Option<&StyleBackgroundContentVecValue> {
425752
        match self {
425752
            Self::BackgroundContent(f) => Some(f),
            _ => None,
        }
425752
    }
    #[must_use] pub const fn as_text_justify(&self) -> Option<&LayoutTextJustifyValue> {
        match self {
            Self::TextJustify(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_caret_color(&self) -> Option<&CaretColorValue> {
        match self {
            Self::CaretColor(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_caret_width(&self) -> Option<&CaretWidthValue> {
        match self {
            Self::CaretWidth(f) => Some(f),
            _ => None,
        }
    }
96
    #[must_use] pub const fn as_caret_animation_duration(&self) -> Option<&CaretAnimationDurationValue> {
96
        match self {
96
            Self::CaretAnimationDuration(f) => Some(f),
            _ => None,
        }
96
    }
60
    #[must_use] pub const fn as_selection_background_color(&self) -> Option<&SelectionBackgroundColorValue> {
60
        match self {
60
            Self::SelectionBackgroundColor(f) => Some(f),
            _ => None,
        }
60
    }
48
    #[must_use] pub const fn as_selection_color(&self) -> Option<&SelectionColorValue> {
48
        match self {
48
            Self::SelectionColor(f) => Some(f),
            _ => None,
        }
48
    }
    #[must_use] pub const fn as_selection_radius(&self) -> Option<&SelectionRadiusValue> {
        match self {
            Self::SelectionRadius(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_background_position(&self) -> Option<&StyleBackgroundPositionVecValue> {
        match self {
            Self::BackgroundPosition(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_background_size(&self) -> Option<&StyleBackgroundSizeVecValue> {
        match self {
            Self::BackgroundSize(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_background_repeat(&self) -> Option<&StyleBackgroundRepeatVecValue> {
        match self {
            Self::BackgroundRepeat(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_grid_auto_flow(&self) -> Option<&LayoutGridAutoFlowValue> {
        match self {
            Self::GridAutoFlow(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_justify_self(&self) -> Option<&LayoutJustifySelfValue> {
        match self {
            Self::JustifySelf(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_justify_items(&self) -> Option<&LayoutJustifyItemsValue> {
        match self {
            Self::JustifyItems(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_gap(&self) -> Option<&LayoutGapValue> {
        match self {
            Self::Gap(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_grid_gap(&self) -> Option<&LayoutGapValue> {
        match self {
            Self::GridGap(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_align_self(&self) -> Option<&LayoutAlignSelfValue> {
        match self {
            Self::AlignSelf(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_font(&self) -> Option<&StyleFontValue> {
        match self {
            Self::Font(f) => Some(f),
            _ => None,
        }
    }
1440
    #[must_use] pub const fn as_font_size(&self) -> Option<&StyleFontSizeValue> {
1440
        match self {
1440
            Self::FontSize(f) => Some(f),
            _ => None,
        }
1440
    }
    #[must_use] pub const fn as_font_family(&self) -> Option<&StyleFontFamilyVecValue> {
        match self {
            Self::FontFamily(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_font_weight(&self) -> Option<&StyleFontWeightValue> {
        match self {
            Self::FontWeight(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_font_style(&self) -> Option<&StyleFontStyleValue> {
        match self {
            Self::FontStyle(f) => Some(f),
            _ => None,
        }
    }
82576
    #[must_use] pub const fn as_text_color(&self) -> Option<&StyleTextColorValue> {
82576
        match self {
82576
            Self::TextColor(f) => Some(f),
            _ => None,
        }
82576
    }
    #[must_use] pub const fn as_text_align(&self) -> Option<&StyleTextAlignValue> {
        match self {
            Self::TextAlign(f) => Some(f),
            _ => None,
        }
    }
1044
    #[must_use] pub const fn as_vertical_align(&self) -> Option<&StyleVerticalAlignValue> {
1044
        match self {
1044
            Self::VerticalAlign(f) => Some(f),
            _ => None,
        }
1044
    }
24336
    #[must_use] pub const fn as_line_height(&self) -> Option<&StyleLineHeightValue> {
24336
        match self {
24336
            Self::LineHeight(f) => Some(f),
            _ => None,
        }
24336
    }
24
    #[must_use] pub const fn as_text_indent(&self) -> Option<&StyleTextIndentValue> {
24
        match self {
24
            Self::TextIndent(f) => Some(f),
            _ => None,
        }
24
    }
    #[must_use] pub const fn as_initial_letter(&self) -> Option<&StyleInitialLetterValue> {
        match self {
            Self::InitialLetter(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_line_clamp(&self) -> Option<&StyleLineClampValue> {
        match self {
            Self::LineClamp(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_hanging_punctuation(&self) -> Option<&StyleHangingPunctuationValue> {
        match self {
            Self::HangingPunctuation(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_text_combine_upright(&self) -> Option<&StyleTextCombineUprightValue> {
        match self {
            Self::TextCombineUpright(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_unicode_bidi(&self) -> Option<&StyleUnicodeBidiValue> {
        match self {
            Self::UnicodeBidi(f) => Some(f),
            _ => None,
        }
    }
96
    #[must_use] pub const fn as_text_box_trim(&self) -> Option<&StyleTextBoxTrimValue> {
96
        match self {
96
            Self::TextBoxTrim(f) => Some(f),
            _ => None,
        }
96
    }
96
    #[must_use] pub const fn as_text_box_edge(&self) -> Option<&StyleTextBoxEdgeValue> {
96
        match self {
96
            Self::TextBoxEdge(f) => Some(f),
            _ => None,
        }
96
    }
    #[must_use] pub const fn as_dominant_baseline(&self) -> Option<&StyleDominantBaselineValue> {
        match self {
            Self::DominantBaseline(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_alignment_baseline(&self) -> Option<&StyleAlignmentBaselineValue> {
        match self {
            Self::AlignmentBaseline(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_baseline_source(&self) -> Option<&StyleBaselineSourceValue> {
        match self {
            Self::BaselineSource(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_line_fit_edge(&self) -> Option<&StyleLineFitEdgeValue> {
        match self {
            Self::LineFitEdge(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_initial_letter_align(&self) -> Option<&StyleInitialLetterAlignValue> {
        match self {
            Self::InitialLetterAlign(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_initial_letter_wrap(&self) -> Option<&StyleInitialLetterWrapValue> {
        match self {
            Self::InitialLetterWrap(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_gutter(&self) -> Option<&StyleScrollbarGutterValue> {
        match self {
            Self::ScrollbarGutter(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_overflow_clip_margin(&self) -> Option<&StyleOverflowClipMarginValue> {
        match self {
            Self::OverflowClipMargin(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_clip(&self) -> Option<&StyleClipRectValue> {
        match self {
            Self::Clip(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_exclusion_margin(&self) -> Option<&StyleExclusionMarginValue> {
        match self {
            Self::ExclusionMargin(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_hyphenation_language(&self) -> Option<&StyleHyphenationLanguageValue> {
        match self {
            Self::HyphenationLanguage(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_letter_spacing(&self) -> Option<&StyleLetterSpacingValue> {
        match self {
            Self::LetterSpacing(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_word_spacing(&self) -> Option<&StyleWordSpacingValue> {
        match self {
            Self::WordSpacing(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_tab_size(&self) -> Option<&StyleTabSizeValue> {
        match self {
            Self::TabSize(f) => Some(f),
            _ => None,
        }
    }
697488
    #[must_use] pub const fn as_cursor(&self) -> Option<&StyleCursorValue> {
697488
        match self {
697488
            Self::Cursor(f) => Some(f),
            _ => None,
        }
697488
    }
48
    #[must_use] pub const fn as_box_shadow_left(&self) -> Option<&StyleBoxShadowValue> {
48
        match self {
48
            Self::BoxShadowLeft(f) => Some(f),
            _ => None,
        }
48
    }
48
    #[must_use] pub const fn as_box_shadow_right(&self) -> Option<&StyleBoxShadowValue> {
48
        match self {
48
            Self::BoxShadowRight(f) => Some(f),
            _ => None,
        }
48
    }
48
    #[must_use] pub const fn as_box_shadow_top(&self) -> Option<&StyleBoxShadowValue> {
48
        match self {
48
            Self::BoxShadowTop(f) => Some(f),
            _ => None,
        }
48
    }
48
    #[must_use] pub const fn as_box_shadow_bottom(&self) -> Option<&StyleBoxShadowValue> {
48
        match self {
48
            Self::BoxShadowBottom(f) => Some(f),
            _ => None,
        }
48
    }
    #[must_use] pub const fn as_border_top_color(&self) -> Option<&StyleBorderTopColorValue> {
        match self {
            Self::BorderTopColor(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_left_color(&self) -> Option<&StyleBorderLeftColorValue> {
        match self {
            Self::BorderLeftColor(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_right_color(&self) -> Option<&StyleBorderRightColorValue> {
        match self {
            Self::BorderRightColor(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_bottom_color(&self) -> Option<&StyleBorderBottomColorValue> {
        match self {
            Self::BorderBottomColor(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_top_style(&self) -> Option<&StyleBorderTopStyleValue> {
        match self {
            Self::BorderTopStyle(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_left_style(&self) -> Option<&StyleBorderLeftStyleValue> {
        match self {
            Self::BorderLeftStyle(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_right_style(&self) -> Option<&StyleBorderRightStyleValue> {
        match self {
            Self::BorderRightStyle(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_bottom_style(&self) -> Option<&StyleBorderBottomStyleValue> {
        match self {
            Self::BorderBottomStyle(f) => Some(f),
            _ => None,
        }
    }
60
    #[must_use] pub const fn as_border_top_left_radius(&self) -> Option<&StyleBorderTopLeftRadiusValue> {
60
        match self {
60
            Self::BorderTopLeftRadius(f) => Some(f),
            _ => None,
        }
60
    }
60
    #[must_use] pub const fn as_border_top_right_radius(&self) -> Option<&StyleBorderTopRightRadiusValue> {
60
        match self {
60
            Self::BorderTopRightRadius(f) => Some(f),
            _ => None,
        }
60
    }
60
    #[must_use] pub const fn as_border_bottom_left_radius(&self) -> Option<&StyleBorderBottomLeftRadiusValue> {
60
        match self {
60
            Self::BorderBottomLeftRadius(f) => Some(f),
            _ => None,
        }
60
    }
60
    #[must_use] pub const fn as_border_bottom_right_radius(
60
        &self,
60
    ) -> Option<&StyleBorderBottomRightRadiusValue> {
60
        match self {
60
            Self::BorderBottomRightRadius(f) => Some(f),
            _ => None,
        }
60
    }
36
    #[must_use] pub const fn as_opacity(&self) -> Option<&StyleOpacityValue> {
36
        match self {
36
            Self::Opacity(f) => Some(f),
            _ => None,
        }
36
    }
5112
    #[must_use] pub const fn as_transform(&self) -> Option<&StyleTransformVecValue> {
5112
        match self {
5112
            Self::Transform(f) => Some(f),
            _ => None,
        }
5112
    }
    #[must_use] pub const fn as_transform_origin(&self) -> Option<&StyleTransformOriginValue> {
        match self {
            Self::TransformOrigin(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_perspective_origin(&self) -> Option<&StylePerspectiveOriginValue> {
        match self {
            Self::PerspectiveOrigin(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_backface_visibility(&self) -> Option<&StyleBackfaceVisibilityValue> {
        match self {
            Self::BackfaceVisibility(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_mix_blend_mode(&self) -> Option<&StyleMixBlendModeValue> {
        match self {
            Self::MixBlendMode(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_filter(&self) -> Option<&StyleFilterVecValue> {
        match self {
            Self::Filter(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_backdrop_filter(&self) -> Option<&StyleFilterVecValue> {
        match self {
            Self::BackdropFilter(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_text_shadow(&self) -> Option<&StyleBoxShadowValue> {
        match self {
            Self::TextShadow(f) => Some(f),
            _ => None,
        }
    }
    // functions that downcast to the concrete CSS type (layout)
7900
    #[must_use] pub const fn as_display(&self) -> Option<&LayoutDisplayValue> {
7900
        match self {
7900
            Self::Display(f) => Some(f),
            _ => None,
        }
7900
    }
    #[must_use] pub const fn as_float(&self) -> Option<&LayoutFloatValue> {
        match self {
            Self::Float(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_box_sizing(&self) -> Option<&LayoutBoxSizingValue> {
        match self {
            Self::BoxSizing(f) => Some(f),
            _ => None,
        }
    }
656
    #[must_use] pub const fn as_width(&self) -> Option<&LayoutWidthValue> {
656
        match self {
656
            Self::Width(f) => Some(f),
            _ => None,
        }
656
    }
708
    #[must_use] pub const fn as_height(&self) -> Option<&LayoutHeightValue> {
708
        match self {
708
            Self::Height(f) => Some(f),
            _ => None,
        }
708
    }
60
    #[must_use] pub const fn as_min_width(&self) -> Option<&LayoutMinWidthValue> {
60
        match self {
60
            Self::MinWidth(f) => Some(f),
            _ => None,
        }
60
    }
    #[must_use] pub const fn as_min_height(&self) -> Option<&LayoutMinHeightValue> {
        match self {
            Self::MinHeight(f) => Some(f),
            _ => None,
        }
    }
40
    #[must_use] pub const fn as_max_width(&self) -> Option<&LayoutMaxWidthValue> {
40
        match self {
40
            Self::MaxWidth(f) => Some(f),
            _ => None,
        }
40
    }
    #[must_use] pub const fn as_max_height(&self) -> Option<&LayoutMaxHeightValue> {
        match self {
            Self::MaxHeight(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_position(&self) -> Option<&LayoutPositionValue> {
        match self {
            Self::Position(f) => Some(f),
            _ => None,
        }
    }
188
    #[must_use] pub const fn as_top(&self) -> Option<&LayoutTopValue> {
188
        match self {
188
            Self::Top(f) => Some(f),
            _ => None,
        }
188
    }
44
    #[must_use] pub const fn as_bottom(&self) -> Option<&LayoutInsetBottomValue> {
44
        match self {
44
            Self::Bottom(f) => Some(f),
            _ => None,
        }
44
    }
32
    #[must_use] pub const fn as_right(&self) -> Option<&LayoutRightValue> {
32
        match self {
32
            Self::Right(f) => Some(f),
            _ => None,
        }
32
    }
176
    #[must_use] pub const fn as_left(&self) -> Option<&LayoutLeftValue> {
176
        match self {
176
            Self::Left(f) => Some(f),
            _ => None,
        }
176
    }
72
    #[must_use] pub const fn as_padding_top(&self) -> Option<&LayoutPaddingTopValue> {
72
        match self {
72
            Self::PaddingTop(f) => Some(f),
            _ => None,
        }
72
    }
72
    #[must_use] pub const fn as_padding_bottom(&self) -> Option<&LayoutPaddingBottomValue> {
72
        match self {
72
            Self::PaddingBottom(f) => Some(f),
            _ => None,
        }
72
    }
132
    #[must_use] pub const fn as_padding_left(&self) -> Option<&LayoutPaddingLeftValue> {
132
        match self {
132
            Self::PaddingLeft(f) => Some(f),
            _ => None,
        }
132
    }
72
    #[must_use] pub const fn as_padding_right(&self) -> Option<&LayoutPaddingRightValue> {
72
        match self {
72
            Self::PaddingRight(f) => Some(f),
            _ => None,
        }
72
    }
71928
    #[must_use] pub const fn as_margin_top(&self) -> Option<&LayoutMarginTopValue> {
71928
        match self {
71928
            Self::MarginTop(f) => Some(f),
            _ => None,
        }
71928
    }
84468
    #[must_use] pub const fn as_margin_bottom(&self) -> Option<&LayoutMarginBottomValue> {
84468
        match self {
84468
            Self::MarginBottom(f) => Some(f),
            _ => None,
        }
84468
    }
348
    #[must_use] pub const fn as_margin_left(&self) -> Option<&LayoutMarginLeftValue> {
348
        match self {
348
            Self::MarginLeft(f) => Some(f),
            _ => None,
        }
348
    }
336
    #[must_use] pub const fn as_margin_right(&self) -> Option<&LayoutMarginRightValue> {
336
        match self {
336
            Self::MarginRight(f) => Some(f),
            _ => None,
        }
336
    }
    #[must_use] pub const fn as_border_top_width(&self) -> Option<&LayoutBorderTopWidthValue> {
        match self {
            Self::BorderTopWidth(f) => Some(f),
            _ => None,
        }
    }
40
    #[must_use] pub const fn as_border_left_width(&self) -> Option<&LayoutBorderLeftWidthValue> {
40
        match self {
40
            Self::BorderLeftWidth(f) => Some(f),
            _ => None,
        }
40
    }
    #[must_use] pub const fn as_border_right_width(&self) -> Option<&LayoutBorderRightWidthValue> {
        match self {
            Self::BorderRightWidth(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_bottom_width(&self) -> Option<&LayoutBorderBottomWidthValue> {
        match self {
            Self::BorderBottomWidth(f) => Some(f),
            _ => None,
        }
    }
40
    #[must_use] pub const fn as_overflow_x(&self) -> Option<&LayoutOverflowValue> {
40
        match self {
40
            Self::OverflowX(f) => Some(f),
            _ => None,
        }
40
    }
1572
    #[must_use] pub const fn as_overflow_y(&self) -> Option<&LayoutOverflowValue> {
1572
        match self {
1572
            Self::OverflowY(f) => Some(f),
            _ => None,
        }
1572
    }
    #[must_use] pub const fn as_overflow_block(&self) -> Option<&LayoutOverflowValue> {
        match self {
            Self::OverflowBlock(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_overflow_inline(&self) -> Option<&LayoutOverflowValue> {
        match self {
            Self::OverflowInline(f) => Some(f),
            _ => None,
        }
    }
120
    #[must_use] pub const fn as_flex_direction(&self) -> Option<&LayoutFlexDirectionValue> {
120
        match self {
120
            Self::FlexDirection(f) => Some(f),
            _ => None,
        }
120
    }
    #[must_use] pub const fn as_direction(&self) -> Option<&StyleDirectionValue> {
        match self {
            Self::Direction(f) => Some(f),
            _ => None,
        }
    }
48168
    #[must_use] pub const fn as_user_select(&self) -> Option<&StyleUserSelectValue> {
48168
        match self {
48168
            Self::UserSelect(f) => Some(f),
            _ => None,
        }
48168
    }
504
    #[must_use] pub const fn as_text_decoration(&self) -> Option<&StyleTextDecorationValue> {
504
        match self {
504
            Self::TextDecoration(f) => Some(f),
            _ => None,
        }
504
    }
    #[must_use] pub const fn as_hyphens(&self) -> Option<&StyleHyphensValue> {
        match self {
            Self::Hyphens(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_word_break(&self) -> Option<&StyleWordBreakValue> {
        match self {
            Self::WordBreak(f) => Some(f),
            _ => None,
        }
    }
24
    #[must_use] pub const fn as_overflow_wrap(&self) -> Option<&StyleOverflowWrapValue> {
24
        match self {
24
            Self::OverflowWrap(f) => Some(f),
            _ => None,
        }
24
    }
    #[must_use] pub const fn as_line_break(&self) -> Option<&StyleLineBreakValue> {
        match self {
            Self::LineBreak(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_object_fit(&self) -> Option<&StyleObjectFitValue> {
        match self {
            Self::ObjectFit(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_text_overflow(&self) -> Option<&StyleTextOverflowValue> {
        match self {
            Self::TextOverflow(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_object_position(&self) -> Option<&StyleObjectPositionValue> {
        match self {
            Self::ObjectPosition(f) => Some(f),
            _ => None,
        }
    }
252
    #[must_use] pub const fn as_aspect_ratio(&self) -> Option<&StyleAspectRatioValue> {
252
        match self {
252
            Self::AspectRatio(f) => Some(f),
            _ => None,
        }
252
    }
    #[must_use] pub const fn as_text_orientation(&self) -> Option<&StyleTextOrientationValue> {
        match self {
            Self::TextOrientation(f) => Some(f),
            _ => None,
        }
    }
24
    #[must_use] pub const fn as_text_transform(&self) -> Option<&StyleTextTransformValue> {
24
        match self {
24
            Self::TextTransform(f) => Some(f),
            _ => None,
        }
24
    }
    #[must_use] pub const fn as_text_align_last(&self) -> Option<&StyleTextAlignLastValue> {
        match self {
            Self::TextAlignLast(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_white_space(&self) -> Option<&StyleWhiteSpaceValue> {
        match self {
            Self::WhiteSpace(f) => Some(f),
            _ => None,
        }
    }
12
    #[must_use] pub const fn as_flex_wrap(&self) -> Option<&LayoutFlexWrapValue> {
12
        match self {
12
            Self::FlexWrap(f) => Some(f),
            _ => None,
        }
12
    }
    #[must_use] pub const fn as_flex_grow(&self) -> Option<&LayoutFlexGrowValue> {
        match self {
            Self::FlexGrow(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_flex_shrink(&self) -> Option<&LayoutFlexShrinkValue> {
        match self {
            Self::FlexShrink(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_justify_content(&self) -> Option<&LayoutJustifyContentValue> {
        match self {
            Self::JustifyContent(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_align_items(&self) -> Option<&LayoutAlignItemsValue> {
        match self {
            Self::AlignItems(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_align_content(&self) -> Option<&LayoutAlignContentValue> {
        match self {
            Self::AlignContent(f) => Some(f),
            _ => None,
        }
    }
12
    #[must_use] pub const fn as_break_before(&self) -> Option<&PageBreakValue> {
12
        match self {
12
            Self::BreakBefore(f) => Some(f),
            _ => None,
        }
12
    }
    #[must_use] pub const fn as_break_after(&self) -> Option<&PageBreakValue> {
        match self {
            Self::BreakAfter(f) => Some(f),
            _ => None,
        }
    }
72
    #[must_use] pub const fn as_break_inside(&self) -> Option<&BreakInsideValue> {
72
        match self {
72
            Self::BreakInside(f) => Some(f),
            _ => None,
        }
72
    }
24
    #[must_use] pub const fn as_orphans(&self) -> Option<&OrphansValue> {
24
        match self {
24
            Self::Orphans(f) => Some(f),
            _ => None,
        }
24
    }
24
    #[must_use] pub const fn as_widows(&self) -> Option<&WidowsValue> {
24
        match self {
24
            Self::Widows(f) => Some(f),
            _ => None,
        }
24
    }
    #[must_use] pub const fn as_box_decoration_break(&self) -> Option<&BoxDecorationBreakValue> {
        match self {
            Self::BoxDecorationBreak(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_column_count(&self) -> Option<&ColumnCountValue> {
        match self {
            Self::ColumnCount(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_column_width(&self) -> Option<&ColumnWidthValue> {
        match self {
            Self::ColumnWidth(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_column_span(&self) -> Option<&ColumnSpanValue> {
        match self {
            Self::ColumnSpan(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_column_fill(&self) -> Option<&ColumnFillValue> {
        match self {
            Self::ColumnFill(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_column_rule_width(&self) -> Option<&ColumnRuleWidthValue> {
        match self {
            Self::ColumnRuleWidth(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_column_rule_style(&self) -> Option<&ColumnRuleStyleValue> {
        match self {
            Self::ColumnRuleStyle(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_column_rule_color(&self) -> Option<&ColumnRuleColorValue> {
        match self {
            Self::ColumnRuleColor(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_flow_into(&self) -> Option<&FlowIntoValue> {
        match self {
            Self::FlowInto(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_flow_from(&self) -> Option<&FlowFromValue> {
        match self {
            Self::FlowFrom(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_shape_outside(&self) -> Option<&ShapeOutsideValue> {
        match self {
            Self::ShapeOutside(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_shape_inside(&self) -> Option<&ShapeInsideValue> {
        match self {
            Self::ShapeInside(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_clip_path(&self) -> Option<&ClipPathValue> {
        match self {
            Self::ClipPath(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_shape_margin(&self) -> Option<&ShapeMarginValue> {
        match self {
            Self::ShapeMargin(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_shape_image_threshold(&self) -> Option<&ShapeImageThresholdValue> {
        match self {
            Self::ShapeImageThreshold(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_content(&self) -> Option<&ContentValue> {
        match self {
            Self::Content(f) => Some(f),
            _ => None,
        }
    }
636
    #[must_use] pub const fn as_counter_reset(&self) -> Option<&CounterResetValue> {
636
        match self {
636
            Self::CounterReset(f) => Some(f),
            _ => None,
        }
636
    }
    #[must_use] pub const fn as_counter_increment(&self) -> Option<&CounterIncrementValue> {
        match self {
            Self::CounterIncrement(f) => Some(f),
            _ => None,
        }
    }
1104
    #[must_use] pub const fn as_list_style_type(&self) -> Option<&StyleListStyleTypeValue> {
1104
        match self {
1104
            Self::ListStyleType(f) => Some(f),
            _ => None,
        }
1104
    }
    #[must_use] pub const fn as_list_style_position(&self) -> Option<&StyleListStylePositionValue> {
        match self {
            Self::ListStylePosition(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_string_set(&self) -> Option<&StringSetValue> {
        match self {
            Self::StringSet(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_table_layout(&self) -> Option<&LayoutTableLayoutValue> {
        match self {
            Self::TableLayout(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_collapse(&self) -> Option<&StyleBorderCollapseValue> {
        match self {
            Self::BorderCollapse(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_border_spacing(&self) -> Option<&LayoutBorderSpacingValue> {
        match self {
            Self::BorderSpacing(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_caption_side(&self) -> Option<&StyleCaptionSideValue> {
        match self {
            Self::CaptionSide(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_empty_cells(&self) -> Option<&StyleEmptyCellsValue> {
        match self {
            Self::EmptyCells(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_width(&self) -> Option<&LayoutScrollbarWidthValue> {
        match self {
            Self::ScrollbarWidth(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_color(&self) -> Option<&StyleScrollbarColorValue> {
        match self {
            Self::ScrollbarColor(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_visibility(&self) -> Option<&ScrollbarVisibilityModeValue> {
        match self {
            Self::ScrollbarVisibility(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_fade_delay(&self) -> Option<&ScrollbarFadeDelayValue> {
        match self {
            Self::ScrollbarFadeDelay(f) => Some(f),
            _ => None,
        }
    }
    #[must_use] pub const fn as_scrollbar_fade_duration(&self) -> Option<&ScrollbarFadeDurationValue> {
        match self {
            Self::ScrollbarFadeDuration(f) => Some(f),
            _ => None,
        }
    }
    // Cross-type dispatch: each `c` is a different `CssPropertyValue<T>`, so the
    // identical `c.is_initial()` bodies can't merge (clippy::match_same_arms FP).
    #[allow(clippy::match_same_arms)]
    #[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
3930
    #[must_use] pub const fn is_initial(&self) -> bool {
        use self::CssProperty::{Animation, AnimationIn, AnimationOut, CaretColor, CaretWidth, CaretAnimationDuration, SelectionBackgroundColor, SelectionColor, SelectionRadius, TextJustify, TextColor, FontSize, FontFamily, TextAlign, LetterSpacing, TextIndent, InitialLetter, LineClamp, HangingPunctuation, TextCombineUpright, UnicodeBidi, TextBoxTrim, TextBoxEdge, DominantBaseline, AlignmentBaseline, BaselineSource, LineFitEdge, InitialLetterAlign, InitialLetterWrap, ScrollbarGutter, OverflowClipMargin, Clip, ExclusionMargin, HyphenationLanguage, LineHeight, WordSpacing, TabSize, Cursor, Display, Float, BoxSizing, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, Position, Top, Right, Left, Bottom, ZIndex, FlexWrap, FlexDirection, FlexGrow, FlexShrink, FlexBasis, JustifyContent, AlignItems, AlignContent, ColumnGap, RowGap, GridTemplateColumns, GridTemplateRows, GridAutoFlow, JustifySelf, JustifyItems, Gap, GridGap, AlignSelf, Font, GridAutoColumns, GridAutoRows, GridColumn, GridRow, GridTemplateAreas, WritingMode, Clear, BackgroundContent, BackgroundPosition, BackgroundSize, BackgroundRepeat, OverflowX, OverflowY, OverflowBlock, OverflowInline, PaddingTop, PaddingLeft, PaddingRight, PaddingBottom, PaddingInlineStart, PaddingInlineEnd, MarginTop, MarginLeft, MarginRight, MarginBottom, BorderTopLeftRadius, BorderTopRightRadius, BorderBottomLeftRadius, BorderBottomRightRadius, BorderTopColor, BorderRightColor, BorderLeftColor, BorderBottomColor, BorderTopStyle, BorderRightStyle, BorderLeftStyle, BorderBottomStyle, BorderTopWidth, BorderRightWidth, BorderLeftWidth, BorderBottomWidth, BoxShadowLeft, BoxShadowRight, BoxShadowTop, BoxShadowBottom, ScrollbarTrack, ScrollbarThumb, ScrollbarButton, ScrollbarCorner, ScrollbarResizer, ScrollbarWidth, ScrollbarColor, ScrollbarVisibility, ScrollbarFadeDelay, ScrollbarFadeDuration, Opacity, Visibility, Transform, TransformOrigin, PerspectiveOrigin, BackfaceVisibility, MixBlendMode, Filter, BackdropFilter, TextShadow, WhiteSpace, Direction, UserSelect, TextDecoration, Hyphens, WordBreak, OverflowWrap, LineBreak, TextOverflow, ObjectFit, ObjectPosition, AspectRatio, TextOrientation, TextAlignLast, TextTransform, BreakBefore, BreakAfter, BreakInside, Orphans, Widows, BoxDecorationBreak, ColumnCount, ColumnWidth, ColumnSpan, ColumnFill, ColumnRuleWidth, ColumnRuleStyle, ColumnRuleColor, FlowInto, FlowFrom, ShapeOutside, ShapeInside, ClipPath, ShapeMargin, ShapeImageThreshold, Content, CounterReset, CounterIncrement, ListStyleType, ListStylePosition, StringSet, TableLayout, BorderCollapse, BorderSpacing, CaptionSide, EmptyCells, FontWeight, FontStyle, VerticalAlign};
3930
        match self {
            CaretColor(c) => c.is_initial(),
            CaretWidth(c) => c.is_initial(),
            CaretAnimationDuration(c) => c.is_initial(),
            Animation(c) => c.is_initial(),
            AnimationIn(c) => c.is_initial(),
            AnimationOut(c) => c.is_initial(),
            SelectionBackgroundColor(c) => c.is_initial(),
            SelectionColor(c) => c.is_initial(),
            SelectionRadius(c) => c.is_initial(),
            TextJustify(c) => c.is_initial(),
744
            TextColor(c) => c.is_initial(),
            FontSize(c) => c.is_initial(),
            FontFamily(c) => c.is_initial(),
            TextAlign(c) => c.is_initial(),
            LetterSpacing(c) => c.is_initial(),
            TextIndent(c) => c.is_initial(),
            InitialLetter(c) => c.is_initial(),
            LineClamp(c) => c.is_initial(),
            HangingPunctuation(c) => c.is_initial(),
            TextCombineUpright(c) => c.is_initial(),
            UnicodeBidi(c) => c.is_initial(),
            TextBoxTrim(c) => c.is_initial(),
            TextBoxEdge(c) => c.is_initial(),
            DominantBaseline(c) => c.is_initial(),
            AlignmentBaseline(c) => c.is_initial(),
            BaselineSource(c) => c.is_initial(),
            LineFitEdge(c) => c.is_initial(),
            InitialLetterAlign(c) => c.is_initial(),
            InitialLetterWrap(c) => c.is_initial(),
            ScrollbarGutter(c) => c.is_initial(),
            OverflowClipMargin(c) => c.is_initial(),
            Clip(c) => c.is_initial(),
            ExclusionMargin(c) => c.is_initial(),
            HyphenationLanguage(c) => c.is_initial(),
            LineHeight(c) => c.is_initial(),
            WordSpacing(c) => c.is_initial(),
            TabSize(c) => c.is_initial(),
            Cursor(c) => c.is_initial(),
54
            Display(c) => c.is_initial(),
            Float(c) => c.is_initial(),
            BoxSizing(c) => c.is_initial(),
1575
            Width(c) => c.is_initial(),
21
            Height(c) => c.is_initial(),
            MinWidth(c) => c.is_initial(),
            MinHeight(c) => c.is_initial(),
            MaxWidth(c) => c.is_initial(),
            MaxHeight(c) => c.is_initial(),
            Position(c) => c.is_initial(),
            Top(c) => c.is_initial(),
            Right(c) => c.is_initial(),
            Left(c) => c.is_initial(),
            Bottom(c) => c.is_initial(),
            ZIndex(c) => c.is_initial(),
            FlexWrap(c) => c.is_initial(),
            FlexDirection(c) => c.is_initial(),
            FlexGrow(c) => c.is_initial(),
            FlexShrink(c) => c.is_initial(),
            FlexBasis(c) => c.is_initial(),
            JustifyContent(c) => c.is_initial(),
            AlignItems(c) => c.is_initial(),
            AlignContent(c) => c.is_initial(),
            ColumnGap(c) => c.is_initial(),
            RowGap(c) => c.is_initial(),
            GridTemplateColumns(c) => c.is_initial(),
            GridTemplateRows(c) => c.is_initial(),
            GridAutoFlow(c) => c.is_initial(),
            JustifySelf(c) => c.is_initial(),
            JustifyItems(c) => c.is_initial(),
            Gap(c) => c.is_initial(),
            GridGap(c) => c.is_initial(),
            AlignSelf(c) => c.is_initial(),
            Font(c) => c.is_initial(),
            GridAutoColumns(c) => c.is_initial(),
            GridAutoRows(c) => c.is_initial(),
            GridColumn(c) => c.is_initial(),
            GridRow(c) => c.is_initial(),
            GridTemplateAreas(c) => c.is_initial(),
            WritingMode(c) => c.is_initial(),
            Clear(c) => c.is_initial(),
72
            BackgroundContent(c) => c.is_initial(),
            BackgroundPosition(c) => c.is_initial(),
            BackgroundSize(c) => c.is_initial(),
            BackgroundRepeat(c) => c.is_initial(),
            OverflowX(c) => c.is_initial(),
            OverflowY(c) => c.is_initial(),
            OverflowBlock(c) => c.is_initial(),
            OverflowInline(c) => c.is_initial(),
            PaddingTop(c) => c.is_initial(),
            PaddingLeft(c) => c.is_initial(),
            PaddingRight(c) => c.is_initial(),
            PaddingBottom(c) => c.is_initial(),
            PaddingInlineStart(c) => c.is_initial(),
            PaddingInlineEnd(c) => c.is_initial(),
            MarginTop(c) => c.is_initial(),
            MarginLeft(c) => c.is_initial(),
            MarginRight(c) => c.is_initial(),
            MarginBottom(c) => c.is_initial(),
            BorderTopLeftRadius(c) => c.is_initial(),
            BorderTopRightRadius(c) => c.is_initial(),
            BorderBottomLeftRadius(c) => c.is_initial(),
            BorderBottomRightRadius(c) => c.is_initial(),
            BorderTopColor(c) => c.is_initial(),
            BorderRightColor(c) => c.is_initial(),
            BorderLeftColor(c) => c.is_initial(),
            BorderBottomColor(c) => c.is_initial(),
            BorderTopStyle(c) => c.is_initial(),
            BorderRightStyle(c) => c.is_initial(),
            BorderLeftStyle(c) => c.is_initial(),
            BorderBottomStyle(c) => c.is_initial(),
            BorderTopWidth(c) => c.is_initial(),
            BorderRightWidth(c) => c.is_initial(),
            BorderLeftWidth(c) => c.is_initial(),
            BorderBottomWidth(c) => c.is_initial(),
            BoxShadowLeft(c) => c.is_initial(),
            BoxShadowRight(c) => c.is_initial(),
            BoxShadowTop(c) => c.is_initial(),
            BoxShadowBottom(c) => c.is_initial(),
            ScrollbarTrack(c) => c.is_initial(),
            ScrollbarThumb(c) => c.is_initial(),
            ScrollbarButton(c) => c.is_initial(),
            ScrollbarCorner(c) => c.is_initial(),
            ScrollbarResizer(c) => c.is_initial(),
            ScrollbarWidth(c) => c.is_initial(),
            ScrollbarColor(c) => c.is_initial(),
            ScrollbarVisibility(c) => c.is_initial(),
            ScrollbarFadeDelay(c) => c.is_initial(),
            ScrollbarFadeDuration(c) => c.is_initial(),
1464
            Opacity(c) => c.is_initial(),
            Visibility(c) => c.is_initial(),
            Transform(c) => c.is_initial(),
            TransformOrigin(c) => c.is_initial(),
            PerspectiveOrigin(c) => c.is_initial(),
            BackfaceVisibility(c) => c.is_initial(),
            MixBlendMode(c) => c.is_initial(),
            Filter(c) => c.is_initial(),
            BackdropFilter(c) => c.is_initial(),
            TextShadow(c) => c.is_initial(),
            WhiteSpace(c) => c.is_initial(),
            Direction(c) => c.is_initial(),
            UserSelect(c) => c.is_initial(),
            TextDecoration(c) => c.is_initial(),
            Hyphens(c) => c.is_initial(),
            WordBreak(c) => c.is_initial(),
            OverflowWrap(c) => c.is_initial(),
            LineBreak(c) => c.is_initial(),
            TextOverflow(c) => c.is_initial(),
            ObjectFit(c) => c.is_initial(),
            ObjectPosition(c) => c.is_initial(),
            AspectRatio(c) => c.is_initial(),
            TextOrientation(c) => c.is_initial(),
            TextAlignLast(c) => c.is_initial(),
            TextTransform(c) => c.is_initial(),
            BreakBefore(c) => c.is_initial(),
            BreakAfter(c) => c.is_initial(),
            BreakInside(c) => c.is_initial(),
            Orphans(c) => c.is_initial(),
            Widows(c) => c.is_initial(),
            BoxDecorationBreak(c) => c.is_initial(),
            ColumnCount(c) => c.is_initial(),
            ColumnWidth(c) => c.is_initial(),
            ColumnSpan(c) => c.is_initial(),
            ColumnFill(c) => c.is_initial(),
            ColumnRuleWidth(c) => c.is_initial(),
            ColumnRuleStyle(c) => c.is_initial(),
            ColumnRuleColor(c) => c.is_initial(),
            FlowInto(c) => c.is_initial(),
            FlowFrom(c) => c.is_initial(),
            ShapeOutside(c) => c.is_initial(),
            ShapeInside(c) => c.is_initial(),
            ClipPath(c) => c.is_initial(),
            ShapeMargin(c) => c.is_initial(),
            ShapeImageThreshold(c) => c.is_initial(),
            Content(c) => c.is_initial(),
            CounterReset(c) => c.is_initial(),
            CounterIncrement(c) => c.is_initial(),
            ListStyleType(c) => c.is_initial(),
            ListStylePosition(c) => c.is_initial(),
            StringSet(c) => c.is_initial(),
            TableLayout(c) => c.is_initial(),
            BorderCollapse(c) => c.is_initial(),
            BorderSpacing(c) => c.is_initial(),
            CaptionSide(c) => c.is_initial(),
            EmptyCells(c) => c.is_initial(),
            FontWeight(c) => c.is_initial(),
            FontStyle(c) => c.is_initial(),
            VerticalAlign(c) => c.is_initial(),
        }
3930
    }
433
    #[must_use] pub const fn const_none(prop_type: CssPropertyType) -> Self {
433
        css_property_from_type!(prop_type, None)
433
    }
1
    #[must_use] pub const fn const_auto(prop_type: CssPropertyType) -> Self {
1
        css_property_from_type!(prop_type, Auto)
1
    }
    #[must_use] pub const fn const_initial(prop_type: CssPropertyType) -> Self {
        css_property_from_type!(prop_type, Initial)
    }
1
    #[must_use] pub const fn const_inherit(prop_type: CssPropertyType) -> Self {
1
        css_property_from_type!(prop_type, Inherit)
1
    }
239755
    #[must_use] pub const fn const_text_color(input: StyleTextColor) -> Self {
239755
        Self::TextColor(StyleTextColorValue::Exact(input))
239755
    }
259952
    #[must_use] pub const fn const_font_size(input: StyleFontSize) -> Self {
259952
        Self::FontSize(StyleFontSizeValue::Exact(input))
259952
    }
73227
    #[must_use] pub const fn const_font_family(input: StyleFontFamilyVec) -> Self {
73227
        Self::FontFamily(StyleFontFamilyVecValue::Exact(input))
73227
    }
220044
    #[must_use] pub const fn const_text_align(input: StyleTextAlign) -> Self {
220044
        Self::TextAlign(StyleTextAlignValue::Exact(input))
220044
    }
    #[must_use] pub const fn const_vertical_align(input: StyleVerticalAlign) -> Self {
        Self::VerticalAlign(StyleVerticalAlignValue::Exact(input))
    }
    #[must_use] pub const fn const_letter_spacing(input: StyleLetterSpacing) -> Self {
        Self::LetterSpacing(StyleLetterSpacingValue::Exact(input))
    }
    #[must_use] pub const fn const_text_indent(input: StyleTextIndent) -> Self {
        Self::TextIndent(StyleTextIndentValue::Exact(input))
    }
    #[must_use] pub const fn const_line_height(input: StyleLineHeight) -> Self {
        Self::LineHeight(StyleLineHeightValue::Exact(input))
    }
    #[must_use] pub const fn const_word_spacing(input: StyleWordSpacing) -> Self {
        Self::WordSpacing(StyleWordSpacingValue::Exact(input))
    }
    #[must_use] pub const fn const_tab_size(input: StyleTabSize) -> Self {
        Self::TabSize(StyleTabSizeValue::Exact(input))
    }
177320
    #[must_use] pub const fn const_cursor(input: StyleCursor) -> Self {
177320
        Self::Cursor(StyleCursorValue::Exact(input))
177320
    }
226946
    #[must_use] pub const fn const_display(input: LayoutDisplay) -> Self {
226946
        Self::Display(LayoutDisplayValue::Exact(input))
226946
    }
    #[must_use] pub const fn const_float(input: LayoutFloat) -> Self {
        Self::Float(LayoutFloatValue::Exact(input))
    }
37125
    #[must_use] pub const fn const_box_sizing(input: LayoutBoxSizing) -> Self {
37125
        Self::BoxSizing(LayoutBoxSizingValue::Exact(input))
37125
    }
156508
    #[must_use] pub const fn const_width(input: LayoutWidth) -> Self {
156508
        Self::Width(LayoutWidthValue::Exact(input))
156508
    }
195085
    #[must_use] pub const fn const_height(input: LayoutHeight) -> Self {
195085
        Self::Height(LayoutHeightValue::Exact(input))
195085
    }
56452
    #[must_use] pub const fn const_min_width(input: LayoutMinWidth) -> Self {
56452
        Self::MinWidth(LayoutMinWidthValue::Exact(input))
56452
    }
2343
    #[must_use] pub const fn const_min_height(input: LayoutMinHeight) -> Self {
2343
        Self::MinHeight(LayoutMinHeightValue::Exact(input))
2343
    }
1793
    #[must_use] pub const fn const_max_width(input: LayoutMaxWidth) -> Self {
1793
        Self::MaxWidth(LayoutMaxWidthValue::Exact(input))
1793
    }
    #[must_use] pub const fn const_max_height(input: LayoutMaxHeight) -> Self {
        Self::MaxHeight(LayoutMaxHeightValue::Exact(input))
    }
10287
    #[must_use] pub const fn const_position(input: LayoutPosition) -> Self {
10287
        Self::Position(LayoutPositionValue::Exact(input))
10287
    }
8283
    #[must_use] pub const fn const_top(input: LayoutTop) -> Self {
8283
        Self::Top(LayoutTopValue::Exact(input))
8283
    }
1782
    #[must_use] pub const fn const_right(input: LayoutRight) -> Self {
1782
        Self::Right(LayoutRightValue::Exact(input))
1782
    }
8272
    #[must_use] pub const fn const_left(input: LayoutLeft) -> Self {
8272
        Self::Left(LayoutLeftValue::Exact(input))
8272
    }
1782
    #[must_use] pub const fn const_bottom(input: LayoutInsetBottom) -> Self {
1782
        Self::Bottom(LayoutInsetBottomValue::Exact(input))
1782
    }
2156
    #[must_use] pub const fn const_flex_wrap(input: LayoutFlexWrap) -> Self {
2156
        Self::FlexWrap(LayoutFlexWrapValue::Exact(input))
2156
    }
151723
    #[must_use] pub const fn const_flex_direction(input: LayoutFlexDirection) -> Self {
151723
        Self::FlexDirection(LayoutFlexDirectionValue::Exact(input))
151723
    }
231682
    #[must_use] pub const fn const_flex_grow(input: LayoutFlexGrow) -> Self {
231682
        Self::FlexGrow(LayoutFlexGrowValue::Exact(input))
231682
    }
29029
    #[must_use] pub const fn const_flex_shrink(input: LayoutFlexShrink) -> Self {
29029
        Self::FlexShrink(LayoutFlexShrinkValue::Exact(input))
29029
    }
78397
    #[must_use] pub const fn const_justify_content(input: LayoutJustifyContent) -> Self {
78397
        Self::JustifyContent(LayoutJustifyContentValue::Exact(input))
78397
    }
128788
    #[must_use] pub const fn const_align_items(input: LayoutAlignItems) -> Self {
128788
        Self::AlignItems(LayoutAlignItemsValue::Exact(input))
128788
    }
    #[must_use] pub const fn const_align_content(input: LayoutAlignContent) -> Self {
        Self::AlignContent(LayoutAlignContentValue::Exact(input))
    }
314149
    #[must_use] pub const fn const_background_content(input: StyleBackgroundContentVec) -> Self {
314149
        Self::BackgroundContent(StyleBackgroundContentVecValue::Exact(input))
314149
    }
    #[must_use] pub const fn const_background_position(input: StyleBackgroundPositionVec) -> Self {
        Self::BackgroundPosition(StyleBackgroundPositionVecValue::Exact(input))
    }
    #[must_use] pub const fn const_background_size(input: StyleBackgroundSizeVec) -> Self {
        Self::BackgroundSize(StyleBackgroundSizeVecValue::Exact(input))
    }
    #[must_use] pub const fn const_background_repeat(input: StyleBackgroundRepeatVec) -> Self {
        Self::BackgroundRepeat(StyleBackgroundRepeatVecValue::Exact(input))
    }
12727
    #[must_use] pub const fn const_overflow_x(input: LayoutOverflow) -> Self {
12727
        Self::OverflowX(LayoutOverflowValue::Exact(input))
12727
    }
10945
    #[must_use] pub const fn const_overflow_y(input: LayoutOverflow) -> Self {
10945
        Self::OverflowY(LayoutOverflowValue::Exact(input))
10945
    }
    #[must_use] pub const fn const_overflow_block(input: LayoutOverflow) -> Self {
        Self::OverflowBlock(LayoutOverflowValue::Exact(input))
    }
    #[must_use] pub const fn const_overflow_inline(input: LayoutOverflow) -> Self {
        Self::OverflowInline(LayoutOverflowValue::Exact(input))
    }
235312
    #[must_use] pub const fn const_padding_top(input: LayoutPaddingTop) -> Self {
235312
        Self::PaddingTop(LayoutPaddingTopValue::Exact(input))
235312
    }
89287
    #[must_use] pub const fn const_padding_left(input: LayoutPaddingLeft) -> Self {
89287
        Self::PaddingLeft(LayoutPaddingLeftValue::Exact(input))
89287
    }
89199
    #[must_use] pub const fn const_padding_right(input: LayoutPaddingRight) -> Self {
89199
        Self::PaddingRight(LayoutPaddingRightValue::Exact(input))
89199
    }
144529
    #[must_use] pub const fn const_padding_bottom(input: LayoutPaddingBottom) -> Self {
144529
        Self::PaddingBottom(LayoutPaddingBottomValue::Exact(input))
144529
    }
114609
    #[must_use] pub const fn const_margin_top(input: LayoutMarginTop) -> Self {
114609
        Self::MarginTop(LayoutMarginTopValue::Exact(input))
114609
    }
26213
    #[must_use] pub const fn const_margin_left(input: LayoutMarginLeft) -> Self {
26213
        Self::MarginLeft(LayoutMarginLeftValue::Exact(input))
26213
    }
4862
    #[must_use] pub const fn const_margin_right(input: LayoutMarginRight) -> Self {
4862
        Self::MarginRight(LayoutMarginRightValue::Exact(input))
4862
    }
1529
    #[must_use] pub const fn const_margin_bottom(input: LayoutMarginBottom) -> Self {
1529
        Self::MarginBottom(LayoutMarginBottomValue::Exact(input))
1529
    }
152119
    #[must_use] pub const fn const_border_top_left_radius(input: StyleBorderTopLeftRadius) -> Self {
152119
        Self::BorderTopLeftRadius(StyleBorderTopLeftRadiusValue::Exact(input))
152119
    }
152086
    #[must_use] pub const fn const_border_top_right_radius(input: StyleBorderTopRightRadius) -> Self {
152086
        Self::BorderTopRightRadius(StyleBorderTopRightRadiusValue::Exact(input))
152086
    }
152845
    #[must_use] pub const fn const_border_bottom_left_radius(input: StyleBorderBottomLeftRadius) -> Self {
152845
        Self::BorderBottomLeftRadius(StyleBorderBottomLeftRadiusValue::Exact(input))
152845
    }
152845
    #[must_use] pub const fn const_border_bottom_right_radius(input: StyleBorderBottomRightRadius) -> Self {
152845
        Self::BorderBottomRightRadius(StyleBorderBottomRightRadiusValue::Exact(input))
152845
    }
100870
    #[must_use] pub const fn const_border_top_color(input: StyleBorderTopColor) -> Self {
100870
        Self::BorderTopColor(StyleBorderTopColorValue::Exact(input))
100870
    }
105215
    #[must_use] pub const fn const_border_right_color(input: StyleBorderRightColor) -> Self {
105215
        Self::BorderRightColor(StyleBorderRightColorValue::Exact(input))
105215
    }
65109
    #[must_use] pub const fn const_border_left_color(input: StyleBorderLeftColor) -> Self {
65109
        Self::BorderLeftColor(StyleBorderLeftColorValue::Exact(input))
65109
    }
115962
    #[must_use] pub const fn const_border_bottom_color(input: StyleBorderBottomColor) -> Self {
115962
        Self::BorderBottomColor(StyleBorderBottomColorValue::Exact(input))
115962
    }
87912
    #[must_use] pub const fn const_border_top_style(input: StyleBorderTopStyle) -> Self {
87912
        Self::BorderTopStyle(StyleBorderTopStyleValue::Exact(input))
87912
    }
90101
    #[must_use] pub const fn const_border_right_style(input: StyleBorderRightStyle) -> Self {
90101
        Self::BorderRightStyle(StyleBorderRightStyleValue::Exact(input))
90101
    }
52151
    #[must_use] pub const fn const_border_left_style(input: StyleBorderLeftStyle) -> Self {
52151
        Self::BorderLeftStyle(StyleBorderLeftStyleValue::Exact(input))
52151
    }
100848
    #[must_use] pub const fn const_border_bottom_style(input: StyleBorderBottomStyle) -> Self {
100848
        Self::BorderBottomStyle(StyleBorderBottomStyleValue::Exact(input))
100848
    }
90090
    #[must_use] pub const fn const_border_top_width(input: LayoutBorderTopWidth) -> Self {
90090
        Self::BorderTopWidth(LayoutBorderTopWidthValue::Exact(input))
90090
    }
92257
    #[must_use] pub const fn const_border_right_width(input: LayoutBorderRightWidth) -> Self {
92257
        Self::BorderRightWidth(LayoutBorderRightWidthValue::Exact(input))
92257
    }
54307
    #[must_use] pub const fn const_border_left_width(input: LayoutBorderLeftWidth) -> Self {
54307
        Self::BorderLeftWidth(LayoutBorderLeftWidthValue::Exact(input))
54307
    }
103004
    #[must_use] pub const fn const_border_bottom_width(input: LayoutBorderBottomWidth) -> Self {
103004
        Self::BorderBottomWidth(LayoutBorderBottomWidthValue::Exact(input))
103004
    }
    #[must_use] pub fn const_box_shadow_left(input: StyleBoxShadow) -> Self {
        Self::BoxShadowLeft(StyleBoxShadowValue::Exact(BoxOrStatic::heap(input)))
    }
    #[must_use] pub fn const_box_shadow_right(input: StyleBoxShadow) -> Self {
        Self::BoxShadowRight(StyleBoxShadowValue::Exact(BoxOrStatic::heap(input)))
    }
    #[must_use] pub fn const_box_shadow_top(input: StyleBoxShadow) -> Self {
        Self::BoxShadowTop(StyleBoxShadowValue::Exact(BoxOrStatic::heap(input)))
    }
    #[must_use] pub fn const_box_shadow_bottom(input: StyleBoxShadow) -> Self {
        Self::BoxShadowBottom(StyleBoxShadowValue::Exact(BoxOrStatic::heap(input)))
    }
119845
    #[must_use] pub const fn const_opacity(input: StyleOpacity) -> Self {
119845
        Self::Opacity(StyleOpacityValue::Exact(input))
119845
    }
    #[must_use] pub const fn const_transform(input: StyleTransformVec) -> Self {
        Self::Transform(StyleTransformVecValue::Exact(input))
    }
    #[must_use] pub const fn const_transform_origin(input: StyleTransformOrigin) -> Self {
        Self::TransformOrigin(StyleTransformOriginValue::Exact(input))
    }
    #[must_use] pub const fn const_perspective_origin(input: StylePerspectiveOrigin) -> Self {
        Self::PerspectiveOrigin(StylePerspectiveOriginValue::Exact(input))
    }
    #[must_use] pub const fn const_backface_visibility(input: StyleBackfaceVisibility) -> Self {
        Self::BackfaceVisibility(StyleBackfaceVisibilityValue::Exact(input))
    }
    #[must_use] pub const fn const_break_before(input: PageBreak) -> Self {
        Self::BreakBefore(PageBreakValue::Exact(input))
    }
    #[must_use] pub const fn const_break_after(input: PageBreak) -> Self {
        Self::BreakAfter(PageBreakValue::Exact(input))
    }
    #[must_use] pub const fn const_break_inside(input: BreakInside) -> Self {
        Self::BreakInside(BreakInsideValue::Exact(input))
    }
    #[must_use] pub const fn const_orphans(input: Orphans) -> Self {
        Self::Orphans(OrphansValue::Exact(input))
    }
    #[must_use] pub const fn const_widows(input: Widows) -> Self {
        Self::Widows(WidowsValue::Exact(input))
    }
    #[must_use] pub const fn const_box_decoration_break(input: BoxDecorationBreak) -> Self {
        Self::BoxDecorationBreak(BoxDecorationBreakValue::Exact(input))
    }
    #[must_use] pub const fn const_column_count(input: ColumnCount) -> Self {
        Self::ColumnCount(ColumnCountValue::Exact(input))
    }
    #[must_use] pub const fn const_column_width(input: ColumnWidth) -> Self {
        Self::ColumnWidth(ColumnWidthValue::Exact(input))
    }
    #[must_use] pub const fn const_column_span(input: ColumnSpan) -> Self {
        Self::ColumnSpan(ColumnSpanValue::Exact(input))
    }
    #[must_use] pub const fn const_column_fill(input: ColumnFill) -> Self {
        Self::ColumnFill(ColumnFillValue::Exact(input))
    }
    #[must_use] pub const fn const_column_rule_width(input: ColumnRuleWidth) -> Self {
        Self::ColumnRuleWidth(ColumnRuleWidthValue::Exact(input))
    }
    #[must_use] pub const fn const_column_rule_style(input: ColumnRuleStyle) -> Self {
        Self::ColumnRuleStyle(ColumnRuleStyleValue::Exact(input))
    }
    #[must_use] pub const fn const_column_rule_color(input: ColumnRuleColor) -> Self {
        Self::ColumnRuleColor(ColumnRuleColorValue::Exact(input))
    }
    #[must_use] pub const fn const_flow_into(input: FlowInto) -> Self {
        Self::FlowInto(FlowIntoValue::Exact(input))
    }
    #[must_use] pub const fn const_flow_from(input: FlowFrom) -> Self {
        Self::FlowFrom(FlowFromValue::Exact(input))
    }
    #[must_use] pub const fn const_shape_outside(input: ShapeOutside) -> Self {
        Self::ShapeOutside(ShapeOutsideValue::Exact(input))
    }
    #[must_use] pub const fn const_shape_inside(input: ShapeInside) -> Self {
        Self::ShapeInside(ShapeInsideValue::Exact(input))
    }
    #[must_use] pub const fn const_clip_path(input: ClipPath) -> Self {
        Self::ClipPath(ClipPathValue::Exact(input))
    }
    #[must_use] pub const fn const_shape_margin(input: ShapeMargin) -> Self {
        Self::ShapeMargin(ShapeMarginValue::Exact(input))
    }
    #[must_use] pub const fn const_shape_image_threshold(input: ShapeImageThreshold) -> Self {
        Self::ShapeImageThreshold(ShapeImageThresholdValue::Exact(input))
    }
    #[must_use] pub const fn const_content(input: Content) -> Self {
        Self::Content(ContentValue::Exact(input))
    }
    #[must_use] pub const fn const_counter_reset(input: CounterReset) -> Self {
        Self::CounterReset(CounterResetValue::Exact(input))
    }
    #[must_use] pub const fn const_counter_increment(input: CounterIncrement) -> Self {
        Self::CounterIncrement(CounterIncrementValue::Exact(input))
    }
    #[must_use] pub const fn const_list_style_type(input: StyleListStyleType) -> Self {
        Self::ListStyleType(StyleListStyleTypeValue::Exact(input))
    }
    #[must_use] pub const fn const_list_style_position(input: StyleListStylePosition) -> Self {
        Self::ListStylePosition(StyleListStylePositionValue::Exact(input))
    }
    #[must_use] pub const fn const_string_set(input: StringSet) -> Self {
        Self::StringSet(StringSetValue::Exact(input))
    }
    #[must_use] pub const fn const_table_layout(input: LayoutTableLayout) -> Self {
        Self::TableLayout(LayoutTableLayoutValue::Exact(input))
    }
    #[must_use] pub const fn const_border_collapse(input: StyleBorderCollapse) -> Self {
        Self::BorderCollapse(StyleBorderCollapseValue::Exact(input))
    }
    #[must_use] pub const fn const_border_spacing(input: LayoutBorderSpacing) -> Self {
        Self::BorderSpacing(LayoutBorderSpacingValue::Exact(input))
    }
    #[must_use] pub const fn const_caption_side(input: StyleCaptionSide) -> Self {
        Self::CaptionSide(StyleCaptionSideValue::Exact(input))
    }
    #[must_use] pub const fn const_empty_cells(input: StyleEmptyCells) -> Self {
        Self::EmptyCells(StyleEmptyCellsValue::Exact(input))
    }
}
// Cross-type dispatch over CssProperty variants; identical format! bodies bind
// different value types and can't merge (clippy::match_same_arms false positive).
#[allow(clippy::match_same_arms)]
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per property/variant)
#[must_use] pub fn format_static_css_prop(prop: &CssProperty, tabs: usize) -> String {
    match prop {
        CssProperty::CaretColor(p) => format!(
            "CssProperty::CaretColor({})",
            print_css_property_value(p, tabs, "CaretColor")
        ),
        CssProperty::CaretWidth(p) => format!(
            "CssProperty::CaretWidth({})",
            print_css_property_value(p, tabs, "CaretWidth")
        ),
        CssProperty::CaretAnimationDuration(p) => format!(
            "CssProperty::CaretAnimationDuration({})",
            print_css_property_value(p, tabs, "CaretAnimationDuration")
        ),
        CssProperty::Animation(p) => format!(
            "CssProperty::Animation({})",
            print_css_property_value(p, tabs, "StyleAnimation")
        ),
        CssProperty::AnimationIn(p) => format!(
            "CssProperty::AnimationIn({})",
            print_css_property_value(p, tabs, "StyleAnimation")
        ),
        CssProperty::AnimationOut(p) => format!(
            "CssProperty::AnimationOut({})",
            print_css_property_value(p, tabs, "StyleAnimation")
        ),
        CssProperty::SelectionBackgroundColor(p) => format!(
            "CssProperty::SelectionBackgroundColor({})",
            print_css_property_value(p, tabs, "SelectionBackgroundColor")
        ),
        CssProperty::SelectionColor(p) => format!(
            "CssProperty::SelectionColor({})",
            print_css_property_value(p, tabs, "SelectionColor")
        ),
        CssProperty::SelectionRadius(p) => format!(
            "CssProperty::SelectionRadius({})",
            print_css_property_value(p, tabs, "SelectionRadius")
        ),
        CssProperty::TextJustify(p) => format!(
            "CssProperty::TextJustify({})",
            print_css_property_value(p, tabs, "LayoutTextJustify")
        ),
        CssProperty::TextColor(p) => format!(
            "CssProperty::TextColor({})",
            print_css_property_value(p, tabs, "StyleTextColor")
        ),
        CssProperty::FontSize(p) => format!(
            "CssProperty::FontSize({})",
            print_css_property_value(p, tabs, "StyleFontSize")
        ),
        CssProperty::FontFamily(p) => format!(
            "CssProperty::FontFamily({})",
            print_css_property_value(p, tabs, "StyleFontFamilyVec")
        ),
        CssProperty::TextAlign(p) => format!(
            "CssProperty::TextAlign({})",
            print_css_property_value(p, tabs, "StyleTextAlign")
        ),
        CssProperty::VerticalAlign(p) => format!(
            "CssProperty::VerticalAlign({})",
            print_css_property_value(p, tabs, "StyleVerticalAlign")
        ),
        CssProperty::LetterSpacing(p) => format!(
            "CssProperty::LetterSpacing({})",
            print_css_property_value(p, tabs, "StyleLetterSpacing")
        ),
        CssProperty::TextIndent(p) => format!(
            "CssProperty::TextIndent({})",
            print_css_property_value(p, tabs, "StyleTextIndent")
        ),
        CssProperty::InitialLetter(p) => format!(
            "CssProperty::InitialLetter({})",
            print_css_property_value(p, tabs, "StyleInitialLetter")
        ),
        CssProperty::LineClamp(p) => format!(
            "CssProperty::LineClamp({})",
            print_css_property_value(p, tabs, "StyleLineClamp")
        ),
        CssProperty::HangingPunctuation(p) => format!(
            "CssProperty::HangingPunctuation({})",
            print_css_property_value(p, tabs, "StyleHangingPunctuation")
        ),
        CssProperty::TextCombineUpright(p) => format!(
            "CssProperty::TextCombineUpright({})",
            print_css_property_value(p, tabs, "StyleTextCombineUpright")
        ),
        CssProperty::UnicodeBidi(p) => format!(
            "CssProperty::UnicodeBidi({})",
            print_css_property_value(p, tabs, "StyleUnicodeBidi")
        ),
        CssProperty::TextBoxTrim(p) => format!(
            "CssProperty::TextBoxTrim({})",
            print_css_property_value(p, tabs, "StyleTextBoxTrim")
        ),
        CssProperty::TextBoxEdge(p) => format!(
            "CssProperty::TextBoxEdge({})",
            print_css_property_value(p, tabs, "StyleTextBoxEdge")
        ),
        CssProperty::DominantBaseline(p) => format!(
            "CssProperty::DominantBaseline({})",
            print_css_property_value(p, tabs, "StyleDominantBaseline")
        ),
        CssProperty::AlignmentBaseline(p) => format!(
            "CssProperty::AlignmentBaseline({})",
            print_css_property_value(p, tabs, "StyleAlignmentBaseline")
        ),
        CssProperty::BaselineSource(p) => format!(
            "CssProperty::BaselineSource({})",
            print_css_property_value(p, tabs, "StyleBaselineSource")
        ),
        CssProperty::LineFitEdge(p) => format!(
            "CssProperty::LineFitEdge({})",
            print_css_property_value(p, tabs, "StyleLineFitEdge")
        ),
        CssProperty::InitialLetterAlign(p) => format!(
            "CssProperty::InitialLetterAlign({})",
            print_css_property_value(p, tabs, "StyleInitialLetterAlign")
        ),
        CssProperty::InitialLetterWrap(p) => format!(
            "CssProperty::InitialLetterWrap({})",
            print_css_property_value(p, tabs, "StyleInitialLetterWrap")
        ),
        CssProperty::ScrollbarGutter(p) => format!(
            "CssProperty::ScrollbarGutter({})",
            print_css_property_value(p, tabs, "StyleScrollbarGutter")
        ),
        CssProperty::OverflowClipMargin(p) => format!(
            "CssProperty::OverflowClipMargin({})",
            print_css_property_value(p, tabs, "StyleOverflowClipMargin")
        ),
        CssProperty::Clip(p) => format!(
            "CssProperty::Clip({})",
            print_css_property_value(p, tabs, "StyleClipRect")
        ),
        CssProperty::ExclusionMargin(p) => format!(
            "CssProperty::ExclusionMargin({})",
            print_css_property_value(p, tabs, "StyleExclusionMargin")
        ),
        CssProperty::HyphenationLanguage(p) => format!(
            "CssProperty::HyphenationLanguage({})",
            print_css_property_value(p, tabs, "StyleHyphenationLanguage")
        ),
        CssProperty::LineHeight(p) => format!(
            "CssProperty::LineHeight({})",
            print_css_property_value(p, tabs, "StyleLineHeight")
        ),
        CssProperty::WordSpacing(p) => format!(
            "CssProperty::WordSpacing({})",
            print_css_property_value(p, tabs, "StyleWordSpacing")
        ),
        CssProperty::TabSize(p) => format!(
            "CssProperty::TabSize({})",
            print_css_property_value(p, tabs, "StyleTabSize")
        ),
        CssProperty::Cursor(p) => format!(
            "CssProperty::Cursor({})",
            print_css_property_value(p, tabs, "StyleCursor")
        ),
        CssProperty::Display(p) => format!(
            "CssProperty::Display({})",
            print_css_property_value(p, tabs, "LayoutDisplay")
        ),
        CssProperty::Float(p) => format!(
            "CssProperty::Float({})",
            print_css_property_value(p, tabs, "LayoutFloat")
        ),
        CssProperty::BoxSizing(p) => format!(
            "CssProperty::BoxSizing({})",
            print_css_property_value(p, tabs, "LayoutBoxSizing")
        ),
        CssProperty::Width(p) => format!(
            "CssProperty::Width({})",
            print_css_property_value(p, tabs, "LayoutWidth")
        ),
        CssProperty::Height(p) => format!(
            "CssProperty::Height({})",
            print_css_property_value(p, tabs, "LayoutHeight")
        ),
        CssProperty::MinWidth(p) => format!(
            "CssProperty::MinWidth({})",
            print_css_property_value(p, tabs, "LayoutMinWidth")
        ),
        CssProperty::MinHeight(p) => format!(
            "CssProperty::MinHeight({})",
            print_css_property_value(p, tabs, "LayoutMinHeight")
        ),
        CssProperty::MaxWidth(p) => format!(
            "CssProperty::MaxWidth({})",
            print_css_property_value(p, tabs, "LayoutMaxWidth")
        ),
        CssProperty::MaxHeight(p) => format!(
            "CssProperty::MaxHeight({})",
            print_css_property_value(p, tabs, "LayoutMaxHeight")
        ),
        CssProperty::Position(p) => format!(
            "CssProperty::Position({})",
            print_css_property_value(p, tabs, "LayoutPosition")
        ),
        CssProperty::Top(p) => format!(
            "CssProperty::Top({})",
            print_css_property_value(p, tabs, "LayoutTop")
        ),
        CssProperty::Right(p) => format!(
            "CssProperty::Right({})",
            print_css_property_value(p, tabs, "LayoutRight")
        ),
        CssProperty::Left(p) => format!(
            "CssProperty::Left({})",
            print_css_property_value(p, tabs, "LayoutLeft")
        ),
        CssProperty::Bottom(p) => format!(
            "CssProperty::Bottom({})",
            print_css_property_value(p, tabs, "LayoutInsetBottom")
        ),
        CssProperty::ZIndex(p) => format!(
            "CssProperty::ZIndex({})",
            print_css_property_value(p, tabs, "LayoutZIndex")
        ),
        CssProperty::FlexWrap(p) => format!(
            "CssProperty::FlexWrap({})",
            print_css_property_value(p, tabs, "LayoutFlexWrap")
        ),
        CssProperty::FlexDirection(p) => format!(
            "CssProperty::FlexDirection({})",
            print_css_property_value(p, tabs, "LayoutFlexDirection")
        ),
        CssProperty::FlexGrow(p) => format!(
            "CssProperty::FlexGrow({})",
            print_css_property_value(p, tabs, "LayoutFlexGrow")
        ),
        CssProperty::FlexShrink(p) => format!(
            "CssProperty::FlexShrink({})",
            print_css_property_value(p, tabs, "LayoutFlexShrink")
        ),
        CssProperty::JustifyContent(p) => format!(
            "CssProperty::JustifyContent({})",
            print_css_property_value(p, tabs, "LayoutJustifyContent")
        ),
        CssProperty::AlignItems(p) => format!(
            "CssProperty::AlignItems({})",
            print_css_property_value(p, tabs, "LayoutAlignItems")
        ),
        CssProperty::AlignContent(p) => format!(
            "CssProperty::AlignContent({})",
            print_css_property_value(p, tabs, "LayoutAlignContent")
        ),
        CssProperty::BackgroundContent(p) => format!(
            "CssProperty::BackgroundContent({})",
            print_css_property_value(p, tabs, "StyleBackgroundContentVec")
        ),
        CssProperty::BackgroundPosition(p) => format!(
            "CssProperty::BackgroundPosition({})",
            print_css_property_value(p, tabs, "StyleBackgroundPositionVec")
        ),
        CssProperty::BackgroundSize(p) => format!(
            "CssProperty::BackgroundSize({})",
            print_css_property_value(p, tabs, "StyleBackgroundSizeVec")
        ),
        CssProperty::BackgroundRepeat(p) => format!(
            "CssProperty::BackgroundRepeat({})",
            print_css_property_value(p, tabs, "StyleBackgroundRepeatVec")
        ),
        CssProperty::OverflowX(p) => format!(
            "CssProperty::OverflowX({})",
            print_css_property_value(p, tabs, "LayoutOverflow")
        ),
        CssProperty::OverflowY(p) => format!(
            "CssProperty::OverflowY({})",
            print_css_property_value(p, tabs, "LayoutOverflow")
        ),
        CssProperty::OverflowBlock(p) => format!(
            "CssProperty::OverflowBlock({})",
            print_css_property_value(p, tabs, "LayoutOverflow")
        ),
        CssProperty::OverflowInline(p) => format!(
            "CssProperty::OverflowInline({})",
            print_css_property_value(p, tabs, "LayoutOverflow")
        ),
        CssProperty::PaddingTop(p) => format!(
            "CssProperty::PaddingTop({})",
            print_css_property_value(p, tabs, "LayoutPaddingTop")
        ),
        CssProperty::PaddingLeft(p) => format!(
            "CssProperty::PaddingLeft({})",
            print_css_property_value(p, tabs, "LayoutPaddingLeft")
        ),
        CssProperty::PaddingRight(p) => format!(
            "CssProperty::PaddingRight({})",
            print_css_property_value(p, tabs, "LayoutPaddingRight")
        ),
        CssProperty::PaddingBottom(p) => format!(
            "CssProperty::PaddingBottom({})",
            print_css_property_value(p, tabs, "LayoutPaddingBottom")
        ),
        CssProperty::PaddingInlineStart(p) => format!(
            "CssProperty::PaddingInlineStart({})",
            print_css_property_value(p, tabs, "LayoutPaddingInlineStart")
        ),
        CssProperty::PaddingInlineEnd(p) => format!(
            "CssProperty::PaddingInlineEnd({})",
            print_css_property_value(p, tabs, "LayoutPaddingInlineEnd")
        ),
        CssProperty::MarginTop(p) => format!(
            "CssProperty::MarginTop({})",
            print_css_property_value(p, tabs, "LayoutMarginTop")
        ),
        CssProperty::MarginLeft(p) => format!(
            "CssProperty::MarginLeft({})",
            print_css_property_value(p, tabs, "LayoutMarginLeft")
        ),
        CssProperty::MarginRight(p) => format!(
            "CssProperty::MarginRight({})",
            print_css_property_value(p, tabs, "LayoutMarginRight")
        ),
        CssProperty::MarginBottom(p) => format!(
            "CssProperty::MarginBottom({})",
            print_css_property_value(p, tabs, "LayoutMarginBottom")
        ),
        CssProperty::BorderTopLeftRadius(p) => format!(
            "CssProperty::BorderTopLeftRadius({})",
            print_css_property_value(p, tabs, "StyleBorderTopLeftRadius")
        ),
        CssProperty::BorderTopRightRadius(p) => format!(
            "CssProperty::BorderTopRightRadius({})",
            print_css_property_value(p, tabs, "StyleBorderTopRightRadius")
        ),
        CssProperty::BorderBottomLeftRadius(p) => format!(
            "CssProperty::BorderBottomLeftRadius({})",
            print_css_property_value(p, tabs, "StyleBorderBottomLeftRadius")
        ),
        CssProperty::BorderBottomRightRadius(p) => format!(
            "CssProperty::BorderBottomRightRadius({})",
            print_css_property_value(p, tabs, "StyleBorderBottomRightRadius")
        ),
        CssProperty::BorderTopColor(p) => format!(
            "CssProperty::BorderTopColor({})",
            print_css_property_value(p, tabs, "StyleBorderTopColor")
        ),
        CssProperty::BorderRightColor(p) => format!(
            "CssProperty::BorderRightColor({})",
            print_css_property_value(p, tabs, "StyleBorderRightColor")
        ),
        CssProperty::BorderLeftColor(p) => format!(
            "CssProperty::BorderLeftColor({})",
            print_css_property_value(p, tabs, "StyleBorderLeftColor")
        ),
        CssProperty::BorderBottomColor(p) => format!(
            "CssProperty::BorderBottomColor({})",
            print_css_property_value(p, tabs, "StyleBorderBottomColor")
        ),
        CssProperty::BorderTopStyle(p) => format!(
            "CssProperty::BorderTopStyle({})",
            print_css_property_value(p, tabs, "StyleBorderTopStyle")
        ),
        CssProperty::BorderRightStyle(p) => format!(
            "CssProperty::BorderRightStyle({})",
            print_css_property_value(p, tabs, "StyleBorderRightStyle")
        ),
        CssProperty::BorderLeftStyle(p) => format!(
            "CssProperty::BorderLeftStyle({})",
            print_css_property_value(p, tabs, "StyleBorderLeftStyle")
        ),
        CssProperty::BorderBottomStyle(p) => format!(
            "CssProperty::BorderBottomStyle({})",
            print_css_property_value(p, tabs, "StyleBorderBottomStyle")
        ),
        CssProperty::BorderTopWidth(p) => format!(
            "CssProperty::BorderTopWidth({})",
            print_css_property_value(p, tabs, "LayoutBorderTopWidth")
        ),
        CssProperty::BorderRightWidth(p) => format!(
            "CssProperty::BorderRightWidth({})",
            print_css_property_value(p, tabs, "LayoutBorderRightWidth")
        ),
        CssProperty::BorderLeftWidth(p) => format!(
            "CssProperty::BorderLeftWidth({})",
            print_css_property_value(p, tabs, "LayoutBorderLeftWidth")
        ),
        CssProperty::BorderBottomWidth(p) => format!(
            "CssProperty::BorderBottomWidth({})",
            print_css_property_value(p, tabs, "LayoutBorderBottomWidth")
        ),
        CssProperty::BoxShadowLeft(p) => format!(
            "CssProperty::BoxShadowLeft({})",
            print_css_property_value(p, tabs, "StyleBoxShadow")
        ),
        CssProperty::BoxShadowRight(p) => format!(
            "CssProperty::BoxShadowRight({})",
            print_css_property_value(p, tabs, "StyleBoxShadow")
        ),
        CssProperty::BoxShadowTop(p) => format!(
            "CssProperty::BoxShadowTop({})",
            print_css_property_value(p, tabs, "StyleBoxShadow")
        ),
        CssProperty::BoxShadowBottom(p) => format!(
            "CssProperty::BoxShadowBottom({})",
            print_css_property_value(p, tabs, "StyleBoxShadow")
        ),
        CssProperty::ScrollbarWidth(p) => format!(
            "CssProperty::ScrollbarWidth({})",
            print_css_property_value(p, tabs, "LayoutScrollbarWidth")
        ),
        CssProperty::ScrollbarColor(p) => format!(
            "CssProperty::ScrollbarColor({})",
            print_css_property_value(p, tabs, "StyleScrollbarColor")
        ),
        CssProperty::ScrollbarVisibility(p) => format!(
            "CssProperty::ScrollbarVisibility({})",
            print_css_property_value(p, tabs, "ScrollbarVisibilityMode")
        ),
        CssProperty::ScrollbarFadeDelay(p) => format!(
            "CssProperty::ScrollbarFadeDelay({})",
            print_css_property_value(p, tabs, "ScrollbarFadeDelay")
        ),
        CssProperty::ScrollbarFadeDuration(p) => format!(
            "CssProperty::ScrollbarFadeDuration({})",
            print_css_property_value(p, tabs, "ScrollbarFadeDuration")
        ),
        CssProperty::ScrollbarTrack(p) => format!(
            "CssProperty::ScrollbarTrack({})",
            print_css_property_value(p, tabs, "StyleBackgroundContent")
        ),
        CssProperty::ScrollbarThumb(p) => format!(
            "CssProperty::ScrollbarThumb({})",
            print_css_property_value(p, tabs, "StyleBackgroundContent")
        ),
        CssProperty::ScrollbarButton(p) => format!(
            "CssProperty::ScrollbarButton({})",
            print_css_property_value(p, tabs, "StyleBackgroundContent")
        ),
        CssProperty::ScrollbarCorner(p) => format!(
            "CssProperty::ScrollbarCorner({})",
            print_css_property_value(p, tabs, "StyleBackgroundContent")
        ),
        CssProperty::ScrollbarResizer(p) => format!(
            "CssProperty::ScrollbarResizer({})",
            print_css_property_value(p, tabs, "StyleBackgroundContent")
        ),
        CssProperty::Opacity(p) => format!(
            "CssProperty::Opacity({})",
            print_css_property_value(p, tabs, "StyleOpacity")
        ),
        CssProperty::Visibility(p) => format!(
            "CssProperty::Visibility({})",
            print_css_property_value(p, tabs, "StyleVisibility")
        ),
        CssProperty::Transform(p) => format!(
            "CssProperty::Transform({})",
            print_css_property_value(p, tabs, "StyleTransformVec")
        ),
        CssProperty::TransformOrigin(p) => format!(
            "CssProperty::TransformOrigin({})",
            print_css_property_value(p, tabs, "StyleTransformOrigin")
        ),
        CssProperty::PerspectiveOrigin(p) => format!(
            "CssProperty::PerspectiveOrigin({})",
            print_css_property_value(p, tabs, "StylePerspectiveOrigin")
        ),
        CssProperty::BackfaceVisibility(p) => format!(
            "CssProperty::BackfaceVisibility({})",
            print_css_property_value(p, tabs, "StyleBackfaceVisibility")
        ),
        CssProperty::MixBlendMode(p) => format!(
            "CssProperty::MixBlendMode({})",
            print_css_property_value(p, tabs, "StyleMixBlendMode")
        ),
        CssProperty::Filter(p) => format!(
            "CssProperty::Filter({})",
            print_css_property_value(p, tabs, "StyleFilterVec")
        ),
        CssProperty::BackdropFilter(p) => format!(
            "CssProperty::Filter({})",
            print_css_property_value(p, tabs, "StyleFilterVec")
        ),
        CssProperty::TextShadow(p) => format!(
            "CssProperty::TextShadow({})",
            print_css_property_value(p, tabs, "StyleBoxShadow")
        ),
        CssProperty::Hyphens(p) => format!(
            "CssProperty::Hyphens({})",
            print_css_property_value(p, tabs, "StyleHyphens")
        ),
        CssProperty::WordBreak(p) => format!(
            "CssProperty::WordBreak({})",
            print_css_property_value(p, tabs, "StyleWordBreak")
        ),
        CssProperty::OverflowWrap(p) => format!(
            "CssProperty::OverflowWrap({})",
            print_css_property_value(p, tabs, "StyleOverflowWrap")
        ),
        CssProperty::LineBreak(p) => format!(
            "CssProperty::LineBreak({})",
            print_css_property_value(p, tabs, "StyleLineBreak")
        ),
        CssProperty::TextOverflow(p) => format!(
            "CssProperty::TextOverflow({})",
            print_css_property_value(p, tabs, "StyleTextOverflow")
        ),
        CssProperty::ObjectFit(p) => format!(
            "CssProperty::ObjectFit({})",
            print_css_property_value(p, tabs, "StyleObjectFit")
        ),
        CssProperty::ObjectPosition(p) => format!(
            "CssProperty::ObjectPosition({})",
            print_css_property_value(p, tabs, "StyleObjectPosition")
        ),
        CssProperty::AspectRatio(p) => format!(
            "CssProperty::AspectRatio({})",
            print_css_property_value(p, tabs, "StyleAspectRatio")
        ),
        CssProperty::TextOrientation(p) => format!(
            "CssProperty::TextOrientation({})",
            print_css_property_value(p, tabs, "StyleTextOrientation")
        ),
        CssProperty::TextAlignLast(p) => format!(
            "CssProperty::TextAlignLast({})",
            print_css_property_value(p, tabs, "StyleTextAlignLast")
        ),
        CssProperty::TextTransform(p) => format!(
            "CssProperty::TextTransform({})",
            print_css_property_value(p, tabs, "StyleTextTransform")
        ),
        CssProperty::Direction(p) => format!(
            "CssProperty::Direction({})",
            print_css_property_value(p, tabs, "Direction")
        ),
        CssProperty::UserSelect(p) => format!(
            "CssProperty::UserSelect({})",
            print_css_property_value(p, tabs, "StyleUserSelect")
        ),
        CssProperty::TextDecoration(p) => format!(
            "CssProperty::TextDecoration({})",
            print_css_property_value(p, tabs, "StyleTextDecoration")
        ),
        CssProperty::WhiteSpace(p) => format!(
            "CssProperty::WhiteSpace({})",
            print_css_property_value(p, tabs, "WhiteSpace")
        ),
        CssProperty::FlexBasis(p) => format!(
            "CssProperty::FlexBasis({})",
            print_css_property_value(p, tabs, "LayoutFlexBasis")
        ),
        CssProperty::ColumnGap(p) => format!(
            "CssProperty::ColumnGap({})",
            print_css_property_value(p, tabs, "LayoutColumnGap")
        ),
        CssProperty::RowGap(p) => format!(
            "CssProperty::RowGap({})",
            print_css_property_value(p, tabs, "LayoutRowGap")
        ),
        CssProperty::GridTemplateColumns(p) => format!(
            "CssProperty::GridTemplateColumns({})",
            print_css_property_value(p, tabs, "LayoutGridTemplateColumns")
        ),
        CssProperty::GridTemplateRows(p) => format!(
            "CssProperty::GridTemplateRows({})",
            print_css_property_value(p, tabs, "LayoutGridTemplateRows")
        ),
        CssProperty::GridAutoFlow(p) => format!(
            "CssProperty::GridAutoFlow({})",
            print_css_property_value(p, tabs, "LayoutGridAutoFlow")
        ),
        CssProperty::JustifySelf(p) => format!(
            "CssProperty::JustifySelf({})",
            print_css_property_value(p, tabs, "LayoutJustifySelf")
        ),
        CssProperty::JustifyItems(p) => format!(
            "CssProperty::JustifyItems({})",
            print_css_property_value(p, tabs, "LayoutJustifyItems")
        ),
        CssProperty::Gap(p) => format!(
            "CssProperty::Gap({})",
            print_css_property_value(p, tabs, "LayoutGap")
        ),
        CssProperty::GridGap(p) => format!(
            "CssProperty::GridGap({})",
            print_css_property_value(p, tabs, "LayoutGap")
        ),
        CssProperty::AlignSelf(p) => format!(
            "CssProperty::AlignSelf({})",
            print_css_property_value(p, tabs, "LayoutAlignSelf")
        ),
        CssProperty::Font(p) => format!(
            "CssProperty::Font({})",
            print_css_property_value(p, tabs, "StyleFontFamilyVec")
        ),
        CssProperty::GridAutoRows(p) => format!(
            "CssProperty::GridAutoRows({})",
            print_css_property_value(p, tabs, "LayoutGridAutoRows")
        ),
        CssProperty::GridAutoColumns(p) => format!(
            "CssProperty::GridAutoColumns({})",
            print_css_property_value(p, tabs, "LayoutGridAutoColumns")
        ),
        CssProperty::GridRow(p) => format!(
            "CssProperty::GridRow({})",
            print_css_property_value(p, tabs, "LayoutGridRow")
        ),
        CssProperty::GridColumn(p) => format!(
            "CssProperty::GridColumn({})",
            print_css_property_value(p, tabs, "LayoutGridColumn")
        ),
        CssProperty::GridTemplateAreas(p) => format!(
            "CssProperty::GridTemplateAreas({})",
            print_css_property_value(p, tabs, "GridTemplateAreas")
        ),
        CssProperty::WritingMode(p) => format!(
            "CssProperty::WritingMode({})",
            print_css_property_value(p, tabs, "LayoutWritingMode")
        ),
        CssProperty::Clear(p) => format!(
            "CssProperty::Clear({})",
            print_css_property_value(p, tabs, "LayoutClear")
        ),
        CssProperty::BreakBefore(p) => format!(
            "CssProperty::BreakBefore({})",
            print_css_property_value(p, tabs, "PageBreak")
        ),
        CssProperty::BreakAfter(p) => format!(
            "CssProperty::BreakAfter({})",
            print_css_property_value(p, tabs, "PageBreak")
        ),
        CssProperty::BreakInside(p) => format!(
            "CssProperty::BreakInside({})",
            print_css_property_value(p, tabs, "BreakInside")
        ),
        CssProperty::Orphans(p) => format!(
            "CssProperty::Orphans({})",
            print_css_property_value(p, tabs, "Orphans")
        ),
        CssProperty::Widows(p) => format!(
            "CssProperty::Widows({})",
            print_css_property_value(p, tabs, "Widows")
        ),
        CssProperty::BoxDecorationBreak(p) => format!(
            "CssProperty::BoxDecorationBreak({})",
            print_css_property_value(p, tabs, "BoxDecorationBreak")
        ),
        CssProperty::ColumnCount(p) => format!(
            "CssProperty::ColumnCount({})",
            print_css_property_value(p, tabs, "ColumnCount")
        ),
        CssProperty::ColumnWidth(p) => format!(
            "CssProperty::ColumnWidth({})",
            print_css_property_value(p, tabs, "ColumnWidth")
        ),
        CssProperty::ColumnSpan(p) => format!(
            "CssProperty::ColumnSpan({})",
            print_css_property_value(p, tabs, "ColumnSpan")
        ),
        CssProperty::ColumnFill(p) => format!(
            "CssProperty::ColumnFill({})",
            print_css_property_value(p, tabs, "ColumnFill")
        ),
        CssProperty::ColumnRuleWidth(p) => format!(
            "CssProperty::ColumnRuleWidth({})",
            print_css_property_value(p, tabs, "ColumnRuleWidth")
        ),
        CssProperty::ColumnRuleStyle(p) => format!(
            "CssProperty::ColumnRuleStyle({})",
            print_css_property_value(p, tabs, "ColumnRuleStyle")
        ),
        CssProperty::ColumnRuleColor(p) => format!(
            "CssProperty::ColumnRuleColor({})",
            print_css_property_value(p, tabs, "ColumnRuleColor")
        ),
        CssProperty::FlowInto(p) => format!(
            "CssProperty::FlowInto({})",
            print_css_property_value(p, tabs, "FlowInto")
        ),
        CssProperty::FlowFrom(p) => format!(
            "CssProperty::FlowFrom({})",
            print_css_property_value(p, tabs, "FlowFrom")
        ),
        CssProperty::ShapeOutside(p) => format!(
            "CssProperty::ShapeOutside({})",
            print_css_property_value(p, tabs, "ShapeOutside")
        ),
        CssProperty::ShapeInside(p) => format!(
            "CssProperty::ShapeInside({})",
            print_css_property_value(p, tabs, "ShapeInside")
        ),
        CssProperty::ClipPath(p) => format!(
            "CssProperty::ClipPath({})",
            print_css_property_value(p, tabs, "ClipPath")
        ),
        CssProperty::ShapeMargin(p) => format!(
            "CssProperty::ShapeMargin({})",
            print_css_property_value(p, tabs, "ShapeMargin")
        ),
        CssProperty::ShapeImageThreshold(p) => format!(
            "CssProperty::ShapeImageThreshold({})",
            print_css_property_value(p, tabs, "ShapeImageThreshold")
        ),
        CssProperty::Content(p) => format!(
            "CssProperty::Content({})",
            print_css_property_value(p, tabs, "Content")
        ),
        CssProperty::CounterReset(p) => format!(
            "CssProperty::CounterReset({})",
            print_css_property_value(p, tabs, "CounterReset")
        ),
        CssProperty::CounterIncrement(p) => format!(
            "CssProperty::CounterIncrement({})",
            print_css_property_value(p, tabs, "CounterIncrement")
        ),
        CssProperty::ListStyleType(p) => format!(
            "CssProperty::ListStyleType({})",
            print_css_property_value(p, tabs, "StyleListStyleType")
        ),
        CssProperty::ListStylePosition(p) => format!(
            "CssProperty::ListStylePosition({})",
            print_css_property_value(p, tabs, "StyleListStylePosition")
        ),
        CssProperty::StringSet(p) => format!(
            "CssProperty::StringSet({})",
            print_css_property_value(p, tabs, "StringSet")
        ),
        CssProperty::TableLayout(p) => format!(
            "CssProperty::TableLayout({})",
            print_css_property_value(p, tabs, "LayoutTableLayout")
        ),
        CssProperty::BorderCollapse(p) => format!(
            "CssProperty::BorderCollapse({})",
            print_css_property_value(p, tabs, "StyleBorderCollapse")
        ),
        CssProperty::BorderSpacing(p) => format!(
            "CssProperty::BorderSpacing({})",
            print_css_property_value(p, tabs, "LayoutBorderSpacing")
        ),
        CssProperty::CaptionSide(p) => format!(
            "CssProperty::CaptionSide({})",
            print_css_property_value(p, tabs, "StyleCaptionSide")
        ),
        CssProperty::EmptyCells(p) => format!(
            "CssProperty::EmptyCells({})",
            print_css_property_value(p, tabs, "StyleEmptyCells")
        ),
        CssProperty::FontWeight(p) => format!(
            "CssProperty::FontWeight({})",
            print_css_property_value(p, tabs, "StyleFontWeight")
        ),
        CssProperty::FontStyle(p) => format!(
            "CssProperty::FontStyle({})",
            print_css_property_value(p, tabs, "StyleFontStyle")
        ),
    }
}
fn print_css_property_value<T: FormatAsRustCode>(
    prop_val: &CssPropertyValue<T>,
    tabs: usize,
    property_value_type: &'static str,
) -> String {
    match prop_val {
        CssPropertyValue::Auto => format!("{property_value_type}Value::Auto"),
        CssPropertyValue::None => format!("{property_value_type}Value::None"),
        CssPropertyValue::Initial => format!("{property_value_type}Value::Initial"),
        CssPropertyValue::Inherit => format!("{property_value_type}Value::Inherit"),
        CssPropertyValue::Revert => format!("{property_value_type}Value::Revert"),
        CssPropertyValue::Unset => format!("{property_value_type}Value::Unset"),
        CssPropertyValue::Exact(t) => format!(
            "{}Value::Exact({})",
            property_value_type,
            t.format_as_rust_code(tabs)
        ),
    }
}
#[cfg(test)]
#[allow(clippy::float_cmp)]
mod autotest_generated {
    use super::*;
    use crate::props::basic::animation::AnimationInterpolationFunction;
    // ---- helpers -----------------------------------------------------------
    fn resolver() -> InterpolateResolver {
        InterpolateResolver {
            interpolate_func: AnimationInterpolationFunction::Linear,
            parent_rect_width: 800.0,
            parent_rect_height: 600.0,
            current_rect_width: 400.0,
            current_rect_height: 300.0,
        }
    }
    fn font_size(px: f32) -> CssProperty {
        CssProperty::font_size(StyleFontSize {
            inner: PixelValue::px(px),
        })
    }
    fn font_size_px_of(prop: &CssProperty) -> f32 {
        match prop {
            CssProperty::FontSize(CssPropertyValue::Exact(fs)) => fs.inner.number.get(),
            other => panic!("expected an exact FontSize, got {other:?}"),
        }
    }
    /// The five CSS table properties that `CssPropertyType::to_str()` names but
    /// `CSS_PROPERTY_KEY_MAP` never registers, so `from_str` can't find them.
    /// See `bug_table_properties_are_unreachable_from_stylesheet_text`.
    // Every property type now resolves through CSS_PROPERTY_KEY_MAP.
    const KEYS_MISSING_FROM_KEY_MAP: &[CssPropertyType] = &[];
    // ---- CssKeyMap / get_css_key_map ---------------------------------------
    #[test]
    fn key_map_is_populated_and_deterministic() {
        let a = get_css_key_map();
        let b = CssKeyMap::get();
        assert_eq!(a, b, "CssKeyMap::get() must equal get_css_key_map()");
        assert!(!a.non_shorthands.is_empty());
        assert!(!a.shorthands.is_empty());
        // Every registered key resolves back to the type it was registered under.
        for (k, v) in &a.non_shorthands {
            assert_eq!(CssPropertyType::from_str(k, &a), Some(*v), "key {k}");
        }
        for (k, v) in &a.shorthands {
            assert_eq!(
                CombinedCssPropertyType::from_str(k, &a),
                Some(*v),
                "shorthand {k}"
            );
        }
    }
    // ---- from_str: malformed / boundary / unicode ---------------------------
    #[test]
    fn from_str_empty_input_returns_none() {
        let map = get_css_key_map();
        assert_eq!(CssPropertyType::from_str("", &map), None);
        assert_eq!(CombinedCssPropertyType::from_str("", &map), None);
    }
    #[test]
    fn from_str_whitespace_only_returns_none() {
        let map = get_css_key_map();
        for input in ["   ", "\t", "\n", "\r\n", " \t \n \r ", "\u{a0}"] {
            assert_eq!(CssPropertyType::from_str(input, &map), None, "{input:?}");
            assert_eq!(
                CombinedCssPropertyType::from_str(input, &map),
                None,
                "{input:?}"
            );
        }
    }
    #[test]
    fn from_str_trims_surrounding_whitespace() {
        let map = get_css_key_map();
        assert_eq!(
            CssPropertyType::from_str("  \t width \n ", &map),
            Some(CssPropertyType::Width)
        );
        assert_eq!(
            CombinedCssPropertyType::from_str("\n border \t", &map),
            Some(CombinedCssPropertyType::Border)
        );
    }
    #[test]
    fn from_str_garbage_returns_none() {
        let map = get_css_key_map();
        for input in [
            "asdfasdfasdf",
            ";",
            "{}",
            "widthh",
            "wid th",
            "width:",
            "width;garbage",
            "width!important",
            "\0",
            "\u{0}width\u{0}",
            "../../etc/passwd",
            "%s%s%s%n",
            "-",
            "--",
            "--custom-property",
        ] {
            assert_eq!(CssPropertyType::from_str(input, &map), None, "{input:?}");
            assert_eq!(
                CombinedCssPropertyType::from_str(input, &map),
                None,
                "{input:?}"
            );
        }
    }
    #[test]
    fn from_str_is_case_sensitive() {
        // CSS keys are case-insensitive per spec, but these lookups are raw map
        // hits: normalisation is the caller's job (see parser2). Locked in so a
        // future change to the casing contract is a deliberate, visible one.
        let map = get_css_key_map();
        for input in ["WIDTH", "Width", "wIdTh"] {
            assert_eq!(CssPropertyType::from_str(input, &map), None, "{input:?}");
        }
        assert_eq!(
            CssPropertyType::from_str("width", &map),
            Some(CssPropertyType::Width)
        );
    }
    #[test]
    fn from_str_boundary_number_strings_return_none() {
        let map = get_css_key_map();
        for input in [
            "0",
            "-0",
            "NaN",
            "nan",
            "inf",
            "-inf",
            "Infinity",
            "9223372036854775807",  // i64::MAX
            "-9223372036854775808", // i64::MIN
            "340282350000000000000000000000000000000", // ~f32::MAX
            "1e309",                // overflows f64
            "0.00000000000000000001",
        ] {
            assert_eq!(CssPropertyType::from_str(input, &map), None, "{input:?}");
            assert_eq!(
                CombinedCssPropertyType::from_str(input, &map),
                None,
                "{input:?}"
            );
        }
    }
    #[test]
    fn from_str_unicode_does_not_panic() {
        let map = get_css_key_map();
        for input in [
            "\u{1F600}",                // emoji
            "wi\u{0301}dth",            // combining acute accent
            "\u{202E}width",            // RTL override
            "width",               // fullwidth latin
            "width\u{FEFF}",            // BOM suffix
            "𝓌𝒾𝒹𝓉𝒽",                    // mathematical script
            "ширина",                   // cyrillic
            "\u{0301}\u{0301}\u{0301}", // lone combining marks
        ] {
            assert_eq!(CssPropertyType::from_str(input, &map), None, "{input:?}");
            assert_eq!(
                CombinedCssPropertyType::from_str(input, &map),
                None,
                "{input:?}"
            );
        }
    }
    #[test]
    fn from_str_extremely_long_input_does_not_panic_or_hang() {
        let map = get_css_key_map();
        let huge = "width".repeat(200_000); // 1_000_000 chars
        assert_eq!(huge.len(), 1_000_000);
        assert_eq!(CssPropertyType::from_str(&huge, &map), None);
        assert_eq!(CombinedCssPropertyType::from_str(&huge, &map), None);
        // A valid key buried in a megabyte of padding is still not a valid key.
        let padded = format!("{}width{}", "x".repeat(500_000), "x".repeat(500_000));
        assert_eq!(CssPropertyType::from_str(&padded, &map), None);
    }
    #[test]
    fn from_str_deeply_nested_brackets_do_not_stack_overflow() {
        let map = get_css_key_map();
        let nested = format!("{}{}", "(".repeat(10_000), ")".repeat(10_000));
        assert_eq!(CssPropertyType::from_str(&nested, &map), None);
        assert_eq!(CombinedCssPropertyType::from_str(&nested, &map), None);
    }
    #[test]
    fn from_str_valid_minimal_positive_control() {
        let map = get_css_key_map();
        assert_eq!(
            CssPropertyType::from_str("width", &map),
            Some(CssPropertyType::Width)
        );
        assert_eq!(
            CssPropertyType::from_str("justify-content", &map),
            Some(CssPropertyType::JustifyContent)
        );
        assert_eq!(
            CombinedCssPropertyType::from_str("border", &map),
            Some(CombinedCssPropertyType::Border)
        );
    }
    #[test]
    fn word_wrap_is_a_registered_alias_for_overflow_wrap() {
        let map = get_css_key_map();
        assert_eq!(
            CssPropertyType::from_str("word-wrap", &map),
            Some(CssPropertyType::OverflowWrap)
        );
        assert_eq!(
            CssPropertyType::from_str("overflow-wrap", &map),
            Some(CssPropertyType::OverflowWrap)
        );
        // The alias is not the canonical name.
        assert_eq!(CssPropertyType::OverflowWrap.to_str(), "overflow-wrap");
    }
    #[test]
    fn keys_present_in_both_maps_are_shorthand_shadowed() {
        // These four strings are registered in *both* key maps. parser2 consults
        // the shorthand map first, so the CombinedCssPropertyType always wins and
        // the same-named CssPropertyType is never reached from stylesheet text.
        let map = get_css_key_map();
        for k in ["background", "font", "gap", "grid-gap"] {
            assert!(
                CssPropertyType::from_str(k, &map).is_some(),
                "{k} should be in the non-shorthand map"
            );
            assert!(
                CombinedCssPropertyType::from_str(k, &map).is_some(),
                "{k} should be in the shorthand map"
            );
        }
    }
    // ---- to_str / Display / Debug round-trips -------------------------------
    #[test]
    fn css_property_type_to_str_is_non_empty_and_unique() {
        let mut seen = BTreeMap::new();
        for t in CssPropertyType::iter() {
            let s = t.to_str();
            assert!(!s.is_empty(), "{t:?} has an empty to_str()");
            assert!(!s.contains(' '), "{t:?} to_str() contains whitespace: {s:?}");
            assert_eq!(s.trim(), s, "{t:?} to_str() is not trimmed: {s:?}");
            if let Some(prev) = seen.insert(s, t) {
                panic!("to_str() collision: {prev:?} and {t:?} both return {s:?}");
            }
        }
        assert_eq!(seen.len(), CssPropertyType::ALL.len());
    }
    #[test]
    fn css_property_type_display_and_debug_agree_with_to_str() {
        for t in CssPropertyType::iter() {
            assert_eq!(format!("{t}"), t.to_str());
            assert_eq!(format!("{t:?}"), t.to_str());
        }
    }
    #[test]
    fn css_property_type_iter_matches_all() {
        let collected: Vec<CssPropertyType> = CssPropertyType::iter().collect();
        assert_eq!(collected.as_slice(), CssPropertyType::ALL);
        // Iteration is repeatable (no interior state).
        let again: Vec<CssPropertyType> = CssPropertyType::iter().collect();
        assert_eq!(collected, again);
    }
    #[test]
    fn css_property_type_to_str_round_trips_except_known_gap() {
        // parse(serialize(x)) == x for every property type that is actually
        // registered in the key map. The set that fails to round-trip is pinned
        // to the five table properties below; a sixth regression fails here.
        let map = get_css_key_map();
        let mut unreachable = Vec::new();
        for t in CssPropertyType::iter() {
            match CssPropertyType::from_str(t.to_str(), &map) {
                Some(back) => assert_eq!(back, t, "{t:?} round-tripped to the wrong type"),
                None => unreachable.push(t),
            }
        }
        assert_eq!(
            unreachable.as_slice(),
            KEYS_MISSING_FROM_KEY_MAP,
            "the set of property types missing from CSS_PROPERTY_KEY_MAP changed"
        );
    }
    #[test]
    fn bug_table_properties_are_unreachable_from_stylesheet_text() {
        let map = get_css_key_map();
        for t in KEYS_MISSING_FROM_KEY_MAP {
            assert_eq!(
                CssPropertyType::from_str(t.to_str(), &map),
                Some(*t),
                "`{}` has a to_str() name and a working value parser, but no key-map \
                 entry, so parser2 rejects the declaration outright",
                t.to_str()
            );
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn table_property_value_parsers_work_even_though_the_keys_do_not_resolve() {
        // Proves the gap above is purely in CSS_PROPERTY_KEY_MAP: given the key
        // *type*, every one of these values parses fine. Only the string -> type
        // lookup is missing.
        for (t, value) in [
            (CssPropertyType::TableLayout, "fixed"),
            (CssPropertyType::BorderCollapse, "collapse"),
            (CssPropertyType::CaptionSide, "top"),
            (CssPropertyType::EmptyCells, "hide"),
        ] {
            let parsed = parse_css_property(t, value)
                .unwrap_or_else(|e| panic!("`{}: {value}` should parse: {e}", t.to_str()));
            assert_eq!(parsed.get_type(), t);
        }
    }
    #[test]
    fn combined_css_property_type_round_trips_and_display_agrees() {
        let map = get_css_key_map();
        for t in map.shorthands.values() {
            let s = t.to_str(&map);
            assert!(!s.is_empty());
            assert_eq!(
                CombinedCssPropertyType::from_str(s, &map),
                Some(*t),
                "{t:?} did not round-trip"
            );
            // Display is derived from the static array, to_str from the map:
            // the two sources must not drift apart.
            assert_eq!(format!("{t}"), s, "Display disagrees with to_str for {t:?}");
        }
        assert_eq!(map.shorthands.len(), COMBINED_CSS_PROPERTIES_KEY_MAP.len());
    }
    // ---- predicates: totality + known true/false -----------------------------
    #[test]
    fn is_inheritable_matches_the_css_spec_for_known_properties() {
        for t in [
            CssPropertyType::TextColor,
            CssPropertyType::FontFamily,
            CssPropertyType::FontSize,
            CssPropertyType::LineHeight,
            CssPropertyType::Visibility,
            CssPropertyType::Cursor,
            CssPropertyType::WritingMode,
        ] {
            assert!(t.is_inheritable(), "{t:?} is inherited per CSS spec");
        }
        for t in [
            CssPropertyType::Width,
            CssPropertyType::Height,
            CssPropertyType::Display,
            CssPropertyType::Position,
            CssPropertyType::Opacity,
            CssPropertyType::Transform,
            CssPropertyType::BackgroundContent,
            CssPropertyType::UnicodeBidi, // explicitly non-inherited, see +spec:display-property
        ] {
            assert!(!t.is_inheritable(), "{t:?} is NOT inherited per CSS spec");
        }
    }
    #[test]
    fn predicates_are_total_over_every_property_type() {
        // Every predicate must return a deterministic bool for all 180 variants
        // without panicking, and must be pure (same answer twice).
        for t in CssPropertyType::iter() {
            assert_eq!(t.is_inheritable(), t.is_inheritable());
            assert_eq!(t.has_compact_encoding(), t.has_compact_encoding());
            assert_eq!(t.can_trigger_relayout(), t.can_trigger_relayout());
            assert_eq!(t.is_gpu_only_property(), t.is_gpu_only_property());
            assert_eq!(t.get_category(), t.get_category());
            assert_eq!(t.relayout_scope(false), t.relayout_scope(false));
            assert_eq!(t.relayout_scope(true), t.relayout_scope(true));
        }
    }
    #[test]
    fn is_gpu_only_property_is_exactly_opacity_and_transform() {
        let gpu: Vec<CssPropertyType> = CssPropertyType::iter()
            .filter(CssPropertyType::is_gpu_only_property)
            .collect();
        assert_eq!(
            gpu,
            vec![CssPropertyType::Opacity, CssPropertyType::Transform]
        );
    }
    #[test]
    fn has_compact_encoding_known_true_false() {
        assert!(CssPropertyType::Display.has_compact_encoding());
        assert!(CssPropertyType::Width.has_compact_encoding());
        assert!(CssPropertyType::FlexGrow.has_compact_encoding());
        assert!(!CssPropertyType::Transform.has_compact_encoding());
        assert!(!CssPropertyType::Filter.has_compact_encoding());
        assert!(!CssPropertyType::Content.has_compact_encoding());
    }
    #[test]
    fn can_trigger_relayout_known_true_false() {
        for t in [
            CssPropertyType::Width,
            CssPropertyType::Display,
            CssPropertyType::FontSize,
            CssPropertyType::MarginTop,
        ] {
            assert!(t.can_trigger_relayout(), "{t:?} affects geometry");
        }
        for t in [
            CssPropertyType::TextColor,
            CssPropertyType::Opacity,
            CssPropertyType::Transform,
            CssPropertyType::BackgroundContent,
        ] {
            assert!(!t.can_trigger_relayout(), "{t:?} is paint-only");
        }
    }
    #[test]
    fn get_category_is_derived_consistently_from_the_predicates() {
        for t in CssPropertyType::iter() {
            let expected = if t.is_gpu_only_property() {
                CssPropertyCategory::GpuOnly
            } else {
                match (t.is_inheritable(), t.can_trigger_relayout()) {
                    (true, true) => CssPropertyCategory::InheritedLayout,
                    (true, false) => CssPropertyCategory::InheritedPaint,
                    (false, true) => CssPropertyCategory::Layout,
                    (false, false) => CssPropertyCategory::Paint,
                }
            };
            assert_eq!(t.get_category(), expected, "{t:?}");
        }
        assert_eq!(
            CssPropertyType::Opacity.get_category(),
            CssPropertyCategory::GpuOnly
        );
        assert_eq!(
            CssPropertyType::Width.get_category(),
            CssPropertyCategory::Layout
        );
        assert_eq!(
            CssPropertyType::FontSize.get_category(),
            CssPropertyCategory::InheritedLayout
        );
    }
    // ---- relayout_scope ------------------------------------------------------
    #[test]
    fn relayout_scope_never_contradicts_can_trigger_relayout() {
        // relayout_scope is documented as "a more granular replacement for
        // can_trigger_relayout()". The safe direction must hold: anything the
        // coarse predicate calls paint-only must also be scope None, or an
        // incremental-layout consumer would skip a relayout it actually needs.
        for t in CssPropertyType::iter() {
            if !t.can_trigger_relayout() {
                for ifc in [false, true] {
                    assert_eq!(
                        t.relayout_scope(ifc),
                        RelayoutScope::None,
                        "{t:?} is paint-only but claims a relayout scope (ifc={ifc})"
                    );
                }
            }
        }
    }
    #[test]
    fn relayout_scope_paint_only_ignores_the_ifc_flag() {
        for t in [
            CssPropertyType::TextColor,
            CssPropertyType::Opacity,
            CssPropertyType::Transform,
            CssPropertyType::BackgroundContent,
            CssPropertyType::CaretColor,
            CssPropertyType::ObjectFit,
        ] {
            assert_eq!(t.relayout_scope(false), RelayoutScope::None, "{t:?}");
            assert_eq!(t.relayout_scope(true), RelayoutScope::None, "{t:?}");
        }
    }
    #[test]
    fn relayout_scope_upgrades_text_properties_only_inside_an_ifc() {
        // Font/text changes reflow an inline formatting context but do not
        // resize a block container that has only block children.
        for t in [
            CssPropertyType::FontSize,
            CssPropertyType::FontFamily,
            CssPropertyType::LineHeight,
            CssPropertyType::LetterSpacing,
        ] {
            assert_eq!(t.relayout_scope(true), RelayoutScope::IfcOnly, "{t:?}");
            assert_ne!(t.relayout_scope(false), RelayoutScope::IfcOnly, "{t:?}");
        }
    }
    // ---- CssProperty keyword constructors: totality over all 180 variants -----
    #[test]
    fn keyword_constructors_preserve_the_property_type_for_every_variant() {
        // css_property_from_type! is a 180-arm hand-written macro: a single
        // copy-paste slip would silently build the wrong variant.
        for t in CssPropertyType::iter() {
            assert_eq!(CssProperty::none(t).get_type(), t, "none({t:?})");
            assert_eq!(CssProperty::auto(t).get_type(), t, "auto({t:?})");
            assert_eq!(CssProperty::initial(t).get_type(), t, "initial({t:?})");
            assert_eq!(CssProperty::inherit(t).get_type(), t, "inherit({t:?})");
        }
    }
    #[test]
    fn key_agrees_with_get_type_for_every_variant() {
        for t in CssPropertyType::iter() {
            assert_eq!(CssProperty::none(t).key(), t.to_str(), "{t:?}");
        }
    }
    #[test]
    fn value_and_format_css_are_well_formed_for_every_keyword_variant() {
        for t in CssPropertyType::iter() {
            for (ctor, keyword) in [
                (CssProperty::none as fn(CssPropertyType) -> CssProperty, "none"),
                (CssProperty::auto, "auto"),
                (CssProperty::initial, "initial"),
                (CssProperty::inherit, "inherit"),
            ] {
                let prop = ctor(t);
                assert_eq!(prop.value(), keyword, "{t:?} {keyword}");
                assert!(!prop.value().is_empty());
                assert_eq!(
                    prop.format_css(),
                    format!("{}: {keyword};", t.to_str()),
                    "{t:?} {keyword}"
                );
            }
        }
    }
    #[test]
    fn format_css_does_not_panic_on_extreme_and_non_finite_numbers() {
        for px in [
            0.0,
            -0.0,
            1.0,
            -1.0,
            f32::MAX,
            f32::MIN,
            f32::MIN_POSITIVE,
            f32::EPSILON,
            f32::INFINITY,
            f32::NEG_INFINITY,
            f32::NAN,
        ] {
            let prop = font_size(px);
            let css = prop.format_css();
            assert!(!css.is_empty(), "empty css for font-size {px}");
            assert!(css.starts_with("font-size: "), "malformed: {css:?}");
            assert!(css.ends_with(';'), "malformed: {css:?}");
            assert_eq!(prop.get_type(), CssPropertyType::FontSize);
        }
    }
    #[test]
    fn extreme_float_inputs_saturate_rather_than_wrap() {
        // FloatValue stores a fixed-point isize; `f32 as isize` saturates, so
        // huge magnitudes must clamp and NaN must land on a defined value.
        assert!(font_size_px_of(&font_size(f32::INFINITY)) > 0.0);
        assert!(font_size_px_of(&font_size(f32::NEG_INFINITY)) < 0.0);
        assert_eq!(font_size_px_of(&font_size(f32::NAN)), 0.0);
        assert_eq!(font_size_px_of(&font_size(0.0)), 0.0);
        assert_eq!(font_size_px_of(&font_size(16.0)), 16.0);
        assert_eq!(font_size_px_of(&font_size(-16.0)), -16.0);
    }
    // ---- interpolate ---------------------------------------------------------
    #[test]
    fn interpolate_at_and_beyond_the_endpoints() {
        let r = resolver();
        let a = font_size(10.0);
        let b = font_size(20.0);
        assert_eq!(a.interpolate(&b, 0.0, &r), a, "t=0 must return self");
        assert_eq!(a.interpolate(&b, 1.0, &r), b, "t=1 must return other");
        assert_eq!(a.interpolate(&b, -0.0, &r), a);
        assert_eq!(a.interpolate(&b, -5.0, &r), a, "t<0 clamps to self");
        assert_eq!(a.interpolate(&b, 5.0, &r), b, "t>1 clamps to other");
        assert_eq!(a.interpolate(&b, f32::NEG_INFINITY, &r), a);
        assert_eq!(a.interpolate(&b, f32::INFINITY, &r), b);
        assert_eq!(a.interpolate(&b, f32::MIN, &r), a);
        assert_eq!(a.interpolate(&b, f32::MAX, &r), b);
    }
    #[test]
    fn interpolate_midpoint_is_the_linear_average() {
        let r = resolver();
        let out = font_size(0.0).interpolate(&font_size(100.0), 0.5, &r);
        let px = font_size_px_of(&out);
        assert!(
            (px - 50.0).abs() < 1.0,
            "linear midpoint of 0px..100px should be ~50px, got {px}"
        );
    }
    #[test]
    fn interpolate_nan_t_does_not_panic_and_keeps_the_property_type() {
        let r = resolver();
        let a = font_size(10.0);
        let b = font_size(20.0);
        // NaN fails both the `t <= 0.0` and `t >= 1.0` guards and survives
        // f32::clamp, so it reaches the per-property interpolators.
        let out = a.interpolate(&b, f32::NAN, &r);
        assert_eq!(out.get_type(), CssPropertyType::FontSize);
        assert!(!out.format_css().is_empty());
    }
    #[test]
    fn interpolate_extreme_endpoints_do_not_panic() {
        let r = resolver();
        for (from, to) in [
            (f32::MAX, f32::MIN),
            (f32::MIN, f32::MAX),
            (f32::INFINITY, f32::NEG_INFINITY),
            (f32::NAN, 10.0),
            (10.0, f32::NAN),
            (0.0, 0.0),
        ] {
            for t in [0.25, 0.5, 0.75] {
                let out = font_size(from).interpolate(&font_size(to), t, &r);
                assert_eq!(out.get_type(), CssPropertyType::FontSize);
                assert!(!out.format_css().is_empty());
            }
        }
    }
    #[test]
    fn interpolate_between_mismatched_types_falls_back_without_panic() {
        let r = resolver();
        let width = CssProperty::width(LayoutWidth::Px(PixelValue::px(10.0)));
        let height = CssProperty::height(LayoutHeight::Px(PixelValue::px(20.0)));
        // Not animatable across types: snaps to the nearer endpoint.
        assert_eq!(width.interpolate(&height, 0.25, &r), width);
        assert_eq!(width.interpolate(&height, 0.75, &r), height);
        // NaN takes neither branch of `t > 0.5`, so it must fall back to self.
        assert_eq!(width.interpolate(&height, f32::NAN, &r), width);
    }
    #[test]
    fn interpolate_keyword_operands_fall_back_to_defaults_without_panic() {
        let r = resolver();
        // `auto`/`inherit` carry no concrete value; interpolating them must not
        // unwrap a missing property.
        let auto = CssProperty::auto(CssPropertyType::FontSize);
        let inherit = CssProperty::inherit(CssPropertyType::FontSize);
        let exact = font_size(24.0);
        for (a, b) in [
            (&auto, &exact),
            (&exact, &auto),
            (&inherit, &exact),
            (&auto, &inherit),
        ] {
            let out = a.interpolate(b, 0.5, &r);
            assert_eq!(out.get_type(), CssPropertyType::FontSize);
            assert!(!out.format_css().is_empty());
        }
    }
    // ---- parse_css_property --------------------------------------------------
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_keyword_shortcut_works_for_every_property_type() {
        // `initial` / `inherit` short-circuit before any key-specific parsing,
        // so they must succeed for all 180 types and keep the requested type.
        for t in CssPropertyType::iter() {
            for keyword in ["initial", "inherit"] {
                let parsed = parse_css_property(t, keyword)
                    .unwrap_or_else(|e| panic!("{}: {keyword} failed: {e}", t.to_str()));
                assert_eq!(parsed.get_type(), t, "{t:?} {keyword}");
                assert_eq!(parsed.value(), keyword);
            }
            // Surrounding whitespace is trimmed before the keyword match.
            let parsed = parse_css_property(t, "  \t initial \n ")
                .unwrap_or_else(|e| panic!("{}: padded initial failed: {e}", t.to_str()));
            assert_eq!(parsed, CssProperty::initial(t), "{t:?}");
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_valid_minimal_positive_control() {
        let width = parse_css_property(CssPropertyType::Width, "100px").expect("100px is valid");
        assert_eq!(width.get_type(), CssPropertyType::Width);
        assert_eq!(width.value(), "100px");
        assert_eq!(width.format_css(), "width: 100px;");
        let display =
            parse_css_property(CssPropertyType::Display, "flex").expect("flex is valid display");
        assert_eq!(display.get_type(), CssPropertyType::Display);
        // text-overflow: full dispatch through parse_css_property -> typed CssProperty,
        // correct type mapping, and canonical serialization.
        let text_overflow = parse_css_property(CssPropertyType::TextOverflow, "ellipsis")
            .expect("ellipsis is valid text-overflow");
        assert_eq!(text_overflow.get_type(), CssPropertyType::TextOverflow);
        assert_eq!(
            text_overflow,
            CssProperty::TextOverflow(CssPropertyValue::Exact(StyleTextOverflow::Ellipsis))
        );
        assert_eq!(text_overflow.value(), "ellipsis");
        assert_eq!(text_overflow.format_css(), "text-overflow: ellipsis;");
        assert!(parse_css_property(CssPropertyType::TextOverflow, "bogus").is_err());
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_empty_and_whitespace_only_are_rejected() {
        for value in ["", " ", "\t", "\n", "   \t\n  "] {
            assert!(
                parse_css_property(CssPropertyType::Width, value).is_err(),
                "width: {value:?} should not parse"
            );
            assert!(
                parse_css_property(CssPropertyType::TextColor, value).is_err(),
                "color: {value:?} should not parse"
            );
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_garbage_is_rejected_without_panicking() {
        for value in [
            "!!!",
            "not-a-value",
            "100pxx",
            "px100",
            "100 px",
            ";",
            "}",
            "100px;",
            "100px !important",
            "\0",
            "#gg0000",
            "rgb(",
            "rgb(1,2",
        ] {
            assert!(
                parse_css_property(CssPropertyType::Width, value).is_err()
                    || parse_css_property(CssPropertyType::TextColor, value).is_err(),
                "{value:?} parsed as both a width and a color"
            );
        }
        // Spot-check the ones that must be rejected by *both* parsers.
        for value in ["!!!", "not-a-value", "\0", ";"] {
            assert!(parse_css_property(CssPropertyType::Width, value).is_err());
            assert!(parse_css_property(CssPropertyType::TextColor, value).is_err());
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_unicode_is_rejected_without_panicking() {
        for value in [
            "\u{1F600}",
            "100\u{0301}px",
            "\u{202E}100px",
            "100px",
            "100px\u{FEFF}",
            "红色",
        ] {
            // Must not panic; a multibyte slice must never be cut mid-codepoint.
            let _ = parse_css_property(CssPropertyType::Width, value).is_err();
            let _ = parse_css_property(CssPropertyType::TextColor, value).is_err();
            let _ = parse_css_property(CssPropertyType::FontFamily, value).is_ok();
        }
        assert!(parse_css_property(CssPropertyType::Width, "\u{1F600}").is_err());
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_boundary_numbers_do_not_panic() {
        for value in [
            "0",
            "0px",
            "-0px",
            "-1px",
            "2147483647px",
            "-2147483648px",
            "9223372036854775807px",
            "340282350000000000000000000000000000000px",
            "1e309px",
            "NaNpx",
            "infpx",
            "0.00000000000000000001px",
            "99999999999999999999999999999999999999999999px",
        ] {
            // The contract is "no panic, no overflow trap" — a saturating Ok or a
            // clean Err are both acceptable, a debug-overflow panic is not.
            let parsed = parse_css_property(CssPropertyType::Width, value);
            if let Ok(p) = parsed {
                assert_eq!(p.get_type(), CssPropertyType::Width, "{value:?}");
                assert!(!p.format_css().is_empty(), "{value:?}");
            }
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_extremely_long_input_does_not_hang() {
        // Long *digit* runs stay at 100k: the float parser is the expensive part
        // and the point is to prove it terminates, not to benchmark it.
        let huge = "1".repeat(100_000);
        if let Ok(p) = parse_css_property(CssPropertyType::Width, &huge) {
            assert_eq!(p.get_type(), CssPropertyType::Width);
        }
        let huge_px = format!("{}px", "9".repeat(100_000));
        let _ = parse_css_property(CssPropertyType::Width, &huge_px);
        // Pure garbage is rejected on the first byte, so a full megabyte is cheap.
        let huge_garbage = "z".repeat(1_000_000);
        assert!(parse_css_property(CssPropertyType::Width, &huge_garbage).is_err());
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_deeply_nested_calc_does_not_stack_overflow() {
        // parse_calc_expression is an iterative stack machine, not a recursive
        // descent parser, so deep nesting must stay on the heap.
        let depth = 10_000;
        let nested = format!("calc({}1px{})", "(".repeat(depth), ")".repeat(depth));
        let _ = parse_css_property(CssPropertyType::Width, &nested);
        let unbalanced = format!("calc({})", "(".repeat(depth));
        let _ = parse_css_property(CssPropertyType::Width, &unbalanced);
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_css_property_leading_trailing_junk_is_handled_deterministically() {
        // Padding is trimmed...
        let padded = parse_css_property(CssPropertyType::Width, "  \t 100px \n ")
            .expect("surrounding whitespace should be trimmed");
        assert_eq!(padded.value(), "100px");
        assert_eq!(
            padded,
            parse_css_property(CssPropertyType::Width, "100px").unwrap()
        );
        // ...but embedded junk is not silently dropped.
        assert!(parse_css_property(CssPropertyType::Width, "100px;garbage").is_err());
        assert!(parse_css_property(CssPropertyType::Width, "garbage 100px").is_err());
    }
    // ---- parse_combined_css_property ------------------------------------------
    #[test]
    #[cfg(feature = "parser")]
    fn parse_combined_css_property_valid_minimal_positive_control() {
        let props = parse_combined_css_property(CombinedCssPropertyType::Margin, "10px")
            .expect("margin: 10px is valid");
        let types: Vec<CssPropertyType> = props.iter().map(CssProperty::get_type).collect();
        assert_eq!(
            types,
            vec![
                CssPropertyType::MarginTop,
                CssPropertyType::MarginBottom,
                CssPropertyType::MarginLeft,
                CssPropertyType::MarginRight,
            ]
        );
        for p in &props {
            assert_eq!(p.value(), "10px");
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_combined_css_property_expands_every_shorthand_or_errors_cleanly() {
        // `initial` short-circuits ahead of every value parser, so all 27
        // shorthands must expand to a non-empty list of `initial` longhands.
        let map = get_css_key_map();
        for key in map.shorthands.values() {
            let props = parse_combined_css_property(*key, "initial")
                .unwrap_or_else(|e| panic!("{key:?}: initial failed: {e}"));
            assert!(
                !props.is_empty(),
                "{key:?} expanded to an empty property list"
            );
            for p in &props {
                assert_eq!(p.value(), "initial", "{key:?} -> {:?}", p.get_type());
                assert_eq!(*p, CssProperty::initial(p.get_type()), "{key:?}");
            }
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_combined_css_property_empty_and_whitespace_are_rejected() {
        for value in ["", " ", "\t\n", "    "] {
            assert!(
                parse_combined_css_property(CombinedCssPropertyType::Margin, value).is_err(),
                "margin: {value:?} should not parse"
            );
            assert!(
                parse_combined_css_property(CombinedCssPropertyType::BorderRadius, value).is_err(),
                "border-radius: {value:?} should not parse"
            );
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_combined_css_property_garbage_is_rejected_without_panicking() {
        for value in ["!!!", "not-a-value", "10pxx", ";", "\0", "10px 20px 30px 40px 50px"] {
            assert!(
                parse_combined_css_property(CombinedCssPropertyType::Margin, value).is_err(),
                "margin: {value:?} should not parse"
            );
        }
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_combined_css_property_unicode_and_long_input_do_not_panic() {
        for value in ["\u{1F600}", "1\u{0301}0px", "10px", "红色"] {
            let _ = parse_combined_css_property(CombinedCssPropertyType::Margin, value).is_err();
            let _ = parse_combined_css_property(CombinedCssPropertyType::Background, value).is_err();
        }
        // The padding/margin parser parses every value before it counts them, so
        // 20k values already exercises the TooManyValues path without a long run.
        let many = "10px ".repeat(20_000);
        assert!(
            parse_combined_css_property(CombinedCssPropertyType::Margin, &many).is_err(),
            "20_000 margin values should be TooManyValues, not a panic"
        );
        let huge_garbage = "z".repeat(1_000_000);
        assert!(
            parse_combined_css_property(CombinedCssPropertyType::Margin, &huge_garbage).is_err()
        );
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parse_combined_css_property_nested_parens_do_not_stack_overflow() {
        let nested = format!("{}10px{}", "(".repeat(1_000), ")".repeat(1_000));
        let _ = parse_combined_css_property(CombinedCssPropertyType::Margin, &nested);
        let _ = parse_combined_css_property(CombinedCssPropertyType::Border, &nested);
    }
    // ---- CssParsingError round-trip -------------------------------------------
    #[test]
    #[cfg(feature = "parser")]
    fn parsing_error_survives_the_owned_round_trip() {
        let err = parse_css_property(CssPropertyType::Width, "definitely-not-a-width")
            .expect_err("garbage width must fail");
        let owned = err.to_contained();
        let shared = owned.to_shared();
        // to_contained/to_shared must preserve the error, not flatten it to a
        // generic variant: the rendered message is the observable contract.
        assert_eq!(format!("{err}"), format!("{shared}"));
        assert!(!format!("{err}").is_empty());
        // ...and the round-trip is idempotent.
        let owned_again = shared.to_contained();
        assert_eq!(format!("{}", owned_again.to_shared()), format!("{err}"));
    }
    #[test]
    #[cfg(feature = "parser")]
    fn parsing_errors_round_trip_for_a_spread_of_property_kinds() {
        for t in [
            CssPropertyType::Width,
            CssPropertyType::TextColor,
            CssPropertyType::FontSize,
            CssPropertyType::Opacity,
            CssPropertyType::Transform,
            CssPropertyType::BackgroundContent,
        ] {
            let Err(err) = parse_css_property(t, "\u{1F600}not-valid\u{1F600}") else {
                continue;
            };
            let owned = err.to_contained();
            let round_tripped = owned.to_shared();
            assert_eq!(
                format!("{err}"),
                format!("{round_tripped}"),
                "{} error lost information in to_contained()",
                t.to_str()
            );
        }
    }
}