- Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathfontfaceset-worker-fontface-crash.html
32 lines (31 loc) · 907 Bytes
/
fontfaceset-worker-fontface-crash.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!doctype html>
<htmlclass="test-wait">
<iframeid="frame" srcdoc=""></iframe>
<scriptid="worker1" type="javascript/worker">
self.onmessage=asyncfunction(e){
leta=newMessageEvent('message')
for(lete=0;e<255;e++){
newUint8ClampedArray(2048).fill(e)
}
try{self.dispatchEvent(a)}catch(e){}
letx=newFontFace('foo','x')
}
</script>
<script>
functiontick(){
returnnewPromise(r=>{
requestAnimationFrame(()=>requestAnimationFrame(r));
});
}
onload=async()=>{
letwin=document.querySelector("#frame").contentWindow;
constblob=newwin.Blob([document.querySelector('#worker1').textContent],{type: "text/javascript"})
letworker=newwin.Worker(win.URL.createObjectURL(blob))
worker.postMessage([],[])
awaittick();
awaittick();
win.location.reload(true)
awaittick();
document.documentElement.className="";
};
</script>