Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Preserve trailing white-space after deleting the last word in `display: inline-block`</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="../include/editor-test-utils.js"></script>
<script>
"use strict";
document.addEventListener("DOMContentLoaded", () => {
promise_test(async () => {
const editingHost = document.querySelector("span[contenteditable]");
const utils = new EditorTestUtils(editingHost);
utils.setupEditingHost("a b[]");
await utils.sendBackspaceKey(utils.deleteWordModifier);
assert_in_array(editingHost.innerHTML, ["a <br>", "a&nbsp;"]);
});
}, {once: true});
</script>
</head>
<body>
<span contenteditable style="display: inline-block"></span>
</body>
</html>