Changeset 143407 in webkit


Ignore:
Timestamp:
Feb 19, 2013 4:35:51 PM (11 years ago)
Author:
tonyg@chromium.org
Message:

Disable ASSERT(!hasInsertionPoint()) for background parser
https://bugs.webkit.org/show_bug.cgi?id=110251

Reviewed by Adam Barth.

The background parser crashes about 10 layout tests by hitting ASSERT(!hasInsertionPoint()).
Now, finish() is the thing that closes the HTMLInputStream which removes the insertion point.
In these tests, a document.open() calls insert() which clears the HTMLInputStream which causes
there to be an insertion point again.

With the main thread parser, insert() is called before finish() so the ASSERT passes.
However, with the threaded parser, finish() is called before insert(), so we fail the ASSERT.

This patch disables the ASSERT for the background parser because m_input isn't really relevant.
This causes us to pass the tests. However, there is a risk that now hasInsertionPoint() may be incorrect
and Document has a non-debug branch that tests hasInsertionPoint().

No new tests because covered by existing tests.

  • html/parser/HTMLDocumentParser.cpp:

(WebCore::HTMLDocumentParser::prepareToStopParsing):
(WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143404 r143407  
     12013-02-19  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Disable ASSERT(!hasInsertionPoint()) for background parser
     4        https://bugs.webkit.org/show_bug.cgi?id=110251
     5
     6        Reviewed by Adam Barth.
     7
     8        The background parser crashes about 10 layout tests by hitting ASSERT(!hasInsertionPoint()).
     9        Now, finish() is the thing that closes the HTMLInputStream which removes the insertion point.
     10        In these tests, a document.open() calls insert() which clears the HTMLInputStream which causes
     11        there to be an insertion point again.
     12
     13        With the main thread parser, insert() is called before finish() so the ASSERT passes.
     14        However, with the threaded parser, finish() is called before insert(), so we fail the ASSERT.
     15
     16        This patch disables the ASSERT for the background parser because m_input isn't really relevant.
     17        This causes us to pass the tests. However, there is a risk that now hasInsertionPoint() may be incorrect
     18        and Document has a non-debug branch that tests hasInsertionPoint().
     19
     20        No new tests because covered by existing tests.
     21
     22        * html/parser/HTMLDocumentParser.cpp:
     23        (WebCore::HTMLDocumentParser::prepareToStopParsing):
     24        (WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd):
     25
    1262013-02-19  Simon Fraser  <simon.fraser@apple.com>
    227
  • trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp

    r143051 r143407  
    158158void HTMLDocumentParser::prepareToStopParsing()
    159159{
    160     ASSERT(!hasInsertionPoint());
     160    // FIXME: It may not be correct to disable this for the background parser.
     161    // That means hasInsertionPoint() may not be correct in some cases.
     162    ASSERT(!hasInsertionPoint() || m_haveBackgroundParser);
    161163
    162164    // pumpTokenizer can cause this parser to be detached from the Document,
     
    645647{
    646648    ASSERT(isStopping());
    647     ASSERT(!hasInsertionPoint());
     649    // FIXME: It may not be correct to disable this for the background parser.
     650    // That means hasInsertionPoint() may not be correct in some cases.
     651    ASSERT(!hasInsertionPoint() || m_haveBackgroundParser);
    648652    if (m_scriptRunner && !m_scriptRunner->executeScriptsWaitingForParsing())
    649653        return;
Note: See TracChangeset for help on using the changeset viewer.