OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>page title</title> | |
5 </head> | |
6 <body> | |
7 <iframe id=iframe></iframe> | |
8 <script> | |
9 var iframe = document.getElementById('iframe'); | |
10 | |
11 function assertDirection(label, expectedDirection, html) | |
12 { | |
13 var doc = iframe.contentDocument; | |
14 doc.removeChild(doc.documentElement); | |
15 doc.open(); | |
16 doc.write(html); | |
17 doc.close(); | |
18 | |
19 var dir = window.testRunner ? testRunner.titleTextDirection : 'testRunner un
available'; | |
20 var status = html + ' should have title direction "' + expectedDirection + '
". '; | |
21 if (dir == expectedDirection) { | |
22 status += 'PASS'; | |
23 } else { | |
24 status += 'FAIL (got: "' + dir + '")'; | |
25 } | |
26 var div = document.createElement('div'); | |
27 div.innerText = status; | |
28 document.body.appendChild(div); | |
29 } | |
30 | |
31 if (window.testRunner) | |
32 testRunner.dumpAsText(); | |
33 | |
34 assertDirection('normal doc', 'ltr', | |
35 '<html><title>foo</title></html>'); | |
36 assertDirection('title dir=rtl', 'rtl', | |
37 '<html><title dir=rtl>foo</title></html>'); | |
38 assertDirection('html dir=rtl', 'rtl', | |
39 '<html dir=rtl><title>foo</title></html>'); | |
40 assertDirection('html dir=rtl, title dir=ltr', 'ltr', | |
41 '<html dir=rtl><title dir=ltr>foo</title></html>'); | |
42 </script> | |
43 </body> | |
44 </html> | |
OLD | NEW |