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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/first-letter/dynamic-2.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>CSS 2.1 Test Suite: :first-letter</title>
     1.8 +  <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
     1.9 +  <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
    1.10 +  <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-letter"/>
    1.11 +  <meta name="flags" content="dom" />
    1.12 +<script>
    1.13 +function boom1()
    1.14 +{
    1.15 +  initFuzzerSpecific();
    1.16 +  setTextContent(stylesheets[1], "*:first-letter { }");
    1.17 +  setTextContent(stylesheets[2], "*:before { counter-reset: chicken; }");
    1.18 +  document.body.offsetWidth;
    1.19 +  boom2();
    1.20 +}
    1.21 +
    1.22 +function boom2()
    1.23 +{
    1.24 +  setTextContent(stylesheets[3], "#q2:first-letter { content: 'generated'; }");
    1.25 +  setTextContent(stylesheets[1], "");
    1.26 +  setTextContent(stylesheets[4], "#q2 { quotes: '<1>' '</1>'; }");
    1.27 +  document.body.offsetWidth;
    1.28 +  boom3();
    1.29 +}
    1.30 +
    1.31 +function boom3()
    1.32 +{
    1.33 +  document.getElementById("p2").style.counterReset = "egg";
    1.34 +  setTextContent(stylesheets[1], "*:first-letter { }");
    1.35 +}
    1.36 +
    1.37 +function setTextContent(n, t) { n.textContent = t; }
    1.38 +
    1.39 +var stylesheets = [];
    1.40 +function initFuzzerSpecific()
    1.41 +{
    1.42 +  var myStylesheetHolder = document.getElementsByTagName("head")[0];
    1.43 +
    1.44 +  for (var i = 0; i < 25; ++i) {
    1.45 +    var s = document.createElementNS("http://www.w3.org/1999/xhtml", 'style');
    1.46 +    s.style.display = "none";
    1.47 +    myStylesheetHolder.appendChild(s);
    1.48 +    stylesheets.push(s);
    1.49 +  }
    1.50 +}
    1.51 +</script>
    1.52 +
    1.53 +</head>
    1.54 +<body>
    1.55 +
    1.56 +<p><q>Foo</q></p>
    1.57 +
    1.58 +<p id="p2"><q id="q2">0</q></p>
    1.59 +
    1.60 +<script>
    1.61 +  document.body.offsetWidth;
    1.62 +  boom1();
    1.63 +</script>
    1.64 +</body>
    1.65 +</html>

mercurial