blob: 9a48b46d0c632eea003e0b455c811ed2df12df81 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="resources/extend-selection.css" />
<script src="resources/extend-selection.js"></script>
</head>
<body>
<pre id="console"></pre>
<script>
function runSelectionTestsWithGranularityForEnclosingBlock(testNodes, granularity)
{
for (var i = 0; i < testNodes.length; ++i) {
getSelection().setPosition(testNodes[i], 0);
log("Test " + (i + 1) + ", LTR:\n");
log(" Extending right: ");
extendAndLogSelectionWithinBlock("right", granularity, "win");
log(" Extending left: ");
extendAndLogSelectionWithinBlock("left", granularity, "win");
}
}
if (window.internals)
internals.settings.setEditingBehavior("win");
log("\n\n\nExtending by character\n");
runSelectionTestsWithGranularityForEnclosingBlock(createEnclosingBlockNodes(), "character");
log("\n\n\n\n\nExtending by word\n");
runSelectionTestsWithGranularityForEnclosingBlock(createEnclosingBlockNodes(), "word");
</script>
</body>