- Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=7724
Minor refactoring to HTMLParser::handleError() to remove duplicate code
WebCore:
* khtml/html/htmlparser.cpp:
(WebCore::HTMLParser::handleError): Refactored code.
LayoutTests:
These tests cover the changed code. No change in behavior.
* fast/invalid/missing-address-end-tag-expected.checksum: Added.
* fast/invalid/missing-address-end-tag-expected.png: Added.
* fast/invalid/missing-address-end-tag-expected.txt: Added.
* fast/invalid/missing-address-end-tag.html: Added.
* fast/invalid/missing-dl-end-tag-expected.checksum: Added.
* fast/invalid/missing-dl-end-tag-expected.png: Added.
* fast/invalid/missing-dl-end-tag-expected.txt: Added.
* fast/invalid/missing-dl-end-tag.html: Added.
* fast/invalid/missing-dt-end-tag-expected.checksum: Added.
* fast/invalid/missing-dt-end-tag-expected.png: Added.
* fast/invalid/missing-dt-end-tag-expected.txt: Added.
* fast/invalid/missing-dt-end-tag.html: Added.
* fast/invalid/missing-font-end-tag-expected.checksum: Added.
* fast/invalid/missing-font-end-tag-expected.png: Added.
* fast/invalid/missing-font-end-tag-expected.txt: Added.
* fast/invalid/missing-font-end-tag.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13262
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-03-12 David Kilzer <ddkilzer@kilzer.net>
+
+ Reviewed by Darin, landed by ap.
+
+ - Tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=7724
+ Minor refactoring to HTMLParser::handleError() to remove duplicate code
+
+ These tests cover the changed code. No change in behavior.
+
+ * fast/invalid/missing-address-end-tag-expected.checksum: Added.
+ * fast/invalid/missing-address-end-tag-expected.png: Added.
+ * fast/invalid/missing-address-end-tag-expected.txt: Added.
+ * fast/invalid/missing-address-end-tag.html: Added.
+ * fast/invalid/missing-dl-end-tag-expected.checksum: Added.
+ * fast/invalid/missing-dl-end-tag-expected.png: Added.
+ * fast/invalid/missing-dl-end-tag-expected.txt: Added.
+ * fast/invalid/missing-dl-end-tag.html: Added.
+ * fast/invalid/missing-dt-end-tag-expected.checksum: Added.
+ * fast/invalid/missing-dt-end-tag-expected.png: Added.
+ * fast/invalid/missing-dt-end-tag-expected.txt: Added.
+ * fast/invalid/missing-dt-end-tag.html: Added.
+ * fast/invalid/missing-font-end-tag-expected.checksum: Added.
+ * fast/invalid/missing-font-end-tag-expected.png: Added.
+ * fast/invalid/missing-font-end-tag-expected.txt: Added.
+ * fast/invalid/missing-font-end-tag.html: Added.
+
2006-03-10 Darin Adler <darin@apple.com>
Reviewed by Geoff, except for frame-name-reset, which was done by Alexey.
--- /dev/null
+96c372cb88ae5f9ab28523027c3f7c82
+\ No newline at end of file
--- /dev/null
+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 784x584
+ RenderBlock {DIV} at (0,0) size 784x18
+ RenderText {TEXT} at (0,0) size 53x18
+ text run at (0,0) width 53: "Test for "
+ RenderInline {A} at (0,0) size 120x18 [color=#0000EE]
+ RenderText {TEXT} at (53,0) size 120x18
+ text run at (53,0) width 120: "Bugzilla Bug 7724"
+ RenderText {TEXT} at (173,0) size 475x18
+ text run at (173,0) width 475: " Minor refactoring to HTMLParser::handleError() to remove duplicate code"
+ RenderBlock {ADDRESS} at (0,18) size 784x18
+ RenderText {TEXT} at (0,0) size 49x18
+ text run at (0,0) width 49: "address"
+ RenderBlock (anonymous) at (0,36) size 784x18
+ RenderText {TEXT} at (0,0) size 9x18
+ text run at (0,0) width 9: "tr"
--- /dev/null
+<div>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7724">Bugzilla Bug 7724</a>
+Minor refactoring to HTMLParser::handleError() to remove duplicate code</div>
+<address>address<tr>tr
--- /dev/null
+c279593802c1278c64aeba24e920b70c
+\ No newline at end of file
--- /dev/null
+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 784x584
+ RenderBlock {DIV} at (0,0) size 784x18
+ RenderText {TEXT} at (0,0) size 53x18
+ text run at (0,0) width 53: "Test for "
+ RenderInline {A} at (0,0) size 120x18 [color=#0000EE]
+ RenderText {TEXT} at (53,0) size 120x18
+ text run at (53,0) width 120: "Bugzilla Bug 7724"
+ RenderText {TEXT} at (173,0) size 475x18
+ text run at (173,0) width 475: " Minor refactoring to HTMLParser::handleError() to remove duplicate code"
+ RenderBlock {DL} at (0,34) size 784x18
+ RenderText {TEXT} at (0,0) size 12x18
+ text run at (0,0) width 12: "dl"
+ RenderBlock (anonymous) at (0,68) size 784x18
+ RenderText {TEXT} at (0,0) size 9x18
+ text run at (0,0) width 9: "tr"
--- /dev/null
+<div>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7724">Bugzilla Bug 7724</a>
+Minor refactoring to HTMLParser::handleError() to remove duplicate code</div>
+<dl>dl<tr>tr
--- /dev/null
+4a4e25509a2c4a74c6c1e82381591aa2
+\ No newline at end of file
--- /dev/null
+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 784x584
+ RenderBlock {DIV} at (0,0) size 784x18
+ RenderText {TEXT} at (0,0) size 53x18
+ text run at (0,0) width 53: "Test for "
+ RenderInline {A} at (0,0) size 120x18 [color=#0000EE]
+ RenderText {TEXT} at (53,0) size 120x18
+ text run at (53,0) width 120: "Bugzilla Bug 7724"
+ RenderText {TEXT} at (173,0) size 475x18
+ text run at (173,0) width 475: " Minor refactoring to HTMLParser::handleError() to remove duplicate code"
+ RenderBlock {DT} at (0,18) size 784x18
+ RenderText {TEXT} at (0,0) size 12x18
+ text run at (0,0) width 12: "dt"
+ RenderBlock (anonymous) at (0,36) size 784x18
+ RenderText {TEXT} at (0,0) size 9x18
+ text run at (0,0) width 9: "tr"
--- /dev/null
+<div>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7724">Bugzilla Bug 7724</a>
+Minor refactoring to HTMLParser::handleError() to remove duplicate code</div>
+<dt>dt<tr>tr
--- /dev/null
+0bbb3aed4ac8db6ddb39337a6af38e05
+\ No newline at end of file
--- /dev/null
+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 784x584
+ RenderBlock {DIV} at (0,0) size 784x18
+ RenderText {TEXT} at (0,0) size 53x18
+ text run at (0,0) width 53: "Test for "
+ RenderInline {A} at (0,0) size 120x18 [color=#0000EE]
+ RenderText {TEXT} at (53,0) size 120x18
+ text run at (53,0) width 120: "Bugzilla Bug 7724"
+ RenderText {TEXT} at (173,0) size 475x18
+ text run at (173,0) width 475: " Minor refactoring to HTMLParser::handleError() to remove duplicate code"
+ RenderBlock (anonymous) at (0,18) size 784x18
+ RenderInline {FONT} at (0,0) size 25x18
+ RenderText {TEXT} at (0,0) size 25x18
+ text run at (0,0) width 25: "font"
+ RenderText {TEXT} at (25,0) size 9x18
+ text run at (25,0) width 9: "tr"
--- /dev/null
+<div>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7724">Bugzilla Bug 7724</a>
+Minor refactoring to HTMLParser::handleError() to remove duplicate code</div>
+<font>font<tr>tr
+2006-03-12 David Kilzer <ddkilzer@kilzer.net>
+
+ Reviewed by Darin, landed by ap.
+
+ - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=7724
+ Minor refactoring to HTMLParser::handleError() to remove duplicate code
+
+ Test: fast/invalid/missing-address-end-tag.html
+ Test: fast/invalid/missing-dl-end-tag.html
+ Test: fast/invalid/missing-dt-end-tag.html
+ Test: fast/invalid/missing-font-end-tag.html
+
+ * khtml/html/htmlparser.cpp:
+ (WebCore::HTMLParser::handleError): Refactored code.
+
2006-03-10 Darin Adler <darin@apple.com>
- fix Windows build
handled = true;
}
}
- } else if (h->hasLocalName(titleTag)) {
+ } else if (h->hasLocalName(addressTag) || h->hasLocalName(dlTag) || h->hasLocalName(dtTag)
+ || h->hasLocalName(fontTag) || h->hasLocalName(titleTag)) {
popBlock(currentTagName);
handled = true;
} else if (h->hasLocalName(captionTag)) {
e = new HTMLDivElementImpl(document);
insertNode(e);
handled = true;
- } else if (h->hasLocalName(dlTag) || h->hasLocalName(dtTag)) {
- popBlock(currentTagName);
- handled = true;
} else if (h->hasLocalName(selectTag)) {
if (isInline(n))
return false;
// IE treats a nested select as </select>. Let's do the same
popBlock(localName);
}
- } else if (h->hasLocalName(addressTag)) {
- popBlock(currentTagName);
- handled = true;
} else if (h->hasLocalName(colgroupTag)) {
if (!n->isTextNode()) {
popBlock(currentTagName);
handled = true;
}
- } else if (h->hasLocalName(fontTag)) {
- popBlock(currentTagName);
- handled = true;
} else if (!h->hasLocalName(bodyTag)) {
if (isInline(current)) {
popInlineBlocks();