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.
Actually, commented out the titleTag code causes test failures, but the others do not!
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 on attachment 7015 [details] Patch v1 r=me
Verified by inspection of htmlparser.cpp.