Changeset 64023 in webkit


Ignore:
Timestamp:
Jul 25, 2010 2:36:32 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-07-25 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Functions supporting the legacy tree builder are confusing
https://bugs.webkit.org/show_bug.cgi?id=42951

This patch just inlines these functions into their one call site and
removes the notImplemented() calls. We thought we were going to grow
these to support the new tree builder, but we took a different path.
Previous to this patch, these functions were confusing because they
looked like part of the new tree builder.

  • html/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::passTokenToLegacyParser):
  • html/HTMLTreeBuilder.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64022 r64023  
     12010-07-25  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Functions supporting the legacy tree builder are confusing
     6        https://bugs.webkit.org/show_bug.cgi?id=42951
     7
     8        This patch just inlines these functions into their one call site and
     9        removes the notImplemented() calls.  We thought we were going to grow
     10        these to support the new tree builder, but we took a different path.
     11        Previous to this patch, these functions were confusing because they
     12        looked like part of the new tree builder.
     13
     14        * html/HTMLTreeBuilder.cpp:
     15        (WebCore::HTMLTreeBuilder::passTokenToLegacyParser):
     16        * html/HTMLTreeBuilder.h:
     17
    1182010-07-25  Adam Barth  <abarth@webkit.org>
    219
  • trunk/WebCore/html/HTMLTreeBuilder.cpp

    r64018 r64023  
    393393}
    394394
    395 void HTMLTreeBuilder::handleScriptStartTag()
    396 {
    397     notImplemented(); // The HTML frgment case?
    398     m_tokenizer->setState(HTMLTokenizer::ScriptDataState);
    399     notImplemented(); // Save insertion mode.
    400 }
    401 
    402 void HTMLTreeBuilder::handleScriptEndTag(Element* scriptElement, int scriptStartLine)
    403 {
    404     ASSERT(!m_scriptToProcess); // Caller never called takeScriptToProcess!
    405     ASSERT(m_scriptToProcessStartLine == uninitializedLineNumberValue); // Caller never called takeScriptToProcess!
    406     notImplemented(); // Save insertion mode and insertion point?
    407 
    408     // Pause ourselves so that parsing stops until the script can be processed by the caller.
    409     m_isPaused = true;
    410     m_scriptToProcess = scriptElement;
    411     // Lexer line numbers are 0-based, ScriptSourceCode expects 1-based lines,
    412     // so we convert here before passing the line number off to HTMLScriptRunner.
    413     m_scriptToProcessStartLine = scriptStartLine + 1;
    414 }
    415 
    416395PassRefPtr<Element> HTMLTreeBuilder::takeScriptToProcess(int& scriptStartLine)
    417396{
     
    471450        // when using the old parser for we have to do this manually.
    472451        if (oldStyleToken.tagName == scriptTag) {
    473             handleScriptStartTag();
     452            m_tokenizer->setState(HTMLTokenizer::ScriptDataState);
    474453            m_lastScriptElement = static_pointer_cast<Element>(result);
    475454            m_lastScriptElementStartLine = m_tokenizer->lineNumber();
     
    488467                    // does not show up in pasted HTML.
    489468                    m_lastScriptElement->removeChildren();
    490                 } else if (insertionMode() != AfterFramesetMode)
    491                     handleScriptEndTag(m_lastScriptElement.get(), m_lastScriptElementStartLine);
     469                } else if (insertionMode() != AfterFramesetMode) {
     470                    ASSERT(!m_scriptToProcess); // Caller never called takeScriptToProcess!
     471                    ASSERT(m_scriptToProcessStartLine == uninitializedLineNumberValue); // Caller never called takeScriptToProcess!
     472                    // Pause ourselves so that parsing stops until the script can be processed by the caller.
     473                    m_isPaused = true;
     474                    m_scriptToProcess = m_lastScriptElement.get();
     475                    // Lexer line numbers are 0-based, ScriptSourceCode expects 1-based lines,
     476                    // so we convert here before passing the line number off to HTMLScriptRunner.
     477                    m_scriptToProcessStartLine = m_lastScriptElementStartLine + 1;
     478                }
    492479                m_lastScriptElement = 0;
    493480                m_lastScriptElementStartLine = uninitializedLineNumberValue;
  • trunk/WebCore/html/HTMLTreeBuilder.h

    r63868 r64023  
    174174    void parseError(AtomicHTMLToken&) { }
    175175
    176     void handleScriptStartTag();
    177     void handleScriptEndTag(Element*, int scriptStartLine);
    178 
    179176    InsertionMode insertionMode() const { return m_insertionMode; }
    180177    void setInsertionMode(InsertionMode mode)
Note: See TracChangeset for help on using the changeset viewer.