blob: c7c9699f51563c8328427f9126e6ac7e8f2fd744 [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>
if (window.internals)
internals.settings.setEditingBehavior("mac");
function runSelectionTestsWithGranularityForEnclosingBlock(testNodes, granularity)
{
for (var i = 0; i < testNodes.length; ++i) {
getSelection().setPosition(testNodes[i].firstChild, 0);
log("Test " + (i + 1) + ", LTR:\n");
log(" Extending right: ");
extendAndLogSelectionWithinBlock("right", granularity, "mac");
log(" Extending left: ");
extendAndLogSelectionWithinBlock("left", granularity, "mac");
}
}
log("\n\n\nExtending by character\n");
runSelectionTestsWithGranularityForEnclosingBlock(createEnclosingBlockNodes(), "character");
log("\n\n\n\n\nExtending by word\n");
runSelectionTestsWithGranularityForEnclosingBlock(createEnclosingBlockNodes(), "word");
</script>
</body>