WebView produces incorrect screen.height, window.innerHeight values

REPRODUCIBILITY: 100%
OS VERSION: 4.4.0.72
HARDWARE: 10ii, volla/gs290
UI LANGUAGE: en/de
REGRESSION: yes, since 4.3

DESCRIPTION:

When scaling elements (tiles area for instance, in harbour-moremahjong), scaling can’t be applied correctly in Landscape mode:

In landscape rotation of 270,

window.innerWidth  = 780, screen.width = 360
window.innerHeight  = 780, screen.height = 780

With 0 degree roation, Portait, we get:

window.innerWidth  = 360, screen.width = 360
window.innerHeight  = 780, screen.height = 780

This error occurs on all 4.4.0.72 devices I tested. In ALL these cases, the same app can be played in the browser (Mah) and it’s ok.

I went through versions of the mahjong app to see if it’s a regression in my last release but it is not

PRECONDITIONS:

Have updated to 4.4.0.68,72.

STEPS TO REPRODUCE:

  1. Install harbour-moremahjong
  2. Start a game/pattern
  3. Rotate the screen to landscape

EXPECTED RESULT:

Scaling in a WebView should work as it does in the web browser

ACTUAL RESULT:

In Landscape mode, WebView content if scaled to window.innerHeight will overflow, not be visible, etc.

MODIFICATIONS:

The xperia 10ii is a clean, licensed device. I haven’t even enabled the android stuff that comes with the license. No patches, no mods.

The volla/gs290 test devices have chum and openrepos installed apps and are targets for the SDK.

The symptoms are the same.

ADDITIONAL INFORMATION:

1 Like

Thanks for reporting this @poetaster, and for checking it carefully. Just to be completely clear, am I correct in understanding that the error is for the window.innerWidth value in landscape mode (it’s giving 780 when you’d expect to see 360)?

I’ve created an internal issue for this and tagged it as tracked here.

2 Likes

Correct. There are a number of other distinct behaviours that don’t appear in the browser but seem to plague the WebView. I’d noted some issues with audio in another ticket.

I’ve just reverted to an older version (.64) on volla and the bug doesn’t appear here. It does appear on .72 x10ii and volla/gs290 .72.

The state where moremahjong works (volla, .64)

sailfish-components-webview-qt5-1.5.9-1.19.1.jolla.src
embedlite-components-qt5-1.24.33-1.35.1.jolla.src

Maybe that helps.

1 Like

For reference? [components-webview] Respect component height. Fixes JB#57689 · sailfishos/sailfish-components-webview@df9ae3c · GitHub

I now have three different results. On .64 volla, harbour-moremahjong works as you’d expect. On .72 volla, the display in portrait mode is obviously desktop (far too small). Select a game and play and it zooms in but is cut off (see title). On .72 on the 10ii, the display in portrait mode is correct. Select a game and play and it’s just like the volla.

This seems to be two different bugs.

volla .64 correct (portrait select, landscape play):


10ii select is the same as above, but landscape play:

The .72 version of GS5 and GS290 have a portrait select as follows:

The landscape play mode looks the same as that of the 10ii one before.

Sooo. Looks like somewhere after .64 (.68-.72) something snuck in.

EDIT:
Just to confuse things:

  • the 10ii with .72 webviews of web pages from servers are rendered correctly (with or without user agent string).
  • the GS290 with .64 they are also correct.
  • the .72 GS290/Volla/GS5 are rendered as if the user agent where desktop (regardless of user agent string).
1 Like

Test tool: GitHub - poetaster/webview-screensize: a tool to test webview screen, browser sizes and orientation

1 Like