460323-1.html (752B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <head> 4 <script> 5 var expectedLoads = 3; 6 function load_done() { 7 --expectedLoads; 8 if (expectedLoads == 0) { 9 document.documentElement.className = ""; 10 } 11 } 12 function addLink() { 13 var l = document.createElement("link"); 14 l.rel = "stylesheet"; 15 l.type = "text/css"; 16 l.href = "data:text/css,some { random: data }"; 17 l.onload = load_done; 18 document.getElementsByTagName("head")[0].appendChild(l); 19 } 20 function doIt() { 21 document.styleSheets[0].insertRule('a {}', 0) 22 addLink(); 23 addLink(); 24 } 25 addLink(); 26 </script> 27 </head> 28 <body onload="doIt()"> 29 <body> 30 </body>