iOS Safari: top and bottom edges aren't covered by the backdrop #396

Closed
opened 2026-10-15 03:36:10 +00:00 by kayg · 3 comments
Owner

kayg, 09:03–09:04 on an iPhone (Safari; the screenshots show a status bar, no address bar, 100% opacity, Mountains backdrop): the top and bottom areas are not fixed.

  • Top: the area behind the status bar and the back link is flat grey, not the backdrop.
  • Bottom: below the list (and below the Style sheet) there's a flat grey band about 130 pt tall, the height of Safari's collapsed toolbar plus the home indicator. The backdrop and list don't run behind it.

#304 ("safe areas") and #290 were meant to fix this, and the e2e checks (phone-edges, safe-areas) pass, but they don't reproduce real iOS Safari: its dynamic toolbar, viewport-fit=cover, 100dvh/100lvh, and the theme-color tint.

To do:

  1. Research how iOS 26 Safari paints the regions behind the status bar and the bottom toolbar: theme-color, viewport-fit=cover, fixed backgrounds versus lvh, the backdrop on html/body versus a fixed layer, and the "liquid glass" bottom bar tinting. Cite the sources.
  2. Fix it so the backdrop (and a sheet's dim) reach the very top and bottom edges in Safari and in the home-screen app. Sheets stay floating, as decided.
  3. Write down which of this the tests can't see, and give kayg a precise device checklist.
kayg, 09:03–09:04 on an iPhone (Safari; the screenshots show a status bar, no address bar, 100% opacity, Mountains backdrop): **the top and bottom areas are not fixed.** - **Top:** the area behind the status bar and the back link is flat grey, not the backdrop. - **Bottom:** below the list (and below the Style sheet) there's a flat grey band about 130 pt tall, the height of Safari's collapsed toolbar plus the home indicator. The backdrop and list don't run behind it. #304 ("safe areas") and #290 were meant to fix this, and the e2e checks (phone-edges, safe-areas) pass, but they don't reproduce real iOS Safari: its dynamic toolbar, `viewport-fit=cover`, `100dvh`/`100lvh`, and the theme-color tint. To do: 1. Research how iOS 26 Safari paints the regions behind the status bar and the bottom toolbar: theme-color, `viewport-fit=cover`, fixed backgrounds versus `lvh`, the backdrop on `html`/`body` versus a fixed layer, and the "liquid glass" bottom bar tinting. Cite the sources. 2. Fix it so the backdrop (and a sheet's dim) reach the very top and bottom edges in Safari and in the home-screen app. Sheets stay floating, as decided. 3. Write down which of this the tests can't see, and give kayg a precise device checklist.
Author
Owner

Research and plan (before code)

What the screenshots show (measured, not guessed)

I measured the pixel rows in both screenshots (1186×2576, about 2.95 px per pt):

  • Bottom band: it starts 166 px above the bottom (about 56–62 pt). That's the height of the status bar, not Safari's toolbar. There's no Safari toolbar or URL pill anywhere in the shot, so this is the Home Screen app, not a Safari tab.
  • The band is our own page, not iOS. The + button's shadow runs down into the band, and the + button sits 18 pt + home indicator above the true screen bottom. So position: fixed boxes reach the real bottom of the screen, but the app (height: var(--vh) = 100svh) stops about one status bar short of it. Below the app, the backdrop's .floor fills the gap with the page colour (the glass colour on the list, dimmed paper under a sheet). That's the "flat grey band".
  • Top: the colour is flat from 0 to about 62 pt, then fades over 36 pt. That matches PhoneStack's .edge.top exactly: solid page colour through the safe area, then a 36 px fade. #226 added it so the list would meet a flat-coloured Safari status bar without a seam. In the Home Screen app that flat strip isn't needed.

What the sources say

Home Screen app (standalone), iOS 26.x/27:

  • On iOS 26.5.2, a standalone app measured screen.height 874 but innerHeight / 100dvh / clientHeight 812, a 62 px gap. The report says regular Safari tabs are fine. A WebKit engineer confirmed it on the iOS 27 beta and reopened the bug: WebKit bug 301994 (rdar://184081721). One report in that thread says the system draws the gap, and that its colour is the page background, cached until relaunch.
  • The general viewport regression is still open: WebKit bug 301108, "viewport-fit=cover / height=device-height don't fill the screen".
  • Other projects saw the same short layout, by the top inset, in the iOS 26 Home Screen app: collie #355 (checked on a device; later corrected to min(100lvh, 100dvh + env(safe-area-inset-top)) because a bare lvh overshot on some releases), ander-gym #68 (all CSS units short, so it measures in JS instead), band #681. They disagree on which units are wrong, so no single CSS unit can be trusted here.
  • iOS reads the apple-mobile-web-app-* tags only when the app is added to the Home Screen (band #681).

Safari tab, iOS 26 (liquid glass toolbar):

  • theme-color is no longer used for the bars (safari-color-tinting, 1ar.io, jahir.dev). Safari tints its bars from a position: fixed/sticky element with an opaque background near the edge (within about 4 px of the top or 3 px of the bottom, at least 80% of the width), and otherwise from the body/html background colour. A WebKit engineer says the solid extension only kicks in for a fixed or sticky element near an edge (WebKit bug 301756, comment 2). (We keep theme-color in sync for Chrome/Android.)
  • Safari doesn't paint position: fixed content below its bottom controls (Apple forums 800798, edoardolunardi.dev, WebKit bug 300965/302272). Content in the normal page flow is painted there. That's why #105 moved the backdrop into the page on 26.4+, and why the dim (#293) is absolute, not fixed.
  • With the page at scroll position 0, Safari fills the status-bar strip with the root background colour, not the page pixels. Only a root that has scrolled shows real content up there (1ar.io). Our root never scrolls, so in a Safari tab the top strip will always be one flat colour. That's why it's set to the page's edge colour. Making it scroll would mean a "scroll runway" hack on the root. I'm not doing that here (keyboard, scroll-link and focus all rely on the root staying still).
  • svh/lvh behave as documented in a Safari tab. The short-viewport bug is Home Screen only (301994).

Plan

  1. Home Screen app on iOS: measure, don't trust units. A zero-width position: fixed; top: 0; bottom: 0 probe measures the box that fixed elements actually get, which is the one the + button proves reaches the real bottom. A ResizeObserver on it (no scroll listeners, nothing that repaints on scroll) writes --vh and a new --screen-h on the root, only when they change (page-chrome). Only in iOS standalone (navigator.standalone / display-mode: standalone together with touch WebKit). A Safari tab, Android and desktop keep 100svh / 100lvh. Then the list, the note, the sheets (still floating), the palette and the dim all reach the real bottom.
  2. Home Screen app: no flat strips at the edges. Nothing to blend into there: the status bar is translucent over our page. So PhoneStack's .edge.top/.edge.bottom and the backdrop's .scrim turn off, and the glass and backdrop run to the top and bottom edges. (If iOS draws its own band, as in 301994, nothing in the page can paint there. The root colour stays the matched edge colour, so even that band blends in.)
  3. Backdrop and body size from --screen-h (default 100lvh) instead of a hard-coded 100lvh.
  4. Safari tab: no change in behaviour. The backdrop is already in the page under the toolbar on 26.4+, and the dim reaches both bars (#293). The top strip is Safari's own fill (see above).
  5. Tests: a new spec that models the iOS 26 Home Screen app the way it really breaks: navigator.standalone, and --vh short by the status bar the way WebKit reports svh. It then checks that the list, the note page, a sheet's dim and the backdrop reach the real bottom row, and that nothing flat sits under the status bar. I'll also be clear about what emulation can't show: real Safari chrome, the system-drawn band, and liquid-glass tinting.
## Research and plan (before code) ### What the screenshots show (measured, not guessed) I measured the pixel rows in both screenshots (1186×2576, about 2.95 px per pt): - **Bottom band:** it starts 166 px above the bottom (about **56–62 pt**). That's the height of the **status bar**, not Safari's toolbar. There's no Safari toolbar or URL pill anywhere in the shot, so this is the **Home Screen app**, not a Safari tab. - **The band is our own page, not iOS.** The + button's shadow runs down into the band, and the + button sits 18 pt + home indicator above the **true** screen bottom. So `position: fixed` boxes reach the real bottom of the screen, but the app (`height: var(--vh)` = `100svh`) stops about one status bar short of it. Below the app, the backdrop's `.floor` fills the gap with the page colour (the glass colour on the list, dimmed paper under a sheet). That's the "flat grey band". - **Top:** the colour is flat from 0 to about 62 pt, then fades over 36 pt. That matches PhoneStack's `.edge.top` exactly: solid page colour through the safe area, then a 36 px fade. #226 added it so the list would meet a flat-coloured Safari status bar without a seam. In the Home Screen app that flat strip isn't needed. ### What the sources say **Home Screen app (standalone), iOS 26.x/27:** - On iOS 26.5.2, a standalone app measured `screen.height` 874 but `innerHeight` / `100dvh` / `clientHeight` **812**, a 62 px gap. The report says regular Safari tabs are fine. A WebKit engineer confirmed it on the iOS 27 beta and reopened the bug: [WebKit bug 301994](https://bugs.webkit.org/show_bug.cgi?id=301994) (rdar://184081721). One report in that thread says the system draws the gap, and that its colour is the page background, cached until relaunch. - The general viewport regression is still open: [WebKit bug 301108](https://bugs.webkit.org/show_bug.cgi?id=301108), "viewport-fit=cover / height=device-height don't fill the screen". - Other projects saw the same short layout, by the top inset, in the iOS 26 Home Screen app: [collie #355](https://github.com/AltanS/collie/pull/355) (checked on a device; later corrected to `min(100lvh, 100dvh + env(safe-area-inset-top))` because a bare `lvh` overshot on some releases), [ander-gym #68](https://github.com/anderboski/ander-gym/pull/68) (all CSS units short, so it measures in JS instead), [band #681](https://github.com/band-app/band/pull/681). They disagree on which units are wrong, so **no single CSS unit can be trusted here.** - iOS reads the `apple-mobile-web-app-*` tags only when the app is added to the Home Screen ([band #681](https://github.com/band-app/band/pull/681)). **Safari tab, iOS 26 (liquid glass toolbar):** - `theme-color` is no longer used for the bars ([safari-color-tinting](https://github.com/andesco/safari-color-tinting), [1ar.io](https://1ar.io/updates/safari-26-liquid-glass-web/), [jahir.dev](https://jahir.dev/blog/safari-toolbar)). Safari tints its bars from a `position: fixed`/`sticky` element with an opaque background near the edge (within about 4 px of the top or 3 px of the bottom, at least 80% of the width), and otherwise from the `body`/`html` background colour. A WebKit engineer says the solid extension only kicks in for a fixed or sticky element near an edge ([WebKit bug 301756, comment 2](https://bugs.webkit.org/show_bug.cgi?id=301756)). (We keep `theme-color` in sync for Chrome/Android.) - Safari doesn't paint `position: fixed` content below its bottom controls ([Apple forums 800798](https://developer.apple.com/forums/thread/800798), [edoardolunardi.dev](https://www.edoardolunardi.dev/blog/safari-26-and-the-strange-case-of-fixed-overlays), [WebKit bug 300965](https://bugs.webkit.org/show_bug.cgi?id=300965)/302272). Content in the normal page flow **is** painted there. That's why #105 moved the backdrop into the page on 26.4+, and why the dim (#293) is `absolute`, not `fixed`. - With the page at scroll position 0, Safari fills the status-bar strip with the root background colour, not the page pixels. Only a root that has scrolled shows real content up there ([1ar.io](https://1ar.io/updates/safari-26-liquid-glass-web/)). Our root never scrolls, so in a **Safari tab** the top strip will always be one flat colour. That's why it's set to the page's edge colour. Making it scroll would mean a "scroll runway" hack on the root. I'm not doing that here (keyboard, scroll-link and focus all rely on the root staying still). - `svh`/`lvh` behave as documented in a Safari tab. The short-viewport bug is Home Screen only (301994). ### Plan 1. **Home Screen app on iOS: measure, don't trust units.** A zero-width `position: fixed; top: 0; bottom: 0` probe measures the box that `fixed` elements actually get, which is the one the + button proves reaches the real bottom. A ResizeObserver on it (no scroll listeners, nothing that repaints on scroll) writes `--vh` and a new `--screen-h` on the root, only when they change (page-chrome). Only in iOS standalone (`navigator.standalone` / `display-mode: standalone` together with touch WebKit). A Safari tab, Android and desktop keep `100svh` / `100lvh`. Then the list, the note, the sheets (still floating), the palette and the dim all reach the real bottom. 2. **Home Screen app: no flat strips at the edges.** Nothing to blend into there: the status bar is translucent over our page. So PhoneStack's `.edge.top`/`.edge.bottom` and the backdrop's `.scrim` turn off, and the glass and backdrop run to the top and bottom edges. (If iOS draws its own band, as in 301994, nothing in the page can paint there. The root colour stays the matched edge colour, so even that band blends in.) 3. **Backdrop and body** size from `--screen-h` (default `100lvh`) instead of a hard-coded `100lvh`. 4. **Safari tab:** no change in behaviour. The backdrop is already in the page under the toolbar on 26.4+, and the dim reaches both bars (#293). The top strip is Safari's own fill (see above). 5. **Tests:** a new spec that models the iOS 26 Home Screen app the way it really breaks: `navigator.standalone`, and `--vh` short by the status bar the way WebKit reports `svh`. It then checks that the list, the note page, a sheet's dim and the backdrop reach the real bottom row, and that nothing flat sits under the status bar. I'll also be clear about what emulation can't show: real Safari chrome, the system-drawn band, and liquid-glass tinting.
Author
Owner

Fixed in PR #405 (not merged)

Cause

Your screenshots are from the Home Screen app. On iOS 26/27 it reports 100svh (the app's height) one status bar short (about 62 pt), while position: fixed boxes still reach the real bottom (WebKit 301994, reopened for iOS 27). So the list, the note, a sheet and its dim all stopped about 62 pt above the bottom. Under them, the backdrop's page-colour "floor" showed as the flat grey band. At the top, the flat strip was PhoneStack's .edge.top plus the backdrop's .scrim. #226 added those so the page would meet Safari's flat-filled bars, but the Home Screen app has no Safari bars.

The tests passed because their "standalone" mode only removed the toolbar. They never made the units short, and they checked "same colour at the edges", which a flat band of page colour passes.

Fix

  • Measure the screen instead of trusting the units (on iPhone/iPad Home Screen only). A zero-width position: fixed; top: 0; bottom: 0 probe is watched by a ResizeObserver, so nothing runs on scroll and no extra layer is painted. It writes --vh and the new --screen-h only when they change, and the root gets data-home-screen. The probe is see-through and zero wide, so no browser samples its colour for its bars.
  • The backdrop and body size from --screen-h (still 100lvh in a Safari tab).
  • On the Home Screen, the flat edge strips (.edge, .scrim) are off. The glass and the picture run to the top and bottom.
  • Safari tab: no change. The backdrop is already painted under the toolbar (in the page, 26.4+), and the dim reaches both bars (#293). The status-bar strip in a tab is Safari's own fill from the root colour (the page is at scroll 0), and it's matched.
  • Sheets still float, now sitting just above the home indicator.

Evidence (WebKit, the iOS Home Screen bug modelled by making the units short by the status bar)

Before (dev) vs after, 390 px. The sheet was cut flat at the bottom, exactly like your 09:03 shot:
before/after

After, at 320 / 360 / 375, light and dark:
grid

(The headless WebKit here draws glass without blur, so the sheet looks see-through, and dev looks the same. Chromium shows the real blur.)

Tests

  • New e2e/home-screen.spec.ts: 320/360/375/390 × light/dark × list/note/sheet, on WebKit and Chromium. It checks that the stack, the showing screen, the backdrop and a sheet's dim reach row 0 and the last row, that the edge strips are off, and that the sheet floats just above the home indicator. On dev it fails (stack.bottom 797 of 844, 47 px short; the dim and the sheet stop at 797). On this branch all 48 pass.
  • Regressions, all passing on webkit-390 and chromium-390: phone-edges (288), safe-areas, page-chrome, pwa, pwa-update, keyboard, backdrops, glass.

What emulation can't show

  • The real iOS status bar and home indicator, and whether iOS paints a band of its own. One report in 301994 says a 62 px gap is drawn by the system and that its colour is cached from the page background until relaunch. Your screenshot shows the + button's shadow inside the bottom band, so at least the bottom band is our page, and that part is fixed. If iOS draws a band at the top on your release, no web page can paint there. The root colour stays the matched edge colour, so it blends in.
  • Safari 26's liquid-glass tinting, and when Safari re-samples bar colours.
  • Whether svh/dvh/lvh are short on your exact iOS build. The fix doesn't depend on that: it measures.

Device checklist (please note your iOS version: Settings → General → About)

Home Screen app. Delete the old icon and add it again from Safari: iOS reads the status-bar tags only when the app is added. Then open it:

  1. Journal list, Mountains backdrop: the glass list and the picture run to the very bottom, behind the home indicator. No flat grey band, and the last rows scroll behind the home indicator.
  2. Same list, top: the picture/glass shows behind the clock and battery, not a flat grey strip. If a flat strip remains exactly behind the status bar only, tell me. That's iOS drawing it (301994), not us.
  3. Open a note, then Style: the sheet floats with rounded bottom corners just above the home indicator, and the dim covers the whole screen, including behind the clock and below the sheet.
  4. Open the palette (search): the dim reaches top and bottom.
  5. Rotate to landscape and back: no gap appears at the bottom in either orientation.
  6. Tap into a note and type, so the keyboard comes up, then close it: the page doesn't jump or leave a gap.
  7. Switch to dark and back in Settings: no band appears at either edge.

Safari tab (as before, should be unchanged):
8. Same list in Safari: the page runs under the floating toolbar, and the strip under it is the list's glass colour, no grey band.
9. The strip behind the clock in Safari is one flat colour that matches the top of the list. That's Safari's own fill at scroll 0, expected.
10. Style sheet in Safari: the clock strip, the page and the strip under the toolbar all dim together.

Screenshots of 1–3 and 8 would settle it.

## Fixed in PR #405 (not merged) ### Cause Your screenshots are from the **Home Screen app**. On iOS 26/27 it reports `100svh` (the app's height) one status bar short (about 62 pt), while `position: fixed` boxes still reach the real bottom ([WebKit 301994](https://bugs.webkit.org/show_bug.cgi?id=301994), reopened for iOS 27). So the list, the note, a sheet and its dim all stopped about 62 pt above the bottom. Under them, the backdrop's page-colour "floor" showed as the flat grey band. At the top, the flat strip was PhoneStack's `.edge.top` plus the backdrop's `.scrim`. #226 added those so the page would meet *Safari's* flat-filled bars, but the Home Screen app has no Safari bars. The tests passed because their "standalone" mode only removed the toolbar. They never made the units short, and they checked "same colour at the edges", which a flat band of page colour passes. ### Fix - **Measure the screen instead of trusting the units** (on iPhone/iPad Home Screen only). A zero-width `position: fixed; top: 0; bottom: 0` probe is watched by a ResizeObserver, so nothing runs on scroll and no extra layer is painted. It writes `--vh` and the new `--screen-h` only when they change, and the root gets `data-home-screen`. The probe is see-through and zero wide, so no browser samples its colour for its bars. - The backdrop and `body` size from `--screen-h` (still `100lvh` in a Safari tab). - On the Home Screen, the flat edge strips (`.edge`, `.scrim`) are off. The glass and the picture run to the top and bottom. - **Safari tab: no change.** The backdrop is already painted under the toolbar (in the page, 26.4+), and the dim reaches both bars (#293). The status-bar strip in a tab is Safari's own fill from the root colour (the page is at scroll 0), and it's matched. - Sheets still float, now sitting just above the home indicator. ### Evidence (WebKit, the iOS Home Screen bug modelled by making the units short by the status bar) Before (dev) vs after, 390 px. The sheet was cut flat at the bottom, exactly like your 09:03 shot: ![before/after](https://git.kayg.org/attachments/32e47e17-e944-4551-ad47-fbd61e557b2a) After, at 320 / 360 / 375, light and dark: ![grid](https://git.kayg.org/attachments/67fa18fd-8427-4aac-a20e-b5a1845688e7) (The headless WebKit here draws glass without blur, so the sheet looks see-through, and dev looks the same. Chromium shows the real blur.) ### Tests - New `e2e/home-screen.spec.ts`: 320/360/375/390 × light/dark × list/note/sheet, on WebKit and Chromium. It checks that the stack, the showing screen, the backdrop and a sheet's dim reach row 0 and the last row, that the edge strips are off, and that the sheet floats just above the home indicator. **On dev it fails** (`stack.bottom` 797 of 844, 47 px short; the dim and the sheet stop at 797). **On this branch all 48 pass.** - Regressions, all passing on webkit-390 and chromium-390: phone-edges (288), safe-areas, page-chrome, pwa, pwa-update, keyboard, backdrops, glass. ### What emulation can't show - The real iOS status bar and home indicator, and whether iOS paints a band of its own. One report in 301994 says a 62 px gap is drawn *by the system* and that its colour is cached from the page background until relaunch. Your screenshot shows the + button's shadow inside the bottom band, so at least the bottom band is our page, and that part is fixed. If iOS draws a band at the **top** on your release, no web page can paint there. The root colour stays the matched edge colour, so it blends in. - Safari 26's liquid-glass tinting, and when Safari re-samples bar colours. - Whether `svh`/`dvh`/`lvh` are short on your exact iOS build. The fix doesn't depend on that: it measures. ### Device checklist (please note your iOS version: Settings → General → About) **Home Screen app.** Delete the old icon and add it again from Safari: iOS reads the status-bar tags only when the app is added. Then open it: 1. Journal list, Mountains backdrop: the glass list and the picture run to the **very bottom**, behind the home indicator. No flat grey band, and the last rows scroll behind the home indicator. 2. Same list, **top**: the picture/glass shows behind the clock and battery, not a flat grey strip. If a flat strip remains *exactly* behind the status bar only, tell me. That's iOS drawing it (301994), not us. 3. Open a note, then Style: the sheet floats with rounded bottom corners just above the home indicator, and the **dim covers the whole screen**, including behind the clock and below the sheet. 4. Open the palette (search): the dim reaches top and bottom. 5. Rotate to landscape and back: no gap appears at the bottom in either orientation. 6. Tap into a note and type, so the keyboard comes up, then close it: the page doesn't jump or leave a gap. 7. Switch to dark and back in Settings: no band appears at either edge. **Safari tab** (as before, should be unchanged): 8. Same list in Safari: the page runs under the floating toolbar, and the strip under it is the list's glass colour, no grey band. 9. The strip behind the clock in Safari is one flat colour that matches the top of the list. That's Safari's own fill at scroll 0, expected. 10. Style sheet in Safari: the clock strip, the page and the strip under the toolbar all dim together. Screenshots of 1–3 and 8 would settle it.
Author
Owner

Closing during the 26 Oct handover cleanup: The Home Screen app fills both edges in dev (PR #405). The remaining iPhone band work is #445.

Closing during the 26 Oct handover cleanup: The Home Screen app fills both edges in dev (PR #405). The remaining iPhone band work is #445.
kayg closed this issue 2026-10-26 08:46:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#396
No description provided.