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