blob: 5826d2f5d996d32b49c2d1210dc90127f82dc3da [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test.js"></script>
<div contenteditable>Also bug if moved to here</div>
<div contentEditable>Bug if moved to here</div>
<div id="before" contenteditable>Selection starts here, and should not go out from here</div>
<div contenteditable>Bug if moved to here</div>
<div contenteditable>Also bug if moved to here</div>
<script>
description("Ensure that moving a selection does not skip adjacent contenteditable if the current is contentEditable.");
var before = document.getElementById("before");
var selection = window.getSelection();
selection.collapse(before, 0);
selection.modify("move", "backward", "character");
shouldBe("selection.focusNode.parentElement", "before");
selection.collapse(before, 1);
selection.modify("move", "forward", "character");
shouldBe("selection.focusNode.parentElement", "before");
</script>
</body>
</html>