Cause: 18e82adc6 (the sidebar) added heldWidth, which lets go of what the
last click held when the window's width changes. Before it, the held
click's ResizeObserver followed the page as it grew back. text-size's
#911 case scrolls Settings to its foot and then resizes the window
across SIDE_AT (960 to 1440). In WebKit the scroll is clamped to each
layout the page passes through:
1. scrollTop goes from 120 to 46 on the resize;
2. after the side-nav swap the max is 10, so scrollTop is 10;
3. about 40ms later a part grows 6px (max 16), but nothing moves the
scroll back.
So the page ends 6px short of its foot, and 3 of text-size's 11 subtests
fail in WebKit, run alone.
Change: on a width change, for a second, a ResizeObserver on the open
view's parts calls backToReader. The reader's own place (readerAt, still
120) is kept, or as far down as the page now goes. It doesn't act while a
click holds the page or while a purposeful scroll runs. Calling
backToReader at the end of layoutNav was tried first and didn't help,
because the growth comes after it. docs/subsystems/gui-shell.md says so.
Run (worktree on origin/main 31c1e3ab1, playwright 1.62.0, chromium-1234
and webkit-2336, each file alone):
- text-size: 11/11 in WebKit, repeated, and 11/11 in Chromium.
Without the change 3 of 11 fail in WebKit, as on 31c1e3ab1.
- 37 files that resize the window and check scroll, or are the
sidebar's: agent-update-all, cli-update, click-scroll, menu-scroll,
panel-usage, sidebar*, side-toggle, sidebar-tab-top, phone-web,
header-zoom-fit, usage-*, settings-groups and others. In both engines,
4 at a time: 73 of 74 green.
The one red is sidebar-overlay-scrollbar in chromium ("dragged to the
end: 162 of 191"). It fails 1 run in 3 alone on unchanged 31c1e3ab1
too, so it is filed as #1863.
- Under parallel load, text-size's "zh, dark: nothing runs off the side
at 150%" sometimes fails on 31c1e3ab1 too ("ResizeObserver loop
completed with undelivered notifications", 2 of 4 runs), and once with
this change ("element not stable"). It passes 3/3 alone and 3/3 in
parallel with the change. Noted on #1672.
Not run: the Windows and Linux apps, and the full GUI suite. No Go code
changed.