4 <script src=
"../../resources/js-test.js"></script>
5 <title>Test moving up and down through non-renderered elements.
</title>
8 <div id=
"before" hidden
></div>
9 <h1 id=
"first_line">First line of rendered text
</h1>
10 <div id=
"after" hidden
></div>
12 <p id=
"description"></p>
13 <div id=
"console"></div>
16 description("Test moving up and down through non-renderered elements. This test should execute quickly if it's working correctly; a timeout is a failure.");
18 var before
= document
.getElementById("before");
19 var after
= document
.getElementById("after");
20 for (var i
= 0; i
< 1000; i
++) {
21 before
.appendChild(document
.createElement("meta"));
22 after
.appendChild(document
.createElement("meta"));
25 function selectFirstLine() {
26 var selection
= document
.getSelection();
27 selection
.removeAllRanges();
28 var range
= document
.createRange();
29 range
.selectNode(document
.getElementById("first_line"));
30 selection
.addRange(range
);
33 for (var i
= 0; i
< 100; i
++) {
35 if (window
.testRunner
)
36 testRunner
.execCommand("MoveUpAndModifySelection");
39 if (window
.testRunner
)
40 testRunner
.execCommand("MoveDownAndModifySelection");
43 before
.textContent
= "";
44 after
.textContent
= "";