[Webkit-unassigned] [Bug 274773] New: env(safe-area-inset-*) always returns 0

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 28 04:46:24 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=274773

            Bug ID: 274773
           Summary: env(safe-area-inset-*) always returns 0
           Product: WebKit
           Version: Safari 17
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: contact at benfrain.com
                CC: koivisto at iki.fi

Created attachment 471525

  --> https://bugs.webkit.org/attachment.cgi?id=471525&action=review

reduction of the safe area reading technique

For the longest time it has been possible to get the value or the iOS safe areas using the following technique:

```css
:root {
    --sat: env(safe-area-inset-top);
    --sar: env(safe-area-inset-right);
    --sab: env(safe-area-inset-bottom);
    --sal: env(safe-area-inset-left);
}
```

And then read that value with JS:

```js
getComputedStyle(document.documentElement).getPropertyValue("--sat")
```

However this no longer works. I have tried adding this behind a timeout of 5s but it remains at zero. Attachment is a reduction of the technique.

The environment variable should resolve to the safe area inset value.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240528/b39dde00/attachment.htm>


More information about the webkit-unassigned mailing list