diff options
Diffstat (limited to 'WebCore/html/HTMLScriptRunner.cpp')
-rw-r--r-- | WebCore/html/HTMLScriptRunner.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/WebCore/html/HTMLScriptRunner.cpp b/WebCore/html/HTMLScriptRunner.cpp index 0d603ed..6d470a0 100644 --- a/WebCore/html/HTMLScriptRunner.cpp +++ b/WebCore/html/HTMLScriptRunner.cpp @@ -77,6 +77,11 @@ HTMLScriptRunner::~HTMLScriptRunner() stopWatchingForLoad(m_parsingBlockingScript); } +void HTMLScriptRunner::detach() +{ + m_document = 0; +} + static KURL documentURLForScriptExecution(Document* document) { if (!document || !document->frame()) @@ -119,6 +124,7 @@ bool HTMLScriptRunner::isPendingScriptReady(const PendingScript& script) void HTMLScriptRunner::executeParsingBlockingScript() { + ASSERT(m_document); ASSERT(!m_scriptNestingLevel); ASSERT(m_document->haveStylesheetsLoaded()); ASSERT(isPendingScriptReady(m_parsingBlockingScript)); @@ -152,6 +158,7 @@ void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendi void HTMLScriptRunner::executeScript(Element* element, const ScriptSourceCode& sourceCode) const { + ASSERT(m_document); ScriptElement* scriptElement = toScriptElement(element); ASSERT(scriptElement); if (!scriptElement->shouldExecuteAsJavaScript()) @@ -222,6 +229,7 @@ bool HTMLScriptRunner::executeScriptsWaitingForLoad(CachedResource* cachedScript bool HTMLScriptRunner::executeScriptsWaitingForStylesheets() { + ASSERT(m_document); // Callers should check hasScriptsWaitingForStylesheets() before calling // to prevent parser or script re-entry during </style> parsing. ASSERT(hasScriptsWaitingForStylesheets()); @@ -269,6 +277,7 @@ bool HTMLScriptRunner::requestPendingScript(PendingScript& pendingScript, Elemen // http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#running-a-script void HTMLScriptRunner::runScript(Element* script, int startingLineNumber) { + ASSERT(m_document); ASSERT(!haveParsingBlockingScript()); { InsertionPointRecord insertionPointRecord(m_host->inputStream()); |