white-space-generated-content-before-001

White-space 'pre-line' vs. ':before' assignment

WeasyPrint

This browser

Assertion
The ':before' assignment and 'white-space: pre-line' assignment behave the same way with respect to white space.

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 'pre-line' vs. ':before' assignment</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-prop">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="The ':before' assignment and 'white-space: pre-line' assignment behave the same way with respect to white space.">
 9         <style type="text/css">
10             #div1
11             {
12                 white-space: pre-line;
13             }
14             #div2:before
15             {
16                 content:" The   spacing  on      these         ";
17                 white-space: pre-line;
18             }
19         </style>
20     </head>
21     <body>
22         <p>Test passes if the two lines below have the exact same spacing.</p>
23         <div id="div1"> The   spacing  on      these         two  sentences need to be the    same!  </div>
24         <div id="div2">two  sentences need to be the    same!  </div>
25     </body>
26 </html>