Stable Scroll Test with fixed-vh-polyfill

This page tests the stable operation of a module that fixes viewport height units (lvh, svh) in certain iOS in-app browsers, Firefox, and Arc Browser.

Problem

Some browsers treat lvh, svh, and dvh values identically or with incorrect values during initial loading.

Specifically, svh values cannot be parsed at load time and are accurately calculated only when the first touch scroll begins.

Test Method

Left boxes: Use browser default 100lvh and 100svh values. In problematic iOS browsers, they behave like dvh with variable heights.

Right boxes: Use CSS variables --fvh, --lvh and --svh for height settings. The module is applied to maintain stable scroll positions.

Notes

Screen flickering in some browsers appears to be a rendering (painting) issue rather than actual scroll position changes.

Currently distinguishes between touch and mouse scrolling by inference, which may not be perfect. Non-touch scrolling assumes viewport size doesn't change.

Compare: With vs Without Polyfill.

Module On
CSS Height: 100lvh (Browser default)
CSS Height: 100svh (Browser default)
CSS Height: calc(100 * var(--fvh)); - Fixed Viewport Height
CSS Height: calc(100 * var(--lvh)); - Fixed Large Viewport Height
CSS Height: calc(100 * var(--svh)); - Fixed Small Viewport Height
Card 1 - 200lvh
Card 2 - 100vh
Card 3 - 100svh
Card 4 - 100lvh
Card 5 - 75svh
Card 6 - 75lvh
Card 7 - 75vh
Card 8 - 100vh