11 <script src=
"../../resources/js-test.js"></script>
12 <script src=../editing.js
language=
"JavaScript" type=
"text/JavaScript" ></script>
18 if (window
.internals
) {
19 internals
.settings
.setUnifiedTextCheckerEnabled(true);
20 internals
.settings
.setAsynchronousSpellCheckingEnabled(true);
23 function editingTest() {
25 var elem
= document
.getElementById("test");
26 var selection
= window
.getSelection();
27 selection
.collapse(elem
, elem
.childNodes
.length
);
29 typeCharacterCommand('z');
30 typeCharacterCommand('z');
31 typeCharacterCommand(' ');
32 typeCharacterCommand('a');
33 typeCharacterCommand(' ');
34 typeCharacterCommand('a');
35 moveSelectionBackwardByWordCommand();
36 insertLineBreakCommand();
38 if (window
.testRunner
) {
39 selection
.collapse(elem
, 0);
40 shouldBecomeEqual("internals.hasSpellingMarker(document, 6, 2)", "true", function() {
41 document
.getElementById("root").style
.display
= "none";
50 <title>Editing Test
</title>
54 description("Misspellings should be preserved when a line-break command "
55 + "splits a text node. You should see 'Hello,zz a' on the first line below, "
56 + "and 'a' on the second line. "
57 + "This test succeeds when 'zz' (and only 'zz') is marked as misspelled.");
59 <div contenteditable
id=
"root" class=
"editing">
60 <!-- we need to lead "Hello," to preserve the marker even after collapse() -->
61 <span id=
"test">Hello,
</span>