<html> 
<head>
<title>Right clicking on an empty cell should not extend the selection to the next cell.</title> 
</head> 
<body>
<div contentEditable="true">
<table border="1" cellspacing="0"><tr><td id="first" width="50" height="25pt"></td><td width="50" height="25pt"></td><td width="50" height="25pt"></td></tr></table>
</div>
<ul id="console"></ul>
</body>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    var elem = document.getElementById("first");
    x = elem.offsetLeft + elem.offsetWidth / 2;
    y = elem.offsetTop + elem.offsetHeight / 2;
    eventSender.mouseMoveTo(x, y);
    eventSender.mouseDown();
    eventSender.mouseUp();

    log("Before: selection type is " + window.getSelection().type);
    
    eventSender.contextClick();
    
    log("After: selection type is " + window.getSelection().type);
}

function log(str) {
    var li = document.createElement("li");
    li.appendChild(document.createTextNode(str));
    var console = document.getElementById("console");
    console.appendChild(li);
}

</script>
</html>
