Bug 7724

Summary: Minor refactoring to HTMLParser::handleError() to remove duplicate code
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: DOMAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: VERIFIED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch v1 darin: review+

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.