white-space-processing-006

White-space 'nowrap' with carriage return adjoining linefeed

WeasyPrint

This browser

Flags
ahem, may
Assertion
A carriage return before a linefeed is removed if 'white-space' is set to 'nowrap'. The linefeed may be rendered as a space or not rendered.

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: White-space 'nowrap' with carriage return adjoining linefeed</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model">
 7         <meta name="flags" content="ahem may">
 8         <meta name="assert" content="A carriage return before a linefeed is removed if 'white-space' is set to 'nowrap'. The linefeed may be rendered as a space or not rendered.">
 9         <style type="text/css">
10             div
11             {
12                 font-family: Ahem;
13                 height: 1em;
14                 margin-bottom: 3px;
15                 width: 4em;
16             }
17             #div1
18             {
19                 background: black;
20                 white-space: nowrap;
21             }
22             #div2
23             {
24                 background-color: blue;
25             }
26         </style>
27     </head>
28     <body>
29         <p>Test passes if the black box below is the same width, or shorter, than the blue box. Its okay if the black box has a small notch in it.</p>
30         <div id="div1">XX
31 X</div>
32         <div id="div2"></div>
33     </body>
34 </html>