@geastack/engine 0.1.6 → 0.1.7

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.
@@ -0,0 +1,261 @@
1
+ # Automatic CSS specialization
2
+
3
+ The compiler plugin reports CSS families reachable from application source, imported
4
+ stylesheets and dynamic style operations. The CLI combines this with native-source
5
+ usage before generating consistent engine and application definitions. Missing or
6
+ opaque analysis retains support. Applications need no feature switches.
7
+
8
+ The first families are transforms/perspective, grid, floats, writing modes/direction
9
+ and relief borders. Per-property analysis also omits unused blink timing, flex/grid
10
+ order, and percentage representations for gaps and corner radii. Dynamic values
11
+ retain the representations they can reach. Missing/older analysis retains defaults;
12
+ the CLI requires v2 before specializing those representations. The v3 facts also
13
+ omit unused opacity, text decoration/transformation, visibility, pointer-events,
14
+ masking and object-fit fields. Attribute-driven native animations and opaque native
15
+ CSS APIs retain support conservatively. Removing a family removes its per-node state and allows the
16
+ optimizer to discard its paths. Ordinary borders and border-box sizing stay usable.
17
+ The v4 facts additionally remove unused filters, box shadows, flex wrapping,
18
+ justify-items, align-content/self, min-width and deferred height expressions.
19
+ Logical size properties, unknown values and native CSS mutation retain the relevant
20
+ families. Shared CSS length parsing stays outside the transform-only guards;
21
+ font-size, padding and min/max sizes must work with transforms absent.
22
+ Renderer cache analysis separately removes unused persistent caches while retaining
23
+ uncached rendering paths.
24
+
25
+ Empty nodes store a four-byte text handle. Nonempty labels own independent strings
26
+ in stable pages of 16 records; releasing a label destroys its character buffer and
27
+ reuses the record. Pool pages retain their high-water capacity and prefer PSRAM on
28
+ ESP32. NodeText::storageBytes reports allocated pool payload, including spare records
29
+ and the page map, but excludes long string buffers and allocator metadata.
30
+
31
+ The pedal's linked S3 ELF measures 220-byte nodes and a 39,472-byte TreeState
32
+ for 160 slots, versus 400 and 68,272 with engine 0.1.6. Node members remain
33
+ naturally aligned direct fields; absent properties become compile-time constants.
34
+ The width probe still emits one S3 load, with no accessor or pool lookup. Total UI memory includes the
35
+ text pool and other allocations; these are not device heap or timing measurements.
36
+
37
+ Native applications that only inspect the mounted tree can include
38
+ ui/tree_inspection.h. Mutable UI headers conservatively retain all CSS families.
39
+
40
+ The common border color's binding flags occupy existing ComputedStyle alignment
41
+ padding, so an ordinary literal colored border does not allocate RareStyle.
42
+ Per-side color payloads remain sparse. In the S3 specialization, RareStyle is
43
+ 128 bytes (336 in the registry baseline). The native regression checks
44
+ both the primitive binding and the CSS shorthand/side-color/currentColor path.
45
+ These record sizes exclude the pool allocator's block and bookkeeping overhead.
46
+
47
+ The optional node record's style overrides share storage between inline entries
48
+ and overflow metadata, which are mutually exclusive. On S3 each override store
49
+ falls from 48 to 36 bytes and NodeRareData from 280 to 256 bytes. Its access
50
+ function has the same instruction sequence, with changed offsets only. Copies,
51
+ moves, overflow growth, removal and reuse retain their previous semantics.
52
+
53
+ Optional records now use an owning pointer table: record addresses remain stable
54
+ across growth and freed records are reused. This avoids deque indexing becoming
55
+ more expensive when a smaller record crosses a block-size threshold. The linked
56
+ S3 lookup is 52 bytes versus 90 before the pointer-table follow-up, with fewer loads/branches;
57
+ that is an assembly observation, not a device timing measurement. Allocations
58
+ include the record payloads, spare pointer-table capacity, reuse list, nested
59
+ containers and allocator overhead; record sizeof alone is not total heap use.
60
+
61
+ An allocator-level macOS regression compares the installed registry engine and the
62
+ candidate across six phases of a 49-node fixture. It sums all malloc zones, counting
63
+ nested containers, long text buffers, spare capacity and allocator rounding. The
64
+ attribute/listener/inline-style phase saves 68,576 allocated bytes; releasing long
65
+ labels saves 83,936 against the registry engine, which retains string capacity.
66
+ Pixels match in all phases. These totals include host framework state and are not
67
+ S3 heap readings or a whole-pedal workload. The test requires explicit reference
68
+ and candidate package paths and is intentionally separate from ordinary host checks.
69
+
70
+ Expanded class-rule coverage exposed a transform guard that had accidentally
71
+ removed shared length parsing in the earlier development candidates. The current
72
+ candidate corrects it and tests font-size, line-height and min/max/box edges with
73
+ transforms disabled. Earlier 288/260/252-byte development artifacts are superseded
74
+ and must not be treated as broadly behavior-qualified release candidates.
75
+
76
+ Grouping the existing byte-sized paint flags removes four alignment bytes from
77
+ ComputedStyle without bitfields or packed/unaligned members. S3 width and colour
78
+ probes remain single aligned loads (l16si/l16ui). ComputedStyle is 120 bytes;
79
+ linked firmware is 3,125,088 bytes versus 3,224,448 for the registry baseline.
80
+ The host allocator census savings remain unchanged because of host layout and
81
+ allocation rounding; do not add the S3 sizeof reduction to that host result.
82
+
83
+ The v5 analyzer additionally specializes z-index, aspect-ratio, margin-trim,
84
+ containment, justify-self, flex-line-count and deferred margin/padding expressions.
85
+ Unknown/dynamic values retain the required representation. Fixed pixel box edges
86
+ keep ordinary layout behavior without expression arrays or resolver calls. All
87
+ versions before v5 retain these newer fields. Grid's authored-template and layout
88
+ bookkeeping is also omitted from NodeRareData when grid is unreachable.
89
+
90
+ For the pedal this leaves Node at 232 bytes, while RareStyle falls from 176 to
91
+ 128 bytes and NodeRareData from 256 to 244 bytes. The linked firmware is 3,114,768
92
+ bytes. Host allocator savings in the 49-node fixture remain unchanged: that
93
+ fixture does not allocate rare styles, and the smaller optional records remain
94
+ in the same host allocation size class. Device allocation effects must be measured.
95
+
96
+
97
+ The source analyzer now resolves the narrow colour-only custom-property case
98
+ across all discovered files before retaining gradient caches. A whole-value
99
+ `var(--name)` can omit those caches only when every visible declaration is a
100
+ literal colour and every fallback is also a literal colour. Missing definitions,
101
+ variable aliases, compound backgrounds, interpolated CSS, opaque writes/imports
102
+ and native CSS mutation retain the caches. Custom-property names stay
103
+ case-sensitive; ordinary CSS property names do not. This adds build-time analysis,
104
+ not runtime field access or decoding. The focused analyzer has 122 passing cases;
105
+ cached/uncached native pixels and geometry match, with cache storage absent in
106
+ the pruned binary. The pedal image falls a further 4,368 bytes to 3,110,400, and
107
+ static PSRAM falls another 5,168 bytes. Node stays 232 bytes.
108
+
109
+ Hardware qualification is still open. On the connected S3, the preceding
110
+ `candidate-sizing` increased maintenance free PSRAM by a median 190,556 bytes
111
+ and free internal SRAM by 512 bytes versus the registry build. The PSRAM change
112
+ includes a 131,072-byte reduction in mapped code/rodata pages and a 25,952-byte
113
+ static-BSS reduction; it must not be described as isolated UI-tree allocation.
114
+ Two registry audio windows (45 seconds, A2-Full, amp and all six effects enabled)
115
+ had zero deadline misses. The sizing candidate had 55/1 and 0/2 misses on the two
116
+ stages. It therefore fails audio qualification despite the memory savings. The
117
+ colour-cache candidate needs its own measurements. No new package is published.
118
+
119
+
120
+ Hardware follow-up: the colour-cache candidate's two stage-B misses were traced
121
+ to the audio test's full task census. ESP-IDF scanned PSRAM task stacks while
122
+ holding its scheduler lock for 2,200/1,792 us. Reading only persistent task
123
+ metadata without stack scans reduces this to 114/112 us; DSP counters are now
124
+ captured before shutdown diagnostics. Two corrected 45-second windows report
125
+ 0/0 deadline misses and zero USB transfer errors. The resulting development
126
+ image is 3,110,736 bytes, and maintenance free PSRAM rises by a five-sample median
127
+ 195,640 bytes versus registry. DSP stage time is essentially unchanged. The
128
+ previous sizing image's 55 core-0 misses remain a rejected result; this does not
129
+ retroactively qualify it. No sample-by-sample device audio or busy-UI equivalence
130
+ is claimed, and no further package has been published. The maintained pedal
131
+ report is docs/UI_MEMORY_OPTIMIZATION.md; raw measurements are in its
132
+ build/css-feature-audit/device-node-compaction-comparison.json.
133
+
134
+
135
+ The v6 facts distinguish independent row/column gaps and independent corner
136
+ radii. Uniform literal radii use one aligned int16 field; all rendering indices
137
+ become the compile-time constant zero. Uniform gaps omit the unused axis fields.
138
+ Unknown values/functions and individual longhands keep the full representation,
139
+ and percentage storage remains independent. The S3 node becomes 220 bytes and
140
+ TreeState 39,472 bytes. Direct loads are preserved; a dynamic corner read loses
141
+ its index arithmetic. Five board samples show 1,964 additional free PSRAM bytes
142
+ versus the 232-byte checkpoint; the host allocator rounds to the same size class.
143
+ Uniform radii also emit one style write/cache entry instead of four; class-rule
144
+ cascade and inline removal are compared across full and pruned configurations.
145
+
146
+ The radius-write follow-up reduces the firmware another 496 bytes to 3,108,992.
147
+ Seven native configurations match across eighteen pixel/geometry frames; plain
148
+ and rounded allocator fixtures match registry pixels with no additional host
149
+ allocated-byte savings. The final image has 4,027,832 median free PSRAM bytes
150
+ (+197,608 versus registry), with the extra four bytes versus uniform fields
151
+ inside measurement noise. A 45-second steady full-chain run and a 90-second
152
+ real-touch soak both report zero DSP misses and USB errors. Steady DSP times
153
+ remain about 1,154/1,194 us; matched touch repaint times are broadly unchanged.
154
+ The soak's legacy panel points exercise a subset and toggle the amp/effects;
155
+ its quiet-time heuristic can miss delayed paints. Full-CSS WASM and pedal host
156
+ checks pass. This remains an unpublished checkpoint toward the original goal,
157
+ not proof of hardware sample equality or a final registry-only package build.
158
+
159
+
160
+ The combined storage work keeps computed style, layout and render fields direct.
161
+ It replaces seven listener vectors with one tagged collection, right-sizes
162
+ attribute payloads, allocates override blocks and virtual-list state only when
163
+ needed, and shares the valid result dimensions of the two layout memo entries.
164
+ The linked S3 checkpoint has a 212-byte Node and a 72-byte optional record.
165
+ A repeated device UI soak exposed a startup/buffer-disruption concern; it is
166
+ not release-qualified. See the pedal report for the negative measurements.
167
+
168
+ Analyzer v8 adds automatic side-border, background-layer and line-height-expression
169
+ specialization. Proven uniform borders need no per-side storage or rare-style
170
+ lookup; plain colors need no clip/placement/layer-count fields. Whole-value color
171
+ variables use the same conservative proof as gradient-cache analysis. Relative
172
+ line heights, non-flat backgrounds, side longhands, unknown values and opaque
173
+ native CSS retain their support. Old analyzers cannot remove these new fields.
174
+ The fully pruned native fixture has a 4-byte RareStyle (deferred flex basis only).
175
+
176
+ Custom-property records now reuse the stable immutable string already stored in
177
+ the CSS atom table, without a second string allocation or reference-count control
178
+ block for interned values. If the table is full, an owned shared string preserves
179
+ the exact value. Copies, mutation, empty values, cached color/length fields and
180
+ self-assignment after atom exhaustion are exercised. This changes cold variable
181
+ storage, not direct computed-style field reads. Total allocated bytes, including
182
+ fallbacks, are measured separately from record sizes.
183
+
184
+
185
+ Analyzer v9 retains scrolling for scrollable/unknown overflow, scroll controls,
186
+ local background attachment, native lists/inputs, dynamic or escaped element
187
+ factories and opaque CSS/native writes. A proven non-scrolling app keeps clipping
188
+ but omits six 32-bit scroll geometry fields, the scroll-dirty byte, child-extent
189
+ walks and pre-layout offset snapshots. Byte flags are grouped before aligned
190
+ colors/bounds, without bitfields or field accessors. Default/older-analyzer
191
+ builds retain scrolling and its 32-bit large-list coordinates. The native
192
+ full/pruned matrix compares hidden/clip/visible overflow through updates; a
193
+ separate retained-scroll regression checks scrollIntoView and offset changes.
194
+
195
+
196
+ Analyzer v10 separately proves deferred flex bases and custom-property length
197
+ caches unused. Fixed pixel/numeric bases retain direct scalar storage; relative
198
+ units, percentages, functions and unknown values retain expressions. Color-only
199
+ or quoted-text custom properties need no parsed length fields. Other values,
200
+ older analyzers and opaque native mutation retain them. This is automatic.
201
+
202
+ When every rare family is absent, RareStyle has no instance fields: nodes carry
203
+ no rare-style handle and allocate no rare-style pool, including inline builds.
204
+ An emptiness assertion prevents a newly added unguarded field from silently
205
+ escaping the family list. Unused scrolling also removes tree-level dirty words,
206
+ pending-scroll state and the optional virtual-list pointer. Reordering the two
207
+ atom IDs removes padding from custom-property records in full builds too.
208
+ These changes preserve direct hot-field reads; allocation and target measurements
209
+ remain separate from sizeof results.
210
+
211
+
212
+ Analyzer v11 adds maximum-height, scalar flex-basis and independent overflow-axis
213
+ proofs. Maximum-height declarations and logical maximum sizes retain their field;
214
+ explicit/unknown flex bases retain the scalar basis. Uniform overflow shorthands
215
+ share the existing aggregate field; longhands, unequal/unknown values and native
216
+ inputs/lists retain separate axes. The existing overflow helpers then compile to
217
+ one direct read instead of coupling two axes at runtime. Gradient-only `bg_fill`
218
+ and unused transform-scan cache state follow their existing feature proofs.
219
+ The pedal's chain UI uses max-height, so that field remains present automatically.
220
+
221
+
222
+ The separate `css-ranges-v1` proof selects byte storage for nonnegative padding,
223
+ gap, border width/radius, font size, resolved line height and flex factors.
224
+ Numeric values and CSS pixel lengths have separate bounds; the CLI applies the
225
+ actual layout pixel ratio before choosing a type. Inheritance, native defaults,
226
+ unitless line heights and 255/256 boundaries are included. Missing or unknown
227
+ proof, dynamic styles, relative units, animation, runtime scale changes and
228
+ opaque native mutation retain 16-bit fields. These are generated build facts,
229
+ not application opt-ins. Grouped byte fields retain ordinary direct loads;
230
+ there is no pointer lookup, bitfield unpacking or per-read range check.
231
+
232
+ Source discovery uses TypeScript syntax trees for imports, exports and literal
233
+ module calls. A leading side-effect stylesheet import must not disappear when
234
+ followed by another import/export. Computed or malformed module boundaries
235
+ retain the conservative feature set. The pedal's 65px root radius is therefore
236
+ included in the range proof before its 2x layout scale is applied.
237
+
238
+
239
+ ## Native node payload reachability
240
+
241
+ The independent `node-analysis-v1` fact set selects image nodes and native text
242
+ inputs from the complete discovered source graph. The CLI generates
243
+ `GEA_UI_IMAGE_NODES` and `GEA_UI_INPUT_NODES`; neither is an application opt-in.
244
+ Older analyzers, unresolved imports, dynamic element factories, opaque markup
245
+ and native UI mutation retain support. Literal tags are case-insensitive, as in
246
+ `Document::createElement`. CSS background images remain a separate renderer
247
+ feature, and custom button keyboards do not require native input/caret state.
248
+
249
+ An image-free build has no per-node image handle. An input-free build has no
250
+ focus/caret fields or native keyboard implementation. A scroll-free build omits
251
+ both scroll-dirty flags. Absent fields are compile-time constants; hot retained
252
+ style and layout fields remain embedded and directly readable. The native test
253
+ matrix exercises image/input support independently of each other and of CSS,
254
+ including positive image painting and input focus/caret behavior when enabled.
255
+
256
+ For the pedal, the linked S3 records are Node 160 B, ComputedStyle 88 B,
257
+ LayoutBox 38 B, RenderState 14 B and TreeState 29,816 B for 160 slots. Compared
258
+ with the preceding 164-byte candidate, this saves 648 B in TreeState and
259
+ 11,664 B of firmware. The 49-node host allocation fixture is unchanged because
260
+ of allocator rounding; these record reductions are not a host heap saving.
261
+ This remains a development checkpoint, not a 50-byte node or a 60 fps guarantee.
@@ -69,10 +69,11 @@ int alignedAbsoluteOffset(const Node &parent, const Node &child, bool horizontal
69
69
  return LayoutEngine::alignedAbsoluteOffset(parent, child, horizontal, &parent, horizontal ? x : y, horizontal ? width : height);
70
70
  }
71
71
 
72
- int resolvedPositionOffset(const Node &child, int side, int basis)
72
+ template <int side>
73
+ int resolvedPositionOffset(const Node &child, int basis)
73
74
  {
74
- int offset = child.style.pos_offsets[side] != kUnset ? child.style.pos_offsets[side] : 0;
75
- const int percent = child.style.pos_offset_percent[side];
75
+ int offset = GEA_CSS_POSITION_PX(child.style, side) != kUnset ? GEA_CSS_POSITION_PX(child.style, side) : 0;
76
+ const int percent = GEA_CSS_POSITION_PERCENT(child.style, side);
76
77
  if (percent != kUnset) {
77
78
  const int numerator = basis * percent;
78
79
  offset += (numerator + (numerator >= 0 ? 500 : -500)) / 1000;
@@ -80,9 +81,10 @@ int resolvedPositionOffset(const Node &child, int side, int basis)
80
81
  return offset;
81
82
  }
82
83
 
83
- bool hasPositionOffset(const Node &node, int side)
84
+ template <int side>
85
+ bool hasPositionOffset(const Node &node)
84
86
  {
85
- return node.style.pos_offsets[side] != kUnset || node.style.pos_offset_percent[side] != kUnset;
87
+ return GEA_CSS_POSITION_PX(node.style, side) != kUnset || GEA_CSS_POSITION_PERCENT(node.style, side) != kUnset;
86
88
  }
87
89
 
88
90
  bool hasExplicitWidth(const Node &node)
@@ -258,19 +260,19 @@ void AbsoluteLeafRefresh::refreshPositions()
258
260
  const int before_y = n->layout.y;
259
261
  int parent_x = p->layout.x;
260
262
  if (p->style.overflow == 2 && scrollsOverflowX(p->style)) parent_x -= p->layout.scroll_x;
261
- if (hasPositionOffset(*n, 3))
262
- n->layout.x = parent_x + areaX + resolvedPositionOffset(*n, 3, areaWidth);
263
- else if (hasPositionOffset(*n, 1))
264
- n->layout.x = parent_x + areaX + areaWidth - n->layout.width - resolvedPositionOffset(*n, 1, areaWidth);
263
+ if (hasPositionOffset<3>(*n))
264
+ n->layout.x = parent_x + areaX + resolvedPositionOffset<3>(*n, areaWidth);
265
+ else if (hasPositionOffset<1>(*n))
266
+ n->layout.x = parent_x + areaX + areaWidth - n->layout.width - resolvedPositionOffset<1>(*n, areaWidth);
265
267
  else
266
268
  n->layout.x = parent_x + alignedAbsoluteOffset(*p, *n, true);
267
269
 
268
270
  int parent_y = p->layout.y;
269
271
  if (p->style.overflow == 2 && scrollsOverflowY(p->style)) parent_y -= p->layout.scroll_y;
270
- if (hasPositionOffset(*n, 0))
271
- n->layout.y = parent_y + areaY + resolvedPositionOffset(*n, 0, areaHeight);
272
- else if (hasPositionOffset(*n, 2))
273
- n->layout.y = parent_y + areaY + areaHeight - n->layout.height - resolvedPositionOffset(*n, 2, areaHeight);
272
+ if (hasPositionOffset<0>(*n))
273
+ n->layout.y = parent_y + areaY + resolvedPositionOffset<0>(*n, areaHeight);
274
+ else if (hasPositionOffset<2>(*n))
275
+ n->layout.y = parent_y + areaY + areaHeight - n->layout.height - resolvedPositionOffset<2>(*n, areaHeight);
274
276
  else
275
277
  n->layout.y = parent_y + alignedAbsoluteOffset(*p, *n, false);
276
278
  translateDescendantLayouts(state, i, n->layout.x - before_x, n->layout.y - before_y);
package/ui/core.cpp CHANGED
@@ -4,6 +4,7 @@
4
4
  #include "document.h"
5
5
  #include "refresh_perf.h"
6
6
  #include "tree_state.h"
7
+ #include "tree_inspection.h"
7
8
 
8
9
  namespace gea::embedded::ui {
9
10
 
@@ -50,11 +51,15 @@ void Tree::markNodeDisplayCommandsDirty(int node)
50
51
 
51
52
  void Tree::markScrollDirty(int node)
52
53
  {
54
+ #if GEA_CSS_SCROLLING
53
55
  auto &state = treeState();
54
56
  if (node < 0 || node >= kMaxNodes) return;
55
57
  state.nodes[node].render.scroll_dirty = 1;
56
58
  state.scrollDirtyNodes[node / 64] |= (1ull << (node % 64));
57
59
  state.scrollDirtyAny = true;
60
+ #else
61
+ (void)node;
62
+ #endif
58
63
  }
59
64
 
60
65
  Node *Tree::nodes()
@@ -82,6 +87,24 @@ int Tree::mountedRoot() const { return treeState().mountedRoot; }
82
87
  int Tree::mountedWidth() const { return treeState().mountedWidth; }
83
88
  int Tree::mountedHeight() const { return treeState().mountedHeight; }
84
89
 
90
+ int TreeInspection::nodeCount() { return Tree::instance().nodeCount(); }
91
+ int TreeInspection::mountedWidth() { return Tree::instance().mountedWidth(); }
92
+ bool TreeInspection::hasMountedText(const char *text)
93
+ {
94
+ if (!text) return false;
95
+ const auto &tree = Tree::instance();
96
+ for (int i = 0; i < tree.nodeCount(); ++i) {
97
+ if (tree.node(i).text != text) continue;
98
+ int node = i;
99
+ for (int depth = 0; node >= 0 && node < tree.nodeCount() && depth < tree.nodeCount(); ++depth) {
100
+ if (isDisplayNone(tree.node(node).style)) break;
101
+ if (node == tree.mountedRoot()) return true;
102
+ node = tree.node(node).parent;
103
+ }
104
+ }
105
+ return false;
106
+ }
107
+
85
108
  bool Tree::displayListRebuildRequired() const { return treeState().displayListDirty; }
86
109
  bool Tree::refreshRequired() const
87
110
  {
package/ui/css_atom.cpp CHANGED
@@ -145,6 +145,12 @@ CssAtomId internCssAtom(const std::string &text)
145
145
  return internCssAtom(text.c_str(), text.size());
146
146
  }
147
147
 
148
+ const std::string &cssAtomString(CssAtomId atom)
149
+ {
150
+ auto &table = atomTable();
151
+ return table[static_cast<std::size_t>(atom) < table.size() ? atom : kInvalidCssAtom];
152
+ }
153
+
148
154
  const char *cssAtomText(CssAtomId atom)
149
155
  {
150
156
  auto &table = atomTable();
package/ui/css_atom.h CHANGED
@@ -16,6 +16,8 @@ CssAtomId findCssAtom(const std::string &text);
16
16
  CssAtomId internCssAtom(const char *text, std::size_t length);
17
17
  CssAtomId internCssAtom(const char *text);
18
18
  CssAtomId internCssAtom(const std::string &text);
19
+ // References remain valid for the process lifetime, including table growth.
20
+ const std::string &cssAtomString(CssAtomId atom);
19
21
  const char *cssAtomText(CssAtomId atom);
20
22
 
21
23
  } // namespace gea::embedded::ui
@@ -0,0 +1,282 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ #pragma once
3
+
4
+ #ifndef GEA_CSS_PSEUDO_ELEMENTS
5
+ #define GEA_CSS_PSEUDO_ELEMENTS 1
6
+ #endif
7
+
8
+ // Opaque/default colour proof, generated from the complete source graph.
9
+ #ifndef GEA_CSS_TEXT_ALPHA
10
+ #define GEA_CSS_TEXT_ALPHA 1
11
+ #endif
12
+ #ifndef GEA_CSS_BORDER_ALPHA
13
+ #define GEA_CSS_BORDER_ALPHA 1
14
+ #endif
15
+
16
+ // Whole-source animation reachability; older/opaque builds retain support.
17
+ #ifndef GEA_CSS_ANIMATIONS
18
+ #define GEA_CSS_ANIMATIONS 1
19
+ #endif
20
+
21
+ // Build-generated reachability facts. The application does not configure these.
22
+ // A driver without CSS analysis retains every feature. All translation units
23
+ // must receive the same facts, because they specialize per-node storage too.
24
+ #ifndef GEA_CSS_TRANSFORMS
25
+ #define GEA_CSS_TRANSFORMS 1
26
+ #endif
27
+ #ifndef GEA_CSS_GRID
28
+ #define GEA_CSS_GRID 1
29
+ #endif
30
+ #ifndef GEA_CSS_FLOATS
31
+ #define GEA_CSS_FLOATS 1
32
+ #endif
33
+ #ifndef GEA_CSS_WRITING_MODE
34
+ #define GEA_CSS_WRITING_MODE 1
35
+ #endif
36
+ #ifndef GEA_CSS_PERCENT_RADIUS
37
+ #define GEA_CSS_PERCENT_RADIUS 1
38
+ #endif
39
+ #ifndef GEA_CSS_PERCENT_GAP
40
+ #define GEA_CSS_PERCENT_GAP 1
41
+ #endif
42
+ #ifndef GEA_CSS_BLINK
43
+ #define GEA_CSS_BLINK 1
44
+ #endif
45
+ #ifndef GEA_CSS_ORDER
46
+ #define GEA_CSS_ORDER 1
47
+ #endif
48
+ #ifndef GEA_CSS_BORDER_RELIEF
49
+ #define GEA_CSS_BORDER_RELIEF 1
50
+ #endif
51
+
52
+ #ifndef GEA_CSS_OPACITY
53
+ #define GEA_CSS_OPACITY 1
54
+ #endif
55
+
56
+ #ifndef GEA_CSS_TEXT_DECORATION
57
+ #define GEA_CSS_TEXT_DECORATION 1
58
+ #endif
59
+
60
+ #ifndef GEA_CSS_TEXT_TRANSFORM
61
+ #define GEA_CSS_TEXT_TRANSFORM 1
62
+ #endif
63
+
64
+ #ifndef GEA_CSS_VISIBILITY
65
+ #define GEA_CSS_VISIBILITY 1
66
+ #endif
67
+
68
+ #ifndef GEA_CSS_POINTER_EVENTS
69
+ #define GEA_CSS_POINTER_EVENTS 1
70
+ #endif
71
+
72
+ #ifndef GEA_CSS_MASK
73
+ #define GEA_CSS_MASK 1
74
+ #endif
75
+
76
+ #ifndef GEA_CSS_IMAGE_FIT
77
+ #define GEA_CSS_IMAGE_FIT 1
78
+ #endif
79
+
80
+ #ifndef GEA_CSS_FILTERS
81
+ #define GEA_CSS_FILTERS 1
82
+ #endif
83
+
84
+ #ifndef GEA_CSS_BOX_SHADOW
85
+ #define GEA_CSS_BOX_SHADOW 1
86
+ #endif
87
+
88
+ #ifndef GEA_CSS_FLEX_WRAP
89
+ #define GEA_CSS_FLEX_WRAP 1
90
+ #endif
91
+
92
+ #ifndef GEA_CSS_JUSTIFY_ITEMS
93
+ #define GEA_CSS_JUSTIFY_ITEMS 1
94
+ #endif
95
+
96
+ #ifndef GEA_CSS_ALIGN_CONTENT
97
+ #define GEA_CSS_ALIGN_CONTENT 1
98
+ #endif
99
+
100
+ #ifndef GEA_CSS_ALIGN_SELF
101
+ #define GEA_CSS_ALIGN_SELF 1
102
+ #endif
103
+
104
+ #ifndef GEA_CSS_MIN_WIDTH
105
+ #define GEA_CSS_MIN_WIDTH 1
106
+ #endif
107
+
108
+ #ifndef GEA_CSS_HEIGHT_EXPRESSIONS
109
+ #define GEA_CSS_HEIGHT_EXPRESSIONS 1
110
+ #endif
111
+
112
+ #ifndef GEA_CSS_Z_INDEX
113
+ #define GEA_CSS_Z_INDEX 1
114
+ #endif
115
+
116
+ #ifndef GEA_CSS_ASPECT_RATIO
117
+ #define GEA_CSS_ASPECT_RATIO 1
118
+ #endif
119
+
120
+ #ifndef GEA_CSS_MARGIN_TRIM
121
+ #define GEA_CSS_MARGIN_TRIM 1
122
+ #endif
123
+
124
+ #ifndef GEA_CSS_CONTAINMENT
125
+ #define GEA_CSS_CONTAINMENT 1
126
+ #endif
127
+
128
+ #ifndef GEA_CSS_JUSTIFY_SELF
129
+ #define GEA_CSS_JUSTIFY_SELF 1
130
+ #endif
131
+
132
+ #ifndef GEA_CSS_FLEX_LINE_COUNT
133
+ #define GEA_CSS_FLEX_LINE_COUNT 1
134
+ #endif
135
+
136
+ #ifndef GEA_CSS_BOX_EXPRESSIONS
137
+ #define GEA_CSS_BOX_EXPRESSIONS 1
138
+ #endif
139
+
140
+
141
+ #ifndef GEA_CSS_AXIS_GAP
142
+ #define GEA_CSS_AXIS_GAP 1
143
+ #endif
144
+
145
+ #ifndef GEA_CSS_CORNER_RADIUS
146
+ #define GEA_CSS_CORNER_RADIUS 1
147
+ #endif
148
+
149
+ // Uniform-corner applications retain a real array with a single element.
150
+ // Every index becomes the constant zero before C++ compilation: no accessor,
151
+ // branch, decoding or additional load. Arguments must be side-effect free.
152
+ #if GEA_CSS_CORNER_RADIUS
153
+ #define GEA_CSS_RADIUS_COUNT 4
154
+ #define GEA_CSS_RADIUS_INDEX(index) (index)
155
+ #else
156
+ #define GEA_CSS_RADIUS_COUNT 1
157
+ #define GEA_CSS_RADIUS_INDEX(index) 0
158
+ #endif
159
+
160
+ #ifndef GEA_CSS_FIRST_LINE
161
+ #define GEA_CSS_FIRST_LINE 1
162
+ #endif
163
+
164
+ #ifndef GEA_CSS_SIDE_BORDERS
165
+ #define GEA_CSS_SIDE_BORDERS 1
166
+ #endif
167
+
168
+ #ifndef GEA_CSS_BACKGROUND_LAYERS
169
+ #define GEA_CSS_BACKGROUND_LAYERS 1
170
+ #endif
171
+
172
+ #ifndef GEA_CSS_LINE_HEIGHT_EXPRESSIONS
173
+ #define GEA_CSS_LINE_HEIGHT_EXPRESSIONS 1
174
+ #endif
175
+
176
+ #ifndef GEA_CSS_SCROLLING
177
+ #define GEA_CSS_SCROLLING 1
178
+ #endif
179
+
180
+ #ifndef GEA_CSS_FLEX_BASIS_EXPRESSIONS
181
+ #define GEA_CSS_FLEX_BASIS_EXPRESSIONS 1
182
+ #endif
183
+ #ifndef GEA_CSS_CUSTOM_PROPERTY_LENGTHS
184
+ #define GEA_CSS_CUSTOM_PROPERTY_LENGTHS 1
185
+ #endif
186
+
187
+ #ifndef GEA_CSS_MAX_HEIGHT
188
+ #define GEA_CSS_MAX_HEIGHT 1
189
+ #endif
190
+ #ifndef GEA_CSS_FLEX_BASIS
191
+ #define GEA_CSS_FLEX_BASIS 1
192
+ #endif
193
+ #ifndef GEA_CSS_OVERFLOW_AXES
194
+ #define GEA_CSS_OVERFLOW_AXES 1
195
+ #endif
196
+
197
+ // Positive range proofs supplied by the build; unknown inputs retain 16 bits.
198
+ #ifndef GEA_CSS_U8_PADDING
199
+ #define GEA_CSS_U8_PADDING 0
200
+ #endif
201
+ #ifndef GEA_CSS_U8_GAP
202
+ #define GEA_CSS_U8_GAP 0
203
+ #endif
204
+ #ifndef GEA_CSS_U8_BORDER
205
+ #define GEA_CSS_U8_BORDER 0
206
+ #endif
207
+ #ifndef GEA_CSS_U8_RADIUS
208
+ #define GEA_CSS_U8_RADIUS 0
209
+ #endif
210
+ #ifndef GEA_CSS_U8_FONT
211
+ #define GEA_CSS_U8_FONT 0
212
+ #endif
213
+ #ifndef GEA_CSS_U8_LINE_HEIGHT
214
+ #define GEA_CSS_U8_LINE_HEIGHT 0
215
+ #endif
216
+ #ifndef GEA_CSS_U8_FLEX
217
+ #define GEA_CSS_U8_FLEX 0
218
+ #endif
219
+
220
+ #define GEA_CSS_U8_BORDER_FLAGS (!GEA_CSS_SIDE_BORDERS && (GEA_CSS_U8_PADDING || GEA_CSS_U8_GAP || GEA_CSS_U8_BORDER || GEA_CSS_U8_RADIUS || GEA_CSS_U8_FONT || GEA_CSS_U8_LINE_HEIGHT || GEA_CSS_U8_FLEX))
221
+
222
+ // Per-edge reachability. Opaque/older builds keep the original four-edge arrays.
223
+ #ifndef GEA_CSS_POSITION_TOP
224
+ #define GEA_CSS_POSITION_TOP 1
225
+ #endif
226
+ #ifndef GEA_CSS_POSITION_TOP_PERCENT
227
+ #define GEA_CSS_POSITION_TOP_PERCENT 1
228
+ #endif
229
+ #ifndef GEA_CSS_POSITION_RIGHT
230
+ #define GEA_CSS_POSITION_RIGHT 1
231
+ #endif
232
+ #ifndef GEA_CSS_POSITION_RIGHT_PERCENT
233
+ #define GEA_CSS_POSITION_RIGHT_PERCENT 1
234
+ #endif
235
+ #ifndef GEA_CSS_POSITION_BOTTOM
236
+ #define GEA_CSS_POSITION_BOTTOM 1
237
+ #endif
238
+ #ifndef GEA_CSS_POSITION_BOTTOM_PERCENT
239
+ #define GEA_CSS_POSITION_BOTTOM_PERCENT 1
240
+ #endif
241
+ #ifndef GEA_CSS_POSITION_LEFT
242
+ #define GEA_CSS_POSITION_LEFT 1
243
+ #endif
244
+ #ifndef GEA_CSS_POSITION_LEFT_PERCENT
245
+ #define GEA_CSS_POSITION_LEFT_PERCENT 1
246
+ #endif
247
+
248
+ #define GEA_CSS_POSITION_PX_ALL (GEA_CSS_POSITION_TOP && GEA_CSS_POSITION_RIGHT && GEA_CSS_POSITION_BOTTOM && GEA_CSS_POSITION_LEFT)
249
+ #if GEA_CSS_POSITION_PX_ALL
250
+ #define GEA_CSS_POSITION_PX_0(style) ((style).pos_offsets[0])
251
+ #define GEA_CSS_POSITION_PX_1(style) ((style).pos_offsets[1])
252
+ #define GEA_CSS_POSITION_PX_2(style) ((style).pos_offsets[2])
253
+ #define GEA_CSS_POSITION_PX_3(style) ((style).pos_offsets[3])
254
+ #else
255
+ #define GEA_CSS_POSITION_PX_0(style) ((style).pos_top)
256
+ #define GEA_CSS_POSITION_PX_1(style) ((style).pos_right)
257
+ #define GEA_CSS_POSITION_PX_2(style) ((style).pos_bottom)
258
+ #define GEA_CSS_POSITION_PX_3(style) ((style).pos_left)
259
+ #endif
260
+ // The selector must be a compile-time constant: no runtime edge mapping.
261
+ #define GEA_CSS_POSITION_PX(style, side) \
262
+ (std::integral_constant<int, (side)>::value == 0 ? GEA_CSS_POSITION_PX_0(style) : \
263
+ std::integral_constant<int, (side)>::value == 1 ? GEA_CSS_POSITION_PX_1(style) : \
264
+ std::integral_constant<int, (side)>::value == 2 ? GEA_CSS_POSITION_PX_2(style) : GEA_CSS_POSITION_PX_3(style))
265
+
266
+ #define GEA_CSS_POSITION_PERCENT_ALL (GEA_CSS_POSITION_TOP_PERCENT && GEA_CSS_POSITION_RIGHT_PERCENT && GEA_CSS_POSITION_BOTTOM_PERCENT && GEA_CSS_POSITION_LEFT_PERCENT)
267
+ #if GEA_CSS_POSITION_PERCENT_ALL
268
+ #define GEA_CSS_POSITION_PERCENT_0(style) ((style).pos_offset_percent[0])
269
+ #define GEA_CSS_POSITION_PERCENT_1(style) ((style).pos_offset_percent[1])
270
+ #define GEA_CSS_POSITION_PERCENT_2(style) ((style).pos_offset_percent[2])
271
+ #define GEA_CSS_POSITION_PERCENT_3(style) ((style).pos_offset_percent[3])
272
+ #else
273
+ #define GEA_CSS_POSITION_PERCENT_0(style) ((style).pos_percent_top)
274
+ #define GEA_CSS_POSITION_PERCENT_1(style) ((style).pos_percent_right)
275
+ #define GEA_CSS_POSITION_PERCENT_2(style) ((style).pos_percent_bottom)
276
+ #define GEA_CSS_POSITION_PERCENT_3(style) ((style).pos_percent_left)
277
+ #endif
278
+ // The selector must be a compile-time constant: no runtime edge mapping.
279
+ #define GEA_CSS_POSITION_PERCENT(style, side) \
280
+ (std::integral_constant<int, (side)>::value == 0 ? GEA_CSS_POSITION_PERCENT_0(style) : \
281
+ std::integral_constant<int, (side)>::value == 1 ? GEA_CSS_POSITION_PERCENT_1(style) : \
282
+ std::integral_constant<int, (side)>::value == 2 ? GEA_CSS_POSITION_PERCENT_2(style) : GEA_CSS_POSITION_PERCENT_3(style))