white-space-collapsing-breaks-001

Line Breaking in Collapsed White Space

WeasyPrint

This browser

Assertion
Line break opportunities are determined before white space collapsing.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: Line Breaking in Collapsed White Space</title>
 5   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model">
 7   <meta name="assert" content="Line break opportunities are determined before     white space collapsing.">
 8   <style type="text/css">
 9     .control {
10       line-height: 1;
11       height: 2em;
12       background: red;
13     }
14     .cover {
15       color: green;
16       background: green;
17     }
18     .constraint {
19       width: 0;
20     }
21     .nobr { white-space: nowrap; }
22   </style>
23 
24  </head>
25  <body>
26   <p>There must be a green box below and no red.</p>
27   <div class="control">
28     <div class="cover">
29       <div class="constraint">
30         <span class="nobr">AA </span> BB
31       </div>
32     </div>
33   </div>
34  </body>
35 </html>