gui tests: text-size scrolls its control to below the Settings tabs held at the top

8f55c27ad (#2396) holds Settings' tabs at the view's top. "100% picked at
the foot of the page" scrolled until the 100% button was within 60px of
the view's top, which is now under that head, and the click timed out on
"<div class="row-head set-head stuck"> intercepts pointer events" in both
engines (20/2 on origin/main 1a16fc0b5). It stops 60px under the head's
foot now, as a reader could still click it.

Run: text-size 22/0 (chromium, webkit) at 1a16fc0b5 + this change.
This commit is contained in:
yetone
2026-10-16 03:55:46 +08:00
parent 056cfe3323
commit d3ca90afcc
+3 -2
View File
@@ -217,10 +217,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const v = page.locator("#view-settings");
await v.hover();
// down as far as the control is still in sight: to the foot, or the
// control at the view's top
// control just under the view's top, below the tabs held there
// (#2396) as they would cover it
for (let i = 0; i < 400; i++) {
if (await v.evaluate((v) => v.scrollTop >= v.scrollHeight - v.clientHeight - 1
|| document.querySelector("#textSizeSegs").getBoundingClientRect().top < v.getBoundingClientRect().top + 60)) break;
|| document.querySelector("#textSizeSegs").getBoundingClientRect().top < Math.max(v.getBoundingClientRect().top, v.querySelector(":scope > .set-head").getBoundingClientRect().bottom) + 60)) break;
await page.mouse.wheel(0, 40);
await page.waitForTimeout(20);
}