⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 107159 in webkit


Ignore:
Timestamp:
Feb 8, 2012, 5:41:45 PM (15 years ago)
Author:
commit-queue@webkit.org
Message:

Improve http-equiv content-language parsing
https://bugs.webkit.org/show_bug.cgi?id=77724

Patch by Matt Falkenhagen <falken@chromium.org> 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.
Location:
trunk/LayoutTests
Files:
9 added
5 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107152 r107159  
     12012-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 Alexey Proskuryakov.
     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
    1282012-02-08  Julien Chaffraix  <jchaffraix@webkit.org>
    229
  • trunk/LayoutTests/fast/text/content-language-case-insensitivity-expected.txt

    r106632 r107159  
    11Test 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.
    22
    3 PASS languageOfNode('x1') is "ja-JP"
     3PASS languageOfNode('x') is "ja-JP"
    44PASS successfullyParsed is true
    55
  • trunk/LayoutTests/fast/text/content-language-case-insensitivity.html

    r106632 r107159  
    1313</p>
    1414<div id="console"></div>
    15 <div id="x1"/>
     15<div id="x"></div>
    1616<script>
    1717function languageOfNode(id) {
     
    1919    return window.getComputedStyle(element).webkitLocale;
    2020}
    21 shouldBeEqualToString("languageOfNode('x1')", "ja-JP");
    22 
    23 var successfullyParsed = true;
     21shouldBeEqualToString("languageOfNode('x')", "ja-JP");
    2422</script>
    2523<script src="../js/resources/js-test-post.js"></script>
  • trunk/LayoutTests/fast/text/content-language-empty.html

    r107157 r107159  
    22<html xmlns="http://www.w3.org/1999/xhtml">
    33<head>
    4 <meta http-equiv="cONtENT-LAnguAGE" content="ja-JP">
     4<meta http-equiv="content-language" content="">
    55<link rel="stylesheet" href="../js/resources/js-test-style.css">
    66<script src="../js/resources/js-test-pre.js"></script>
     
    88<body>
    99<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
    10 map content-language to -webkit-locale. This particular test tests that the
    11 matching of the http-equiv attribute to the content-language state is case
    12 insensitive.
     10map HTTP-EQUIV content-language to -webkit-locale. This particular test tests
     11that a content-language of empty string is ignored. This expectation may
     12change, see bug. HTML5 decrees that the meta element be ignored in case of the
     13empty string. It's unclear what other browsers do.
    1314</p>
    1415<div id="console"></div>
    15 <div id="x1"/>
     16<div id="x"></div>
     17<div id="y" lang="ar"></div>
    1618<script>
    1719function languageOfNode(id) {
     
    1921    return window.getComputedStyle(element).webkitLocale;
    2022}
    21 shouldBeEqualToString("languageOfNode('x1')", "ja-JP");
    22 
    23 var successfullyParsed = true;
     23shouldBeEqualToString("languageOfNode('x')", "auto");
     24shouldBeEqualToString("languageOfNode('y')", "ar");
    2425</script>
    2526<script src="../js/resources/js-test-post.js"></script>
  • trunk/LayoutTests/fast/text/content-language-mapped-to-webkit-locale-expected.txt

    r106632 r107159  
    11Test for bug 76701: map content-language to -webkit-locale.
    22
    3 PASS languageOfNode('x1') is "zh-CN"
    4 PASS languageOfNode('m1') is "ar"
     3PASS languageOfNode('x') is "zh-CN"
     4PASS languageOfNode('y') is "ar"
    55PASS successfullyParsed is true
    66
  • trunk/LayoutTests/fast/text/content-language-mapped-to-webkit-locale.html

    r106632 r107159  
    1010map content-language to -webkit-locale.</p>
    1111<div id="console"></div>
    12 <div id="x1"/>
    13 <div lang="ar" id="m1"/>
     12<div id="x"></div>
     13<div id="y" lang="ar"></div>
    1414<script>
    1515function languageOfNode(id) {
     
    1717    return window.getComputedStyle(element).webkitLocale;
    1818}
    19 shouldBeEqualToString("languageOfNode('x1')", "zh-CN");
    20 shouldBeEqualToString("languageOfNode('m1')", "ar");
    21 
    22 var successfullyParsed = true;
     19shouldBeEqualToString("languageOfNode('x')", "zh-CN");
     20shouldBeEqualToString("languageOfNode('y')", "ar");
    2321</script>
    2422<script src="../js/resources/js-test-post.js"></script>
  • trunk/LayoutTests/fast/text/content-language-no-content.html

    r107157 r107159  
    22<html xmlns="http://www.w3.org/1999/xhtml">
    33<head>
    4 <meta http-equiv="cONtENT-LAnguAGE" content="ja-JP">
     4<meta http-equiv="content-language">
    55<link rel="stylesheet" href="../js/resources/js-test-style.css">
    66<script src="../js/resources/js-test-pre.js"></script>
     
    88<body>
    99<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=76701">bug 76701</a>:
    10 map content-language to -webkit-locale. This particular test tests that the
    11 matching of the http-equiv attribute to the content-language state is case
    12 insensitive.
     10map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that
     11a content-language with missing content is effectively ignored. This expectation
     12may change, see comments in bug.
    1313</p>
    1414<div id="console"></div>
    15 <div id="x1"/>
     15<div id="x"></div>
     16<div id="y" lang="ar"></div>
    1617<script>
    1718function languageOfNode(id) {
     
    1920    return window.getComputedStyle(element).webkitLocale;
    2021}
    21 shouldBeEqualToString("languageOfNode('x1')", "ja-JP");
    22 
    23 var successfullyParsed = true;
     22shouldBeEqualToString("languageOfNode('x')", "auto");
     23shouldBeEqualToString("languageOfNode('y')", "ar");
    2424</script>
    2525<script src="../js/resources/js-test-post.js"></script>
  • trunk/LayoutTests/fast/text/content-language-only-whitespace.html

    r107157 r107159  
    22<html xmlns="http://www.w3.org/1999/xhtml">
    33<head>
    4 <meta http-equiv="content-language" content="zh-CN">
     4<meta http-equiv="content-language" content="   
     5 ">
    56<link rel="stylesheet" href="../js/resources/js-test-style.css">
    67<script src="../js/resources/js-test-pre.js"></script>
     
    89<body>
    910<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>
     11map HTTP-EQUIV content-language to -webkit-locale. This particular test tests
     12that a content-language with whitespace-only content is ignored. This
     13expectation may change, see bug. HTML5 decrees that the meta element be ignored
     14in case of whitespace only content.  It's unclear what other browsers do.</p>
    1115<div id="console"></div>
    12 <div id="x1"/>
    13 <div lang="ar" id="m1"/>
     16<div id="x"></div>
     17<div id="y" lang="ar"></div>
    1418<script>
    1519function languageOfNode(id) {
     
    1721    return window.getComputedStyle(element).webkitLocale;
    1822}
    19 shouldBeEqualToString("languageOfNode('x1')", "zh-CN");
    20 shouldBeEqualToString("languageOfNode('m1')", "ar");
    21 
    22 var successfullyParsed = true;
     23shouldBeEqualToString("languageOfNode('x')", "auto");
     24shouldBeEqualToString("languageOfNode('y')", "ar");
    2325</script>
    2426<script src="../js/resources/js-test-post.js"></script>
Note: See TracChangeset for help on using the changeset viewer.