blob: cc937f28f8e5eb7edbd7956442826bc49d318709 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<!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,
[
'<font face="monospace">def <b>g</b></font>',
'<font face="monospace">def <b>g<br></b></font>',
]
);
}, "");
</script>
</body>
</html>
|