@geastack/engine 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ui/tree_style.cpp CHANGED
@@ -30,6 +30,7 @@ bool nodeParticipatesInMountedTree(const TreeState &state, int node)
30
30
  bool isTransformProperty(Property prop)
31
31
  {
32
32
  switch (prop) {
33
+ #if GEA_CSS_TRANSFORMS
33
34
  case Property::RotateAngle:
34
35
  case Property::RotateAxisX:
35
36
  case Property::RotateAxisY:
@@ -60,6 +61,7 @@ bool isTransformProperty(Property prop)
60
61
  case Property::PerspectiveOriginX:
61
62
  case Property::PerspectiveOriginY:
62
63
  return true;
64
+ #endif
63
65
  default:
64
66
  return false;
65
67
  }
@@ -70,21 +72,33 @@ bool isLayoutProperty(Property prop)
70
72
  switch (prop) {
71
73
  case Property::FlexLineCount:
72
74
  case Property::AspectRatio:
75
+ #if GEA_CSS_TRANSFORMS
73
76
  case Property::TranslatePresent:
74
77
  case Property::TransformPresent:
75
78
  case Property::RotatePresent:
76
79
  case Property::ScalePresent:
80
+ #endif
77
81
  case Property::FilterPresent:
78
82
  case Property::Display:
79
83
  case Property::FlexDirection:
80
84
  case Property::BoxSizing:
85
+ #if GEA_CSS_FLOATS
81
86
  case Property::Float:
87
+ #endif
82
88
  case Property::MarginTrim:
89
+ #if GEA_CSS_FLOATS
83
90
  case Property::Clear:
91
+ #endif
92
+ #if GEA_CSS_WRITING_MODE
84
93
  case Property::WritingMode:
85
94
  case Property::Direction:
95
+ #endif
96
+ #if GEA_CSS_AXIS_GAP
86
97
  case Property::RowGap:
98
+ #endif
99
+ #if GEA_CSS_AXIS_GAP
87
100
  case Property::ColumnGap:
101
+ #endif
88
102
  case Property::RowGapPercent:
89
103
  case Property::ColumnGapPercent:
90
104
  case Property::MarginTopAuto:
@@ -107,10 +121,12 @@ bool isLayoutProperty(Property prop)
107
121
  case Property::AlignItems:
108
122
  case Property::JustifyItems:
109
123
  case Property::JustifySelf:
124
+ #if GEA_CSS_GRID
110
125
  case Property::GridRowStart:
111
126
  case Property::GridColumnStart:
112
127
  case Property::GridRowEnd:
113
128
  case Property::GridColumnEnd:
129
+ #endif
114
130
  case Property::AlignContent:
115
131
  case Property::AlignSelf:
116
132
  case Property::Gap:
@@ -160,7 +176,9 @@ bool isLayoutProperty(Property prop)
160
176
  case Property::Visibility:
161
177
  case Property::WhiteSpace:
162
178
  case Property::TextOverflow:
179
+ #if GEA_UI_IMAGE_NODES
163
180
  case Property::ImageId:
181
+ #endif
164
182
  case Property::ImageFit:
165
183
  return true;
166
184
  default:
@@ -193,7 +211,7 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
193
211
  {
194
212
  auto &perf = refreshPerfStatsMutable();
195
213
  ScopedRefreshStat timer(perf.treeSetStyleUs);
196
- perf.treeSetStyleCalls++;
214
+ GEA_REFRESH_PERF(perf.treeSetStyleCalls++);
197
215
  auto &state = treeState();
198
216
  if (node < 0 || node >= state.nodeCount) return;
199
217
  // Record every authored inline property — including Left/Top — so it survives a
@@ -241,6 +259,8 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
241
259
  overrides.remove(static_cast<Property>(static_cast<int>(Property::MarginTopExpression) + static_cast<int>(prop) - static_cast<int>(Property::MarginTop)));
242
260
  if (prop >= Property::PaddingTop && prop <= Property::PaddingLeft)
243
261
  overrides.remove(static_cast<Property>(static_cast<int>(Property::PaddingTopExpression) + static_cast<int>(prop) - static_cast<int>(Property::PaddingTop)));
262
+ if (prop == Property::Gap)
263
+ for (Property companion : {Property::RowGap, Property::ColumnGap, Property::RowGapPercent, Property::ColumnGapPercent}) overrides.remove(companion);
244
264
  if (prop == Property::BorderWidth)
245
265
  for (Property side : {Property::BorderTopWidth, Property::BorderRightWidth, Property::BorderBottomWidth, Property::BorderLeftWidth}) overrides.remove(side);
246
266
  if (prop == Property::BorderRelief)
@@ -265,6 +285,7 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
265
285
  overrides.set(prop, value);
266
286
  }
267
287
  Node *n = &state.nodes[node];
288
+ ComputedStyle &style = n->mutableStyle();
268
289
  int changed = 0;
269
290
  int prevOpacity = -1;
270
291
  // These previous-bg values feed ONLY the BackgroundColor solid-recolor fast path
@@ -273,254 +294,500 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
273
294
  // layout/paint writes (e.g. 128 left/top writes per frame in bouncing-balls = ~512
274
295
  // wasted pooled reads). Gate them on the property.
275
296
  const bool isBgColorChange = (prop == Property::BackgroundColor);
276
- const style_color_t previousBgColor = isBgColorChange ? n->style.bg_color : style_color_t{};
277
- const uint8_t previousHasBg = isBgColorChange ? n->style.has_bg : 0;
278
- const uint8_t previousBgAlpha = isBgColorChange ? n->style.bg_alpha : 0;
279
- const int8_t previousBgFill = isBgColorChange ? n->style.bg_fill : 0;
280
- const uint8_t previousBgGradientHasMid = isBgColorChange ? rstyle(n->style).bg_gradient_has_mid : 0;
281
- const uint8_t previousBgOverlayGradient = isBgColorChange ? rstyle(n->style).bg_overlay_gradient : 0;
282
- const uint8_t previousBgRadialGradient = isBgColorChange ? rstyle(n->style).bg_radial_gradient : 0;
283
- const uint8_t previousBgGridAxes = isBgColorChange ? rstyle(n->style).bg_grid_axes : 0;
297
+ const style_color_t previousBgColor = isBgColorChange ? style.bg_color : style_color_t{};
298
+ const uint8_t previousHasBg = isBgColorChange ? style.has_bg : 0;
299
+ const uint8_t previousBgAlpha = isBgColorChange ? style.bg_alpha : 0;
300
+ const int8_t previousBgFill = isBgColorChange ? style.bg_fill : 0;
301
+ const uint8_t previousBgGradientHasMid = isBgColorChange ? rstyle(style).bg_gradient_has_mid : 0;
302
+ const uint8_t previousBgOverlayGradient = isBgColorChange ? rstyle(style).bg_overlay_gradient : 0;
303
+ const uint8_t previousBgRadialGradient = isBgColorChange ? rstyle(style).bg_radial_gradient : 0;
304
+ const uint8_t previousBgGridAxes = isBgColorChange ? rstyle(style).bg_grid_axes : 0;
284
305
  switch (prop) {
285
306
  case Property::Display:
286
307
  // Any application of the `display` property is explicit authoring — record
287
308
  // it so the inline-formatting heuristic treats e.g. `display:block` on a
288
309
  // <span> as block-level (stacks) rather than its default inline behaviour.
289
- if (!n->style.display_explicit) { n->style.display_explicit = 1; changed = 1; }
290
- if (n->style.display != value) { n->style.display = value; changed = 1; }
310
+ #if GEA_CSS_DISPLAY_EXPLICIT
311
+ if (!style.display_explicit) { style.display_explicit = 1; changed = 1; }
312
+ #endif
313
+ if (style.display != value) { style.display = value; changed = 1; }
291
314
  break;
315
+ #if GEA_CSS_FLEX_DIRECTION
292
316
  case Property::FlexDirection:
293
- if (!n->style.flex_direction_explicit) {
294
- n->style.flex_direction_explicit = 1;
295
- changed = 1;
296
- }
297
- if (n->style.flex_direction != value) {
298
- n->style.flex_direction = value;
299
- changed = 1;
300
- }
301
- break;
302
- case Property::BoxSizing: if (n->style.box_sizing != value) { n->style.box_sizing = value; changed = 1; } break;
303
- case Property::Float: if (n->style.float_side != value) { n->style.float_side = value; changed = 1; } break;
304
- case Property::AspectRatio: if (rstyle(n->style).aspect_ratio != value) { rstyleMut(n->style).aspect_ratio = value; changed = 1; } break;
305
- case Property::Containment: if (rstyle(n->style).containment != value) { rstyleMut(n->style).containment = value; changed = 1; } break;
306
- case Property::FlexLineCount: if (rstyle(n->style).flex_line_count != value) { rstyleMut(n->style).flex_line_count = value; changed = 1; } break;
307
- case Property::MarginTrim: if (rstyle(n->style).margin_trim != value) { rstyleMut(n->style).margin_trim = value; changed = 1; } break;
308
- case Property::Clear: if (n->style.clear_side != value) { n->style.clear_side = value; changed = 1; } break;
309
- case Property::Direction: if (n->style.direction != value) { n->style.direction = value; changed = 1; } break;
310
- case Property::WritingMode: if (n->style.writing_mode != value) { n->style.writing_mode = value; changed = 1; } break;
311
- case Property::RowGap: if (n->style.row_gap != value) { n->style.row_gap = value; changed = 1; } break;
312
- case Property::ColumnGap: if (n->style.column_gap != value) { n->style.column_gap = value; changed = 1; } break;
313
- case Property::RowGapPercent: if (n->style.row_gap_percent != value) { n->style.row_gap_percent = value; changed = 1; } break;
314
- case Property::ColumnGapPercent: if (n->style.column_gap_percent != value) { n->style.column_gap_percent = value; changed = 1; } break;
315
- case Property::MarginTopAuto: { const auto mask = (n->style.margin_auto & ~1) | (value ? 1 : 0); if (mask != n->style.margin_auto) { n->style.margin_auto = mask; changed = 1; } break; }
316
- case Property::MarginRightAuto: { const auto mask = (n->style.margin_auto & ~2) | (value ? 2 : 0); if (mask != n->style.margin_auto) { n->style.margin_auto = mask; changed = 1; } break; }
317
- case Property::MarginBottomAuto: { const auto mask = (n->style.margin_auto & ~4) | (value ? 4 : 0); if (mask != n->style.margin_auto) { n->style.margin_auto = mask; changed = 1; } break; }
318
- case Property::MarginLeftAuto: { const auto mask = (n->style.margin_auto & ~8) | (value ? 8 : 0); if (mask != n->style.margin_auto) { n->style.margin_auto = mask; changed = 1; } break; }
319
- case Property::MarginTopExpression: if (rstyle(n->style).margin_expression[0] != value) { rstyleMut(n->style).margin_expression[0] = value; changed = 1; } break;
320
- case Property::MarginRightExpression: if (rstyle(n->style).margin_expression[1] != value) { rstyleMut(n->style).margin_expression[1] = value; changed = 1; } break;
321
- case Property::MarginBottomExpression: if (rstyle(n->style).margin_expression[2] != value) { rstyleMut(n->style).margin_expression[2] = value; changed = 1; } break;
322
- case Property::MarginLeftExpression: if (rstyle(n->style).margin_expression[3] != value) { rstyleMut(n->style).margin_expression[3] = value; changed = 1; } break;
323
- case Property::PaddingTopExpression: if (rstyle(n->style).padding_expression[0] != value) { rstyleMut(n->style).padding_expression[0] = value; changed = 1; } break;
324
- case Property::PaddingRightExpression: if (rstyle(n->style).padding_expression[1] != value) { rstyleMut(n->style).padding_expression[1] = value; changed = 1; } break;
325
- case Property::PaddingBottomExpression: if (rstyle(n->style).padding_expression[2] != value) { rstyleMut(n->style).padding_expression[2] = value; changed = 1; } break;
326
- case Property::PaddingLeftExpression: if (rstyle(n->style).padding_expression[3] != value) { rstyleMut(n->style).padding_expression[3] = value; changed = 1; } break;
327
- case Property::WidthExpression: if (n->style.width_expression != value) { n->style.width_expression = value; n->style.width = n->style.width_percent = kUnset; changed = 1; } break;
328
- case Property::HeightExpression: if (n->style.height_expression != value) { n->style.height_expression = value; n->style.height = n->style.height_percent = kUnset; changed = 1; } break;
329
- case Property::Order: if (n->style.order != value) { n->style.order = value; changed = 1; } break;
330
- case Property::FlexWrap: if (n->style.flex_wrap != value) { n->style.flex_wrap = value; changed = 1; } break;
331
- case Property::JustifyContent: if (n->style.justify_content != value) { n->style.justify_content = value; changed = 1; } break;
332
- case Property::AlignItems: if (n->style.align_items != value) { n->style.align_items = value; changed = 1; } break;
333
- case Property::JustifyItems: if (n->style.justify_items != value) { n->style.justify_items = value; changed = 1; } break;
334
- case Property::AlignContent: if (n->style.align_content != value) { n->style.align_content = value; changed = 1; } break;
335
- case Property::AlignSelf: if (n->style.align_self != value) { n->style.align_self = value; changed = 1; } break;
336
- case Property::JustifySelf: if (rstyle(n->style).justify_self != value) { rstyleMut(n->style).justify_self = value; changed = 1; } break;
337
- case Property::GridRowStart: if (rstyle(n->style).grid_line[0] != value) { rstyleMut(n->style).grid_line[0] = value; changed = 1; } break;
338
- case Property::GridColumnStart: if (rstyle(n->style).grid_line[1] != value) { rstyleMut(n->style).grid_line[1] = value; changed = 1; } break;
339
- case Property::GridRowEnd: if (rstyle(n->style).grid_line[2] != value) { rstyleMut(n->style).grid_line[2] = value; changed = 1; } break;
340
- case Property::GridColumnEnd: if (rstyle(n->style).grid_line[3] != value) { rstyleMut(n->style).grid_line[3] = value; changed = 1; } break;
317
+ if (!style.flex_direction_explicit) {
318
+ style.flex_direction_explicit = 1;
319
+ changed = 1;
320
+ }
321
+ if (style.flex_direction != value) {
322
+ style.flex_direction = value;
323
+ changed = 1;
324
+ }
325
+ break;
326
+ #endif
327
+ #if GEA_CSS_BOX_SIZING
328
+ case Property::BoxSizing: if (style.box_sizing != value) { style.box_sizing = value; changed = 1; } break;
329
+ #endif
330
+ #if GEA_CSS_FLOATS
331
+ case Property::Float: if (style.float_side != value) { style.float_side = value; changed = 1; } break;
332
+ #endif
333
+ #if GEA_CSS_ASPECT_RATIO
334
+ case Property::AspectRatio: if ((GEA_CSS_ASPECT_RATIO ? rstyle(style).aspect_ratio : 0) != value) { rstyleMut(style).aspect_ratio = value; changed = 1; } break;
335
+ #endif
336
+ #if GEA_CSS_CONTAINMENT
337
+ case Property::Containment: if ((GEA_CSS_CONTAINMENT ? rstyle(style).containment : 0) != value) { rstyleMut(style).containment = value; changed = 1; } break;
338
+ #endif
339
+ #if GEA_CSS_FLEX_LINE_COUNT
340
+ case Property::FlexLineCount: if ((GEA_CSS_FLEX_LINE_COUNT ? rstyle(style).flex_line_count : 1) != value) { rstyleMut(style).flex_line_count = value; changed = 1; } break;
341
+ #endif
342
+ #if GEA_CSS_MARGIN_TRIM
343
+ case Property::MarginTrim: if ((GEA_CSS_MARGIN_TRIM ? rstyle(style).margin_trim : 0) != value) { rstyleMut(style).margin_trim = value; changed = 1; } break;
344
+ #endif
345
+ #if GEA_CSS_FLOATS
346
+ case Property::Clear: if (style.clear_side != value) { style.clear_side = value; changed = 1; } break;
347
+ #endif
348
+ #if GEA_CSS_WRITING_MODE
349
+ case Property::Direction: if (style.direction != value) { style.direction = value; changed = 1; } break;
350
+ case Property::WritingMode: if (style.writing_mode != value) { style.writing_mode = value; changed = 1; } break;
351
+ #endif
352
+ #if GEA_CSS_AXIS_GAP
353
+ case Property::RowGap: if (style.row_gap != value) { style.row_gap = value; changed = 1; } break;
354
+ #endif
355
+ #if GEA_CSS_AXIS_GAP
356
+ case Property::ColumnGap: if (style.column_gap != value) { style.column_gap = value; changed = 1; } break;
357
+ #endif
358
+ #if GEA_CSS_PERCENT_GAP
359
+ case Property::RowGapPercent: if (style.row_gap_percent != value) { style.row_gap_percent = value; changed = 1; } break;
360
+ case Property::ColumnGapPercent: if (style.column_gap_percent != value) { style.column_gap_percent = value; changed = 1; } break;
361
+ #endif
362
+ #if GEA_CSS_MARGIN_AUTO
363
+ case Property::MarginTopAuto: { const auto mask = (style.margin_auto & ~1) | (value ? 1 : 0); if (mask != style.margin_auto) { style.margin_auto = mask; changed = 1; } break; }
364
+ #endif
365
+ #if GEA_CSS_MARGIN_AUTO
366
+ case Property::MarginRightAuto: { const auto mask = (style.margin_auto & ~2) | (value ? 2 : 0); if (mask != style.margin_auto) { style.margin_auto = mask; changed = 1; } break; }
367
+ #endif
368
+ #if GEA_CSS_MARGIN_AUTO
369
+ case Property::MarginBottomAuto: { const auto mask = (style.margin_auto & ~4) | (value ? 4 : 0); if (mask != style.margin_auto) { style.margin_auto = mask; changed = 1; } break; }
370
+ #endif
371
+ #if GEA_CSS_MARGIN_AUTO
372
+ case Property::MarginLeftAuto: { const auto mask = (style.margin_auto & ~8) | (value ? 8 : 0); if (mask != style.margin_auto) { style.margin_auto = mask; changed = 1; } break; }
373
+ #endif
374
+ #if GEA_CSS_BOX_EXPRESSIONS
375
+ case Property::MarginTopExpression: if (rstyle(style).margin_expression[0] != value) { rstyleMut(style).margin_expression[0] = value; changed = 1; } break;
376
+ #endif
377
+ #if GEA_CSS_BOX_EXPRESSIONS
378
+ case Property::MarginRightExpression: if (rstyle(style).margin_expression[1] != value) { rstyleMut(style).margin_expression[1] = value; changed = 1; } break;
379
+ #endif
380
+ #if GEA_CSS_BOX_EXPRESSIONS
381
+ case Property::MarginBottomExpression: if (rstyle(style).margin_expression[2] != value) { rstyleMut(style).margin_expression[2] = value; changed = 1; } break;
382
+ #endif
383
+ #if GEA_CSS_BOX_EXPRESSIONS
384
+ case Property::MarginLeftExpression: if (rstyle(style).margin_expression[3] != value) { rstyleMut(style).margin_expression[3] = value; changed = 1; } break;
385
+ #endif
386
+ #if GEA_CSS_BOX_EXPRESSIONS
387
+ case Property::PaddingTopExpression: if (rstyle(style).padding_expression[0] != value) { rstyleMut(style).padding_expression[0] = value; changed = 1; } break;
388
+ #endif
389
+ #if GEA_CSS_BOX_EXPRESSIONS
390
+ case Property::PaddingRightExpression: if (rstyle(style).padding_expression[1] != value) { rstyleMut(style).padding_expression[1] = value; changed = 1; } break;
391
+ #endif
392
+ #if GEA_CSS_BOX_EXPRESSIONS
393
+ case Property::PaddingBottomExpression: if (rstyle(style).padding_expression[2] != value) { rstyleMut(style).padding_expression[2] = value; changed = 1; } break;
394
+ #endif
395
+ #if GEA_CSS_BOX_EXPRESSIONS
396
+ case Property::PaddingLeftExpression: if (rstyle(style).padding_expression[3] != value) { rstyleMut(style).padding_expression[3] = value; changed = 1; } break;
397
+ #endif
398
+ #if GEA_CSS_WIDTH_EXPRESSIONS
399
+ case Property::WidthExpression:
400
+ if (style.width_expression != value) {
401
+ style.width_expression = value;
402
+ style.width = kUnset;
403
+ #if GEA_CSS_WIDTH_PERCENT
404
+ style.width_percent = kUnset;
405
+ #endif
406
+ changed = 1;
407
+ }
408
+ break;
409
+ #endif
410
+ #if GEA_CSS_HEIGHT_EXPRESSIONS
411
+ case Property::HeightExpression:
412
+ if (style.height_expression != value) {
413
+ style.height_expression = value;
414
+ style.height = kUnset;
415
+ #if GEA_CSS_HEIGHT_PERCENT
416
+ style.height_percent = kUnset;
417
+ #endif
418
+ changed = 1;
419
+ }
420
+ break;
421
+ #endif
422
+ #if GEA_CSS_ORDER
423
+ case Property::Order: if (style.order != value) { style.order = value; changed = 1; } break;
424
+ #endif
425
+ #if GEA_CSS_FLEX_WRAP
426
+ case Property::FlexWrap: if (style.flex_wrap != value) { style.flex_wrap = value; changed = 1; } break;
427
+ #endif
428
+ #if GEA_CSS_JUSTIFY_CONTENT
429
+ case Property::JustifyContent: if (style.justify_content != value) { style.justify_content = value; changed = 1; } break;
430
+ #endif
431
+ #if GEA_CSS_ALIGN_ITEMS
432
+ case Property::AlignItems: if (style.align_items != value) { style.align_items = value; changed = 1; } break;
433
+ #endif
434
+ #if GEA_CSS_JUSTIFY_ITEMS
435
+ case Property::JustifyItems: if (style.justify_items != value) { style.justify_items = value; changed = 1; } break;
436
+ #endif
437
+ #if GEA_CSS_ALIGN_CONTENT
438
+ case Property::AlignContent: if (style.align_content != value) { style.align_content = value; changed = 1; } break;
439
+ #endif
440
+ #if GEA_CSS_ALIGN_SELF
441
+ case Property::AlignSelf: if (style.align_self != value) { style.align_self = value; changed = 1; } break;
442
+ #endif
443
+ #if GEA_CSS_JUSTIFY_SELF
444
+ case Property::JustifySelf: if ((GEA_CSS_JUSTIFY_SELF ? rstyle(style).justify_self : -1) != value) { rstyleMut(style).justify_self = value; changed = 1; } break;
445
+ #endif
446
+ #if GEA_CSS_GRID
447
+ case Property::GridRowStart: if (rstyle(style).grid_line[0] != value) { rstyleMut(style).grid_line[0] = value; changed = 1; } break;
448
+ case Property::GridColumnStart: if (rstyle(style).grid_line[1] != value) { rstyleMut(style).grid_line[1] = value; changed = 1; } break;
449
+ case Property::GridRowEnd: if (rstyle(style).grid_line[2] != value) { rstyleMut(style).grid_line[2] = value; changed = 1; } break;
450
+ case Property::GridColumnEnd: if (rstyle(style).grid_line[3] != value) { rstyleMut(style).grid_line[3] = value; changed = 1; } break;
451
+ #endif
452
+ #if GEA_CSS_GAP
341
453
  case Property::Gap:
342
- if (n->style.gap != value || n->style.row_gap != kUnset || n->style.column_gap != kUnset || n->style.row_gap_percent != kUnset || n->style.column_gap_percent != kUnset) {
343
- n->style.gap = value;
344
- n->style.row_gap = n->style.column_gap = n->style.row_gap_percent = n->style.column_gap_percent = kUnset;
454
+ if (style.gap != value || style.row_gap != kUnset || style.column_gap != kUnset || style.row_gap_percent != kUnset || style.column_gap_percent != kUnset) {
455
+ style.gap = value;
456
+ #if GEA_CSS_AXIS_GAP
457
+ style.row_gap = style.column_gap = kUnset;
458
+ #endif
459
+ #if GEA_CSS_PERCENT_GAP
460
+ style.row_gap_percent = style.column_gap_percent = kUnset;
461
+ #endif
345
462
  changed = 1;
346
463
  }
347
464
  break;
465
+ #endif
348
466
  case Property::Width:
349
- if (n->style.width_expression >= 0) { n->style.width_expression = -1; changed = 1; }
350
- if (n->style.width != value || n->style.width_percent != kUnset) {
351
- n->style.width = value;
352
- n->style.width_percent = kUnset;
467
+ #if GEA_CSS_WIDTH_EXPRESSIONS
468
+ if (style.width_expression >= 0) { style.width_expression = -1; changed = 1; }
469
+ #endif
470
+ if (style.width != value || style.width_percent != kUnset) {
471
+ style.width = value;
472
+ #if GEA_CSS_WIDTH_PERCENT
473
+ style.width_percent = kUnset;
474
+ #endif
353
475
  changed = 1;
354
476
  }
355
477
  break;
356
478
  case Property::Height:
357
- if (n->style.height_expression != -1) { n->style.height_expression = -1; changed = 1; }
358
- if (n->style.height != value || n->style.height_percent != kUnset) {
359
- n->style.height = value;
360
- n->style.height_percent = kUnset;
479
+ #if GEA_CSS_HEIGHT_EXPRESSIONS
480
+ if (style.height_expression != -1) { style.height_expression = -1; changed = 1; }
481
+ #endif
482
+ if (style.height != value || style.height_percent != kUnset) {
483
+ style.height = value;
484
+ #if GEA_CSS_HEIGHT_PERCENT
485
+ style.height_percent = kUnset;
486
+ #endif
361
487
  changed = 1;
362
488
  }
363
489
  break;
364
490
  case Property::WidthPercent:
365
- if (n->style.width_expression >= 0) { n->style.width_expression = -1; changed = 1; }
366
- if (n->style.width_percent != value || n->style.width != kUnset) {
367
- n->style.width_percent = value;
368
- n->style.width = kUnset;
491
+ #if GEA_CSS_WIDTH_EXPRESSIONS
492
+ if (style.width_expression >= 0) { style.width_expression = -1; changed = 1; }
493
+ #endif
494
+ if (style.width_percent != value || style.width != kUnset) {
495
+ #if GEA_CSS_WIDTH_PERCENT
496
+ style.width_percent = value;
497
+ #endif
498
+ style.width = kUnset;
369
499
  changed = 1;
370
500
  }
371
501
  break;
372
502
  case Property::HeightPercent:
373
- if (n->style.height_expression != -1) { n->style.height_expression = -1; changed = 1; }
374
- if (n->style.height_percent != value || n->style.height != kUnset) {
375
- n->style.height_percent = value;
376
- n->style.height = kUnset;
503
+ #if GEA_CSS_HEIGHT_EXPRESSIONS
504
+ if (style.height_expression != -1) { style.height_expression = -1; changed = 1; }
505
+ #endif
506
+ if (style.height_percent != value || style.height != kUnset) {
507
+ #if GEA_CSS_HEIGHT_PERCENT
508
+ style.height_percent = value;
509
+ #endif
510
+ style.height = kUnset;
377
511
  changed = 1;
378
512
  }
379
513
  break;
380
- case Property::MinWidth: if (n->style.min_width != value) { n->style.min_width = value; changed = 1; } break;
381
- case Property::MinHeight: if (n->style.min_height != value) { n->style.min_height = value; changed = 1; } break;
382
- case Property::MaxWidth: if (n->style.max_width != value) { n->style.max_width = value; changed = 1; } break;
383
- case Property::MaxHeight: if (n->style.max_height != value) { n->style.max_height = value; changed = 1; } break;
384
- case Property::Flex: if (n->style.flex != value) { n->style.flex = value; changed = 1; } break;
385
- case Property::FlexShrink: if (n->style.flex_shrink != value) { n->style.flex_shrink = value; changed = 1; } break;
514
+ #if GEA_CSS_MIN_WIDTH
515
+ case Property::MinWidth: if (style.min_width != value) { style.min_width = value; changed = 1; } break;
516
+ #endif
517
+ #if GEA_CSS_MIN_HEIGHT
518
+ case Property::MinHeight: if (style.min_height != value) { style.min_height = value; changed = 1; } break;
519
+ #endif
520
+ #if GEA_CSS_MAX_WIDTH
521
+ case Property::MaxWidth: if (style.max_width != value) { style.max_width = value; changed = 1; } break;
522
+ #endif
523
+ #if GEA_CSS_MAX_HEIGHT
524
+ case Property::MaxHeight: if (style.max_height != value) { style.max_height = value; changed = 1; } break;
525
+ #endif
526
+ #if GEA_CSS_FLEX_FACTORS
527
+ case Property::Flex: if (style.flex != value) { style.flex = value; changed = 1; } break;
528
+ case Property::FlexShrink: if (style.flex_shrink != value) { style.flex_shrink = value; changed = 1; } break;
529
+ #endif
386
530
  case Property::FlexBasis:
387
- if (rstyle(n->style).flex_basis_expression >= 0) { rstyleMut(n->style).flex_basis_expression = -1; changed = 1; }
388
- if (n->style.flex_basis != value) { n->style.flex_basis = value; changed = 1; } break;
531
+ #if GEA_CSS_FLEX_BASIS_EXPRESSIONS
532
+ if (rstyle(style).flex_basis_expression >= 0) { rstyleMut(style).flex_basis_expression = -1; changed = 1; }
533
+ #endif
534
+ #if GEA_CSS_FLEX_BASIS
535
+ if (style.flex_basis != value) { style.flex_basis = value; changed = 1; }
536
+ #endif
537
+ break;
538
+ #if GEA_CSS_FLEX_BASIS_EXPRESSIONS
389
539
  case Property::FlexBasisExpression:
390
- if (rstyle(n->style).flex_basis_expression != value || n->style.flex_basis != kUnset) {
391
- rstyleMut(n->style).flex_basis_expression = value; n->style.flex_basis = kUnset; changed = 1;
540
+ if (rstyle(style).flex_basis_expression != value || style.flex_basis != kUnset) {
541
+ rstyleMut(style).flex_basis_expression = value;
542
+ #if GEA_CSS_FLEX_BASIS
543
+ style.flex_basis = kUnset;
544
+ #endif
545
+ changed = 1;
546
+ }
547
+ break;
548
+ #endif
549
+ #if GEA_CSS_PADDING
550
+ case Property::PaddingTop:
551
+ #if GEA_CSS_BOX_EXPRESSIONS
552
+ if (rstyle(style).padding_expression[0] >= 0) { rstyleMut(style).padding_expression[0] = -1; changed = 1; }
553
+ #endif
554
+ if (style.padding[0] != value) { style.padding[0] = value; changed = 1; } break;
555
+ case Property::PaddingRight:
556
+ #if GEA_CSS_BOX_EXPRESSIONS
557
+ if (rstyle(style).padding_expression[1] >= 0) { rstyleMut(style).padding_expression[1] = -1; changed = 1; }
558
+ #endif
559
+ if (style.padding[1] != value) { style.padding[1] = value; changed = 1; } break;
560
+ case Property::PaddingBottom:
561
+ #if GEA_CSS_BOX_EXPRESSIONS
562
+ if (rstyle(style).padding_expression[2] >= 0) { rstyleMut(style).padding_expression[2] = -1; changed = 1; }
563
+ #endif
564
+ if (style.padding[2] != value) { style.padding[2] = value; changed = 1; } break;
565
+ case Property::PaddingLeft:
566
+ #if GEA_CSS_BOX_EXPRESSIONS
567
+ if (rstyle(style).padding_expression[3] >= 0) { rstyleMut(style).padding_expression[3] = -1; changed = 1; }
568
+ #endif
569
+ if (style.padding[3] != value) { style.padding[3] = value; changed = 1; } break;
570
+ #endif
571
+ #if GEA_CSS_MARGINS
572
+ case Property::MarginTop:
573
+ #if GEA_CSS_BOX_EXPRESSIONS
574
+ if (rstyle(style).margin_expression[0] >= 0) { rstyleMut(style).margin_expression[0] = -1; changed = 1; }
575
+ #endif
576
+ if (style.margin[0] != value || (style.margin_auto & 1)) {
577
+ style.margin[0] = value;
578
+ #if GEA_CSS_MARGIN_AUTO
579
+ style.margin_auto &= ~1;
580
+ #endif
581
+ changed = 1;
392
582
  } break;
393
- case Property::PaddingTop: if (rstyle(n->style).padding_expression[0] >= 0) { rstyleMut(n->style).padding_expression[0] = -1; changed = 1; } if (n->style.padding[0] != value) { n->style.padding[0] = value; changed = 1; } break;
394
- case Property::PaddingRight: if (rstyle(n->style).padding_expression[1] >= 0) { rstyleMut(n->style).padding_expression[1] = -1; changed = 1; } if (n->style.padding[1] != value) { n->style.padding[1] = value; changed = 1; } break;
395
- case Property::PaddingBottom: if (rstyle(n->style).padding_expression[2] >= 0) { rstyleMut(n->style).padding_expression[2] = -1; changed = 1; } if (n->style.padding[2] != value) { n->style.padding[2] = value; changed = 1; } break;
396
- case Property::PaddingLeft: if (rstyle(n->style).padding_expression[3] >= 0) { rstyleMut(n->style).padding_expression[3] = -1; changed = 1; } if (n->style.padding[3] != value) { n->style.padding[3] = value; changed = 1; } break;
397
- case Property::MarginTop: if (rstyle(n->style).margin_expression[0] >= 0) { rstyleMut(n->style).margin_expression[0] = -1; changed = 1; } if (n->style.margin[0] != value || (n->style.margin_auto & 1)) { n->style.margin[0] = value; n->style.margin_auto &= ~1; changed = 1; } break;
398
- case Property::MarginRight: if (rstyle(n->style).margin_expression[1] >= 0) { rstyleMut(n->style).margin_expression[1] = -1; changed = 1; } if (n->style.margin[1] != value || (n->style.margin_auto & 2)) { n->style.margin[1] = value; n->style.margin_auto &= ~2; changed = 1; } break;
399
- case Property::MarginBottom: if (rstyle(n->style).margin_expression[2] >= 0) { rstyleMut(n->style).margin_expression[2] = -1; changed = 1; } if (n->style.margin[2] != value || (n->style.margin_auto & 4)) { n->style.margin[2] = value; n->style.margin_auto &= ~4; changed = 1; } break;
400
- case Property::MarginLeft: if (rstyle(n->style).margin_expression[3] >= 0) { rstyleMut(n->style).margin_expression[3] = -1; changed = 1; } if (n->style.margin[3] != value || (n->style.margin_auto & 8)) { n->style.margin[3] = value; n->style.margin_auto &= ~8; changed = 1; } break;
401
- case Property::Position: if (value == kPositionFixed) state.fixedPositionUsed = true; if (n->style.position != value) { n->style.position = value; changed = 1; } break;
583
+ case Property::MarginRight:
584
+ #if GEA_CSS_BOX_EXPRESSIONS
585
+ if (rstyle(style).margin_expression[1] >= 0) { rstyleMut(style).margin_expression[1] = -1; changed = 1; }
586
+ #endif
587
+ if (style.margin[1] != value || (style.margin_auto & 2)) {
588
+ style.margin[1] = value;
589
+ #if GEA_CSS_MARGIN_AUTO
590
+ style.margin_auto &= ~2;
591
+ #endif
592
+ changed = 1;
593
+ } break;
594
+ case Property::MarginBottom:
595
+ #if GEA_CSS_BOX_EXPRESSIONS
596
+ if (rstyle(style).margin_expression[2] >= 0) { rstyleMut(style).margin_expression[2] = -1; changed = 1; }
597
+ #endif
598
+ if (style.margin[2] != value || (style.margin_auto & 4)) {
599
+ style.margin[2] = value;
600
+ #if GEA_CSS_MARGIN_AUTO
601
+ style.margin_auto &= ~4;
602
+ #endif
603
+ changed = 1;
604
+ } break;
605
+ case Property::MarginLeft:
606
+ #if GEA_CSS_BOX_EXPRESSIONS
607
+ if (rstyle(style).margin_expression[3] >= 0) { rstyleMut(style).margin_expression[3] = -1; changed = 1; }
608
+ #endif
609
+ if (style.margin[3] != value || (style.margin_auto & 8)) {
610
+ style.margin[3] = value;
611
+ #if GEA_CSS_MARGIN_AUTO
612
+ style.margin_auto &= ~8;
613
+ #endif
614
+ changed = 1;
615
+ } break;
616
+ #endif
617
+ case Property::Position: if (value == kPositionFixed) state.fixedPositionUsed = true; if (style.position != value) { style.position = value; changed = 1; } break;
402
618
  case Property::Top:
403
- if (n->style.pos_offsets[0] != value || n->style.pos_offset_percent[0] != kUnset) {
404
- n->style.pos_offsets[0] = value;
405
- n->style.pos_offset_percent[0] = kUnset;
619
+ #if GEA_CSS_POSITION_TOP
620
+ if (GEA_CSS_POSITION_PX_0(style) != value || GEA_CSS_POSITION_PERCENT_0(style) != kUnset) {
621
+ GEA_CSS_POSITION_PX_0(style) = value;
622
+ #if GEA_CSS_POSITION_TOP_PERCENT
623
+ GEA_CSS_POSITION_PERCENT_0(style) = kUnset;
624
+ #endif
406
625
  changed = 1;
407
626
  }
627
+ #endif
408
628
  break;
409
629
  case Property::Right:
410
- if (n->style.pos_offsets[1] != value || n->style.pos_offset_percent[1] != kUnset) {
411
- n->style.pos_offsets[1] = value;
412
- n->style.pos_offset_percent[1] = kUnset;
630
+ #if GEA_CSS_POSITION_RIGHT
631
+ if (GEA_CSS_POSITION_PX_1(style) != value || GEA_CSS_POSITION_PERCENT_1(style) != kUnset) {
632
+ GEA_CSS_POSITION_PX_1(style) = value;
633
+ #if GEA_CSS_POSITION_RIGHT_PERCENT
634
+ GEA_CSS_POSITION_PERCENT_1(style) = kUnset;
635
+ #endif
413
636
  changed = 1;
414
637
  }
638
+ #endif
415
639
  break;
416
640
  case Property::Bottom:
417
- if (n->style.pos_offsets[2] != value || n->style.pos_offset_percent[2] != kUnset) {
418
- n->style.pos_offsets[2] = value;
419
- n->style.pos_offset_percent[2] = kUnset;
641
+ #if GEA_CSS_POSITION_BOTTOM
642
+ if (GEA_CSS_POSITION_PX_2(style) != value || GEA_CSS_POSITION_PERCENT_2(style) != kUnset) {
643
+ GEA_CSS_POSITION_PX_2(style) = value;
644
+ #if GEA_CSS_POSITION_BOTTOM_PERCENT
645
+ GEA_CSS_POSITION_PERCENT_2(style) = kUnset;
646
+ #endif
420
647
  changed = 1;
421
648
  }
649
+ #endif
422
650
  break;
423
651
  case Property::Left:
424
- if (n->style.pos_offsets[3] != value || n->style.pos_offset_percent[3] != kUnset) {
425
- n->style.pos_offsets[3] = value;
426
- n->style.pos_offset_percent[3] = kUnset;
652
+ #if GEA_CSS_POSITION_LEFT
653
+ if (GEA_CSS_POSITION_PX_3(style) != value || GEA_CSS_POSITION_PERCENT_3(style) != kUnset) {
654
+ GEA_CSS_POSITION_PX_3(style) = value;
655
+ #if GEA_CSS_POSITION_LEFT_PERCENT
656
+ GEA_CSS_POSITION_PERCENT_3(style) = kUnset;
657
+ #endif
427
658
  changed = 1;
428
659
  }
660
+ #endif
429
661
  break;
430
662
  case Property::TopPercent:
431
- if (n->style.pos_offset_percent[0] != value || n->style.pos_offsets[0] != kUnset) {
432
- n->style.pos_offset_percent[0] = value;
433
- n->style.pos_offsets[0] = kUnset;
663
+ #if GEA_CSS_POSITION_TOP_PERCENT
664
+ if (GEA_CSS_POSITION_PERCENT_0(style) != value || GEA_CSS_POSITION_PX_0(style) != kUnset) {
665
+ GEA_CSS_POSITION_PERCENT_0(style) = value;
666
+ #if GEA_CSS_POSITION_TOP
667
+ GEA_CSS_POSITION_PX_0(style) = kUnset;
668
+ #endif
434
669
  changed = 1;
435
670
  }
671
+ #endif
436
672
  break;
437
673
  case Property::RightPercent:
438
- if (n->style.pos_offset_percent[1] != value || n->style.pos_offsets[1] != kUnset) {
439
- n->style.pos_offset_percent[1] = value;
440
- n->style.pos_offsets[1] = kUnset;
674
+ #if GEA_CSS_POSITION_RIGHT_PERCENT
675
+ if (GEA_CSS_POSITION_PERCENT_1(style) != value || GEA_CSS_POSITION_PX_1(style) != kUnset) {
676
+ GEA_CSS_POSITION_PERCENT_1(style) = value;
677
+ #if GEA_CSS_POSITION_RIGHT
678
+ GEA_CSS_POSITION_PX_1(style) = kUnset;
679
+ #endif
441
680
  changed = 1;
442
681
  }
682
+ #endif
443
683
  break;
444
684
  case Property::BottomPercent:
445
- if (n->style.pos_offset_percent[2] != value || n->style.pos_offsets[2] != kUnset) {
446
- n->style.pos_offset_percent[2] = value;
447
- n->style.pos_offsets[2] = kUnset;
685
+ #if GEA_CSS_POSITION_BOTTOM_PERCENT
686
+ if (GEA_CSS_POSITION_PERCENT_2(style) != value || GEA_CSS_POSITION_PX_2(style) != kUnset) {
687
+ GEA_CSS_POSITION_PERCENT_2(style) = value;
688
+ #if GEA_CSS_POSITION_BOTTOM
689
+ GEA_CSS_POSITION_PX_2(style) = kUnset;
690
+ #endif
448
691
  changed = 1;
449
692
  }
693
+ #endif
450
694
  break;
451
695
  case Property::LeftPercent:
452
- if (n->style.pos_offset_percent[3] != value || n->style.pos_offsets[3] != kUnset) {
453
- n->style.pos_offset_percent[3] = value;
454
- n->style.pos_offsets[3] = kUnset;
696
+ #if GEA_CSS_POSITION_LEFT_PERCENT
697
+ if (GEA_CSS_POSITION_PERCENT_3(style) != value || GEA_CSS_POSITION_PX_3(style) != kUnset) {
698
+ GEA_CSS_POSITION_PERCENT_3(style) = value;
699
+ #if GEA_CSS_POSITION_LEFT
700
+ GEA_CSS_POSITION_PX_3(style) = kUnset;
701
+ #endif
455
702
  changed = 1;
456
703
  }
704
+ #endif
457
705
  break;
706
+ #if GEA_CSS_Z_INDEX
458
707
  case Property::ZIndex: {
459
708
  const bool automatic = value == kZIndexAuto;
460
709
  const int level = automatic ? 0 : std::clamp(value, -32768, 32767);
461
- if (n->style.z_index != level || n->style.z_index_auto != automatic) {
462
- n->style.z_index = level; n->style.z_index_auto = automatic; changed = 1;
710
+ if (style.z_index != level || style.z_index_auto != automatic) {
711
+ style.z_index = level; style.z_index_auto = automatic; changed = 1;
463
712
  }
464
713
  break;
465
714
  }
715
+ #endif
466
716
  case Property::BackgroundColor: {
467
717
  style_color_t next = StyleValues::pixelFromStyleValue(value);
468
- if (n->style.bg_color != next) { n->style.bg_color = next; changed = 1; }
469
- if (n->style.bg_alpha != 255) { n->style.bg_alpha = 255; changed = 1; }
718
+ if (style.bg_color != next) { style.bg_color = next; changed = 1; }
719
+ if (style.bg_alpha != 255) { style.bg_alpha = 255; changed = 1; }
470
720
  break;
471
721
  }
472
722
  case Property::BackgroundAlpha: {
473
723
  const uint8_t alpha = static_cast<uint8_t>(std::clamp(value, 0, 255));
474
- if (n->style.bg_alpha != alpha) { n->style.bg_alpha = alpha; changed = 1; }
724
+ if (style.bg_alpha != alpha) { style.bg_alpha = alpha; changed = 1; }
475
725
  break;
476
726
  }
477
- case Property::BackgroundClip: if (rstyle(n->style).bg_clip != value) { rstyleMut(n->style).bg_clip = value; changed = 1; } break;
478
- case Property::BackgroundSizeList: if (rstyle(n->style).bg_size_list != value) { rstyleMut(n->style).bg_size_list = value; changed = 1; } break;
479
- case Property::BackgroundPositionList: if (rstyle(n->style).bg_position_list != value) { rstyleMut(n->style).bg_position_list = value; changed = 1; } break;
480
- case Property::BackgroundRepeatList: if (rstyle(n->style).bg_repeat_list != value) { rstyleMut(n->style).bg_repeat_list = value; changed = 1; } break;
481
- case Property::BackgroundAttachmentList: if (rstyle(n->style).bg_attachment_list != value) { rstyleMut(n->style).bg_attachment_list = value; changed = 1; } break;
482
- case Property::BackgroundOriginList: if (rstyle(n->style).bg_origin_list != value) { rstyleMut(n->style).bg_origin_list = value; changed = 1; } break;
727
+ #if GEA_CSS_BACKGROUND_LAYERS
728
+ case Property::BackgroundClip: if (rstyle(style).bg_clip != value) { rstyleMut(style).bg_clip = value; changed = 1; } break;
729
+ case Property::BackgroundSizeList: if (rstyle(style).bg_size_list != value) { rstyleMut(style).bg_size_list = value; changed = 1; } break;
730
+ case Property::BackgroundPositionList: if (rstyle(style).bg_position_list != value) { rstyleMut(style).bg_position_list = value; changed = 1; } break;
731
+ case Property::BackgroundRepeatList: if (rstyle(style).bg_repeat_list != value) { rstyleMut(style).bg_repeat_list = value; changed = 1; } break;
732
+ case Property::BackgroundAttachmentList: if (rstyle(style).bg_attachment_list != value) { rstyleMut(style).bg_attachment_list = value; changed = 1; } break;
733
+ case Property::BackgroundOriginList: if (rstyle(style).bg_origin_list != value) { rstyleMut(style).bg_origin_list = value; changed = 1; } break;
483
734
 
735
+ #endif
484
736
  case Property::BackgroundImage:
485
- changed = StyleValues::applyBackgroundImage(n->style, value, node);
737
+ changed = StyleValues::applyBackgroundImage(style, value, node);
486
738
  break;
487
- case Property::HasBackground: if (n->style.has_bg != value) { n->style.has_bg = value; changed = 1; } break;
739
+ case Property::HasBackground: if (style.has_bg != value) { style.has_bg = value; changed = 1; } break;
740
+ #if GEA_CSS_ACTIVE_BACKGROUND
488
741
  case Property::ActiveBackgroundColor: {
489
742
  style_color_t next = StyleValues::pixelFromStyleValue(value);
490
- if (n->style.active_bg_color != next) { n->style.active_bg_color = next; changed = 1; }
743
+ if (style.active_bg_color != next) { style.active_bg_color = next; changed = 1; }
491
744
  break;
492
745
  }
493
- case Property::HasActiveBackground: if (n->style.has_active_bg != value) { n->style.has_active_bg = value; changed = 1; } break;
746
+ #endif
747
+ #if GEA_CSS_ACTIVE_BACKGROUND
748
+ case Property::HasActiveBackground: if (style.has_active_bg != value) { style.has_active_bg = value; changed = 1; } break;
749
+ #endif
494
750
  case Property::Color: {
495
751
  style_color_t next = StyleValues::pixelFromStyleValue(value);
496
- if (n->style.text_color != next) { n->style.text_color = next; changed = 1; }
497
- if (n->style.text_alpha != 255) { n->style.text_alpha = 255; changed = 1; }
752
+ if (style.text_color != next) { style.text_color = next; changed = 1; }
753
+ #if GEA_CSS_TEXT_ALPHA
754
+ if (style.text_alpha != 255) { style.text_alpha = 255; changed = 1; }
755
+ #endif
498
756
  break;
499
757
  }
758
+ #if GEA_CSS_OPACITY
500
759
  case Property::Opacity: {
501
760
  uint8_t next = (uint8_t)value;
502
- if (n->style.opacity != next) { prevOpacity = n->style.opacity; n->style.opacity = next; changed = 1; }
761
+ if (style.opacity != next) { prevOpacity = style.opacity; style.opacity = next; changed = 1; }
503
762
  break;
504
763
  }
764
+ #endif
765
+ #if GEA_CSS_BLINK
505
766
  case Property::BlinkInterval:
506
767
  value = value > 0 ? value : 0;
507
- if (n->style.blink_interval_ms != value) {
508
- n->style.blink_interval_ms = value;
509
- n->style.blink_started_ms = state.lastFrameMs;
510
- n->style.blink_visible = 1;
768
+ if (style.blink_interval_ms != value) {
769
+ style.blink_interval_ms = value;
770
+ style.blink_started_ms = state.lastFrameMs;
771
+ style.blink_visible = 1;
511
772
  changed = 1;
512
773
  }
513
774
  break;
775
+ #endif
514
776
  case Property::ColorAlpha: {
777
+ #if GEA_CSS_TEXT_ALPHA
515
778
  const uint8_t alpha = static_cast<uint8_t>(std::clamp(value, 0, 255));
516
- if (n->style.text_alpha != alpha) { n->style.text_alpha = alpha; changed = 1; }
779
+ if (style.text_alpha != alpha) { style.text_alpha = alpha; changed = 1; }
780
+ #endif
517
781
  break;
518
782
  }
519
783
  case Property::BorderAlpha: {
784
+ #if GEA_CSS_BORDER_ALPHA
520
785
  const uint8_t alpha = static_cast<uint8_t>(std::clamp(value, 0, 255));
521
- if (n->style.border_alpha != alpha) { n->style.border_alpha = alpha; changed = 1; }
786
+ if (style.border_alpha != alpha) { style.border_alpha = alpha; changed = 1; }
787
+ #endif
522
788
  break;
523
789
  }
790
+ #if GEA_CSS_SIDE_BORDERS
524
791
  case Property::BorderTopAlpha:
525
792
  case Property::BorderRightAlpha:
526
793
  case Property::BorderBottomAlpha:
@@ -528,25 +795,35 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
528
795
  {
529
796
  const int side = static_cast<int>(prop) - static_cast<int>(Property::BorderTopAlpha);
530
797
  const uint8_t alpha = static_cast<uint8_t>(std::clamp(value, 0, 255));
531
- if (rstyle(n->style).border_side_alpha[side] != alpha) { rstyleMut(n->style).border_side_alpha[side] = alpha; changed = 1; }
798
+ if (rstyle(style).border_side_alpha[side] != alpha) { rstyleMut(style).border_side_alpha[side] = alpha; changed = 1; }
532
799
  break;
533
800
  }
534
- case Property::BorderColorCurrent: changed |= setBorderColorBinding(n->style, -1, value != 0); break;
801
+ #endif
802
+ case Property::BorderColorCurrent: changed |= setBorderColorBinding(style, -1, value != 0); break;
803
+ #if GEA_CSS_SIDE_BORDERS
535
804
  case Property::BorderTopColorCurrent:
536
805
  case Property::BorderRightColorCurrent:
537
806
  case Property::BorderBottomColorCurrent:
538
807
  case Property::BorderLeftColorCurrent:
539
- changed |= setBorderColorBinding(n->style, static_cast<int>(prop) - static_cast<int>(Property::BorderTopColorCurrent), value != 0);
808
+ changed |= setBorderColorBinding(style, static_cast<int>(prop) - static_cast<int>(Property::BorderTopColorCurrent), value != 0);
540
809
  break;
541
- case Property::BorderWidth: changed |= setComputedBorderWidth(n->style, -1, value, n->parent >= 0 ? &state.nodes[n->parent].style : nullptr); break;
810
+ #endif
811
+ case Property::BorderWidth: changed |= setComputedBorderWidth(style, -1, value, n->parent >= 0 ? &state.nodes[n->parent].computedStyle() : nullptr); break;
812
+ #if GEA_CSS_BORDER_COLORS
542
813
  case Property::BorderColor: {
543
- changed |= setBorderColorBinding(n->style, -1, false);
814
+ changed |= setBorderColorBinding(style, -1, false);
544
815
  style_color_t next = StyleValues::pixelFromStyleValue(value);
545
- if (n->style.border_color != next) { n->style.border_color = next; changed = 1; }
546
- if (n->style.border_alpha != 255) { n->style.border_alpha = 255; changed = 1; }
816
+ if (style.border_color != next) { style.border_color = next; changed = 1; }
817
+ #if GEA_CSS_BORDER_ALPHA
818
+ if (style.border_alpha != 255) { style.border_alpha = 255; changed = 1; }
819
+ #endif
547
820
  break;
548
821
  }
549
- case Property::BorderTopWidth: changed |= setComputedBorderWidth(n->style, 0, value, n->parent >= 0 ? &state.nodes[n->parent].style : nullptr); break;
822
+ #endif
823
+ #if GEA_CSS_SIDE_BORDERS
824
+ case Property::BorderTopWidth: changed |= setComputedBorderWidth(style, 0, value, n->parent >= 0 ? &state.nodes[n->parent].computedStyle() : nullptr); break;
825
+ #endif
826
+ #if GEA_CSS_BORDER_RELIEF
550
827
  case Property::BorderRelief:
551
828
  case Property::BorderTopRelief:
552
829
  case Property::BorderRightRelief:
@@ -554,245 +831,334 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
554
831
  case Property::BorderLeftRelief:
555
832
  for (int side = 0; side < 4; ++side) {
556
833
  if (prop != Property::BorderRelief && side != static_cast<int>(prop) - static_cast<int>(Property::BorderTopRelief)) continue;
557
- if (rstyle(n->style).border_relief[side] != value) {
558
- rstyleMut(n->style).border_relief[side] = static_cast<uint8_t>(value);
834
+ if (rstyle(style).border_relief[side] != value) {
835
+ rstyleMut(style).border_relief[side] = static_cast<uint8_t>(value);
559
836
  changed = 1;
560
837
  }
561
838
  }
562
839
  break;
563
- case Property::BorderRightWidth: changed |= setComputedBorderWidth(n->style, 1, value, n->parent >= 0 ? &state.nodes[n->parent].style : nullptr); break;
564
- case Property::BorderBottomWidth: changed |= setComputedBorderWidth(n->style, 2, value, n->parent >= 0 ? &state.nodes[n->parent].style : nullptr); break;
565
- case Property::BorderLeftWidth: changed |= setComputedBorderWidth(n->style, 3, value, n->parent >= 0 ? &state.nodes[n->parent].style : nullptr); break;
840
+ #endif
841
+ #if GEA_CSS_SIDE_BORDERS
842
+ case Property::BorderRightWidth: changed |= setComputedBorderWidth(style, 1, value, n->parent >= 0 ? &state.nodes[n->parent].computedStyle() : nullptr); break;
843
+ case Property::BorderBottomWidth: changed |= setComputedBorderWidth(style, 2, value, n->parent >= 0 ? &state.nodes[n->parent].computedStyle() : nullptr); break;
844
+ case Property::BorderLeftWidth: changed |= setComputedBorderWidth(style, 3, value, n->parent >= 0 ? &state.nodes[n->parent].computedStyle() : nullptr); break;
566
845
  case Property::BorderTopColor: {
567
- changed |= setBorderColorBinding(n->style, 0, false);
846
+ changed |= setBorderColorBinding(style, 0, false);
568
847
  style_color_t next = StyleValues::pixelFromStyleValue(value);
569
- if (rstyle(n->style).border_side_color[0] != next) { rstyleMut(n->style).border_side_color[0] = next; changed = 1; }
570
- if (rstyle(n->style).border_side_alpha[0] != 255) { rstyleMut(n->style).border_side_alpha[0] = 255; changed = 1; }
848
+ if (rstyle(style).border_side_color[0] != next) { rstyleMut(style).border_side_color[0] = next; changed = 1; }
849
+ if (rstyle(style).border_side_alpha[0] != 255) { rstyleMut(style).border_side_alpha[0] = 255; changed = 1; }
571
850
  break;
572
851
  }
573
852
  case Property::BorderRightColor: {
574
- changed |= setBorderColorBinding(n->style, 1, false);
853
+ changed |= setBorderColorBinding(style, 1, false);
575
854
  style_color_t next = StyleValues::pixelFromStyleValue(value);
576
- if (rstyle(n->style).border_side_color[1] != next) { rstyleMut(n->style).border_side_color[1] = next; changed = 1; }
577
- if (rstyle(n->style).border_side_alpha[1] != 255) { rstyleMut(n->style).border_side_alpha[1] = 255; changed = 1; }
855
+ if (rstyle(style).border_side_color[1] != next) { rstyleMut(style).border_side_color[1] = next; changed = 1; }
856
+ if (rstyle(style).border_side_alpha[1] != 255) { rstyleMut(style).border_side_alpha[1] = 255; changed = 1; }
578
857
  break;
579
858
  }
580
859
  case Property::BorderBottomColor: {
581
- changed |= setBorderColorBinding(n->style, 2, false);
860
+ changed |= setBorderColorBinding(style, 2, false);
582
861
  style_color_t next = StyleValues::pixelFromStyleValue(value);
583
- if (rstyle(n->style).border_side_color[2] != next) { rstyleMut(n->style).border_side_color[2] = next; changed = 1; }
584
- if (rstyle(n->style).border_side_alpha[2] != 255) { rstyleMut(n->style).border_side_alpha[2] = 255; changed = 1; }
862
+ if (rstyle(style).border_side_color[2] != next) { rstyleMut(style).border_side_color[2] = next; changed = 1; }
863
+ if (rstyle(style).border_side_alpha[2] != 255) { rstyleMut(style).border_side_alpha[2] = 255; changed = 1; }
585
864
  break;
586
865
  }
587
866
  case Property::BorderLeftColor: {
588
- changed |= setBorderColorBinding(n->style, 3, false);
867
+ changed |= setBorderColorBinding(style, 3, false);
589
868
  style_color_t next = StyleValues::pixelFromStyleValue(value);
590
- if (rstyle(n->style).border_side_color[3] != next) { rstyleMut(n->style).border_side_color[3] = next; changed = 1; }
591
- if (rstyle(n->style).border_side_alpha[3] != 255) { rstyleMut(n->style).border_side_alpha[3] = 255; changed = 1; }
869
+ if (rstyle(style).border_side_color[3] != next) { rstyleMut(style).border_side_color[3] = next; changed = 1; }
870
+ if (rstyle(style).border_side_alpha[3] != 255) { rstyleMut(style).border_side_alpha[3] = 255; changed = 1; }
592
871
  break;
593
872
  }
873
+ #endif
594
874
  case Property::BorderRadiusTopLeft:
595
- if (n->style.border_radius[0] != value || n->style.border_radius_percent[0] != kUnset) {
596
- n->style.border_radius[0] = value;
597
- n->style.border_radius_percent[0] = kUnset;
875
+ if (style.border_radius[GEA_CSS_RADIUS_INDEX(0)] != value || style.border_radius_percent[GEA_CSS_RADIUS_INDEX(0)] != kUnset) {
876
+ style.border_radius[GEA_CSS_RADIUS_INDEX(0)] = value;
877
+ #if GEA_CSS_PERCENT_RADIUS
878
+ style.border_radius_percent[GEA_CSS_RADIUS_INDEX(0)] = kUnset;
879
+ #endif
598
880
  changed = 1;
599
881
  }
600
882
  break;
601
883
  case Property::BorderRadiusTopRight:
602
- if (n->style.border_radius[1] != value || n->style.border_radius_percent[1] != kUnset) {
603
- n->style.border_radius[1] = value;
604
- n->style.border_radius_percent[1] = kUnset;
884
+ if (style.border_radius[GEA_CSS_RADIUS_INDEX(1)] != value || style.border_radius_percent[GEA_CSS_RADIUS_INDEX(1)] != kUnset) {
885
+ style.border_radius[GEA_CSS_RADIUS_INDEX(1)] = value;
886
+ #if GEA_CSS_PERCENT_RADIUS
887
+ style.border_radius_percent[GEA_CSS_RADIUS_INDEX(1)] = kUnset;
888
+ #endif
605
889
  changed = 1;
606
890
  }
607
891
  break;
608
892
  case Property::BorderRadiusBottomRight:
609
- if (n->style.border_radius[2] != value || n->style.border_radius_percent[2] != kUnset) {
610
- n->style.border_radius[2] = value;
611
- n->style.border_radius_percent[2] = kUnset;
893
+ if (style.border_radius[GEA_CSS_RADIUS_INDEX(2)] != value || style.border_radius_percent[GEA_CSS_RADIUS_INDEX(2)] != kUnset) {
894
+ style.border_radius[GEA_CSS_RADIUS_INDEX(2)] = value;
895
+ #if GEA_CSS_PERCENT_RADIUS
896
+ style.border_radius_percent[GEA_CSS_RADIUS_INDEX(2)] = kUnset;
897
+ #endif
612
898
  changed = 1;
613
899
  }
614
900
  break;
615
901
  case Property::BorderRadiusBottomLeft:
616
- if (n->style.border_radius[3] != value || n->style.border_radius_percent[3] != kUnset) {
617
- n->style.border_radius[3] = value;
618
- n->style.border_radius_percent[3] = kUnset;
902
+ if (style.border_radius[GEA_CSS_RADIUS_INDEX(3)] != value || style.border_radius_percent[GEA_CSS_RADIUS_INDEX(3)] != kUnset) {
903
+ style.border_radius[GEA_CSS_RADIUS_INDEX(3)] = value;
904
+ #if GEA_CSS_PERCENT_RADIUS
905
+ style.border_radius_percent[GEA_CSS_RADIUS_INDEX(3)] = kUnset;
906
+ #endif
619
907
  changed = 1;
620
908
  }
621
909
  break;
910
+ #if GEA_CSS_PERCENT_RADIUS
622
911
  case Property::BorderRadiusTopLeftPercent:
623
- if (n->style.border_radius_percent[0] != value || n->style.border_radius[0] != 0) {
624
- n->style.border_radius_percent[0] = value;
625
- n->style.border_radius[0] = 0;
912
+ if (style.border_radius_percent[GEA_CSS_RADIUS_INDEX(0)] != value || style.border_radius[GEA_CSS_RADIUS_INDEX(0)] != 0) {
913
+ style.border_radius_percent[GEA_CSS_RADIUS_INDEX(0)] = value;
914
+ style.border_radius[GEA_CSS_RADIUS_INDEX(0)] = 0;
626
915
  changed = 1;
627
916
  }
628
917
  break;
629
918
  case Property::BorderRadiusTopRightPercent:
630
- if (n->style.border_radius_percent[1] != value || n->style.border_radius[1] != 0) {
631
- n->style.border_radius_percent[1] = value;
632
- n->style.border_radius[1] = 0;
919
+ if (style.border_radius_percent[GEA_CSS_RADIUS_INDEX(1)] != value || style.border_radius[GEA_CSS_RADIUS_INDEX(1)] != 0) {
920
+ style.border_radius_percent[GEA_CSS_RADIUS_INDEX(1)] = value;
921
+ style.border_radius[GEA_CSS_RADIUS_INDEX(1)] = 0;
633
922
  changed = 1;
634
923
  }
635
924
  break;
636
925
  case Property::BorderRadiusBottomRightPercent:
637
- if (n->style.border_radius_percent[2] != value || n->style.border_radius[2] != 0) {
638
- n->style.border_radius_percent[2] = value;
639
- n->style.border_radius[2] = 0;
926
+ if (style.border_radius_percent[GEA_CSS_RADIUS_INDEX(2)] != value || style.border_radius[GEA_CSS_RADIUS_INDEX(2)] != 0) {
927
+ style.border_radius_percent[GEA_CSS_RADIUS_INDEX(2)] = value;
928
+ style.border_radius[GEA_CSS_RADIUS_INDEX(2)] = 0;
640
929
  changed = 1;
641
930
  }
642
931
  break;
643
932
  case Property::BorderRadiusBottomLeftPercent:
644
- if (n->style.border_radius_percent[3] != value || n->style.border_radius[3] != 0) {
645
- n->style.border_radius_percent[3] = value;
646
- n->style.border_radius[3] = 0;
933
+ if (style.border_radius_percent[GEA_CSS_RADIUS_INDEX(3)] != value || style.border_radius[GEA_CSS_RADIUS_INDEX(3)] != 0) {
934
+ style.border_radius_percent[GEA_CSS_RADIUS_INDEX(3)] = value;
935
+ style.border_radius[GEA_CSS_RADIUS_INDEX(3)] = 0;
647
936
  changed = 1;
648
937
  }
649
938
  break;
650
- case Property::FontId: if (n->style.font_id != value) { n->style.font_id = value; changed = 1; } break;
651
- case Property::FontSize: if (n->style.font_size != value) { n->style.font_size = value; changed = 1; } break;
652
- case Property::FontWeight: if (n->style.font_weight != value) { n->style.font_weight = value; changed = 1; } break;
939
+ #endif
940
+ case Property::FontId: if (style.font_id != value) { style.font_id = value; changed = 1; } break;
941
+ case Property::FontSize: if (style.font_size != value) { style.font_size = value; changed = 1; } break;
942
+ #if GEA_CSS_FONT_WEIGHT
943
+ case Property::FontWeight: if (style.font_weight != value) { style.font_weight = value; changed = 1; } break;
944
+ #endif
945
+ #if GEA_CSS_LINE_HEIGHT
653
946
  case Property::LineHeight:
654
- if (n->style.line_height_multiplier >= 0) { n->style.line_height_multiplier = -1; changed = 1; }
655
- if (rstyle(n->style).line_height_expression >= 0) { rstyleMut(n->style).line_height_expression = -1; changed = 1; }
656
- if (n->style.line_height != value) { n->style.line_height = value; changed = 1; } break;
947
+ #if GEA_CSS_LINE_HEIGHT_MULTIPLIER
948
+ if (style.line_height_multiplier >= 0) { style.line_height_multiplier = -1; changed = 1; }
949
+ #endif
950
+ #if GEA_CSS_LINE_HEIGHT_EXPRESSIONS
951
+ if (rstyle(style).line_height_expression >= 0) { rstyleMut(style).line_height_expression = -1; changed = 1; }
952
+ #endif
953
+ if (style.line_height != value) { style.line_height = value; changed = 1; } break;
954
+ #if GEA_CSS_LINE_HEIGHT_EXPRESSIONS
657
955
  case Property::LineHeightExpression: {
658
- if (n->style.line_height_multiplier >= 0) { n->style.line_height_multiplier = -1; changed = 1; }
956
+ #if GEA_CSS_LINE_HEIGHT_MULTIPLIER
957
+ if (style.line_height_multiplier >= 0) { style.line_height_multiplier = -1; changed = 1; }
958
+ #endif
659
959
  const int height = resolveLineHeightExpression(node, value);
660
- if (rstyle(n->style).line_height_expression != value || n->style.line_height != height) {
661
- rstyleMut(n->style).line_height_expression = value; n->style.line_height = height; changed = 1;
960
+ if (rstyle(style).line_height_expression != value || style.line_height != height) {
961
+ rstyleMut(style).line_height_expression = value; style.line_height = height; changed = 1;
662
962
  } break;
663
963
  }
964
+ #endif
965
+ #if GEA_CSS_LINE_HEIGHT_MULTIPLIER
664
966
  case Property::LineHeightMultiplier: {
665
967
  const int height = resolveLineHeightMultiplier(node, value);
666
- if (rstyle(n->style).line_height_expression >= 0) { rstyleMut(n->style).line_height_expression = -1; changed = 1; }
667
- if (n->style.line_height_multiplier != value || n->style.line_height != height) {
668
- n->style.line_height_multiplier = value; n->style.line_height = height; changed = 1;
968
+ #if GEA_CSS_LINE_HEIGHT_EXPRESSIONS
969
+ if (rstyle(style).line_height_expression >= 0) { rstyleMut(style).line_height_expression = -1; changed = 1; }
970
+ #endif
971
+ if (style.line_height_multiplier != value || style.line_height != height) {
972
+ style.line_height_multiplier = value; style.line_height = height; changed = 1;
669
973
  } break;
670
974
  }
671
- case Property::TextAlign: if (n->style.text_align != value) { n->style.text_align = value; changed = 1; } break;
672
- case Property::TextDecoration: if (n->style.text_decoration != value) { n->style.text_decoration = value; changed = 1; } break;
673
- case Property::TextTransform: if (n->style.text_transform != value) { n->style.text_transform = value; changed = 1; } break;
674
- case Property::WhiteSpace: if (n->style.white_space != static_cast<int8_t>(value)) { n->style.white_space = static_cast<int8_t>(value); changed = 1; } break;
675
- case Property::TextOverflow: if (n->style.text_overflow != static_cast<int8_t>(value)) { n->style.text_overflow = static_cast<int8_t>(value); changed = 1; } break;
676
- case Property::TransformStyle: if (rstyle(n->style).transform_preserve_3d != (value != 0)) { rstyleMut(n->style).transform_preserve_3d = value != 0; changed = 1; } break;
677
- case Property::Visibility: if (n->style.visibility != static_cast<int8_t>(value)) { n->style.visibility = static_cast<int8_t>(value); changed = 1; } break;
678
- case Property::Backface: if (n->style.backface_hidden != static_cast<int8_t>(value)) { n->style.backface_hidden = static_cast<int8_t>(value); changed = 1; } break;
679
- case Property::PointerEvents: if (n->style.pointer_events != static_cast<int8_t>(value)) { n->style.pointer_events = static_cast<int8_t>(value); changed = 1; } break;
975
+ #endif
976
+ #endif
977
+ #if GEA_CSS_TEXT_ALIGN
978
+ case Property::TextAlign: if (style.text_align != value) { style.text_align = value; changed = 1; } break;
979
+ #endif
980
+ #if GEA_CSS_TEXT_DECORATION
981
+ case Property::TextDecoration: if (style.text_decoration != value) { style.text_decoration = value; changed = 1; } break;
982
+ #endif
983
+ #if GEA_CSS_TEXT_TRANSFORM
984
+ case Property::TextTransform: if (style.text_transform != value) { style.text_transform = value; changed = 1; } break;
985
+ #endif
986
+ #if GEA_CSS_WHITE_SPACE
987
+ case Property::WhiteSpace: if (style.white_space != static_cast<int8_t>(value)) { style.white_space = static_cast<int8_t>(value); changed = 1; } break;
988
+ #endif
989
+ #if GEA_CSS_TEXT_OVERFLOW
990
+ case Property::TextOverflow: if (style.text_overflow != static_cast<int8_t>(value)) { style.text_overflow = static_cast<int8_t>(value); changed = 1; } break;
991
+ #endif
992
+ #if GEA_CSS_TRANSFORMS
993
+ case Property::TransformStyle: if (rstyle(style).transform_preserve_3d != (value != 0)) { rstyleMut(style).transform_preserve_3d = value != 0; changed = 1; } break;
994
+ #endif
995
+ #if GEA_CSS_VISIBILITY
996
+ case Property::Visibility: if (style.visibility != static_cast<int8_t>(value)) { style.visibility = static_cast<int8_t>(value); changed = 1; } break;
997
+ #endif
998
+ #if GEA_CSS_TRANSFORMS
999
+ case Property::Backface: if (style.backface_hidden != static_cast<int8_t>(value)) { style.backface_hidden = static_cast<int8_t>(value); changed = 1; } break;
1000
+ #endif
1001
+ #if GEA_CSS_POINTER_EVENTS
1002
+ case Property::PointerEvents: if (style.pointer_events != static_cast<int8_t>(value)) { style.pointer_events = static_cast<int8_t>(value); changed = 1; } break;
1003
+ #endif
1004
+ #if GEA_CSS_OVERFLOW_AXES
680
1005
  case Property::Overflow: {
681
1006
  const int8_t next = static_cast<int8_t>(value);
682
- if (n->style.overflow != next || n->style.overflow_x != next || n->style.overflow_y != next) {
683
- n->style.overflow = next;
684
- n->style.overflow_x = next;
685
- n->style.overflow_y = next;
1007
+ if (style.overflow != next || style.overflow_x != next || style.overflow_y != next) {
1008
+ style.overflow = next;
1009
+ style.overflow_x = next;
1010
+ style.overflow_y = next;
686
1011
  changed = 1;
687
1012
  }
688
1013
  break;
689
1014
  }
690
1015
  case Property::OverflowX: {
691
1016
  const int8_t next = static_cast<int8_t>(value);
692
- const int8_t aggregate = aggregateOverflow(next, n->style.overflow_y);
693
- if (n->style.overflow_x != next || n->style.overflow != aggregate) {
694
- n->style.overflow_x = next;
695
- n->style.overflow = aggregate;
1017
+ const int8_t aggregate = aggregateOverflow(next, style.overflow_y);
1018
+ if (style.overflow_x != next || style.overflow != aggregate) {
1019
+ style.overflow_x = next;
1020
+ style.overflow = aggregate;
696
1021
  changed = 1;
697
1022
  }
698
1023
  break;
699
1024
  }
700
1025
  case Property::OverflowY: {
701
1026
  const int8_t next = static_cast<int8_t>(value);
702
- const int8_t aggregate = aggregateOverflow(n->style.overflow_x, next);
703
- if (n->style.overflow_y != next || n->style.overflow != aggregate) {
704
- n->style.overflow_y = next;
705
- n->style.overflow = aggregate;
1027
+ const int8_t aggregate = aggregateOverflow(style.overflow_x, next);
1028
+ if (style.overflow_y != next || style.overflow != aggregate) {
1029
+ style.overflow_y = next;
1030
+ style.overflow = aggregate;
706
1031
  changed = 1;
707
1032
  }
708
1033
  break;
709
1034
  }
1035
+ #else
1036
+ case Property::Overflow:
1037
+ case Property::OverflowX:
1038
+ case Property::OverflowY: {
1039
+ const int8_t next = static_cast<int8_t>(value);
1040
+ if (style.overflow != next) { style.overflow = next; changed = 1; }
1041
+ break;
1042
+ }
1043
+ #endif
1044
+ #if GEA_CSS_MASK
710
1045
  case Property::MaskRightFadeWidth: {
711
1046
  const int16_t next = static_cast<int16_t>(value < 0 ? 0 : value > 32767 ? 32767 : value);
712
- if (n->style.mask_right_fade_width != next) {
713
- n->style.mask_right_fade_width = next;
1047
+ if (style.mask_right_fade_width != next) {
1048
+ style.mask_right_fade_width = next;
714
1049
  changed = 1;
715
1050
  }
716
1051
  break;
717
1052
  }
1053
+ #endif
1054
+ #if GEA_UI_IMAGE_NODES
718
1055
  case Property::ImageId: if (n->image_id != value) { n->image_id = value; changed = 1; } break;
719
- case Property::ImageFit: if (n->style.image_fit != value) { n->style.image_fit = value; changed = 1; } break;
720
- case Property::TransformTranslateOuterAxes: if (rstyle(n->style).transform_translate_outer_axes != value) { rstyleMut(n->style).transform_translate_outer_axes = value; changed = 1; } break;
721
- case Property::RotateAngle: if (rstyle(n->style).rotate_angle != value) { rstyleMut(n->style).rotate_angle = value; changed = 1; } break;
722
- case Property::RotateAxisX: if (rstyle(n->style).rotate_axis_x != value) { rstyleMut(n->style).rotate_axis_x = value; changed = 1; } break;
723
- case Property::RotateAxisY: if (rstyle(n->style).rotate_axis_y != value) { rstyleMut(n->style).rotate_axis_y = value; changed = 1; } break;
724
- case Property::RotateAxisZ: if (rstyle(n->style).rotate_axis_z != value) { rstyleMut(n->style).rotate_axis_z = value; changed = 1; } break;
725
- case Property::ScaleX: if (rstyle(n->style).scale_x != value) { rstyleMut(n->style).scale_x = value; changed = 1; } break;
726
- case Property::ScaleY: if (rstyle(n->style).scale_y != value) { rstyleMut(n->style).scale_y = value; changed = 1; } break;
727
- case Property::ScaleZ: if (rstyle(n->style).scale_z != value) { rstyleMut(n->style).scale_z = value; changed = 1; } break;
728
- case Property::TranslatePresent: if (rstyle(n->style).translate_present != (value != 0)) { rstyleMut(n->style).translate_present = value != 0; changed = 1; } break;
729
- case Property::TranslateX: if (rstyle(n->style).translate_x != value) { rstyleMut(n->style).translate_x = value; changed = 1; } break;
730
- case Property::TranslateY: if (rstyle(n->style).translate_y != value) { rstyleMut(n->style).translate_y = value; changed = 1; } break;
731
- case Property::TranslateZ: if (rstyle(n->style).translate_z != value) { rstyleMut(n->style).translate_z = value; changed = 1; } break;
732
- case Property::TranslateXPercent: if (rstyle(n->style).translate_x_percent != value) { rstyleMut(n->style).translate_x_percent = value; changed = 1; } break;
733
- case Property::TranslateYPercent: if (rstyle(n->style).translate_y_percent != value) { rstyleMut(n->style).translate_y_percent = value; changed = 1; } break;
734
- case Property::TransformPresent: if (rstyle(n->style).transform_present != (value != 0)) { rstyleMut(n->style).transform_present = value != 0; changed = 1; } break;
735
- case Property::RotatePresent: if (rstyle(n->style).rotate_present != (value != 0)) { rstyleMut(n->style).rotate_present = value != 0; changed = 1; } break;
736
- case Property::ScalePresent: if (rstyle(n->style).scale_present != (value != 0)) { rstyleMut(n->style).scale_present = value != 0; changed = 1; } break;
737
- case Property::FilterPresent: if (rstyle(n->style).filter_present != (value != 0)) { rstyleMut(n->style).filter_present = value != 0; changed = 1; } break;
1056
+ #endif
1057
+ #if GEA_CSS_IMAGE_FIT
1058
+ case Property::ImageFit: if (style.image_fit != value) { style.image_fit = value; changed = 1; } break;
1059
+ #endif
1060
+ #if GEA_CSS_TRANSFORMS
1061
+ case Property::TransformTranslateOuterAxes: if (rstyle(style).transform_translate_outer_axes != value) { rstyleMut(style).transform_translate_outer_axes = value; changed = 1; } break;
1062
+ case Property::RotateAngle: if (rstyle(style).rotate_angle != value) { rstyleMut(style).rotate_angle = value; changed = 1; } break;
1063
+ case Property::RotateAxisX: if (rstyle(style).rotate_axis_x != value) { rstyleMut(style).rotate_axis_x = value; changed = 1; } break;
1064
+ case Property::RotateAxisY: if (rstyle(style).rotate_axis_y != value) { rstyleMut(style).rotate_axis_y = value; changed = 1; } break;
1065
+ case Property::RotateAxisZ: if (rstyle(style).rotate_axis_z != value) { rstyleMut(style).rotate_axis_z = value; changed = 1; } break;
1066
+ case Property::ScaleX: if (rstyle(style).scale_x != value) { rstyleMut(style).scale_x = value; changed = 1; } break;
1067
+ case Property::ScaleY: if (rstyle(style).scale_y != value) { rstyleMut(style).scale_y = value; changed = 1; } break;
1068
+ case Property::ScaleZ: if (rstyle(style).scale_z != value) { rstyleMut(style).scale_z = value; changed = 1; } break;
1069
+ case Property::TranslatePresent: if (rstyle(style).translate_present != (value != 0)) { rstyleMut(style).translate_present = value != 0; changed = 1; } break;
1070
+ case Property::TranslateX: if (rstyle(style).translate_x != value) { rstyleMut(style).translate_x = value; changed = 1; } break;
1071
+ case Property::TranslateY: if (rstyle(style).translate_y != value) { rstyleMut(style).translate_y = value; changed = 1; } break;
1072
+ case Property::TranslateZ: if (rstyle(style).translate_z != value) { rstyleMut(style).translate_z = value; changed = 1; } break;
1073
+ case Property::TranslateXPercent: if (rstyle(style).translate_x_percent != value) { rstyleMut(style).translate_x_percent = value; changed = 1; } break;
1074
+ case Property::TranslateYPercent: if (rstyle(style).translate_y_percent != value) { rstyleMut(style).translate_y_percent = value; changed = 1; } break;
1075
+ case Property::TransformPresent: if (rstyle(style).transform_present != (value != 0)) { rstyleMut(style).transform_present = value != 0; changed = 1; } break;
1076
+ case Property::RotatePresent: if (rstyle(style).rotate_present != (value != 0)) { rstyleMut(style).rotate_present = value != 0; changed = 1; } break;
1077
+ case Property::ScalePresent: if (rstyle(style).scale_present != (value != 0)) { rstyleMut(style).scale_present = value != 0; changed = 1; } break;
1078
+ #endif
1079
+ #if GEA_CSS_FILTERS
1080
+ case Property::FilterPresent: if (rstyle(style).filter_present != (value != 0)) { rstyleMut(style).filter_present = value != 0; changed = 1; } break;
1081
+ #endif
1082
+ #if GEA_CSS_TRANSFORMS
738
1083
  case Property::TransformRotate:
739
- if (rstyle(n->style).transform_rotate != value) {
740
- rstyleMut(n->style).transform_rotate = value;
741
- changed = 1;
742
- }
743
- break;
744
- case Property::TransformRotateX: if (rstyle(n->style).transform_rotate_x != value) { rstyleMut(n->style).transform_rotate_x = value; changed = 1; } break;
745
- case Property::TransformRotateY: if (rstyle(n->style).transform_rotate_y != value) { rstyleMut(n->style).transform_rotate_y = value; changed = 1; } break;
746
- case Property::TransformTranslateX: if (rstyle(n->style).transform_translate_x != value) { rstyleMut(n->style).transform_translate_x = value; changed = 1; } break;
747
- case Property::TransformTranslateY: if (rstyle(n->style).transform_translate_y != value) { rstyleMut(n->style).transform_translate_y = value; changed = 1; } break;
748
- case Property::TransformTranslateZ: if (rstyle(n->style).transform_translate_z != value) { rstyleMut(n->style).transform_translate_z = value; changed = 1; } break;
749
- case Property::TransformTranslateXPercent: if (rstyle(n->style).transform_translate_x_percent != value) { rstyleMut(n->style).transform_translate_x_percent = value; changed = 1; } break;
750
- case Property::TransformTranslateYPercent: if (rstyle(n->style).transform_translate_y_percent != value) { rstyleMut(n->style).transform_translate_y_percent = value; changed = 1; } break;
751
- case Property::TransformScaleX: if (rstyle(n->style).transform_scale_x != value) { rstyleMut(n->style).transform_scale_x = value; changed = 1; } break;
752
- case Property::TransformScaleY: if (rstyle(n->style).transform_scale_y != value) { rstyleMut(n->style).transform_scale_y = value; changed = 1; } break;
753
- case Property::TransformScaleZ: if (rstyle(n->style).transform_scale_z != value) { rstyleMut(n->style).transform_scale_z = value; changed = 1; } break;
754
- case Property::TransformOriginX: if (rstyle(n->style).transform_origin_x != value) { rstyleMut(n->style).transform_origin_x = value; changed = 1; } break;
755
- case Property::TransformOriginY: if (rstyle(n->style).transform_origin_y != value) { rstyleMut(n->style).transform_origin_y = value; changed = 1; } break;
756
- case Property::Perspective: if (rstyle(n->style).perspective != value) { rstyleMut(n->style).perspective = value; changed = 1; } break;
757
- case Property::PerspectiveOriginX: if (rstyle(n->style).perspective_origin_x != value) { rstyleMut(n->style).perspective_origin_x = value; changed = 1; } break;
758
- case Property::PerspectiveOriginY: if (rstyle(n->style).perspective_origin_y != value) { rstyleMut(n->style).perspective_origin_y = value; changed = 1; } break;
759
- case Property::FilterBlur: if (rstyle(n->style).filter_blur_radius != value) { rstyleMut(n->style).filter_blur_radius = value; changed = 1; } break;
1084
+ if (rstyle(style).transform_rotate != value) {
1085
+ rstyleMut(style).transform_rotate = value;
1086
+ changed = 1;
1087
+ }
1088
+ break;
1089
+ case Property::TransformRotateX: if (rstyle(style).transform_rotate_x != value) { rstyleMut(style).transform_rotate_x = value; changed = 1; } break;
1090
+ case Property::TransformRotateY: if (rstyle(style).transform_rotate_y != value) { rstyleMut(style).transform_rotate_y = value; changed = 1; } break;
1091
+ case Property::TransformTranslateX: if (rstyle(style).transform_translate_x != value) { rstyleMut(style).transform_translate_x = value; changed = 1; } break;
1092
+ case Property::TransformTranslateY: if (rstyle(style).transform_translate_y != value) { rstyleMut(style).transform_translate_y = value; changed = 1; } break;
1093
+ case Property::TransformTranslateZ: if (rstyle(style).transform_translate_z != value) { rstyleMut(style).transform_translate_z = value; changed = 1; } break;
1094
+ case Property::TransformTranslateXPercent: if (rstyle(style).transform_translate_x_percent != value) { rstyleMut(style).transform_translate_x_percent = value; changed = 1; } break;
1095
+ case Property::TransformTranslateYPercent: if (rstyle(style).transform_translate_y_percent != value) { rstyleMut(style).transform_translate_y_percent = value; changed = 1; } break;
1096
+ case Property::TransformScaleX: if (rstyle(style).transform_scale_x != value) { rstyleMut(style).transform_scale_x = value; changed = 1; } break;
1097
+ case Property::TransformScaleY: if (rstyle(style).transform_scale_y != value) { rstyleMut(style).transform_scale_y = value; changed = 1; } break;
1098
+ case Property::TransformScaleZ: if (rstyle(style).transform_scale_z != value) { rstyleMut(style).transform_scale_z = value; changed = 1; } break;
1099
+ case Property::TransformOriginX: if (rstyle(style).transform_origin_x != value) { rstyleMut(style).transform_origin_x = value; changed = 1; } break;
1100
+ case Property::TransformOriginY: if (rstyle(style).transform_origin_y != value) { rstyleMut(style).transform_origin_y = value; changed = 1; } break;
1101
+ case Property::Perspective: if (rstyle(style).perspective != value) { rstyleMut(style).perspective = value; changed = 1; } break;
1102
+ case Property::PerspectiveOriginX: if (rstyle(style).perspective_origin_x != value) { rstyleMut(style).perspective_origin_x = value; changed = 1; } break;
1103
+ case Property::PerspectiveOriginY: if (rstyle(style).perspective_origin_y != value) { rstyleMut(style).perspective_origin_y = value; changed = 1; } break;
1104
+ #endif
1105
+ #if GEA_CSS_FILTERS
1106
+ case Property::FilterBlur: if (rstyle(style).filter_blur_radius != value) { rstyleMut(style).filter_blur_radius = value; changed = 1; } break;
1107
+ #endif
1108
+ #if GEA_CSS_BOX_SHADOW
760
1109
  case Property::BoxShadowInset: {
761
1110
  const uint8_t next = value != 0 ? 1 : 0;
762
- if (rstyle(n->style).box_shadow_inset != next) { rstyleMut(n->style).box_shadow_inset = next; changed = 1; }
1111
+ if (rstyle(style).box_shadow_inset != next) { rstyleMut(style).box_shadow_inset = next; changed = 1; }
763
1112
  break;
764
1113
  }
765
- case Property::BoxShadowOffsetX: if (rstyle(n->style).box_shadow_offset_x != value) { rstyleMut(n->style).box_shadow_offset_x = value; changed = 1; } break;
766
- case Property::BoxShadowOffsetY: if (rstyle(n->style).box_shadow_offset_y != value) { rstyleMut(n->style).box_shadow_offset_y = value; changed = 1; } break;
767
- case Property::BoxShadowBlur: if (rstyle(n->style).box_shadow_blur_radius != value) { rstyleMut(n->style).box_shadow_blur_radius = value; changed = 1; } break;
768
- case Property::BoxShadowSpread: if (rstyle(n->style).box_shadow_spread != value) { rstyleMut(n->style).box_shadow_spread = value; changed = 1; } break;
1114
+ #endif
1115
+ #if GEA_CSS_BOX_SHADOW
1116
+ case Property::BoxShadowOffsetX: if (rstyle(style).box_shadow_offset_x != value) { rstyleMut(style).box_shadow_offset_x = value; changed = 1; } break;
1117
+ #endif
1118
+ #if GEA_CSS_BOX_SHADOW
1119
+ case Property::BoxShadowOffsetY: if (rstyle(style).box_shadow_offset_y != value) { rstyleMut(style).box_shadow_offset_y = value; changed = 1; } break;
1120
+ #endif
1121
+ #if GEA_CSS_BOX_SHADOW
1122
+ case Property::BoxShadowBlur: if (rstyle(style).box_shadow_blur_radius != value) { rstyleMut(style).box_shadow_blur_radius = value; changed = 1; } break;
1123
+ #endif
1124
+ #if GEA_CSS_BOX_SHADOW
1125
+ case Property::BoxShadowSpread: if (rstyle(style).box_shadow_spread != value) { rstyleMut(style).box_shadow_spread = value; changed = 1; } break;
1126
+ #endif
1127
+ #if GEA_CSS_BOX_SHADOW
769
1128
  case Property::BoxShadowColor: {
770
1129
  const style_color_t next = StyleValues::pixelFromStyleValue(value);
771
- if (rstyle(n->style).box_shadow_color != next) { rstyleMut(n->style).box_shadow_color = next; changed = 1; }
1130
+ if (rstyle(style).box_shadow_color != next) { rstyleMut(style).box_shadow_color = next; changed = 1; }
772
1131
  break;
773
1132
  }
1133
+ #endif
1134
+ #if GEA_CSS_BOX_SHADOW
774
1135
  case Property::BoxShadowAlpha: {
775
1136
  const uint8_t next = static_cast<uint8_t>(value < 0 ? 0 : value > 255 ? 255 : value);
776
- if (rstyle(n->style).box_shadow_alpha != next) { rstyleMut(n->style).box_shadow_alpha = next; changed = 1; }
1137
+ if (rstyle(style).box_shadow_alpha != next) { rstyleMut(style).box_shadow_alpha = next; changed = 1; }
777
1138
  break;
778
1139
  }
1140
+ #endif
779
1141
  default:
780
- perf.treeSetStyleNoop++;
1142
+ GEA_REFRESH_PERF(perf.treeSetStyleNoop++);
781
1143
  return;
782
1144
  }
783
1145
  if (!changed) {
784
- perf.treeSetStyleNoop++;
1146
+ GEA_REFRESH_PERF(perf.treeSetStyleNoop++);
785
1147
  return;
786
1148
  }
787
- perf.treeSetStyleChanged++;
1149
+ GEA_REFRESH_PERF(perf.treeSetStyleChanged++);
788
1150
  if (isLayoutProperty(prop) || (isTransformProperty(prop) && state.fixedPositionUsed))
789
- perf.treeSetStyleLayoutChanged++;
1151
+ GEA_REFRESH_PERF(perf.treeSetStyleLayoutChanged++);
790
1152
  if (isTransformProperty(prop))
791
- perf.treeSetStyleTransformChanged++;
1153
+ GEA_REFRESH_PERF(perf.treeSetStyleTransformChanged++);
792
1154
  else if (isPaintProperty(prop))
793
- perf.treeSetStylePaintChanged++;
1155
+ GEA_REFRESH_PERF(perf.treeSetStylePaintChanged++);
794
1156
  if (state.styleInvalidationSuppressionDepth > 0) return;
795
1157
  if (!nodeParticipatesInMountedTree(state, node)) return;
1158
+ const bool hadRecolor = n->render.bg_recolor_pending;
1159
+ const bool canRecolor = !n->render.dirty || hadRecolor;
1160
+ n->render.text_partial_dirty = 0;
1161
+ n->render.bg_recolor_pending = 0;
796
1162
  if (prop == Property::Visibility || prop == Property::Backface || prop == Property::TransformStyle)
797
1163
  tree.markDisplayListDirty();
798
1164
  const int documentRoot = state.mountedRoot;
@@ -811,16 +1177,18 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
811
1177
  // path below, since its intrinsic size can move layout.
812
1178
  if (prop == Property::ImageId) {
813
1179
  const bool fixedBox =
814
- (n->style.width != kUnset || n->style.width_percent != kUnset) &&
815
- (n->style.height != kUnset || n->style.height_percent != kUnset);
1180
+ (style.width != kUnset || style.width_percent != kUnset) &&
1181
+ (style.height != kUnset || style.height_percent != kUnset);
816
1182
  if (fixedBox) {
817
1183
  n->render.dirty = 1;
1184
+ #if GEA_CSS_SCROLLING
818
1185
  n->render.non_scroll_dirty = 1;
1186
+ #endif
819
1187
  tree.markNodeDisplayCommandsDirty(node);
820
1188
  return;
821
1189
  }
822
1190
  }
823
- if (prop == Property::BackgroundColor &&
1191
+ if (canRecolor && prop == Property::BackgroundColor &&
824
1192
  previousHasBg &&
825
1193
  previousBgAlpha == 255 &&
826
1194
  previousBgFill == 0 &&
@@ -828,17 +1196,16 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
828
1196
  previousBgOverlayGradient == 0 &&
829
1197
  previousBgRadialGradient == 0 &&
830
1198
  previousBgGridAxes == 0 &&
831
- n->style.has_bg &&
832
- n->style.bg_alpha == 255 &&
833
- n->style.bg_fill == 0 &&
834
- rstyle(n->style).bg_gradient_has_mid == 0 &&
835
- rstyle(n->style).bg_overlay_gradient == 0 &&
836
- rstyle(n->style).bg_radial_gradient == 0 &&
837
- rstyle(n->style).bg_grid_axes == 0 &&
838
- previousBgColor != n->style.bg_color) {
1199
+ style.has_bg &&
1200
+ style.bg_alpha == 255 &&
1201
+ style.bg_fill == 0 &&
1202
+ rstyle(style).bg_gradient_has_mid == 0 &&
1203
+ rstyle(style).bg_overlay_gradient == 0 &&
1204
+ rstyle(style).bg_radial_gradient == 0 &&
1205
+ rstyle(style).bg_grid_axes == 0 &&
1206
+ previousBgColor != style.bg_color) {
1207
+ if (!hadRecolor) n->render.bg_recolor_from = previousBgColor;
839
1208
  n->render.bg_recolor_pending = 1;
840
- n->render.bg_recolor_from = previousBgColor;
841
- n->render.bg_recolor_to = n->style.bg_color;
842
1209
  }
843
1210
  n->render.dirty = 1;
844
1211
  // Paint-only properties (background, colors, shadows, ...) repaint in
@@ -847,11 +1214,18 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
847
1214
  // not let a retained transform update suppress the required relayout.
848
1215
  if (isLayoutProperty(prop) || (isTransformProperty(prop) && state.fixedPositionUsed))
849
1216
  n->render.layout_dirty = 1;
1217
+ #if GEA_CSS_SCROLLING
850
1218
  n->render.non_scroll_dirty = 1;
1219
+ #endif
851
1220
  if (isTransformProperty(prop)) {
1221
+ #if GEA_CSS_TRANSFORMS
852
1222
  n->render.transform_dirty = 1;
1223
+ #endif
1224
+
1225
+ #if GEA_CSS_TRANSFORMS
853
1226
  state.transformScanSerial = ~0ull;
854
1227
  state.transformScanValid = false; // a transform was added/changed → drop durable no-transform cache
1228
+ #endif
855
1229
  }
856
1230
  if (DisplayInvalidation::rebuildsNodeDisplayCommands(prop)) {
857
1231
  const bool stayLocal = DisplayInvalidation::nodeDisplayChangeCanStayLocal(node);
@@ -868,13 +1242,13 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
868
1242
  // [drawStart,drawEnd], which excludes the scope — which is why
869
1243
  // canReplayDirectDirtyRegions still bails and we fall to the safe
870
1244
  // full-per-rect replay. The record stays incremental either way.)
871
- if (stayLocal && prevOpacity < 255 && n->style.opacity < 255 &&
872
- DisplayList::instance().patchNodeAlpha(node, static_cast<uint8_t>(n->style.opacity)))
1245
+ if (stayLocal && prevOpacity < 255 && style.opacity < 255 &&
1246
+ DisplayList::instance().patchNodeAlpha(node, static_cast<uint8_t>(style.opacity)))
873
1247
  return;
874
1248
  // Crossing the 255 boundary (scope appears/disappears) or a non-leaf:
875
1249
  // a leaf toggling strictly 0↔255 re-records locally; otherwise rebuild.
876
1250
  const bool toggleOnly = (prevOpacity == 0 || prevOpacity == 255) &&
877
- (n->style.opacity == 0 || n->style.opacity == 255);
1251
+ (style.opacity == 0 || style.opacity == 255);
878
1252
  forceFull = !stayLocal || !toggleOnly;
879
1253
  } else if (prop == Property::MaskRightFadeWidth ||
880
1254
  prop == Property::FilterBlur ||
@@ -910,7 +1284,7 @@ void setStyleValue(Tree &tree, int node, Property prop, int value, bool recordIn
910
1284
  // labels are NOT re-recorded). Every other size/layout/z-index change
911
1285
  // reflows or reorders → full rebuild.
912
1286
  const bool absLeafSize = (prop == Property::Width || prop == Property::Height) &&
913
- n->style.position == 1 && n->first_child < 0 && n->type != NodeType::Text;
1287
+ style.position == 1 && n->first_child < 0 && n->type != NodeType::Text;
914
1288
  if (absLeafSize)
915
1289
  tree.markNodeDisplayCommandsDirty(node);
916
1290
  else
@@ -943,15 +1317,17 @@ void Tree::resetStyleForClassRecompute(int node)
943
1317
  auto &state = treeState();
944
1318
  if (node < 0 || node >= state.nodeCount) return;
945
1319
 
946
- Node defaults;
947
- NodeLifecycle::init(&defaults, state.nodes[node].type);
948
- state.nodes[node].style = defaults.style;
949
- state.nodes[node].image_id = defaults.image_id;
1320
+ state.nodes[node].resetComputedStyle();
1321
+ #if GEA_UI_IMAGE_NODES
1322
+ state.nodes[node].image_id = -1;
1323
+ #endif
950
1324
  if (state.styleInvalidationSuppressionDepth > 0) return;
951
1325
  if (!nodeParticipatesInMountedTree(state, node)) return;
952
1326
  state.nodes[node].render.dirty = 1;
953
1327
  state.nodes[node].render.layout_dirty = 1;
1328
+ #if GEA_CSS_SCROLLING
954
1329
  state.nodes[node].render.non_scroll_dirty = 1;
1330
+ #endif
955
1331
  markDisplayListDirty();
956
1332
  }
957
1333