Changeset 61470 in webkit


Ignore:
Timestamp:
Jun 19, 2010 12:26:25 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-19 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Eric Seidel.

Some very minor cleanups for HTML5 Parser
https://bugs.webkit.org/show_bug.cgi?id=40638

No new tests because no new functionality.

  • html/HTML5DocumentParser.cpp: (WebCore::): Make ctor explicit.
  • html/HTML5DocumentParser.h: (WebCore::HTML5DocumentParser::InsertionPointRecord::InsertionPointRecord): Make ctor explicit.
  • html/HTML5Lexer.cpp: (WebCore::HTMLNames::isEndTagBufferingState): Use switch to generate an efficient table with single branch.
  • html/HTML5Token.h: (WebCore::HTML5Token::forceQuirks): Add const.
  • html/HTML5TreeBuilder.h: (WebCore::HTML5TreeBuilder::isPaused): Add const.
Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r61468 r61470  
     12010-06-19  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Some very minor cleanups for HTML5 Parser
     6        https://bugs.webkit.org/show_bug.cgi?id=40638
     7
     8        No new tests because no new functionality.
     9
     10        * html/HTML5DocumentParser.cpp:
     11        (WebCore::): Make ctor explicit.
     12        * html/HTML5DocumentParser.h:
     13        (WebCore::HTML5DocumentParser::InsertionPointRecord::InsertionPointRecord): Make ctor explicit.
     14        * html/HTML5Lexer.cpp:
     15        (WebCore::HTMLNames::isEndTagBufferingState): Use switch to generate an efficient table with single branch.
     16        * html/HTML5Token.h:
     17        (WebCore::HTML5Token::forceQuirks): Add const.
     18        * html/HTML5TreeBuilder.h:
     19        (WebCore::HTML5TreeBuilder::isPaused): Add const.
     20
    1212010-06-18  Aaron Boodman  <aa@chromium.org>
    222
  • trunk/WebCore/html/HTML5DocumentParser.cpp

    r61374 r61470  
    6060class NestingLevelIncrementer : public Noncopyable {
    6161public:
    62     NestingLevelIncrementer(int& counter)
     62    explicit NestingLevelIncrementer(int& counter)
    6363        : m_counter(&counter)
    6464    {
  • trunk/WebCore/html/HTML5DocumentParser.h

    r61374 r61470  
    152152    class InsertionPointRecord {
    153153    public:
    154         InsertionPointRecord(InputStream& inputStream)
     154        explicit InsertionPointRecord(InputStream& inputStream)
    155155            : m_inputStream(&inputStream)
    156156        {
  • trunk/WebCore/html/HTML5Lexer.cpp

    r61280 r61470  
    7272inline bool isEndTagBufferingState(HTML5Lexer::State state)
    7373{
    74     return state == HTML5Lexer::RCDATAEndTagOpenState
    75         || state == HTML5Lexer::RCDATAEndTagNameState
    76         || state == HTML5Lexer::RAWTEXTEndTagOpenState
    77         || state == HTML5Lexer::RAWTEXTEndTagNameState
    78         || state == HTML5Lexer::ScriptDataEndTagOpenState
    79         || state == HTML5Lexer::ScriptDataEndTagNameState
    80         || state == HTML5Lexer::ScriptDataEscapedEndTagOpenState
    81         || state == HTML5Lexer::ScriptDataEscapedEndTagNameState;
     74    switch (state) {
     75    case HTML5Lexer::RCDATAEndTagOpenState:
     76    case HTML5Lexer::RCDATAEndTagNameState:
     77    case HTML5Lexer::RAWTEXTEndTagOpenState:
     78    case HTML5Lexer::RAWTEXTEndTagNameState:
     79    case HTML5Lexer::ScriptDataEndTagOpenState:
     80    case HTML5Lexer::ScriptDataEndTagNameState:
     81    case HTML5Lexer::ScriptDataEscapedEndTagOpenState:
     82    case HTML5Lexer::ScriptDataEscapedEndTagNameState:
     83        return true;
     84    default:
     85        return false;
     86    }
    8287}
    8388
  • trunk/WebCore/html/HTML5Token.h

    r61161 r61470  
    213213    }
    214214
    215     bool forceQuirks()
     215    bool forceQuirks() const
    216216    {
    217217        ASSERT(m_type == DOCTYPE);
  • trunk/WebCore/html/HTML5TreeBuilder.h

    r61372 r61470  
    5050
    5151    void setPaused(bool paused) { m_isPaused = paused; }
    52     bool isPaused() { return m_isPaused; }
     52    bool isPaused() const { return m_isPaused; }
    5353
    5454    // The token really should be passed as a const& since it's never modified.
Note: See TracChangeset for help on using the changeset viewer.