Title: [110440] trunk/LayoutTests
Revision
110440
Author
[email protected]
Date
2012-03-12 10:13:07 -0700 (Mon, 12 Mar 2012)

Log Message

Add tests for dynamic attribute changes for mapping of lang/xml:lang to -webkit-locale
https://bugs.webkit.org/show_bug.cgi?id=80658

Patch by Matt Falkenhagen <[email protected]> on 2012-03-12
Reviewed by Alexey Proskuryakov.

* fast/text/lang-mapped-to-webkit-locale-dynamic-expected.txt: Added.
* fast/text/lang-mapped-to-webkit-locale-dynamic.xhtml: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (110439 => 110440)


--- trunk/LayoutTests/ChangeLog	2012-03-12 17:09:35 UTC (rev 110439)
+++ trunk/LayoutTests/ChangeLog	2012-03-12 17:13:07 UTC (rev 110440)
@@ -1,3 +1,13 @@
+2012-03-12  Matt Falkenhagen  <[email protected]>
+
+        Add tests for dynamic attribute changes for mapping of lang/xml:lang to -webkit-locale
+        https://bugs.webkit.org/show_bug.cgi?id=80658
+
+        Reviewed by Alexey Proskuryakov.
+
+        * fast/text/lang-mapped-to-webkit-locale-dynamic-expected.txt: Added.
+        * fast/text/lang-mapped-to-webkit-locale-dynamic.xhtml: Added.
+
 2012-03-12  Philippe Normand  <[email protected]>
 
         Unreviewed, slight Skipped list reorganization and unskip a bunch

Added: trunk/LayoutTests/fast/text/lang-mapped-to-webkit-locale-dynamic-expected.txt (0 => 110440)


--- trunk/LayoutTests/fast/text/lang-mapped-to-webkit-locale-dynamic-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/text/lang-mapped-to-webkit-locale-dynamic-expected.txt	2012-03-12 17:13:07 UTC (rev 110440)
@@ -0,0 +1,17 @@
+This is tests mapping of lang/xml:lang to -webkit-locale with dynamic attribute changes. bug 76364.
+
+PASS localeOfNode('x1') is "ko"
+PASS localeOfNode('x2') is "ko"
+PASS localeOfNode('x3') is "ar"
+PASS localeOfNode('x1') is "ja"
+PASS localeOfNode('x2') is "ja"
+PASS localeOfNode('x3') is "ar"
+PASS localeOfNode('x3') is "auto"
+PASS localeOfNode('x3') is "ja"
+PASS localeOfNode('x2') is "zh"
+PASS localeOfNode('x2') is "ja"
+PASS localeOfNode('x2') is "ja"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/text/lang-mapped-to-webkit-locale-dynamic.xhtml (0 => 110440)


--- trunk/LayoutTests/fast/text/lang-mapped-to-webkit-locale-dynamic.xhtml	                        (rev 0)
+++ trunk/LayoutTests/fast/text/lang-mapped-to-webkit-locale-dynamic.xhtml	2012-03-12 17:13:07 UTC (rev 110440)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>mapping dynamic lang to -webkit-locale</title>
+<link rel="stylesheet" href="" />
+<script src=""
+</head>
+<body>
+<p>This is tests mapping of lang/xml:lang to -webkit-locale with dynamic attribute changes. <a href="" 76364</a>.</p>
+<div id="console"></div>
+<div lang="ko" id="x1"><div id="x2"/><div id="x3" lang="ar"/></div>
+<script>
+function localeOfNode(id) {
+    var element = document.getElementById(id);
+    return window.getComputedStyle(element).webkitLocale;
+}
+var x1 = document.getElementById("x1");
+var x2 = document.getElementById("x2");
+var x3 = document.getElementById("x3");
+
+shouldBeEqualToString("localeOfNode('x1')", "ko");
+shouldBeEqualToString("localeOfNode('x2')", "ko");
+shouldBeEqualToString("localeOfNode('x3')", "ar");
+
+x1.lang = "ja";
+shouldBeEqualToString("localeOfNode('x1')", "ja");
+shouldBeEqualToString("localeOfNode('x2')", "ja");
+shouldBeEqualToString("localeOfNode('x3')", "ar");
+
+x3.lang = "";
+shouldBeEqualToString("localeOfNode('x3')", "auto");
+
+x3.removeAttribute("lang");
+shouldBeEqualToString("localeOfNode('x3')", "ja");
+
+// The "lang" attribute in the XML namespace should affect locale (since this is an XHTML document).
+var attr1 = document.createAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:lang");
+attr1.value = "zh";
+x2.setAttributeNodeNS(attr1);
+shouldBeEqualToString("localeOfNode('x2')", "zh");
+
+x2.removeAttributeNode(attr1);
+shouldBeEqualToString("localeOfNode('x2')", "ja");
+
+// An attribute with local name "lang" not in the XML namespace should not affect locale.
+var attr2 = document.createAttributeNS("foobar", "fb:lang");
+attr2.value = "ph";
+x2.setAttributeNodeNS(attr2);
+shouldBeEqualToString("localeOfNode('x2')", "ja");
+
+</script>
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to