layout: More conservatively replace Stylist's Device (#31857)

Instead of replacing Stylist's device on every reflow, only replace it
when the viewport changes. In addition, preserve the root font size from
the previous reflow fixing an issue where `rem` units were not properly
computed between reflows.

This fixes a bug where fonts that are sized using `rem` units change
size on reload.
This commit is contained in:
Martin Robinson 2024-03-26 16:00:50 +01:00 committed by GitHub
parent b71de92569
commit bf3798bbde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 95 additions and 61 deletions

View file

@ -1,6 +1,3 @@
[getComputedStyle-calc-mixed-units-002.html]
[testing width: calc(5% + 4rem)]
expected: FAIL
[testing width: calc(8lh + 7px)]
expected: FAIL

View file

@ -1,2 +0,0 @@
[rem-root-font-size-restyle-1.html]
expected: FAIL

View file

@ -1,6 +1,3 @@
[getComputedStyle-calc-mixed-units-002.html]
[testing width: calc(5% + 4rem)]
expected: FAIL
[testing width: calc(8lh + 7px)]
expected: FAIL

View file

@ -1,2 +0,0 @@
[rem-root-font-size-restyle-1.html]
expected: FAIL

View file

@ -1,3 +0,0 @@
[detached_layout.html]
[Detached layout doesn't panic]
expected: FAIL