summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dynamic/inline-to-block-crash.html
blob: 6e8f2b8be3b8a78891f0792492cd57dbda3950fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<script>

// This tests a particular sequence of render tree changes, which
// caused a crash in the code that maintains the line box tree.
// Even small changes to the test make it no longer crash, so it
// should be left as-is. That's why the test results don't say
// anything about what this tests -- adding that caused the crash
// to go away!

function turnAnchorIntoBlock()
{
    document.getElementById("a").style.display = "block";
    document.getElementById("span").firstChild.data = "PASSED";
    if (window.testRunner)
        testRunner.notifyDone();
}

function turnSpanIntoBlock()
{
    document.body.offsetHeight; // trigger layout
    document.getElementById("span").style.display = "block";
    
    setTimeout(turnAnchorIntoBlock, 0);
}

function runTest()
{
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }
    setTimeout(turnSpanIntoBlock, 0);
}

</script>

<body onload="runTest()">

<a id="a">
    <span id="span">TEST HAS NOT RUN YET</span>
</a>

</body>