Commit ec1e35c
fix(Image): handle SSR image already complete before inline script runs (#1536)
## Problem
The inline `<script>` rendered after `<img>` in SSR attached a `load`
listener to set the image opacity to `1`. When the image finished
loading before that script was parsed, the listener never fired and the
image stayed at `opacity: 0`, producing flaky snapshot diffs in the SSR
acceptance test.
## Fix
Check `img.complete` first and set `opacity = "1"` synchronously in that
case; fall back to the `load` listener otherwise.
Ref: WEB-2429
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bc3574f commit ec1e35c
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
| |||
0 commit comments