Changeset 28998 in webkit


Ignore:
Timestamp:
Dec 27, 2007 12:22:24 AM (16 years ago)
Author:
ap@webkit.org
Message:

Reviewed by Maciej.

http://bugs.webkit.org/show_bug.cgi?id=14500
need to be more generous about charset declaration with meta tag


http://bugs.webkit.org/show_bug.cgi?id=12526
<rdar://problem/4867183> Safari ignores encoding description "charset=Shift_JIS" in invalid html

<rdar://problem/4892428> Unlike other browsers, WebKit ignores <meta> charset definitions outside the head

<rdar://problem/5643774> REGRESSION: Text is garbled when clicking a link inside an Arabic website

Tests: fast/encoding/ahram-org-eg.html

fast/encoding/bandai-co-jp-releases.html
fast/encoding/floraexpress-ru.html
fast/encoding/hanarei-blog32-fc2-com.html
fast/encoding/yahoo-mail.html

  • loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::checkForHeadCharset): Don't stop looking for <meta> until we've seen at least 512 bytes of input.
Location:
trunk
Files:
10 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r28996 r28998  
     12007-12-27  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Maciej.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=14500
     6        need to be more generous about charset declaration with meta tag
     7       
     8        http://bugs.webkit.org/show_bug.cgi?id=12526
     9        <rdar://problem/4867183> Safari ignores encoding description "charset=Shift_JIS" in invalid html
     10
     11        <rdar://problem/4892428> Unlike other browsers, WebKit ignores <meta> charset definitions outside the head
     12
     13        <rdar://problem/5643774> REGRESSION: Text is garbled when clicking a link inside an Arabic website
     14
     15        * fast/encoding/ahram-org-eg-expected.txt: Added.
     16        * fast/encoding/ahram-org-eg.html: Added.
     17        * fast/encoding/bandai-co-jp-releases-expected.txt: Added.
     18        * fast/encoding/bandai-co-jp-releases.html: Added.
     19        * fast/encoding/floraexpres-ru-expected.txt: Added.
     20        * fast/encoding/floraexpres-ru.html: Added.
     21        * fast/encoding/hanarei-blog32-fc2-com-expected.txt: Added.
     22        * fast/encoding/hanarei-blog32-fc2-com.html: Added.
     23        * fast/encoding/yahoo-mail-expected.txt: Added.
     24        * fast/encoding/yahoo-mail.html: Added.
     25
    1262007-12-26  Dan Bernstein  <mitz@apple.com>
    227
  • trunk/WebCore/ChangeLog

    r28997 r28998  
     12007-12-27  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Maciej.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=14500
     6        need to be more generous about charset declaration with meta tag
     7       
     8        http://bugs.webkit.org/show_bug.cgi?id=12526
     9        <rdar://problem/4867183> Safari ignores encoding description "charset=Shift_JIS" in invalid html
     10
     11        <rdar://problem/4892428> Unlike other browsers, WebKit ignores <meta> charset definitions outside the head
     12
     13        <rdar://problem/5643774> REGRESSION: Text is garbled when clicking a link inside an Arabic website
     14
     15        Tests: fast/encoding/ahram-org-eg.html
     16               fast/encoding/bandai-co-jp-releases.html
     17               fast/encoding/floraexpress-ru.html
     18               fast/encoding/hanarei-blog32-fc2-com.html
     19               fast/encoding/yahoo-mail.html
     20
     21        * loader/TextResourceDecoder.cpp:
     22        (WebCore::TextResourceDecoder::checkForHeadCharset): Don't stop looking for <meta> until we've
     23        seen at least 512 bytes of input.
     24
    1252007-12-26  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
    226
  • trunk/WebCore/loader/TextResourceDecoder.cpp

    r26676 r28998  
    530530    // <http://bugs.webkit.org/show_bug.cgi?id=4560>, <http://bugs.webkit.org/show_bug.cgi?id=12165>
    531531    // and <http://bugs.webkit.org/show_bug.cgi?id=12389>.
    532    
     532
     533    // Since many sites have charset declarations after <body> or other tags that are disallowed in <head>,
     534    // we don't bail out until we've checked at least 512 bytes of input.
     535
    533536    AtomicStringImpl* enclosingTagName = 0;
    534537
     
    647650                    pos = endpos + 1;
    648651                }
    649             } else if (tag != scriptTag && tag != noscriptTag && tag != styleTag &&
     652            } else if (ptr - m_buffer.data() >= 512 && tag != scriptTag && tag != noscriptTag && tag != styleTag &&
    650653                       tag != linkTag && tag != metaTag && tag != objectTag &&
    651654                       tag != titleTag && tag != baseTag &&
Note: See TracChangeset for help on using the changeset viewer.