34 lines
1,004 B
HTML
34 lines
1,004 B
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
</head>
|
|
<body>
|
|
<div contenteditable><div><br></div></div>
|
|
<script>
|
|
"use strict";
|
|
|
|
const editingHost = document.querySelector("div[contenteditable]");
|
|
test(() => {
|
|
editingHost.focus();
|
|
document.execCommand("fontName", false, "monospace");
|
|
document.execCommand("insertText", false, "abc");
|
|
document.execCommand("insertParagraph");
|
|
document.execCommand("insertText", false, "def ");
|
|
document.execCommand("bold");
|
|
document.execCommand("insertText", false, "g");
|
|
assert_in_array(
|
|
editingHost.querySelector("div + div").innerHTML,
|
|
// It's fine to convert the white-space at end of the `Text` in the <font>
|
|
// for optimizing the deletion handler of following <b>.
|
|
[
|
|
'<font face="monospace">def <b>g</b></font>',
|
|
'<font face="monospace">def <b>g</b></font>',
|
|
]
|
|
);
|
|
}, "");
|
|
</script>
|
|
</body>
|
|
</html>
|