<!DOCTYPE html>
<html>
<head>
<meta id="target" http-equiv="content-language" content="zh">
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
map http-equiv content-language to -webkit-locale. This particular test tests
that dynamic changes to the meta element have no effect. This expectation may
change, see bug. The HTML 5 spec decrees that the pragma-set default language
be set only when the meta element is 
<a href="http://dev.w3.org/html5/spec/Overview.html#insert-an-element-into-a-document">inserted into the document</a>.
In Firefox and IE changing the element dynamically doesn't seem to affect the
page, but in Firefox the meta content-language displayed in "Page Information"
is affected.
</p>
<div id="console"></div>
<div id="x"></div>
<div id="y" lang="ar"></div>
<script>
function languageOfNode(id) {
    var element = document.getElementById(id);
    return window.getComputedStyle(element).webkitLocale;
}
shouldBeEqualToString("languageOfNode('x')", "zh");
shouldBeEqualToString("languageOfNode('y')", "ar");

var meta = document.getElementById("target");                                                                   
meta.content = "ja";                                                                                            
shouldBeEqualToString("languageOfNode('x')", "zh");
shouldBeEqualToString("languageOfNode('y')", "ar");

meta.httpEquiv = "foobar";
shouldBeEqualToString("languageOfNode('x')", "zh");
shouldBeEqualToString("languageOfNode('y')", "ar");

meta.httpEquiv = "content-language";
shouldBeEqualToString("languageOfNode('x')", "zh");
shouldBeEqualToString("languageOfNode('y')", "ar");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
