bidi-breaking-002

Bidi paragraph boundaries: Forced Line Breaks

WeasyPrint

This browser

Assertion
Forced line breaks of class B (but not class WS) break bidi paragraphs.

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: Bidi paragraph boundaries: Forced Line Breaks</title>
 5   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction">
 7   <meta name="flags" content="">
 8   <meta name="assert" content="Forced line breaks of class B (but not class WS)         break bidi paragraphs.">
 9   <style type="text/css">
10      /* Make test easier to read */
11     .test, .control {
12       color: blue;
13       font: bold larger monospace;
14       margin: 1em;
15       padding: 0.25em;
16       border: solid silver;
17       float: left;
18     }
19     .set {
20       clear: both;
21       float: left;
22       border-bottom: solid orange;
23     }
24     p + .set {
25       border-top: solid orange;
26     }
27 
28     /* ensure BDO processing */
29     bdo {
30       unicode-bidi: bidi-override;
31       direction: ltr;
32     }
33 
34     /* Enable preservation of source line breaks
35        (and PS and LS for certain nonconformant ws-collapsing implementations) */
36     .pre {
37       white-space: pre; white-space: pre-lines;
38     }
39   </style>
40 </head>
41 <body>
42   <p>In each pair of silver boxes below, the two patterns must be identical.</p>
43 
44   <!-- control for bidi support -->
45   <div class="set">
46     <div class="test">
47       <div>&rlm;&nbsp; + - &times; &divide; א</div>
48       <div>ת + - &times; &divide; &nbsp;&rlm;</div>
49     </div>
50     <div class="control">
51       <div><bdo dir="ltr">א &divide; &times; - + &nbsp;</bdo></div>
52       <div><bdo dir="ltr">&nbsp; &divide; &times; - + ת</bdo></div>
53     </div>
54   </div>
55 
56   <!-- preserved source line break breaks bidi paragraph -->
57   <div class="set">
58     <div class="test">
59       <div class="pre">א + - &times; &divide; &nbsp;
60 &nbsp; + - &times; &divide; ת</div>
61     </div>
62     <div class="control">
63       <div><bdo dir="ltr">א + - &times; &divide; &nbsp;</bdo></div>
64       <div><bdo dir="ltr">&nbsp; + - &times; &divide; ת</bdo></div>
65     </div>
66   </div>
67 
68   <!-- <br> on shaky ground since HTML4 said it's an LS, but HTML5 will
69        likely side with PS due to better bidi safety; test below as PS for now;
70        move to a separate file when this is resolved in HTML5
71   <div class="set">
72     <div class="test">
73       &#x05D0; + - &times; &divide; &nbsp;<br/>
74       &nbsp; + - &times; &divide; &#x05EA;
75     </div>
76     <div class="control">
77       <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
78       <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
79     </div>
80   </div>
81   -->
82 </body>
83 </html>