Changeset 266466 in webkit


Ignore:
Timestamp:
Sep 2, 2020, 8:52:14 AM (5 years ago)
Author:
achristensen@apple.com
Message:

Allow direct creation of replacement codec
https://bugs.webkit.org/show_bug.cgi?id=216063

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

  • web-platform-tests/encoding/replacement-encodings.any-expected.txt:
  • web-platform-tests/encoding/replacement-encodings.any.worker-expected.txt:

Source/WebCore:

Chrome and Firefox do.
Covered by a newly passing web platform test.

  • platform/text/TextCodecReplacement.cpp:

(WebCore::TextCodecReplacement::registerEncodingNames):

  • platform/text/TextEncoding.cpp:

(WebCore::TextEncoding::TextEncoding):

LayoutTests:

  • fast/encoding/charset-replacement-expected.txt:
  • fast/encoding/charset-replacement.html:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r266461 r266466  
     12020-09-02  Alex Christensen  <achristensen@webkit.org>
     2
     3        Allow direct creation of replacement codec
     4        https://bugs.webkit.org/show_bug.cgi?id=216063
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * fast/encoding/charset-replacement-expected.txt:
     9        * fast/encoding/charset-replacement.html:
     10
    1112020-09-02  Aditya Keerthi  <akeerthi@apple.com>
    212
  • trunk/LayoutTests/fast/encoding/charset-replacement-expected.txt

    r204605 r266466  
    1 ALERT: windows-1252
    2 Test PASSED if the encoding of this document is the default encoding.
    3 Test FAILED if you see a U+FFFD character in a dumped render tree.
    4 
     1layer at (0,0) size 800x600
     2  RenderView at (0,0) size 800x600
     3layer at (0,0) size 800x600
     4  RenderBlock {HTML} at (0,0) size 800x600
     5    RenderBody {BODY} at (8,8) size 784x584
     6      RenderText {#text} at (0,1) size 16x18
     7        text run at (0,1) width 16: "\x{FFFD}"
  • trunk/LayoutTests/fast/encoding/charset-replacement.html

    r202599 r266466  
    33<head>
    44    <meta charset=rEpLaCeMeNt>
    5     <script>
    6     if (window.testRunner)
    7         testRunner.dumpAsText();
    8     alert(document.characterSet);
    9     </script>
    105</head>
    116<body>
    12     Test PASSED if the encoding of this document is the default encoding.<br>
    13     Test FAILED if you see a U+FFFD character in a dumped render tree.<br>
     7    Test passed if you see a U+FFFD character in a dumped render tree.<br>
    148</body>
    159</html>
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r266457 r266466  
     12020-09-02  Alex Christensen  <achristensen@webkit.org>
     2
     3        Allow direct creation of replacement codec
     4        https://bugs.webkit.org/show_bug.cgi?id=216063
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * web-platform-tests/encoding/replacement-encodings.any-expected.txt:
     9        * web-platform-tests/encoding/replacement-encodings.any.worker-expected.txt:
     10
    1112020-09-02  Alex Christensen  <achristensen@webkit.org>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/replacement-encodings.any-expected.txt

    r244377 r266466  
    1010PASS iso-2022-kr - non-empty input decodes to one replacement character.
    1111PASS iso-2022-kr - empty input decodes to empty output.
    12 FAIL replacement - non-empty input decodes to one replacement character. assert_equals: Decoding with replacement expected "U+FFFD" but got "U+0041/U+0042/U+0043/U+0061/U+0062/U+0063/U+0031/U+0032/U+0033/U+FFFD"
     12PASS replacement - non-empty input decodes to one replacement character.
    1313PASS replacement - empty input decodes to empty output.
    1414
  • trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/replacement-encodings.any.worker-expected.txt

    r244377 r266466  
    1010PASS iso-2022-kr - non-empty input decodes to one replacement character.
    1111PASS iso-2022-kr - empty input decodes to empty output.
    12 FAIL replacement - non-empty input decodes to one replacement character. assert_equals: Decoding with replacement expected "U+FFFD" but got "U+0041/U+0042/U+0043/U+0061/U+0062/U+0063/U+0031/U+0032/U+0033/U+FFFD"
     12PASS replacement - non-empty input decodes to one replacement character.
    1313PASS replacement - empty input decodes to empty output.
    1414
  • trunk/Source/WebCore/ChangeLog

    r266462 r266466  
     12020-09-02  Alex Christensen  <achristensen@webkit.org>
     2
     3        Allow direct creation of replacement codec
     4        https://bugs.webkit.org/show_bug.cgi?id=216063
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Chrome and Firefox do.
     9        Covered by a newly passing web platform test.
     10
     11        * platform/text/TextCodecReplacement.cpp:
     12        (WebCore::TextCodecReplacement::registerEncodingNames):
     13        * platform/text/TextEncoding.cpp:
     14        (WebCore::TextEncoding::TextEncoding):
     15
    1162020-09-02  Zalan Bujtas  <zalan@apple.com>
    217
  • trunk/Source/WebCore/platform/text/TextCodecReplacement.cpp

    r248846 r266466  
    3535void TextCodecReplacement::registerEncodingNames(EncodingNameRegistrar registrar)
    3636{
    37     // The string 'replacement' itself is not a valid label. It is the name of
    38     // a group of legacy encoding labels. Hence, it cannot be used directly.
    39     // The TextEncoding class implements the above rule; here we register it normally.
    4037    registrar("replacement", "replacement");
    4138
  • trunk/Source/WebCore/platform/text/TextEncoding.cpp

    r266330 r266466  
    4848    , m_backslashAsCurrencySymbol(backslashAsCurrencySymbol())
    4949{
    50     // Aliases are valid, but not "replacement" itself.
    51     if (equalLettersIgnoringASCIICase(name, "replacement"))
    52         m_name = nullptr;
    5350}
    5451
     
    5754    , m_backslashAsCurrencySymbol(backslashAsCurrencySymbol())
    5855{
    59     // Aliases are valid, but not "replacement" itself.
    60     if (equalLettersIgnoringASCIICase(name, "replacement"))
    61         m_name = nullptr;
    6256}
    6357
Note: See TracChangeset for help on using the changeset viewer.