Changeset 12652 in webkit


Ignore:
Timestamp:
Feb 7, 2006 6:39:22 PM (18 years ago)
Author:
adele
Message:

LayoutTests:

  • test for <rdar://problem/3727939> Safari strips \0 characters from HTML tags making them valid
  • fast/encoding/decoder-allow-null-chars.html
  • fast/encoding/decoder-allow-null-chars-expected.txt

WebCore:

Reviewed by Maciej.

  • Fixed <rdar://problem/3727939> Safari strips \0 characters from HTML tags making them valid

Test: fast/encoding/decoder-allow-null-chars.html

  • kwq/KWQTextCodec.cpp: (KWQTextDecoder::convertLatin1): Removed stripping of null characters (unwanted): ditto.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r12644 r12652  
     12006-02-07  Adele Peterson  <adele@apple.com>
     2
     3       - test for
     4        <rdar://problem/3727939> Safari strips \0 characters from HTML tags making them valid
     5
     6        * fast/encoding/decoder-allow-null-chars.html
     7        * fast/encoding/decoder-allow-null-chars-expected.txt
     8
    192006-02-07  Alexey Proskuryakov  <ap@nypop.com>
    210
  • trunk/WebCore/ChangeLog

    r12651 r12652  
     12006-02-07  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        - Fixed <rdar://problem/3727939> Safari strips \0 characters from HTML tags making them valid
     6
     7        Test: fast/encoding/decoder-allow-null-chars.html
     8
     9        * kwq/KWQTextCodec.cpp:
     10        (KWQTextDecoder::convertLatin1): Removed stripping of null characters
     11        (unwanted): ditto.
     12
    1132006-02-07  David Hyatt <hyatt@apple.com>
    214
  • trunk/WebCore/kwq/KWQTextCodec.cpp

    r12471 r12652  
    285285    ASSERT(_numBufferedBytes == 0);
    286286
    287     int i;
    288     for (i = 0; i != length; ++i) {
    289         if (s[i] == 0) {
    290             break;
    291         }
    292     }
    293     if (i == length) {
    294         return QString(reinterpret_cast<const char *>(s), length);
    295     }
    296 
    297     QString result("");
    298    
    299     result.reserve(length);
    300    
    301     result.append(reinterpret_cast<const char *>(s), i);
    302     int start = ++i;
    303     for (; i != length; ++i) {
    304         if (s[i] == 0) {
    305             if (start != i) {
    306                 result.append(reinterpret_cast<const char *>(&s[start]), i - start);
    307             }
    308             start = i + 1;
    309         }
    310     }
    311     if (start != length) {
    312         result.append(reinterpret_cast<const char *>(&s[start]), length - start);
    313     }
    314 
    315     return result;
     287    return QString(reinterpret_cast<const char *>(s), length);
    316288}
    317289
     
    406378}
    407379
    408 // We strip NUL characters because other browsers (at least WinIE) do.
    409380// We strip replacement characters because the ICU converter for UTF-8 converts
    410381// invalid sequences into replacement characters, but other browsers discard them.
     
    414385{
    415386    switch (c) {
    416         case 0:
    417387        case replacementCharacter:
    418388        case BOM:
Note: See TracChangeset for help on using the changeset viewer.