Changeset 91008 in webkit


Ignore:
Timestamp:
Jul 14, 2011 10:15:04 AM (13 years ago)
Author:
vsevik@chromium.org
Message:

Move XML errors handling out from XMLDocumentParser (refactoring).
https://bugs.webkit.org/show_bug.cgi?id=64305

XML errors handling logic is moved out from XMLDocumentParser to allow using it for XSLT error handling as well.

Reviewed by Adam Barth.

No tests needed as there is no new functionality added.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • xml/XMLErrors.cpp: Added.

(WebCore::XMLErrors::XMLErrors):
(WebCore::XMLErrors::handleError):
(WebCore::XMLErrors::appendErrorMessage):
(WebCore::createXHTMLParserErrorHeader):
(WebCore::XMLErrors::insertErrorMessageBlock):

  • xml/XMLErrors.h: Added.
  • xml/parser/XMLDocumentParser.cpp:

(WebCore::XMLDocumentParser::pushCurrentNode):
(WebCore::XMLDocumentParser::handleError):
(WebCore::XMLDocumentParser::insertErrorMessageBlock):

  • xml/parser/XMLDocumentParser.h:
  • xml/parser/XMLDocumentParserLibxml2.cpp:

(WebCore::PendingCallbacks::appendErrorCallback):
(WebCore::XMLDocumentParser::XMLDocumentParser):
(WebCore::XMLDocumentParser::doWrite):
(WebCore::XMLDocumentParser::error):
(WebCore::warningHandler):
(WebCore::fatalErrorHandler):
(WebCore::normalErrorHandler):

  • xml/parser/XMLDocumentParserQt.cpp:

(WebCore::XMLDocumentParser::XMLDocumentParser):
(WebCore::XMLDocumentParser::doWrite):
(WebCore::XMLDocumentParser::doEnd):
(WebCore::XMLDocumentParser::parse):
(WebCore::XMLDocumentParser::parseStartElement):
(WebCore::XMLDocumentParser::parseDtd):

Location:
trunk/Source/WebCore
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r90849 r91008  
    13641364    xml/DOMParser.cpp
    13651365    xml/NativeXPathNSResolver.cpp
     1366    xml/XMLErrors.cpp
    13661367    xml/XMLHttpRequest.cpp
    13671368    xml/XMLHttpRequestProgressEventThrottle.cpp
  • trunk/Source/WebCore/ChangeLog

    r91006 r91008  
     12011-07-14  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Move XML errors handling out from XMLDocumentParser (refactoring).
     4        https://bugs.webkit.org/show_bug.cgi?id=64305
     5
     6        XML errors handling logic is moved out from XMLDocumentParser to allow using it for XSLT error handling as well.
     7
     8        Reviewed by Adam Barth.
     9
     10        No tests needed as there is no new functionality added.
     11
     12        * CMakeLists.txt:
     13        * GNUmakefile.list.am:
     14        * WebCore.gypi:
     15        * WebCore.pro:
     16        * WebCore.vcproj/WebCore.vcproj:
     17        * WebCore.xcodeproj/project.pbxproj:
     18        * xml/XMLErrors.cpp: Added.
     19        (WebCore::XMLErrors::XMLErrors):
     20        (WebCore::XMLErrors::handleError):
     21        (WebCore::XMLErrors::appendErrorMessage):
     22        (WebCore::createXHTMLParserErrorHeader):
     23        (WebCore::XMLErrors::insertErrorMessageBlock):
     24        * xml/XMLErrors.h: Added.
     25        * xml/parser/XMLDocumentParser.cpp:
     26        (WebCore::XMLDocumentParser::pushCurrentNode):
     27        (WebCore::XMLDocumentParser::handleError):
     28        (WebCore::XMLDocumentParser::insertErrorMessageBlock):
     29        * xml/parser/XMLDocumentParser.h:
     30        * xml/parser/XMLDocumentParserLibxml2.cpp:
     31        (WebCore::PendingCallbacks::appendErrorCallback):
     32        (WebCore::XMLDocumentParser::XMLDocumentParser):
     33        (WebCore::XMLDocumentParser::doWrite):
     34        (WebCore::XMLDocumentParser::error):
     35        (WebCore::warningHandler):
     36        (WebCore::fatalErrorHandler):
     37        (WebCore::normalErrorHandler):
     38        * xml/parser/XMLDocumentParserQt.cpp:
     39        (WebCore::XMLDocumentParser::XMLDocumentParser):
     40        (WebCore::XMLDocumentParser::doWrite):
     41        (WebCore::XMLDocumentParser::doEnd):
     42        (WebCore::XMLDocumentParser::parse):
     43        (WebCore::XMLDocumentParser::parseStartElement):
     44        (WebCore::XMLDocumentParser::parseDtd):
     45
    1462011-07-14  Vsevolod Vlasov  <vsevik@chromium.org>
    247
  • trunk/Source/WebCore/GNUmakefile.list.am

    r90953 r91008  
    38083808        Source/WebCore/xml/NativeXPathNSResolver.cpp \
    38093809        Source/WebCore/xml/NativeXPathNSResolver.h \
     3810        Source/WebCore/xml/XMLErrors.cpp \
     3811        Source/WebCore/xml/XMLErrors.h \
    38103812        Source/WebCore/xml/XMLHttpRequest.cpp \
    38113813        Source/WebCore/xml/XMLHttpRequestException.h \
  • trunk/Source/WebCore/WebCore.gypi

    r90996 r91008  
    61126112            'xml/NativeXPathNSResolver.cpp',
    61136113            'xml/NativeXPathNSResolver.h',
     6114            'xml/XMLErrors.cpp',
     6115            'xml/XMLErrors.h',
    61146116            'xml/XMLHttpRequest.cpp',
    61156117            'xml/XMLHttpRequest.h',
  • trunk/Source/WebCore/WebCore.pro

    r90849 r91008  
    11961196    xml/XMLHttpRequestProgressEventThrottle.cpp \
    11971197    xml/XMLHttpRequestUpload.cpp \
     1198    xml/XMLErrors.cpp \
    11981199    xml/XMLSerializer.cpp \
    11991200    xml/parser/XMLDocumentParser.cpp
     
    24982499    xml/XMLHttpRequest.h \
    24992500    xml/XMLHttpRequestUpload.h \
     2501    xml/XMLErrors.h \
    25002502    xml/XMLSerializer.h \
    25012503    xml/XPathEvaluator.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r90863 r91008  
    4206142061                        </File>
    4206242062                        <File
     42063                                RelativePath="..\xml\XMLErrors.cpp"
     42064                                >
     42065                        </File>
     42066                        <File
     42067                                RelativePath="..\xml\XMLErrors.h"
     42068                                >
     42069                        </File>
     42070                        <File
    4206342071                                RelativePath="..\xml\XMLHttpRequest.cpp"
    4206442072                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r90911 r91008  
    14681468                59C27F05138D28C10079B7E2 /* NetworkResourcesData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59C27F04138D28C10079B7E2 /* NetworkResourcesData.cpp */; };
    14691469                59C27F07138D28CF0079B7E2 /* NetworkResourcesData.h in Headers */ = {isa = PBXBuildFile; fileRef = 59C27F06138D28CF0079B7E2 /* NetworkResourcesData.h */; };
     1470                59C28045138DC2410079B7E2 /* XMLErrors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59C28043138DC2410079B7E2 /* XMLErrors.cpp */; };
     1471                59C28046138DC2410079B7E2 /* XMLErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 59C28044138DC2410079B7E2 /* XMLErrors.h */; };
    14701472                59D1C10411EB5DCF00B638C8 /* DeviceOrientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */; };
    14711473                59E560A71105336600AA1258 /* JavaClassJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59E560A61105336600AA1258 /* JavaClassJSC.h */; };
     
    80078009                59C27F04138D28C10079B7E2 /* NetworkResourcesData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkResourcesData.cpp; sourceTree = "<group>"; };
    80088010                59C27F06138D28CF0079B7E2 /* NetworkResourcesData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkResourcesData.h; sourceTree = "<group>"; };
     8011                59C28043138DC2410079B7E2 /* XMLErrors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLErrors.cpp; sourceTree = "<group>"; };
     8012                59C28044138DC2410079B7E2 /* XMLErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLErrors.h; sourceTree = "<group>"; };
    80098013                59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceOrientation.cpp; sourceTree = "<group>"; };
    80108014                59E560A61105336600AA1258 /* JavaClassJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaClassJSC.h; path = jsc/JavaClassJSC.h; sourceTree = "<group>"; };
     
    1896918973                                E10B9B6A0B747599003ED890 /* NativeXPathNSResolver.h */,
    1897018974                                A833C7F60A2CF1D800D57664 /* xmlattrs.in */,
     18975                                59C28043138DC2410079B7E2 /* XMLErrors.cpp */,
     18976                                59C28044138DC2410079B7E2 /* XMLErrors.h */,
    1897118977                                BC772C440C4EB2C60083285F /* XMLHttpRequest.cpp */,
    1897218978                                BC772C450C4EB2C60083285F /* XMLHttpRequest.h */,
     
    2304523051                                00B9318813BA8DBA0035A948 /* XMLDocumentParser.h in Headers */,
    2304623052                                00B9318C13BA8DCC0035A948 /* XMLDocumentParserScope.h in Headers */,
     23053                                59C28046138DC2410079B7E2 /* XMLErrors.h in Headers */,
    2304723054                                BC772C470C4EB2C60083285F /* XMLHttpRequest.h in Headers */,
    2304823055                                BC60D9C90D2A29E500B9918F /* XMLHttpRequestException.h in Headers */,
     
    2581425821                                00B9318913BA8DBC0035A948 /* XMLDocumentParserLibxml2.cpp in Sources */,
    2581525822                                00B9318B13BA8DC90035A948 /* XMLDocumentParserScope.cpp in Sources */,
     25823                                59C28045138DC2410079B7E2 /* XMLErrors.cpp in Sources */,
    2581625824                                BC772C460C4EB2C60083285F /* XMLHttpRequest.cpp in Sources */,
    2581725825                                A136A00C1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp in Sources */,
  • trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp

    r90269 r91008  
    5151#include "TextResourceDecoder.h"
    5252#include "TreeDepthLimit.h"
    53 #include <wtf/text/WTFString.h>
     53#include "XMLErrors.h"
    5454#include <wtf/StringExtras.h>
    5555#include <wtf/Threading.h>
     
    6666
    6767using namespace HTMLNames;
    68 
    69 const int maxErrors = 25;
    7068
    7169void XMLDocumentParser::pushCurrentNode(ContainerNode* n)
     
    7876    m_currentNode = n;
    7977    if (m_currentNodeStack.size() > maxDOMTreeDepth)
    80         handleError(fatal, "Excessive node nesting.", lineNumber(), columnNumber());
     78        handleError(XMLErrors::fatal, "Excessive node nesting.", lineNumber(), columnNumber());
    8179}
    8280
     
    136134}
    137135
    138 void XMLDocumentParser::handleError(ErrorType type, const char* m, int lineNumber, int columnNumber)
     136void XMLDocumentParser::handleError(XMLErrors::ErrorType type, const char* m, int lineNumber, int columnNumber)
    139137{
    140138    handleError(type, m, TextPosition1(WTF::OneBasedNumber::fromOneBasedInt(lineNumber), WTF::OneBasedNumber::fromOneBasedInt(columnNumber)));
    141139}
    142140
    143 void XMLDocumentParser::handleError(ErrorType type, const char* m, TextPosition1 position)
    144 {
    145     if (type == fatal || (m_errorCount < maxErrors && m_lastErrorPosition.m_line != position.m_line && m_lastErrorPosition.m_column != position.m_column)) {
    146         switch (type) {
    147             case warning:
    148                 m_errorMessages += "warning on line " + String::number(position.m_line.oneBasedInt()) + " at column " + String::number(position.m_column.oneBasedInt()) + ": " + m;
    149                 break;
    150             case fatal:
    151             case nonFatal:
    152                 m_errorMessages += "error on line " + String::number(position.m_line.oneBasedInt()) + " at column " + String::number(position.m_column.oneBasedInt()) + ": " + m;
    153         }
    154 
    155         m_lastErrorPosition = position;
    156         ++m_errorCount;
    157     }
    158 
    159     if (type != warning)
     141void XMLDocumentParser::handleError(XMLErrors::ErrorType type, const char* m, TextPosition1 position)
     142{
     143    m_xmlErrors.handleError(type, m, position);
     144    if (type != XMLErrors::warning)
    160145        m_sawError = true;
    161 
    162     if (type == fatal)
     146    if (type == XMLErrors::fatal)
    163147        stopParsing();
    164148}
     
    252236}
    253237
    254 static inline RefPtr<Element> createXHTMLParserErrorHeader(Document* doc, const String& errorMessages)
    255 {
    256     RefPtr<Element> reportElement = doc->createElement(QualifiedName(nullAtom, "parsererror", xhtmlNamespaceURI), false);
    257     reportElement->setAttribute(styleAttr, "display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black");
    258 
    259     ExceptionCode ec = 0;
    260     RefPtr<Element> h3 = doc->createElement(h3Tag, false);
    261     reportElement->appendChild(h3.get(), ec);
    262     h3->appendChild(doc->createTextNode("This page contains the following errors:"), ec);
    263 
    264     RefPtr<Element> fixed = doc->createElement(divTag, false);
    265     reportElement->appendChild(fixed.get(), ec);
    266     fixed->setAttribute(styleAttr, "font-family:monospace;font-size:12px");
    267     fixed->appendChild(doc->createTextNode(errorMessages), ec);
    268 
    269     h3 = doc->createElement(h3Tag, false);
    270     reportElement->appendChild(h3.get(), ec);
    271     h3->appendChild(doc->createTextNode("Below is a rendering of the page up to the first error."), ec);
    272 
    273     return reportElement;
    274 }
    275 
    276238void XMLDocumentParser::insertErrorMessageBlock()
    277239{
     
    280242        return;
    281243#endif
    282     // One or more errors occurred during parsing of the code. Display an error block to the user above
    283     // the normal content (the DOM tree is created manually and includes line/col info regarding
    284     // where the errors are located)
    285 
    286     // Create elements for display
    287     ExceptionCode ec = 0;
    288     Document* document = this->document();
    289     RefPtr<Element> documentElement = document->documentElement();
    290     if (!documentElement) {
    291         RefPtr<Element> rootElement = document->createElement(htmlTag, false);
    292         document->appendChild(rootElement, ec);
    293         RefPtr<Element> body = document->createElement(bodyTag, false);
    294         rootElement->appendChild(body, ec);
    295         documentElement = body.get();
    296     }
    297 #if ENABLE(SVG)
    298     else if (documentElement->namespaceURI() == SVGNames::svgNamespaceURI) {
    299         RefPtr<Element> rootElement = document->createElement(htmlTag, false);
    300         RefPtr<Element> body = document->createElement(bodyTag, false);
    301         rootElement->appendChild(body, ec);
    302         body->appendChild(documentElement, ec);
    303         document->appendChild(rootElement.get(), ec);
    304         documentElement = body.get();
    305     }
    306 #endif
    307     RefPtr<Element> reportElement = createXHTMLParserErrorHeader(document, m_errorMessages);
    308     documentElement->insertBefore(reportElement, documentElement->firstChild(), ec);
    309 #if ENABLE(XSLT)
    310     if (document->transformSourceDocument()) {
    311         RefPtr<Element> paragraph = document->createElement(pTag, false);
    312         paragraph->setAttribute(styleAttr, "white-space: normal");
    313         paragraph->appendChild(document->createTextNode("This document was created as the result of an XSL transformation. The line and column numbers given are from the transformed result."), ec);
    314         reportElement->appendChild(paragraph.release(), ec);
    315     }
    316 #endif
    317     document->updateStyleIfNeeded();
     244
     245    m_xmlErrors.insertErrorMessageBlock();
    318246}
    319247
  • trunk/Source/WebCore/xml/parser/XMLDocumentParser.h

    r90269 r91008  
    3131#include "ScriptableDocumentParser.h"
    3232#include "SegmentedString.h"
     33#include "XMLErrors.h"
    3334#include <wtf/HashMap.h>
    3435#include <wtf/OwnPtr.h>
     
    8788
    8889        // Exposed for callbacks:
    89         enum ErrorType { warning, nonFatal, fatal };
    90         void handleError(ErrorType, const char* message, int lineNumber, int columnNumber);
    91         void handleError(ErrorType, const char* message, TextPosition1);
     90        void handleError(XMLErrors::ErrorType, const char* message, int lineNumber, int columnNumber);
     91        void handleError(XMLErrors::ErrorType, const char* message, TextPosition1);
    9292
    9393        void setIsXHTMLDocument(bool isXHTML) { m_isXHTMLDocument = isXHTML; }
     
    149149public:
    150150        // callbacks from parser SAX
    151         void error(ErrorType, const char* message, va_list args) WTF_ATTRIBUTE_PRINTF(3, 0);
     151        void error(XMLErrors::ErrorType, const char* message, va_list args) WTF_ATTRIBUTE_PRINTF(3, 0);
    152152        void startElementNs(const xmlChar* xmlLocalName, const xmlChar* xmlPrefix, const xmlChar* xmlURI, int nb_namespaces,
    153153                            const xmlChar** namespaces, int nb_attributes, int nb_defaulted, const xmlChar** libxmlAttributes);
     
    208208        bool m_finishCalled;
    209209
    210         int m_errorCount;
    211         TextPosition1 m_lastErrorPosition;
    212         String m_errorMessages;
     210        XMLErrors m_xmlErrors;
    213211
    214212        CachedResourceHandle<CachedScript> m_pendingScript;
  • trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp

    r90269 r91008  
    173173    }
    174174
    175     void appendErrorCallback(XMLDocumentParser::ErrorType type, const xmlChar* message, int lineNumber, int columnNumber)
     175    void appendErrorCallback(XMLErrors::ErrorType type, const xmlChar* message, int lineNumber, int columnNumber)
    176176    {
    177177        OwnPtr<PendingErrorCallback> callback = adoptPtr(new PendingErrorCallback);
     
    329329        }
    330330
    331         XMLDocumentParser::ErrorType type;
     331        XMLErrors::ErrorType type;
    332332        xmlChar* message;
    333333        int lineNumber;
     
    563563    , m_requestingScript(false)
    564564    , m_finishCalled(false)
    565     , m_errorCount(0)
    566     , m_lastErrorPosition(TextPosition1::belowRangePosition())
     565    , m_xmlErrors(document)
    567566    , m_pendingScript(0)
    568567    , m_scriptStartPosition(TextPosition1::belowRangePosition())
     
    590589    , m_requestingScript(false)
    591590    , m_finishCalled(false)
    592     , m_errorCount(0)
    593     , m_lastErrorPosition(TextPosition1::belowRangePosition())
     591    , m_xmlErrors(fragment->document())
    594592    , m_pendingScript(0)
    595593    , m_scriptStartPosition(TextPosition1::belowRangePosition())
     
    676674    if (document()->decoder() && document()->decoder()->sawError()) {
    677675        // If the decoder saw an error, report it as fatal (stops parsing)
    678         handleError(fatal, "Encoding error", context->context()->input->line, context->context()->input->col);
     676        handleError(XMLErrors::fatal, "Encoding error", context->context()->input->line, context->context()->input->col);
    679677    }
    680678}
     
    936934}
    937935
    938 void XMLDocumentParser::error(ErrorType type, const char* message, va_list args)
     936void XMLDocumentParser::error(XMLErrors::ErrorType type, const char* message, va_list args)
    939937{
    940938    if (isStopped())
     
    11581156    va_list args;
    11591157    va_start(args, message);
    1160     getParser(closure)->error(XMLDocumentParser::warning, message, args);
     1158    getParser(closure)->error(XMLErrors::warning, message, args);
    11611159    va_end(args);
    11621160}
     
    11671165    va_list args;
    11681166    va_start(args, message);
    1169     getParser(closure)->error(XMLDocumentParser::fatal, message, args);
     1167    getParser(closure)->error(XMLErrors::fatal, message, args);
    11701168    va_end(args);
    11711169}
     
    11761174    va_list args;
    11771175    va_start(args, message);
    1178     getParser(closure)->error(XMLDocumentParser::nonFatal, message, args);
     1176    getParser(closure)->error(XMLErrors::nonFatal, message, args);
    11791177    va_end(args);
    11801178}
  • trunk/Source/WebCore/xml/parser/XMLDocumentParserQt.cpp

    r90269 r91008  
    102102    , m_requestingScript(false)
    103103    , m_finishCalled(false)
    104     , m_errorCount(0)
    105     , m_lastErrorPosition(TextPosition1::belowRangePosition())
     104    , m_xmlErrors(document)
    106105    , m_pendingScript(0)
    107106    , m_scriptStartPosition(TextPosition1::belowRangePosition())
     
    129128    , m_requestingScript(false)
    130129    , m_finishCalled(false)
    131     , m_errorCount(0)
    132     , m_lastErrorPosition(TextPosition1::belowRangePosition())
     130    , m_xmlErrors(fragment->document())
    133131    , m_pendingScript(0)
    134132    , m_scriptStartPosition(TextPosition1::belowRangePosition())
     
    186184    if (document()->decoder() && document()->decoder()->sawError()) {
    187185        // If the decoder saw an error, report it as fatal (stops parsing)
    188         handleError(fatal, "Encoding error", lineNumber(), columnNumber());
     186        handleError(XMLErrors::fatal, "Encoding error", lineNumber(), columnNumber());
    189187        return;
    190188    }
     
    226224    if (m_stream.error() == QXmlStreamReader::PrematureEndOfDocumentError
    227225        || (m_wroteText && !m_sawFirstElement && !m_sawXSLTransform && !m_sawError))
    228         handleError(fatal, qPrintable(m_stream.errorString()), lineNumber(), columnNumber());
     226        handleError(XMLErrors::fatal, qPrintable(m_stream.errorString()), lineNumber(), columnNumber());
    229227}
    230228
     
    383381#if ENABLE(XHTMLMP)
    384382            if (document()->isXHTMLMPDocument() && !m_hasDocTypeDeclaration) {
    385                 handleError(fatal, "DOCTYPE declaration lost.", lineNumber(), columnNumber());
     383                handleError(XMLErrors::fatal, "DOCTYPE declaration lost.", lineNumber(), columnNumber());
    386384                break;
    387385            }
     
    441439        default: {
    442440            if (m_stream.error() != QXmlStreamReader::PrematureEndOfDocumentError) {
    443                 ErrorType type = (m_stream.error() == QXmlStreamReader::NotWellFormedError) ?
    444                                  fatal : warning;
     441                XMLErrors::ErrorType type = (m_stream.error() == QXmlStreamReader::NotWellFormedError) ?
     442                                 XMLErrors::fatal : XMLErrors::warning;
    445443                handleError(type, qPrintable(m_stream.errorString()), lineNumber(),
    446444                            columnNumber());
     
    502500        // MUST be 'http://www.w3.org/1999/xhtml'
    503501        if (localName != HTMLNames::htmlTag.localName()) {
    504             handleError(fatal, "XHTMLMP document expects 'html' as root element.", lineNumber(), columnNumber());
     502            handleError(XMLErrors::fatal, "XHTMLMP document expects 'html' as root element.", lineNumber(), columnNumber());
    505503            return;
    506504        }
     
    706704             || (publicId == QLatin1String("-//WAPFORUM//DTD XHTML Mobile 1.0//EN"))) {
    707705        if (AtomicString(name) != HTMLNames::htmlTag.localName()) {
    708             handleError(fatal, "Invalid DOCTYPE declaration, expected 'html' as root element.", lineNumber(), columnNumber());
     706            handleError(XMLErrors::fatal, "Invalid DOCTYPE declaration, expected 'html' as root element.", lineNumber(), columnNumber());
    709707            return;
    710708        }
Note: See TracChangeset for help on using the changeset viewer.