Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3563)

Unified Diff: WebCore/html/parser/HTMLScriptRunner.cpp

Issue 3776004: Revert 66670 - 2010-09-01 Tony Gentilcore <tonyg@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/html/parser/HTMLScriptRunner.h ('k') | WebCore/loader/ImageDocument.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/html/parser/HTMLScriptRunner.cpp
===================================================================
--- WebCore/html/parser/HTMLScriptRunner.cpp (revision 69799)
+++ WebCore/html/parser/HTMLScriptRunner.cpp (working copy)
@@ -75,12 +75,6 @@
// FIXME: Should we be passed a "done loading/parsing" callback sooner than destruction?
if (m_parsingBlockingScript.cachedScript() && m_parsingBlockingScript.watchingForLoad())
stopWatchingForLoad(m_parsingBlockingScript);
-
- while (!m_scriptsToExecuteAfterParsing.isEmpty()) {
- PendingScript pendingScript = m_scriptsToExecuteAfterParsing.takeFirst();
- if (pendingScript.cachedScript() && pendingScript.watchingForLoad())
- stopWatchingForLoad(pendingScript);
- }
}
void HTMLScriptRunner::detach()
@@ -135,6 +129,10 @@
ASSERT(m_document->haveStylesheetsLoaded());
ASSERT(isPendingScriptReady(m_parsingBlockingScript));
+ // Stop watching loads before executeScript to prevent recursion if the script reloads itself.
+ if (m_parsingBlockingScript.cachedScript() && m_parsingBlockingScript.watchingForLoad())
+ stopWatchingForLoad(m_parsingBlockingScript);
+
InsertionPointRecord insertionPointRecord(m_host->inputStream());
executePendingScriptAndDispatchEvent(m_parsingBlockingScript);
}
@@ -144,10 +142,6 @@
bool errorOccurred = false;
ScriptSourceCode sourceCode = sourceFromPendingScript(pendingScript, errorOccurred);
- // Stop watching loads before executeScript to prevent recursion if the script reloads itself.
- if (pendingScript.cachedScript() && pendingScript.watchingForLoad())
- stopWatchingForLoad(pendingScript);
-
// Clear the pending script before possible rentrancy from executeScript()
RefPtr<Element> scriptElement = pendingScript.releaseElementAndClear();
{
@@ -244,24 +238,6 @@
return executeParsingBlockingScripts();
}
-bool HTMLScriptRunner::executeScriptsWaitingForParsing()
-{
- while (!m_scriptsToExecuteAfterParsing.isEmpty()) {
- ASSERT(!m_scriptNestingLevel);
- ASSERT(!haveParsingBlockingScript());
- ASSERT(m_scriptsToExecuteAfterParsing.first().cachedScript());
- if (!m_scriptsToExecuteAfterParsing.first().cachedScript()->isLoaded()) {
- watchForLoad(m_scriptsToExecuteAfterParsing.first());
- return false;
- }
- PendingScript first = m_scriptsToExecuteAfterParsing.takeFirst();
- executePendingScriptAndDispatchEvent(first);
- if (!m_document)
- return false;
- }
- return true;
-}
-
void HTMLScriptRunner::requestParsingBlockingScript(Element* element)
{
if (!requestPendingScript(m_parsingBlockingScript, element))
@@ -276,16 +252,6 @@
watchForLoad(m_parsingBlockingScript);
}
-void HTMLScriptRunner::requestDeferredScript(Element* element)
-{
- PendingScript pendingScript;
- if (!requestPendingScript(pendingScript, element))
- return;
-
- ASSERT(pendingScript.cachedScript());
- m_scriptsToExecuteAfterParsing.append(pendingScript);
-}
-
bool HTMLScriptRunner::requestPendingScript(PendingScript& pendingScript, Element* script) const
{
ASSERT(!pendingScript.element());
@@ -321,11 +287,8 @@
notImplemented(); // event for support
if (script->hasAttribute(srcAttr)) {
- // FIXME: Handle async.
- if (script->hasAttribute(deferAttr))
- requestDeferredScript(script);
- else
- requestParsingBlockingScript(script);
+ // FIXME: Handle defer and async
+ requestParsingBlockingScript(script);
} else {
// FIXME: We do not block inline <script> tags on stylesheets to match the
// old parser for now. When we do, the ASSERT below should be added.
« no previous file with comments | « WebCore/html/parser/HTMLScriptRunner.h ('k') | WebCore/loader/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698