OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta id="target" http-equiv="content-language" content="zh"> | 4 <meta id="target" http-equiv="content-language" content="zh"> |
5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a
>: | 8 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a
>: |
9 map http-equiv content-language to -webkit-locale. This particular test tests | 9 map http-equiv content-language to -webkit-locale. This particular test tests |
10 that dynamic changes to the meta element have no effect. This expectation may | 10 that dynamic changes to the meta element have no effect. This expectation may |
11 change, see bug. The HTML 5 spec decrees that the pragma-set default language | 11 change, see bug. The HTML 5 spec decrees that the pragma-set default language |
12 be set only when the meta element is | 12 be set only when the meta element is |
13 <a href="http://dev.w3.org/html5/spec/Overview.html#insert-an-element-into-a-doc
ument">inserted into the document</a>. | 13 <a href="http://dev.w3.org/html5/spec/Overview.html#insert-an-element-into-a-doc
ument">inserted into the document</a>. |
14 In Firefox and IE changing the element dynamically doesn't seem to affect the | 14 In Firefox and IE changing the element dynamically doesn't seem to affect the |
15 page, but in Firefox the meta content-language displayed in "Page Information" | 15 page, but in Firefox the meta content-language displayed in "Page Information" |
16 is affected. | 16 is affected. |
17 </p> | 17 </p> |
18 <div id="console"></div> | 18 <div id="console"></div> |
19 <div id="x"></div> | 19 <div id="x"></div> |
20 <div id="y" lang="ar"></div> | 20 <div id="y" lang="ar"></div> |
21 <script> | 21 <script> |
22 function languageOfNode(id) { | 22 function languageOfNode(id) { |
23 var element = document.getElementById(id); | 23 var element = document.getElementById(id); |
24 return window.getComputedStyle(element).webkitLocale; | 24 return window.getComputedStyle(element).webkitLocale; |
25 } | 25 } |
26 shouldBeEqualToString("languageOfNode('x')", "'zh'"); | 26 shouldBeEqualToString("languageOfNode('x')", '"zh"'); |
27 shouldBeEqualToString("languageOfNode('y')", "'ar'"); | 27 shouldBeEqualToString("languageOfNode('y')", '"ar"'); |
28 | 28 |
29 var meta = document.getElementById("target");
| 29 var meta = document.getElementById("target");
|
30 meta.content = "ja";
| 30 meta.content = "ja";
|
31 shouldBeEqualToString("languageOfNode('x')", "'zh'"); | 31 shouldBeEqualToString("languageOfNode('x')", '"zh"'); |
32 shouldBeEqualToString("languageOfNode('y')", "'ar'"); | 32 shouldBeEqualToString("languageOfNode('y')", '"ar"'); |
33 | 33 |
34 meta.httpEquiv = "foobar"; | 34 meta.httpEquiv = "foobar"; |
35 shouldBeEqualToString("languageOfNode('x')", "'zh'"); | 35 shouldBeEqualToString("languageOfNode('x')", '"zh"'); |
36 shouldBeEqualToString("languageOfNode('y')", "'ar'"); | 36 shouldBeEqualToString("languageOfNode('y')", '"ar"'); |
37 | 37 |
38 meta.httpEquiv = "content-language"; | 38 meta.httpEquiv = "content-language"; |
39 shouldBeEqualToString("languageOfNode('x')", "'zh'"); | 39 shouldBeEqualToString("languageOfNode('x')", '"zh"'); |
40 shouldBeEqualToString("languageOfNode('y')", "'ar'"); | 40 shouldBeEqualToString("languageOfNode('y')", '"ar"'); |
41 </script> | 41 </script> |
42 </body> | 42 </body> |
43 </html> | 43 </html> |
OLD | NEW |