<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://drafts.csswg.org/css-text-3/#letter-spacing-property">
<link rel=help href="https://bugzilla.mozilla.org/show_bug.cgi?id=1892262">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#t, #r {
font: 20px/1 monospace;
letter-spacing: 2ch;
overflow-wrap: anywhere;
outline: 1px solid black;
margin: 10px;
}
</style>
<script>
function run() {
let refWidth = r.offsetWidth;
test(() => assert_less_than(t.offsetWidth, refWidth, "test div should have smaller width"));
t.style.width = "max-content";
test(() => assert_equals(t.offsetWidth, refWidth, "widths should now match"));
}
</script>
</head>
<body onload="run()">
<div id="r" style="width: max-content;">
aaaaa<i></i>bbb
</div>
<div id="t" style="width: 15ch;">
aaaaa<i></i>bbb
</div>