line-breaking-005

CSS Text — line breaking sanity check 4

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Assertion
sanity check: an unstyled span should not affect line breaking

Source

 1 <!DOCTYPE html>
 2 <html><head><meta charset="utf-8">
 3 <title>CSS Text — line breaking sanity check 4</title>
 4 <meta content="sanity check: an unstyled span should not affect line breaking" name="assert">
 5 <link href="https://www.w3.org/TR/css-text-3/#line-break-details" rel="help">
 6 <link href="reference/line-breaking-001-ref.htm" rel="match">
 7 <link href="http://florian.rivoal.net" rel="author" title="Florian Rivoal">
 8 <style>
 9 div {
10     color:green;
11     width: 1em;
12     line-height: 1em;
13     font-family: ahem;
14     white-space: normal;
15     font-size: 20px;
16 }
17 .container {
18     position: relative;
19 }
20 .fail {
21     color: red;
22     position: absolute;
23     left: 0;
24     top: 1em;
25     z-index: -1;
26 }
27 </style>
28 </head><body>
29     <p>There should be a green rectangle and no red.</p>
30     <div class="container">
31         <div>X<span>&#x200B;X<span></span></span></div>
32         <div class="fail">X</div>
33     </div>
34 
35 
36 </body></html>