What do you get if you serialize the computed value of --x here?
<div data-x="calc(1px + 2px)">
div { --x: attr(data-x length); }
I think we expect eager simplification (3px), and generally we may need something like the equivalent token sequence (but for non-computed values)?