Changeset 13863 in webkit


Ignore:
Timestamp:
Apr 13, 2006 10:03:16 AM (18 years ago)
Author:
ap
Message:

WebCore:

Reviewed by Darin.

  • html/HTMLTokenizer.cpp: Only use fixUpChar() when handling entities. (WebCore::HTMLTokenizer::parseSpecial): (WebCore::HTMLTokenizer::parseText): (WebCore::HTMLTokenizer::parseTag): (WebCore::HTMLTokenizer::write):
  • platform/StreamingTextDecoder.cpp: (WebCore::StreamingTextDecoder::convert): Remove the special case for Latin-1, because it is already handled via effectiveEncoding().
  • platform/StreamingTextDecoder.h: Remove convertLatin1().

LayoutTests:

Tests that Latin-1 is handled as windows-1252
(see http://bugzilla.opendarwin.org/show_bug.cgi?id=7602). Some existing tests
already did cover this, but only indirectly.

  • fast/encoding/latin1-winlatin-expected.txt: Added.
  • fast/encoding/latin1-winlatin.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r13855 r13863  
     12006-04-13  Alexey Proskuryakov  <ap@nypop.com>
     2
     3        Test created by Maciej.
     4
     5        Tests that Latin-1 is handled as windows-1252
     6        (see http://bugzilla.opendarwin.org/show_bug.cgi?id=7602). Some existing tests
     7        already did cover this, but only indirectly.
     8
     9        * fast/encoding/latin1-winlatin-expected.txt: Added.
     10        * fast/encoding/latin1-winlatin.html: Added.
     11
    1122006-04-12  Justin Garcia  <justin.garcia@apple.com>
    213
     
    200211        * editing/deleting/merge-unrendered-space-expected.txt: Added.
    201212        * editing/deleting/merge-unrendered-space.html: Added.
     213
     2142006-04-10  Alexey Proskuryakov  <ap@nypop.com>
     215
     216        Reviewed by Darin.
     217
     218        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8157
     219          Make HTTP tests using Perl use .pl extension
     220
     221        * http/tests/incremental/slow-utf8-text.pl: Added (renamed from .text).
     222        * http/tests/incremental/slow-utf8-text.text: Removed.
     223        * http/tests/incremental/split-hex-entities.pl: Added (renamed from .html).
     224        * http/tests/incremental/split-hex-entities.html: Removed.
     225        * http/tests/incremental/.htaccess: Removed.
    202226
    2032272006-04-10  Darin Adler  <darin@apple.com>
  • trunk/WebCore/ChangeLog

    r13862 r13863  
     12006-04-13  Alexey Proskuryakov  <ap@nypop.com>
     2
     3        Reviewed by Darin.
     4
     5        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7602
     6        Only use fixupChar for entities
     7
     8        * html/HTMLTokenizer.cpp: Only use fixUpChar() when handling entities.
     9        (WebCore::HTMLTokenizer::parseSpecial):
     10        (WebCore::HTMLTokenizer::parseText):
     11        (WebCore::HTMLTokenizer::parseTag):
     12        (WebCore::HTMLTokenizer::write):
     13        * platform/StreamingTextDecoder.cpp:
     14        (WebCore::StreamingTextDecoder::convert): Remove the special case for Latin-1, because it is already handled
     15        via effectiveEncoding().
     16        * platform/StreamingTextDecoder.h: Remove convertLatin1().
     17
    1182006-04-13  Darin Adler  <darin@apple.com>
    219
  • trunk/WebCore/html/HTMLTokenizer.cpp

    r13859 r13863  
    99              (C) 2001 Dirk Mueller (mueller@kde.org)
    1010    Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
     11    Copyright (C) 2005, 2006 Alexey Proskuryakov (ap@nypop.com)
    1112
    1213    This library is free software; you can redistribute it and/or
     
    8283// There may be better equivalents
    8384
    84 // We need this for entities at least. For non-entity text, we could
    85 // handle this in the text encoding.
    86 
    87 // To cover non-entity text, I think this function would need to be called
    88 // in more places. There seem to be some places that don't call fixUpChar.
     85// We only need this for entities. For non-entity text, we handle this in the text encoding.
    8986
    9087static const unsigned short windowsLatin1ExtensionArray[32] = {
     
    329326        }
    330327        else {
    331             scriptCode[scriptCodeSize++] = fixUpChar(*src);
     328            scriptCode[scriptCodeSize++] = *src;
    332329            ++src;
    333330        }
     
    639636            *dest++ = '\n';
    640637        } else
    641             *dest++ = fixUpChar(cc);
     638            *dest++ = cc;
    642639        ++src;
    643640    }
     
    10631060                    }
    10641061                }
    1065                 *dest++ = fixUpChar(*src);
     1062                *dest++ = *src;
    10661063                ++src;
    10671064            }
     
    10941091                }
    10951092
    1096                 *dest++ = fixUpChar(*src);
     1093                *dest++ = *src;
    10971094                ++src;
    10981095            }
     
    14561453        } else {
    14571454            state.setDiscardLF(false);
    1458             *dest++ = fixUpChar(*src);
     1455            *dest++ = *src;
    14591456            ++src;
    14601457        }
  • trunk/WebCore/platform/StreamingTextDecoder.cpp

    r13821 r13863  
    4343}
    4444
    45 DeprecatedString StreamingTextDecoder::convertLatin1(const unsigned char* s, int length)
    46 {
    47     ASSERT(m_numBufferedBytes == 0);
    48     return DeprecatedString(reinterpret_cast<const char *>(s), length);
    49 }
    50 
    5145static const UChar replacementCharacter = 0xFFFD;
    5246static const UChar BOM = 0xFEFF;
     
    231225
    232226    switch (m_encoding.encodingID()) {
    233     case Latin1Encoding:
    234     case WinLatin1Encoding:
    235         return convertLatin1(chs, len);
    236 
    237227    case UTF16Encoding:
    238228        return convertUTF16(chs, len);
  • trunk/WebCore/platform/StreamingTextDecoder.h

    r13393 r13863  
    4545            { return convert(reinterpret_cast<const unsigned char*>(chs), len, flush); }
    4646        DeprecatedString convert(const unsigned char* chs, int len, bool flush);
    47         DeprecatedString convertLatin1(const unsigned char* chs, int len);
    4847        DeprecatedString convertUTF16(const unsigned char* chs, int len);
    4948       
Note: See TracChangeset for help on using the changeset viewer.