Measure only while true; a host in another mode pays nothing.
iOS Safari keeps the layout viewport at full height and scrolls the page instead; the visual viewport is the one signal that reflects the keyboard on every platform. While the keyboard is up the host gives up its height (layout minus visual), rides the visual viewport's offset so it stays put while Safari scrolls the layout under it, and the page is scrolled back to the top as the keyboard changes and once as it goes. Only the keyboard counts: the address bar showing or hiding and a pinch zoom leave the host alone.
Meant for a host that fills a page that does not scroll. There, Chrome's address bar never hides,
so the visual viewport's readings stay right; on a page that scrolls, use the 'float' mode.
Re-renders with the visual viewport while enabled.
The room a host that is the page makes for the virtual keyboard (the
'resize'VirtualKeyboardMode): it shrinks to the part of the screen the keyboard leaves. Apply the result to the host's own box, e.g.height: calc(100% - ${inset}px)andtransform: translateY(${offsetTop}px).