2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / traversal / size-zero-run.html
blob23949351c90250fc2505d8e7259ad4ca51a0e6d5
1 <html>
3 <head>
4 <script>
5 function test() {
6 if(window.layoutTestController)
7 layoutTestController.dumpAsText();
9 var textnode1 = document.getElementById("node").firstChild;
10 var textnode2 = textnode1.splitText(3);
11 textnode2.nodeValue = "";
13 var root = document.body;
14 var it = document.createNodeIterator(root, NodeFilter.SHOW_ELEMENT, NodeFilter.FILTER_ACCEPT, false);
16 var n = it.nextNode();
17 while(n) {
18 n = it.nextNode();
21 var text = document.getElementById("node").innerText;
23 </script>
24 </head>
26 <body onload="test();">
27 <p>If a zero lengthed render object (such as a text node that has been set to "") occured at the end of a line, it was previously given a non-zero sized run.</p>
28 <p>A crash would occur on iteration over a node containing such a run. NodeIterators, the innerText property, and hovering over a link all use iteration.</p>
29 <p>This tests iteration using both the innerText property and NodeIterators. It is successful if it doesn't crash Safari.</p>
30 <hr>
31 <a href="#" id="node">hello</a></body></html>