layout/reftests/first-letter/dynamic-2.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial