verify / internal · noindexsections 01 – 16

Verify

Three phases of correctness work, most of which has no UI surface — engine internals, CI gates, packaging, README numbers. This page renders the parts that can be seen, so they can be checked by eye instead of taken on trust. Every section states what was broken, then demonstrates it live in this browser.

Phases
3
Sections
16
Live proofs
13
Not yet proven
6
0Phase 0Honesty & hygiene
  • 5 false README claims
  • CI red on main
  • library never typechecked
  • 3 engine bugs
  • 2 CLI bugs
§ 01 – 05
1Phase 1Real browsers
  • native CSS ≠ JS engine
  • CDN build crashed
  • idle CPU burn
  • scrollSnap ignored a11y
  • morphTo silently wrong
§ 06 – 09
2Phase 2The rest of the surface
  • scrollHorizontal never moved
  • destroy() abandoned styles
  • onSnap fired twice
  • viewport override in the harness
  • no Range support = dead video
§ 10 – 15
OpenNot yet proven
  • 6 limits, kept up to date
§ 16
Fig. 1 — the revision record: what each phase found, and where on this sheet it is re-run
0Phase 0sections 01 – 05

Honesty and hygiene.

Nothing here needed a browser to find. The package was advertising numbers that were measurably wrong, its own CI had been failing on every push, and the library was never typechecked — so a type error shipped in the engine and sat there across releases.

Coverage
74.6% → 85.9%, gate now passes
Tests
425 → 475
Size claim
~4.4 KB advertised, 9.0 KB real
Guards added
size budgets + doc-claim checker in CI
010 phase 0live proof#

Generated Vue & Svelte files had an inert stroke.

The starter file from npx svg-scroll-draw init used JSX-style attribute names in HTML-parsed templates. Both graphics below request an identical 2.5px round stroke. Only one gets it.

Fig. 01live — measured in this browser
strokeWidth="2.5"before

what Vue / Svelte users generated

parsed attributes…

stroke-width="2.5"after

what they get now

parsed attributes…

WAIT
The left path asked for a 2.5px round stroke and rendered a 1px butt-capped hairline. The HTML parser lowercased strokeWidth to strokewidth, which is not an SVG attribute, so it was discarded. Every Vue and Svelte starter file from npx svg-scroll-draw init shipped this.
020 phase 0live proof#

getProgress() was frozen at zero.

For every autoplay stroke animation, currentAlpha was only assigned on the clip-path branch — so the public getProgress() API reported 0.000 forever. The readout below is polled every frame from the real instance.

Fig. 02live — measured in this browser
getProgress()0.000
peak seen0.000
WAIT
Not measured yet — this autoplay only starts once its container enters the viewport. Scroll it fully into view and the readout above will begin ticking.
030 phase 0live proof#

Off-screen pause/resume burned the animation out.

Leaving the viewport set startTime = null. Because null coerces to 0, a later pause() recorded the whole timestamp since page load as elapsed time — so resume() started a run already past its own duration and completed instantly, invisibly.

Fig. 03live — measured in this browser
idle — press the button
040 phase 0measured#

Every size figure is now measured.

The README claimed ~4.4 KB against a real 8.9 KB, directly beneath a bundlephobia badge showing the true number. These come from npm run size, which reads the built output and fails CI if any entry drifts past its budget.

Entry pointRawGzippedGzipped, against the main entry
svg-scroll-draw27.1 KB9.0 KB
svg-scroll-draw/group23.6 KB7.6 KB
svg-scroll-draw/reveal9.2 KB3.9 KB
svg-scroll-draw/timeline7.0 KB3.0 KB
svg-scroll-draw/text5.4 KB2.3 KB
svg-scroll-draw/video3.9 KB1.9 KB
svg-scroll-draw/pin3.3 KB1.5 KB
svg-scroll-draw/snap2.5 KB1.3 KB
svg-scroll-draw/lenis0.4 KB0.2 KB

9 of 21 entries shown — the full table lives in README.md.

050 phase 0record#

Claims that were wrong, and now can't be.

scripts/check-claims.mjs derives the real test and example counts from source and fails the build when a doc disagrees. It caught a stale number mid-session, which is the only reason this table is right.

Bundle size (main entry)measured from dist/was ~4.4 KBis 9.0 KB
Raw ESM sizemeasured from dist/was 11.9 KBis 27.1 KB
Test countread from vitestwas 272is 531
Example countread from ExamplesPagewas 13is 23
Smaller than GSAP bymain entrywas 8–10×is ~4×
Coverage gateagainst 91.3% realwas 90 / 90 / 85 / 80is 90 / 90 / 82 / 82
1Phase 1sections 06 – 09

What a real browser found.

Phase 0 could not prove the library worked, only that its paperwork was honest — every unit test, 478 of them at the time, ran in jsdom with getTotalLength stubbed and IntersectionObserver faked. A Playwright suite across Chromium, Firefox and WebKit now runs in CI, and the first thing it did was disprove the library's headline claim.

Browser tests
30, across Chromium · Firefox · WebKit
Bugs found
5, none of them findable in jsdom
Headline claim
was false — native CSS ≠ JS engine
Worst divergence
0.114 in WebKit → now 0.0000
061 phase 1live proof#

Native CSS and the JS engine disagreed.

The library's headline claim is that the native CSS fast path and the JS engine are interchangeable. Nothing verified it, and it was false. Below, the same SVG is drawn twice at the same scroll offset — left on whatever the browser supports, right with native: false forced. Scroll slowly and watch Δ.

Fig. 06live — measured in this browser
native CSS view-timeline0.0000
JS engine (native: false)0.0000
live Δ (while you scroll)0.0000
worst Δ in sweep—
native supportedno
fast path engagedno
WAIT
This browser reports no scroll-driven animation support, so both boxes run the JS engine and Δ is trivially 0. That fallback is itself worth checking — Firefox before 159 takes exactly this path.
071 phase 1live proof#

The CDN build crashed in a plain browser.

Every dev warning in 13 modules was guarded by a bare process.env.NODE_ENV check. process does not exist in a browser without a bundler, so reaching a warning threw instead of logging one. Both guards are evaluated below in a scope that has no process.

Fig. 07live — measured in this browser

iframe · no process in scopeResult

beforeprocess.env.NODE_ENV !== 'production'

…

aftertypeof process !== 'undefined' && typeof process.env !== 'undefined' && …

…

WAIT
Both expressions were just evaluated inside a fresh iframe — a scope with no bundler-injected process, exactly what a CDN user has. The old guard sat in front of every dev warning in 13 modules, so reaching one threw instead of logging. The concrete repro: style a path’s stroke with CSS instead of a stroke attribute, and the engine’s “no stroke” warning took down the whole call.
081 phase 1live proof#

The JS engine worked while the page sat still.

The rAF loop ran every frame for as long as the container was in view, whether or not the scroll position had moved — recomputing values that had not changed. This is the path Firefox and every pre-115 browser always take, so it is not a niche case.

Fig. 08live — measured in this browser
parked (1s)—
scrolling (1s)—
ratio—

Both figures are baseline-subtracted: the page is timed once with no instances, then again with 8 alive. Without that subtraction this readout is dominated by React and the other live proofs on this page, which poll every frame — it read 1.6× where the isolated e2e fixture reads 7×.

WAIT
Press the button. Before the fix the rAF loop did identical work whether or not the user was scrolling: 8 instances parked in a viewport cost 6.4 ms per second in Chromium, recomputing values that had not changed.
091 phase 1live proof#

scrollSnap overrode prefers-reduced-motion.

The clearest accessibility defect in the library, and the readout below is live against your own OS setting.

Fig. 09live — measured in this browser
your OS preference…
scrollSnap would…

This readout is live — toggle Reduce motion in System Settings → Accessibility → Display and it updates without a reload. That is the same listener the library now uses.

PASS
scrollSnap animates window.scrollTo over a duration with an easing curve, driven off a debounced scroll handler — it takes over the user’s scrolling. It had no reduced-motion check of any kind, which was the clearest accessibility defect in the library. It now jumps straight to the target section; snapping still happens, only the animated scroll is dropped. respectReducedMotion: false is the documented opt-out.
2Phase 2sections 10 – 15

Everything else.

Phase 1 examined one API in a real browser and found five bugs. Everything else was unexamined, so this phase went through the rest of the surface: the other nine APIs, then Group / Sequence / Timeline / Cinematic, then scrollAnimate's own native fast path, then all eight framework wrappers and the CDN builds, and finally the same code again with no DOM at all. It found the worst defect of the three phases — an API that did nothing in the arrangement its own documentation prescribed — and ten more after that, including a server-side import that crashed the render and a CDN bundle shipping without the component it advertises. Sections 10–12 show three of them, and 13–15 the three 2.10.0 fixes; the rest are in the changelog for 2.10.0.

Browser tests
30 → 175, on all three engines
Defects found
14 in the library, 2 in the test harness
Worst of them
scrollHorizontal never moved the track
New guard
every test must fail against a broken build
102 phase 2live proof#

scrollHorizontal never moved the track.

The worst defect in three phases of this work. The default trigger window was measured against the track itself — and a sticky stage pins that track at exactly one stage tall, so both ends of the window resolved to the same scroll position. Progress was then clamped at zero forever. The API did nothing, in precisely the CSS setup its own docs prescribe.

Fig. 10live — measured in this browser

old — trigger measured on the pinned track

01
02
03
04
05

new — trigger measured on the container that holds the scroll

01
02
03
04
05

scroll inside this box ↕

old progress—
new progress—
WAIT
Scroll inside the box. The lower strip travels through all five panels; the upper one never moves at all, and its progress readout stays at 0.000 no matter how far you scroll. That upper strip is not a mock-up — it is the current library with triggerElement pointed at the track, which is precisely what the engine measured before this fix. The API had 100% line coverage in jsdom the whole time it was broken: every rect there is 0, so the window is equally degenerate and looks identical to a working one.
112 phase 2live proof#

destroy() left elements stranded mid-animation.

The engine wrote opacity and transform inline every frame and removed neither on teardown. Destroy a component while its reveal was half-finished and it stayed half-finished — permanently faded and offset, with nothing left running to correct it. Worse for the visitor than never animating at all.

Fig. 11live — measured in this browser

old teardown

Still here?

style="" (nothing yet)

after the fix

Still here?

style="" (nothing yet)

WAIT
Press the button. Both boxes are driven by the real engine and destroyed at the same progress — the difference is only what destroy() leaves behind.
122 phase 2live proof#

onSnap fired twice for a single snap.

scrollSnap reacted to the scroll event its own animated scroll produced, treating it as a fresh user gesture and announcing a snap it had already announced. Guaranteed under reduced motion, intermittent otherwise — a public callback that fires once or twice depending on the easing curve.

Fig. 12live — measured in this browser
01section one
02section two
03section three
snaps requested0
onSnap calls0
your OS preference…
WAIT
Press a snapTo() button. The two counters must stay equal.
132 phase 2live proof#

A finished sequence reported 0%.

scrollDrawSequence delegates getProgress() to whichever step is active. When the last step completed, the active index advanced past the end of the array, so the getter read from an undefined instance and fell back to zero — a sequence that had visibly finished reported that nothing had happened.

Fig. 13live — measured in this browser

01Code

02Build

03Ship

getProgress()0.000
peak seen0.000
onComplete—
WAIT
Scroll until all three have drawn. The number to watch is what getProgress() reports After the last one finishes.
142 phase 2live proof#

split: 'lines' deleted the spaces between words.

The only one of the three you can see without instrumentation. splitIntoLines groups words by offsetTop, and the whitespace nodes between them were dropped rather than reinserted — so a split headline rendered as one unbroken word. The sentence below is the test: read it.

Fig. 14live — measured in this browser

Every word here should still be separated by a space after splitting.

spaces before—
spaces after—
splitlines
WAIT
Measuring…
152 phase 2live proof#

A named easing drew a different curve on the native path.

Section 06 proves the two engines agree on the default curve, where there is nothing to get wrong. Before 2.10.0 the native path handed CSS the keyword of the same name — ease-out became animation-timing-function: ease-out — but the keywords are fixed cubic-béziers and this library’s easings are its own curves, so the two engines drew up to 0.069 apart mid-scroll. The same SVG below runs easing: 'ease-out' on both.

Fig. 15live — measured in this browser
JS fallback · ease-out0.0000
JS forced · ease-out0.0000
Steps through 10 offsets, waits for both engines to settle at each, then compares.
WAIT
Press the button. The verdict deliberately does not come from the live meter above — after a scroll jump the compositor and the JS engine are legitimately a frame or two apart, and reading that as a divergence reports bugs that do not exist.
16limits#

What still is not proven.

The limits, kept up to date rather than quietly dropped as they shrink.

  1. 011077 unit tests are still jsdomgetTotalLength is stubbed to a constant and IntersectionObserver is faked. They verify engine arithmetic. The 359 Playwright tests per engine are what cover browser behaviour — now run on GitHub Actions before every release, not only on one laptop — and a separate suite with no DOM at all covers what happens on a server.
  2. 02The wrappers are tested through their contracts, not their build pipelinesAll eight now mount for real and are held to the same contract — the engine runs, unmounting leaks no observer and no frame loop, re-mounting works. But Svelte is exercised through its action functions rather than a compiled component, and Angular through its ref classes rather than a running Angular app. That is the whole public surface in both cases, and it is still not the same as a real build.
  3. 03Every wrapper follows its options, and that is all it checksSince 2.17.0 the React, Vue, Nuxt, Solid, Svelte and Angular wrappers rebuild the engine when an option really changes, and keep it when a re-render passes equal options: a fresh inline object, a new callback. Since 2.19.0 Astro and <scroll-draw> do too: the element watches its option attributes and the Astro scanner its JSON attribute, and running the scanner again keeps the engine it started. The browser suite checks both halves on every engine, through the options each wrapper takes — not through every way a framework can change them.
  4. 04This page found a bug the e2e suite missedSection 06 kept reporting a constant 0.0201 offset. Trigger points were cached at init and only recomputed on a window resize, so a 21px layout shift during hydration left the JS engine permanently offset while the native CSS path stayed correct. Now fixed with a ResizeObserver — but only a busy, real page surfaced it, which says something about how much the isolated fixtures can prove.
  5. 05And the e2e suite caught this page outSection 15 was withheld for months because its harness measured the two engines 0.83 apart with easing: "ease-out". The suite’s own ease-out case had passed all along. The page was wrong: the native cell was keyed by its label, the label changed once support was detected, and React replaced that cell after the library had attached to it — leaving a fresh, undrawn path that read as fully drawn. Keyed by role, it reads 0.0001. Both sweeps also jump instantly now; this page scrolls smoothly, and a smooth jump was still gliding when the samples were read.
  6. 06Dev warnings still need opting intoThey were unreachable for CDN users entirely: IS_DEV is derived from process.env.NODE_ENV, and process does not exist in a browser without a bundler. 2.10.0 ships svg-scroll-draw.dev.global.js, which reports them — but you have to know to load it, and the production bundle has them removed at build time.
recas merged

v2.10.0, merged to main · 531 unit tests + 175 browser tests per engine (525 runs across Chromium, Firefox and WebKit) · 56 mutations, each caught by the one test named for it · 91% line coverage · npm run verify and npm run test:e2e both exit 0