4 <title>Tests handling of unmatched surrogate pairs
</title>
5 <meta charset=
"utf16-be">
9 function appendLine(str
)
11 var line
= document
.createElement('div');
12 line
.appendChild(document
.createTextNode(str
));
13 document
.body
.appendChild(line
);
16 var globe
= '\u{1F30E}';
17 appendLine('Full codepoint, "\u{1F30E}". Prints a globe glyph.');
18 appendLine('First part of surrogate pair, "' + globe
.substr(0, 1) +
19 '". Should print replacement character and rest of run.');
20 appendLine('Second part of surrogate pair, "' + globe
.substr(1, 1) +
21 '". Should print replacement character and rest of run.');
22 document
.body
.appendChild(document
.createElement('br'));
24 appendLine('Spanning text nodes:');
25 var nodeA
= document
.createTextNode('- First part "' +
27 var nodeB
= document
.createTextNode(globe
.substr(1, 1) +
29 var container
= document
.createElement('div');
30 container
.appendChild(nodeA
);
31 container
.appendChild(nodeB
);
32 document
.body
.appendChild(container
);
34 appendLine('After element.normalize():');
35 var clone
= container
.cloneNode(true);
37 document
.body
.appendChild(clone
);