[webkit-changes] cvs commit: WebCore/khtml/html htmltokenizer.cpp
David
hyatt at opensource.apple.com
Fri Jul 22 14:34:12 PDT 2005
hyatt 05/07/22 14:34:11
Modified: . ChangeLog
khtml/html htmltokenizer.cpp
Log:
Put back in the <script src="foo"/> self-closing tag quirk in HTML. Unfortunately
Dashboard widgets are dependent on this quirk.
Reviewed by mjs
* khtml/html/htmltokenizer.cpp:
(khtml::HTMLTokenizer::parseTag):
Revision Changes Path
1.4461 +10 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4460
retrieving revision 1.4461
diff -u -r1.4460 -r1.4461
--- ChangeLog 22 Jul 2005 18:09:18 -0000 1.4460
+++ ChangeLog 22 Jul 2005 21:34:07 -0000 1.4461
@@ -1,3 +1,13 @@
+2005-07-22 David Hyatt <hyatt at apple.com>
+
+ Put back in the <script src="foo"/> self-closing tag quirk in HTML. Unfortunately
+ Dashboard widgets are dependent on this quirk.
+
+ Reviewed by mjs
+
+ * khtml/html/htmltokenizer.cpp:
+ (khtml::HTMLTokenizer::parseTag):
+
2005-07-22 John Sullivan <sullivan at apple.com>
Reviewed by Chris Blumenberg.
1.101 +15 -1 WebCore/khtml/html/htmltokenizer.cpp
Index: htmltokenizer.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/html/htmltokenizer.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- htmltokenizer.cpp 19 Jul 2005 23:44:07 -0000 1.100
+++ htmltokenizer.cpp 22 Jul 2005 21:34:11 -0000 1.101
@@ -1125,6 +1125,13 @@
dest = buffer;
*dest++ = 0;
tag = SearchEqual;
+ // This is a deliberate quirk to match Mozilla and Opera. We have to do this
+ // since sites that use the "standards-compliant" path sometimes send
+ // <script src="foo.js"/>. Both Moz and Opera will honor this, despite it
+ // being bogus HTML. They do not honor the "/" for other tags. This behavior
+ // also deviates from WinIE, but in this case we'll just copy Moz and Opera.
+ if (currToken.tagName == HTMLTags::script() && curchar == '>' && attrName == "/")
+ currToken.flat = true;
break;
}
}
@@ -1322,8 +1329,12 @@
#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 0
kdDebug( 6036 ) << "appending Tag: " << tagID << endl;
#endif
+
+ // Handle <script src="foo"/> like Mozilla/Opera. We have to do this now for Dashboard
+ // compatibility.
+ bool isSelfClosingScript = currToken.flat && currToken.beginTag && currToken.tagName == HTMLTags::script();
bool beginTag = !currToken.flat && currToken.beginTag;
- if (beginTag && currToken.tagName == HTMLTags::script()) {
+ if (currToken.beginTag && currToken.tagName == HTMLTags::script()) {
AttributeImpl* a = 0;
bool foundTypeAttribute = false;
scriptSrc = QString::null;
@@ -1408,6 +1419,9 @@
searchStopperLen = 8;
script = true;
parseSpecial(src);
+ } else if (isSelfClosingScript) { // Handle <script src="foo"/>
+ script = true;
+ scriptHandler();
}
} else if (tagName == HTMLTags::style()) {
if (beginTag) {
More information about the webkit-changes
mailing list