From a3813850f78c0370c2e4f97eb80bde51fdb0dc01 Mon Sep 17 00:00:00 2001
From: "commit-queue@webkit.org"
Date: Thu, 9 Feb 2012 01:41:45 +0000
Subject: [PATCH] Improve http-equiv content-language parsing
https://bugs.webkit.org/show_bug.cgi?id=77724
Patch by Matt Falkenhagen on 2012-02-08
Reviewed by Alexey Proskuryakov.
Add more tests for mapping http-equiv content-language to -webkit-locale. The desired behavior of some
of these is not yet decided, so some of the tests currently fail and the expectations may change. See comments in bug and in the tests.
* fast/text/content-language-case-insensitivity-expected.txt:
* fast/text/content-language-case-insensitivity.html: Style fixes.
* fast/text/content-language-empty-expected.txt: Added.
* fast/text/content-language-empty.html: Added.
* fast/text/content-language-late-expected.txt: Added.
* fast/text/content-language-late.html: Added.
* fast/text/content-language-mapped-to-webkit-locale-expected.txt:
* fast/text/content-language-mapped-to-webkit-locale.html: Style fixes.
* fast/text/content-language-multiple-expected.txt: Added.
* fast/text/content-language-multiple.html: Added.
* fast/text/content-language-no-content-expected.txt: Added.
* fast/text/content-language-no-content.html: Added.
* fast/text/content-language-only-whitespace-expected.txt: Added.
* fast/text/content-language-only-whitespace.html: Added.
* fast/text/content-language-with-whitespace-expected.txt: Added.
* fast/text/content-language-with-whitespace.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
---
LayoutTests/ChangeLog | 27 ++++++++++++++++++
...ontent-language-case-insensitivity-expected.txt | 2 +-
.../text/content-language-case-insensitivity.html | 6 ++--
.../fast/text/content-language-empty-expected.txt | 8 ++++++
LayoutTests/fast/text/content-language-empty.html | 28 ++++++++++++++++++
.../fast/text/content-language-late-expected.txt | 8 ++++++
LayoutTests/fast/text/content-language-late.html | 30 ++++++++++++++++++++
...t-language-mapped-to-webkit-locale-expected.txt | 4 +--
.../content-language-mapped-to-webkit-locale.html | 10 +++----
.../text/content-language-multiple-expected.txt | 8 ++++++
.../fast/text/content-language-multiple.html | 31 ++++++++++++++++++++
.../text/content-language-no-content-expected.txt | 8 ++++++
.../fast/text/content-language-no-content.html | 27 ++++++++++++++++++
.../content-language-only-whitespace-expected.txt | 8 ++++++
.../text/content-language-only-whitespace.html | 28 ++++++++++++++++++
.../content-language-with-whitespace-expected.txt | 8 ++++++
.../text/content-language-with-whitespace.html | 33 ++++++++++++++++++++++
17 files changed, 261 insertions(+), 13 deletions(-)
create mode 100644 LayoutTests/fast/text/content-language-empty-expected.txt
create mode 100644 LayoutTests/fast/text/content-language-empty.html
create mode 100644 LayoutTests/fast/text/content-language-late-expected.txt
create mode 100644 LayoutTests/fast/text/content-language-late.html
create mode 100644 LayoutTests/fast/text/content-language-multiple-expected.txt
create mode 100644 LayoutTests/fast/text/content-language-multiple.html
create mode 100644 LayoutTests/fast/text/content-language-no-content-expected.txt
create mode 100644 LayoutTests/fast/text/content-language-no-content.html
create mode 100644 LayoutTests/fast/text/content-language-only-whitespace-expected.txt
create mode 100644 LayoutTests/fast/text/content-language-only-whitespace.html
create mode 100644 LayoutTests/fast/text/content-language-with-whitespace-expected.txt
create mode 100644 LayoutTests/fast/text/content-language-with-whitespace.html
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a8ccfd4..73139a6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,30 @@
+2012-02-08 Matt Falkenhagen
+
+ Improve http-equiv content-language parsing
+ https://bugs.webkit.org/show_bug.cgi?id=77724
+
+ Reviewed by Alexey Proskuryakov.
+
+ Add more tests for mapping http-equiv content-language to -webkit-locale. The desired behavior of some
+ of these is not yet decided, so some of the tests currently fail and the expectations may change. See comments in bug and in the tests.
+
+ * fast/text/content-language-case-insensitivity-expected.txt:
+ * fast/text/content-language-case-insensitivity.html: Style fixes.
+ * fast/text/content-language-empty-expected.txt: Added.
+ * fast/text/content-language-empty.html: Added.
+ * fast/text/content-language-late-expected.txt: Added.
+ * fast/text/content-language-late.html: Added.
+ * fast/text/content-language-mapped-to-webkit-locale-expected.txt:
+ * fast/text/content-language-mapped-to-webkit-locale.html: Style fixes.
+ * fast/text/content-language-multiple-expected.txt: Added.
+ * fast/text/content-language-multiple.html: Added.
+ * fast/text/content-language-no-content-expected.txt: Added.
+ * fast/text/content-language-no-content.html: Added.
+ * fast/text/content-language-only-whitespace-expected.txt: Added.
+ * fast/text/content-language-only-whitespace.html: Added.
+ * fast/text/content-language-with-whitespace-expected.txt: Added.
+ * fast/text/content-language-with-whitespace.html: Added.
+
2012-02-08 Julien Chaffraix
Unreviewed gardening.
diff --git a/LayoutTests/fast/text/content-language-case-insensitivity-expected.txt b/LayoutTests/fast/text/content-language-case-insensitivity-expected.txt
index 5f0b4db..315c45a 100644
--- a/LayoutTests/fast/text/content-language-case-insensitivity-expected.txt
+++ b/LayoutTests/fast/text/content-language-case-insensitivity-expected.txt
@@ -1,6 +1,6 @@
Test for bug 76701: map content-language to -webkit-locale. This particular test tests that the matching of the http-equiv attribute to the content-language state is case insensitive.
-PASS languageOfNode('x1') is "ja-JP"
+PASS languageOfNode('x') is "ja-JP"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/text/content-language-case-insensitivity.html b/LayoutTests/fast/text/content-language-case-insensitivity.html
index b975bf3..dd7aa3f 100644
--- a/LayoutTests/fast/text/content-language-case-insensitivity.html
+++ b/LayoutTests/fast/text/content-language-case-insensitivity.html
@@ -12,15 +12,13 @@ matching of the http-equiv attribute to the content-language state is case
insensitive.
-
+
+Test for bug 76701:
+map HTTP-EQUIV content-language to -webkit-locale. This particular test tests
+that a content-language of empty string is ignored. This expectation may
+change, see bug. HTML5 decrees that the meta element be ignored in case of the
+empty string. It's unclear what other browsers do.
+
+
+
+
+
+
+
diff --git a/LayoutTests/fast/text/content-language-empty-expected.txt b/LayoutTests/fast/text/content-language-empty-expected.txt
new file mode 100644
index 0000000..0d27f59
--- /dev/null
+++ b/LayoutTests/fast/text/content-language-empty-expected.txt
@@ -0,0 +1,8 @@
+Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that a content-language of empty string is ignored. This expectation may change, see bug. HTML5 decrees that the meta element be ignored in case of the empty string. It's unclear what other browsers do.
+
+FAIL languageOfNode('x') should be auto. Was ''.
+PASS languageOfNode('y') is "ar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/text/content-language-empty.html b/LayoutTests/fast/text/content-language-empty.html
new file mode 100644
index 0000000..c043a18
--- /dev/null
+++ b/LayoutTests/fast/text/content-language-empty.html
@@ -0,0 +1,28 @@
+
+
+