Changeset 78127 in webkit


Ignore:
Timestamp:
Feb 9, 2011 1:53:57 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-02-09 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

REGRESSION(HTML 5): HTMLDocumentParser does not report html parse errors to the console
https://bugs.webkit.org/show_bug.cgi?id=41187

Wire up a basic HTML parse error message. There's a lot of room for
improvement in this area, but this is a start.

No tests! See https://bugs.webkit.org/show_bug.cgi?id=54134

  • html/parser/HTMLDocumentParser.h:
  • html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::parseError):
  • html/parser/HTMLTreeBuilder.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r78103 r78127  
     12011-02-09  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        REGRESSION(HTML 5): HTMLDocumentParser does not report html parse errors to the console
     6        https://bugs.webkit.org/show_bug.cgi?id=41187
     7
     8        Wire up a basic HTML parse error message.  There's a lot of room for
     9        improvement in this area, but this is a start.
     10
     11        No tests!  See https://bugs.webkit.org/show_bug.cgi?id=54134
     12
     13        * html/parser/HTMLDocumentParser.h:
     14        * html/parser/HTMLTreeBuilder.cpp:
     15        (WebCore::HTMLTreeBuilder::parseError):
     16        * html/parser/HTMLTreeBuilder.h:
     17
    1182011-02-09  Naoki Takano  <takano.naoki@gmail.com>
    219
  • trunk/Source/WebCore/html/parser/HTMLDocumentParser.h

    r76980 r78127  
    7777
    7878    virtual TextPosition0 textPosition() const;
     79    virtual int lineNumber() const;
     80
    7981    virtual void suspendScheduledTasks();
    8082    virtual void resumeScheduledTasks();
     
    101103    virtual bool isExecutingScript() const;
    102104    virtual void executeScriptsWaitingForStylesheets();
    103     virtual int lineNumber() const;
    104105
    105106    // HTMLScriptRunnerHost
  • trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp

    r77062 r78127  
    2828
    2929#include "Comment.h"
     30#include "DOMWindow.h"
    3031#include "DocumentFragment.h"
    3132#include "DocumentType.h"
     
    28082809}
    28092810
     2811void HTMLTreeBuilder::parseError(AtomicHTMLToken&)
     2812{
     2813    DEFINE_STATIC_LOCAL(String, parseErrorMessage, ("HTML parse error (recovered gracefully)"));
     2814
     2815    if (!m_reportErrors)
     2816        return;
     2817
     2818    DOMWindow* domWindow = m_document->domWindow();
     2819    if (!domWindow)
     2820        return;
     2821
     2822    domWindow->console()->addMessage(HTMLMessageSource, LogMessageType, WarningMessageLevel, parseErrorMessage, m_parser->lineNumber(), m_document->url().string());
     2823}
     2824
    28102825bool HTMLTreeBuilder::scriptEnabled(Frame* frame)
    28112826{
  • trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h

    r77053 r78127  
    184184    bool m_framesetOk;
    185185
    186     // FIXME: Implement error reporting.
    187     void parseError(AtomicHTMLToken&) { }
     186    void parseError(AtomicHTMLToken&);
    188187
    189188    InsertionMode insertionMode() const { return m_insertionMode; }
Note: See TracChangeset for help on using the changeset viewer.