+2007-07-18 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Oliver.
+
+ - test for <rdar://problem/5340603> REGRESSION: javascript being written to the screen in Safari
+
+ * fast/tokenizer/badscript-expected.txt: Added.
+ * fast/tokenizer/badscript.html: Added.
+
2007-07-17 Sam Weinig <sam@webkit.org>
Reviewed by Geoff Garen.
--- /dev/null
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+This tests that bad attribute syntax doesn't mistakenly trigger the self-closing script quirk.
+<script type"text/javascript">
+var thisShouldNotShowUp;
+</script>
+
+2007-07-18 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Oliver.
+
+ - fixed <rdar://problem/5340603> REGRESSION: javascript being written to the screen in Safari
+
+ Test Case: fast/tokenizer/badscript.html
+
+ * html/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::parseTag): Don't apply our self-closing
+ <script> quirk in cases where the / appears in a mangled attribtue
+ value.
+
2007-07-17 Peter Kasting <zerodpx@gmail.com>
Reviewed by Hyatt.
unsigned cBufferPos = m_cBufferPos;
int* lineNoPtr = lineNumberPtr();
+ bool lastIsSlash = false;
while (!src.isEmpty()) {
checkBuffer();
#endif
while(!src.isEmpty()) {
UChar curchar = *src;
+
+ if (lastIsSlash && curchar == '>') {
+ // This is a quirk (with a long sad history). We have to do this
+ // since widgets do <script src="foo.js"/> and expect the tag to close.
+ if (currToken.tagName == scriptTag)
+ currToken.flat = true;
+ currToken.brokenXMLStyle = true;
+ }
+
// In this mode just ignore any quotes or slashes we encounter and treat them like spaces.
if (curchar > ' ' && curchar != '\'' && curchar != '"' && curchar != '/') {
if(curchar == '=') {
currToken.addAttribute(m_doc, attrName, emptyAtom, inViewSourceMode());
dest = buffer;
state.setTagState(SearchAttribute);
+ lastIsSlash = false;
}
break;
}
if (inViewSourceMode())
currToken.addViewSourceChar(curchar);
- if (curchar == '/') {
- // This is a quirk (with a long sad history). We have to do this
- // since widgets do <script src="foo.js"/> and expect the tag to close.
- if (currToken.tagName == scriptTag)
- currToken.flat = true;
- currToken.brokenXMLStyle = true;
- }
+ lastIsSlash = curchar == '/';
+
src.advance(lineNoPtr);
}
break;