blob: 1991028b948800d6ace2ccd8ff4198242a6e84c0 [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().collapse(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>