fix: inline images onload (#1174)

* fix: inline images onload

* add integration test case

* Apply formatting changes

* Create small-olives-arrive.md

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
This commit is contained in:
fukang wang
2026-04-01 12:00:00 +08:00
committed by GitHub
parent d4d840122a
commit 6855705445
4 changed files with 39 additions and 1 deletions

View File

@@ -303,6 +303,28 @@ iframe.contentDocument.querySelector('center').clientHeight
)) as string;
assert(snapshot.includes('-webkit-background-clip: text;'));
});
it('images with inline onload should work', async () => {
const page: puppeteer.Page = await browser.newPage();
await page.goto(
'http://localhost:3030/html/picture-with-inline-onload.html',
{
waitUntil: 'load',
},
);
await page.waitForSelector('img', { timeout: 1000 });
await page.evaluate(`${code}var snapshot = rrweb.snapshot(document, {
dataURLOptions: { type: "image/webp", quality: 0.8 },
inlineImages: true,
inlineStylesheet: false
})`);
await waitForRAF(page);
const fnName = (await page.evaluate(
'document.querySelector("img").onload.name',
)) as string;
assert(fnName === 'onload');
});
});
describe('iframe integration tests', function (this: ISuite) {