Commit 5a10bba
User
Load
`view_to_iframe` previously forced `loading="lazy"` on the rendered iframe.
The browser only fetches a lazy iframe's document once it is scrolled close to
the viewport. On the home page these iframes sit well below the fold, and the
test harness performs no navigation (and no scroll) when it is already on "/",
so a deferred lazy iframe is never fetched and a consumer waiting on the
iframe's contents times out (observed intermittently on slow CI runners, e.g.
`test_component_view_to_iframe_sync_func` on windows-latest).
An eager iframe (the HTML default, no `loading` attribute) is a sub-resource
the browser fetches as part of the parent page's initial load, so its document
is guaranteed to be present as soon as the page loads. This makes loading
deterministic instead of depending on the browser's load-timing heuristics,
which is the real root cause of the flake.
Lazy loading remains available as an opt-in for users who prefer it: pass
`extra_props={"loading": "lazy"}`.view_to_iframe iframes eagerly by default1 parent 4fd0434 commit 5a10bba
3 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
304 | 308 | | |
305 | 309 | | |
306 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
| |||
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
247 | 260 | | |
248 | 261 | | |
249 | 262 | | |
250 | 263 | | |
251 | | - | |
252 | 264 | | |
253 | 265 | | |
254 | 266 | | |
| |||
0 commit comments