6 function selectNodes(a
, b
) {
7 window
.getSelection().setBaseAndExtent(a
, 1, b
, 1);
8 output
+= window
.getSelection().anchorNode
.parentNode
.id
+ ' ';
11 if (window
.testRunner
)
12 testRunner
.dumpAsText();
16 var x
= document
.getElementById('x');
17 var y
= document
.getElementById('y');
20 document
.getElementById('result').innerHTML
= (output
== "x y " ? "PASS" : ("FAIL: " + output
));
21 } catch (e
) { alert(e
); }
25 <body onload=
"doIt()">
26 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=20117">bug
20117</a>:
27 setBaseAndExtent fails to reverse the current selection.
</p>
28 <div id='x'
>Div X
</div>
29 <div id='y'
>Div Y
</div>
30 <div id='z'
>Div Z
</div>
31 <div id='result'
>FAIL (script didn't run)
</div>