Changeset 66660 in webkit
- Timestamp:
- Sep 2, 2010 4:43:30 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 28 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r66656 r66660 1 2010-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 1 38 2010-09-02 Andreas Kling <andreas.kling@nokia.com> 2 39 -
trunk/WebCore/ChangeLog
r66659 r66660 1 2010-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 1 57 2010-09-02 Eric Seidel <eric@webkit.org> 2 58 -
trunk/WebCore/dom/Document.cpp
r66649 r66660 1824 1824 if (m_frame) { 1825 1825 ScriptableDocumentParser* parser = scriptableDocumentParser(); 1826 if (m_frame->loader()->isLoadingMainResource() || (parser && parser->is Parsing() && parser->isExecutingScript()))1826 if (m_frame->loader()->isLoadingMainResource() || (parser && parser->isExecutingScript())) 1827 1827 return; 1828 1828 -
trunk/WebCore/dom/DocumentParser.cpp
r66649 r66660 32 32 33 33 DocumentParser::DocumentParser(Document* document) 34 : m_ state(ParsingState)34 : m_parserStopped(false) 35 35 , m_document(document) 36 36 { … … 46 46 } 47 47 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 64 48 void DocumentParser::detach() 65 49 { 66 m_state = DetachedState;67 50 m_document = 0; 68 51 } -
trunk/WebCore/dom/DocumentParser.h
r66649 r66660 58 58 // FIXME: processingData() is only used by DocumentLoader::isLoadingInAPISense 59 59 // and is very unclear as to what it actually means. The LegacyHTMLDocumentParser 60 // used to implement it.60 // used to implements it. 61 61 virtual bool processingData() const { return false; } 62 62 63 63 // document() will return 0 after detach() is called. 64 64 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; } 83 66 84 67 // Document is expected to detach the parser before releasing its ref. … … 89 72 virtual void detach(); 90 73 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 91 80 protected: 92 81 DocumentParser(Document*); 93 82 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 94 89 private: 95 enum ParserState {96 ParsingState,97 StoppingState,98 StoppedState,99 DetachedState100 };101 ParserState m_state;102 103 90 // Every DocumentParser needs a pointer back to the document. 104 91 // m_document will be 0 after the parser is stopped. -
trunk/WebCore/dom/RawDataDocumentParser.h
r66649 r66660 40 40 virtual void finish() 41 41 { 42 if (! isStopped())42 if (!m_parserStopped && !isDetached()) 43 43 document()->finishedParsing(); 44 44 } -
trunk/WebCore/dom/XMLDocumentParser.cpp
r66649 r66660 133 133 m_originalSourceForTransform += parseString; 134 134 135 if (is Stopped()|| m_sawXSLTransform)135 if (isDetached() || m_parserStopped || m_sawXSLTransform) 136 136 return; 137 137 … … 191 191 void XMLDocumentParser::exitText() 192 192 { 193 if ( isStopped())193 if (m_parserStopped) 194 194 return; 195 195 -
trunk/WebCore/dom/XMLDocumentParserLibxml2.cpp
r66649 r66660 661 661 // JavaScript (which may be run under the xmlParseChunk callstack) may 662 662 // cause the parser to be stopped or detached. 663 if (is Stopped())663 if (isDetached() || m_parserStopped) 664 664 return; 665 665 } … … 734 734 const xmlChar** libxmlNamespaces, int nb_attributes, int nb_defaulted, const xmlChar** libxmlAttributes) 735 735 { 736 if ( isStopped())736 if (m_parserStopped) 737 737 return; 738 738 … … 823 823 void XMLDocumentParser::endElementNs() 824 824 { 825 if ( isStopped())825 if (m_parserStopped) 826 826 return; 827 827 … … 907 907 void XMLDocumentParser::characters(const xmlChar* s, int len) 908 908 { 909 if ( isStopped())909 if (m_parserStopped) 910 910 return; 911 911 … … 922 922 void XMLDocumentParser::error(ErrorType type, const char* message, va_list args) 923 923 { 924 if ( isStopped())924 if (m_parserStopped) 925 925 return; 926 926 … … 946 946 void XMLDocumentParser::processingInstruction(const xmlChar* target, const xmlChar* data) 947 947 { 948 if ( isStopped())948 if (m_parserStopped) 949 949 return; 950 950 … … 980 980 void XMLDocumentParser::cdataBlock(const xmlChar* s, int len) 981 981 { 982 if ( isStopped())982 if (m_parserStopped) 983 983 return; 984 984 … … 998 998 void XMLDocumentParser::comment(const xmlChar* s) 999 999 { 1000 if ( isStopped())1000 if (m_parserStopped) 1001 1001 return; 1002 1002 … … 1035 1035 void XMLDocumentParser::internalSubset(const xmlChar* name, const xmlChar* externalID, const xmlChar* systemID) 1036 1036 { 1037 if ( isStopped())1037 if (m_parserStopped) 1038 1038 return; 1039 1039 … … 1295 1295 sax.entityDecl = xmlSAX2EntityDecl; 1296 1296 sax.initialized = XML_SAX2_MAGIC; 1297 DocumentParser::startParsing();1297 m_parserStopped = false; 1298 1298 m_sawError = false; 1299 1299 m_sawXSLTransform = false; … … 1319 1319 document()->styleSelectorChanged(RecalcStyleImmediately); 1320 1320 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) 1326 1326 return; 1327 1327 -
trunk/WebCore/dom/XMLDocumentParserQt.cpp
r66649 r66660 200 200 void XMLDocumentParser::initializeParserContext(const char*) 201 201 { 202 DocumentParser::stopParsing();202 m_parserStopped = false; 203 203 m_sawError = false; 204 204 m_sawXSLTransform = false; … … 214 214 document()->styleSelectorChanged(RecalcStyleImmediately); 215 215 document()->setParsing(true); 216 DocumentParser::startParsing();216 m_parserStopped = true; 217 217 } 218 218 #endif … … 351 351 void XMLDocumentParser::parse() 352 352 { 353 while (! isStopped()&& !m_parserPaused && !m_stream.atEnd()) {353 while (!m_parserStopped && !m_parserPaused && !m_stream.atEnd()) { 354 354 m_stream.readNext(); 355 355 switch (m_stream.tokenType()) { -
trunk/WebCore/html/parser/HTMLDocumentParser.cpp
r66649 r66660 143 143 } 144 144 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-end147 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 167 145 bool HTMLDocumentParser::processingData() const 168 146 { … … 172 150 void HTMLDocumentParser::pumpTokenizerIfPossible(SynchronousMode mode) 173 151 { 174 if ( isStopped()|| m_treeBuilder->isPaused())152 if (m_parserStopped || m_treeBuilder->isPaused()) 175 153 return; 176 154 … … 216 194 void HTMLDocumentParser::pumpTokenizer(SynchronousMode mode) 217 195 { 218 ASSERT(!isStopped()); 196 ASSERT(!isDetached()); 197 ASSERT(!m_parserStopped); 219 198 ASSERT(!m_treeBuilder->isPaused()); 220 199 ASSERT(!isScheduledForResume()); … … 236 215 237 216 // JavaScript may have stopped or detached the parser. 238 if (is Stopped())217 if (isDetached() || m_parserStopped) 239 218 return; 240 219 … … 248 227 249 228 // JavaScript may have stopped or detached the parser. 250 if (is Stopped())229 if (isDetached() || m_parserStopped) 251 230 return; 252 231 … … 297 276 void HTMLDocumentParser::insert(const SegmentedString& source) 298 277 { 299 if ( isStopped())278 if (m_parserStopped) 300 279 return; 301 280 … … 318 297 void HTMLDocumentParser::append(const SegmentedString& source) 319 298 { 320 if ( isStopped())299 if (m_parserStopped) 321 300 return; 322 301 … … 350 329 ASSERT(!isScheduledForResume()); 351 330 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 352 339 // Informs the the rest of WebCore that parsing is really finished (and deletes this). 353 340 m_treeBuilder->finished(); … … 363 350 return; 364 351 } 365 prepareToStopParsing();352 end(); 366 353 } 367 354 … … 376 363 377 364 m_endWasDelayed = false; 378 prepareToStopParsing();365 end(); 379 366 } 380 367 … … 461 448 void HTMLDocumentParser::notifyFinished(CachedResource* cachedResource) 462 449 { 463 if (isStopping()) {464 prepareToStopParsing();465 return;466 }467 468 450 // pumpTokenizer can cause this parser to be detached from the Document, 469 451 // but we need to ensure it isn't deleted yet. -
trunk/WebCore/html/parser/HTMLDocumentParser.h
r66649 r66660 82 82 virtual bool finishWasCalled(); 83 83 virtual bool processingData() const; 84 virtual void prepareToStopParsing();85 84 virtual void stopParsing(); 86 85 virtual bool isWaitingForScripts() const; -
trunk/WebCore/html/parser/HTMLScriptRunner.cpp
r66649 r66660 76 76 if (m_parsingBlockingScript.cachedScript() && m_parsingBlockingScript.watchingForLoad()) 77 77 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 }84 78 } 85 79 … … 136 130 ASSERT(isPendingScriptReady(m_parsingBlockingScript)); 137 131 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 138 136 InsertionPointRecord insertionPointRecord(m_host->inputStream()); 139 137 executePendingScriptAndDispatchEvent(m_parsingBlockingScript); … … 144 142 bool errorOccurred = false; 145 143 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);150 144 151 145 // Clear the pending script before possible rentrancy from executeScript() … … 245 239 } 246 240 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 265 241 void HTMLScriptRunner::requestParsingBlockingScript(Element* element) 266 242 { … … 277 253 } 278 254 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 289 255 bool HTMLScriptRunner::requestPendingScript(PendingScript& pendingScript, Element* script) const 290 256 { … … 322 288 323 289 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); 329 292 } else { 330 293 // FIXME: We do not block inline <script> tags on stylesheets to match the -
trunk/WebCore/html/parser/HTMLScriptRunner.h
r66649 r66660 28 28 29 29 #include "PendingScript.h" 30 #include <wtf/Deque.h>31 30 #include <wtf/Noncopyable.h> 32 31 #include <wtf/PassRefPtr.h> … … 58 57 bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; } 59 58 bool executeScriptsWaitingForStylesheets(); 60 bool executeScriptsWaitingForParsing();61 59 62 60 bool isExecutingScript() const { return !!m_scriptNestingLevel; } … … 74 72 75 73 void requestParsingBlockingScript(Element*); 76 void requestDeferredScript(Element*);77 74 bool requestPendingScript(PendingScript&, Element*) const; 78 75 … … 88 85 HTMLScriptRunnerHost* m_host; 89 86 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-parsing91 87 unsigned m_scriptNestingLevel; 92 88 -
trunk/WebCore/loader/ImageDocument.cpp
r66649 r66660 139 139 void ImageDocumentParser::finish() 140 140 { 141 if (! isStopped()&& document()->imageElement()) {141 if (!m_parserStopped && document()->imageElement()) { 142 142 CachedImage* cachedImage = document()->cachedImage(); 143 143 RefPtr<SharedBuffer> data = document()->frame()->loader()->documentLoader()->mainResourceData();
Note: See TracChangeset
for help on using the changeset viewer.