env(safe-area-inset-right) value is too big on some Android devices in landscape mode
Categories
(GeckoView :: General, defect, P3)
Tracking
(Webcompat Priority:?, firefox98 fixed, firefox99 fixed)
People
(Reporter: ksenia, Assigned: emilio)
References
()
Details
Attachments
(4 files, 1 obsolete file)
We received a report in https://github.com/webcompat/web-bugs/issues/99164 where user is experiencing a problem with content being broken on the site when rotating device to landscape mode.
I've attached a reduced test case to this bug.
To reproduce:
- Turn the device to landscape mode clockwise and load the attached testcase in Firefox on Android.
Expected:
"Off Topic" displayed in one line
Actual:
"Off Topic" is shifted because padding-right
value from env(safe-area-inset-right)
is the same width as the screen size.
Note that the problem is not reproducible if rotating in counter clockwise direction.
It also seems to be reproducible only on certain devices (for example: Google Pixel 5 and Google Pixel 4a, both on Android 12).
Also, if I remove viewport-fit=cover
from the meta name="viewport"", the problem is going away.
Assignee | ||
Comment 1•3 years ago
|
||
I can reproduce on my OnePlus 9 fwiw.
Assignee | ||
Comment 2•3 years ago
|
||
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
I can't repro on the same device on GeckoViewExample, not sure why. Makoto, do you know? However with some logging in nsPresContext::SetSafeAreaInsets, I see:
SetSafeAreaInsets((t=0, r=2184, b=0, l=0))
Which is the root of the problem, the right inset is massive.
Assignee | ||
Comment 5•3 years ago
|
||
My guess is that GeckoView does nothing with LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
, which android-components
does.
Assignee | ||
Comment 6•3 years ago
|
||
Oh, but it's supposed to, what am I missing?
Anyways this is not a CSS bug, it's a GeckoView issue.
Assignee | ||
Comment 7•3 years ago
|
||
Ok so Chrome and GVE agree on there not being safe areas on the test-case above. So this might be some weird quirk of how Fenix is configuring the window or something? The cutout area on my device is definitely not covered.
Assignee | ||
Comment 8•3 years ago
|
||
It'll probably take me quite a while to figure out all the bits and pieces here, unassigning for now since this is probably best worked on by someone that knows the Android-specific bits.
Assignee | ||
Comment 9•3 years ago
|
||
Ah, I found the bogus stuff. Wallpaper incoming though it's a deeper issue.
Assignee | ||
Comment 10•3 years ago
|
||
The fix here is the EnsureAtMost call, but we can simplify a bit of the
related code by replacing the four conditionals with an
EnsureAtLeast call too, and using Deflate() rather than the manual
calculations.
This is sort of a wall paper over bug 1754323, but should be safe and
prevents ridiculously big safe areas.
Updated•3 years ago
|
Reporter | ||
Comment 11•3 years ago
|
||
Thanks for looking into this!
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
Comment 14•3 years ago
|
||
Emilio, this bug blocks bug 1754802 which is a Webcompat P1 bug, would uplifting the patch to beta help resolving it at this point? Would we also need bug 1754858? Thanks
Assignee | ||
Comment 15•3 years ago
|
||
This won't help resolving bug 1754802, though it's a pre-requisite, low risk, and fixes other compat issues, so might be worth uplifting.
Assignee | ||
Comment 16•3 years ago
|
||
Comment on attachment 9263336 [details]
Bug 1754323 - Ensure safe-area calculations aren't too off. r=m_kato
Beta/Release Uplift Approval Request
- User impact if declined: comment 0
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: comment 0
- List of other uplifts needed: none
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Simple wallpaper to avoid bogus screen calculations. Proper fix will be bug 1754802, which is ongoing.
- String changes made/needed: none
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 17•3 years ago
|
||
I managed to reproduce the issue on Firefox RC 97.1.0 using a Google Pixel 6 (Android 12). On Nightly 2022-02-16 the issue no longer occurs. I tested both the test case from comment 0 and the https://offtopic.com/ website and both are working properly.
Updated•3 years ago
|
Comment 18•3 years ago
|
||
Comment on attachment 9263336 [details]
Bug 1754323 - Ensure safe-area calculations aren't too off. r=m_kato
Approved for 98 beta 6 as it improves Web Compatibility of Gecko, thanks.
Comment 19•3 years ago
|
||
bugherder uplift |
Description
•