Context
Found by reading while scoping #18874, where measure is the nearest sibling of the read that ticket adds. Verified at dev@b13719d1c1 by reading only: nothing in the repository exercises the branch, so there is no runtime sighting. Captured first as an A2A defect-note (2026-09-18), promoted here on the operator's escalation so it is not lost.
The Problem
Neo.main.DomAccess.measure({id, value}) converts one CSS length to px. For any unit other than px / % it sizes an off-screen measuring div and is meant to read that div's computed width back. It reads the original node's instead:
const elStyle = node.ownerDocument.defaultView.getComputedStyle(node);
…
d.style.width = value;
value = elStyle.width;
So measure({id, value: '2em'}) answers the node's own width, as a String ('412px'), where its caller component.Base#measure documents Promise<number>. Unchanged since the method arrived in 16c9246418 (2023-09-10, floating auto-align, #4851).
The Architectural Reality
src/main/DomAccess.mjs:778 measure — a remote method (the remote.app list, :84).
- Callers, repo-wide (
grep -rnE "\bmeasure\(" over src apps examples test learn): two.
src/component/Base.mjs:1669 measure(value) forwards to the remote. Nothing calls it, today or at the introducing commit.
DomAccess#getBoundingClientRect (:498, :501) passes the computed min-width / min-height. A computed length is already px, so from here only the parseFloat branch runs; the comment above it ("in other units like em/rem etc") names a case the computed style has already resolved.
- Both callers gate on
lengthRE = /^\d+\w+$/ (DomAccess.mjs:9, component/Base.mjs:17). Measured with node -e: 14.4px, 1.5em and 50% all fail it. Consequences, by reading:
- a computed
min-width of 14.4px (0.9em at 16px) never lands on the rect, so Rectangle#constrainTo (src/util/Rectangle.mjs:357, me.minWidth || me.width) takes the current width as the minimum and answers false for any tighter constraint;
component.measure('1.5em') and component.measure('50%') return their input String unchanged;
- the
% branch (always the offsetParent's height, for a width too) is reachable only through a direct remote call.
Net: the unit branch is wrong and unreachable from engine code today; what IS reachable is the regex gap on fractional computed minimums.
The Fix
Recommended (A) — keep the documented contract and make it true:
measure: read getComputedStyle(d).width, parseFloat it, return a Number on every branch.
lengthRE at both sites: admit a fractional number. Decide % explicitly — axis-correct and reachable, or removed; the PR says which.
- Arms in the component tier (the defect IS which node's computed style is read, so it needs a real DOM):
2em on a node with a known font-size answers 2 × font-size as a Number, not the node's width — red first; a fractional computed min-width lands on the rect.
Alternative (B) — delete the unreachable surface: component.Base#measure plus the unit and % branches, leaving parseFloat for the rect's computed minimums. Falsifier for A over B: a public remote and a public component method can have workspace callers this repository cannot see, so B is a breaking removal and the operator's release call. Falsifier for B over A: if no consumer is ever named, A maintains code nothing runs.
Contract Ledger
| Target surface |
Source of authority |
Proposed behaviour |
Fallback |
Docs |
Evidence |
Neo.main.DomAccess.measure (remote) |
src/main/DomAccess.mjs:778 |
a Number of px for any CSS length; the unit branch reads the measuring div |
none |
method docblock, @returns {Number} |
red-first component arm |
Neo.component.Base#measure |
src/component/Base.mjs:1669 |
signature unchanged; fractional lengths reach the remote |
none |
docblock |
arm |
rect.minWidth / rect.minHeight from getBoundingClientRect |
src/main/DomAccess.mjs:497 |
fractional computed minimums are reported |
none |
— |
arm |
Decision Record impact: none.
Acceptance Criteria
Out of Scope
- The natural-size read #18874 adds beside
measure — a different question (an element's own height, batched across ids).
- Floating / align behaviour beyond the min-size report.
Avoided Traps
- Fixing only the readback:
getComputedStyle(d).width still answers '32px', a String.
- An arm in the unit tier over a stubbed DOM: a stub cannot tell which node's style was read.
Related
#18874 — scoped beside this method; found there.
Live latest-open sweep: latest 20 open issues read at 2026-09-18T12:58:15Z, no equivalent. A2A in-flight sweep: newest inbox rows to 12:57:16Z, no claim on this surface. Content grep (DomAccess[.#]measure|measuringDiv over resources/content/issues + discussions): no hit.
MC sweep: DomAccess measure em rem length converted to px returns the node's own width as a String, measuring div, minWidth minHeight floating align, 6 results, no prior decision found (the one hit is this finding's own turn).
Own-assignment sweep: 5 open, none overlapping (#18874 names measure as a sibling, not this defect).
unowned-rationale: latent — no engine caller reaches the wrong branch — small, and claimable by any seat; the filer's lane is #18874, the same file but a different method.
Origin Session ID: 1ef6c04a-10f6-4977-ad7d-0e2c7f343c59
Retrieval Hint: "DomAccess measure em readback wrong node String lengthRE fractional"
Context
Found by reading while scoping #18874, where
measureis the nearest sibling of the read that ticket adds. Verified at dev@b13719d1c1 by reading only: nothing in the repository exercises the branch, so there is no runtime sighting. Captured first as an A2A defect-note (2026-09-18), promoted here on the operator's escalation so it is not lost.The Problem
Neo.main.DomAccess.measure({id, value})converts one CSS length to px. For any unit other thanpx/%it sizes an off-screen measuringdivand is meant to read that div's computed width back. It reads the original node's instead:const elStyle = node.ownerDocument.defaultView.getComputedStyle(node); // :788 — the node … d.style.width = value; // :806 — the measuring div // Read back the resulting computed pixel width value = elStyle.width; // :809 — the node againSo
measure({id, value: '2em'})answers the node's own width, as a String ('412px'), where its callercomponent.Base#measuredocumentsPromise<number>. Unchanged since the method arrived in 16c9246418 (2023-09-10, floating auto-align,#4851).The Architectural Reality
src/main/DomAccess.mjs:778measure— a remote method (theremote.applist,:84).grep -rnE "\bmeasure\("oversrc apps examples test learn): two.src/component/Base.mjs:1669measure(value)forwards to the remote. Nothing calls it, today or at the introducing commit.DomAccess#getBoundingClientRect(:498,:501) passes the computedmin-width/min-height. A computed length is already px, so from here only theparseFloatbranch runs; the comment above it ("in other units like em/rem etc") names a case the computed style has already resolved.lengthRE = /^\d+\w+$/(DomAccess.mjs:9,component/Base.mjs:17). Measured withnode -e:14.4px,1.5emand50%all fail it. Consequences, by reading:min-widthof14.4px(0.9emat 16px) never lands on the rect, soRectangle#constrainTo(src/util/Rectangle.mjs:357,me.minWidth || me.width) takes the current width as the minimum and answersfalsefor any tighter constraint;component.measure('1.5em')andcomponent.measure('50%')return their input String unchanged;%branch (always theoffsetParent's height, for a width too) is reachable only through a direct remote call.Net: the unit branch is wrong and unreachable from engine code today; what IS reachable is the regex gap on fractional computed minimums.
The Fix
Recommended (A) — keep the documented contract and make it true:
measure: readgetComputedStyle(d).width,parseFloatit, return a Number on every branch.lengthREat both sites: admit a fractional number. Decide%explicitly — axis-correct and reachable, or removed; the PR says which.2emon a node with a known font-size answers2 × font-sizeas a Number, not the node's width — red first; a fractional computedmin-widthlands on the rect.Alternative (B) — delete the unreachable surface:
component.Base#measureplus the unit and%branches, leavingparseFloatfor the rect's computed minimums. Falsifier for A over B: a public remote and a public component method can have workspace callers this repository cannot see, so B is a breaking removal and the operator's release call. Falsifier for B over A: if no consumer is ever named, A maintains code nothing runs.Contract Ledger
Neo.main.DomAccess.measure(remote)src/main/DomAccess.mjs:778@returns {Number}Neo.component.Base#measuresrc/component/Base.mjs:1669rect.minWidth/rect.minHeightfromgetBoundingClientRectsrc/main/DomAccess.mjs:497Decision Record impact: none.
Acceptance Criteria
measureanswering the node's width for anemlength on dev, and2 × font-sizeas a Number after the fix.measurereturns a Number on every branch.min-width/min-heightis reported on the rect (arm).%branch is either axis-correct and reachable, or removed — the PR says which and why.Out of Scope
measure— a different question (an element's own height, batched across ids).Avoided Traps
getComputedStyle(d).widthstill answers'32px', a String.Related
#18874 — scoped beside this method; found there.
Live latest-open sweep: latest 20 open issues read at 2026-09-18T12:58:15Z, no equivalent. A2A in-flight sweep: newest inbox rows to 12:57:16Z, no claim on this surface. Content grep (
DomAccess[.#]measure|measuringDivoverresources/content/issues+discussions): no hit. MC sweep:DomAccess measure em rem length converted to px returns the node's own width as a String, measuring div, minWidth minHeight floating align, 6 results, no prior decision found (the one hit is this finding's own turn). Own-assignment sweep: 5 open, none overlapping (#18874 namesmeasureas a sibling, not this defect).unowned-rationale: latent — no engine caller reaches the wrong branch — small, and claimable by any seat; the filer's lane is #18874, the same file but a different method.
Origin Session ID: 1ef6c04a-10f6-4977-ad7d-0e2c7f343c59 Retrieval Hint: "DomAccess measure em readback wrong node String lengthRE fractional"