mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
Add 18 crash tests covering various scenarios where image loading callbacks fire after an iframe has been removed from the DOM, making its document inactive. These tests cover microtasks, element tasks, batching dispatcher callbacks, decode promises, lazy loading, srcset, picture elements, nested iframes, document adoption, and iframe reattach/remove cycles.
33 lines
986 B
HTML
33 lines
986 B
HTML
<!DOCTYPE html>
|
|
<!-- Test: Image loads in a nested iframe. Removing the outermost iframe
|
|
makes all nested documents inactive. Image callbacks fire on the innermost
|
|
inactive document. -->
|
|
<html class="test-wait">
|
|
<body>
|
|
<script>
|
|
const imageUrl = new URL("../../Assets/120.png", document.baseURI).href;
|
|
|
|
const outerIframe = document.createElement("iframe");
|
|
document.body.appendChild(outerIframe);
|
|
|
|
const outerDoc = outerIframe.contentDocument;
|
|
const innerIframe = outerDoc.createElement("iframe");
|
|
outerDoc.body.appendChild(innerIframe);
|
|
|
|
const innerDoc = innerIframe.contentDocument;
|
|
const img = innerDoc.createElement("img");
|
|
img.src = imageUrl;
|
|
innerDoc.body.appendChild(img);
|
|
|
|
// Remove the outer iframe, making both documents inactive.
|
|
setTimeout(() => {
|
|
outerIframe.remove();
|
|
}, 10);
|
|
|
|
setTimeout(() => {
|
|
document.documentElement.classList.remove("test-wait");
|
|
}, 500);
|
|
</script>
|
|
</body>
|
|
</html>
|