Home | History | Annotate | Download | only in assets
      1 <script>
      2 
      3 // This tests a particular sequence of render tree changes, which
      4 // caused a crash in the code that maintains the line box tree.
      5 // Even small changes to the test make it no longer crash, so it
      6 // should be left as-is. That's why the test results don't say
      7 // anything about what this tests -- adding that caused the crash
      8 // to go away!
      9 
     10 function turnAnchorIntoBlock()
     11 {
     12     document.getElementById("a").style.display = "block";
     13     document.getElementById("span").firstChild.data = "PASSED";
     14     if (window.layoutTestController)
     15         layoutTestController.notifyDone();
     16 }
     17 
     18 function turnSpanIntoBlock()
     19 {
     20     document.body.offsetHeight; // trigger layout
     21     document.getElementById("span").style.display = "block";
     22     
     23     setTimeout(turnAnchorIntoBlock, 0);
     24 }
     25 
     26 function runTest()
     27 {
     28     if (window.layoutTestController) {
     29         layoutTestController.dumpAsText();
     30         layoutTestController.waitUntilDone();
     31     }
     32     setTimeout(turnSpanIntoBlock, 0);
     33 }
     34 
     35 </script>
     36 
     37 <body onload="runTest()">
     38 
     39 <a id="a">
     40     <span id="span">TEST HAS NOT RUN YET</span>
     41 </a>
     42 
     43 </body>
     44