Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / content-language-dynamically-added.html
blob32616ba3012c7dda4a3ba88c1e25fe76fb600914
1 <!DOCTYPE html>
2 <html>
3 <head id="head">
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
8 map http-equiv content-language to -webkit-locale. This particular test tests
9 that a dynamically added content-language is processed. This expectation may
10 change, see bug. The HTML 5 spec decrees that http-equiv content-language be
11 processed when it is
12 <a href="http://dev.w3.org/html5/spec/Overview.html#insert-an-element-into-a-document">inserted into the document</a>.
13 In Firefox and IE adding the meta element dynamically doesn't seem to affect
14 the page, but in Firefox the meta content-language displayed in "Page
15 Information" is affected.
16 </p>
17 <div id="console"></div>
18 <div id="x"></div>
19 <div id="y" lang="ar"></div>
20 <script>
21 function languageOfNode(id) {
22 var element = document.getElementById(id);
23 return window.getComputedStyle(element).webkitLocale;
25 shouldBeEqualToString("languageOfNode('x')", "auto");
26 shouldBeEqualToString("languageOfNode('y')", '"ar"');
28 var meta = document.createElement("meta");
29 meta.httpEquiv = "content-language";
30 meta.content = "ja";
31 document.getElementById("head").appendChild(meta);
32 shouldBeEqualToString("languageOfNode('x')", '"ja"');
33 shouldBeEqualToString("languageOfNode('y')", '"ar"');
34 </script>
35 </body>
36 </html>