From: commit-queue@webkit.org Date: Thu, 9 Feb 2012 01:41:45 +0000 (+0000) Subject: Improve http-equiv content-language parsing X-Git-Tag: 070512121124~13388 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3813850f78c0370c2e4f97eb80bde51fdb0dc01;p=profile%2Fivi%2Fwebkit-efl.git 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 --- 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.

-
+
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 @@ + + + + + + + + +

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-late-expected.txt b/LayoutTests/fast/text/content-language-late-expected.txt new file mode 100644 index 0000000..55d4273 --- /dev/null +++ b/LayoutTests/fast/text/content-language-late-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 is used even if it appears at the end of the document. This expectation may change, see bug. According to the HTML 5 spec, a meta element should be processed when it is inserted into the document, regardless of where. IE and Firefox also seem to process the content-language at the end of the document. + +FAIL languageOfNode('x') should be ja-JP. Was auto. +PASS languageOfNode('y') is "ar" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/text/content-language-late.html b/LayoutTests/fast/text/content-language-late.html new file mode 100644 index 0000000..b5c7d3e --- /dev/null +++ b/LayoutTests/fast/text/content-language-late.html @@ -0,0 +1,30 @@ + + + + + + + +

Test for bug 76701: +map HTTP-EQUIV content-language to -webkit-locale. This particular test tests +that a content-language is used even if it appears at the end of the document. +This expectation may change, see bug. According to the HTML 5 spec, a meta +element should be processed when it is inserted into the document, regardless +of where. IE and Firefox also seem to process the content-language at the end +of the document. +

+
+
+
+ + + + + diff --git a/LayoutTests/fast/text/content-language-mapped-to-webkit-locale-expected.txt b/LayoutTests/fast/text/content-language-mapped-to-webkit-locale-expected.txt index 7c79078..66ba83a 100644 --- a/LayoutTests/fast/text/content-language-mapped-to-webkit-locale-expected.txt +++ b/LayoutTests/fast/text/content-language-mapped-to-webkit-locale-expected.txt @@ -1,7 +1,7 @@ Test for bug 76701: map content-language to -webkit-locale. -PASS languageOfNode('x1') is "zh-CN" -PASS languageOfNode('m1') is "ar" +PASS languageOfNode('x') is "zh-CN" +PASS languageOfNode('y') is "ar" PASS successfullyParsed is true TEST COMPLETE diff --git a/LayoutTests/fast/text/content-language-mapped-to-webkit-locale.html b/LayoutTests/fast/text/content-language-mapped-to-webkit-locale.html index bb61ea1..9ff0fd6 100644 --- a/LayoutTests/fast/text/content-language-mapped-to-webkit-locale.html +++ b/LayoutTests/fast/text/content-language-mapped-to-webkit-locale.html @@ -9,17 +9,15 @@

Test for bug 76701: map content-language to -webkit-locale.

-
-
+
+
diff --git a/LayoutTests/fast/text/content-language-multiple-expected.txt b/LayoutTests/fast/text/content-language-multiple-expected.txt new file mode 100644 index 0000000..5981ef8 --- /dev/null +++ b/LayoutTests/fast/text/content-language-multiple-expected.txt @@ -0,0 +1,8 @@ +Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that in the event of multiple content-languages, the final content-language is used as the pragma-set default language. This expectation may change, see bug. The HTML5 spec decrees that the first successfully processed one be used. Firefox and IE seem to use the final one. + +PASS languageOfNode('x') is "zh_CN" +PASS languageOfNode('y') is "ar" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/text/content-language-multiple.html b/LayoutTests/fast/text/content-language-multiple.html new file mode 100644 index 0000000..44ea63c --- /dev/null +++ b/LayoutTests/fast/text/content-language-multiple.html @@ -0,0 +1,31 @@ + + + + + + + + + + +

Test for bug 76701: +map HTTP-EQUIV content-language to -webkit-locale. This particular test tests +that in the event of multiple content-languages, the final content-language is +used as the pragma-set default language. This expectation may change, see bug. +The HTML5 spec decrees that the first successfully processed one be used. +Firefox and IE seem to use the final one. +

+
+
+
+ + + + diff --git a/LayoutTests/fast/text/content-language-no-content-expected.txt b/LayoutTests/fast/text/content-language-no-content-expected.txt new file mode 100644 index 0000000..b88dc92 --- /dev/null +++ b/LayoutTests/fast/text/content-language-no-content-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 with missing content is effectively ignored. This expectation may change, see comments in bug. + +PASS languageOfNode('x') is "auto" +PASS languageOfNode('y') is "ar" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/text/content-language-no-content.html b/LayoutTests/fast/text/content-language-no-content.html new file mode 100644 index 0000000..8839b22 --- /dev/null +++ b/LayoutTests/fast/text/content-language-no-content.html @@ -0,0 +1,27 @@ + + + + + + + + +

Test for bug 76701: +map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that +a content-language with missing content is effectively ignored. This expectation +may change, see comments in bug. +

+
+
+
+ + + + diff --git a/LayoutTests/fast/text/content-language-only-whitespace-expected.txt b/LayoutTests/fast/text/content-language-only-whitespace-expected.txt new file mode 100644 index 0000000..5d14508 --- /dev/null +++ b/LayoutTests/fast/text/content-language-only-whitespace-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 with whitespace-only content is ignored. This expectation may change, see bug. HTML5 decrees that the meta element be ignored in case of whitespace only content. It's unclear what other browsers do. + +FAIL languageOfNode('x') should be auto. Was ' \9\a '. +PASS languageOfNode('y') is "ar" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/text/content-language-only-whitespace.html b/LayoutTests/fast/text/content-language-only-whitespace.html new file mode 100644 index 0000000..88e82ed --- /dev/null +++ b/LayoutTests/fast/text/content-language-only-whitespace.html @@ -0,0 +1,28 @@ + + + + + + + + +

Test for bug 76701: +map HTTP-EQUIV content-language to -webkit-locale. This particular test tests +that a content-language with whitespace-only content is ignored. This +expectation may change, see bug. HTML5 decrees that the meta element be ignored +in case of whitespace only content. It's unclear what other browsers do.

+
+
+
+ + + + diff --git a/LayoutTests/fast/text/content-language-with-whitespace-expected.txt b/LayoutTests/fast/text/content-language-with-whitespace-expected.txt new file mode 100644 index 0000000..ba01c72 --- /dev/null +++ b/LayoutTests/fast/text/content-language-with-whitespace-expected.txt @@ -0,0 +1,8 @@ +Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that the the pragma-set default language is set to the first sequence of non-whitespace characters of the content-language content. This expectation may change, see bug. This expectation is as per the HTML 5 spec. It appears that Firefox does not exactly do this, but trims the leading and trailing whitespace. It's unclear what IE does. + +FAIL languageOfNode('x') should be ja_JP. Was ' \a\9\9ja-JP \9 zh_CN \9\a\a\9\9'. +PASS languageOfNode('y') is "ar" +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/text/content-language-with-whitespace.html b/LayoutTests/fast/text/content-language-with-whitespace.html new file mode 100644 index 0000000..a8658e7 --- /dev/null +++ b/LayoutTests/fast/text/content-language-with-whitespace.html @@ -0,0 +1,33 @@ + + + + + + + + +

Test for bug 76701: +map HTTP-EQUIV content-language to -webkit-locale. This particular test tests +that the the pragma-set default language is set to the first sequence of +non-whitespace characters of the content-language content. This expectation may +change, see bug. This expectation is as per the HTML 5 spec. It appears that +Firefox does not exactly do this, but trims the leading and trailing +whitespace. It's unclear what IE does. +

+
+
+
+ + + +