blob: 8e461aefa121cef1822c5d7175cbaa562f01076f [file] [edit]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<!-- U+2028 LINE SEPARATOR has UAX#14 line breaking class BK and is a forced line break
regardless of white-space (CSS Text Level 3 §5.1).
All cases use Ahem 10px with line-height: 10px for exact measurements. -->
<!-- white-space: normal — U+2028 still forces a line break (BK class, unconditional). -->
<div id="normal" style="font-family: Ahem; font-size: 10px; line-height: 10px; white-space: normal;"></div>
<!-- white-space: pre -->
<div id="pre" style="font-family: Ahem; font-size: 10px; line-height: 10px; white-space: pre;"></div>
<!-- white-space: pre-wrap -->
<div id="pre-wrap" style="font-family: Ahem; font-size: 10px; line-height: 10px; white-space: pre-wrap;"></div>
<!-- white-space: pre-line -->
<div id="pre-line" style="font-family: Ahem; font-size: 10px; line-height: 10px; white-space: pre-line;"></div>
<script>
description("U+2028 LINE SEPARATOR is a forced line break in all white-space modes (UAX#14 class BK, CSS Text Level 3 §5.1).");
var ls = "\u2028";
document.getElementById("normal").textContent = "a" + ls + "b";
document.getElementById("pre").textContent = "a" + ls + "b";
document.getElementById("pre-wrap").textContent = "a" + ls + "b";
document.getElementById("pre-line").textContent = "a" + ls + "b";
// U+2028 forces a line break unconditionally — two lines (20px) in all white-space modes.
shouldBe("document.getElementById('normal').offsetHeight", "20");
shouldBe("document.getElementById('pre').offsetHeight", "20");
shouldBe("document.getElementById('pre-wrap').offsetHeight", "20");
shouldBe("document.getElementById('pre-line').offsetHeight", "20");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>