blob: cddc8254663b97fadbd8839967850381550dde13 [file] [edit]
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Basic User Interface Test: text-overflow with string and bidi text</title>
<link rel="author" title="Minseong Kim" href="mailto:jja08111@gmail.com">
<link rel="help" href="https://drafts.csswg.org/css-overflow-4">
<link rel="match" href="reference/text-overflow-string-005-ref.html">
<meta name="assert" content="When text-overflow is a string and the content overflows, the string should appear as ellipsis, and it should work correctly with bidirectional text.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
@font-face {
/* Pin a bundled font covering Latin and Hebrew so the bidi content is laid
out with known, platform-independent advances. */
font-family: "mplus-test";
src: url("/fonts/mplus-1p-regular.woff");
}
div {
font-family: "mplus-test";
font-size: 20px;
white-space: pre;
/* 6ch for the digits "123456" + 6px for the space + 20px for the Hebrew +
9px for the "-" ellipsis + 4px of slack against rounding. The LTR line
then keeps "ום 123456" and the RTL line keeps "שלום 3456". */
width: calc(6ch + 6px + 20px + 9px + 4px);
overflow: hidden;
}
div.test {
text-overflow: "-";
}
</style>
<body>
<p>Test passes if each pair of lines looks identical</p>
<div class="test">שלום 123456</div>
<div>ום 123456-</div>
<br/>
<div class="test" dir=rtl>שלום 123456</div>
<div dir=rtl>שלום 3456-</div>
</body>