1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <title>mapping dynamic lang to -webkit-locale</title>
6 <script src="../../resources/js-test.js"></script>
8 function localeOfNode(id) {
9 var element = document.getElementById(id);
10 return window.getComputedStyle(element).webkitLocale;
14 description('This tests mapping of lang/xml:lang to -webkit-locale with dynamic attribute changes. WebKit bug 76364');
15 var x1 = document.getElementById("x1");
16 var x2 = document.getElementById("x2");
17 var x3 = document.getElementById("x3");
19 shouldBeEqualToString("localeOfNode('x1')", "ko");
20 shouldBeEqualToString("localeOfNode('x2')", "ko");
21 shouldBeEqualToString("localeOfNode('x3')", "ar");
24 shouldBeEqualToString("localeOfNode('x1')", "ja");
25 shouldBeEqualToString("localeOfNode('x2')", "ja");
26 shouldBeEqualToString("localeOfNode('x3')", "ar");
29 shouldBeEqualToString("localeOfNode('x3')", "auto");
31 x3.removeAttribute("lang");
32 shouldBeEqualToString("localeOfNode('x3')", "ja");
34 // If we include js-test-post.js directly, the "TEST COMPLETE" output comes out of order.
35 wasPostTestScriptParsed = true;
40 <body onload="runTest();">
41 <div lang="ko" id="x1"><div id="x2"/><div id="x3" lang="ar"/></div>