Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-text/bidi/bidi-plaintext-003.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text test: unicode-bidi:plaintext line alignment after a dynamic change of line breaks</title>
<link rel="match" href="reference/bidi-plaintext-003-ref.html">
<style>
.test {
font: 20px Arial, sans-serif;
margin: 10px;
border: 1px solid gray;
width: 20em;
unicode-bidi: plaintext;
}
.narrow {
width: 6em;
}
</style>
<p>Alignment of text in both boxes should match (all lines of the Hebrew
paragraph right-aligned, and those of the English left-aligned):</p>
<div class="test" id="a">Hello Bidi World!<br>שלום עולם שלום עולם שלום עולם</div>
<div class="test" id="b"><span>Hello Bidi World!<br>שלום עולם שלום עולם שלום עולם</span></div>
<script>
document.documentElement.classList.add("reftest-wait");
requestAnimationFrame(() => requestAnimationFrame(() => {
// Make the line breaks change after the initial layout.
document.getElementById("a").classList.add("narrow");
document.getElementById("b").classList.add("narrow");
document.documentElement.offsetHeight;
requestAnimationFrame(() => {
document.documentElement.classList.remove("reftest-wait");
});
}));
</script>