newwin: do something smarter to reduce entropy and increase usability
similar to #41753
PART ONE
https://arkenfox.github.io/TZP/tests/newwinsim.html - FWIW, by next ESR win7 will be dead, but the extra variances vs win11 re taskbar still exist in win10 AFAICT
So the test (WIP) has multiple whatifs. We moved from 1000x1000 to 1400x900 maximums. But we can do something smarter here to reduce the buckets. For example, one scenario is the last scenario = X: variable
[1] - i.e the maximum width changes depending on the available height. If we ignore portrait (names starting with a little p
such as pXGA
) and XGA
(older than jesus), the number of buckets isn't too bad.
on the current test (win7)
-
original (
1000 x 1000
)-
14
possible buckets -
8
are portrait or XGA, and1
(1000 x 500
) seems a little dubious [2] -
5
buckets = best guess after excluding old hardware and outliers we'll never be able to protect
-
-
current (
1400 x 900
)-
20
possible buckets -
6
are portrait or XGA, and2
(1200 x 500
,1000 x 500
) seem dubious -
12
buckets left
-
- so original vs current = 5 or 6 buckets -> 12 buckets = double, seems legit
-
smart (
"variable up to 1400" x 900
)-
14
buckets - already six less than current but with the same benefits - again,
6
are portrait of XGA, and1
(1000 x 500
) seems a little dubious -
7
buckets
-
Being smarter drastically reduces buckets, and still gives benefits to larger screens and aspect ratios at 16/9 or wider
[1] based on 1400x900 as out ultimate maximums
// variable steps
if (maxW == "variable") {
if (finalHeight == 900) {maxW = 1400
} else if (finalHeight === 800) {maxW = 1200
} else {maxW = 1000}
}
[2] I've tried to weed out some results where e.g. the screen height is small (say under 800px) I exclude double height taskbars, etc.
PART TWO
We could actually define a set of sizes and enforce only those. As @ruihildt has mentioned a few times. This would allow us to keep the number of sizes small, but allow for even bigger sizes, because it's very selective and not every combination of steps. In order to even consider this, we would want non-mobile data only of a large set of users on their inner window size (e.g. on firefox close?) - so umm, that'll be Mozilla would need to do it (and the data collected would need to be in ranges). The examples given online were horrendous and old AF
These set sizes would also make it easy to make a toolbar window resizer
extension and users can snap to whatever they want if it fits
Class, discuss .. for maybe ESR128