|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <meta charset="utf-8" /> |
|
5 <title>HTML Test: dir=auto, start with dir, then R</title> |
|
6 <link rel="reference" href="dir_auto-contained-dir-R-ref.html" /> |
|
7 <link rel="author" title="Matitiahu Allouche" href="mailto:matitiahu.allouche@google.com" /> |
|
8 <link rel="author" title="Oren Roth" href="mailto:oren.roth@gmail.com" /> |
|
9 <link rel="author" title="Simon Montagu" href="mailto:smontagu@smontagu.org" /> |
|
10 <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" /> |
|
11 <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#the-dir-attribute" /> |
|
12 <meta name="assert" content=" |
|
13 When dir='auto', the direction is set according to the first strong character |
|
14 of the text while ignoring contained elements with an explicit dir of their own. |
|
15 In this test, it is the Hebrew letter Alef, thus the direction must be |
|
16 resolved as RTL. |
|
17 This is a variation of the original dir_auto-contained-dir-R.html in which |
|
18 the explicit dir is set by script after loading the page" /> |
|
19 <style> |
|
20 input, textarea { |
|
21 font-size:1em; |
|
22 } |
|
23 body { |
|
24 font-size:2em; |
|
25 } |
|
26 .test, .ref { |
|
27 border: medium solid gray; |
|
28 width: 400px; |
|
29 margin: 20px; |
|
30 } |
|
31 .comments { |
|
32 display: none; |
|
33 } |
|
34 </style> |
|
35 <script type="text/javascript"> |
|
36 function setDirs(value) |
|
37 { |
|
38 var p1 = document.getElementById("p1"); |
|
39 p1.dir = value; |
|
40 |
|
41 var p1 = document.getElementById("p2"); |
|
42 p2.dir = value; |
|
43 } |
|
44 </script> |
|
45 </head> |
|
46 <body onload="setDirs('ltr')"> |
|
47 <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> |
|
48 <div class="comments"> |
|
49 Key to entities used below: |
|
50 א - The Hebrew letter Alef (strongly RTL). |
|
51 ב - The Hebrew letter Bet (strongly RTL). |
|
52 ג - The Hebrew letter Gimel (strongly RTL). |
|
53 </div> |
|
54 <div class="test"> |
|
55 <div dir="ltr"> |
|
56 <div dir="auto"><p id="p1">DEF</p>אבגABC.</div> |
|
57 </div> |
|
58 <div dir="rtl"> |
|
59 <div dir="auto"><p id="p2">DEF</p>אבגABC.</div> |
|
60 </div> |
|
61 </div> |
|
62 <div class="ref"> |
|
63 <div dir="ltr"> |
|
64 <div dir="rtl"><p dir="ltr">DEF</p>אבגABC.</div> |
|
65 </div> |
|
66 <div dir="rtl"> |
|
67 <div dir="rtl"><p dir="ltr">DEF</p>אבגABC.</div> |
|
68 </div> |
|
69 </div> |
|
70 </body> |
|
71 </html> |