<html>
  <head>
    <script>
      var output = '';
   
      function selectNodes(a, b) {
        window.getSelection().setBaseAndExtent(a, 1, b, 1);
        output += window.getSelection().anchorNode.parentNode.id + ' ';   
      }

      if (window.layoutTestController)
        layoutTestController.dumpAsText();

      function doIt() {
        try {
          var x = document.getElementById('x');
          var y = document.getElementById('y');
          selectNodes(x, y);
          selectNodes(y, x);
          document.getElementById('result').innerHTML = (output == "x y " ? "PASS" : ("FAIL: " + output));
        } catch (e) { alert(e); }
      }
    </script>
  </head>
  <body onload="doIt()">
    <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=20117">bug 20117</a>:
    setBaseAndExtent fails to reverse the current selection.</p>
    <div id='x'>Div X</div>
    <div id='y'>Div Y</div>
    <div id='z'>Div Z</div>
    <div id='result'>FAIL (script didn't run)</div>
  </body>
</html>
