Bug 7724 - Minor refactoring to HTMLParser::handleError() to remove duplicate code
Summary: Minor refactoring to HTMLParser::handleError() to remove duplicate code
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-11 14:14 PST by David Kilzer (:ddkilzer)
Modified: 2006-03-19 06:09 PST (History)
0 users

See Also:


Attachments
Patch v1 (14.02 KB, patch)
2006-03-11 17:57 PST, David Kilzer (:ddkilzer)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2006-03-11 14:14:32 PST
This code could be consolidated:

        // ....
        } else if (h->hasLocalName(titleTag)) {
            popBlock(currentTagName);
            handled = true;
        // ....
        } else if (h->hasLocalName(dlTag) || h->hasLocalName(dtTag)) {
            popBlock(currentTagName);
            handled = true;
        // ....
        } else if (h->hasLocalName(addressTag)) {
            popBlock(currentTagName);
            handled = true;
        // ....
        } else if (h->hasLocalName(fontTag)) {
            popBlock(currentTagName);
            handled = true;
        // ....

However, tests should be written for this code since commenting out the duplicate code did not cause any tests to break.
Comment 1 David Kilzer (:ddkilzer) 2006-03-11 14:28:28 PST
Actually, commented out the titleTag code causes test failures, but the others do not!
Comment 2 David Kilzer (:ddkilzer) 2006-03-11 17:57:32 PST
Created attachment 7015 [details]
Patch v1

Patch to refactor code in HTMLParser::handleError() and test cases to cover changed code (which previously had no coverage).
Comment 3 Darin Adler 2006-03-11 22:08:17 PST
Comment on attachment 7015 [details]
Patch v1

r=me
Comment 4 David Kilzer (:ddkilzer) 2006-03-19 06:09:09 PST
Verified by inspection of htmlparser.cpp.