Commit cb0ece1
fix(capture): preserve parent session across nested iframe capture
rasterizeIframe rasterizes the iframe via a nested snapdom capture, which
runs its own captureDOM → applyCachePolicy and REASSIGNS
cache.session.{nodeMap,styleMap,styleCache} to fresh instances mid-clone.
That orphans every entry the parent cloned before reaching the iframe.
After #440 made inlineBackgroundImages resolve clone→source via
cache.session.nodeMap, those orphaned subtrees were skipped, so a remote
background/mask on a sibling of the iframe was silently dropped (visual
demo d6: the mask gradient rendered as a full square instead of a ring).
Snapshot and restore the parent session around the nested capture so it
stays intact. Keeps #440's nodeMap recursion; covers pseudo/iconFonts too.
Also fixes a brittle assertion in the #439 background test (the browser
normalizes the `green`/`purple` color keywords to rgb()).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5be5025 commit cb0ece1
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
423 | 432 | | |
424 | 433 | | |
425 | 434 | | |
426 | 435 | | |
427 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
428 | 440 | | |
429 | 441 | | |
430 | 442 | | |
| |||
0 commit comments