tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

dynamic-2.html (1511B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <title>CSS 2.1 Test Suite: :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>
     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>
     58  document.body.offsetWidth;
     59  boom1();
     60 </script>
     61 </body>
     62 </html>