Changeset 66660 in webkit


Ignore:
Timestamp:
Sep 2, 2010 4:43:30 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-09-02 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r66649.
http://trac.webkit.org/changeset/66649
https://bugs.webkit.org/show_bug.cgi?id=45103

It broke ~2000 tests on Qt bot (Requested by Ossy on #webkit).

  • fast/dom/HTMLScriptElement/defer-double-defer-write-expected.txt: Removed.
  • fast/dom/HTMLScriptElement/defer-double-defer-write.html: Removed.
  • fast/dom/HTMLScriptElement/defer-double-write-expected.txt: Removed.
  • fast/dom/HTMLScriptElement/defer-double-write.html: Removed.
  • fast/dom/HTMLScriptElement/defer-inline-script-expected.txt: Removed.
  • fast/dom/HTMLScriptElement/defer-inline-script.html: Removed.
  • fast/dom/HTMLScriptElement/defer-onbeforeload-expected.txt: Removed.
  • fast/dom/HTMLScriptElement/defer-onbeforeload.html: Removed.
  • fast/dom/HTMLScriptElement/defer-script-invalid-url-expected.txt: Removed.
  • fast/dom/HTMLScriptElement/defer-script-invalid-url.html: Removed.
  • fast/dom/HTMLScriptElement/defer-write-expected.txt: Removed.
  • fast/dom/HTMLScriptElement/defer-write.html: Removed.
  • fast/dom/HTMLScriptElement/resources/defer.js: Removed.
  • fast/dom/HTMLScriptElement/resources/external.js: Removed.
  • fast/dom/HTMLScriptElement/resources/shouldnotexecute.js: Removed.
  • fast/dom/HTMLScriptElement/shouldnotexecute.js: Removed.
  • fast/dom/HTMLScriptElement/two-defer-writes-expected.txt: Removed.
  • fast/dom/HTMLScriptElement/two-defer-writes.html: Removed.
  • http/tests/misc/resources/defer-script.js: Removed.
  • http/tests/misc/resources/external-script.js: Removed.
  • http/tests/misc/resources/script-debug-body-background.js: Removed.
  • http/tests/misc/resources/script-write-slow-stylesheet.js: Removed.
  • http/tests/misc/resources/slow-defer-script.cgi: Removed.
  • http/tests/misc/resources/slow-stylesheet.cgi: Removed.
  • http/tests/misc/script-defer-after-slow-stylesheet-expected.txt: Removed.
  • http/tests/misc/script-defer-after-slow-stylesheet.html: Removed.
  • http/tests/misc/script-defer-expected.txt: Removed.
  • http/tests/misc/script-defer.html: Removed.

2010-09-02 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r66649.
http://trac.webkit.org/changeset/66649
https://bugs.webkit.org/show_bug.cgi?id=45103

It broke ~2000 tests on Qt bot (Requested by Ossy on #webkit).

  • dom/Document.cpp: (WebCore::Document::open):
  • dom/DocumentParser.cpp: (WebCore::DocumentParser::DocumentParser): (WebCore::DocumentParser::detach):
  • dom/DocumentParser.h: (WebCore::DocumentParser::isDetached): (WebCore::DocumentParser::stopParsing):
  • dom/RawDataDocumentParser.h: (WebCore::RawDataDocumentParser::finish):
  • dom/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::append): (WebCore::XMLDocumentParser::exitText):
  • dom/XMLDocumentParserLibxml2.cpp: (WebCore::XMLDocumentParser::doWrite): (WebCore::XMLDocumentParser::startElementNs): (WebCore::XMLDocumentParser::endElementNs): (WebCore::XMLDocumentParser::characters): (WebCore::XMLDocumentParser::error): (WebCore::XMLDocumentParser::processingInstruction): (WebCore::XMLDocumentParser::cdataBlock): (WebCore::XMLDocumentParser::comment): (WebCore::XMLDocumentParser::internalSubset): (WebCore::XMLDocumentParser::initializeParserContext): (WebCore::XMLDocumentParser::doEnd):
  • dom/XMLDocumentParserQt.cpp: (WebCore::XMLDocumentParser::initializeParserContext): (WebCore::XMLDocumentParser::doEnd): (WebCore::XMLDocumentParser::parse):
  • html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::pumpTokenizerIfPossible): (WebCore::HTMLDocumentParser::pumpTokenizer): (WebCore::HTMLDocumentParser::insert): (WebCore::HTMLDocumentParser::append): (WebCore::HTMLDocumentParser::end): (WebCore::HTMLDocumentParser::attemptToEnd): (WebCore::HTMLDocumentParser::endIfDelayed): (WebCore::HTMLDocumentParser::notifyFinished):
  • html/parser/HTMLDocumentParser.h:
  • html/parser/HTMLScriptRunner.cpp: (WebCore::HTMLScriptRunner::~HTMLScriptRunner): (WebCore::HTMLScriptRunner::executeParsingBlockingScript): (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): (WebCore::HTMLScriptRunner::runScript):
  • html/parser/HTMLScriptRunner.h:
  • loader/ImageDocument.cpp: (WebCore::ImageDocumentParser::finish):
Location:
trunk
Files:
28 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66656 r66660  
     12010-09-02  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r66649.
     4        http://trac.webkit.org/changeset/66649
     5        https://bugs.webkit.org/show_bug.cgi?id=45103
     6
     7        It broke ~2000 tests on Qt bot (Requested by Ossy on #webkit).
     8
     9        * fast/dom/HTMLScriptElement/defer-double-defer-write-expected.txt: Removed.
     10        * fast/dom/HTMLScriptElement/defer-double-defer-write.html: Removed.
     11        * fast/dom/HTMLScriptElement/defer-double-write-expected.txt: Removed.
     12        * fast/dom/HTMLScriptElement/defer-double-write.html: Removed.
     13        * fast/dom/HTMLScriptElement/defer-inline-script-expected.txt: Removed.
     14        * fast/dom/HTMLScriptElement/defer-inline-script.html: Removed.
     15        * fast/dom/HTMLScriptElement/defer-onbeforeload-expected.txt: Removed.
     16        * fast/dom/HTMLScriptElement/defer-onbeforeload.html: Removed.
     17        * fast/dom/HTMLScriptElement/defer-script-invalid-url-expected.txt: Removed.
     18        * fast/dom/HTMLScriptElement/defer-script-invalid-url.html: Removed.
     19        * fast/dom/HTMLScriptElement/defer-write-expected.txt: Removed.
     20        * fast/dom/HTMLScriptElement/defer-write.html: Removed.
     21        * fast/dom/HTMLScriptElement/resources/defer.js: Removed.
     22        * fast/dom/HTMLScriptElement/resources/external.js: Removed.
     23        * fast/dom/HTMLScriptElement/resources/shouldnotexecute.js: Removed.
     24        * fast/dom/HTMLScriptElement/shouldnotexecute.js: Removed.
     25        * fast/dom/HTMLScriptElement/two-defer-writes-expected.txt: Removed.
     26        * fast/dom/HTMLScriptElement/two-defer-writes.html: Removed.
     27        * http/tests/misc/resources/defer-script.js: Removed.
     28        * http/tests/misc/resources/external-script.js: Removed.
     29        * http/tests/misc/resources/script-debug-body-background.js: Removed.
     30        * http/tests/misc/resources/script-write-slow-stylesheet.js: Removed.
     31        * http/tests/misc/resources/slow-defer-script.cgi: Removed.
     32        * http/tests/misc/resources/slow-stylesheet.cgi: Removed.
     33        * http/tests/misc/script-defer-after-slow-stylesheet-expected.txt: Removed.
     34        * http/tests/misc/script-defer-after-slow-stylesheet.html: Removed.
     35        * http/tests/misc/script-defer-expected.txt: Removed.
     36        * http/tests/misc/script-defer.html: Removed.
     37
    1382010-09-02  Andreas Kling  <andreas.kling@nokia.com>
    239
  • trunk/WebCore/ChangeLog

    r66659 r66660  
     12010-09-02  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r66649.
     4        http://trac.webkit.org/changeset/66649
     5        https://bugs.webkit.org/show_bug.cgi?id=45103
     6
     7        It broke ~2000 tests on Qt bot (Requested by Ossy on #webkit).
     8
     9        * dom/Document.cpp:
     10        (WebCore::Document::open):
     11        * dom/DocumentParser.cpp:
     12        (WebCore::DocumentParser::DocumentParser):
     13        (WebCore::DocumentParser::detach):
     14        * dom/DocumentParser.h:
     15        (WebCore::DocumentParser::isDetached):
     16        (WebCore::DocumentParser::stopParsing):
     17        * dom/RawDataDocumentParser.h:
     18        (WebCore::RawDataDocumentParser::finish):
     19        * dom/XMLDocumentParser.cpp:
     20        (WebCore::XMLDocumentParser::append):
     21        (WebCore::XMLDocumentParser::exitText):
     22        * dom/XMLDocumentParserLibxml2.cpp:
     23        (WebCore::XMLDocumentParser::doWrite):
     24        (WebCore::XMLDocumentParser::startElementNs):
     25        (WebCore::XMLDocumentParser::endElementNs):
     26        (WebCore::XMLDocumentParser::characters):
     27        (WebCore::XMLDocumentParser::error):
     28        (WebCore::XMLDocumentParser::processingInstruction):
     29        (WebCore::XMLDocumentParser::cdataBlock):
     30        (WebCore::XMLDocumentParser::comment):
     31        (WebCore::XMLDocumentParser::internalSubset):
     32        (WebCore::XMLDocumentParser::initializeParserContext):
     33        (WebCore::XMLDocumentParser::doEnd):
     34        * dom/XMLDocumentParserQt.cpp:
     35        (WebCore::XMLDocumentParser::initializeParserContext):
     36        (WebCore::XMLDocumentParser::doEnd):
     37        (WebCore::XMLDocumentParser::parse):
     38        * html/parser/HTMLDocumentParser.cpp:
     39        (WebCore::HTMLDocumentParser::pumpTokenizerIfPossible):
     40        (WebCore::HTMLDocumentParser::pumpTokenizer):
     41        (WebCore::HTMLDocumentParser::insert):
     42        (WebCore::HTMLDocumentParser::append):
     43        (WebCore::HTMLDocumentParser::end):
     44        (WebCore::HTMLDocumentParser::attemptToEnd):
     45        (WebCore::HTMLDocumentParser::endIfDelayed):
     46        (WebCore::HTMLDocumentParser::notifyFinished):
     47        * html/parser/HTMLDocumentParser.h:
     48        * html/parser/HTMLScriptRunner.cpp:
     49        (WebCore::HTMLScriptRunner::~HTMLScriptRunner):
     50        (WebCore::HTMLScriptRunner::executeParsingBlockingScript):
     51        (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
     52        (WebCore::HTMLScriptRunner::runScript):
     53        * html/parser/HTMLScriptRunner.h:
     54        * loader/ImageDocument.cpp:
     55        (WebCore::ImageDocumentParser::finish):
     56
    1572010-09-02  Eric Seidel  <eric@webkit.org>
    258
  • trunk/WebCore/dom/Document.cpp

    r66649 r66660  
    18241824    if (m_frame) {
    18251825        ScriptableDocumentParser* parser = scriptableDocumentParser();
    1826         if (m_frame->loader()->isLoadingMainResource() || (parser && parser->isParsing() && parser->isExecutingScript()))
     1826        if (m_frame->loader()->isLoadingMainResource() || (parser && parser->isExecutingScript()))
    18271827            return;
    18281828
  • trunk/WebCore/dom/DocumentParser.cpp

    r66649 r66660  
    3232
    3333DocumentParser::DocumentParser(Document* document)
    34     : m_state(ParsingState)
     34    : m_parserStopped(false)
    3535    , m_document(document)
    3636{
     
    4646}
    4747
    48 void DocumentParser::startParsing()
    49 {
    50     m_state = ParsingState;
    51 }
    52 
    53 void DocumentParser::prepareToStopParsing()
    54 {
    55     if (m_state == ParsingState)
    56         m_state = StoppingState;
    57 }
    58 
    59 void DocumentParser::stopParsing()
    60 {
    61     m_state = StoppedState;
    62 }
    63 
    6448void DocumentParser::detach()
    6549{
    66     m_state = DetachedState;
    6750    m_document = 0;
    6851}
  • trunk/WebCore/dom/DocumentParser.h

    r66649 r66660  
    5858    // FIXME: processingData() is only used by DocumentLoader::isLoadingInAPISense
    5959    // and is very unclear as to what it actually means.  The LegacyHTMLDocumentParser
    60     // used to implement it.
     60    // used to implements it.
    6161    virtual bool processingData() const { return false; }
    6262
    6363    // document() will return 0 after detach() is called.
    6464    Document* document() const { ASSERT(m_document); return m_document; }
    65 
    66     bool isParsing() const { return m_state == ParsingState; }
    67     bool isStopping() const { return m_state == StoppingState; }
    68     bool isStopped() const { return m_state >= StoppedState; }
    69     bool isDetached() const { return m_state == DetachedState; }
    70 
    71     // FIXME: Is this necessary? Does XMLDocumentParserLibxml2 really need to set this?
    72     virtual void startParsing();
    73 
    74     // prepareToStop() is used when the EOF token is encountered and parsing is to be
    75     // stopped normally.
    76     virtual void prepareToStopParsing();
    77 
    78     // stopParsing() is used when a load is canceled/stopped.
    79     // stopParsing() is currently different from detach(), but shouldn't be.
    80     // It should NOT be ok to call any methods on DocumentParser after either
    81     // detach() or stopParsing() but right now only detach() will ASSERT.
    82     virtual void stopParsing();
     65    bool isDetached() const { return !m_document; }
    8366
    8467    // Document is expected to detach the parser before releasing its ref.
     
    8972    virtual void detach();
    9073
     74    // stopParsing() is used when a load is canceled/stopped.
     75    // stopParsing() is currently different from detach(), but shouldn't be.
     76    // It should NOT be ok to call any methods on DocumentParser after either
     77    // detach() or stopParsing() but right now only detach() will ASSERT.
     78    virtual void stopParsing() { m_parserStopped = true; }
     79
    9180protected:
    9281    DocumentParser(Document*);
    9382
     83    // The parser has buffers, so parsing may continue even after
     84    // it stops receiving data. We use m_parserStopped to stop the parser
     85    // even when it has buffered data.
     86    // FIXME: m_document = 0 could be changed to mean "parser stopped".
     87    bool m_parserStopped;
     88
    9489private:
    95     enum ParserState {
    96         ParsingState,
    97         StoppingState,
    98         StoppedState,
    99         DetachedState
    100     };
    101     ParserState m_state;
    102 
    10390    // Every DocumentParser needs a pointer back to the document.
    10491    // m_document will be 0 after the parser is stopped.
  • trunk/WebCore/dom/RawDataDocumentParser.h

    r66649 r66660  
    4040    virtual void finish()
    4141    {
    42         if (!isStopped())
     42        if (!m_parserStopped && !isDetached())
    4343            document()->finishedParsing();
    4444    }
  • trunk/WebCore/dom/XMLDocumentParser.cpp

    r66649 r66660  
    133133        m_originalSourceForTransform += parseString;
    134134
    135     if (isStopped() || m_sawXSLTransform)
     135    if (isDetached() || m_parserStopped || m_sawXSLTransform)
    136136        return;
    137137
     
    191191void XMLDocumentParser::exitText()
    192192{
    193     if (isStopped())
     193    if (m_parserStopped)
    194194        return;
    195195
  • trunk/WebCore/dom/XMLDocumentParserLibxml2.cpp

    r66649 r66660  
    661661        // JavaScript (which may be run under the xmlParseChunk callstack) may
    662662        // cause the parser to be stopped or detached.
    663         if (isStopped())
     663        if (isDetached() || m_parserStopped)
    664664            return;
    665665    }
     
    734734                                  const xmlChar** libxmlNamespaces, int nb_attributes, int nb_defaulted, const xmlChar** libxmlAttributes)
    735735{
    736     if (isStopped())
     736    if (m_parserStopped)
    737737        return;
    738738
     
    823823void XMLDocumentParser::endElementNs()
    824824{
    825     if (isStopped())
     825    if (m_parserStopped)
    826826        return;
    827827
     
    907907void XMLDocumentParser::characters(const xmlChar* s, int len)
    908908{
    909     if (isStopped())
     909    if (m_parserStopped)
    910910        return;
    911911
     
    922922void XMLDocumentParser::error(ErrorType type, const char* message, va_list args)
    923923{
    924     if (isStopped())
     924    if (m_parserStopped)
    925925        return;
    926926
     
    946946void XMLDocumentParser::processingInstruction(const xmlChar* target, const xmlChar* data)
    947947{
    948     if (isStopped())
     948    if (m_parserStopped)
    949949        return;
    950950
     
    980980void XMLDocumentParser::cdataBlock(const xmlChar* s, int len)
    981981{
    982     if (isStopped())
     982    if (m_parserStopped)
    983983        return;
    984984
     
    998998void XMLDocumentParser::comment(const xmlChar* s)
    999999{
    1000     if (isStopped())
     1000    if (m_parserStopped)
    10011001        return;
    10021002
     
    10351035void XMLDocumentParser::internalSubset(const xmlChar* name, const xmlChar* externalID, const xmlChar* systemID)
    10361036{
    1037     if (isStopped())
     1037    if (m_parserStopped)
    10381038        return;
    10391039
     
    12951295    sax.entityDecl = xmlSAX2EntityDecl;
    12961296    sax.initialized = XML_SAX2_MAGIC;
    1297     DocumentParser::startParsing();
     1297    m_parserStopped = false;
    12981298    m_sawError = false;
    12991299    m_sawXSLTransform = false;
     
    13191319        document()->styleSelectorChanged(RecalcStyleImmediately);
    13201320        document()->setParsing(true);
    1321         DocumentParser::stopParsing();
    1322     }
    1323 #endif
    1324 
    1325     if (isStopped())
     1321        m_parserStopped = true;
     1322    }
     1323#endif
     1324
     1325    if (m_parserStopped)
    13261326        return;
    13271327
  • trunk/WebCore/dom/XMLDocumentParserQt.cpp

    r66649 r66660  
    200200void XMLDocumentParser::initializeParserContext(const char*)
    201201{
    202     DocumentParser::stopParsing();
     202    m_parserStopped = false;
    203203    m_sawError = false;
    204204    m_sawXSLTransform = false;
     
    214214        document()->styleSelectorChanged(RecalcStyleImmediately);
    215215        document()->setParsing(true);
    216         DocumentParser::startParsing();
     216        m_parserStopped = true;
    217217    }
    218218#endif
     
    351351void XMLDocumentParser::parse()
    352352{
    353     while (!isStopped() && !m_parserPaused && !m_stream.atEnd()) {
     353    while (!m_parserStopped && !m_parserPaused && !m_stream.atEnd()) {
    354354        m_stream.readNext();
    355355        switch (m_stream.tokenType()) {
  • trunk/WebCore/html/parser/HTMLDocumentParser.cpp

    r66649 r66660  
    143143}
    144144
    145 // This kicks off "Once the user agent stops parsing" as described by:
    146 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#the-end
    147 void HTMLDocumentParser::prepareToStopParsing()
    148 {
    149     ASSERT(!hasInsertionPoint());
    150 
    151     // pumpTokenizer can cause this parser to be detached from the Document,
    152     // but we need to ensure it isn't deleted yet.
    153     RefPtr<HTMLDocumentParser> protect(this);
    154 
    155     // FIXME: Set the current document readiness to "interactive".
    156 
    157     // NOTE: This pump should only ever emit buffered character tokens,
    158     // so ForceSynchronous vs. AllowYield should be meaningless.
    159     pumpTokenizerIfPossible(ForceSynchronous);
    160 
    161     DocumentParser::prepareToStopParsing();
    162     if (m_scriptRunner && !m_scriptRunner->executeScriptsWaitingForParsing())
    163         return;
    164     end();
    165 }
    166 
    167145bool HTMLDocumentParser::processingData() const
    168146{
     
    172150void HTMLDocumentParser::pumpTokenizerIfPossible(SynchronousMode mode)
    173151{
    174     if (isStopped() || m_treeBuilder->isPaused())
     152    if (m_parserStopped || m_treeBuilder->isPaused())
    175153        return;
    176154
     
    216194void HTMLDocumentParser::pumpTokenizer(SynchronousMode mode)
    217195{
    218     ASSERT(!isStopped());
     196    ASSERT(!isDetached());
     197    ASSERT(!m_parserStopped);
    219198    ASSERT(!m_treeBuilder->isPaused());
    220199    ASSERT(!isScheduledForResume());
     
    236215
    237216        // JavaScript may have stopped or detached the parser.
    238         if (isStopped())
     217        if (isDetached() || m_parserStopped)
    239218            return;
    240219
     
    248227
    249228        // JavaScript may have stopped or detached the parser.
    250         if (isStopped())
     229        if (isDetached() || m_parserStopped)
    251230            return;
    252231
     
    297276void HTMLDocumentParser::insert(const SegmentedString& source)
    298277{
    299     if (isStopped())
     278    if (m_parserStopped)
    300279        return;
    301280
     
    318297void HTMLDocumentParser::append(const SegmentedString& source)
    319298{
    320     if (isStopped())
     299    if (m_parserStopped)
    321300        return;
    322301
     
    350329    ASSERT(!isScheduledForResume());
    351330
     331    // pumpTokenizer can cause this parser to be detached from the Document,
     332    // but we need to ensure it isn't deleted yet.
     333    RefPtr<HTMLDocumentParser> protect(this);
     334
     335    // NOTE: This pump should only ever emit buffered character tokens,
     336    // so ForceSynchronous vs. AllowYield should be meaningless.
     337    pumpTokenizerIfPossible(ForceSynchronous);
     338
    352339    // Informs the the rest of WebCore that parsing is really finished (and deletes this).
    353340    m_treeBuilder->finished();
     
    363350        return;
    364351    }
    365     prepareToStopParsing();
     352    end();
    366353}
    367354
     
    376363
    377364    m_endWasDelayed = false;
    378     prepareToStopParsing();
     365    end();
    379366}
    380367
     
    461448void HTMLDocumentParser::notifyFinished(CachedResource* cachedResource)
    462449{
    463     if (isStopping()) {
    464         prepareToStopParsing();
    465         return;
    466     }
    467 
    468450    // pumpTokenizer can cause this parser to be detached from the Document,
    469451    // but we need to ensure it isn't deleted yet.
  • trunk/WebCore/html/parser/HTMLDocumentParser.h

    r66649 r66660  
    8282    virtual bool finishWasCalled();
    8383    virtual bool processingData() const;
    84     virtual void prepareToStopParsing();
    8584    virtual void stopParsing();
    8685    virtual bool isWaitingForScripts() const;
  • trunk/WebCore/html/parser/HTMLScriptRunner.cpp

    r66649 r66660  
    7676    if (m_parsingBlockingScript.cachedScript() && m_parsingBlockingScript.watchingForLoad())
    7777        stopWatchingForLoad(m_parsingBlockingScript);
    78 
    79     while (!m_scriptsToExecuteAfterParsing.isEmpty()) {
    80         PendingScript pendingScript = m_scriptsToExecuteAfterParsing.takeFirst();
    81         if (pendingScript.cachedScript() && pendingScript.watchingForLoad())
    82             stopWatchingForLoad(pendingScript);
    83     }
    8478}
    8579
     
    136130    ASSERT(isPendingScriptReady(m_parsingBlockingScript));
    137131
     132    // Stop watching loads before executeScript to prevent recursion if the script reloads itself.
     133    if (m_parsingBlockingScript.cachedScript() && m_parsingBlockingScript.watchingForLoad())
     134        stopWatchingForLoad(m_parsingBlockingScript);
     135
    138136    InsertionPointRecord insertionPointRecord(m_host->inputStream());
    139137    executePendingScriptAndDispatchEvent(m_parsingBlockingScript);
     
    144142    bool errorOccurred = false;
    145143    ScriptSourceCode sourceCode = sourceFromPendingScript(pendingScript, errorOccurred);
    146 
    147     // Stop watching loads before executeScript to prevent recursion if the script reloads itself.
    148     if (pendingScript.cachedScript() && pendingScript.watchingForLoad())
    149         stopWatchingForLoad(pendingScript);
    150144
    151145    // Clear the pending script before possible rentrancy from executeScript()
     
    245239}
    246240
    247 bool HTMLScriptRunner::executeScriptsWaitingForParsing()
    248 {
    249     while (!m_scriptsToExecuteAfterParsing.isEmpty()) {
    250         ASSERT(!m_scriptNestingLevel);
    251         ASSERT(!haveParsingBlockingScript());
    252         ASSERT(m_scriptsToExecuteAfterParsing.first().cachedScript());
    253         if (!m_scriptsToExecuteAfterParsing.first().cachedScript()->isLoaded()) {
    254             watchForLoad(m_scriptsToExecuteAfterParsing.first());
    255             return false;
    256         }
    257         PendingScript first = m_scriptsToExecuteAfterParsing.takeFirst();
    258         executePendingScriptAndDispatchEvent(first);
    259         if (!m_document)
    260             return false;
    261     }
    262     return true;
    263 }
    264 
    265241void HTMLScriptRunner::requestParsingBlockingScript(Element* element)
    266242{
     
    277253}
    278254
    279 void HTMLScriptRunner::requestDeferredScript(Element* element)
    280 {
    281     PendingScript pendingScript;
    282     if (!requestPendingScript(pendingScript, element))
    283         return;
    284 
    285     ASSERT(pendingScript.cachedScript());
    286     m_scriptsToExecuteAfterParsing.append(pendingScript);
    287 }
    288 
    289255bool HTMLScriptRunner::requestPendingScript(PendingScript& pendingScript, Element* script) const
    290256{
     
    322288
    323289        if (script->hasAttribute(srcAttr)) {
    324             // FIXME: Handle async.
    325             if (script->hasAttribute(deferAttr))
    326                 requestDeferredScript(script);
    327             else
    328                 requestParsingBlockingScript(script);
     290            // FIXME: Handle defer and async
     291            requestParsingBlockingScript(script);
    329292        } else {
    330293            // FIXME: We do not block inline <script> tags on stylesheets to match the
  • trunk/WebCore/html/parser/HTMLScriptRunner.h

    r66649 r66660  
    2828
    2929#include "PendingScript.h"
    30 #include <wtf/Deque.h>
    3130#include <wtf/Noncopyable.h>
    3231#include <wtf/PassRefPtr.h>
     
    5857    bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; }
    5958    bool executeScriptsWaitingForStylesheets();
    60     bool executeScriptsWaitingForParsing();
    6159
    6260    bool isExecutingScript() const { return !!m_scriptNestingLevel; }
     
    7472
    7573    void requestParsingBlockingScript(Element*);
    76     void requestDeferredScript(Element*);
    7774    bool requestPendingScript(PendingScript&, Element*) const;
    7875
     
    8885    HTMLScriptRunnerHost* m_host;
    8986    PendingScript m_parsingBlockingScript;
    90     Deque<PendingScript> m_scriptsToExecuteAfterParsing; // http://www.whatwg.org/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing
    9187    unsigned m_scriptNestingLevel;
    9288
  • trunk/WebCore/loader/ImageDocument.cpp

    r66649 r66660  
    139139void ImageDocumentParser::finish()
    140140{
    141     if (!isStopped() && document()->imageElement()) {
     141    if (!m_parserStopped && document()->imageElement()) {
    142142        CachedImage* cachedImage = document()->cachedImage();
    143143        RefPtr<SharedBuffer> data = document()->frame()->loader()->documentLoader()->mainResourceData();
Note: See TracChangeset for help on using the changeset viewer.