[webkit-changes] cvs commit: WebCore/layout-tests/fast/encoding tag-in-title-expected.checksum tag-in-title-expected.png tag-in-title-expected.txt tag-in-title.html

Darin darin at opensource.apple.com
Wed Aug 31 22:37:18 PDT 2005


darin       05/08/31 22:37:18

  Modified:    .        ChangeLog
               khtml/misc decoder.cpp
  Added:       layout-tests/fast/encoding tag-in-title-expected.checksum
                        tag-in-title-expected.png tag-in-title-expected.txt
                        tag-in-title.html
  Log:
          Reviewed and landed by Darin.
  
          - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4560
            Markup in <title> prevents decoder from looking for a charset
  
  	Test cases added:
          * layout-tests/fast/encoding/tag-in-title.html: Added.
          * layout-tests/fast/encoding/tag-in-title-expected.png: Added.
          * layout-tests/fast/encoding/tag-in-title-expected.txt: Added.
  
          * khtml/misc/decoder.cpp: (Decoder::decode): Ignore tags within <title>.
  
  Revision  Changes    Path
  1.64      +14 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- ChangeLog	1 Sep 2005 05:04:57 -0000	1.63
  +++ ChangeLog	1 Sep 2005 05:37:16 -0000	1.64
  @@ -1,3 +1,17 @@
  +2005-08-31  Alexey Proskuryakov  <ap at nypop.com>
  +
  +        Reviewed and landed by Darin.
  +
  +        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4560
  +          Markup in <title> prevents decoder from looking for a charset
  +
  +	Test cases added: 
  +        * layout-tests/fast/encoding/tag-in-title.html: Added.
  +        * layout-tests/fast/encoding/tag-in-title-expected.png: Added.
  +        * layout-tests/fast/encoding/tag-in-title-expected.txt: Added.
  +
  +        * khtml/misc/decoder.cpp: (Decoder::decode): Ignore tags within <title>.
  +
   2005-08-31  Maciej Stachowiak  <mjs at apple.com>
   
           - updated pixel test baselines that had the button text off by one - I think
  
  
  
  1.42      +10 -1     WebCore/khtml/misc/decoder.cpp
  
  Index: decoder.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/misc/decoder.cpp,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- decoder.cpp	25 Aug 2005 23:13:53 -0000	1.41
  +++ decoder.cpp	1 Sep 2005 05:37:17 -0000	1.42
  @@ -484,6 +484,11 @@
               // is seen, rather when </head> is seen, because that more closely
               // matches behavior in other browsers; more details in
               // <http://bugzilla.opendarwin.org/show_bug.cgi?id=3590>.
  +            
  +            // Additionally, we ignore things that looks like tags in <title>; see
  +            // <http://bugzilla.opendarwin.org/show_bug.cgi?id=4560>.
  +            
  +            bool withinTitle = false;
   
   #if APPLE_CHANGES
               const char *ptr = buffer.latin1();
  @@ -536,6 +541,10 @@
                       }
   		    tmp[len] = 0;
                       AtomicString tag(tmp);
  +                    
  +                    if (tag == titleTag)
  +                        withinTitle = !end;
  +                    
                       if (!end && tag == metaTag) {
                           // found a meta tag...
                           //ptr += 5;
  @@ -578,7 +587,7 @@
   		    } else if (tag != scriptTag && tag != noscriptTag && tag != styleTag &&
                                  tag != linkTag && tag != metaTag && tag != objectTag &&
                                  tag != titleTag && tag != baseTag && 
  -                               (end || tag != htmlTag) &&
  +                               (end || tag != htmlTag) && !withinTitle &&
                                  (tag != headTag) && isalpha(tmp[0])) {
                           body = true;
   #ifdef DECODE_DEBUG
  
  
  
  1.1                  WebCore/layout-tests/fast/encoding/tag-in-title-expected.checksum
  
  Index: tag-in-title-expected.checksum
  ===================================================================
  7a95b373c87950690236d38b4c10d6b2
  
  
  1.1                  WebCore/layout-tests/fast/encoding/tag-in-title-expected.png
  
  	<<Binary file>>
  
  
  1.1                  WebCore/layout-tests/fast/encoding/tag-in-title-expected.txt
  
  Index: tag-in-title-expected.txt
  ===================================================================
  layer at (0,0) size 800x600
    RenderCanvas at (0,0) size 800x600
  layer at (0,0) size 800x600
    RenderBlock {HTML} at (0,0) size 800x600
      RenderBody {BODY} at (8,8) size 784x576
        RenderBlock {P} at (0,0) size 784x36
          RenderText {TEXT} at (0,0) size 770x36
            text run at (0,0) width 770: "This test checks that WebKit doesn't stop looking for a charset defined in an HTTP-EQUIV meta when it encounters a tag"
            text run at (0,18) width 89: "within <title>."
        RenderBlock {P} at (0,52) size 784x18
          RenderText {TEXT} at (0,0) size 306x18
            text run at (0,0) width 306: "The first letter should look like a Latin \"K\" here:"
        RenderBlock {P} at (0,86) size 784x18
          RenderText {TEXT} at (0,0) size 99x18
            text run at (0,0) width 99: "\x{41A}\x{430}\x{43A}\x{430}\x{44F} \x{433}\x{430}\x{434}\x{43E}\x{441}\x{442}\x{44C}!"
  
  
  
  1.1                  WebCore/layout-tests/fast/encoding/tag-in-title.html
  
  Index: tag-in-title.html
  ===================================================================
  <html>
   <head>
   <title>ôÜÇÉ <b><font color=red>[R]</font></b> × &lt;title&gt;</title>
   <link rel="shortcut icon" href=/favicon.ico type=image/x-icon>
   <meta http-equiv="Content-Type" content="text/html; charset=KOI8-R">
   </head>
  
  <body>
    <p>This test checks that WebKit doesn't stop looking for a charset defined in an HTTP-EQUIV meta when it encounters a tag within &lt;title&gt;.</p>
    <p>The first letter should look like a Latin "K" here:</p>
    <p>
    ëÁËÁÑ ÇÁÄÏÓÔØ!
    </p>
  </body>
  </html>
  
  
  



More information about the webkit-changes mailing list