[webkit-changes] cvs commit: WebCore/layout-tests/fast/encoding
mispositioned-meta-expected.txt mispositioned-meta.html
Darin
darin at opensource.apple.com
Sun Aug 14 01:47:14 PDT 2005
darin 05/08/14 01:47:14
Modified: . ChangeLog
khtml/misc decoder.cpp
Added: layout-tests/fast/encoding mispositioned-meta-expected.txt
mispositioned-meta.html
Log:
Fixed by Alexey Proskuryakov <ap at nypop.com>.
Reviewed and landed by Darin.
- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3590
should allow <meta> tags for encoding even after </head>
Test cases added:
* layout-tests/fast/encoding/mispositioned-meta-expected.txt: Added.
* layout-tests/fast/encoding/mispositioned-meta.html: Added.
* khtml/misc/decoder.cpp: (Decoder::decode): Don't stop scanning when seeing </head>.
Revision Changes Path
1.4569 +14 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4568
retrieving revision 1.4569
diff -u -r1.4568 -r1.4569
--- ChangeLog 14 Aug 2005 08:27:57 -0000 1.4568
+++ ChangeLog 14 Aug 2005 08:47:03 -0000 1.4569
@@ -1,3 +1,17 @@
+2005-08-14 Darin Adler <darin at apple.com>
+
+ Fixed by Alexey Proskuryakov <ap at nypop.com>.
+ Reviewed and landed by Darin.
+
+ - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3590
+ should allow <meta> tags for encoding even after </head>
+
+ Test cases added:
+ * layout-tests/fast/encoding/mispositioned-meta-expected.txt: Added.
+ * layout-tests/fast/encoding/mispositioned-meta.html: Added.
+
+ * khtml/misc/decoder.cpp: (Decoder::decode): Don't stop scanning when seeing </head>.
+
2005-08-14 Anders Carlsson <andersca at mac.com>
Reviewed and landed by Darin.
1.40 +7 -4 WebCore/khtml/misc/decoder.cpp
Index: decoder.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/misc/decoder.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- decoder.cpp 30 Jul 2005 02:33:21 -0000 1.39
+++ decoder.cpp 14 Aug 2005 08:47:13 -0000 1.40
@@ -23,7 +23,6 @@
//
// KDE HTML Widget -- decoder for input stream
-#undef DECODE_DEBUG
//#define DECODE_DEBUG
#include "decoder.h"
@@ -479,6 +478,11 @@
// we still don't have an encoding, and are in the head
// the following tags are allowed in <head>:
// SCRIPT|STYLE|META|LINK|OBJECT|TITLE|BASE
+
+ // We stop scanning when a tag that is not permitted in <head>
+ // 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>.
#if APPLE_CHANGES
const char *ptr = buffer.latin1();
@@ -574,10 +578,10 @@
tag != linkTag && tag != metaTag && tag != objectTag &&
tag != titleTag && tag != baseTag &&
(end || tag != htmlTag) &&
- (end || tag != headTag) && isalpha(tmp[0])) {
+ (tag != headTag) && isalpha(tmp[0])) {
body = true;
#ifdef DECODE_DEBUG
- kdDebug( 6005 ) << "Decoder: no charset found. Id=" << id << endl;
+ kdDebug( 6005 ) << "Decoder: no charset found (bailing because of \"" << tag.ascii() << "\")." << endl;
#endif
goto found;
}
@@ -692,4 +696,3 @@
}
// -----------------------------------------------------------------------------
-#undef DECODE_DEBUG
1.1 WebCore/layout-tests/fast/encoding/mispositioned-meta-expected.txt
Index: mispositioned-meta-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 784x18
RenderText {TEXT} at (0,0) size 611x18
text run at (0,0) width 611: "This test checks if WebKit can find a charset defined in an HTTP-EQUIV meta after the HEAD."
RenderBlock {P} at (0,34) size 784x18
RenderText {TEXT} at (0,0) size 305x18
text run at (0,0) width 305: "The first letter should look like a Latin \"C\" here:"
RenderBlock {P} at (0,68) size 784x18
RenderText {TEXT} at (0,0) size 633x18
text run at (0,0) width 633: "\x{421}\x{430}\x{439}\x{442} \x{413}\x{43E}\x{431}\x{43B}\x{438}\x{43D}\x{430} - \x{422}\x{443}\x{43F}\x{438}\x{447}\x{43E}\x{43A} \x{441}\x{442}.\x{43E}/\x{443} \x{413}\x{43E}\x{431}\x{43B}\x{438}\x{43D}\x{430} (Goblin). \x{424}\x{438}\x{43B}\x{44C}\x{43C}\x{44B} \x{413}\x{43E}\x{431}\x{43B}\x{438}\x{43D}\x{430}. \x{43F}\x{43E}\x{43B}\x{43D}\x{44B}\x{439} \x{41F}\x{44D}. \x{411}\x{43E}\x{436}\x{44C}\x{44F} \x{418}\x{441}\x{43A}\x{440}\x{430}."
1.1 WebCore/layout-tests/fast/encoding/mispositioned-meta.html
Index: mispositioned-meta.html
===================================================================
<html>
<head>
<title>çÏÂÌÉÎ, Goblin, ÓÁÊÔ çÏÂÌÉÎÁ</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
</head>
<meta http-equiv="Content-Type" content="text/html; charset=KOI8-R">
<body>
<p>This test checks if WebKit can find a charset defined in an HTTP-EQUIV meta after the HEAD.</p>
<p>The first letter should look like a Latin "C" here:</p>
<p>
óÁÊÔ çÏÂÌÉÎÁ - ôÕÐÉÞÏË ÓÔ.Ï/Õ çÏÂÌÉÎÁ (Goblin). æÉÌØÍÙ çÏÂÌÉÎÁ. ÐÏÌÎÙÊ ðÜ. âÏÖØÑ éÓËÒÁ.
</p>
</body>
</html>
<!--
See http://bugzilla.opendarwin.org/show_bug.cgi?id=3590
and https://bugzilla.mozilla.org/show_bug.cgi?id=98700
-->
More information about the webkit-changes
mailing list