white-space-processing-050

White-space 'normal' on a 'pre' element

WeasyPrint

This browser

Flags
ahem
Assertion
The 'white-space' property set to 'normal' removes extra spacing when two spaces are next to each other when set on 'pre' element.

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 'normal' on a 'pre' element</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">
 8         <meta name="assert" content="The 'white-space' property set to 'normal' removes extra spacing when two spaces are next to each other when set on 'pre' element.">
 9         <style type="text/css">
10             pre
11             {
12                 font: 16px/1em Ahem;
13                 margin: 0;
14                 padding: 0;
15             }
16             #pre1
17             {
18                 white-space: normal;
19             }
20             #pre2
21             {
22                 background: blue;
23             }
24             #pre3
25             {
26                 margin-left: 1em;
27             }
28             #pre2, #pre3
29             {
30                 background: black;
31                 display: inline-block;
32                 height: 1em;
33                 width: 2em;
34             }
35         </style>
36     </head>
37     <body>
38         <p>Test passes if there are only two boxes below.</p>
39         <pre id="pre1">XX   XX</pre>
40         <pre id="pre2"></pre><pre id="pre3"></pre>
41     </body>
42 </html>