[fix](trx-frontend-http): fill the map column down to the footer
The windowed map was capped at 75% of the viewport height and at a width-derived aspect ratio, which left a dead band under it: 69px at 1600x950, and on a 420px-wide phone a 270px map on an 800px screen. Neither cap was doing useful work now that the stage spans the full width, so the map fills the column down to the footer instead. Growing into the footer needs a bound: once the column is tall enough to push the footer below the fold, using its position would push it further on every pass, so the bottom edge is clamped to the viewport. Growth then consumes the column's spare height and settles in one pass. Also drops three mapIsFullscreen() branches in the windowed path that could never be taken — the fullscreen case returns above them. Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -237,11 +237,18 @@ try {
|
||||
right: Math.round(rect.right),
|
||||
viewport: document.documentElement.clientWidth,
|
||||
sideways: document.documentElement.scrollWidth > document.documentElement.clientWidth + 1,
|
||||
gapToFooter: Math.round(document.querySelector(".footer").getBoundingClientRect().top - rect.bottom),
|
||||
pageScrolls: document.documentElement.scrollHeight > document.documentElement.clientHeight + 1,
|
||||
};
|
||||
});
|
||||
assert.equal(stage.left, 0, `map stage starts at ${stage.left}px, not the viewport edge`);
|
||||
assert.equal(stage.right, stage.viewport, `map stage ends at ${stage.right}px, not ${stage.viewport}px`);
|
||||
assert.equal(stage.sideways, false, "full-bleed map makes the page scroll sideways");
|
||||
// ...and fills the column down to the footer. Capping the height at a
|
||||
// fraction of the viewport left a dead band that grew with the window.
|
||||
assert.ok(stage.gapToFooter <= 16,
|
||||
`${stage.gapToFooter}px of dead space between the map and the footer`);
|
||||
assert.equal(stage.pageScrolls, false, "the map grew past the viewport");
|
||||
|
||||
await page.locator('.tab[data-tab="main"]').click();
|
||||
assert.equal(new URL(page.url()).pathname, "/");
|
||||
|
||||
Reference in New Issue
Block a user