|
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 an element with an invalid dir attribute has the dir attribute set by |
|
19 script after loading the page" /> |
|
20 <style> |
|
21 input, textarea { |
|
22 font-size:1em; |
|
23 } |
|
24 body { |
|
25 font-size:2em; |
|
26 } |
|
27 .test, .ref { |
|
28 border: medium solid gray; |
|
29 width: 400px; |
|
30 margin: 20px; |
|
31 } |
|
32 .comments { |
|
33 display: none; |
|
34 } |
|
35 </style> |
|
36 <script type="text/javascript"> |
|
37 function setDirs(value) |
|
38 { |
|
39 var p1 = document.getElementById("p1"); |
|
40 p1.dir = value; |
|
41 |
|
42 var p1 = document.getElementById("p2"); |
|
43 p2.dir = value; |
|
44 } |
|
45 </script> |
|
46 </head> |
|
47 <body onload="setDirs('ltr')"> |
|
48 <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> |
|
49 <div class="comments"> |
|
50 Key to entities used below: |
|
51 א - The Hebrew letter Alef (strongly RTL). |
|
52 ב - The Hebrew letter Bet (strongly RTL). |
|
53 ג - The Hebrew letter Gimel (strongly RTL). |
|
54 </div> |
|
55 <div class="test"> |
|
56 <div dir="ltr"> |
|
57 <div dir="auto"><p id="p1" dir="foopy">DEF</p>אבגABC.</div> |
|
58 </div> |
|
59 <div dir="rtl"> |
|
60 <div dir="auto"><p id="p2" dir="foopy">DEF</p>אבגABC.</div> |
|
61 </div> |
|
62 </div> |
|
63 <div class="ref"> |
|
64 <div dir="ltr"> |
|
65 <div dir="rtl"><p dir="ltr">DEF</p>אבגABC.</div> |
|
66 </div> |
|
67 <div dir="rtl"> |
|
68 <div dir="rtl"><p dir="ltr">DEF</p>אבגABC.</div> |
|
69 </div> |
|
70 </div> |
|
71 </body> |
|
72 </html> |