diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-text/white-space/trailing-space-before-br-001.html')
-rw-r--r-- | testing/web-platform/tests/css/css-text/white-space/trailing-space-before-br-001.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-text/white-space/trailing-space-before-br-001.html b/testing/web-platform/tests/css/css-text/white-space/trailing-space-before-br-001.html new file mode 100644 index 0000000000..fcc2bdfa43 --- /dev/null +++ b/testing/web-platform/tests/css/css-text/white-space/trailing-space-before-br-001.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<title>CSS Text: A sequence of collapsible spaces at the end of a line is removed</title> +<link rel='help' href='https://drafts.csswg.org/css-text-3/#white-space-phase-2'> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<style> +#container > div { + display: inline-block; + -font-family: Ahem; + font-size: 10px; +} +</style> +<body> +<div id=log></div> +<div id=container> + <div>1111</div> + <div>1111 </div> + <div> 1111</div> + <div> 1111 </div> + <div>1111<br></div> + <div>1111<br> </div> + <div>1111 <br></div> + <div>1111 <br> </div> +</div> +<script> +(function () { + const epsilon = 1; + let elements = Array.from(container.children); + let reference = elements[0]; + let reference_width = reference.offsetWidth; + for (let element of elements) { + test(() => { + assert_approx_equals(element.offsetWidth, reference_width, epsilon); + }, escapeSpaces(element.innerHTML)); + } +})(); + +function escapeSpaces(text) { + return text + .replace(/ /g, ' ') + .replace(/\n/g, '
') +} +</script> +</body> |