#1100·obscura

SVGGeometryElement.getTotalLength() not implemented (prototype chain exists, method throws)

Author: Arman-noCreated Sep 27, 2026Updated Sep 27, 2026

Description

getTotalLength() on SVG path/line elements throws TypeError: ... is not a function at runtime, even though the SVGGeometryElement/SVGPathElement prototype chain is otherwise implemented correctly (instanceof checks pass).

Repro

Any page that calls element.getTotalLength() on a real <path> or <line> SVG element (e.g. for a stroke-draw / "draw SVG" animation) throws instead of returning the path length.

Console output when hit via GSAP-driven stroke animation:

WARN obscura::console: Invalid property strokeDashoffset set to 100
ERROR obscura::console: Timer error: TypeError: l.getTotalLength is not a function
    at buildViz (script.js:2025:21)
    at App.onReveal.vStart (script.js:2211:21)

(The "Missing plugin?" wording in the first warning is GSAP's own generic message when a property write silently fails — misleading here, since the real cause is the missing DOM method, not a missing GSAP plugin.)

Root cause (source-verified)

In obscura-js/src/runtime.rs / bootstrap.js: the SVGGeometryElement/SVGPathElement prototype chain is implemented (confirmed via the existing instanceof / prototype-chain test), but no geometry-length computation backs getTotalLength() — the method is simply missing from the prototype, so calling it throws.

Impact

Any page using standard SVG stroke-draw animations (a very common pattern, e.g. via GSAP DrawSVGPlugin-style code, or hand-rolled stroke-dasharray/stroke-dashoffset animation keyed off path length) will throw at runtime under Obscura, even though the same code runs correctly in every real browser.