Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / setBaseAndExtent-revert-selection.html
blob5bb90445929267d31c1127ab0214c25ca679c9b2
1 <html>
2 <head>
3 <script>
4 var output = '';
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();
14 function doIt() {
15 try {
16 var x = document.getElementById('x');
17 var y = document.getElementById('y');
18 selectNodes(x, y);
19 selectNodes(y, x);
20 document.getElementById('result').innerHTML = (output == "x y " ? "PASS" : ("FAIL: " + output));
21 } catch (e) { alert(e); }
23 </script>
24 </head>
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>
32 </body>
33 </html>