Commit 0167bcc
committed
LibWeb: Invalidate viewport-relative lengths nested in math functions
Style invalidation on viewport resize only touches elements whose
computed values recorded a viewport metric dependency. Lengths resolved
by the Rust calc simplification had no way to report that dependency
back, so `calc(50vh - 10px)`, `min(50vh, ...)`, `clamp()` and anything
reaching them through var() kept their stale pixel values after a
resize until something else dirtied the element's style. On sites like
YouTube that made a window resize appear to do nothing until a later
unrelated invalidation moved everything at once.
Carry the resolution context's tracking flag across the FFI boundary so
the Rust length absolutization records viewport (and viewport-dependent
font metric) resolutions the same way the C++ path does. Adds a test
resizing an iframe and checking each construct picks up the new
viewport height.1 parent 27d11da commit 0167bcc
6 files changed
Lines changed: 65 additions & 0 deletions
File tree
- Libraries/LibWeb/CSS
- Rust/src
- Tests/LibWeb/Text
- expected/css
- input/css
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5238 | 5238 | | |
5239 | 5239 | | |
5240 | 5240 | | |
| 5241 | + | |
5241 | 5242 | | |
5242 | 5243 | | |
5243 | 5244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
56 | 69 | | |
57 | 70 | | |
58 | 71 | | |
| |||
251 | 264 | | |
252 | 265 | | |
253 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
254 | 270 | | |
255 | 271 | | |
256 | 272 | | |
| |||
259 | 275 | | |
260 | 276 | | |
261 | 277 | | |
| 278 | + | |
262 | 279 | | |
263 | 280 | | |
264 | 281 | | |
| |||
3840 | 3857 | | |
3841 | 3858 | | |
3842 | 3859 | | |
| 3860 | + | |
3843 | 3861 | | |
3844 | 3862 | | |
3845 | 3863 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments