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

            
52
const COMBINED_CSS_PROPERTIES_KEY_MAP: [(CombinedCssPropertyType, &str); 31] = [
53
    (CombinedCssPropertyType::BorderRadius, "border-radius"),
54
    (CombinedCssPropertyType::Overflow, "overflow"),
55
    (
56
        CombinedCssPropertyType::OverscrollBehavior,
57
        "overscroll-behavior",
58
    ),
59
    (CombinedCssPropertyType::Padding, "padding"),
60
    (CombinedCssPropertyType::Margin, "margin"),
61
    (CombinedCssPropertyType::Border, "border"),
62
    (CombinedCssPropertyType::BorderLeft, "border-left"),
63
    (CombinedCssPropertyType::BorderRight, "border-right"),
64
    (CombinedCssPropertyType::BorderTop, "border-top"),
65
    (CombinedCssPropertyType::BorderBottom, "border-bottom"),
66
    (CombinedCssPropertyType::BorderColor, "border-color"),
67
    (CombinedCssPropertyType::BorderStyle, "border-style"),
68
    (CombinedCssPropertyType::BorderWidth, "border-width"),
69
    (CombinedCssPropertyType::BoxShadow, "box-shadow"),
70
    (CombinedCssPropertyType::BackgroundColor, "background-color"),
71
    (CombinedCssPropertyType::BackgroundImage, "background-image"),
72
    (CombinedCssPropertyType::Background, "background"),
73
    (CombinedCssPropertyType::Flex, "flex"),
74
    (CombinedCssPropertyType::Grid, "grid"),
75
    (CombinedCssPropertyType::Gap, "gap"),
76
    (CombinedCssPropertyType::GridGap, "grid-gap"),
77
    (CombinedCssPropertyType::Font, "font"),
78
    (CombinedCssPropertyType::Columns, "columns"),
79
    (CombinedCssPropertyType::GridArea, "grid-area"),
80
    (CombinedCssPropertyType::ColumnRule, "column-rule"),
81
    (CombinedCssPropertyType::TextBox, "text-box"),
82
    // +spec:writing-modes:798cca - inset-block/inset-inline shorthand properties
83
    (CombinedCssPropertyType::InsetBlock, "inset-block"),
84
    (CombinedCssPropertyType::InsetInline, "inset-inline"),
85
    // SVG's `fill` IS a background: an SVG shape's box is clipped to its own
86
    // geometry, so filling the box fills the shape. Aliasing it here rather
87
    // than adding a parallel paint model is what lets all three spellings -
88
    // the presentation attribute, `style="fill:…"`, and a stylesheet rule
89
    // matching `class="ColorScheme-Text"` - resolve through the ONE cascade,
90
    // and it brings every background feature along: a gradient fill, an image
91
    // fill and a `:hover` fill need no further plumbing.
92
    //
93
    // Placed LAST on purpose: `Display for CombinedCssPropertyType` returns
94
    // the first name for a type, so this stays an accepted input spelling
95
    // without becoming the printed one.
96
    (CombinedCssPropertyType::BackgroundColor, "fill"),
97
    // ... and SVG's `stroke` is the BORDER of that same box. An SVG shape's
98
    // box is clipped to its geometry and can never show a rectangular border,
99
    // so the border slots are free, and reusing them means a stroke is styled
100
    // by the same cascade as everything else: `stroke="…"`, `style="stroke:…"`
101
    // and a stylesheet rule all land in one place. The display list turns them
102
    // into a STROKED PATH rather than a rectangle - a stroke follows the
103
    // geometry, which is the whole difference between it and a border.
104
    (CombinedCssPropertyType::BorderColor, "stroke"),
105
    (CombinedCssPropertyType::BorderWidth, "stroke-width"),
106
];
107

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

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

            
545
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
546
pub struct CssKeyMap {
547
    // Contains all keys that have no shorthand
548
    pub non_shorthands: BTreeMap<&'static str, CssPropertyType>,
549
    // Contains all keys that act as a shorthand for other types
550
    pub shorthands: BTreeMap<&'static str, CombinedCssPropertyType>,
551
}
552

            
553
impl CssKeyMap {
554
    #[must_use]
555
265
    pub fn get() -> Self {
556
265
        get_css_key_map()
557
265
    }
558
}
559

            
560
/// Returns a map useful for parsing the keys of CSS stylesheets
561
#[must_use]
562
120494
pub fn get_css_key_map() -> CssKeyMap {
563
    CssKeyMap {
564
23616824
        non_shorthands: CSS_PROPERTY_KEY_MAP.iter().map(|(v, k)| (*k, *v)).collect(),
565
120494
        shorthands: COMBINED_CSS_PROPERTIES_KEY_MAP
566
120494
            .iter()
567
3735314
            .map(|(v, k)| (*k, *v))
568
120494
            .collect(),
569
    }
570
120494
}
571

            
572
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
573
#[repr(C)]
574
pub enum CombinedCssPropertyType {
575
    BorderRadius,
576
    Overflow,
577
    OverscrollBehavior,
578
    Margin,
579
    Border,
580
    BorderLeft,
581
    BorderRight,
582
    BorderTop,
583
    BorderBottom,
584
    BorderColor,
585
    BorderStyle,
586
    BorderWidth,
587
    Padding,
588
    BoxShadow,
589
    BackgroundColor, // BackgroundContent::Color
590
    BackgroundImage, // BackgroundContent::Image
591
    Background,
592
    Flex,
593
    Grid,
594
    Gap,
595
    GridGap,
596
    Font,
597
    Columns,
598
    ColumnRule,
599
    GridArea,
600
    TextBox,
601
    /// `inset-block` shorthand: sets `inset-block-start` + `inset-block-end`
602
    /// (maps to `top` + `bottom` in horizontal-tb writing mode)
603
    InsetBlock,
604
    /// `inset-inline` shorthand: sets `inset-inline-start` + `inset-inline-end`
605
    /// (maps to `left` + `right` in horizontal-tb writing mode)
606
    InsetInline,
607
}
608

            
609
impl fmt::Display for CombinedCssPropertyType {
610
34
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
611
        // The map is `[(CombinedCssPropertyType, &str)]`, so the NAME is slot 1.
612
        // `.map(|(k, _)| k)` bound slot 0 — the enum itself — and `write!` then called
613
        // this very impl on it again, recursing until the stack blew.
614
34
        let key = COMBINED_CSS_PROPERTIES_KEY_MAP
615
34
            .iter()
616
460
            .find(|(v, _)| *v == *self)
617
34
            .map(|(_, k)| k)
618
34
            .unwrap();
619
34
        write!(f, "{key}")
620
34
    }
621
}
622

            
623
impl CombinedCssPropertyType {
624
    /// Parses a CSS key, such as `width` from a string:
625
    ///
626
    /// # Example
627
    ///
628
    /// ```rust
629
    /// # use azul_css::props::property::{CombinedCssPropertyType, get_css_key_map};
630
    /// let map = get_css_key_map();
631
    /// assert_eq!(
632
    ///     Some(CombinedCssPropertyType::Border),
633
    ///     CombinedCssPropertyType::from_str("border", &map)
634
    /// );
635
    /// ```
636
    #[must_use]
637
692523
    pub fn from_str(input: &str, map: &CssKeyMap) -> Option<Self> {
638
692523
        let input = input.trim();
639
692523
        map.shorthands.get(input).copied()
640
692523
    }
641

            
642
    /// Returns the original string that was used to construct this `CssPropertyType`.
643
    ///
644
    /// # Panics
645
    ///
646
    /// Panics if `self` is not present in `map` (i.e. `map` is not the
647
    /// `CssKeyMap` this property type was constructed from).
648
    #[must_use]
649
31
    pub fn to_str(&self, map: &CssKeyMap) -> &'static str {
650
31
        map.shorthands
651
31
            .iter()
652
441
            .find(|(_, v)| *v == self)
653
31
            .map(|(k, _)| k)
654
31
            .unwrap()
655
31
    }
656
}
657

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

            
861
impl_option!(
862
    CssProperty,
863
    OptionCssProperty,
864
    copy = false,
865
    [Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord]
866
);
867

            
868
crate::impl_vec!(
869
    CssProperty,
870
    CssPropertyVec,
871
    CssPropertyVecDestructor,
872
    CssPropertyVecDestructorType,
873
    CssPropertyVecSlice,
874
    OptionCssProperty
875
);
876
crate::impl_vec_clone!(CssProperty, CssPropertyVec, CssPropertyVecDestructor);
877
crate::impl_vec_debug!(CssProperty, CssPropertyVec);
878
crate::impl_vec_partialeq!(CssProperty, CssPropertyVec);
879
crate::impl_vec_eq!(CssProperty, CssPropertyVec);
880
crate::impl_vec_partialord!(CssProperty, CssPropertyVec);
881
crate::impl_vec_ord!(CssProperty, CssPropertyVec);
882
crate::impl_vec_hash!(CssProperty, CssPropertyVec);
883

            
884
/// Categorizes a CSS property by its effect on the layout pipeline.
885
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
886
pub enum CssPropertyCategory {
887
    GpuOnly,
888
    /// Affects geometry (width, height, margin, padding, font-size, etc.)
889
    Layout,
890
    /// Affects only appearance (color, background-color, etc.)
891
    Paint,
892
    /// A layout-affecting property that also requires children to be re-evaluated.
893
    InheritedLayout,
894
    /// A paint-affecting property that also requires children to be re-evaluated.
895
    InheritedPaint,
896
}
897

            
898
/// Fine-grained dirty classification for CSS property changes.
899
///
900
/// Inspired by Taffy's binary dirty flag but extended to 4 levels for CSS-specific
901
/// optimizations. Instead of "clean vs dirty", we classify property changes by their
902
/// actual layout impact, enabling the engine to skip unnecessary work.
903
///
904
/// Reference: Taffy (<https://github.com/DioxusLabs/taffy>) uses a binary dirty flag
905
/// (clean/dirty). Our improvement: 4-level classification enables IFC-only reflow,
906
/// sizing-only recomputation, and paint-only updates without full subtree relayout.
907
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
908
#[repr(C)]
909
#[derive(Default)]
910
pub enum RelayoutScope {
911
    /// No relayout needed — repaint only (e.g., color, background, opacity, transform).
912
    /// The node's size and position are unchanged.
913
    #[default]
914
    None,
915
    /// Only the IFC (Inline Formatting Context) containing this node needs re-shaping.
916
    /// Block-level siblings are unaffected unless the IFC height changes,
917
    /// in which case this auto-upgrades to `SizingOnly`.
918
    IfcOnly,
919
    /// This node's sizing needs recomputation. Parent may need repositioning
920
    /// of subsequent siblings but doesn't need full recursive relayout.
921
    SizingOnly,
922
    /// Full subtree relayout required (e.g., display, position, float change).
923
    Full,
924
}
925

            
926
/// Represents a CSS key (for example `"border-radius"` => `BorderRadius`).
927
/// You can also derive this key from a `CssProperty` by calling `CssProperty::get_type()`.
928
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
929
#[repr(C)]
930
pub enum CssPropertyType {
931
    CaretColor,
932
    CaretAnimationDuration,
933
    Animation,
934
    AnimationIn,
935
    AnimationOut,
936
    CaretWidth,
937
    SelectionBackgroundColor,
938
    SelectionColor,
939
    SelectionRadius,
940
    TextColor,
941
    FontSize,
942
    FontFamily,
943
    FontWeight,
944
    FontStyle,
945
    TextAlign,
946
    TextJustify,
947
    VerticalAlign,
948
    LetterSpacing,
949
    TextIndent,
950
    InitialLetter,
951
    LineClamp,
952
    HangingPunctuation,
953
    TextCombineUpright,
954
    UnicodeBidi,
955
    TextBoxTrim,
956
    TextBoxEdge,
957
    DominantBaseline,
958
    AlignmentBaseline,
959
    BaselineSource,
960
    LineFitEdge,
961
    InitialLetterAlign,
962
    InitialLetterWrap,
963
    ScrollbarGutter,
964
    OverflowClipMargin,
965
    Clip,
966
    ExclusionMargin,
967
    HyphenationLanguage,
968
    LineHeight,
969
    WordSpacing,
970
    TabSize,
971
    WhiteSpace,
972
    Hyphens,
973
    WordBreak,
974
    OverflowWrap,
975
    LineBreak,
976
    TextOverflow,
977
    ObjectFit,
978
    ObjectPosition,
979
    AspectRatio,
980
    TextOrientation,
981
    TextAlignLast,
982
    TextTransform,
983
    Direction,
984
    UserSelect,
985
    TextDecoration,
986
    Cursor,
987
    Display,
988
    Float,
989
    BoxSizing,
990
    Width,
991
    Height,
992
    MinWidth,
993
    MinHeight,
994
    MaxWidth,
995
    MaxHeight,
996
    Position,
997
    Top,
998
    Right,
999
    Left,
    Bottom,
    ZIndex,
    FlexWrap,
    FlexDirection,
    FlexGrow,
    FlexShrink,
    FlexBasis,
    JustifyContent,
    AlignItems,
    AlignContent,
    ColumnGap,
    RowGap,
    GridTemplateColumns,
    GridTemplateRows,
    GridAutoColumns,
    GridAutoRows,
    GridColumn,
    GridRow,
    GridTemplateAreas,
    GridAutoFlow,
    JustifySelf,
    JustifyItems,
    Gap,
    GridGap,
    AlignSelf,
    Font,
    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,
    OverscrollBehaviorX,
    OverscrollBehaviorY,
    ScrollbarColor,
    ScrollbarVisibility,
    ScrollbarFadeDelay,
    ScrollbarFadeDuration,
    Opacity,
    Visibility,
    Transform,
    TransformOrigin,
    PerspectiveOrigin,
    BackfaceVisibility,
    AppRegion,
    SpatialNavigationAction,
    SpatialNavigationContain,
    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::OverscrollBehaviorX,
        Self::OverscrollBehaviorY,
        Self::ScrollbarColor,
        Self::ScrollbarVisibility,
        Self::ScrollbarFadeDelay,
        Self::ScrollbarFadeDuration,
        Self::Opacity,
        Self::Visibility,
        Self::Transform,
        Self::TransformOrigin,
        Self::PerspectiveOrigin,
        Self::BackfaceVisibility,
        Self::AppRegion,
        Self::SpatialNavigationAction,
        Self::SpatialNavigationContain,
        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 {
689
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
689
        write!(f, "{}", self.to_str())
689
    }
}
impl fmt::Display for CssPropertyType {
191
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
191
        write!(f, "{}", self.to_str())
191
    }
}
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));
    /// ```
    #[must_use]
567116
    pub fn from_str(input: &str, map: &CssKeyMap) -> Option<Self> {
567116
        let input = input.trim();
567116
        map.non_shorthands.get(input).copied()
567116
    }
    /// 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)
    #[must_use]
3851
    pub const fn to_str(&self) -> &'static str {
3851
        match self {
16
            Self::CaretColor => "caret-color",
16
            Self::CaretAnimationDuration => "caret-animation-duration",
55
            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",
146
            Self::TextColor => "color",
155
            Self::FontSize => "font-size",
16
            Self::FontFamily => "font-family",
100
            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",
37
            Self::Display => "display",
16
            Self::Float => "float",
16
            Self::BoxSizing => "box-sizing",
78
            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",
43
            Self::BackgroundContent => "background",
16
            Self::BackgroundPosition => "background-position",
16
            Self::BackgroundSize => "background-size",
16
            Self::BackgroundRepeat => "background-repeat",
37
            Self::OverflowX => "overflow-x",
37
            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",
16
            Self::MarginTop => "margin-top",
146
            Self::MarginLeft => "margin-left",
16
            Self::MarginRight => "margin-right",
16
            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::OverscrollBehaviorX => "overscroll-behavior-x",
16
            Self::OverscrollBehaviorY => "overscroll-behavior-y",
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",
29
            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::AppRegion => "-azul-app-region",
16
            Self::SpatialNavigationAction => "spatial-navigation-action",
16
            Self::SpatialNavigationContain => "spatial-navigation-contain",
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",
        }
3851
    }
    /// 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)
    #[must_use]
35876384
    pub const fn is_inheritable(&self) -> bool {
        use self::CssPropertyType::{
            BorderCollapse, BorderSpacing, CaptionSide, Cursor, Direction, EmptyCells, FontFamily,
            FontSize, FontStyle, FontWeight, HangingPunctuation, HyphenationLanguage, Hyphens,
            LetterSpacing, LineBreak, LineHeight, ListStylePosition, ListStyleType, Orphans,
            OverflowWrap, TabSize, TextAlign, TextAlignLast, TextColor, TextCombineUpright,
            TextDecoration, TextIndent, TextJustify, TextOrientation, TextTransform, UserSelect,
            Visibility, WhiteSpace, Widows, WordBreak, WordSpacing, WritingMode,
        };
35876384
        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
21941046
            => true,
13935338
            _ => false,
        }
35876384
    }
    #[must_use]
2759920
    pub const fn has_compact_encoding(&self) -> bool {
        use self::CssPropertyType::{
            AlignContent, AlignItems, AlignSelf, BorderBottomColor, BorderBottomStyle,
            BorderBottomWidth, BorderCollapse, BorderLeftColor, BorderLeftStyle, BorderLeftWidth,
            BorderRightColor, BorderRightStyle, BorderRightWidth, BorderSpacing, BorderTopColor,
            BorderTopStyle, BorderTopWidth, Bottom, BoxSizing, Clear, ColumnGap, Direction,
            Display, FlexBasis, FlexDirection, FlexGrow, FlexShrink, FlexWrap, Float, FontFamily,
            FontSize, FontStyle, FontWeight, Gap, GridAutoFlow, GridColumn, GridRow, Height,
            JustifyContent, JustifyItems, JustifySelf, Left, LetterSpacing, LineHeight,
            MarginBottom, MarginLeft, MarginRight, MarginTop, MaxHeight, MaxWidth, MinHeight,
            MinWidth, OverflowX, OverflowY, PaddingBottom, PaddingLeft, PaddingRight, PaddingTop,
            Position, Right, RowGap, TabSize, TextAlign, TextColor, TextIndent, Top, VerticalAlign,
            Visibility, WhiteSpace, Width, WordSpacing, WritingMode, ZIndex,
        };
815250
        matches!(
2759920
            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
        )
2759920
    }
    #[must_use]
576
    pub const fn get_category(&self) -> CssPropertyCategory {
576
        if self.is_gpu_only_property() {
7
            CssPropertyCategory::GpuOnly
        } else {
569
            let is_inheritable = self.is_inheritable();
569
            let can_trigger_layout = self.can_trigger_relayout();
569
            match (is_inheritable, can_trigger_layout) {
106
                (true, true) => CssPropertyCategory::InheritedLayout,
6
                (true, false) => CssPropertyCategory::InheritedPaint,
334
                (false, true) => CssPropertyCategory::Layout,
123
                (false, false) => CssPropertyCategory::Paint,
            }
        }
576
    }
    /// Returns whether this property can trigger a re-layout (important for incremental layout and
    /// caching layouted DOMs).
    #[must_use]
7044
    pub const fn can_trigger_relayout(&self) -> bool {
        use self::CssPropertyType::{
            Animation, AnimationIn, AnimationOut, AppRegion, BackdropFilter, BackfaceVisibility,
            BackgroundContent, BackgroundPosition, BackgroundRepeat, BackgroundSize,
            BorderBottomColor, BorderBottomLeftRadius, BorderBottomRightRadius, BorderBottomStyle,
            BorderLeftColor, BorderLeftStyle, BorderRightColor, BorderRightStyle, BorderTopColor,
            BorderTopLeftRadius, BorderTopRightRadius, BorderTopStyle, BoxDecorationBreak,
            BoxShadowBottom, BoxShadowLeft, BoxShadowRight, BoxShadowTop, Clip, ColumnRuleColor,
            ColumnRuleStyle, Cursor, Filter, MixBlendMode, Opacity, PerspectiveOrigin,
            ScrollbarButton, ScrollbarCorner, ScrollbarResizer, ScrollbarThumb, ScrollbarTrack,
            SpatialNavigationAction, SpatialNavigationContain, TextColor, TextShadow, Transform,
            TransformOrigin,
        };
        // 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
4803
        !matches!(
7044
            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
            // The spatial-navigation properties are meta in the same way, and
            // one step further: they describe what an ARROW KEY does. They
            // move no box and paint no pixel, so a relayout here would be pure
            // cost. The default for an unlisted property is `true`, which is
            // why they have to be named.
            | SpatialNavigationAction
            | SpatialNavigationContain
        )
7044
    }
    /// Returns whether the property is a GPU property (currently only opacity and transforms)
    #[must_use]
1806
    pub const fn is_gpu_only_property(&self) -> bool {
1806
        match self {
            Self::Opacity |
35
            Self::Transform /* | CssPropertyType::Color */ => true,
1771
            _ => false
        }
1806
    }
    /// 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.
    #[must_use]
6299
    pub const fn relayout_scope(&self, node_is_ifc_member: bool) -> RelayoutScope {
        use CssPropertyType::{
            AlignmentBaseline, Animation, AnimationIn, AnimationOut, AppRegion, BackdropFilter,
            BackfaceVisibility, BackgroundContent, BackgroundPosition, BackgroundRepeat,
            BackgroundSize, BaselineSource, BorderBottomColor, BorderBottomLeftRadius,
            BorderBottomRightRadius, BorderBottomStyle, BorderBottomWidth, BorderLeftColor,
            BorderLeftStyle, BorderLeftWidth, BorderRightColor, BorderRightStyle, BorderRightWidth,
            BorderTopColor, BorderTopLeftRadius, BorderTopRightRadius, BorderTopStyle,
            BorderTopWidth, BoxDecorationBreak, BoxShadowBottom, BoxShadowLeft, BoxShadowRight,
            BoxShadowTop, BoxSizing, CaretAnimationDuration, CaretColor, CaretWidth, Clip,
            ColumnRuleColor, ColumnRuleStyle, Cursor, Direction, DominantBaseline, Filter,
            FontFamily, FontSize, FontStyle, FontWeight, HangingPunctuation, Height,
            HyphenationLanguage, Hyphens, InitialLetter, InitialLetterAlign, InitialLetterWrap,
            LetterSpacing, LineBreak, LineClamp, LineFitEdge, LineHeight, MaxHeight, MaxWidth,
            MinHeight, MinWidth, MixBlendMode, ObjectFit, ObjectPosition, Opacity,
            OverflowClipMargin, OverflowWrap, PaddingBottom, PaddingInlineEnd, PaddingInlineStart,
            PaddingLeft, PaddingRight, PaddingTop, PerspectiveOrigin, ScrollbarButton,
            ScrollbarCorner, ScrollbarGutter, ScrollbarResizer, ScrollbarThumb, ScrollbarTrack,
            ScrollbarVisibility, ScrollbarWidth, SelectionBackgroundColor, SelectionColor,
            SelectionRadius, SpatialNavigationAction, SpatialNavigationContain, TabSize, TextAlign,
            TextAlignLast, TextBoxEdge, TextBoxTrim, TextColor, TextCombineUpright, TextDecoration,
            TextIndent, TextJustify, TextOrientation, TextOverflow, TextShadow, Transform,
            TransformOrigin, UnicodeBidi, VerticalAlign, WhiteSpace, Width, WordBreak, WordSpacing,
        };
6299
        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
            | AnimationOut
            // Same argument, one step further: these describe what an arrow
            // key does and change nothing on screen at all. `None` and not
            // `PaintOnly`, because there is nothing to repaint either. The
            // fallthrough here is `Full`, so being unlisted would cost a whole
            // layout pass per declaration.
            | SpatialNavigationAction
2214
            | SpatialNavigationContain => 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 => {
795
                if node_is_ifc_member {
503
                    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.
292
                    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
1562
            | ScrollbarGutter | OverflowClipMargin => RelayoutScope::SizingOnly,
            // Everything else: display, position, float, margin, flex-*,
            // grid-*, overflow, writing-mode, etc. — full relayout.
1728
            _ => RelayoutScope::Full,
        }
6299
    }
}
// -- 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>),
    OverscrollBehavior(OverscrollBehaviorParseError<'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>),
    AppRegion(CssAppRegionParseError<'a>),
    SpatialNavigationAction(CssSpatialNavigationActionParseError<'a>),
    SpatialNavigationContain(CssSpatialNavigationContainParseError<'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),
    OverscrollBehavior(OverscrollBehaviorParseErrorOwned),
    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),
    AppRegion(CssAppRegionParseErrorOwned),
    SpatialNavigationAction(CssSpatialNavigationActionParseErrorOwned),
    SpatialNavigationContain(CssSpatialNavigationContainParseErrorOwned),
    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),
    OverscrollBehavior(e) => format!("Invalid overscroll-behavior: {}", 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),
    AppRegion(e) => format!("Invalid app-region: {}", e),
    SpatialNavigationAction(e) => format!("Invalid spatial-navigation-action: {}", e),
    SpatialNavigationContain(e) => format!("Invalid spatial-navigation-contain: {}", 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!(
    OverscrollBehaviorParseError<'a>,
    CssParsingError::OverscrollBehavior
);
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!(CssAppRegionParseError<'a>, CssParsingError::AppRegion);
impl_from!(
    CssSpatialNavigationActionParseError<'a>,
    CssParsingError::SpatialNavigationAction
);
impl_from!(
    CssSpatialNavigationContainParseError<'a>,
    CssParsingError::SpatialNavigationContain
);
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)
    #[must_use]
9
    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::OverscrollBehavior(e) => {
                CssParsingErrorOwned::OverscrollBehavior(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::AppRegion(e) => CssParsingErrorOwned::AppRegion(e.to_contained()),
            CssParsingError::SpatialNavigationAction(e) => {
                CssParsingErrorOwned::SpatialNavigationAction(e.to_contained())
            }
            CssParsingError::SpatialNavigationContain(e) => {
                CssParsingErrorOwned::SpatialNavigationContain(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)
    #[must_use]
9
    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::OverscrollBehavior(e) => CssParsingError::OverscrollBehavior(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::AppRegion(e) => CssParsingError::AppRegion(e.to_shared()),
            Self::SpatialNavigationAction(e) => {
                CssParsingError::SpatialNavigationAction(e.to_shared())
            }
            Self::SpatialNavigationContain(e) => {
                CssParsingError::SpatialNavigationContain(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.
540459
pub fn parse_css_property(
540459
    key: CssPropertyType,
540459
    value: &str,
540459
) -> Result<CssProperty, CssParsingError<'_>> {
    use crate::props::style::{
        parse_selection_background_color, parse_selection_color, parse_selection_radius,
    };
540459
    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.
540459
    let has_typed_auto = matches!(
540459
        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
        // overscroll-behavior: auto/none are TYPED values (OverscrollBehavior::
        // Auto / ::None), not the CSS-wide keywords. Intercepting them here
        // produced `CssPropertyValue::None`, which reads back as "no value" —
        // so `overscroll-behavior-x: none` silently resolved to the default.
        CssPropertyType::OverscrollBehaviorX |
        CssPropertyType::OverscrollBehaviorY |
        CssPropertyType::AspectRatio // aspect-ratio: auto means StyleAspectRatio::Auto
    );
540459
    let has_typed_none = matches!(
540459
        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::OverscrollBehaviorX | // see the auto list above
        CssPropertyType::OverscrollBehaviorY |
        CssPropertyType::ObjectFit // object-fit: none means StyleObjectFit::None
    );
333
    Ok(match value {
540459
        "auto" if !has_typed_auto => CssProperty::auto(key),
540147
        "none" if !has_typed_none => CssProperty::none(key),
539814
        "initial" => CssProperty::initial(key),
539432
        "inherit" => CssProperty::inherit(key),
539715
        value => match key {
            CssPropertyType::CaretColor => parse_caret_color(value)?.into(),
            CssPropertyType::CaretWidth => parse_caret_width(value)?.into(),
            CssPropertyType::CaretAnimationDuration => {
104
                parse_caret_animation_duration(value)?.into()
            }
            CssPropertyType::Animation => CssProperty::Animation(CssPropertyValue::Exact(
105
                crate::props::basic::animation::parse_style_animation_vec(value)?,
            )),
            CssPropertyType::AnimationIn => CssProperty::AnimationIn(CssPropertyValue::Exact(
53
                crate::props::basic::animation::parse_style_animation_vec(value)?,
            )),
            CssPropertyType::AnimationOut => CssProperty::AnimationOut(CssPropertyValue::Exact(
261
                crate::props::basic::animation::parse_style_animation_vec(value)?,
            )),
            CssPropertyType::SelectionBackgroundColor => {
39
                parse_selection_background_color(value)?.into()
            }
39
            CssPropertyType::SelectionColor => parse_selection_color(value)?.into(),
            CssPropertyType::SelectionRadius => parse_selection_radius(value)?.into(),
67519
            CssPropertyType::TextColor => parse_style_text_color(value)?.into(),
            CssPropertyType::FontSize => {
21167
                CssProperty::FontSize(parse_style_font_size(value)?.into())
            }
3352
            CssPropertyType::FontFamily => parse_style_font_family(value)?.into(),
            CssPropertyType::FontWeight => {
46
                CssProperty::FontWeight(parse_font_weight(value)?.into())
            }
26
            CssPropertyType::FontStyle => CssProperty::FontStyle(parse_font_style(value)?.into()),
102
            CssPropertyType::TextAlign => parse_style_text_align(value)?.into(),
            CssPropertyType::TextJustify => parse_layout_text_justify(value)?.into(),
26
            CssPropertyType::VerticalAlign => parse_style_vertical_align(value)?.into(),
39
            CssPropertyType::LetterSpacing => parse_style_letter_spacing(value)?.into(),
13
            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(),
980
            CssPropertyType::LineHeight => parse_style_line_height(value)?.into(),
13
            CssPropertyType::WordSpacing => parse_style_word_spacing(value)?.into(),
            CssPropertyType::TabSize => parse_style_tab_size(value)?.into(),
574
            CssPropertyType::WhiteSpace => parse_style_white_space(value)?.into(),
            CssPropertyType::Hyphens => parse_style_hyphens(value)?.into(),
            CssPropertyType::WordBreak => parse_style_word_break(value)?.into(),
13
            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(),
26
            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(),
26
            CssPropertyType::TextTransform => parse_style_text_transform(value)?.into(),
39
            CssPropertyType::Direction => parse_style_direction(value)?.into(),
123
            CssPropertyType::UserSelect => parse_style_user_select(value)?.into(),
            CssPropertyType::TextDecoration => parse_style_text_decoration(value)?.into(),
25809
            CssPropertyType::Cursor => parse_style_cursor(value)?.into(),
64952
            CssPropertyType::Display => parse_layout_display(value)?.into(),
507
            CssPropertyType::Float => parse_layout_float(value)?.into(),
1950
            CssPropertyType::BoxSizing => parse_layout_box_sizing(value)?.into(),
52119
            CssPropertyType::Width => parse_layout_width(value)?.into(),
50512
            CssPropertyType::Height => parse_layout_height(value)?.into(),
1932
            CssPropertyType::MinWidth => parse_layout_min_width(value)?.into(),
1196
            CssPropertyType::MinHeight => parse_layout_min_height(value)?.into(),
935
            CssPropertyType::MaxWidth => parse_layout_max_width(value)?.into(),
741
            CssPropertyType::MaxHeight => parse_layout_max_height(value)?.into(),
37788
            CssPropertyType::Position => parse_layout_position(value)?.into(),
30090
            CssPropertyType::Top => parse_layout_top(value)?.into(),
944
            CssPropertyType::Right => parse_layout_right(value)?.into(),
29834
            CssPropertyType::Left => parse_layout_left(value)?.into(),
931
            CssPropertyType::Bottom => parse_layout_bottom(value)?.into(),
126
            CssPropertyType::ZIndex => CssProperty::ZIndex(parse_layout_z_index(value)?.into()),
34
            CssPropertyType::FlexWrap => parse_layout_flex_wrap(value)?.into(),
46683
            CssPropertyType::FlexDirection => parse_layout_flex_direction(value)?.into(),
3988
            CssPropertyType::FlexGrow => parse_layout_flex_grow(value)?.into(),
1664
            CssPropertyType::FlexShrink => parse_layout_flex_shrink(value)?.into(),
            CssPropertyType::FlexBasis => parse_layout_flex_basis(value)?.into(),
3208
            CssPropertyType::JustifyContent => parse_layout_justify_content(value)?.into(),
30521
            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 => {
61
                CssProperty::GridTemplateColumns(parse_grid_template(value)?.into())
            }
            CssPropertyType::GridTemplateRows => {
60
                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 => {
26
                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;
27
                let areas = parse_grid_template_areas(value)
27
                    .map_err(|()| CssParsingError::InvalidValue(InvalidValueErr(value)))?;
27
                CssProperty::GridTemplateAreas(CssPropertyValue::Exact(areas))
            }
39
            CssPropertyType::WritingMode => parse_layout_writing_mode(value)?.into(),
91
            CssPropertyType::Clear => parse_layout_clear(value)?.into(),
            CssPropertyType::BackgroundContent => {
326
                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 => {
1365
                CssProperty::OverflowX(parse_layout_overflow(value)?.into())
            }
            CssPropertyType::OverflowY => {
2120
                CssProperty::OverflowY(parse_layout_overflow(value)?.into())
            }
            CssPropertyType::OverflowBlock => {
                CssProperty::OverflowBlock(parse_layout_overflow(value)?.into())
            }
            CssPropertyType::OverflowInline => {
13
                CssProperty::OverflowInline(parse_layout_overflow(value)?.into())
            }
221
            CssPropertyType::PaddingTop => parse_layout_padding_top(value)?.into(),
18330
            CssPropertyType::PaddingLeft => parse_layout_padding_left(value)?.into(),
17745
            CssPropertyType::PaddingRight => parse_layout_padding_right(value)?.into(),
87
            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(),
3694
            CssPropertyType::MarginTop => parse_layout_margin_top(value)?.into(),
5332
            CssPropertyType::MarginLeft => parse_layout_margin_left(value)?.into(),
66
            CssPropertyType::MarginRight => parse_layout_margin_right(value)?.into(),
5599
            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::OverscrollBehaviorX => CssProperty::OverscrollBehaviorX(
                CssPropertyValue::Exact(parse_overscroll_behavior(value)?),
            ),
            CssPropertyType::OverscrollBehaviorY => CssProperty::OverscrollBehaviorY(
                CssPropertyValue::Exact(parse_overscroll_behavior(value)?),
            ),
            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(),
542
            CssPropertyType::Opacity => parse_style_opacity(value)?.into(),
21
            CssPropertyType::Visibility => parse_style_visibility(value)?.into(),
887
            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(),
1365
            CssPropertyType::AppRegion => parse_style_app_region(value)?.into(),
            CssPropertyType::SpatialNavigationAction => {
1
                parse_style_spatial_navigation_action(value)?.into()
            }
            CssPropertyType::SpatialNavigationContain => {
1
                parse_style_spatial_navigation_contain(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 => {
13
                CssProperty::BreakBefore(parse_page_break(value)?.into())
            }
            CssPropertyType::BreakAfter => CssProperty::BreakAfter(parse_page_break(value)?.into()),
            CssPropertyType::BreakInside => {
117
                CssProperty::BreakInside(parse_break_inside(value)?.into())
            }
143
            CssPropertyType::Orphans => CssProperty::Orphans(parse_orphans(value)?.into()),
143
            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(
53
                parse_border_collapse(value)
53
                    .map_err(|_| CssParsingError::GenericParseError)?
53
                    .into(),
            ),
            CssPropertyType::BorderSpacing => CssProperty::BorderSpacing(
13
                parse_border_spacing(value)
13
                    .map_err(|_| CssParsingError::GenericParseError)?
13
                    .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(),
            ),
        },
    })
540459
}
/// 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.
131948
pub fn parse_combined_css_property(
131948
    key: CombinedCssPropertyType,
131948
    value: &str,
131948
) -> Result<Vec<CssProperty>, CssParsingError<'_>> {
    use self::CombinedCssPropertyType::{
        Background, BackgroundColor, BackgroundImage, Border, BorderBottom, BorderColor,
        BorderLeft, BorderRadius, BorderRight, BorderStyle, BorderTop, BorderWidth, BoxShadow,
        ColumnRule, Columns, Flex, Font, Gap, Grid, GridArea, GridGap, InsetBlock, InsetInline,
        Margin, Overflow, OverscrollBehavior, Padding, TextBox,
    };
    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())
                }
            }
        };
    }
131948
    let keys = match key {
        BorderRadius => {
16763
            vec![
16763
                CssPropertyType::BorderTopLeftRadius,
16763
                CssPropertyType::BorderTopRightRadius,
16763
                CssPropertyType::BorderBottomLeftRadius,
16763
                CssPropertyType::BorderBottomRightRadius,
            ]
        }
        OverscrollBehavior => {
1
            vec![
1
                CssPropertyType::OverscrollBehaviorX,
1
                CssPropertyType::OverscrollBehaviorY,
            ]
        }
        Overflow => {
10236
            vec![CssPropertyType::OverflowX, CssPropertyType::OverflowY]
        }
        Padding => {
13619
            vec![
13619
                CssPropertyType::PaddingTop,
13619
                CssPropertyType::PaddingBottom,
13619
                CssPropertyType::PaddingLeft,
13619
                CssPropertyType::PaddingRight,
            ]
        }
        Margin => {
10790
            vec![
10790
                CssPropertyType::MarginTop,
10790
                CssPropertyType::MarginBottom,
10790
                CssPropertyType::MarginLeft,
10790
                CssPropertyType::MarginRight,
            ]
        }
        Border => {
17752
            vec![
17752
                CssPropertyType::BorderTopColor,
17752
                CssPropertyType::BorderRightColor,
17752
                CssPropertyType::BorderLeftColor,
17752
                CssPropertyType::BorderBottomColor,
17752
                CssPropertyType::BorderTopStyle,
17752
                CssPropertyType::BorderRightStyle,
17752
                CssPropertyType::BorderLeftStyle,
17752
                CssPropertyType::BorderBottomStyle,
17752
                CssPropertyType::BorderTopWidth,
17752
                CssPropertyType::BorderRightWidth,
17752
                CssPropertyType::BorderLeftWidth,
17752
                CssPropertyType::BorderBottomWidth,
            ]
        }
        BorderLeft => {
27
            vec![
27
                CssPropertyType::BorderLeftColor,
27
                CssPropertyType::BorderLeftStyle,
27
                CssPropertyType::BorderLeftWidth,
            ]
        }
        BorderRight => {
1
            vec![
1
                CssPropertyType::BorderRightColor,
1
                CssPropertyType::BorderRightStyle,
1
                CssPropertyType::BorderRightWidth,
            ]
        }
        BorderTop => {
14
            vec![
14
                CssPropertyType::BorderTopColor,
14
                CssPropertyType::BorderTopStyle,
14
                CssPropertyType::BorderTopWidth,
            ]
        }
        BorderBottom => {
55
            vec![
55
                CssPropertyType::BorderBottomColor,
55
                CssPropertyType::BorderBottomStyle,
55
                CssPropertyType::BorderBottomWidth,
            ]
        }
        BorderColor => {
15
            vec![
15
                CssPropertyType::BorderTopColor,
15
                CssPropertyType::BorderRightColor,
15
                CssPropertyType::BorderBottomColor,
15
                CssPropertyType::BorderLeftColor,
            ]
        }
        BorderStyle => {
27
            vec![
27
                CssPropertyType::BorderTopStyle,
27
                CssPropertyType::BorderRightStyle,
27
                CssPropertyType::BorderBottomStyle,
27
                CssPropertyType::BorderLeftStyle,
            ]
        }
        BorderWidth => {
41
            vec![
41
                CssPropertyType::BorderTopWidth,
41
                CssPropertyType::BorderRightWidth,
41
                CssPropertyType::BorderBottomWidth,
41
                CssPropertyType::BorderLeftWidth,
            ]
        }
        BoxShadow => {
5663
            vec![
5663
                CssPropertyType::BoxShadowLeft,
5663
                CssPropertyType::BoxShadowRight,
5663
                CssPropertyType::BoxShadowTop,
5663
                CssPropertyType::BoxShadowBottom,
            ]
        }
        BackgroundColor | BackgroundImage | Background => {
47109
            vec![CssPropertyType::BackgroundContent]
        }
        Flex => {
96
            vec![
96
                CssPropertyType::FlexGrow,
96
                CssPropertyType::FlexShrink,
96
                CssPropertyType::FlexBasis,
            ]
        }
        Grid => {
1
            vec![
1
                CssPropertyType::GridTemplateColumns,
1
                CssPropertyType::GridTemplateRows,
            ]
        }
        Gap | GridGap => {
9598
            vec![CssPropertyType::RowGap, CssPropertyType::ColumnGap]
        }
        Font => {
1
            vec![CssPropertyType::Font]
        }
        Columns => {
1
            vec![CssPropertyType::ColumnWidth, CssPropertyType::ColumnCount]
        }
        GridArea => {
108
            vec![CssPropertyType::GridRow, CssPropertyType::GridColumn]
        }
        ColumnRule => {
1
            vec![
1
                CssPropertyType::ColumnRuleWidth,
1
                CssPropertyType::ColumnRuleStyle,
1
                CssPropertyType::ColumnRuleColor,
            ]
        }
        TextBox => {
27
            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.
131948
    let has_typed_auto = matches!(key, Overflow);
131948
    let has_typed_none = false; // Currently no combined properties have typed "none"
27
    match value {
131948
        "auto" if !has_typed_auto => return Ok(keys.into_iter().map(CssProperty::auto).collect()),
131629
        "none" if !has_typed_none => return Ok(keys.into_iter().map(CssProperty::none).collect()),
131602
        "initial" => {
31
            return Ok(keys.into_iter().map(CssProperty::initial).collect());
        }
131571
        "inherit" => {
            return Ok(keys.into_iter().map(CssProperty::inherit).collect());
        }
131877
        _ => {}
    }
131877
    match key {
        BorderRadius => {
16762
            let border_radius = parse_style_border_radius(value)?;
16758
            Ok(vec![
16758
                CssProperty::BorderTopLeftRadius(
16758
                    StyleBorderTopLeftRadius {
16758
                        inner: border_radius.top_left,
16758
                    }
16758
                    .into(),
16758
                ),
16758
                CssProperty::BorderTopRightRadius(
16758
                    StyleBorderTopRightRadius {
16758
                        inner: border_radius.top_right,
16758
                    }
16758
                    .into(),
16758
                ),
16758
                CssProperty::BorderBottomLeftRadius(
16758
                    StyleBorderBottomLeftRadius {
16758
                        inner: border_radius.bottom_left,
16758
                    }
16758
                    .into(),
16758
                ),
16758
                CssProperty::BorderBottomRightRadius(
16758
                    StyleBorderBottomRightRadius {
16758
                        inner: border_radius.bottom_right,
16758
                    }
16758
                    .into(),
16758
                ),
16758
            ])
        }
        // +spec:overflow:ff5ea4 - overflow shorthand sets overflow-x and overflow-y; second value
        // copied from first if omitted
        OverscrollBehavior => {
            // Same 1-or-2-value shape as `overflow`: one value applies to both
            // axes, two are `x y`.
            let parts: Vec<&str> = value.split_whitespace().collect();
            match parts.len() {
                1 => {
                    let b = parse_overscroll_behavior(value)?;
                    Ok(vec![
                        CssProperty::OverscrollBehaviorX(b.into()),
                        CssProperty::OverscrollBehaviorY(b.into()),
                    ])
                }
                2 => {
                    let bx = parse_overscroll_behavior(parts[0])?;
                    let by = parse_overscroll_behavior(parts[1])?;
                    Ok(vec![
                        CssProperty::OverscrollBehaviorX(bx.into()),
                        CssProperty::OverscrollBehaviorY(by.into()),
                    ])
                }
                _ => Err(CssParsingError::OverscrollBehavior(
                    OverscrollBehaviorParseError::InvalidValue(value),
                )),
            }
        }
        Overflow => {
10235
            let parts: Vec<&str> = value.split_whitespace().collect();
10235
            match parts.len() {
                1 => {
10235
                    let overflow = parse_layout_overflow(value)?;
10235
                    Ok(vec![
10235
                        CssProperty::OverflowX(overflow.into()),
10235
                        CssProperty::OverflowY(overflow.into()),
10235
                    ])
                }
                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 => {
13618
            let padding = parse_layout_padding(value)?;
13618
            Ok(vec![
13618
                convert_value!(padding.top, PaddingTop, LayoutPaddingTop),
13618
                convert_value!(padding.bottom, PaddingBottom, LayoutPaddingBottom),
13618
                convert_value!(padding.left, PaddingLeft, LayoutPaddingLeft),
13618
                convert_value!(padding.right, PaddingRight, LayoutPaddingRight),
            ])
        }
        Margin => {
10776
            let margin = parse_layout_margin(value)?;
10759
            Ok(vec![
10759
                convert_value!(margin.top, MarginTop, LayoutMarginTop),
10759
                convert_value!(margin.bottom, MarginBottom, LayoutMarginBottom),
10759
                convert_value!(margin.left, MarginLeft, LayoutMarginLeft),
10759
                convert_value!(margin.right, MarginRight, LayoutMarginRight),
            ])
        }
        Border => {
17751
            let border = parse_style_border(value)?;
17750
            Ok(vec![
17750
                CssProperty::BorderTopColor(
17750
                    StyleBorderTopColor {
17750
                        inner: border.border_color,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderRightColor(
17750
                    StyleBorderRightColor {
17750
                        inner: border.border_color,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderLeftColor(
17750
                    StyleBorderLeftColor {
17750
                        inner: border.border_color,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderBottomColor(
17750
                    StyleBorderBottomColor {
17750
                        inner: border.border_color,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderTopStyle(
17750
                    StyleBorderTopStyle {
17750
                        inner: border.border_style,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderRightStyle(
17750
                    StyleBorderRightStyle {
17750
                        inner: border.border_style,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderLeftStyle(
17750
                    StyleBorderLeftStyle {
17750
                        inner: border.border_style,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderBottomStyle(
17750
                    StyleBorderBottomStyle {
17750
                        inner: border.border_style,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderTopWidth(
17750
                    LayoutBorderTopWidth {
17750
                        inner: border.border_width,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderRightWidth(
17750
                    LayoutBorderRightWidth {
17750
                        inner: border.border_width,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderLeftWidth(
17750
                    LayoutBorderLeftWidth {
17750
                        inner: border.border_width,
17750
                    }
17750
                    .into(),
17750
                ),
17750
                CssProperty::BorderBottomWidth(
17750
                    LayoutBorderBottomWidth {
17750
                        inner: border.border_width,
17750
                    }
17750
                    .into(),
17750
                ),
17750
            ])
        }
        BorderLeft => {
26
            let border = parse_style_border(value)?;
26
            Ok(vec![
26
                CssProperty::BorderLeftColor(
26
                    StyleBorderLeftColor {
26
                        inner: border.border_color,
26
                    }
26
                    .into(),
26
                ),
26
                CssProperty::BorderLeftStyle(
26
                    StyleBorderLeftStyle {
26
                        inner: border.border_style,
26
                    }
26
                    .into(),
26
                ),
26
                CssProperty::BorderLeftWidth(
26
                    LayoutBorderLeftWidth {
26
                        inner: border.border_width,
26
                    }
26
                    .into(),
26
                ),
26
            ])
        }
        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 => {
13
            let border = parse_style_border(value)?;
13
            Ok(vec![
13
                CssProperty::BorderTopColor(
13
                    StyleBorderTopColor {
13
                        inner: border.border_color,
13
                    }
13
                    .into(),
13
                ),
13
                CssProperty::BorderTopStyle(
13
                    StyleBorderTopStyle {
13
                        inner: border.border_style,
13
                    }
13
                    .into(),
13
                ),
13
                CssProperty::BorderTopWidth(
13
                    LayoutBorderTopWidth {
13
                        inner: border.border_width,
13
                    }
13
                    .into(),
13
                ),
13
            ])
        }
        BorderBottom => {
54
            let border = parse_style_border(value)?;
26
            Ok(vec![
26
                CssProperty::BorderBottomColor(
26
                    StyleBorderBottomColor {
26
                        inner: border.border_color,
26
                    }
26
                    .into(),
26
                ),
26
                CssProperty::BorderBottomStyle(
26
                    StyleBorderBottomStyle {
26
                        inner: border.border_style,
26
                    }
26
                    .into(),
26
                ),
26
                CssProperty::BorderBottomWidth(
26
                    LayoutBorderBottomWidth {
26
                        inner: border.border_width,
26
                    }
26
                    .into(),
26
                ),
26
            ])
        }
        BorderColor => {
13
            let colors = parse_style_border_color(value)?;
13
            Ok(vec![
13
                CssProperty::BorderTopColor(StyleBorderTopColor { inner: colors.top }.into()),
13
                CssProperty::BorderRightColor(
13
                    StyleBorderRightColor {
13
                        inner: colors.right,
13
                    }
13
                    .into(),
13
                ),
13
                CssProperty::BorderBottomColor(
13
                    StyleBorderBottomColor {
13
                        inner: colors.bottom,
13
                    }
13
                    .into(),
13
                ),
13
                CssProperty::BorderLeftColor(StyleBorderLeftColor { inner: colors.left }.into()),
13
            ])
        }
        BorderStyle => {
13
            let styles = parse_style_border_style(value)?;
13
            Ok(vec![
13
                CssProperty::BorderTopStyle(StyleBorderTopStyle { inner: styles.top }.into()),
13
                CssProperty::BorderRightStyle(
13
                    StyleBorderRightStyle {
13
                        inner: styles.right,
13
                    }
13
                    .into(),
13
                ),
13
                CssProperty::BorderBottomStyle(
13
                    StyleBorderBottomStyle {
13
                        inner: styles.bottom,
13
                    }
13
                    .into(),
13
                ),
13
                CssProperty::BorderLeftStyle(StyleBorderLeftStyle { inner: styles.left }.into()),
13
            ])
        }
        BorderWidth => {
39
            let widths = parse_style_border_width(value)?;
39
            Ok(vec![
39
                CssProperty::BorderTopWidth(LayoutBorderTopWidth { inner: widths.top }.into()),
39
                CssProperty::BorderRightWidth(
39
                    LayoutBorderRightWidth {
39
                        inner: widths.right,
39
                    }
39
                    .into(),
39
                ),
39
                CssProperty::BorderBottomWidth(
39
                    LayoutBorderBottomWidth {
39
                        inner: widths.bottom,
39
                    }
39
                    .into(),
39
                ),
39
                CssProperty::BorderLeftWidth(LayoutBorderLeftWidth { inner: widths.left }.into()),
39
            ])
        }
        BoxShadow => {
5662
            let box_shadow = parse_style_box_shadow(value)?;
195
            Ok(vec![
195
                CssProperty::BoxShadowLeft(CssPropertyValue::Exact(BoxOrStatic::heap(box_shadow))),
195
                CssProperty::BoxShadowRight(CssPropertyValue::Exact(BoxOrStatic::heap(box_shadow))),
195
                CssProperty::BoxShadowTop(CssPropertyValue::Exact(BoxOrStatic::heap(box_shadow))),
195
                CssProperty::BoxShadowBottom(CssPropertyValue::Exact(BoxOrStatic::heap(
195
                    box_shadow,
195
                ))),
195
            ])
        }
        BackgroundColor => {
921
            let color = parse_css_color(value)?;
921
            let vec: StyleBackgroundContentVec = vec![StyleBackgroundContent::Color(color)].into();
921
            Ok(vec![CssProperty::BackgroundContent(
921
                CssPropertyValue::Exact(vec),
921
            )])
        }
        BackgroundImage => {
26
            let background_content = parse_style_background_content(value)?;
26
            let vec: StyleBackgroundContentVec = vec![background_content].into();
26
            Ok(vec![CssProperty::BackgroundContent(
26
                CssPropertyValue::Exact(vec),
26
            )])
        }
        Background => {
46158
            let background_content = parse_style_background_content_multiple(value)?;
46147
            Ok(vec![CssProperty::BackgroundContent(
46147
                CssPropertyValue::Exact(background_content),
46147
            )])
        }
        Flex => {
            // parse shorthand into grow/shrink/basis
81
            let parts: Vec<&str> = value.split_whitespace().collect();
81
            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()),
                ]);
81
            }
81
            if parts.len() == 1 {
                // CSS spec: flex: <number> => grow: <number>, shrink: 1, basis: 0
40
                if let Ok(g) = parse_layout_flex_grow(parts[0]) {
40
                    return Ok(vec![
40
                        CssProperty::FlexGrow(g.into()),
40
                        CssProperty::FlexShrink(
40
                            LayoutFlexShrink {
40
                                inner: crate::props::basic::length::FloatValue::const_new(1),
40
                            }
40
                            .into(),
40
                        ),
40
                        CssProperty::FlexBasis(LayoutFlexBasis::Exact(PixelValue::px(0.0)).into()),
40
                    ]);
                }
                if let Ok(b) = parse_layout_flex_basis(parts[0]) {
                    return Ok(vec![CssProperty::FlexBasis(b.into())]);
                }
41
            }
41
            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(LayoutFlexBasis::Exact(PixelValue::px(0.0)).into()),
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
                    ]);
                }
27
            }
27
            if parts.len() == 3 {
27
                let g = parse_layout_flex_grow(parts[0])?;
27
                let s = parse_layout_flex_shrink(parts[1])?;
27
                let b = parse_layout_flex_basis(parts[2])?;
27
                return Ok(vec![
27
                    CssProperty::FlexGrow(g.into()),
27
                    CssProperty::FlexShrink(s.into()),
27
                    CssProperty::FlexBasis(b.into()),
27
                ]);
            }
            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 | GridGap => {
9596
            let parts: Vec<&str> = value.split_whitespace().collect();
9596
            if parts.len() == 1 {
9596
                let g = parse_layout_gap(parts[0])?;
9596
                Ok(vec![
9596
                    CssProperty::RowGap(LayoutRowGap { inner: g.inner }.into()),
9596
                    CssProperty::ColumnGap(LayoutColumnGap { inner: g.inner }.into()),
9596
                ])
            } 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>
107
            let parts: Vec<&str> = value.split('/').map(str::trim).collect();
107
            let (row_start, col_start, row_end, col_end) = match parts.len() {
107
                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))),
            };
428
            let parse_line = |s: &str| -> Result<GridLine, CssParsingError<'_>> {
428
                parse_grid_line_owned(s.trim())
428
                    .map_err(|()| CssParsingError::InvalidValue(InvalidValueErr(value)))
428
            };
107
            Ok(vec![
                CssProperty::GridRow(CssPropertyValue::Exact(GridPlacement {
107
                    grid_start: parse_line(row_start)?,
107
                    grid_end: parse_line(row_end)?,
                })),
                CssProperty::GridColumn(CssPropertyValue::Exact(GridPlacement {
107
                    grid_start: parse_line(col_start)?,
107
                    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 => {
26
            let trimmed = value.trim();
26
            if trimmed == "normal" {
                return Ok(vec![
                    CssProperty::TextBoxTrim(CssPropertyValue::Exact(StyleTextBoxTrim::None)),
                    CssProperty::TextBoxEdge(CssPropertyValue::Exact(StyleTextBoxEdge::AUTO)),
                ]);
26
            }
            // 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.
26
            let parts: Vec<&str> = trimmed.split_whitespace().collect();
26
            let mut trim_val = None;
26
            let mut edge_tokens: Vec<&str> = Vec::new();
91
            for part in &parts {
65
                if let Ok(t) = parse_style_text_box_trim(part) {
26
                    if trim_val.is_some() {
                        return Err(CssParsingError::InvalidValue(InvalidValueErr(value)));
26
                    }
26
                    trim_val = Some(t);
39
                } else {
39
                    edge_tokens.push(part);
39
                }
            }
26
            let edge_val = if edge_tokens.is_empty() {
                None
            } else {
26
                match parse_style_text_box_edge(&edge_tokens.join(" ")) {
26
                    Ok(e) => Some(e),
                    Err(_) => return Err(CssParsingError::InvalidValue(InvalidValueErr(value))),
                }
            };
            // Per spec: omitting trim defaults to "both" (not the initial "none")
26
            let trim = trim_val.unwrap_or(StyleTextBoxTrim::TrimBoth);
            // Per spec: omitting edge defaults to "auto" (the initial value)
26
            let edge = edge_val.unwrap_or(StyleTextBoxEdge::AUTO);
26
            Ok(vec![
26
                CssProperty::TextBoxTrim(CssPropertyValue::Exact(trim)),
26
                CssProperty::TextBoxEdge(CssPropertyValue::Exact(edge)),
26
            ])
        }
        // +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()),
            ])
        }
    }
131948
}
// 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 {
477264
            fn from(e: $a) -> Self {
477264
                $b::$enum_type(CssPropertyValue::from(e))
477264
            }
        }
    };
}
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!(StyleAppRegion, CssProperty::AppRegion);
impl_from_css_prop!(
    StyleSpatialNavigationAction,
    CssProperty::SpatialNavigationAction
);
impl_from_css_prop!(
    StyleSpatialNavigationContain,
    CssProperty::SpatialNavigationContain
);
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 {
    #[must_use]
1004
    pub const fn key(&self) -> &'static str {
1004
        self.get_type().to_str()
1004
    }
    // 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)
    #[must_use]
2821
    pub fn value(&self) -> String {
2821
        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(),
18
            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(),
18
            Self::BorderTopColor(v) => v.get_css_value_fmt(),
18
            Self::BorderRightColor(v) => v.get_css_value_fmt(),
18
            Self::BorderLeftColor(v) => v.get_css_value_fmt(),
18
            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(),
18
            Self::BorderTopWidth(v) => v.get_css_value_fmt(),
18
            Self::BorderRightWidth(v) => v.get_css_value_fmt(),
18
            Self::BorderLeftWidth(v) => v.get_css_value_fmt(),
18
            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(),
30
            Self::OverscrollBehaviorX(v) | Self::OverscrollBehaviorY(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::AppRegion(v) => v.get_css_value_fmt(),
14
            Self::SpatialNavigationAction(v) => v.get_css_value_fmt(),
14
            Self::SpatialNavigationContain(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(),
        }
2821
    }
    #[must_use]
813
    pub fn format_css(&self) -> String {
813
        format!("{}: {};", self.key(), self.value())
813
    }
    #[allow(clippy::too_many_lines)]
    // large but cohesive: single-purpose CSS parser/formatter/dispatch table (one branch per
    // property/variant)
    #[must_use]
5174
    pub fn interpolate(
5174
        &self,
5174
        other: &Self,
5174
        t: f32,
5174
        interpolate_resolver: &InterpolateResolver,
5174
    ) -> Self {
5174
        if t <= 0.0 {
5
            return self.clone();
5169
        } else if t >= 1.0 {
173
            return other.clone();
4996
        }
        // Map from linear interpolation function to Easing curve
4996
        let t: f32 = interpolate_resolver.interpolate_func.evaluate(f64::from(t));
4996
        let t = t.clamp(0.0, 1.0);
4996
        match (self, other) {
780
            (Self::TextColor(col_start), Self::TextColor(col_end)) => {
780
                let col_start = col_start.get_property().copied().unwrap_or_default();
780
                let col_end = col_end.get_property().copied().unwrap_or_default();
780
                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))
            }
1560
            (Self::Width(start), Self::Width(end)) => {
1560
                let start =
1560
                    start
1560
                        .get_property()
1560
                        .cloned()
1560
                        .unwrap_or(LayoutWidth::Px(PixelValue::px(
1560
                            interpolate_resolver.current_rect_width,
1560
                        )));
1560
                let end = end.get_property().cloned().unwrap_or_default();
1560
                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)))
            }
1066
            (Self::MarginLeft(start), Self::MarginLeft(end)) => {
1066
                let start = start.get_property().copied().unwrap_or_default();
1066
                let end = end.get_property().copied().unwrap_or_default();
1066
                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)))
            }
1560
            (Self::Opacity(start), Self::Opacity(end)) => {
1560
                let start = start.get_property().copied().unwrap_or_default();
1560
                let end = end.get_property().copied().unwrap_or_default();
1560
                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)))
            }
            // A single solid colour on both ends is a colour, and a colour
            // tweens (a switch track fading between its off and on colours).
            // Gradients, images, layers and unresolved system colours still
            // take the half-way jump below.
3
            (Self::BackgroundContent(start), Self::BackgroundContent(end)) => {
                use crate::props::style::background::StyleBackgroundContent as B;
6
                let solid = |v: &StyleBackgroundContentVecValue| match v
6
                    .get_property()
6
                    .map(StyleBackgroundContentVec::as_slice)
                {
4
                    Some([B::Color(c)]) => Some(*c),
2
                    _ => None,
6
                };
3
                match (solid(start), solid(end)) {
1
                    (Some(a), Some(b)) => {
1
                        Self::background_content(vec![B::Color(a.interpolate(&b, t))].into())
                    }
                    _ => {
2
                        if t > 0.5 {
1
                            other.clone()
                        } else {
1
                            self.clone()
                        }
                    }
                }
            }
            /*
            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()
                }
            }
        }
5174
    }
    /// 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)
    #[must_use]
85541492
    pub const fn get_type(&self) -> CssPropertyType {
85541492
        match &self {
11
            Self::CaretColor(_) => CssPropertyType::CaretColor,
11
            Self::CaretWidth(_) => CssPropertyType::CaretWidth,
219
            Self::CaretAnimationDuration(_) => CssPropertyType::CaretAnimationDuration,
28273
            Self::Animation(_) => CssPropertyType::Animation,
141
            Self::AnimationIn(_) => CssPropertyType::AnimationIn,
596
            Self::AnimationOut(_) => CssPropertyType::AnimationOut,
115
            Self::SelectionBackgroundColor(_) => CssPropertyType::SelectionBackgroundColor,
102
            Self::SelectionColor(_) => CssPropertyType::SelectionColor,
11
            Self::SelectionRadius(_) => CssPropertyType::SelectionRadius,
11
            Self::TextJustify(_) => CssPropertyType::TextJustify,
3995149
            Self::TextColor(_) => CssPropertyType::TextColor,
2526619
            Self::FontSize(_) => CssPropertyType::FontSize,
649223
            Self::FontFamily(_) => CssPropertyType::FontFamily,
5841
            Self::FontWeight(_) => CssPropertyType::FontWeight,
89
            Self::FontStyle(_) => CssPropertyType::FontStyle,
1197592
            Self::TextAlign(_) => CssPropertyType::TextAlign,
3738
            Self::VerticalAlign(_) => CssPropertyType::VerticalAlign,
128
            Self::LetterSpacing(_) => CssPropertyType::LetterSpacing,
50
            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,
90
            Self::TextBoxTrim(_) => CssPropertyType::TextBoxTrim,
90
            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,
75651
            Self::LineHeight(_) => CssPropertyType::LineHeight,
50
            Self::WordSpacing(_) => CssPropertyType::WordSpacing,
11
            Self::TabSize(_) => CssPropertyType::TabSize,
2704986
            Self::Cursor(_) => CssPropertyType::Cursor,
4006296
            Self::Display(_) => CssPropertyType::Display,
1025
            Self::Float(_) => CssPropertyType::Float,
3178056
            Self::BoxSizing(_) => CssPropertyType::BoxSizing,
1479978
            Self::Width(_) => CssPropertyType::Width,
1667148
            Self::Height(_) => CssPropertyType::Height,
418958
            Self::MinWidth(_) => CssPropertyType::MinWidth,
83874
            Self::MinHeight(_) => CssPropertyType::MinHeight,
6372
            Self::MaxWidth(_) => CssPropertyType::MaxWidth,
1493
            Self::MaxHeight(_) => CssPropertyType::MaxHeight,
284103
            Self::Position(_) => CssPropertyType::Position,
52489
            Self::Top(_) => CssPropertyType::Top,
11435
            Self::Right(_) => CssPropertyType::Right,
52190
            Self::Left(_) => CssPropertyType::Left,
7522
            Self::Bottom(_) => CssPropertyType::Bottom,
25052
            Self::ZIndex(_) => CssPropertyType::ZIndex,
22140
            Self::FlexWrap(_) => CssPropertyType::FlexWrap,
2635335
            Self::FlexDirection(_) => CssPropertyType::FlexDirection,
4284906
            Self::FlexGrow(_) => CssPropertyType::FlexGrow,
1276651
            Self::FlexShrink(_) => CssPropertyType::FlexShrink,
140360
            Self::FlexBasis(_) => CssPropertyType::FlexBasis,
775516
            Self::JustifyContent(_) => CssPropertyType::JustifyContent,
2056380
            Self::AlignItems(_) => CssPropertyType::AlignItems,
11
            Self::AlignContent(_) => CssPropertyType::AlignContent,
6604
            Self::ColumnGap(_) => CssPropertyType::ColumnGap,
6604
            Self::RowGap(_) => CssPropertyType::RowGap,
129
            Self::GridTemplateColumns(_) => CssPropertyType::GridTemplateColumns,
129
            Self::GridTemplateRows(_) => CssPropertyType::GridTemplateRows,
11
            Self::GridAutoColumns(_) => CssPropertyType::GridAutoColumns,
11
            Self::GridAutoRows(_) => CssPropertyType::GridAutoRows,
207
            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,
110498
            Self::AlignSelf(_) => CssPropertyType::AlignSelf,
12
            Self::Font(_) => CssPropertyType::Font,
207
            Self::GridRow(_) => CssPropertyType::GridRow,
50
            Self::GridTemplateAreas(_) => CssPropertyType::GridTemplateAreas,
180
            Self::WritingMode(_) => CssPropertyType::WritingMode,
193
            Self::Clear(_) => CssPropertyType::Clear,
3247423
            Self::BackgroundContent(_) => CssPropertyType::BackgroundContent,
531
            Self::BackgroundPosition(_) => CssPropertyType::BackgroundPosition,
11
            Self::BackgroundSize(_) => CssPropertyType::BackgroundSize,
531
            Self::BackgroundRepeat(_) => CssPropertyType::BackgroundRepeat,
259049
            Self::OverflowX(_) => CssPropertyType::OverflowX,
261955
            Self::OverflowY(_) => CssPropertyType::OverflowY,
11
            Self::OverflowBlock(_) => CssPropertyType::OverflowBlock,
50
            Self::OverflowInline(_) => CssPropertyType::OverflowInline,
3900177
            Self::PaddingTop(_) => CssPropertyType::PaddingTop,
3562854
            Self::PaddingLeft(_) => CssPropertyType::PaddingLeft,
3555339
            Self::PaddingRight(_) => CssPropertyType::PaddingRight,
3529627
            Self::PaddingBottom(_) => CssPropertyType::PaddingBottom,
11
            Self::PaddingInlineStart(_) => CssPropertyType::PaddingInlineStart,
11
            Self::PaddingInlineEnd(_) => CssPropertyType::PaddingInlineEnd,
3020472
            Self::MarginTop(_) => CssPropertyType::MarginTop,
2738132
            Self::MarginLeft(_) => CssPropertyType::MarginLeft,
2358037
            Self::MarginRight(_) => CssPropertyType::MarginRight,
2896015
            Self::MarginBottom(_) => CssPropertyType::MarginBottom,
574157
            Self::BorderTopLeftRadius(_) => CssPropertyType::BorderTopLeftRadius,
574131
            Self::BorderTopRightRadius(_) => CssPropertyType::BorderTopRightRadius,
579565
            Self::BorderBottomLeftRadius(_) => CssPropertyType::BorderBottomLeftRadius,
579539
            Self::BorderBottomRightRadius(_) => CssPropertyType::BorderBottomRightRadius,
1787201
            Self::BorderTopColor(_) => CssPropertyType::BorderTopColor,
2314369
            Self::BorderRightColor(_) => CssPropertyType::BorderRightColor,
1668984
            Self::BorderLeftColor(_) => CssPropertyType::BorderLeftColor,
2201113
            Self::BorderBottomColor(_) => CssPropertyType::BorderBottomColor,
992393
            Self::BorderTopStyle(_) => CssPropertyType::BorderTopStyle,
1117224
            Self::BorderRightStyle(_) => CssPropertyType::BorderRightStyle,
854936
            Self::BorderLeftStyle(_) => CssPropertyType::BorderLeftStyle,
1238761
            Self::BorderBottomStyle(_) => CssPropertyType::BorderBottomStyle,
1059500
            Self::BorderTopWidth(_) => CssPropertyType::BorderTopWidth,
1184344
            Self::BorderRightWidth(_) => CssPropertyType::BorderRightWidth,
922153
            Self::BorderLeftWidth(_) => CssPropertyType::BorderLeftWidth,
1306011
            Self::BorderBottomWidth(_) => CssPropertyType::BorderBottomWidth,
6954
            Self::BoxShadowLeft(_) => CssPropertyType::BoxShadowLeft,
7058
            Self::BoxShadowRight(_) => CssPropertyType::BoxShadowRight,
7162
            Self::BoxShadowTop(_) => CssPropertyType::BoxShadowTop,
7266
            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,
50760
            Self::ScrollbarWidth(_) => CssPropertyType::ScrollbarWidth,
12
            Self::OverscrollBehaviorX(_) => CssPropertyType::OverscrollBehaviorX,
12
            Self::OverscrollBehaviorY(_) => CssPropertyType::OverscrollBehaviorY,
1271
            Self::ScrollbarColor(_) => CssPropertyType::ScrollbarColor,
515
            Self::ScrollbarVisibility(_) => CssPropertyType::ScrollbarVisibility,
536
            Self::ScrollbarFadeDelay(_) => CssPropertyType::ScrollbarFadeDelay,
536
            Self::ScrollbarFadeDuration(_) => CssPropertyType::ScrollbarFadeDuration,
55430
            Self::Opacity(_) => CssPropertyType::Opacity,
53
            Self::Visibility(_) => CssPropertyType::Visibility,
14277
            Self::Transform(_) => CssPropertyType::Transform,
11
            Self::PerspectiveOrigin(_) => CssPropertyType::PerspectiveOrigin,
11
            Self::TransformOrigin(_) => CssPropertyType::TransformOrigin,
11
            Self::BackfaceVisibility(_) => CssPropertyType::BackfaceVisibility,
947
            Self::AppRegion(_) => CssPropertyType::AppRegion,
11
            Self::SpatialNavigationAction(_) => CssPropertyType::SpatialNavigationAction,
908
            Self::SpatialNavigationContain(_) => CssPropertyType::SpatialNavigationContain,
11
            Self::MixBlendMode(_) => CssPropertyType::MixBlendMode,
11
            Self::Filter(_) => CssPropertyType::Filter,
11
            Self::BackdropFilter(_) => CssPropertyType::BackdropFilter,
11
            Self::TextShadow(_) => CssPropertyType::TextShadow,
336688
            Self::WhiteSpace(_) => CssPropertyType::WhiteSpace,
11
            Self::Hyphens(_) => CssPropertyType::Hyphens,
11
            Self::WordBreak(_) => CssPropertyType::WordBreak,
12928
            Self::OverflowWrap(_) => CssPropertyType::OverflowWrap,
11
            Self::LineBreak(_) => CssPropertyType::LineBreak,
13
            Self::TextOverflow(_) => CssPropertyType::TextOverflow,
11
            Self::ObjectFit(_) => CssPropertyType::ObjectFit,
11
            Self::ObjectPosition(_) => CssPropertyType::ObjectPosition,
622
            Self::AspectRatio(_) => CssPropertyType::AspectRatio,
11
            Self::TextOrientation(_) => CssPropertyType::TextOrientation,
11
            Self::TextAlignLast(_) => CssPropertyType::TextAlignLast,
89
            Self::TextTransform(_) => CssPropertyType::TextTransform,
128
            Self::Direction(_) => CssPropertyType::Direction,
2960228
            Self::UserSelect(_) => CssPropertyType::UserSelect,
1678
            Self::TextDecoration(_) => CssPropertyType::TextDecoration,
102
            Self::BreakBefore(_) => CssPropertyType::BreakBefore,
1901
            Self::BreakAfter(_) => CssPropertyType::BreakAfter,
3527
            Self::BreakInside(_) => CssPropertyType::BreakInside,
63
            Self::Orphans(_) => CssPropertyType::Orphans,
63
            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,
1483
            Self::CounterReset(_) => CssPropertyType::CounterReset,
11
            Self::CounterIncrement(_) => CssPropertyType::CounterIncrement,
1483
            Self::ListStyleType(_) => CssPropertyType::ListStyleType,
11
            Self::ListStylePosition(_) => CssPropertyType::ListStylePosition,
11
            Self::StringSet(_) => CssPropertyType::StringSet,
12
            Self::TableLayout(_) => CssPropertyType::TableLayout,
428
            Self::BorderCollapse(_) => CssPropertyType::BorderCollapse,
89
            Self::BorderSpacing(_) => CssPropertyType::BorderSpacing,
12
            Self::CaptionSide(_) => CssPropertyType::CaptionSide,
12
            Self::EmptyCells(_) => CssPropertyType::EmptyCells,
        }
85541492
    }
    // const constructors for easier API access
    #[must_use]
807
    pub const fn none(prop_type: CssPropertyType) -> Self {
807
        css_property_from_type!(prop_type, None)
807
    }
    #[must_use]
660
    pub const fn auto(prop_type: CssPropertyType) -> Self {
660
        css_property_from_type!(prop_type, Auto)
660
    }
    #[must_use]
1437
    pub const fn initial(prop_type: CssPropertyType) -> Self {
1437
        css_property_from_type!(prop_type, Initial)
1437
    }
    #[must_use]
574
    pub const fn inherit(prop_type: CssPropertyType) -> Self {
574
        css_property_from_type!(prop_type, Inherit)
574
    }
    #[must_use]
780
    pub const fn text_color(input: StyleTextColor) -> Self {
780
        Self::TextColor(CssPropertyValue::Exact(input))
780
    }
    #[must_use]
672
    pub const fn font_size(input: StyleFontSize) -> Self {
672
        Self::FontSize(CssPropertyValue::Exact(input))
672
    }
    #[must_use]
192
    pub const fn font_family(input: StyleFontFamilyVec) -> Self {
192
        Self::FontFamily(CssPropertyValue::Exact(input))
192
    }
    #[must_use]
9
    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))
    }
    #[must_use]
374705
    pub const fn user_select(input: StyleUserSelect) -> Self {
374705
        Self::UserSelect(CssPropertyValue::Exact(input))
374705
    }
    #[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))
    }
    #[must_use]
17312
    pub const fn width(input: LayoutWidth) -> Self {
17312
        Self::Width(CssPropertyValue::Exact(input))
17312
    }
    #[must_use]
495
    pub const fn height(input: LayoutHeight) -> Self {
495
        Self::Height(CssPropertyValue::Exact(input))
495
    }
    #[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))
    }
    #[must_use]
228
    pub const fn position(input: LayoutPosition) -> Self {
228
        Self::Position(CssPropertyValue::Exact(input))
228
    }
    #[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))
    }
    #[must_use]
456
    pub const fn flex_grow(input: LayoutFlexGrow) -> Self {
456
        Self::FlexGrow(CssPropertyValue::Exact(input))
456
    }
    #[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))
    }
    #[must_use]
50136
    pub const fn align_self(input: LayoutAlignSelf) -> Self {
50136
        Self::AlignSelf(CssPropertyValue::Exact(input))
50136
    }
    #[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))
    }
    #[must_use]
254
    pub const fn background_content(input: StyleBackgroundContentVec) -> Self {
254
        Self::BackgroundContent(CssPropertyValue::Exact(input))
254
    }
    #[must_use]
228
    pub const fn background_position(input: StyleBackgroundPositionVec) -> Self {
228
        Self::BackgroundPosition(CssPropertyValue::Exact(input))
228
    }
    #[must_use]
    pub const fn background_size(input: StyleBackgroundSizeVec) -> Self {
        Self::BackgroundSize(CssPropertyValue::Exact(input))
    }
    #[must_use]
228
    pub const fn background_repeat(input: StyleBackgroundRepeatVec) -> Self {
228
        Self::BackgroundRepeat(CssPropertyValue::Exact(input))
228
    }
    #[must_use]
456
    pub const fn overflow_x(input: LayoutOverflow) -> Self {
456
        Self::OverflowX(CssPropertyValue::Exact(input))
456
    }
    #[must_use]
456
    pub const fn overflow_y(input: LayoutOverflow) -> Self {
456
        Self::OverflowY(CssPropertyValue::Exact(input))
456
    }
    #[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))
    }
    #[must_use]
78
    pub const fn as_z_index(&self) -> Option<&LayoutZIndexValue> {
78
        match self {
78
            Self::ZIndex(f) => Some(f),
            _ => None,
        }
78
    }
    #[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,
        }
    }
    #[must_use]
475328
    pub const fn as_background_content(&self) -> Option<&StyleBackgroundContentVecValue> {
475328
        match self {
475328
            Self::BackgroundContent(f) => Some(f),
            _ => None,
        }
475328
    }
    #[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,
        }
    }
    #[must_use]
104
    pub const fn as_caret_animation_duration(&self) -> Option<&CaretAnimationDurationValue> {
104
        match self {
104
            Self::CaretAnimationDuration(f) => Some(f),
            _ => None,
        }
104
    }
    #[must_use]
65
    pub const fn as_selection_background_color(&self) -> Option<&SelectionBackgroundColorValue> {
65
        match self {
65
            Self::SelectionBackgroundColor(f) => Some(f),
            _ => None,
        }
65
    }
    #[must_use]
52
    pub const fn as_selection_color(&self) -> Option<&SelectionColorValue> {
52
        match self {
52
            Self::SelectionColor(f) => Some(f),
            _ => None,
        }
52
    }
    #[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,
        }
    }
    #[must_use]
1602
    pub const fn as_font_size(&self) -> Option<&StyleFontSizeValue> {
1602
        match self {
1602
            Self::FontSize(f) => Some(f),
            _ => None,
        }
1602
    }
    #[must_use]
52
    pub const fn as_font_family(&self) -> Option<&StyleFontFamilyVecValue> {
52
        match self {
52
            Self::FontFamily(f) => Some(f),
            _ => None,
        }
52
    }
    #[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,
        }
    }
    #[must_use]
796153
    pub const fn as_text_color(&self) -> Option<&StyleTextColorValue> {
796153
        match self {
796153
            Self::TextColor(f) => Some(f),
            _ => None,
        }
796153
    }
    #[must_use]
    pub const fn as_text_align(&self) -> Option<&StyleTextAlignValue> {
        match self {
            Self::TextAlign(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
1131
    pub const fn as_vertical_align(&self) -> Option<&StyleVerticalAlignValue> {
1131
        match self {
1131
            Self::VerticalAlign(f) => Some(f),
            _ => None,
        }
1131
    }
    #[must_use]
26364
    pub const fn as_line_height(&self) -> Option<&StyleLineHeightValue> {
26364
        match self {
26364
            Self::LineHeight(f) => Some(f),
            _ => None,
        }
26364
    }
    #[must_use]
26
    pub const fn as_text_indent(&self) -> Option<&StyleTextIndentValue> {
26
        match self {
26
            Self::TextIndent(f) => Some(f),
            _ => None,
        }
26
    }
    #[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,
        }
    }
    #[must_use]
104
    pub const fn as_text_box_trim(&self) -> Option<&StyleTextBoxTrimValue> {
104
        match self {
104
            Self::TextBoxTrim(f) => Some(f),
            _ => None,
        }
104
    }
    #[must_use]
104
    pub const fn as_text_box_edge(&self) -> Option<&StyleTextBoxEdgeValue> {
104
        match self {
104
            Self::TextBoxEdge(f) => Some(f),
            _ => None,
        }
104
    }
    #[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,
        }
    }
    #[must_use]
775580
    pub const fn as_cursor(&self) -> Option<&StyleCursorValue> {
775580
        match self {
775580
            Self::Cursor(f) => Some(f),
            _ => None,
        }
775580
    }
    #[must_use]
221
    pub const fn as_box_shadow_left(&self) -> Option<&StyleBoxShadowValue> {
221
        match self {
221
            Self::BoxShadowLeft(f) => Some(f),
            _ => None,
        }
221
    }
    #[must_use]
221
    pub const fn as_box_shadow_right(&self) -> Option<&StyleBoxShadowValue> {
221
        match self {
221
            Self::BoxShadowRight(f) => Some(f),
            _ => None,
        }
221
    }
    #[must_use]
221
    pub const fn as_box_shadow_top(&self) -> Option<&StyleBoxShadowValue> {
221
        match self {
221
            Self::BoxShadowTop(f) => Some(f),
            _ => None,
        }
221
    }
    #[must_use]
221
    pub const fn as_box_shadow_bottom(&self) -> Option<&StyleBoxShadowValue> {
221
        match self {
221
            Self::BoxShadowBottom(f) => Some(f),
            _ => None,
        }
221
    }
    #[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,
        }
    }
    #[must_use]
65
    pub const fn as_border_top_left_radius(&self) -> Option<&StyleBorderTopLeftRadiusValue> {
65
        match self {
65
            Self::BorderTopLeftRadius(f) => Some(f),
            _ => None,
        }
65
    }
    #[must_use]
65
    pub const fn as_border_top_right_radius(&self) -> Option<&StyleBorderTopRightRadiusValue> {
65
        match self {
65
            Self::BorderTopRightRadius(f) => Some(f),
            _ => None,
        }
65
    }
    #[must_use]
65
    pub const fn as_border_bottom_left_radius(&self) -> Option<&StyleBorderBottomLeftRadiusValue> {
65
        match self {
65
            Self::BorderBottomLeftRadius(f) => Some(f),
            _ => None,
        }
65
    }
    #[must_use]
65
    pub const fn as_border_bottom_right_radius(
65
        &self,
65
    ) -> Option<&StyleBorderBottomRightRadiusValue> {
65
        match self {
65
            Self::BorderBottomRightRadius(f) => Some(f),
            _ => None,
        }
65
    }
    #[must_use]
39
    pub const fn as_opacity(&self) -> Option<&StyleOpacityValue> {
39
        match self {
39
            Self::Opacity(f) => Some(f),
            _ => None,
        }
39
    }
    #[must_use]
5170
    pub const fn as_transform(&self) -> Option<&StyleTransformVecValue> {
5170
        match self {
5170
            Self::Transform(f) => Some(f),
            _ => None,
        }
5170
    }
    #[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_spatial_navigation_action(&self) -> Option<&StyleSpatialNavigationActionValue> {
        match self {
            Self::SpatialNavigationAction(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
52
    pub const fn as_spatial_navigation_contain(
52
        &self,
52
    ) -> Option<&StyleSpatialNavigationContainValue> {
52
        match self {
52
            Self::SpatialNavigationContain(f) => Some(f),
            _ => None,
        }
52
    }
    #[must_use]
    pub const fn as_app_region(&self) -> Option<&StyleAppRegionValue> {
        match self {
            Self::AppRegion(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)
    #[must_use]
10583
    pub const fn as_display(&self) -> Option<&LayoutDisplayValue> {
10583
        match self {
10583
            Self::Display(f) => Some(f),
            _ => None,
        }
10583
    }
    #[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,
        }
    }
    #[must_use]
723
    pub const fn as_width(&self) -> Option<&LayoutWidthValue> {
723
        match self {
723
            Self::Width(f) => Some(f),
            _ => None,
        }
723
    }
    #[must_use]
762
    pub const fn as_height(&self) -> Option<&LayoutHeightValue> {
762
        match self {
762
            Self::Height(f) => Some(f),
            _ => None,
        }
762
    }
    #[must_use]
60
    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,
        }
    }
    #[must_use]
40
    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,
        }
    }
    #[must_use]
202
    pub const fn as_top(&self) -> Option<&LayoutTopValue> {
202
        match self {
202
            Self::Top(f) => Some(f),
            _ => None,
        }
202
    }
    #[must_use]
46
    pub const fn as_bottom(&self) -> Option<&LayoutInsetBottomValue> {
46
        match self {
46
            Self::Bottom(f) => Some(f),
            _ => None,
        }
46
    }
    #[must_use]
33
    pub const fn as_right(&self) -> Option<&LayoutRightValue> {
33
        match self {
33
            Self::Right(f) => Some(f),
            _ => None,
        }
33
    }
    #[must_use]
189
    pub const fn as_left(&self) -> Option<&LayoutLeftValue> {
189
        match self {
189
            Self::Left(f) => Some(f),
            _ => None,
        }
189
    }
    #[must_use]
104
    pub const fn as_padding_top(&self) -> Option<&LayoutPaddingTopValue> {
104
        match self {
104
            Self::PaddingTop(f) => Some(f),
            _ => None,
        }
104
    }
    #[must_use]
182
    pub const fn as_padding_bottom(&self) -> Option<&LayoutPaddingBottomValue> {
182
        match self {
182
            Self::PaddingBottom(f) => Some(f),
            _ => None,
        }
182
    }
    #[must_use]
164
    pub const fn as_padding_left(&self) -> Option<&LayoutPaddingLeftValue> {
164
        match self {
164
            Self::PaddingLeft(f) => Some(f),
            _ => None,
        }
164
    }
    #[must_use]
104
    pub const fn as_padding_right(&self) -> Option<&LayoutPaddingRightValue> {
104
        match self {
104
            Self::PaddingRight(f) => Some(f),
            _ => None,
        }
104
    }
    #[must_use]
7174
    pub const fn as_margin_top(&self) -> Option<&LayoutMarginTopValue> {
7174
        match self {
7174
            Self::MarginTop(f) => Some(f),
            _ => None,
        }
7174
    }
    #[must_use]
3318
    pub const fn as_margin_bottom(&self) -> Option<&LayoutMarginBottomValue> {
3318
        match self {
3318
            Self::MarginBottom(f) => Some(f),
            _ => None,
        }
3318
    }
    #[must_use]
406
    pub const fn as_margin_left(&self) -> Option<&LayoutMarginLeftValue> {
406
        match self {
406
            Self::MarginLeft(f) => Some(f),
            _ => None,
        }
406
    }
    #[must_use]
393
    pub const fn as_margin_right(&self) -> Option<&LayoutMarginRightValue> {
393
        match self {
393
            Self::MarginRight(f) => Some(f),
            _ => None,
        }
393
    }
    #[must_use]
    pub const fn as_border_top_width(&self) -> Option<&LayoutBorderTopWidthValue> {
        match self {
            Self::BorderTopWidth(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
40
    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,
        }
    }
    #[must_use]
469
    pub const fn as_overflow_x(&self) -> Option<&LayoutOverflowValue> {
469
        match self {
469
            Self::OverflowX(f) => Some(f),
            _ => None,
        }
469
    }
    #[must_use]
2093
    pub const fn as_overflow_y(&self) -> Option<&LayoutOverflowValue> {
2093
        match self {
2093
            Self::OverflowY(f) => Some(f),
            _ => None,
        }
2093
    }
    #[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,
        }
    }
    #[must_use]
130
    pub const fn as_flex_direction(&self) -> Option<&LayoutFlexDirectionValue> {
130
        match self {
130
            Self::FlexDirection(f) => Some(f),
            _ => None,
        }
130
    }
    #[must_use]
    pub const fn as_direction(&self) -> Option<&StyleDirectionValue> {
        match self {
            Self::Direction(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
52780
    pub const fn as_user_select(&self) -> Option<&StyleUserSelectValue> {
52780
        match self {
52780
            Self::UserSelect(f) => Some(f),
            _ => None,
        }
52780
    }
    #[must_use]
546
    pub const fn as_text_decoration(&self) -> Option<&StyleTextDecorationValue> {
546
        match self {
546
            Self::TextDecoration(f) => Some(f),
            _ => None,
        }
546
    }
    #[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,
        }
    }
    #[must_use]
26
    pub const fn as_overflow_wrap(&self) -> Option<&StyleOverflowWrapValue> {
26
        match self {
26
            Self::OverflowWrap(f) => Some(f),
            _ => None,
        }
26
    }
    #[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,
        }
    }
    #[must_use]
273
    pub const fn as_aspect_ratio(&self) -> Option<&StyleAspectRatioValue> {
273
        match self {
273
            Self::AspectRatio(f) => Some(f),
            _ => None,
        }
273
    }
    #[must_use]
    pub const fn as_text_orientation(&self) -> Option<&StyleTextOrientationValue> {
        match self {
            Self::TextOrientation(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
26
    pub const fn as_text_transform(&self) -> Option<&StyleTextTransformValue> {
26
        match self {
26
            Self::TextTransform(f) => Some(f),
            _ => None,
        }
26
    }
    #[must_use]
    pub const fn as_text_align_last(&self) -> Option<&StyleTextAlignLastValue> {
        match self {
            Self::TextAlignLast(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
91
    pub const fn as_white_space(&self) -> Option<&StyleWhiteSpaceValue> {
91
        match self {
91
            Self::WhiteSpace(f) => Some(f),
            _ => None,
        }
91
    }
    #[must_use]
13
    pub const fn as_flex_wrap(&self) -> Option<&LayoutFlexWrapValue> {
13
        match self {
13
            Self::FlexWrap(f) => Some(f),
            _ => None,
        }
13
    }
    #[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,
        }
    }
    #[must_use]
91
    pub const fn as_break_before(&self) -> Option<&PageBreakValue> {
91
        match self {
91
            Self::BreakBefore(f) => Some(f),
            _ => None,
        }
91
    }
    #[must_use]
923
    pub const fn as_break_after(&self) -> Option<&PageBreakValue> {
923
        match self {
923
            Self::BreakAfter(f) => Some(f),
            _ => None,
        }
923
    }
    #[must_use]
78
    pub const fn as_break_inside(&self) -> Option<&BreakInsideValue> {
78
        match self {
78
            Self::BreakInside(f) => Some(f),
            _ => None,
        }
78
    }
    #[must_use]
26
    pub const fn as_orphans(&self) -> Option<&OrphansValue> {
26
        match self {
26
            Self::Orphans(f) => Some(f),
            _ => None,
        }
26
    }
    #[must_use]
26
    pub const fn as_widows(&self) -> Option<&WidowsValue> {
26
        match self {
26
            Self::Widows(f) => Some(f),
            _ => None,
        }
26
    }
    #[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,
        }
    }
    #[must_use]
689
    pub const fn as_counter_reset(&self) -> Option<&CounterResetValue> {
689
        match self {
689
            Self::CounterReset(f) => Some(f),
            _ => None,
        }
689
    }
    #[must_use]
    pub const fn as_counter_increment(&self) -> Option<&CounterIncrementValue> {
        match self {
            Self::CounterIncrement(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
1196
    pub const fn as_list_style_type(&self) -> Option<&StyleListStyleTypeValue> {
1196
        match self {
1196
            Self::ListStyleType(f) => Some(f),
            _ => None,
        }
1196
    }
    #[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_overscroll_behavior_x(&self) -> Option<&OverscrollBehaviorValue> {
        match self {
            Self::OverscrollBehaviorX(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
    pub const fn as_overscroll_behavior_y(&self) -> Option<&OverscrollBehaviorValue> {
        match self {
            Self::OverscrollBehaviorY(f) => Some(f),
            _ => None,
        }
    }
    #[must_use]
754
    pub const fn as_scrollbar_width(&self) -> Option<&LayoutScrollbarWidthValue> {
754
        match self {
754
            Self::ScrollbarWidth(f) => Some(f),
            _ => None,
        }
754
    }
    #[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)
    #[must_use]
5784
    pub const fn is_initial(&self) -> bool {
        use self::CssProperty::{
            AlignContent, AlignItems, AlignSelf, AlignmentBaseline, Animation, AnimationIn,
            AnimationOut, AppRegion, AspectRatio, BackdropFilter, BackfaceVisibility,
            BackgroundContent, BackgroundPosition, BackgroundRepeat, BackgroundSize,
            BaselineSource, BorderBottomColor, BorderBottomLeftRadius, BorderBottomRightRadius,
            BorderBottomStyle, BorderBottomWidth, BorderCollapse, BorderLeftColor, BorderLeftStyle,
            BorderLeftWidth, BorderRightColor, BorderRightStyle, BorderRightWidth, BorderSpacing,
            BorderTopColor, BorderTopLeftRadius, BorderTopRightRadius, BorderTopStyle,
            BorderTopWidth, Bottom, BoxDecorationBreak, BoxShadowBottom, BoxShadowLeft,
            BoxShadowRight, BoxShadowTop, BoxSizing, BreakAfter, BreakBefore, BreakInside,
            CaptionSide, CaretAnimationDuration, CaretColor, CaretWidth, Clear, Clip, ClipPath,
            ColumnCount, ColumnFill, ColumnGap, ColumnRuleColor, ColumnRuleStyle, ColumnRuleWidth,
            ColumnSpan, ColumnWidth, Content, CounterIncrement, CounterReset, Cursor, Direction,
            Display, DominantBaseline, EmptyCells, ExclusionMargin, Filter, FlexBasis,
            FlexDirection, FlexGrow, FlexShrink, FlexWrap, Float, FlowFrom, FlowInto, Font,
            FontFamily, FontSize, FontStyle, FontWeight, Gap, GridAutoColumns, GridAutoFlow,
            GridAutoRows, GridColumn, GridGap, GridRow, GridTemplateAreas, GridTemplateColumns,
            GridTemplateRows, HangingPunctuation, Height, HyphenationLanguage, Hyphens,
            InitialLetter, InitialLetterAlign, InitialLetterWrap, JustifyContent, JustifyItems,
            JustifySelf, Left, LetterSpacing, LineBreak, LineClamp, LineFitEdge, LineHeight,
            ListStylePosition, ListStyleType, MarginBottom, MarginLeft, MarginRight, MarginTop,
            MaxHeight, MaxWidth, MinHeight, MinWidth, MixBlendMode, ObjectFit, ObjectPosition,
            Opacity, Orphans, OverflowBlock, OverflowClipMargin, OverflowInline, OverflowWrap,
            OverflowX, OverflowY, OverscrollBehaviorX, OverscrollBehaviorY, PaddingBottom,
            PaddingInlineEnd, PaddingInlineStart, PaddingLeft, PaddingRight, PaddingTop,
            PerspectiveOrigin, Position, Right, RowGap, ScrollbarButton, ScrollbarColor,
            ScrollbarCorner, ScrollbarFadeDelay, ScrollbarFadeDuration, ScrollbarGutter,
            ScrollbarResizer, ScrollbarThumb, ScrollbarTrack, ScrollbarVisibility, ScrollbarWidth,
            SelectionBackgroundColor, SelectionColor, SelectionRadius, ShapeImageThreshold,
            ShapeInside, ShapeMargin, ShapeOutside, SpatialNavigationAction,
            SpatialNavigationContain, StringSet, TabSize, TableLayout, TextAlign, TextAlignLast,
            TextBoxEdge, TextBoxTrim, TextColor, TextCombineUpright, TextDecoration, TextIndent,
            TextJustify, TextOrientation, TextOverflow, TextShadow, TextTransform, Top, Transform,
            TransformOrigin, UnicodeBidi, UserSelect, VerticalAlign, Visibility, WhiteSpace,
            Widows, Width, WordBreak, WordSpacing, WritingMode, ZIndex,
        };
5784
        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(),
848
            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(),
55
            Display(c) => c.is_initial(),
            Float(c) => c.is_initial(),
            BoxSizing(c) => c.is_initial(),
1714
            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(),
78
            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(),
1482
            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(),
            OverscrollBehaviorX(c) | OverscrollBehaviorY(c) => c.is_initial(),
            ScrollbarColor(c) => c.is_initial(),
            ScrollbarVisibility(c) => c.is_initial(),
            ScrollbarFadeDelay(c) => c.is_initial(),
            ScrollbarFadeDuration(c) => c.is_initial(),
1586
            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(),
            AppRegion(c) => c.is_initial(),
            SpatialNavigationAction(c) => c.is_initial(),
            SpatialNavigationContain(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(),
        }
5784
    }
    #[must_use]
433
    pub const fn const_none(prop_type: CssPropertyType) -> Self {
433
        css_property_from_type!(prop_type, None)
433
    }
    #[must_use]
1
    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)
    }
    #[must_use]
1
    pub const fn const_inherit(prop_type: CssPropertyType) -> Self {
1
        css_property_from_type!(prop_type, Inherit)
1
    }
    #[must_use]
485302
    pub const fn const_text_color(input: StyleTextColor) -> Self {
485302
        Self::TextColor(StyleTextColorValue::Exact(input))
485302
    }
    #[must_use]
326220
    pub const fn const_font_size(input: StyleFontSize) -> Self {
326220
        Self::FontSize(StyleFontSizeValue::Exact(input))
326220
    }
    #[must_use]
47952
    pub const fn const_font_family(input: StyleFontFamilyVec) -> Self {
47952
        Self::FontFamily(StyleFontFamilyVecValue::Exact(input))
47952
    }
    #[must_use]
215268
    pub const fn const_text_align(input: StyleTextAlign) -> Self {
215268
        Self::TextAlign(StyleTextAlignValue::Exact(input))
215268
    }
    #[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))
    }
    #[must_use]
257976
    pub const fn const_cursor(input: StyleCursor) -> Self {
257976
        Self::Cursor(StyleCursorValue::Exact(input))
257976
    }
    #[must_use]
245019
    pub const fn const_display(input: LayoutDisplay) -> Self {
245019
        Self::Display(LayoutDisplayValue::Exact(input))
245019
    }
    #[must_use]
    pub const fn const_float(input: LayoutFloat) -> Self {
        Self::Float(LayoutFloatValue::Exact(input))
    }
    #[must_use]
94872
    pub const fn const_box_sizing(input: LayoutBoxSizing) -> Self {
94872
        Self::BoxSizing(LayoutBoxSizingValue::Exact(input))
94872
    }
    #[must_use]
304140
    pub const fn const_width(input: LayoutWidth) -> Self {
304140
        Self::Width(LayoutWidthValue::Exact(input))
304140
    }
    #[must_use]
337572
    pub const fn const_height(input: LayoutHeight) -> Self {
337572
        Self::Height(LayoutHeightValue::Exact(input))
337572
    }
    #[must_use]
60228
    pub const fn const_min_width(input: LayoutMinWidth) -> Self {
60228
        Self::MinWidth(LayoutMinWidthValue::Exact(input))
60228
    }
    #[must_use]
2628
    pub const fn const_min_height(input: LayoutMinHeight) -> Self {
2628
        Self::MinHeight(LayoutMinHeightValue::Exact(input))
2628
    }
    #[must_use]
1320
    pub const fn const_max_width(input: LayoutMaxWidth) -> Self {
1320
        Self::MaxWidth(LayoutMaxWidthValue::Exact(input))
1320
    }
    #[must_use]
    pub const fn const_max_height(input: LayoutMaxHeight) -> Self {
        Self::MaxHeight(LayoutMaxHeightValue::Exact(input))
    }
    #[must_use]
9706
    pub const fn const_position(input: LayoutPosition) -> Self {
9706
        Self::Position(LayoutPositionValue::Exact(input))
9706
    }
    #[must_use]
3780
    pub const fn const_z_index(input: LayoutZIndex) -> Self {
3780
        Self::ZIndex(LayoutZIndexValue::Exact(input))
3780
    }
    #[must_use]
6760
    pub const fn const_top(input: LayoutTop) -> Self {
6760
        Self::Top(LayoutTopValue::Exact(input))
6760
    }
    #[must_use]
1885
    pub const fn const_right(input: LayoutRight) -> Self {
1885
        Self::Right(LayoutRightValue::Exact(input))
1885
    }
    #[must_use]
6981
    pub const fn const_left(input: LayoutLeft) -> Self {
6981
        Self::Left(LayoutLeftValue::Exact(input))
6981
    }
    #[must_use]
1885
    pub const fn const_bottom(input: LayoutInsetBottom) -> Self {
1885
        Self::Bottom(LayoutInsetBottomValue::Exact(input))
1885
    }
    #[must_use]
1656
    pub const fn const_flex_wrap(input: LayoutFlexWrap) -> Self {
1656
        Self::FlexWrap(LayoutFlexWrapValue::Exact(input))
1656
    }
    #[must_use]
227088
    pub const fn const_flex_direction(input: LayoutFlexDirection) -> Self {
227088
        Self::FlexDirection(LayoutFlexDirectionValue::Exact(input))
227088
    }
    #[must_use]
473412
    pub const fn const_flex_grow(input: LayoutFlexGrow) -> Self {
473412
        Self::FlexGrow(LayoutFlexGrowValue::Exact(input))
473412
    }
    #[must_use]
71916
    pub const fn const_flex_shrink(input: LayoutFlexShrink) -> Self {
71916
        Self::FlexShrink(LayoutFlexShrinkValue::Exact(input))
71916
    }
    #[must_use]
118572
    pub const fn const_justify_content(input: LayoutJustifyContent) -> Self {
118572
        Self::JustifyContent(LayoutJustifyContentValue::Exact(input))
118572
    }
    #[must_use]
203928
    pub const fn const_align_items(input: LayoutAlignItems) -> Self {
203928
        Self::AlignItems(LayoutAlignItemsValue::Exact(input))
203928
    }
    #[must_use]
    pub const fn const_align_content(input: LayoutAlignContent) -> Self {
        Self::AlignContent(LayoutAlignContentValue::Exact(input))
    }
    #[must_use]
858234
    pub const fn const_background_content(input: StyleBackgroundContentVec) -> Self {
858234
        Self::BackgroundContent(StyleBackgroundContentVecValue::Exact(input))
858234
    }
    #[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))
    }
    #[must_use]
13596
    pub const fn const_overflow_x(input: LayoutOverflow) -> Self {
13596
        Self::OverflowX(LayoutOverflowValue::Exact(input))
13596
    }
    #[must_use]
11616
    pub const fn const_overflow_y(input: LayoutOverflow) -> Self {
11616
        Self::OverflowY(LayoutOverflowValue::Exact(input))
11616
    }
    #[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))
    }
    #[must_use]
261168
    pub const fn const_padding_top(input: LayoutPaddingTop) -> Self {
261168
        Self::PaddingTop(LayoutPaddingTopValue::Exact(input))
261168
    }
    #[must_use]
165936
    pub const fn const_padding_left(input: LayoutPaddingLeft) -> Self {
165936
        Self::PaddingLeft(LayoutPaddingLeftValue::Exact(input))
165936
    }
    #[must_use]
165600
    pub const fn const_padding_right(input: LayoutPaddingRight) -> Self {
165600
        Self::PaddingRight(LayoutPaddingRightValue::Exact(input))
165600
    }
    #[must_use]
156576
    pub const fn const_padding_bottom(input: LayoutPaddingBottom) -> Self {
156576
        Self::PaddingBottom(LayoutPaddingBottomValue::Exact(input))
156576
    }
    #[must_use]
626724
    pub const fn const_margin_top(input: LayoutMarginTop) -> Self {
626724
        Self::MarginTop(LayoutMarginTopValue::Exact(input))
626724
    }
    #[must_use]
40740
    pub const fn const_margin_left(input: LayoutMarginLeft) -> Self {
40740
        Self::MarginLeft(LayoutMarginLeftValue::Exact(input))
40740
    }
    #[must_use]
2208
    pub const fn const_margin_right(input: LayoutMarginRight) -> Self {
2208
        Self::MarginRight(LayoutMarginRightValue::Exact(input))
2208
    }
    #[must_use]
492864
    pub const fn const_margin_bottom(input: LayoutMarginBottom) -> Self {
492864
        Self::MarginBottom(LayoutMarginBottomValue::Exact(input))
492864
    }
    #[must_use]
167520
    pub const fn const_border_top_left_radius(input: StyleBorderTopLeftRadius) -> Self {
167520
        Self::BorderTopLeftRadius(StyleBorderTopLeftRadiusValue::Exact(input))
167520
    }
    #[must_use]
167484
    pub const fn const_border_top_right_radius(input: StyleBorderTopRightRadius) -> Self {
167484
        Self::BorderTopRightRadius(StyleBorderTopRightRadiusValue::Exact(input))
167484
    }
    #[must_use]
168336
    pub const fn const_border_bottom_left_radius(input: StyleBorderBottomLeftRadius) -> Self {
168336
        Self::BorderBottomLeftRadius(StyleBorderBottomLeftRadiusValue::Exact(input))
168336
    }
    #[must_use]
168336
    pub const fn const_border_bottom_right_radius(input: StyleBorderBottomRightRadius) -> Self {
168336
        Self::BorderBottomRightRadius(StyleBorderBottomRightRadiusValue::Exact(input))
168336
    }
    #[must_use]
275015
    pub const fn const_border_top_color(input: StyleBorderTopColor) -> Self {
275015
        Self::BorderTopColor(StyleBorderTopColorValue::Exact(input))
275015
    }
    #[must_use]
349011
    pub const fn const_border_right_color(input: StyleBorderRightColor) -> Self {
349011
        Self::BorderRightColor(StyleBorderRightColorValue::Exact(input))
349011
    }
    #[must_use]
235677
    pub const fn const_border_left_color(input: StyleBorderLeftColor) -> Self {
235677
        Self::BorderLeftColor(StyleBorderLeftColorValue::Exact(input))
235677
    }
    #[must_use]
357136
    pub const fn const_border_bottom_color(input: StyleBorderBottomColor) -> Self {
357136
        Self::BorderBottomColor(StyleBorderBottomColorValue::Exact(input))
357136
    }
    #[must_use]
125004
    pub const fn const_border_top_style(input: StyleBorderTopStyle) -> Self {
125004
        Self::BorderTopStyle(StyleBorderTopStyleValue::Exact(input))
125004
    }
    #[must_use]
131748
    pub const fn const_border_right_style(input: StyleBorderRightStyle) -> Self {
131748
        Self::BorderRightStyle(StyleBorderRightStyleValue::Exact(input))
131748
    }
    #[must_use]
84864
    pub const fn const_border_left_style(input: StyleBorderLeftStyle) -> Self {
84864
        Self::BorderLeftStyle(StyleBorderLeftStyleValue::Exact(input))
84864
    }
    #[must_use]
160788
    pub const fn const_border_bottom_style(input: StyleBorderBottomStyle) -> Self {
160788
        Self::BorderBottomStyle(StyleBorderBottomStyleValue::Exact(input))
160788
    }
    #[must_use]
140907
    pub const fn const_border_top_width(input: LayoutBorderTopWidth) -> Self {
140907
        Self::BorderTopWidth(LayoutBorderTopWidthValue::Exact(input))
140907
    }
    #[must_use]
148187
    pub const fn const_border_right_width(input: LayoutBorderRightWidth) -> Self {
148187
        Self::BorderRightWidth(LayoutBorderRightWidthValue::Exact(input))
148187
    }
    #[must_use]
97396
    pub const fn const_border_left_width(input: LayoutBorderLeftWidth) -> Self {
97396
        Self::BorderLeftWidth(LayoutBorderLeftWidthValue::Exact(input))
97396
    }
    #[must_use]
179647
    pub const fn const_border_bottom_width(input: LayoutBorderBottomWidth) -> Self {
179647
        Self::BorderBottomWidth(LayoutBorderBottomWidthValue::Exact(input))
179647
    }
    #[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)))
    }
    #[must_use]
128280
    pub const fn const_opacity(input: StyleOpacity) -> Self {
128280
        Self::Opacity(StyleOpacityValue::Exact(input))
128280
    }
    #[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::OverscrollBehaviorX(p) => format!(
            "CssProperty::OverscrollBehaviorX({})",
            print_css_property_value(p, tabs, "OverscrollBehavior")
        ),
        CssProperty::OverscrollBehaviorY(p) => format!(
            "CssProperty::OverscrollBehaviorY({})",
            print_css_property_value(p, tabs, "OverscrollBehavior")
        ),
        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::SpatialNavigationAction(p) => format!(
            "CssProperty::SpatialNavigationAction({})",
            print_css_property_value(p, tabs, "StyleSpatialNavigationAction")
        ),
        CssProperty::SpatialNavigationContain(p) => format!(
            "CssProperty::SpatialNavigationContain({})",
            print_css_property_value(p, tabs, "StyleSpatialNavigationContain")
        ),
        CssProperty::AppRegion(p) => format!(
            "CssProperty::AppRegion({})",
            print_css_property_value(p, tabs, "StyleAppRegion")
        ),
        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_a_solid_background_colour_tweens_and_a_gradient_jumps() {
        use crate::props::style::background::{LinearGradient, StyleBackgroundContent as B};
        let r = resolver();
        let solid = |c: ColorU| CssProperty::background_content(vec![B::Color(c)].into());
        let off = ColorU {
            r: 200,
            g: 200,
            b: 200,
            a: 255,
        };
        let on = ColorU {
            r: 0,
            g: 100,
            b: 255,
            a: 255,
        };
        // A switch track fading from its off to its on colour passes through
        // the colours in between instead of snapping at the half-way mark.
        let mid = solid(off).interpolate(&solid(on), 0.5, &r);
        let CssProperty::BackgroundContent(CssPropertyValue::Exact(layers)) = &mid else {
            panic!("expected an exact background, got {mid:?}");
        };
        let [B::Color(c)] = layers.as_slice() else {
            panic!("expected one solid colour layer, got {layers:?}");
        };
        assert!(
            (99..=101).contains(&c.r) && (149..=151).contains(&c.g) && (227..=228).contains(&c.b),
            "the half-way colour lies between the ends, got {c:?}"
        );
        // A gradient has no colour to tween: it keeps the nearer endpoint.
        let gradient = CssProperty::background_content(
            vec![B::LinearGradient(LinearGradient::default())].into(),
        );
        assert_eq!(solid(off).interpolate(&gradient, 0.25, &r), solid(off));
        assert_eq!(solid(off).interpolate(&gradient, 0.75, &r), gradient);
    }
    #[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()
            );
        }
    }
}