1
0
Fork 0
firefox/testing/web-platform/tests/css/css-font-loading/fontfaceset-worker-fontface-crash.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

32 lines
907 B
HTML

<!doctype html>
<html class="test-wait">
<iframe id="frame" srcdoc=""></iframe>
<script id="worker1" type="javascript/worker">
self.onmessage = async function(e) {
let a = new MessageEvent('message')
for (let e = 0; e < 255; e++) {
new Uint8ClampedArray(2048).fill(e)
}
try { self.dispatchEvent(a) } catch (e) {}
let x = new FontFace('foo', 'x')
}
</script>
<script>
function tick() {
return new Promise(r => {
requestAnimationFrame(() => requestAnimationFrame(r));
});
}
onload = async () => {
let win = document.querySelector("#frame").contentWindow;
const blob = new win.Blob([document.querySelector('#worker1').textContent], { type: "text/javascript" })
let worker = new win.Worker(win.URL.createObjectURL(blob))
worker.postMessage([], [])
await tick();
await tick();
win.location.reload(true)
await tick();
document.documentElement.className = "";
};
</script>