| Differences between
and this patch
- a/LayoutTests/ChangeLog +27 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-02-08  Matt Falkenhagen  <falken@chromium.org>
2
3
        Improve http-equiv content-language parsing
4
        https://bugs.webkit.org/show_bug.cgi?id=77724
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add more tests for mapping http-equiv content-language to -webkit-locale. The desired behavior of some
9
        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.
10
11
        * fast/text/content-language-case-insensitivity-expected.txt:
12
        * fast/text/content-language-case-insensitivity.html: Style fixes.
13
        * fast/text/content-language-empty-expected.txt: Added.
14
        * fast/text/content-language-empty.html: Added.
15
        * fast/text/content-language-late-expected.txt: Added.
16
        * fast/text/content-language-late.html: Added.
17
        * fast/text/content-language-mapped-to-webkit-locale-expected.txt: 
18
        * fast/text/content-language-mapped-to-webkit-locale.html: Style fixes.
19
        * fast/text/content-language-multiple-expected.txt: Added.
20
        * fast/text/content-language-multiple.html: Added.
21
        * fast/text/content-language-no-content-expected.txt: Added.
22
        * fast/text/content-language-no-content.html: Added.
23
        * fast/text/content-language-only-whitespace-expected.txt: Added.
24
        * fast/text/content-language-only-whitespace.html: Added.
25
        * fast/text/content-language-with-whitespace-expected.txt: Added.
26
        * fast/text/content-language-with-whitespace.html: Added.
27
1
2012-02-07  Erik Arvidsson  <arv@chromium.org>
28
2012-02-07  Erik Arvidsson  <arv@chromium.org>
2
29
3
        [V8] Allow bindings for attributes on DOM nodes to also set a named hidden reference
30
        [V8] Allow bindings for attributes on DOM nodes to also set a named hidden reference
- a/LayoutTests/fast/text/content-language-case-insensitivity-expected.txt -1 / +1 lines
Lines 1-6 a/LayoutTests/fast/text/content-language-case-insensitivity-expected.txt_sec1
1
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.
1
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.
2
2
3
PASS languageOfNode('x1') is "ja-JP"
3
PASS languageOfNode('x') is "ja-JP"
4
PASS successfullyParsed is true
4
PASS successfullyParsed is true
5
5
6
TEST COMPLETE
6
TEST COMPLETE
- a/LayoutTests/fast/text/content-language-case-insensitivity.html -4 / +2 lines
Lines 12-26 matching of the http-equiv attribute to the content-language state is case a/LayoutTests/fast/text/content-language-case-insensitivity.html_sec1
12
insensitive.
12
insensitive.
13
</p>
13
</p>
14
<div id="console"></div>
14
<div id="console"></div>
15
<div id="x1"/>
15
<div id="x"></div>
16
<script>
16
<script>
17
function languageOfNode(id) {
17
function languageOfNode(id) {
18
    var element = document.getElementById(id);
18
    var element = document.getElementById(id);
19
    return window.getComputedStyle(element).webkitLocale;
19
    return window.getComputedStyle(element).webkitLocale;
20
}
20
}
21
shouldBeEqualToString("languageOfNode('x1')", "ja-JP");
21
shouldBeEqualToString("languageOfNode('x')", "ja-JP");
22
23
var successfullyParsed = true;
24
</script>
22
</script>
25
<script src="../js/resources/js-test-post.js"></script>
23
<script src="../js/resources/js-test-post.js"></script>
26
</body>
24
</body>
- a/LayoutTests/fast/text/content-language-empty-expected.txt +8 lines
Line 0 a/LayoutTests/fast/text/content-language-empty-expected.txt_sec1
1
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.
2
3
FAIL languageOfNode('x') should be auto. Was ''.
4
PASS languageOfNode('y') is "ar"
5
PASS successfullyParsed is true
6
7
TEST COMPLETE
8
- a/LayoutTests/fast/text/content-language-empty.html +28 lines
Line 0 a/LayoutTests/fast/text/content-language-empty.html_sec1
1
<!DOCTYPE html>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="content-language" content="">
5
<link rel="stylesheet" href="../js/resources/js-test-style.css">
6
<script src="../js/resources/js-test-pre.js"></script>
7
</head>
8
<body>
9
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
10
map HTTP-EQUIV content-language to -webkit-locale. This particular test tests
11
that a content-language of empty string is ignored. This expectation may
12
change, see bug. HTML5 decrees that the meta element be ignored in case of the
13
empty string. It's unclear what other browsers do.
14
</p>
15
<div id="console"></div>
16
<div id="x"></div>
17
<div id="y" lang="ar"></div>
18
<script>
19
function languageOfNode(id) {
20
    var element = document.getElementById(id);
21
    return window.getComputedStyle(element).webkitLocale;
22
}
23
shouldBeEqualToString("languageOfNode('x')", "auto");
24
shouldBeEqualToString("languageOfNode('y')", "ar");
25
</script>
26
<script src="../js/resources/js-test-post.js"></script>
27
</body>
28
</html>
- a/LayoutTests/fast/text/content-language-late-expected.txt +8 lines
Line 0 a/LayoutTests/fast/text/content-language-late-expected.txt_sec1
1
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.
2
3
FAIL languageOfNode('x') should be ja-JP. Was auto.
4
PASS languageOfNode('y') is "ar"
5
PASS successfullyParsed is true
6
7
TEST COMPLETE
8
- a/LayoutTests/fast/text/content-language-late.html +30 lines
Line 0 a/LayoutTests/fast/text/content-language-late.html_sec1
1
<!DOCTYPE html>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<link rel="stylesheet" href="../js/resources/js-test-style.css">
5
<script src="../js/resources/js-test-pre.js"></script>
6
</head>
7
<body>
8
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
9
map HTTP-EQUIV content-language to -webkit-locale. This particular test tests
10
that a content-language is used even if it appears at the end of the document.
11
This expectation may change, see bug.  According to the HTML 5 spec, a meta
12
element should be processed when it is inserted into the document, regardless
13
of where. IE and Firefox also seem to process the content-language at the end
14
of the document.
15
</p>
16
<div id="console"></div>
17
<div id="x"></div>
18
<div id="y" lang="ar"></div>
19
<script>
20
function languageOfNode(id) {
21
    var element = document.getElementById(id);
22
    return window.getComputedStyle(element).webkitLocale;
23
}
24
shouldBeEqualToString("languageOfNode('x')", "ja-JP");
25
shouldBeEqualToString("languageOfNode('y')", "ar");
26
</script>
27
<script src="../js/resources/js-test-post.js"></script>
28
<meta http-equiv="content-language" content="ja-JP">
29
</body>
30
</html>
- a/LayoutTests/fast/text/content-language-mapped-to-webkit-locale-expected.txt -2 / +2 lines
Lines 1-7 a/LayoutTests/fast/text/content-language-mapped-to-webkit-locale-expected.txt_sec1
1
Test for bug 76701: map content-language to -webkit-locale.
1
Test for bug 76701: map content-language to -webkit-locale.
2
2
3
PASS languageOfNode('x1') is "zh-CN"
3
PASS languageOfNode('x') is "zh-CN"
4
PASS languageOfNode('m1') is "ar"
4
PASS languageOfNode('y') is "ar"
5
PASS successfullyParsed is true
5
PASS successfullyParsed is true
6
6
7
TEST COMPLETE
7
TEST COMPLETE
- a/LayoutTests/fast/text/content-language-mapped-to-webkit-locale.html -6 / +4 lines
Lines 9-25 a/LayoutTests/fast/text/content-language-mapped-to-webkit-locale.html_sec1
9
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
9
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
10
map content-language to -webkit-locale.</p>
10
map content-language to -webkit-locale.</p>
11
<div id="console"></div>
11
<div id="console"></div>
12
<div id="x1"/>
12
<div id="x"></div>
13
<div lang="ar" id="m1"/>
13
<div id="y" lang="ar"></div>
14
<script>
14
<script>
15
function languageOfNode(id) {
15
function languageOfNode(id) {
16
    var element = document.getElementById(id);
16
    var element = document.getElementById(id);
17
    return window.getComputedStyle(element).webkitLocale;
17
    return window.getComputedStyle(element).webkitLocale;
18
}
18
}
19
shouldBeEqualToString("languageOfNode('x1')", "zh-CN");
19
shouldBeEqualToString("languageOfNode('x')", "zh-CN");
20
shouldBeEqualToString("languageOfNode('m1')", "ar");
20
shouldBeEqualToString("languageOfNode('y')", "ar");
21
22
var successfullyParsed = true;
23
</script>
21
</script>
24
<script src="../js/resources/js-test-post.js"></script>
22
<script src="../js/resources/js-test-post.js"></script>
25
</body>
23
</body>
- a/LayoutTests/fast/text/content-language-multiple-expected.txt +8 lines
Line 0 a/LayoutTests/fast/text/content-language-multiple-expected.txt_sec1
1
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.
2
3
PASS languageOfNode('x') is "zh_CN"
4
PASS languageOfNode('y') is "ar"
5
PASS successfullyParsed is true
6
7
TEST COMPLETE
8
- a/LayoutTests/fast/text/content-language-multiple.html +31 lines
Line 0 a/LayoutTests/fast/text/content-language-multiple.html_sec1
1
<!DOCTYPE html>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="content-language" content="   ">
5
<meta http-equiv="content-language" content="ja_JP">
6
<meta http-equiv="content-language" content="zh_CN">
7
<link rel="stylesheet" href="../js/resources/js-test-style.css">
8
<script src="../js/resources/js-test-pre.js"></script>
9
</head>
10
<body>
11
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
12
map HTTP-EQUIV content-language to -webkit-locale. This particular test tests
13
that in the event of multiple content-languages, the final content-language is
14
used as the pragma-set default language. This expectation may change, see bug.
15
The HTML5 spec decrees that the first successfully processed one be used.
16
Firefox and IE seem to use the final one.
17
</p>
18
<div id="console"></div>
19
<div id="x" lang="zh_CN"></div>
20
<div id="y" lang="ar"></div>
21
<script>
22
function languageOfNode(id) {
23
    var element = document.getElementById(id);
24
    return window.getComputedStyle(element).webkitLocale;
25
}
26
shouldBeEqualToString("languageOfNode('x')", "zh_CN");
27
shouldBeEqualToString("languageOfNode('y')", "ar");
28
</script>
29
<script src="../js/resources/js-test-post.js"></script>
30
</body>
31
</html>
- a/LayoutTests/fast/text/content-language-no-content-expected.txt +8 lines
Line 0 a/LayoutTests/fast/text/content-language-no-content-expected.txt_sec1
1
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.
2
3
PASS languageOfNode('x') is "auto"
4
PASS languageOfNode('y') is "ar"
5
PASS successfullyParsed is true
6
7
TEST COMPLETE
8
- a/LayoutTests/fast/text/content-language-no-content.html +27 lines
Line 0 a/LayoutTests/fast/text/content-language-no-content.html_sec1
1
<!DOCTYPE html>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="content-language">
5
<link rel="stylesheet" href="../js/resources/js-test-style.css">
6
<script src="../js/resources/js-test-pre.js"></script>
7
</head>
8
<body>
9
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
10
map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that
11
a content-language with missing content is effectively ignored. This expectation
12
may change, see comments in bug.
13
</p>
14
<div id="console"></div>
15
<div id="x"></div>
16
<div id="y" lang="ar"></div>
17
<script>
18
function languageOfNode(id) {
19
    var element = document.getElementById(id);
20
    return window.getComputedStyle(element).webkitLocale;
21
}
22
shouldBeEqualToString("languageOfNode('x')", "auto");
23
shouldBeEqualToString("languageOfNode('y')", "ar");
24
</script>
25
<script src="../js/resources/js-test-post.js"></script>
26
</body>
27
</html>
- a/LayoutTests/fast/text/content-language-only-whitespace-expected.txt +8 lines
Line 0 a/LayoutTests/fast/text/content-language-only-whitespace-expected.txt_sec1
1
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.
2
3
FAIL languageOfNode('x') should be auto. Was '  \9\a  '.
4
PASS languageOfNode('y') is "ar"
5
PASS successfullyParsed is true
6
7
TEST COMPLETE
8
- a/LayoutTests/fast/text/content-language-only-whitespace.html +28 lines
Line 0 a/LayoutTests/fast/text/content-language-only-whitespace.html_sec1
1
<!DOCTYPE html>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="content-language" content="  	
5
 ">
6
<link rel="stylesheet" href="../js/resources/js-test-style.css">
7
<script src="../js/resources/js-test-pre.js"></script>
8
</head>
9
<body>
10
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
11
map HTTP-EQUIV content-language to -webkit-locale. This particular test tests
12
that a content-language with whitespace-only content is ignored. This
13
expectation may change, see bug. HTML5 decrees that the meta element be ignored
14
in case of whitespace only content.  It's unclear what other browsers do.</p>
15
<div id="console"></div>
16
<div id="x"></div>
17
<div id="y" lang="ar"></div>
18
<script>
19
function languageOfNode(id) {
20
    var element = document.getElementById(id);
21
    return window.getComputedStyle(element).webkitLocale;
22
}
23
shouldBeEqualToString("languageOfNode('x')", "auto");
24
shouldBeEqualToString("languageOfNode('y')", "ar");
25
</script>
26
<script src="../js/resources/js-test-post.js"></script>
27
</body>
28
</html>
- a/LayoutTests/fast/text/content-language-with-whitespace-expected.txt +8 lines
Line 0 a/LayoutTests/fast/text/content-language-with-whitespace-expected.txt_sec1
1
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.
2
3
FAIL languageOfNode('x') should be ja_JP. Was '  \a\9\9ja-JP   \9  zh_CN \9\a\a\9\9'.
4
PASS languageOfNode('y') is "ar"
5
PASS successfullyParsed is true
6
7
TEST COMPLETE
8
- a/LayoutTests/fast/text/content-language-with-whitespace.html +33 lines
Line 0 a/LayoutTests/fast/text/content-language-with-whitespace.html_sec1
1
<!DOCTYPE html>
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="content-language" content="  
5
		ja-JP   	 zh_CN 	
6
7
		">
8
<link rel="stylesheet" href="../js/resources/js-test-style.css">
9
<script src="../js/resources/js-test-pre.js"></script>
10
</head>
11
<body>
12
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
13
map HTTP-EQUIV content-language to -webkit-locale. This particular test tests
14
that the the pragma-set default language is set to the first sequence of
15
non-whitespace characters of the content-language content. This expectation may
16
change, see bug. This expectation is as per the HTML 5 spec. It appears that
17
Firefox does not exactly do this, but trims the leading and trailing
18
whitespace.  It's unclear what IE does.
19
</p>
20
<div id="console"></div>
21
<div id="x"></div>
22
<div id="y" lang="ar"></div>
23
<script>
24
function languageOfNode(id) {
25
    var element = document.getElementById(id);
26
    return window.getComputedStyle(element).webkitLocale;
27
}
28
shouldBeEqualToString("languageOfNode('x')", "ja_JP");
29
shouldBeEqualToString("languageOfNode('y')", "ar");
30
</script>
31
<script src="../js/resources/js-test-post.js"></script>
32
</body>
33
</html>

Return to Bug 77724