first-letter-dynamic-002.xht (1755B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> 2 <title>CSS Test: :first-letter</title> 3 <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" /> 4 <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> 5 <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-letter" /> 6 <link rel="match" href="first-letter-dynamic-002-ref.xht"/> 7 <meta name="flags" content="dom" /> 8 <script type="text/javascript"> 9 function boom1() 10 { 11 initFuzzerSpecific(); 12 setTextContent(stylesheets[1], "*:first-letter { }"); 13 setTextContent(stylesheets[2], "*:before { counter-reset: chicken; }"); 14 document.body.offsetWidth; 15 boom2(); 16 } 17 18 function boom2() 19 { 20 setTextContent(stylesheets[3], "#q2:first-letter { content: 'generated'; }"); 21 setTextContent(stylesheets[1], ""); 22 setTextContent(stylesheets[4], "#q2 { quotes: '<1>' '</1>'; }"); 23 document.body.offsetWidth; 24 boom3(); 25 } 26 27 function boom3() 28 { 29 document.getElementById("p2").style.counterReset = "egg"; 30 setTextContent(stylesheets[1], "*:first-letter { }"); 31 } 32 33 function setTextContent(n, t) { n.textContent = t; } 34 35 var stylesheets = []; 36 function initFuzzerSpecific() 37 { 38 var myStylesheetHolder = document.getElementsByTagName("head")[0]; 39 40 for (var i = 0; i < 25; ++i) { 41 var s = document.createElementNS("http://www.w3.org/1999/xhtml", 'style'); 42 s.style.display = "none"; 43 myStylesheetHolder.appendChild(s); 44 stylesheets.push(s); 45 } 46 } 47 </script> 48 49 </head> 50 <body> 51 52 <p><q>Foo</q></p> 53 54 <p id="p2"><q id="q2">0</q></p> 55 56 <script type="text/javascript"> 57 document.body.offsetWidth; 58 boom1(); 59 </script> 60 61 62 </body></html>